Jump to content

Scripting Help


ThatFalloutGuy2

Recommended Posts

Hey everyone, I've got a pretty easy case. I made this neat vertibird interior scene I scrapped from FO3 Broken Steel, the script and its functions work perfectly, but I can't seem to figure out a way to make the trigger repeatable. where the script will play out each time the player enters the trigger, as right now it only works once.

 

 

scn EPVertibirdinteriorScript
;Looping interior vertibird scene
short Stamp ; Stage Variable
float timer ; Timer Variable
;******************************************
Begin onTriggerEnter Player
if (Stamp == 0)
imod FadeInFromBlack4sISFX
EPDoor.disable ;make sure the Exit door is disabled
endif
if (GetCurrentTime < 6) || (GetCurrentTime > 19)
lightput.enable ;light activator
endif
set timer to 5
playsound OBJVertibirdTakeoff
set Stamp to 1
End
;******************************************
Begin gameMode
if (Stamp == 1)
if (timer <= 0)
;Pilot take off topic
EPMark.enable ;enable the xmarker looping sound
set timer to 10
set Stamp to 2
else
set timer to (timer - GetSecondsPasseD)
endif
elseif (Stamp == 2)
if (timer <= 0)
playsound OBJVertibirdLand
EPMark.disable ;Disable the looping Xmarker sound
;Pilot landing topic
set timer to 8
set Stamp to 3
else
set timer to (timer - GetSecondsPasseD)
endif
elseif (Stamp == 3)
if (timer <= 0)
Showmessage EPExitVertibirdMSG ;show message to exit the vertibird
EPDoor.enable ;enable the exit door to the vertibird
set timer to 4
set Stamp to 4
else
set timer to (timer - GetSecondsPassed)
endif
elseif (Stamp == 4)
if (timer <= 0)
Set Stamp to 5
else
set timer to (timer - GetSecondsPassed)
endif
endif
End
;******************************************
Link to comment
Share on other sites

Should be a pretty easy fix!

 

After the script runs, your "Stamp" variable is left at value 5 per the last condition block and does not reset to 0. You need to reset the Stamp value to 0 at the end of the script, or when the player leaves the trigger, whichever would make most sense for your script.

Edited by sullyvanj93
Link to comment
Share on other sites

This first chunk in the first script needs the variable "Stamp" to be 0 to run, but "Stamp" stays 5 after the first run.

if (Stamp == 0) ;Stamp will never be 0 after the first run

imod FadeInFromBlack4sISFX

        EPDoor.disable       ;make sure the Exit door is disabled

endif

So I think setting Stamp to 0 instead 5 on the "stage 4" solves your problem here.

 

EDIT: Damn, sullyvanj93 solved it first.

Edited by ebizoe
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...