From 96f0e89d72b5d1c2d4b32c86fe4bdb5c4f188412 Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Sun, 27 Jul 2025 18:24:59 +0200 Subject: [PATCH] Use states in _00E_Complex_AddSilenceSC --- scripts/_00e_complex_addsilencesc.pex | Bin 1669 -> 2038 bytes source/scripts/_00e_complex_addsilencesc.psc | 59 ++++++++++++++----- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/scripts/_00e_complex_addsilencesc.pex b/scripts/_00e_complex_addsilencesc.pex index e1073e56b8a73d825823fcf968d3b66fe3a7c2ab..3b1c41980980d3538deec21740cbc287a3cdfeea 100644 GIT binary patch literal 2038 zcma)5+j0{}5Iv)dC0Sr$3%%^3wPS}db52Hob`M1 zL;I=cwfvq`u52Bw^&=OPP0tGkVKnH~FeOua?c7&2G_XLhY`Y2A@w_Mo69^QaOWo3r zmMA?BbP$_UN9rW>I~^G|m6jn!`PQczH;%94fNOzzCOf`L zn1^&I9;w%T&!n3SR8x6zz(m*gJgHE21LgVJ50ukG<>>A2($&ZEREFlRs5Ba{dd`Im zkDG_>_fCksWjX_Edp6o zb?SH8{?ArzN7|t53#G3dJ0GYuIbIk8{yLD6J_%Y<$C~~yd))k#7>oZ;B}&6vqB^7* zrMbkNsKP``hra4y>2RQ2Q^1<;I=U80JqT6AjjXwYkag6x$acHXXvDS8{SqjNvh(h# z#j)JrnU-h$dTMMS_bdo{>2@mW{QOZVbOk%X{7p5EwHVx>A)(F`qK4Jed#6Ii%Ooy;uEF2Y5vEUIF@GtN3{A{g`B{M z<9ir{$;=gIX1y4#y8%m53LQ%ACK@Y*0v`TmL%z3nsh(?PCuf=FG?U| zzFT8tQzHjdQLw9s%d13C36m%%%i!{0=!{*nn8Q4maZecc3fCj9RlAI*XwDwk26S%_sXOrecflJSw@%AhMv#5-xJ93( zDe!&^ge043+$K@7so*OjlFb~x9${vw#bnLk4!(&w&0E|SxQiTWG03R?mMROl$M=0+ z^&u%1`M<>9GO;TRtxgHt6R1=K?lYd7Ia;Oz)AIt~32^(+Hl!-BNLyG4two+Jnv>j> zz-fUc8#qgD1}>$6MFwUB9tkX4M&@MTGB3l3rIcz_fD9`(f`F_A*saK*Fk}2;{LOKx z;d^?`0oHggqUp*KTpoc<>+bTL-r|^-WxP_aEY?}CI%{ND3cSO5T%WqF&pNf%jfgy% zHol})Fko{mRVOGTsf-ZjW W+qQdj?x%V#xA$^mCqJ+03gka%s$bv$ literal 1669 zcma)5+g95~6y4)H7#j>UgrqcX(&9o4C70g(l!TfzYo#T{qKq`{~)Gp;la;Y<3M z{z>~K{g6I&&q%V3`%=wX(m6BxoW0LEqkn$>>+gIH0(=I4{;`Cu{=q@Ff2c1;L;0@% zGzfa(P%2;c4);f~kHu~f=y4Q}hfUOFX768ys)@(gWU%b}X|NXraT3fxpz>Urp7D&t z!gFnOV%CqPz}&J8Y`BrRnwe%rWr{y zj#NxXHvMtLwwh+_CRpxtlKB;W(27&)bnN#h_O^5)FEo2s^?tQo)QSTE;YMDJzQ~L( zvG!U;auCLx`H_y&xfWtMoPfW|z+YqIWD4z3=TN2rY2Jej`XDnNX2zq;c#H<`-(gaP zoArxtk>~x!H`j}fFGJ&>OIvjqH?_M|O`}~C;*s>jvrq*;%w=BL0l(FJg1FKl$vfIpB!L6Bf z8@Js-8RTl>W4Jz1y3M&_*0u+nqX`eBmOzQrwpEmrwaf^%EALpQe}&=gn|xZ~PZ z6R5Kv#VJy-&_(w2F5mZ9f{iNI1?~#0EDPM@Ih`A{Y=YukKDwU>e0n|oxv(oZuxl06NU$%kE^yzvSQBW|7N{|VR-3@KlR5`%2<$mvH39C;0zaQ` lzeqHv%JWoyVA*WT9&oJeCAVy`52wX~gWKXccOT8{{tK1!JC6VW diff --git a/source/scripts/_00e_complex_addsilencesc.psc b/source/scripts/_00e_complex_addsilencesc.psc index 970ba998e..3d7fb82e2 100644 --- a/source/scripts/_00e_complex_addsilencesc.psc +++ b/source/scripts/_00e_complex_addsilencesc.psc @@ -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