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.

How do I change the x,y position of the battler image?

I use rpgmakerxp

For example I thought I could put $game_actors[001].x-=50, just to test but that didnt work
If it matters I put $game_actors[001].x-=50 in the troop ghost*2 battle event with the condition of turn 0 and the span is battle
thanks to anyone who helps :smile:
 
The Battle Scene uses the screen_x & screen_y methods from Game_Actor to set the battler positions.

In the default system, screen_y returns a constant (the battlers are all near the bottom of the screen), and screen_x returns a function of the actor's index in the party.

return self.index * 160 + 80

so, for actor 1 (index = 0), the battler is in the center of the 1st quarter of the screen. battler 2... in the 2nd quarter.

If you modify these methods, you can change the battler positions.

How do you want the battlers placed? It looks like you are trying to move actor 1 50 pixels to the left?

Be Well
 
I eventualy would like the battler's to change position based on the attack/spell that they use, so in the script of an attack I make, it would say the syntax correct version of this,

if self.index!=="however you indicate the enemy's x coordinate"
return self.index - 1

I believe that states -1 from battler's x and it would keep doing subtracting 1 until it equals the enemy's x
so that should make my battler move toward the enemy(assuming hes to the right of the enemy) until he is at the enemy, then I would like him to change to an attacking animation

Im sure this seems weird if you are imagining one of those huge battler sprites that take up half the screen but mine is a little guy who I want to stand across from the enemy

also I know there are scripts for battler movement and animation, but I have no clue what those are saying(other than the calling variables in the beggining) because I dont know ruby, I want to learn how to make a script like that myself and edit it to my liking

thank you for you help
 

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