(SOLVED) Create Responsive Health (Not Using the Health Extension)

Thanks Keith, but I was able to solve the health problem. I’ve also tried taking out the “Set saving to 1” action as one of my experiments, but it didn’t do anything.

So far today, I’m just testing things out and trying to figure out why the button to take the character to the first room in the Level Select scene needs to be clicked twice now before it responds.

Is there an animation 0 for Transition? Is it possible for transition to not be at animation 0? If it’s not at 0 and the animation plays, it won’t be finished by the next event. The first click will play the animation and when you click it the 2nd time it will have already played, so it won’t play again and it will do the actions and switch scenes.

There is an Animation 0 for Transition. It’s worked no problem with other scripting so far, but here it’s been a problem.

On the plus side, I was able to get the button working by taking that last part with the “When Animation is Finished” condition out of the mouse click script sequence and set it as it’s own condition.

At first it was working, but then I realized that this could be a problem when the other level buttons are pressed, so I tried placing all the buttons in an Episodes group and messing around with variables. It created another problem where the scene doesn’t transition, so I’m going to sort this out today.

I tried setting the Change the Scene action to a specific room and that worked, so I know it has to be that VaribleString I put in that line right now.

Since my last try didn’t work, I sorta figured out a fix by using the LevelUnlock Global variable.
The idea is that, when you start the game, only the first Episode/Level in unlocked. When you beat the first episode, the second episode is unlocked, the button for Episode 2 works, and the variable is set to 2. I have a feeling it’s not totally fixed. At the Beginning of the Scene Condition, I put an action to set the variable to 1 and I could see that potentially causing problems in the future. I’ll make another thread about it if I have to.

For now, I’m satisfied. I’m going to make another post later today or tomorrow detailing how we solved the health scripts.


The first screenshot shows what I did for the player’s health. Enemies is an object group of AIs. Anything I put in the group will affect the player’s health. For better or for worse, I had to program each state of the health count.

The second screenshot shows the Runner AIs script. I don’t need to add anything on it’s own, but included some extra programming because the AI changes animation. In one state, it’s an enemy that hurts the player. In another state, it’s harmless and the player can walk by without getting hurt.