ZunaSW Posted November 13, 2012 Posted November 13, 2012 (edited) Hello. I want to spawn npcs only if my custom quest is active. I know it have to use a script, but I don't know which script I have to use. I tryed opening the spawn in the object window, adding new script and writing the script "nameofmyquest.SetActive()" and a lot of scripts, but they don't work.Which script I have to use? Edited November 13, 2012 by ZunaSW
acidzebra Posted November 13, 2012 Posted November 13, 2012 The quickest way would be to set your NPCs as initially disabled and have a script enable them using IsRunning() http://www.creationkit.com/Reference#Common_Datahttp://www.creationkit.com/IsRunning_-_Questhttp://www.creationkit.com/Enable_-_ObjectReference
ZunaSW Posted November 13, 2012 Author Posted November 13, 2012 Mmmm.... I made it. I disabled the NPC, then in the Scripts tab I put the script: if (myquestname.IsRunning()) Debug.Trace("The main quest is running")endIf But the compiler output give me this error: missing EOF at 'if' Am I putting well the script?
acidzebra Posted November 13, 2012 Posted November 13, 2012 Not really, these things should happen inside of events. http://www.creationkit.com/Category:Events
ZunaSW Posted November 13, 2012 Author Posted November 13, 2012 And then, how can I make it works?Sorry :( I don't understand :(
acidzebra Posted November 13, 2012 Posted November 13, 2012 (edited) I can't answer you for what sort of event you need, it's your setting. You could try something like this as a script on the NPC Event OnCellLoad() self.disable() if (myquestname.IsRunning()) Debug.Notification("Hurray, enabling NPC") self.enable() endIf EndEvent There are many sort of events to test for, which one you need depends on what your needs are Edited November 13, 2012 by acidzebra
ZunaSW Posted November 13, 2012 Author Posted November 13, 2012 Ok, thanks :) I will see what can I do. Really, thank you :)
acidzebra Posted November 13, 2012 Posted November 13, 2012 Good luck, ask if you get stuck, and show us all a cool quest :thumbsup:
ZunaSW Posted November 13, 2012 Author Posted November 13, 2012 I'm really stuck xDD I put a event (now I learned to put it), but then I put the IsRunning function, but in the compiler output, again a problem " IsRunning is not a function or does not exist" :wallbash: Arghhhh I don't know what is it. It is not the only problem: " cannot call the member function IsRunning alone or on a type, must call it on a variable"I'm new with papyrus and I don't understand this problems :wallbash:
acidzebra Posted November 13, 2012 Posted November 13, 2012 (edited) Can you post the script you have created thus far please? My example script was only a snippet - it wasn't a competed thing you can just drop in and go.I may have given you bad advice - the isrunning() is part of the quest script. Or you could have forgotten to declare the right properties. Edited November 13, 2012 by acidzebra
Recommended Posts