Use states in _00E_Complex_AddSilenceSC
This commit is contained in:
parent
9442c10d26
commit
96f0e89d72
Binary file not shown.
@ -1,11 +1,15 @@
|
||||
Scriptname _00E_Complex_AddSilenceSC extends ObjectReference
|
||||
|
||||
; Eddoursul: Reworked in 2.1.4 to use states and the OnTrigger() event to encure silence track removal
|
||||
|
||||
Event OnTriggerEnter(ObjectReference akActionRef)
|
||||
|
||||
If akActionRef == PlayerREF
|
||||
If (__Config_QuestToSet.GetCurrentStageID() >= __Config_iMinStage) && (__Config_QuestToSet.GetCurrentStageID() <= __Config_iMaxStage)
|
||||
_00E_SilenceLongTransitionHighPriority.Add()
|
||||
bActive = true
|
||||
If (__Config_QuestToSet.GetCurrentStageID() >= __Config_iMinStage) && (__Config_QuestToSet.GetCurrentStageID() <= __Config_iMaxStage)
|
||||
if GetState() == ""
|
||||
_00E_SilenceLongTransitionHighPriority.Add()
|
||||
GoToState("WaitLeave")
|
||||
endif
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
@ -15,27 +19,52 @@ Event OnTriggerLeave(ObjectReference akActionRef)
|
||||
|
||||
If akActionRef == PlayerREF
|
||||
_00E_SilenceLongTransitionHighPriority.Remove()
|
||||
GoToState("")
|
||||
UnregisterForUpdate()
|
||||
bActive = false
|
||||
;Debug.Notification("Leaving area")
|
||||
EndIf
|
||||
|
||||
EndEvent
|
||||
|
||||
; 2.1.4 Failsafe to ensure silence removal when OnTriggerLeave does not fire
|
||||
Event OnTrigger(ObjectReference akActionRef)
|
||||
If bActive && akActionRef == PlayerREF
|
||||
RegisterForSingleUpdate(3.0)
|
||||
EndIf
|
||||
EndEvent
|
||||
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
|
||||
;
|
||||
endEvent
|
||||
|
||||
Event OnUpdate()
|
||||
_00E_SilenceLongTransitionHighPriority.Remove()
|
||||
bActive = false
|
||||
EndEvent
|
||||
State WaitLeave
|
||||
|
||||
Event OnBeginState()
|
||||
RegisterForSingleUpdate(3.0)
|
||||
;Debug.Notification("Waiting to leave")
|
||||
EndEvent
|
||||
|
||||
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
|
||||
if akTarget == PlayerREF
|
||||
; Remove silence on combat start
|
||||
if aeCombatState == 1
|
||||
GoToState("")
|
||||
endif
|
||||
endif
|
||||
endEvent
|
||||
|
||||
Event OnTrigger(ObjectReference akActionRef)
|
||||
If akActionRef == PlayerREF
|
||||
RegisterForSingleUpdate(3.0)
|
||||
EndIf
|
||||
EndEvent
|
||||
|
||||
Event OnUpdate()
|
||||
GoToState("")
|
||||
EndEvent
|
||||
|
||||
Event OnEndState()
|
||||
_00E_SilenceLongTransitionHighPriority.Remove()
|
||||
;Debug.Notification("Leaving area")
|
||||
EndEvent
|
||||
|
||||
EndState
|
||||
|
||||
int Property __Config_iMinStage Auto
|
||||
int Property __Config_iMaxStage Auto
|
||||
Actor Property PlayerREF Auto
|
||||
Quest Property __Config_QuestToSet Auto
|
||||
MusicType Property _00E_SilenceLongTransitionHighPriority Auto
|
||||
bool bActive
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user