Ceftadzime Posted February 23, 2018 Share Posted February 23, 2018 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 More sharing options...
SKKmods Posted February 23, 2018 Share Posted February 23, 2018 Do you have a trigger that calls the next SetStage() and SetObjectiveDisplayed() ? Link to comment Share on other sites More sharing options...
Ceftadzime Posted February 23, 2018 Author Share Posted February 23, 2018 Are you referring to the scripting in the quest stages on a quest, or do i need to create an actual trigger box? Link to comment Share on other sites More sharing options...
SKKmods Posted February 23, 2018 Share Posted February 23, 2018 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 More sharing options...
Ceftadzime Posted February 23, 2018 Author Share Posted February 23, 2018 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 referencealiasNo output generated for CraterDoorScript, compilation failed." By the way thanks for all the help. Link to comment Share on other sites More sharing options...
FlashyJoer Posted February 23, 2018 Share Posted February 23, 2018 (edited) 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 referencealiasNo 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) EndifEndEvent These both will compile. Be sure to add an actor property and a quest property to the script: Actor property PlayerREF autoQuest property QUESTNAME auto Once compiled, be sure to edit the properties of the script and link these to their forms. Edited February 23, 2018 by joerqc Link to comment Share on other sites More sharing options...
Ceftadzime Posted February 23, 2018 Author Share Posted February 23, 2018 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 More sharing options...
FlashyJoer Posted February 24, 2018 Share Posted February 24, 2018 (edited) 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 autoQuest property QUESTNAME auto Event OnActivate(ObjectReference akActionRef) If akActionREF == PlayerREF && QUESTNAME.GetStage() < 20 QUESTNAME.SetObjectiveCompleted(10) QUESTNAME.SetStage(20) QUESTNAME.SetObjectiveDisplayed(20) EndifEndEvent 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 February 24, 2018 by joerqc Link to comment Share on other sites More sharing options...
Ceftadzime Posted February 24, 2018 Author Share Posted February 24, 2018 Oh finally it worked, thank you so much. Link to comment Share on other sites More sharing options...
FlashyJoer Posted February 24, 2018 Share Posted February 24, 2018 (edited) :smile: Happy to hear it. Its a steep curve learning about these papyrus calls. But once one small thing clicks, they all start clicking a lot quicker. Edited February 24, 2018 by joerqc Link to comment Share on other sites More sharing options...
Recommended Posts