End Phase Triggers

● ARCHIVED · READ-ONLY
Started by Tsukihime 20 posts View original ↗
  1. 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.


    event_endPhaseTriggers1.jpg


    Download


    Get it at Hime Works


    Usage


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


    Add-ons


    You can use extended event page conditions with this script. More information at


    http://www.rpgmakervxace.net/topic/4174-event-extend-page-conditions/


    Basically, by combining these two scripts, you can have arbitrary page conditions. Now you can really run an event when "all enemies are dead" by simply writing


    endphase_trigger.jpg
  2. Sweet! I've been using a workaround script to get this effect, but it was just an ugly hack so I could start balancing numbers.

    This looks like something I can build on :)
  3. Nice script, this will make things run a bit smoother for boss fights

    thanks for taking the time to put this together
  4. Mouser said:
    Sweet! I've been using a workaround script to get this effect, but it was just an ugly hack so I could start balancing numbers.

    This looks like something I can build on :)
    Maybe you can look into this issue:

    I've exposed the current end-phase which can be accessed using



    Code:
    BattleManager.end_phase
    It will return :win, :lose, or :abort

    The idea is that you can use the extended page condition to say



    Code:
    if BattleManager.end_phase == :win
       # do this
    Which will cause the event to always run when you win***

    Now the problem is it goes into an infinite loop because something is happening where the event runs...and then the battle manager checks the phase...and then the event runs again, and repeat.

    of course, if you just say



    Code:
    $game_troop.all_dead?
    That is logically equivalent (based on the default engine anyways), but if there are other ways to get a "victory" end phase then it'd be nice to fix the bug.

    I haven't found a solution, though that is because I haven't figured out where the problem is coming from. I guess you could always set a self-switch or something.

    ***well, when I say "always" that's only if the event actually gets to that page. If another page returns true then only that page will be run I think and nothing else...
  5. This is exactly what I've been looking for!

    EDIT: However, just as Tsuki said above, it goes into an infinite loop. I'll have to wait for this to be fixed, since i need an event to run once every enemy is defeated. Still good script so far, it has great potential.
  6. antega34 said:
    This is exactly what I've been looking for!

    EDIT: However, just as Tsuki said above, it goes into an infinite loop. I'll have to wait for this to be fixed, since i need an event to run once every enemy is defeated. Still good script so far, it has great potential.
    Just use the other script call I wrote which achieves the same effect under usual (default) conditions.
  7. You mean $game_troop.all_dead I've tried but kept getting a loop. Or do you mean something else? (if you could maybe show like in a screenshot that'd be easier, or if not I can probably figure it out)\
  8. Hmm it was working before guess it isn't working anymore.

    Will have to figure out how to deal with it.
  9. Ok. I'll try and figure something out, if it helps. maybe through conditions or variables.
  10. Bump, just in case someone knows how to fix the loop issue, since this script would be very beneficial to myself and others. (Are we allowed to bump other's topics btw?)
  11. I found the issue. It was in the extended page condition script that was not checking whether the event was already run or not (assuming battle/turn span). If you use "moment" it will just keep looping, which is also a bug but I haven't looked at the default conditions long enough to figure out which ones I need to check.

    I've updated that script.
  12. Good to know the script is progressing. Hopefully the bug isnt too big and timeconsuming for you.
  13. It was one line of code. I've already fixed the issue.
  14. Oh ya, it works perfectly now, thanks! I'll post any bugs I might find, but so far its good.
  15. I think it's worth noting, that, for me, at least, you run into compatability issues if, when you're using Battle Rules, that you put Battle Rules before End Phase Triggers. As in, end phase trigger doesn't work, period.
  16. Wow, this thread is pretty old.

    I can't get this script to function. Just like it's promoted, I want a new enemy to appear after the old one has been killed. So I have set the event condition in the battle to activate when the enemy's HP is 0 or less %, it's set for Span = Battle, I've marked then for the new enemy to appear, yet nothing happens. The victory sequence goes on normally. I even started a new project and pasted the script into it (just in case any other scripts in the other project were interfering) but the end-phase event doesn't trigger after my enemy is defeated.

    Also tried using the Custom Page Conditions script. That doesn't work either.

    If this thread's still alive, could somebody help me out?
  17. I created a new project, set slime HP to 0% or less, set demon king to appear halfway, then attacked the slime normally to kill it. When it died, the demon king appeared.
  18. Hi, I can't seem to get the $game_troop.all_dead? script to work at all.


    Here's my page.  No matter how much is there, I can't get $game_troop.all_dead? to trigger at all.

    script.png
  19. Your condition box say "Don't run".  I haven't used this script, but logically, if you tell it not to run, then it won't.