Solved Preventing HP recovery

Question that is answered or resolved.

mersox

Active member
Hi all. Wondering if I'm missing an obvious solution to my issue.

OpenBOR by default replenishes the players' health when starting a new stage. That's good. But you know how sometimes you have stages within a stage (for example, the basement area in the first stage of the original Final Fight). Well by default, the engine replenishes health when stepping into those areas as well, thinking it's a brand new stage. I'd like to avoid that.

I was thinking of adding a script in the level file that checks the player's health at the end of a stage, and then again giving player's that amount of health at the start of the next stage. But I may be overcomplicating things. Thoughts?
 
Solution
That's pretty much the best way to go, except you'll probably want to apply the health in entity's spawn script, since the it (the entity) doesn't exist right when new level starts. This is how I do it:
  1. Level A populates global var with entity HP. I add player index to the key to know which is which.
  2. Entity spawn script looks for global var with same player index, and if present, applies value to its current HP.
  3. Delete the global var.
That's pretty much the best way to go, except you'll probably want to apply the health in entity's spawn script, since the it (the entity) doesn't exist right when new level starts. This is how I do it:
  1. Level A populates global var with entity HP. I add player index to the key to know which is which.
  2. Entity spawn script looks for global var with same player index, and if present, applies value to its current HP.
  3. Delete the global var.
 
Solution
That's pretty much the best way to go, except you'll probably want to apply the health in entity's spawn script, since the it (the entity) doesn't exist right when new level starts. This is how I do it:
  1. Level A populates global var with entity HP. I add player index to the key to know which is which.
  2. Entity spawn script looks for global var with same player index, and if present, applies value to its current HP.
  3. Delete the global var.
Excellent. Thanks DC!
 
Back
Top Bottom