Guest Messenjah Posted August 31, 2011 Share Posted August 31, 2011 Ok, so here is my script: SCN FFTESTSCRIPT Short DoOnce Float TimeVar ;***********************LightsTurnOn********************************** Begin GameMode Set TimeVar to TimeVar + GetSecondsPassed If [TimeVar >= 1.5] && [TimeVar < 1.75] && [DoOnce == 1] SecretRoomLightsREF.Enable 0 Elseif [TimeVar >= 1.75] && [TimeVar < 2.25] && [DoOnce == 1] SecretRoomLightsREF.Disable 0 Elseif [TimeVar >= 2.25] && [TimeVar < 2.5] && [DoOnce == 1] SecretRoomLightsREF.Enable 0 Elseif [TimeVar >= 2.5] && [TimeVar < 2.75] && [DoOnce == 1] SecretRoomLightsREF.Disable 0 Elseif [TimeVar >= 3] && [DoOnce == 1] SecretRoomLightsREF.Enable 0 Set DoOnce to 0 Endif End ;*************************OpenDoor************************************ Begin OnActivate Player Activate If [FFSuiteSecretDoorREF.GetOpenState == 1] Activate FFSuiteSecretDoorREF.SetOpenState 0 Elseif [FFSuiteSecretDoorREF.GetOpenState == 3] Activate FFSuiteSecretDoorREF.SetOpenState 1 Set DoOnce to 1 Endif End ;*********************************************************************** What this script does, is it is supposed to allow an activator to open a door, then flags DoOnce to 1 in order to allow a light sequence to play after so many seconds until the lights remain on and then flags DoOnce to 0 in order to shut the script off. The activate script tells it to open the door when the object is activated and then sets the DoOnce flag to 1 to start the sequence.' The second part of the script is a GameMode script so it should check at every single frame and at the last from it will flag DoOnce as 0 so that it will stop the sequence. Now, the activator script, for sure works alone just fine. However, with the second script, it simply does nothing at all... what is going on? Link to comment Share on other sites More sharing options...
rickerhk Posted September 1, 2011 Share Posted September 1, 2011 I'm not sure if you need all those activate functions, but you do need to set the timer to zero when DoOnce is flagged, because TimeVar is counting up all the time. And FYI : Begin OnActivate Player doesn't do anything. Other actors can still activate the activator. Begin OnActivate if (IsActionRef Player == 1) If [FFSuiteSecretDoorREF.GetOpenState == 1] Activate FFSuiteSecretDoorREF.SetOpenState 0 Elseif [FFSuiteSecretDoorREF.GetOpenState == 3] Activate FFSuiteSecretDoorREF.SetOpenState 1 Set DoOnce to 1 Set TimeVar to 0 < --------- need this Endif Endif End Link to comment Share on other sites More sharing options...
Recommended Posts