monster variable change on death

Status
Not open for further replies.

Nanaki_Fan

Veteran
Veteran
Joined
Jul 15, 2014
Messages
501
Reaction score
159
First Language
English
Primarily Uses
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?
 

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
341
Reaction score
294
First Language
English
Primarily Uses
RMVXA
The best way I could help is if I saw screenshots of the two events (the npc and rats)
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
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.
 

Nanaki_Fan

Veteran
Veteran
Joined
Jul 15, 2014
Messages
501
Reaction score
159
First Language
English
Primarily Uses
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)

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?
 
Last edited by a moderator:

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
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.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
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.
 

Nanaki_Fan

Veteran
Veteran
Joined
Jul 15, 2014
Messages
501
Reaction score
159
First Language
English
Primarily Uses
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.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Nanaki_Fan

Veteran
Veteran
Joined
Jul 15, 2014
Messages
501
Reaction score
159
First Language
English
Primarily Uses
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
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top