Open door event based on enemy hp

● ARCHIVED · READ-ONLY
Started by manck 15 posts View original ↗
  1. 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
  2. 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.
  3. lordosthyvel said:
    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 ?
  4. lordosthyvel said:
    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 =
  5. lordosthyvel said:
    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
  6. manck said:
    I added ===0 to the end of the snippet and it works. Thanks

    Great! :)
  7. lordosthyvel said:
    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?
  8. manck said:
    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?
  9. lordosthyvel said:
    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
  10. manck said:
    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.
  11. lordosthyvel said:
    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
  12. manck said:
    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"
  13. lordosthyvel said:
    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.
  14. lordosthyvel said:
    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!
  15. manck said:
    never mind, I put the summon enemy event on a new tab, and everything works. Thanks!

    Great! No problem :)