There are some information which is not saved in the .zds and only when custom monsters are involved.
Technical:
The healthbar is shown in integer numbers XXX / XXX health.
When pointing on a monster the global script displays the health on the screen as a hud.
Actors health can be manipulated via map scripts like the following code:
Code: Select all
Script 1 OPEN
{
SetActorProperty(3, APROP_HEALTH, 352);
SetActorProperty(4, APROP_HEALTH, 404);
SetActorProperty(5, APROP_HEALTH, 606);
}
To define a max health and make the map script to do it is possible using this method in DECORATE for each monster:
Code: Select all
ACTOR ZombieMan2: ZombieMan replaces ZombieMan 3004
{
var int user_MaxHealth;
States
{
Spawn:
POSS AA 1
POSS A 0 A_SetUserVar("user_MaxHealth", Health)
Idle:
POSS AB 10 A_Look
Loop
}
}
this explains the 2 tic delay at the start of the spawn.
The rest of the time the monster will return to Idle state, not spawn, so the healthbar limits can only be set once, but are never saved in zdoom savegame files *.zds.
Debugging
Run Feel free to take a look inside the WAD for relevant information.
There is a custom monster called SmartShotgunGuy which doesn't replace any original monster.
Patch the demo on DOOM2.WAD and simply run it despite skill.
Kill the imp and the save the game.
Press the switch and target at the SmartShotgunGuy in the middle, his health starts with 606, set via scripting.
Then die by letting them shot you or write "kill" in the console.
Your recent save is loaded. Now pull the switch again and target the SmartShotgunGuy again, his health not starts on 92, not 606.
The other monsters are OK so this error seem to affect only custom monsters.
What happened? The map script was executed after the save, but the actor's decorate Spawn state was never entered,
showing of the spawnhealth given to the script not the health passed over first time.
Analysis appreciated.
Have best wishes to get it fixed.