Jump to content

Recommended Posts

Posted (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 by Kevaar
Posted (edited)

NPC property in your script is an actor not a reference alias

So 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 by sLoPpYdOtBiGhOlE
Posted (edited)

That worked! Thank you!

 

What's the difference between an Actor and an Actorbase though anyway?

Edited by Kevaar
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...