Jump to content

Recommended Posts

Posted (edited)

How to disable NPC/Actor? I have tried this but it doesn't work:

 

Event OnUpdate()
If MyQuest.GetStage() == 30
Utility.Wait(10.0)
MyNPC.Disable(True)
EndIf
EndEvent

 

 

Edited by Ancient76
Posted (edited)

Well, that depends immensely on how you've set your quest and your updates up. First of all, make sure that 1) the update event is being run using a debug function, and that 2) your stage is succesfully set to 30 using console command SQV.

Edited by wormple12
Posted

Stage is set to 30. I know because I get message to perform another task.

 

I use "Flee To" package before this script. My NPC should run to some place and then disappear after 10 seconds. But this package shouldn't be a problem.

Posted

Well obviously it doesn't work because my NPC is still there.

 

It's a quest where i search for some people, and at the certain point this NPC forcegreets and warns me to leave and stop searching for them. Then after this stage he should flee from me and disappear, i must disable him.

Later in the quest he's gonna be enabled again, but that's not important now.

 

I use OnUpdate() event in the Reference window, like this:

 

 

Scriptname MyNPCDisableScript extends ObjectReference

Event OnUpdate()
If MyQuest.GetStage() == 30
Utility.Wait(10.0)
MyNPC.Disable(True)
EndIf
EndEvent
Quest Property MyQuest Auto
Actor Property MyNPC Auto

Posted

If you never register your npc for updates, the OnUpdate event will not run...

 

It sounds like you shouldn't use OnUpdate at all, but rather use utility.wait in your stage 30 script fragment -- or even better, run a script in your package when it completes (if Flee packages ever complete, you can figure that out on the wiki too, probably).

  • Recently Browsing   0 members

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