Kevaar Posted March 15, 2016 Posted March 15, 2016 (edited) <sigh> Yet again with the Skyrim scripts. Whyyy did they have to change to Papyrus? I never had these issues using the Morrowind script language. So, this time I'm trying to have an NPC ambush the player after they rest. Here's my script: Scriptname Ambush extends Quest Actor Property NPC auto event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime) NPC.Enable() NPC.MoveTo(Game.Getplayer()) SetStage(40) UnregisterForSleep() endevent Quest Stage 40 has a debug notification attached that is firing correctly, so I know the script's being called and executed just fine. My problem is that the NPC never appears! I've tried having NPC be the actual Actor's ID, I've also tried it being an alias. I've tried using variations of NPC.GetActorRef() and that doesn't do anything either. If it helps, I can summon the NPC using the console ingame with player.placeatme, and he shows up and attacks like he's supposed to. Just can't figure out the Creation Kit equivalent. Help, por favor? Edited March 15, 2016 by Kevaar
sLoPpYdOtBiGhOlE Posted March 15, 2016 Posted March 15, 2016 (edited) NPC property in your script is an actor not a reference aliasSo NPC.GetActorRef() would not do anything...You would use GetActorRef() on a a reference alias to return the actor that fills the alias. Instead of placing a NPC in game world disabled, why not use something like:http://www.creationkit.com/PlaceActorAtMe_-_ObjectReference Scriptname Ambush extends Quest ActorBase Property NPC auto ;< Fill this in in CK and point it to your base actor. event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime) Game.GetPlayer().PlaceActorAtMe(NPC, 3) ; Boss Level SetStage(40) UnregisterForSleep() endevent Edited March 15, 2016 by sLoPpYdOtBiGhOlE
Kevaar Posted March 16, 2016 Author Posted March 16, 2016 (edited) That worked! Thank you! What's the difference between an Actor and an Actorbase though anyway? Edited March 16, 2016 by Kevaar
sLoPpYdOtBiGhOlE Posted March 16, 2016 Posted March 16, 2016 ActorBase is what you look at in the CK Object Window -> Actors Actor would be an ActorBase that you Dropped into the CK Render Window or used PlaceAtMe or PlaceActorAtMe.Basically an ObjectReference.
Recommended Posts