4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

54 lines
1.3 KiB

Scriptname _00E_AddMusicScript extends ObjectReference
{Dynamically adds and removes music.}
Auto State WaitingForActivate
Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerREF
MusicToPlay.Add()
Levelsystem.RemoveSilence()
If Config_RemoveOnLeave == True
GoToState("WaitingForLeave")
Else
GoToState("Done")
EndIf
EndIf
EndEvent
EndState
State WaitingForLeave
Event OnTriggerLeave(ObjectReference akActionRef)
If akActionRef == PlayerREF
MusicToPlay.Remove()
If Config_ActivateMultipleTimes
GoToState("WaitingForActivate")
Else
GoToState("Done")
EndIf
EndIf
EndEvent
EndState
State Done
; Do nothing
EndState
;=====================================================================================
; PROPERTIES
;=====================================================================================
_00E_QuestFunctions Property Levelsystem Auto
Bool Property Config_RemoveOnLeave = False Auto
{If checked, removes the music once the player leaves the triggerbox. Check this if you want to check Config_ActivateMultipleTimes!}
Bool Property Config_ActivateMultipleTimes = False Auto
{If checked, the triggerbox will reset after the player leaving}
MusicType Property MusicToPlay Auto
Actor Property PlayerREF Auto