Jump to content

Quest Stages


Ceftadzime

Recommended Posts

Im having trouble getting the quest stages to advance. I can get the first stage and objective to appear telling the player to go to an autoload door, but once you go through the door the next stage and objective won't appear.
Link to comment
Share on other sites

This is not well explained in quests, but you need some action or event that you can attach the SetStage() and SetObjectiveDisplayed() functions to as the quest doesn't know about the activation of your door (even through it may be an objective).

 

If the door is the trigger, you could attach a script to it directly with an OnActivate() event that calls the quest advance functions. Neater is to add the door to you quest as a reference alias forced reference and attach an OnActivate() script to the reference alias that calls the quest advance functions.

Link to comment
Share on other sites

So I actually did create the door as an alias already, and I'm trying to add this script, and I think I have it set up correctly but It won't compile. This is what the script I have looks like.

Event OnActivate(CraterDoor akActionRef)
SetStage(20)
SetObjectiveDisplayed(20)
EndEvent
These are the error messages that I am getting as well.
"unknown type craterdoor"
"SetStage is not a function or does not exist"
"SetObjectiveDisplayed is not a function or does not exist"
"the parameter types of function onactivate in the empty state on script craterdoorscript do not match the original script referencealias
No output generated for CraterDoorScript, compilation failed."
By the way thanks for all the help.
Link to comment
Share on other sites

 

So I actually did create the door as an alias already, and I'm trying to add this script, and I think I have it set up correctly but It won't compile. This is what the script I have looks like.

Event OnActivate(CraterDoor akActionRef)
SetStage(20)
SetObjectiveDisplayed(20)
EndEvent
These are the error messages that I am getting as well.
"unknown type craterdoor"
"SetStage is not a function or does not exist"
"SetObjectiveDisplayed is not a function or does not exist"
"the parameter types of function onactivate in the empty state on script craterdoorscript do not match the original script referencealias
No output generated for CraterDoorScript, compilation failed."
By the way thanks for all the help.

 

Event OnActivate(ObjectReference akActionRef)
QUESTNAME.SetStage(20)
QUESTNAME.SetObjectiveDisplayed(20)
EndEvent
You were missing the quest name for the stage and objective and the OnActivate needs 'ObjectReference' not that actual reference.
Now, can ANYONE open the door and trigger it or only the player? if only the player, do this instead:
Event OnActivate(ObjectReference akActionRef)
If akActionREF == PlayerREF
QUESTNAME.SetStage(20)
QUESTNAME.SetObjectiveDisplayed(20)
Endif
EndEvent

 

These both will compile. Be sure to add an actor property and a quest property to the script:

 

Actor property PlayerREF auto

Quest property QUESTNAME auto

 

Once compiled, be sure to edit the properties of the script and link these to their forms.

Edited by joerqc
Link to comment
Share on other sites

Sorry, I'm very new to making script like this and I'm having a terrible time finding the Object Reference, everything I have tried keeps giving me different results, but none of them have worked.

Link to comment
Share on other sites

Sorry, I'm very new to making script like this and I'm having a terrible time finding the Object Reference, everything I have tried keeps giving me different results, but none of them have worked.

No no... the actual line you need in the script is:

 

Event OnActivate(ObjectReference akActionRef)

 

Because akActionRef *is* the object reference of WHO activated the alias.

 

Think about it this way. If you attached this script to a ref alias that links to a door, everytime the door is activated, this script runs because, Event OnActivate. The Object Reference in the Event is WHO activated it. So, if you have a door / button that is linked to a reference alias and this script is attached, everytime the door opens or the button is pushed, your script's onActivate will execute.

 

The best way to do this is, precisely as it is below:

 

Scriptname NAME_OF_YOUR_SCRIPT_HERE extends ReferenceAlias

 

Actor property PlayerREF auto

Quest property QUESTNAME auto

 

Event OnActivate(ObjectReference akActionRef)
If akActionREF == PlayerREF && QUESTNAME.GetStage() < 20
QUESTNAME.SetObjectiveCompleted(10)
QUESTNAME.SetStage(20)
QUESTNAME.SetObjectiveDisplayed(20)
Endif
EndEvent
In this manner, the script will run ONCE when the reference object is activated (button or door) provided it is the player activating it and the quest has not yet reached Stage 20. After it reaches 20, this script will not execute again. Where it is yellow, you substitute that with the appropriate form from your mod or the script's name when you created it.
Edited by joerqc
Link to comment
Share on other sites

  • Recently Browsing   0 members

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