Open door event based on enemy hp

I am using the ChronoEngine action battle system demo

https://mega.nz/#!SV5yGYBB!Y9CUZVHWbUtvcuxx2XgkYxser_LAQU0HlagKbM-Tq1A

I might be able to track enemy HP with script: $gameMap.event(x)._user.battler._hp
replace x with enemy's event's id

I have a door event,
I want to make the door open,
when a specific enemy hp is 0.
​
how can I do this?

any help is appreciated
Set the event to parallel process with a short wait at the end.
In the process you have a conditional branch to check if the hp is zero (add === 0 or <== 0 to the end of your snippet) .
If hp is zero flip a self switch that opens the door.
Set the event to parallel process with a short wait at the end.
In the process you have a conditional branch to check if the hp is zero (add === 0 or <== 0 to the end of your snippet) .
If hp is zero flip a self switch that opens the door.
thanks
I am new to RPG MAKER MV
where do I put the $gameMap.event(x)._user.battler._hp ?
Set the event to parallel process with a short wait at the end.
In the process you have a conditional branch to check if the hp is zero (add === 0 or <== 0 to the end of your snippet) .
If hp is zero flip a self switch that opens the door.
I got syntax error unexpected token =
Set the event to parallel process with a short wait at the end.
In the process you have a conditional branch to check if the hp is zero (add === 0 or <== 0 to the end of your snippet) .
If hp is zero flip a self switch that opens the door.
I added ===0 to the end of the snippet and it works. Thanks
I added ===0 to the end of the snippet and it works. Thanks

Great! 🙂
Great! 🙂
I want to increase variable by 1 every time a specific enemy loses hp. Do you happen to know the script to compare if enemy hp is lower than previous?
I want to increase variable by 1 every time a specific enemy loses hp. Do you happen to know the script to compare of enemy hp is lower than previous?

Why do you want to increase a variable by 1 every time an enemy loses hp?
Why do you want to increase a variable by 1 every time an enemy loses hp?
I am trying to create an enemy boss fight scene, whenever enemy boss loses hp, an enemy minion disappears
I am trying to create an enemy boss fight scene, whenever enemy boss loses hp, an enemy minion disappears

1. Decide how often this is allowed to happen (like every second for example)
2. Create a parallel process event. It will check if enemy hp is different than value in variable x. If it is, spawn enemy. Next make variable x equal to enemy hp. Finally wait the amount of time you decided in 1.
1. Decide how often this is allowed to happen (like every second for example)
2. Create a parallel process event. It will check if enemy hp is different than value in variable x. If it is, spawn enemy. Next make variable x equal to enemy hp. Finally wait the amount of time you decided in 1.


nothing seem to happen when I attack the enemy boss
I have screen shot of the event, is this right ?

upload_2018-9-3_0-34-14.png


event 7 is the enemy boss id
nothing seem to happen when I attack the enemy boss
I have screen shot of the event, is this right ?

View attachment 97570

event 7 is the enemy boss id

It looks like it should work if you change the branch condition. What you have put now is: "Do this if variable 3 is equal to variable 3".
You want to change it to "Do this if variable 3 is equal to $gameMap.event(7)._user.battler._hp".
OR better yet, remove the "else" part alltogether and make the if statement "Do this if variable 3 is NOT equal to $gameMap.event(7)._user.battler._hp"
It looks like it should work if you change the branch condition. What you have put now is: "Do this if variable 3 is equal to variable 3".
You want to change it to "Do this if variable 3 is equal to $gameMap.event(7)._user.battler._hp".
OR better yet, remove the "else" part alltogether and make the if statement "Do this if variable 3 is NOT equal to $gameMap.event(7)._user.battler._hp"
Thank you it works , but it would summon one enemy right away when I entered the map, even I am not doing any attack. After that everything works great.
It looks like it should work if you change the branch condition. What you have put now is: "Do this if variable 3 is equal to variable 3".
You want to change it to "Do this if variable 3 is equal to $gameMap.event(7)._user.battler._hp".
OR better yet, remove the "else" part alltogether and make the if statement "Do this if variable 3 is NOT equal to $gameMap.event(7)._user.battler._hp"
never mind, I put the summon enemy event on a new tab, and everything works. Thanks!
never mind, I put the summon enemy event on a new tab, and everything works. Thanks!

Great! No problem 🙂

Original thread: https://forums.rpgmakerweb.com/threads/open-door-event-based-on-enemy-hp.99536/