Jump to content

Script - Only spawn if custom quest is active


ZunaSW

Recommended Posts

Like I said, the script as I put it compiles just fine, zero errors. I tested it. I'm assuming you have a legal version of skyrim.

 

In your 2nd example, without

quest property CWE02 auto

 

the compiler will have no idea what you are talking about.

Edited by acidzebra
Link to comment
Share on other sites

If you have copied and pasted THIS script exactly as written and it still doesn't work, I don't know what to tell you. This compiles for me, that's all I can say.

 

Scriptname CHANGEFORYOURSCRIPTNAME extends ObjectReference   

quest property CWE02 auto
ObjectReference property CWFortSoldierImperialCWE auto


Event OnLoad()
     Debug.Trace("Every object in this cell has loaded its 3d")
     if CWE02.IsRunning()
     CWFortSoldierImperialCWE.enable()
     endIf
EndEvent 

Edited by acidzebra
Link to comment
Share on other sites

The script posted by acidzebra should compile without errors, whether the event will fire is another thing. So where did you put the script on? A trigger box? If so, OnLoad() may not work, since a trigger box has no 3d. Try using OnCellAttach().

 

 

With a trigger box, you could also use OnTriggerEnter() event:

 

Scriptname CHANGEFORYOURSCRIPTNAME extends ObjectReference   

quest property CWE02 auto
ObjectReference property CWFortSoldierImperialCWE auto


Event OnTriggerEnter(ObjectReference akActionRef)
     if akActionRef == Game.GetPlayer() && CWE02.IsRunning()
		Debug.Trace("We entered the trigger")
		CWFortSoldierImperialCWE.enable()
     endIf
EndEvent 

 

Just make sure the player actually enters the trigger.

Link to comment
Share on other sites

For now I'm making the script in a reference in Render Window, I don't know where I will put it. What is a trigger box? Sorry, I never mod Oblivion if it was in the game xD. That I want is:

For now, the npc of the spawn isn't in the world. The player talks with a guy, who gives a quest to the player. When the player enters in the cell where is the spawn, and the player have the quest active, the spawn works and spawn the npc.

I think I have to put the script in the spawn reference, but I'm not sure.

About the script, nothing, it doesn't work, I have the same errors. Can be it because my steam account is spanish? or anything about the lenguage of my programs and OS?

Ahh!! And I compile the script in Creation Kit. Have I to compile in other program?

Edited by ZunaSW
Link to comment
Share on other sites

Yes xD I have a legal version of Skyrim.

Nothing, it doesn't work :( I made a lot of things, a lot of changes, but nothing. Always says the same errors.

 

If you copied AcidZebra's or Ghaunadaur's script exactly and it won't compile (IsRunning is not a function error), then Quest.pex is missing or broken.

Edited by steve40
Link to comment
Share on other sites

Well, I make a script, and if I put a function in my script and the script is like this:

 

 Scriptname CWE02newscript extends ObjectReference  

quest property CWE02 auto
ObjectReference property CWFortSoldierImperialCWE auto
int count

Event OnLoad()
   if player.isinfaction(CWSonsFaction)

endif
CWFortSoldierImperialCWE.enable()
endEvent  
endFunction

 

I get this error:

 

Starting 1 compile threads for 1 files...

Compiling "CWE02newscript"...

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CWE02newscript.psc(13,0): missing EOF at 'endFunction'

No output generated for CWE02newscript, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on CWE02newscript

 

 

 

Then, If I delete the function and the script is like this:

 

 Scriptname CWE02newscript extends ObjectReference  

quest property CWE02 auto
ObjectReference property CWFortSoldierImperialCWE auto

Event OnLoad()
   if player.isinfaction(CWSonsFaction)

endif
CWFortSoldierImperialCWE.enable()
endEvent  

 

 

I get this errors:

 

Starting 1 compile threads for 1 files...

Compiling "CWE02newscript"...

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\CWE02.psc(3,15): cannot name a variable or property the same as a known type or script

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\CWE02.psc(6,10): IsRunning is not a function or does not exist

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\CWE02.psc(6,10): cannot call the member function IsRunning alone or on a type, must call it on a variable

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CWE02newscript.psc(3,15): cannot name a variable or property the same as a known type or script

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CWE02newscript.psc(7,7): variable player is undefined

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CWE02newscript.psc(7,26): variable CWSonsFaction is undefined

e:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CWE02newscript.psc(7,14): none is not a known user-defined type

No output generated for CWE02newscript, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on CWE02newscript

 

I know how to solve the three final errors, but the four first errors I don't know.

And yes, I change the script to try if it works with other events. And I made a new script called "CWE02newscript".

Link to comment
Share on other sites

I don't think you need a function. A function makes sense if you want to execute some piece of code many times, which isn't the case with your script.

 

Then, you can't just use player as a variable. It has to be declared somewhere, either as a property or inside the event block using Actor player = game.GetPlayer().

 

Oh, and why is your script using isinfaction() now? I thought it was meant to check if a quest is running.

 

 

Scriptname CWE02newscript extends ObjectReference   

Faction Property CWSonsFaction auto
ObjectReference property CWFortSoldierImperialCWE auto

Event OnLoad()
Actor player = Game.GetPlayer()
       if player.isinfaction(CWSonsFaction)
	CWFortSoldierImperialCWE.enable()
endif

endEvent  

 

 

I'm not getting those first 4 errors, there must went something wrong on your side. Try to rename the property CWE02 to any other name.

Edited by Ghaunadaur
Link to comment
Share on other sites

  • Recently Browsing   0 members

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