I Don't Know Why This Wasn't Working But It's Fixed Now

Ugh. I need some help with something with my game. Ok, so basically, in this game, unlike the original Legend of Spyro Spyro's enemies are an undead Lich army and Orcs instead of apes. They leave these nasty bear traps around to hurt Spyro and I programmed the bear traps so when you step on one you lose ten HP-at least that was supposed to happen. But for some reason after I step on a trap, I go to my character status page for all the characters and none of their HP is gone. Why is that? This is frustrating; what's the point of traps being around if when you step on them they don't even hurt you? Lame......
Could you post the event page?
Could you post the event page?
Ok I'll try. Just a minute......

Ok here you go. At least everything else about these bear traps is the way I want. They snap shut when you step on them, and make a bear trap snapping sound....now all I need is for them to hurt you properly. Now if only I could make them dangerous enough.

Bear Trap Event.png
For reference in future topics, screenshots of your events is pretty much the absolute bare minimum of what any of us would need to help you fix or troubleshoot anything. We can do literally nothing with "It doesn't work!"
Ok I'll try. Just a minute......

Ok here you go. At least everything else about these bear traps is the way I want. They snap shut when you step on them, and make a bear trap snapping sound....now all I need is for them to hurt you properly. Now if only I could make them dangerous enough.

View attachment 274526
Just the code itself looks ok so we'll need to see the rest of the page.
Just the code itself looks ok so we'll need to see the rest of the page.
Ok hang on just a minute.....also Guardintheena made the bear trap sprites (thank God). Also yeah one other thing this map is of an abandoned town Spyro and Sparx the dragonfly are living in that was half-destroyed by the Orcs.

image_2023-08-25_164338955.png
It looks like each of then is its own event. Did you verify the one you are testing has the right code?
It looks like each of then is its own event. Did you verify the one you are testing has the right code?
Ok, what happens is it basically acts like a switch, so every time I step on a trap, it switches to the "closed" position and you can never activate it again. It's supposed to be set up so that every time I step on one while it's still open, it injures me by taking away 10 HP. Also I didn't make a bunch of separate events; for each trap, I just take the one that's set up in front of the town mayor's house that Spyro and Sparx are hanging out in, and duplicate it. Also like a real bear trap once one of them is snapped shut it can't hurt you anymore because the teeth are no longer exposed. Basically the way I set them up is by creating a standard treasure chest animation thing which you can generate on the fly from RPG Maker, and then changed it so the sprites were a bear trap instead. And of course got rid of the line saying you got treasure.
I didn't make a bunch of separate events; for each trap, I just take the one that's set up in front of the town mayor's house that Spyro and Sparx are hanging out in, and duplicate it.
Is the first trap going off but the rest aren't? How are you duplicating it?
Is the first trap going off but the rest aren't? How are you duplicating it?
Ok. I set up one trap event, and then for every other trap event I want on the map, I clone it and put the copy of it somewhere else on the map. ALL the traps ARE going off but they are not subtracting 10 HP when I step on one like I intended; that's the problem here. Maybe I didn't make that clear. Sorry.

So yeah, other than the not hurting you part, all the traps are behaving exactly the way I want. Anyway, since each character has about 2000 HP in my party and the traps only take away 10 HP, they're not that dangerous, but still, they hurt. These Orcs are sadistic monsters!
What happens if you set the traps to "through"?
What happens if you set the traps to "through"?
They're not "through" until they're closed. Reason I had to do that was because otherwise my character would get stuck on them when they closed. I mean, sure, it's realistic, but then I couldn't continue playing.

Ok a correction-the traps aren't set to through even when they're closed. They don't need to be; once I step on one, my character moves away from them afterwards. Obviously I programmed something wrong with the taking away HP part, but what could it be? If these traps do nothing, there's no point in having them as hazards in my game. At that point they're just annoyances, and not hazards.
They're not "through" until they're closed. Reason I had to do that was because otherwise my character would get stuck on them when they closed. I mean, sure, it's realistic, but then I couldn't continue playing.

Ok a correction-the traps aren't set to through even when they're closed. They don't need to be; once I step on on, my character moves away from them afterwards. Obviously I programmed something wrong with the taking away HP part, but what could it be? If these traps do nothing, there's no point in having them as hazards in my game. At that point they're just annoyances, and not hazards.
Could you post your second event page? Because just this on a blank project worked for me
So are you saying that everything else in the event happens besides the HP reduction?
So are you saying that everything else in the event happens besides the HP reduction?
are u saying that everything else in the event happens besides the HP reduction?
Yeah. That's exactly it.

Second event page:

Second Event Page.png


Update: Ok so after looking at the programming for both my event and AquaEcho's, I noticed that he had as the first thing that happened in the event losing HP, whereas my event has you lose HP AFTER it plays the sound effect. I wonder if perhaps I need to have "lose 10 HP" first and THEN the sound effect in order to make it actually hurt the player? Maybe it's not registering that part because the sound effect comes first; I've had similar problems like this before, then changed one little thing in programming order, and it worked fine. I wonder if THAT'S it.
When something built into the game, like an event command, doesn't do what it's supposed to do, always check plugins. Those are what change how the game works, right?

Turn off all plugins and try it out - because there's literally no way you can be wrong with "Event command to lose 10 HP"

For the sake of people who are trying to help you, try to cut down on the extraneous fluff thematic descriptions of things.

It makes no difference that it's in an abandoned town, near the mayor's house, orcs used to live there, Spyro and his friends are doing whatever...that's all irrelevant words that people have to read through to try to help you. None of that could have anything to do with whether the event works or not.
If you remove all the code except the lose HP and it still doesn't work then there is something somewhere else, like a state or common event or plugin that's stopping your party from losing HP.
I turned off all plugins and tried this and had the same issue. Again, I think I need to program it so the event command "lose 10 HP" comes first instead of the sound effect. Also one other thing my party still loses HP normally from enemies hitting them in battle; no issues with that.
That can't possibly make any difference. There's no way that playing a sound effect somehow interferes with taking away HP.
Are you using any plugins that change the party roster or how reserve characters work?

Original thread: https://forums.rpgmakerweb.com/threads/i-dont-know-why-this-wasnt-working-but-its-fixed-now.160626/