dietplums Posted March 20, 2023 Share Posted March 20, 2023 I've tried using this script on an xmarker, as that is the specific point I want the explosion to occur Scriptname ExplodeonQuestStage extends ObjectReference Const Quest Property boomquest Auto Const Explosion Property Nuke Auto Const Function ExplodeOnQuestStage() if (boomquest.GetStage() == 20) Game.GetPlayer().PlaceAtMe(Nuke, 1) endifEndFunction Event OnInit() ExplodeOnQuestStage()EndEvent I have also added the quest and the explosion to the properties the script itself complies fine with no errors however in game, I set the quest trigger but the explosion does not happen thank you Link to comment Share on other sites More sharing options...
SKKmods Posted March 20, 2023 Share Posted March 20, 2023 Because that script is not listening for the quest stage change. Can you imagine every script trying to listen out for every possible game event ? You either need to: On the Xmarker script Self.RegisterForRemoteEvent(pboomquest, "OnStageSet") and then Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID) ... OR Put the ExplodeOnQuestStage code in the quest a stage 20 fragment which is far more straightforward as no event registrations required. Link to comment Share on other sites More sharing options...
dietplums Posted March 21, 2023 Author Share Posted March 21, 2023 I put the code in the quest fragment 20 but I keep getting "A psc(17,0): mismatched input 'Function' expecting ENDFUNCTION I also tried the Self.RegisterForRemoteEvent(boomquest, "OnStageSet") and Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID) on the xmarker script and it compiled, but the explosion still did not occur Link to comment Share on other sites More sharing options...
DieFeM Posted March 21, 2023 Share Posted March 21, 2023 (edited) If you use a quest stage fragment to trigger the explosion, then you don't need all the code, just the one that places the explosion: Game.GetPlayer().PlaceAtMe(Nuke, 1)But, before trying to add this code to the fragment, you need to use "Add property" to add "Nuke" as an Explosion type property, and fill it with the desired explosion. PS: A fragment is actually a function, and you can't nest a function inside of another function, that's why you get "mismatched input 'Function' expecting ENDFUNCTION". Edited March 21, 2023 by DieFeM Link to comment Share on other sites More sharing options...
dietplums Posted March 21, 2023 Author Share Posted March 21, 2023 thank you all, it now works I'm bad at scripting Link to comment Share on other sites More sharing options...
Recommended Posts