I am having trouble getting a scene to play when the player starts combat with an actor alias - in this case Anise. The scene is meant to be a none intrusive commentary before the invisible activator backs out. I am also trying to get a different scene to play when Anise dies through the same method. I have gotten scenes like these to work before, so I am not sure what I am doing wrong with this one:
The code is posted below:
Scriptname SirBeastXM01AniseRefScript extends ReferenceAlias
;-----Properties
Actor Property Player Auto
Scene Property AniseAliveScene Auto
Scene Property AniseDeadScene Auto
ReferenceAlias Property XhiivAct Auto
ObjectReference Property ActReturnMarker Auto
ReferenceAlias Property Anise Auto
Int Property FightingAnise = -1 Auto
;-----Events
Event OnCombatStateChange(actor Target, int CS)
if Target == Player
if CS == 1
FightingAnise = 1
debug.messagebox("Event has triggered")
PlayAniseAliveScene()
elseIf CS == 0
if Anise.GetActorReference().IsDead()
PlayAniseDeadScene()
endif
endif
endif
EndEvent
;-----Functions
Function PlayAniseAliveScene()
XhiivAct.GetReference().MoveTo(Player, -90.0 * Math.Sin(Player.GetAngleZ()), -90.0 * Math.Cos(Player.GetAngleZ()))
AniseAliveScene.start()
while AniseAliveScene.IsPlaying()
utility.wait(1.0)
endWhile
XhiivAct.GetReference().MoveTo(ActReturnMarker)
EndFunction
Function PlayAniseDeadScene()
XhiivAct.GetReference().MoveTo(Player, -90.0 * Math.Sin(Player.GetAngleZ()), -90.0 * Math.Cos(Player.GetAngleZ()))
AniseDeadScene.start()
while AniseDeadScene.IsPlaying()
utility.wait(1.0)
endWhile
XhiivAct.GetReference().MoveTo(ActReturnMarker)
EndFunction
----------------
I also have a different problem for the same mod where the dialogue box with the next options shows up when I have a character forcegreet the player, even as they are trying to do their intro speech.
The details are at this page: