Jump to content

how to trigger explosion at an xmarker when a quest stage is set


Recommended Posts

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)
endif
EndFunction
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

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

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

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 by DieFeM
Link to comment
Share on other sites

  • Recently Browsing   0 members

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