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.

Changing the order of battle processing

All i want to do is change the order battle is processed. it seems like enemys always heal one turn late(after adding some debug code to show hp). i think this is due to their choice being made before the player chooses theirs. im not sure about that. but either way it would be nice if i could make it so instead of the enemy healing one turn after they need it i could make it so they do it that turn. any info on how to change the order would be nice.

edit: im using XP
 

Atoa

Member

the problem isn't the order, but the fact that enemies actions are decided BEFERE the battle phase.
So, changing order woudn't help in that.

The only thing that might help you is to make the action selection just before the action. But for that, you would need to state what maker you're using and if you're using any custom system.
 
Sh*t my bad i totally screwed that up and ive been a member forever :( i use rpg maker xp. and im working on a AI script. but the only thing i have changed is The make_action method(Game_Enemy) and Game_BattleAction
 

Atoa

Member

well since XP don't have anything (by default) like the the skill.speed (wich decides the battler initiative when using the skill), putting the enemy.make_action method on the update_phase4_step2 of Scene_Battle would solve that, making them to decide their actions just before acting.

something like:
Code:
 

  alias update_phase4_step2_later update_phase4_step2

  def update_phase4_step2

    @active_battler.make_action if @active_battler.is_a?(Game_Enemy)

    update_phase4_step2_later

  end
 

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