2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_AddMusicScript extends ObjectReference
|
|
|
|
{Dynamically adds and removes music.}
|
|
|
|
|
|
|
|
Auto State WaitingForActivate
|
|
|
|
|
|
|
|
Event OnTriggerEnter(ObjectReference akActionRef)
|
|
|
|
|
|
|
|
If akActionRef == PlayerREF
|
|
|
|
MusicToPlay.Add()
|
2024-01-09 22:00:18 +00:00
|
|
|
_00E_PlayerFunctions.GetSoundControl().RemoveSilence()
|
2021-10-05 22:15:58 +00:00
|
|
|
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
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
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
|