Must complete objectives before continuing. - by Xarik86
Xarik86 on 10/8/2013 at 22:24
Hello,
I'm trying to create a scenario where the player must complete all visible objectives (including the loot goal) before being allowed to say, open a door. I'm not really sure how to go about this or if there are any examples available. Any help is appreciated. Thank you.
kdau on 10/8/2013 at 23:49
If all visible objectives are completed, the mission will just end. Invisible objectives aren't counted until and unless they're made visible, so you'll need to reveal at least one of them before the visible ones are all completed.
In the simplest case, you could wait for all the non-final (goal_final_X=0) objectives to be complete. There's a standard script for that: TrapNonFinalComplete (despite the name, it's a trigger, not a trap or relay).
If it's not that simple, but you know in advance the exact list of objective numbers you want to wait for, you can create a QuestVarTrigger fnord for each objective. For each, set the Trap\Quest Var property to =1:goal_state_X, where X is the objective number. Then create a RequireAllTrap (RAT) and add a ControlDevice link from each trigger to the RAT. Finally, ControlDevice-link the RAT to whatever script you want to control (such as unlocking a door).
For the RAT setup, if you have objectives that vary by difficulty, you would have to use the Difficulty\Permit property to get rid of each QuestVarTrigger for difficulties it shouldn't apply to.
If you don't know in advance which objectives will be visible and relevant, you'll need something more complicated, and a more detailed description of your situation would help. :)
MysteryMan on 11/8/2013 at 00:01
Quote Posted by Xarik86
Hello,
I'm trying to create a scenario where the player must complete all visible objectives (including the loot goal) before being allowed to say, open a door. I'm not really sure how to go about this or if there are any examples available. Any help is appreciated. Thank you.
Are you using Dromed 2 ?
If so, then you can use requireall trap, and questvartriggers.
Example:
goal_0 qvartrigger =1:goal_state_0 > cdlink
goal_1 " " =1:goal_state_1 > cdlink
goal_2 " " =1:goal_state_2 > cdlink > All Triggers to RequireAll Trap cd link>Door
goal_3 " " =1:goal_state_3 > cdlink
goal_4 " " =1:goal_state_4 > cdlink
The questvartrigger waits for the goal_x to be completed, and when it receives the signal it send a TurnOn to the RequireAllTrap. Do the same for all of your visible goals using a Control Device link from all of your questvartriggers to the RequireAllTrap, Then cd link the RequireAllTrap to your Door or whatever you want triggered.
You can use Destroy 0, Destroy 1, and Destroy 2 to control the objectives in the different difficulty levels.
It really depends on your circumstance in how this would be done. This might give you an idea.
Xarik86 on 11/8/2013 at 02:55
Thank you! That got it working perfectly. The door opens at all difficulty levels with the proper destroy settings. I just needed the general idea on how this is done, and it is fairly simple. Thank you again :cheeky: