[SOLVED] Cant get an event to harm my player

Hi!

I'd like to know what is wrong with this event? I want it to cause harm to the player once he touches this 'Fire'. When I touch it, it doesn't do anything to the HP

What am I doing wrong? What has to be done?


Here's a Screenshot:


1609019799510.png

PS: I've also tried with 'Player Touch' Trigger.
1) Try changing the Change HP command to Entire Party instead.

2) Make sure that the FIRE 1 Switch is actually on. Btw. does this really need to be on a switch?

EDIT: Ok, I just noticed... either turn off Through or change the Priority of the event to either Above or Below characters.
1) Try changing the Change HP command to Entire Party instead.

2) Make sure that the FIRE 1 Switch is actually on. Btw. does this really need to be on a switch?

EDIT: Ok, I just noticed... either turn off Through or change the Priority of the event to either Above or Below characters.

Yup, because the fire starts after a specific event occurs.

I switched it to Above Characters and now it works! But... is there a way of making the character lose HP as long as he stays there? Because the damage is done only once, and in order to make him lose HP again it would have to go off and on again.
You would have to create a second event page, conditioned by self switch A.

On page 1, turn on self switch A after the damage is done.

On the second page, set it to parallel process. In the event commands, do this:
Code:
Wait 60 frames (60 frames is 1 second, so adjust to your preferred delay between 'hits'
If: Script: $gamePlayer.x !== this.character(0).x || $gamePlayer.y !== this.character(0).y
  Control Self Switches A = OFF
Else
  Change HP
End

So this will continue dealing damage every second while the player remains on the event, but when they move away, the event will switch back to the first 'event touch' page.

Because your event isn't moving, you could also change the trigger to Player Touch. Event Touch is more for moving events that might walk into the player, but in your case, the player will always make the contact.

You might also consider doing an SE and animation or screen flash to let them know they're taking damage. Otherwise they won't have any way to see, unless you have some kind of on-map HUD that shows their HP.

Do you only have one party member? If not, should the damage be to the entire party rather than just one character?
Yup, because the fire starts after a specific event occurs.

I switched it to Above Characters and now it works! But... is there a way of making the character lose HP as long as he stays there? Because the damage is done only once, and in order to make him lose HP again it would have to go off and on again.

You would have to redo it as a Parallel event that checks the coordinates of both the player and the fire and also add a Wait X frames command at the end to ensure the damage isn't inflicted insanely fast.
You would have to redo it as a Parallel event that checks the coordinates of both the player and the fire and also add a Wait X frames command at the end to ensure the damage isn't inflicted insanely fast.
i think shaz approach is more fps friendly instead converting it as parallel event from the start that always active...

shaz approach:
page 1 is normal event
page 2 is parallel event
and page 2 only activate when player step on the fire and deactivate when player leave the fire...

especially if more than one fire in that map... the fps will be bad with lots of parallel process running at the same time.
THANK ALL OF YOU! THANKS A LOT!
If you got it working, please report your first post and let us know, so the thread can be closed.
i think shaz approach is more fps friendly instead converting it as parallel event from the start that always active...

shaz approach:
page 1 is normal event
page 2 is parallel event
and page 2 only activate when player step on the fire and deactivate when player leave the fire...

especially if more than one fire in that map... the fps will be bad with lots of parallel process running at the same time.

Well, while that is true, it's not that simple:

1) You don't need a separate Parallel event for each fire, it can just be one parallel event that compares the location of the player with the Region Id of the fire tiles/locations of the fire tiles or something similar.

2) The Self-switch approach is fine if you have like 5 fire events, but if you have any more, it makes it much harder to go back and change something if you need to.

3) Making 1 Parallel event that governs all fires is much better in the long run, in case you need to change something. Instead of having to redo all the fire events on the map (which could easily be like 50), you can just change that 1 event. I can't think of a way to do this with the Self-switch way at this exact moment.

I'm speaking from experience, but the Self-switch approach is fine too.
The beauty of my method is that there's only one parallel event active, and only when it needs to be. But you're right, your method would work too, and having the wait in there is good as it also avoids lag.

With your method, a simpler way to do it would be (assuming the fire events don't move, which in this case is true) to use a region tile and paint over the map where the fire events are with that region tile. Then in the parallel process event, get the player's X and Y locations into variables and use the Get Location Info to get the region id the player is standing on into another variable. This means you're only doing one comparison that will cover all the events, rather than comparing the player's location with each event individually. MZ makes this nicer as you don't even need to use variables for the X and Y locations.

OP, as you have marked your thread title as [SOLVED] I will close this, but next time please report your first post and say it's solved, so we can take care of it.

Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/solved-cant-get-an-event-to-harm-my-player.131448/