Didact2805 Posted January 27, 2019 Share Posted January 27, 2019 Hi there, I'm making an activator where, on Stage 73, it should display Message 1 AND also SetStage the Quest to Stage 74. Upon 2nd activation I want it to Set the Stage to 76 (So activating the activator X2 set the Stages to 74 and 76 respectively). Event OnActivate(ObjectReference akActionRef)if BBX_TestQuestProperty.GetStage() == 73BBX_TestQuestProperty.SetStage (74)Debug.MessageBox("Stage 74 Successful.") elseBBX_TestQuestProperty.SetStage (76)Debug.MessageBox("Stage 76 Successful.") The script does compile successfully, however, ONLY the Stage 76 message box appears on activation instead of '74' then '76'. Was wondering what is required to set it properly. Thanks in advance. Link to comment Share on other sites More sharing options...
Evangela Posted January 28, 2019 Share Posted January 28, 2019 (edited) Doesn't work that way. The else will only run if the stage is already set to 74. To run the else statement, that code would need run again after the stage has been set to 74. if (this happens to be true at time this statement is run) ; this will fire, and the else will not be checked else (this happens if the above statement is false);endif there's also this which may fit more into what you want if (this happens to be true at the time this statement is run) ; run this code no other statementselseif (the above statement was false so run this one) ; no other statements run after thiselseif (see above..) ; see aboveelse (when everything else is false) ; run thisendif Edited January 28, 2019 by Rasikko Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 28, 2019 Share Posted January 28, 2019 To figure it out a bit more, what Rasikko already explained to you. If you forgot to fill "BBX_TestQuestProperty" in the CK, only messagebox with 76 will be shown.If you filled the quest property right, show next script. xyzObjectScript Scriptname xyzObjectScript extends ObjectReference ; https://forums.nexusmods.com/index.php?/topic/7348961-activator-conditions-not-working-ifs-else-to-setstage/ ; ScannerLegend wrote: "ONLY the Stage 76 message box appears on activation instead of '74' then '76'. ; Was wondering what is required to set it properly." Quest PROPERTY BBX_TestQuestProperty auto ; Description: ; ~~~~~~~~~~~~ ; "I'm making an activator where, on Stage 73, it should display Message 1 AND also SetStage the Quest to Stage 74. ; Upon 2nd activation I want it to Set the Stage to 76 (So activating the activator X2 set the Stages to 74 and 76 respectively)." ; -- EVENT -- EVENT OnActivate(ObjectReference akActionRef) myF_Action(akActionRef) ENDEVENT ; -- FUNCTION -- ;----------------------------------------------- FUNCTION myF_Action(ObjectReference akActionRef) ;----------------------------------------------- IF (akActionRef == Game.GetPlayer() as ObjectReference) ; make sure player activation only ELSE RETURN ; - STOP - ENDIF ;--------------------- IF ( BBX_TestQuestProperty ) ELSE Debug.Notification("Missing quest property") RETURN ; - STOP - ENDIF ;--------------------- IF BBX_TestQuestProperty.IsStageDone(76) RETURN ; - STOP - last stage has been already set, nothing more to do ENDIF ;--------------------- IF (BBX_TestQuestProperty.GetCurrentStageID() == 73) ; current quest stage has to be 73 BBX_TestQuestProperty.setStage(74) ; now set stage 74 Debug.MessageBox("Stage 74 Successful.") ELSEIF BBX_TestQuestProperty.IsStageDone(74) ; if quest stage 74 is already set BBX_TestQuestProperty.setStage(76) ; now set stage 76 Debug.MessageBox("Stage 76 Successful.") ENDIF ENDFUNCTION Link to comment Share on other sites More sharing options...
Didact2805 Posted February 3, 2019 Author Share Posted February 3, 2019 Thanks! Came up with this thanks to your input and it works like a charm: Scriptname AAX_C2Q3ArdaalinePrisonCrystal extends ObjectReference GlobalVariable Property AAX_C2Q3CrystalCount Auto Quest Property AAX_C2Q3Property Auto Event OnActivate(ObjectReference akActionRef) If AAX_C2Q3CrystalCount.GetValue() < 1 AAX_C2Q3CrystalCount.SetValue(AAX_C2Q3CrystalCount.GetValue() + 1) AAX_C2Q3Property.SetStage(75) AAX_C2Q3Property.SetObjectiveDisplayed(75) AAX_C2_Q3_ArdaalinePrisonCrystal01.Disable() AAX_C2_Q3_PrisonCrystalBeam01.Disable()Debug.MessageBox("You disrupt the flow of magicka by distorting the configuration of the crystals.")elseIf AAX_C2Q3CrystalCount.GetValue() == 1 AAX_C2Q3Property.SetStage(75) AAX_C2Q3Property.SetObjectiveDisplayed(77) AAX_C2_Q3_ArdaalinePrisonCrystal01.Disable() AAX_C2_Q3_PrisonCrystalBeam01.Disable()Debug.MessageBox("You disrupt the flow of magicka by distorting the configuration of the crystals.")EndifendEVENT ObjectReference Property AAX_C2_Q3_ArdaalinePrisonCrystal01 Auto ObjectReference Property AAX_C2_Q3_PrisonCrystalBeam01 Auto Link to comment Share on other sites More sharing options...
Recommended Posts