I've just started getting into Doom mapping and scripting. I'm making a level where you enter a virtual reality environment for a time, then return back to the "real" game world. For this I need to store the health of the player as it was before he enters the virtual reality.
This is my script:
Code: Select all
world int 1:storedhealth;
world bool 1:InCyberSpace;
script 801 (void)
{
storedhealth = GetActorProperty(0, APROP_Health);
Teleport_NoFog(0, 1, 690);
InCyberSpace = true;
setplayerproperty (420, 1, 16);
SetActorProperty(420, APROP_Health, 300);
GiveInventory("CyberWeapon", 1);
SetWeapon("CyberWeapon");
while ( InCyberSpace == true ) {
if (GetActorProperty(420, APROP_Health) < 2 )
{
InCyberSpace = false;
ACS_Execute (802, 0);
}
else
{ delay(1); }
}
}
script 802 (void)
{
Teleport_NoFog(0, 1, 691);
TakeInventory("CyberWeapon", 1);
InCyberSpace = false;
setplayerproperty (420, 0, 16);
SetActorProperty(420, APROP_Health, storedhealth);
}
What am I doing wrong here?
