I'm new to scripting and want to write a script that causes a few draugr to appear from thin air after a short teleport-in visual effect. I also want the Draugr to be disabled while the teleport effect is playing so they arent moving around during that time.
I've created a few draugr that are initially disabled. I've made a trigger box that covers an entire room and I've successfully made it so that when the player enters the trigger box the draugr are enabled and it even plays the teleport visual effect. The only problem is that there is always a delay, the draugr model plays for maybe 1/5 of a second and then the teleport effect plays.
The script attached to the trigger box:
Scriptname SpawnDraugr extends ObjectReference Hidden Actor Property Draugr1H AutoActor Property Draugr2H AutoActor Property DraugrMissile AutoActor Property DraugrWarlock AutoObjectReference Property TriggerBox AutoEvent OnTriggerEnter(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() Utility.Wait(2.0) Draugr1H.enableNoWait() Draugr2H.enableNoWait() DraugrMissile.enableNoWait() DraugrWarlock.enableNoWait() Draugr1H.enableAI(false) Draugr2H.enableAI(false) DraugrMissile.enableAI(false) DraugrWarlock.enableAI(false) EndIfEndEvent
Scriptname AppearEffect extends ObjectReference Hidden Actor Property DraugrActor AutoObjectReference Property TriggerBox AutoVisualEffect Property AppearAnimation AutoEvent OnLoad() AppearAnimation.play(DraugrActor, 1.0, Game.GetPlayer()) Utility.Wait(1.0) DraugrActor.EnableAI(True);EndEvent