Can you take a screenshot of the event? Might help a lot more
But for now what i can tell is that you made the change variable to set instead of add
My bad, screenshot didnt load for me
So from what im seeing is that the script doesnt count each step but instead every frame when the player moves in any direction
What it does is basically repeats the whole event every single frame until it meets the 0 hp condition while the player moves
What you can alternatively do is check whenever the player presses an arrow key then you decrease the variable
Which event do you mean? This is all there is.
I switched SET to ADD but it didn't help 🙁
Sorry, didn't see the edit 😀
Unfortunately it didn't work either, it does the same thing (i take one step and it takes all the variable). Youre right that it keeps executing the action every frame instead of every press of the button
There's a step count already implemented in game.
Why not set the variable to the step count in your first page and then check when step count has grown by whatever amount you want to in your second page?
It can be found in Control variables -> Game Data -> Other -> Steps
Note that the above solution is a terrible workaround, because if your game framerate changes for whatever reasons the calculations will be off.
I'm having a hard time figuring out why you couldn't use the ready made steps counter for this, though.
Using this step counter will also allow you to not check every frame, and add a wait in your parallel process which is good practice because too many parallell processes running each frame will make your framerate tank.
I didn't know there was a step counter built in, thanks 🙂 I'm not sure if it works in my case though.
It does kill the player after taking a certain amount of steps, so that's good, but is there any way to give player more steps on the way?
For example:
Player can only take 6 steps, and then he dies. But after taking 3 steps, theres an NPC that gives him additional 6 steps, so he can walk further.
I connected Hero HP variable to Steps, made it so that the player dies after taking 6 steps, and made an NPC on the way that takes 3 Hero HP. But the Player still dies after taking 6 steps, instead of 9.
Just use a variable and increment it instead of using a fixed reference point for your comparison.
Let's say you store the starting steps in variable 1
In your second event instead of checking [current steps > variable 1 + 6], check for [current steps > variable 1 + variable 2]
Then you only have to change variable 2 to change how many steps the player can take.
i just remembered the damage floor feature that barely anyone uses. it literally does the same thing but it does it directly to the players HP. that method might be simpler then using the steps counter or the other method
If you want different events to happen on certain hp then you could just set a variable for the hero's hp in
game data - actor - hp
On default the player wouldnt die from poison, it's probably because you checked the knockout from slip/floor damage box in systems.
But im still not sure what you mean by different deaths.
You could probably use switches to get different death endings by turning them on right before death.
It should look something like this:
1st page, set variable 1 to current steps, this is the fixed number of reference, set variable 2 to 6, this is the difference in steps, then self switch a to on to switch pages.
2nd page, compare if current steps > variable 1 + variable 2 and do your things when the player has run out of steps.
If you need to modify the difference in steps before things happen, you just have to modify variable 2.
If you need something to happen at specific steps use current steps - starting steps (var 1) as a condition.