- Joined
- Mar 26, 2019
- Messages
- 64
- Reaction score
- 29
- First Language
- English
- Primarily Uses
- RMMV
I am working on a game that uses an ABS plugin, so all of the action takes place on-map.
There are points when I need to "freeze" the player's HP, and prevent it from suffering damage.
I am currently using a script that uses a variable to store the player's HP:
and then a function that "maintains" the player's HP:
It works, it just feels clunky.
Is there a better way to go about doing this?
Is it possible instead to attach a switch to the function that monitor's a player's HP, which can be enabled / disabled to allow / deny damage?
I am sorry if this is a basic question, I am still learning my way around RPG Maker.
Thanks!
There are points when I need to "freeze" the player's HP, and prevent it from suffering damage.
I am currently using a script that uses a variable to store the player's HP:
Code:
var xActor = $gameActors.actor($.xActorID);
$.xHPFreeze = xActor.hp;
Code:
$.fRHP = function() {
if ($.xHPFreeze != undefined) {
var cActorHP = $gameActors.actor($.xActorID);
if (cActorHP.hp < $.xHPFreeze) {
var xHP = ($.xHPFreeze - cActorHP.hp);
cActorHP.gainHp(xHP);
};
};
};
Is there a better way to go about doing this?
Is it possible instead to attach a switch to the function that monitor's a player's HP, which can be enabled / disabled to allow / deny damage?
I am sorry if this is a basic question, I am still learning my way around RPG Maker.
Thanks!


