monster variable change on death

● ARCHIVED · READ-ONLY
Started by Nanaki_Fan 13 posts View original ↗
  1. Hi guys,

    so I have a variable that controlls an NPC to give a player a reward if it reaches 4.

    I set up events "rat", four of them, in a dungeon and added a +1 to the variable via the troop command window.

    so in theory the variable should increase by one each time I battle them/kill them (one enemy per event, there is only one rat in my troop)

    but the NPC didnt move to the next event page (which I had set to be triggered if the variable is 4 or more).

    have i done something wrong?
  2. The best way I could help is if I saw screenshots of the two events (the npc and rats)
  3. For this to work, you'd need to set the Rats to be Immortal.  Then you would have an event page in the Troop.  When a rat reached at or below 0%, increment the variable and remove the Immortal state, allowing the rat to die.

    So you'd have to treat the rats like very tiny bosses, in that most boss characters do something special when they die.  Using the "Immortal" state (which is merely "State Resist: Death") allows the Troop running the fight to do something special when the enemy dies. Then, removing that state, allows the death to proceed normally.
  4. cthulhusquid said:
    The best way I could help is if I saw screenshots of the two events (the npc and rats)
    I have attached screenshots (see below)

    whitesphere said:
    For this to work, you'd need to set the Rats to be Immortal.  Then you would have an event page in the Troop.  When a rat reached at or below 0%, increment the variable and remove the Immortal state, allowing the rat to die.

    So you'd have to treat the rats like very tiny bosses, in that most boss characters do something special when they die.  Using the "Immortal" state (which is merely "State Resist: Death") allows the Troop running the fight to do something special when the enemy dies. Then, removing that state, allows the death to proceed normally.
    how do I do this? I cannot seem immortal option?
  5. Nanaki_Fan said:
    I have attached screenshots (see below)

    how do I do this? I cannot seem immortal option?
    Press F9 and look under "States".  State #11 is the "Immortal" state.

    In the rat's Troop page, set Turn 0 + 0 to "Add State" "Immortal" to all of the enemy.
  6. You found the troop event on last enemy killed bug. Troop events don't trigger off the last enemy to die.

    Go get the fix on Hime's site, adn drop it in your script editor.
  7. Zoltor said:
    You found the troop event on last enemy killed bug. Troop events don't trigger off the last enemy to die.

    Go get the fix on Hime's site, adn drop it in your script editor.
    what bug? fix? didnt realise this was a problem! Gonna go google Hime and see what this is about. Thanks for the heads up.
  8. Nanaki_Fan said:
    what bug? fix? didnt realise this was a problem! Gonna go google Hime and see what this is about. Thanks for the heads up.
    Yea, evidently the developers of RPG Maker didn't catch that bug.

    I think this is the one: http://www.himeworks.com/2013/03/06/end-phase-triggers/

    Hime also has another script for post battle events, in your case I'm pretty sure they do the same thing. If this doesn't do the job though, go get the post battle event script.
  9. interesting stuff!

    However I managed to get it to work without the need of a script. I just added the resist death state then removed it.

     all good :D
  10. Nanaki_Fan said:
    interesting stuff!

    However I managed to get it to work without the need of a script. I just added the resist death state then removed it.

     all good :D

    Ok, so you resist death, then make it so when hp hits 0, variable+1, and the enemy is removed? Lol yep, that works too.
  11. Unfortunately, both Whitesphere and Zoltor are wrong about the reason for your problem.


    They assumed that you had one of the more often found bugs in the game (if an troop event is conditioned to enemy death, the battle will end before the event in case of the last enemy killed), but your problem is much simpler:


    You set your troop event to "don't run", which means "do never execute"...


    If you set your events to be executed on turn 0, then the variable will be increased per battle, no matter of win or escape


    If you set it to conditioning of last enemy killed, you'll either need very tricky eventing or the immortal state as a workaround.
  12. For what it's worth, I think Zoltar was correct.  Yes, what Andar said about "Don't Run" could also be a reason for it, but if the battle had exactly 4 rats and you only do the battle once, then the variable will never increment high enough without Hime's End Phase Triggers fix.
  13. All those suggestions (including your own solution) are much more complicated than they need to be.


    You ASSUME you have to wait for the rat to be killed (or reach 0 HP), and THEN increment the variable. That is a mistake. It doesn't matter whether the rat is killed before or after the variable is increased - it only matters that the variable is increased at some point during the battle.


    So increment it right at the start. If you win, the rat is dead and your variable has increased. If you lose, it's gameover and you have to go back to an earlier save, and the variable will still have its previous value.


    The only time this would not work is if you had checked the "Continue Even When Lose" box.


    Anyway, since you've got a solution you're happy with ...


    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.