Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Change position of battlers

Hi, (again),
I decided to try and use faces for the battlers instead of the actual characters to see what it looks like. However, the faces are too low on the screen (see screenshot). I tried going into the scripting, but unfortunately I couldn't figure out how to change the sprite coordinates. I could find where the command was, but couldn't figure anything else out. Here is the piece of script (I think this is the right section)
Code:
    # Set sprite coordinates
    self.x = @battler.screen_x
    self.y = @battler.screen_y
    self.z = @battler.screen_z

what should i do with it? It is found in "Sprite_Battler".

Alternatively, one could centre the name above the image. this would also look ok. As well as that though, you could shrink the size of the bottom box (as in the one with the battlers and info in). This would actually be better, as i like the position of the eyes in the screenshot below.

http://i164.photobucket.com/albums/u9/reason2breathe/Screenshot.png[/IMG]

Please Reply ASAP

Cheers

Jonathan
 
I know i'm going to sound really stupid, and i am sorry about harping on about this, but i suck at scripting, and i still haven't a clue how to centre the names. I uess it is in this section, but i've tried editing various values and it seems to do nothing...
Code:
def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end

Also, for editing the window size, is that in the window_battlestatus sectuon as well or... like i said, i'm sorry for being so ridiculously awful at simple scripting, and thankyou very much for being so patient.

Thank you very much
Jonathan

P.S is it possible to make the money sign go before the value in the Gold window on the menu screen, i.e £45 instead of 45£?
 
Well, the simplest way would be to look in Window_Base, under this:
Code:
  #--------------------------------------------------------------------------
  # * Draw Name
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 120, 32, actor.name)
  end

Replace that with this:
Code:
  #--------------------------------------------------------------------------
  # * Draw Name
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 120, 32, actor.name, ($game_temp.in_battle ? 1 : 0))
  end

That will center the actors name in battle, but nowhere else.

To alter the size, you just need to look in Window_BattleStatus under def initialize
Code:
    super(0, 320, 640, 160)
That sets the x, y, width and height of the window. If you are doing it by size of the party, you can do something like:
Code:
width = $game_party.actors.size * 160
super(320 - width / 2, 320, width, 160)


As for switching the gold symbol, this is only for the Window_Gold class. If it occurs elsewhere, you will have to do it manually. Replace the refresh method in Window_Gold with this:
Code:
  def refresh
    self.contents.clear
    cx = contents.text_size($game_party.gold.to_s).width
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120-cx-2, 32, $data_system.words.gold, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(124-cx, 0, cx, 32, $game_party.gold.to_s, 2)
  end
 
The Centering works fantastically, and the gold. however, editing the height doesn't seem to do anything...

thankyou again for your help, and do you know what is wrong?
 
Editing the height of what? Are you trying to make the height of the battlestatus window smaller? That's this line right here:

Code:
width = $game_party.actors.size * 160
super(320 - width / 2, 320, width, 160)

Change that , 160 to , number_of_pixels you want the window to be. But you will also have to adjust your refresh method as well, or it will cut off your text. If that's not what you meant, ignore all this and explain what you are trying to adjust the height of.

Hehe. If you help hundreds of people with similar problems and have memorized probably 85% now of all of the default scripts (maybe more). I have them memorized more than my own scripts. ^_^ Just takes a lot of time and practice, and with enough detail, you can figure out any problem without even opening rmxp.
 
That is what I want, thanks. I don't know whether it works yet as i don't have RMXP at school (which is where i am atm) but it looks like it is what i want. If you look back at the screen shot there is a large gap between the name of the character and the top of the battlestatus window, so i just want to get rid of the gap. Is the refresh method section in battlestatus as well?

How long has it taken you to learn to program RGSS like you do?! ages i bet lol

EDIT: How do I edit the size for the reason I said just above? I don't want to edit the size for the number of characters in my party, as though it is a good idea, i don't think it is particularly needed in the game i am making. All i want is to cut out the gap above the actors name in the Battle_status window.

Thanks again (again... etc.)
Jonathan
 

Anonymous

Guest

will somebody please help me ....................... I have totally
forgot how to change RMXP battle system to look like the one on RM2k3
any help would be bril.......................
 
That gap is there because of the default margin windows have (16 pixels along all sides). You can change this by finding Selywn's Window class rewrite. Check the Script Listings (points at useful links in signature).

Another solution is there is an extra gap that is caused by the draw_actor_name method. By default, everything is spaced 32 pixels appart (command windows and such) when the font is I believe only 20-24 pixels (leaving 8-12 pixel gap between text). What you can do is alter your refresh method with this:

Code:
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, -4)
      draw_actor_hp(actor, actor_x, 20, 120)
      draw_actor_sp(actor, actor_x, 44, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 68, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 68)
      end
    end
  end

Everything is now more closer together, but it still looks ok. You can now change your window height and such and the words will not be cut off. Anyways, I suggest just tinkering with the values until you get something you like. Ask here if you need anything.

Off-topic : I started scripting 2 years ago in May 05, however, I didn't take it seriously until later in the fall, so I would say around a year and half. It's all the amount of time you put into it. With anything, practice practice practice.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top