if ( ( GetGlobalInt(54) == 0) && ( GetGlobalInt(58) == 1) ) {
if (UsedAction(A_LOOK_AT)) {
if(MovePlayer(270, 96)) {
FaceDirection(GetPlayerCharacter(), DIR_UP);
Display("Light Switch.");
}
else Unhandled();
}
else if (UsedAction(A_USE)) {
if(MovePlayer(270, 96)) {
FaceDirection(GetPlayerCharacter(), DIR_UP);
PlaySound(66);
// ObjectOff(1);
SetFlashlightDarkness (GetFlashlightMaxLightLevel ());
SetFlashlightBrightness (GetFlashlightDarkness ());
//LoseInventory(2);
//AddInventory(1);
SetGlobalInt(54, 1);
SetGlobalInt(58, 0);
}
else Unhandled();
}
else Unhandled();
}
do i really need the GetGlobalInt
Yes.
Unless they're just used in that one place, you can define a couple of local boolean or integer variables. See the manual.
thank you