Ao no Kiseki Battle System Turn Length

Hello! 🙂

I'm wondering if anyone could help me out with making a change to Saba Kan's Ao no Kiseki Battle System (The core script, most likely). As it is, the script causes a turn to pass after every action, which messes with states and turn based events. Could someone please help me add in a more consistant turn counter (either after every participant in battle has made an action, or after a certain amount of time)

Thank you!
Hey there,

Just to clarify, if I understood the script correctly it should work like this:
- Turns for battle events pass between each action
- Turns for states update each time their wearer takes a turn (either to choose a new action or to execute a charged action)
- Turns for enemy actions are updated each time the enemy attempts an action (so enemies should always follow their pattern)

If this doesn't apply, especially if states are updated between each action, there might be a complication with another script at work, in which case I'd like to ask which scripts you are using of course.

If it works as it's supposed to but you don't like it, should the new turn timer include all the items above or just battle events and states? Is there one of the solutions you stated that you'd prefer? Does "certain amount of time" mean a certain amount of total skill delay or something else? Or is there something specific you want to achieve where the current solution just causes problems?


Can't really promise a timely solution right now, but if no one else is faster I'll see what I can do. 🙂
Hey! Thanks for taking on my request. 🙂

As it stands, turns work in the following way...
-turns for battle events pass after every action
-turns for states ALSO pass after every action
-turns for enemy actions pass each time they act

Ideally, I'd love for the battle event turns to happen once every actor/enemy has had a turn, and for status turns to pass after each of that target's turns. (For example, I have Eric use guard. His guard state goes away instantly when his turn ends. I tried setting the guard to 2 turns instead, but then it just ends when the next person in line ends their turn. I'd ideally have his guard last until he gets to his next turn). The way enemies work is fine as is.

As for scripts, I tested this in a project with only the Kiseki scripts, Battle Symphony, and the Enemy Sprite + Fix from the other request.
Uh, could you upload a test project maybe? (If that isn't a problem)
I too tried to test this by adding the Battle Symphony scripts to the Ao No Kiseki demo project (from the link in your opening post), and I can't find a possible cause for the state / enemy appearence issues you described.

For reference, this is the project I used (the system folder is missing to reduce the file size):
For testing purposes, the guard state has a visible icon and the bats "Uncancellable Skill" revives all enemies that were dead when the cast started.
Hey, thanks for putting a demo together to test out. It actually proved to be incredibly useful.

Pretty much, I tried to replicate the demo in my project (made a back up, deleted all other scripts, etc.), and was still having issues. Eventually, I noticed something though, the lines in my copies didn't match the ones you had in the demo.

Turns out wherever I got one of the scripts from had made some edits, and was causing the issues. I feel a bit silly having gone this far without realizing this, sorry for the wasted effort. :/

But I'm happy to say that this has fixed the error with states updating after every action, and the error with sprites not re-appearing after being revived! 🙏

In that case, my script request has been greatly simplified. The only other thing I was hoping to change is how battle event turns are counted (changed from after every action to once after everyone's had an action).
Ooof, one week... Sorry for the late response 🙁

Anyway, I was going to suggest that you could give everyone a 1-turn-state and check every turn if every instance has expired in order to check whether all battlers have acted.
Only problem would be that because of the ordering, the last state would expire right before that battler would act.

Anyway, I tried to make a script version too. Unfortunately it has become a bit more lengthy than anticipated, but it should work: 🙂
Spoiler
Code:
class << BattleManager
 
  #--------------------------------------------------------------------------
  # BattleManager.turn_start  (Modified)
  #   Only increase troop turn if all battlers had their turns processed
  #--------------------------------------------------------------------------
  def turn_start
    @phase = :turn
    clear_actor
    if round_finished?
      start_new_round
      $game_troop.increase_turn
    end
    make_action_orders
  end
 
  #--------------------------------------------------------------------------
  # BattleManager.round_finished?
  #   Check if BattleManager is ready to advance to the next troop turn
  #--------------------------------------------------------------------------
  def round_finished?
    battlers = $game_party.members + $game_troop.members
    return battlers.none? { |battler| battler.wait_for_turn? }
  end
 
  #--------------------------------------------------------------------------
  # BattleManager.start_new_round
  #   Reset progress towards the next troop turn
  #--------------------------------------------------------------------------
  def start_new_round
    battlers = $game_party.members + $game_troop.members
    return battlers.each { |battler| battler.reset_turn_progress }
  end  
end


class Scene_Battle
 
  #--------------------------------------------------------------------------
  # Scene_Battle#turn_start  (Modified)
  #   Mark selected battler as processed
  #--------------------------------------------------------------------------
  alias_method(:turn_start_ILC_processBattlerTurn, :turn_start)
  def turn_start
    turn_start_ILC_processBattlerTurn
    OrderManager.top_unit.battler.set_turn_progress
  end
end


class Game_Battler
 
  #--------------------------------------------------------------------------
  # Game_Battler#wait_for_turn?
  #   Check if the battler is ready to advance to the next troop turn
  #--------------------------------------------------------------------------
  def wait_for_turn?
    alive? && !@turn_processed
  end
 
  #--------------------------------------------------------------------------
  # Game_Battler#set_turn_progress
  #   Set personal progress towards the next troop turn
  #--------------------------------------------------------------------------
  def set_turn_progress
    @turn_processed = true
  end
 
  #--------------------------------------------------------------------------
  # Game_Battler#reset_turn_progress
  #   Reset personal progress towards the next troop turn
  #--------------------------------------------------------------------------
  def reset_turn_progress
    @turn_processed = false  if alive?
  end
 
  #--------------------------------------------------------------------------
  # Game_Battler#on_battle_start  (Modified)
  #--------------------------------------------------------------------------
  alias_method(:on_battle_start_ILC_turnProgress, :on_battle_start)
  def on_battle_start
    on_battle_start_ILC_turnProgress
    @turn_processed = true
  end
end


class Game_Troop
 
  #--------------------------------------------------------------------------
  # Game_Troop#conditions_met?  (Modified)
  #   End of Turn is only met when the BattleManager is ready to advance
  #--------------------------------------------------------------------------
  alias_method(:conditions_met_ILC_turnProgress, :conditions_met?)
  def conditions_met?(page)
    return false if page.condition.turn_ending && !BattleManager.round_finished?
    conditions_met_ILC_turnProgress(page)
  end
end
I wasn't quite sure how to handle deaths though, as it stands right now if a battler dies that has not yet acted this turn, the turn checker will only wait for their action if you revive that battler before everyone else has acted.
Seems to do the trick great, thanks a bunch! 👋

Original thread: https://forums.rpgmakerweb.com/threads/ao-no-kiseki-battle-system-turn-length.96613/