Jump to content

Script - Only spawn if custom quest is active


ZunaSW

Recommended Posts

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 by ZunaSW
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by acidzebra
Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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 by acidzebra
Link to comment
Share on other sites

  • Recently Browsing   0 members

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