End Phase Triggers

This script extends the troop event system with “end phase triggers”. This is simply a final check on all of the event pages when a victory/lose condition has been met. Any pages that can be run during this end phase will be executed and may change the outcome of the battle.

This script is completely plug-and-play and requires no additional setup.

endphase_trigger

Download

Script: download here

Usage

Plug and play. Just set up your events as usual.

Tutorials

If you would like ideas on how to use the script, here are some tutorials written by other developers that I would recommend reading:

 

You may also like...

33 Responses

  1. Theo James says:

    I have now the script but I don’t know how to use it…I will make an event, that says: if all enemies are dead than the game will end. Hope someone can help me…

  2. kevin eontrainer says:

    My game seems to ignore the $game_troop.all_dead conditional branch…
    Is there any way to fix this? I want the event to run after all enemies have been defeated…

    • Hime says:

      If your page condition is “don’t run” then it won’t run. You may need custom page conditions in order to implement that if the page has a condition that prevents it from running.

      • pathos says:

        I stuck in the “custom page conditions” script, but the $game_troop.all_dead? still isn’t triggering anything.
        I’m just supposed to make it say:
        Comment: /
        Conditional Branch: $game_troop.all_dead? /
        End Branch /
        Thing I want to happen

        Right?

      • pathos says:

        (That’s supposed to say “page condition” after the Comment, it got deleted somehow)

        • Hime says:

          It should work if you just write

          <page condition> 
          

          in a comment. I’m assuming that is what you wrote.
          You should check if end phase triggers works when a specific enemy dies, to verify that the script is working in the first place.

  3. confused says:

    is there a version of this that works with MV?

  4. Chris says:

    I can't download the script. Is there another link?

  5. aegixdrakan says:

    Found a weird bug…

    I have a battle event page that triggers at the end of every turn (it uses a lot of Force Actions to make turrets fire automatically, buffs go off automatically, etc).

    If the last enemy dies during this end-of-turn page event (usually during one of these force action attacks), then the framerate will drop considerably, and the battle will never end.

    I tried running the same test with your script removed, and the bug didn't happen.

    I'd rather not remove the script since I rely on it for one really clever "last chance revival" kind of skill. :s

    Do you know how I might fix this problem?

    • aegixdrakan says:

      If there is no easy fix for it, can you tell me how to disable this script on victory only, since the only time I'm using it is for when the party is wiped?

    • Hime says:

      I'd have to see your set up, since I used a force action on turn 1 to kill all enemies and my end of turn event runs as usual.

      • aegixdrakan says:

        Huh. When I put it into a blank project, it works fine.

        ….Must be something in my (many) other scripts that's making it blow up. Oh well…Had to happen sometime with so many scripts in one project..

        Can you tell me how to disable the script from kicking in when it's a victory condition?

        • Hime says:

          Delete the lines

          elsif $game_troop.all_dead?
                  return @end_phase = :win
          
          • aegixdrakan says:

            …Doens't work, apparently the sideview battle system I'm using doesn't like it. 🙁 If I end the battle normally now, it crashes due to a problem with that script, and if I finish during that end-loop, I go to the next turn and can select attacks even though there are no enemies…

            Oh well. I guess I can't include this script in this project.

            🙂 But thank you for your help, Hime. Sorry for bothering you.

    • Bobstah says:

      I had the same issue. What I did to fix it was change the process_forced_action around line 120 to:
      process_forced_action unless BattleManager.process_win_loss

      This did the trick for me, and seems to work fine with everything else I had scripted.

      Hope this helps!

  6. 1jim3bob says:

    I did exactly as this and it still didnt work

  7. Brandon says:

    Are you supposed to make the second enemy appear halfway?

  1. April 28, 2014

    […] you’re willing to use a script, Hime has a script for you. But what if you […]

  2. September 8, 2015

    […] we need to do is to copy the script from Hime’s website, open the script editor (F11) and insert it under the ▼ Materials section and above the ▼ […]

Leave a Reply

Your email address will not be published. Required fields are marked *