Ancient76 Posted June 12, 2018 Share Posted June 12, 2018 (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) EndIfEndEvent Edited June 12, 2018 by Ancient76 Link to comment Share on other sites More sharing options...
TheWormpie Posted June 12, 2018 Share Posted June 12, 2018 (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 June 12, 2018 by wormple12 Link to comment Share on other sites More sharing options...
Ancient76 Posted June 12, 2018 Author Share Posted June 12, 2018 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. Link to comment Share on other sites More sharing options...
TheWormpie Posted June 13, 2018 Share Posted June 13, 2018 Allright. So why and how are you using the OnUpdate() event? Have you checked if it runs at all? Link to comment Share on other sites More sharing options...
Ancient76 Posted June 13, 2018 Author Share Posted June 13, 2018 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) EndIfEndEvent Quest Property MyQuest Auto Actor Property MyNPC Auto Link to comment Share on other sites More sharing options...
TheWormpie Posted June 13, 2018 Share Posted June 13, 2018 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). Link to comment Share on other sites More sharing options...
Recommended Posts