Jump to content

[LE] Needing help with scripting for a follower mod


Recommended Posts

Hey!

So I've started working on my first follower mod (with a small unmarked quest)
And I've been following this tutorial https://www.creationkit.com/index.php?title=Bethesda_Tutorial_Planning_the_Quest.
But at the stage were you have to script an amulet (I chose a book) the script always fails to compile.
The property source is this (It's the same as in the tutorial I just replaced 30 with 20 so it fits my stages):

 

Scriptname GSQBookScript extends ObjectReference
Quest Property BookPickup Auto
Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
if (newContainer == Game.GetPlayer())
GSQ01.SetObjectivedisplayed(20)
GSQ01.SetStage(20)
endif
EndEvent
But when saving/compiling it I get this error
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GSQBookScript.psc(7,22): SetObjectivedisplayed is not a function or does not exist
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GSQBookScript.psc(7,22): cannot call the member function SetObjectivedisplayed alone or on a type, must call it on a variable
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GSQBookScript.psc(8,11): SetStage is not a function or does not exist
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GSQBookScript.psc(8,11): cannot call the member function SetStage alone or on a type, must call it on a variable
No output generated for GSQBookScript, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on GSQBookScript
I hope someone can helo me. Thank you in advance
Link to comment
Share on other sites

Sounds like you have not unpacked the default scripts that come with skyrim

 

The engine has to be able to find the commands. Take a look for a zip file in your data directory, and unzip the scripts that are there.

Link to comment
Share on other sites

Yeah I had that issue as well, davethepak is probably right.. That's what the problem was for myself years back. Just unzip those compressed files in your Skyrim Data Directory then restart Creation Kit. If that doesn't end up being the issue I'm sure someone will be able to help you further.

Link to comment
Share on other sites

I'm a bit unclear as to where this script is being applied.

 

You are telling it to set objectives to be displayed in quest GSQ01 but you don't define a quest property.. Since this extends an object reference, i don't see how it links to quest GSQ01.

 

I think I know what you're trying to do and it probably doesn't even need a new script.

 

Add your book as an alias into your quest.

One of the best ways to do this is to make a new empty container, give it an ID.

Put the container in game.

In your quest, make a new alias (Your book). Select "Create in" and specify the chest you just put in the game. When the quest runs, the container will have your book added to it. Your book needs no script attached to it, which is good.

Next, on the new book alias that you just made, add a script. It's a default script, so you don't add new scripts to the game and you don't worry about writing one and compiling!

The script is something like (top of my head here) "DefaultSetStageOnBookClosed". I think there's one that is the same name but with "NotAlias" on the end. You need the one that is for an alias.

That script will only let you set stage 20., but that's no issue. In the papyrus fragment of stage 20, just type "SetObjectiveDisplayed(20)"

 

If you don't want a container, simply plonk the book somewhere, create an alias as before and select "Forced Reference". Set it to your book. Then do the script as above.

 

Edit: just type in the Papyrus script manager "DefaultSetStage". You'll see the ones relating to a book! That was just from memory!

Link to comment
Share on other sites

Unziping the scripts to the corresponding folders won't be enough, your script won't compile as is because it isn't targeting your quest.

Example:




Quest property QuestToSet Auto
{The Quest we will set stage on}

Int Property StageToSet Auto
{The stage that will be set}

Auto State Waiting
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
If akNewContainer == Game.GetPlayer()
QuestToSet.SetStage(StageToSet)
QuestToSet.SetObjectiveDisplayed(StageToSet)
GoToState("Taken")
EndIf
EndEvent
EndState

State Taken
; Do nothing
EndState

Edited by maxarturo
Link to comment
Share on other sites

I'm a bit unclear as to where this script is being applied.

 

You are telling it to set objectives to be displayed in quest GSQ01 but you don't define a quest property.. Since this extends an object reference, i don't see how it links to quest GSQ01.

 

I think I know what you're trying to do and it probably doesn't even need a new script.

 

Add your book as an alias into your quest.

One of the best ways to do this is to make a new empty container, give it an ID.

Put the container in game.

In your quest, make a new alias (Your book). Select "Create in" and specify the chest you just put in the game. When the quest runs, the container will have your book added to it. Your book needs no script attached to it, which is good.

Next, on the new book alias that you just made, add a script. It's a default script, so you don't add new scripts to the game and you don't worry about writing one and compiling!

The script is something like (top of my head here) "DefaultSetStageOnBookClosed". I think there's one that is the same name but with "NotAlias" on the end. You need the one that is for an alias.

That script will only let you set stage 20., but that's no issue. In the papyrus fragment of stage 20, just type "SetObjectiveDisplayed(20)"

 

If you don't want a container, simply plonk the book somewhere, create an alias as before and select "Forced Reference". Set it to your book. Then do the script as above.

 

Edit: just type in the Papyrus script manager "DefaultSetStage". You'll see the ones relating to a book! That was just from memory!

I've followed this. But now my follower/quest giver won't talk to me anymore. E to interact thing is there but he won't say the voice line anymore. Which is weird since the only conditions are that only he says it and GetStage GSQ01 < 10. And the book won't appear in the container

Edited by Dovahgamer1208
Link to comment
Share on other sites

  • Recently Browsing   0 members

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