[Solved] Victory Trigger when Main Quests are Completed

Level 5
Joined
Aug 9, 2005
Messages
97
So I have a map with 5 Quests. The player can only achieve victory if they complete all 5. I have 5 different boolean variables that are each turn to True when they complete a quest. Then I created the following trigger to check if they are all True, and if they are, the victory Cinematic plays. However, it simply doesn't work.
  • Victory
    • Events
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Victory1 Equal to True
          • Victory2 Equal to True
          • Victory3 Equal to True
          • Victory4 Equal to True
          • Victory5 Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Run VictoryCinematic <gen> (checking conditions)
 
Something like this could work:
  • Victory
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Victory1 Equal to True
      • Victory2 Equal to True
      • Victory3 Equal to True
      • Victory4 Equal to True
      • Victory5 Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Run VictoryCinematic <gen> (checking conditions)
Note that the "And" condition is already the default behavior so you can get rid of it. It's meant to be used along with the "Or" condition to ask more complex sets of questions like: If (A is true) or (B and C are true).

Also, you can use a single Boolean Array variable instead of needing 5 separate Boolean variables.
  • Conditions
    • Victory[1] Equal to True
    • Victory[2] Equal to True
    • Victory[3] Equal to True
    • Victory[4] Equal to True
    • Victory[5] Equal to True
Then you could even use a For Loop to "simplify" the logic, although maybe overkill here:
  • Victory
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Variable Victory[0] = True
      • For each (Integer A) from 1 to Victory_Condition_Count do (Actions)
        • Loop - Actions
          • If Victory[(Integer A)] Equal to False then Set Variable Victory[0] = False Else do nothing
      • If all conditions are true then do Actions
        • If - Conditions
          • Victory[0] Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Run VictoryCinematic <gen> (checking conditions)
        • Else - Actions
 
Last edited:
No. You need to have an event which the game uses to detect when to fire your trigger, or you need to run your trigger manually from another trigger using the 'Trigger - Run Trigger' action.
Yup, that worked. I just assumed variables would simply trigger in conditions. Thanks!

Something like this could work:
  • Victory
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Victory1 Equal to True
      • Victory2 Equal to True
      • Victory3 Equal to True
      • Victory4 Equal to True
      • Victory5 Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Run VictoryCinematic <gen> (checking conditions)
Note that the "And" condition is already the default behavior so you can get rid of it. It's meant to be used along with the "Or" condition to ask more complex sets of questions like: If (A is true) or (B and C are true).

Also, you can use a single Boolean Array variable instead of needing 5 separate Boolean variables.
  • Conditions
    • Victory[1] Equal to True
    • Victory[2] Equal to True
    • Victory[3] Equal to True
    • Victory[4] Equal to True
    • Victory[5] Equal to True
Then you could even use a For Loop to "simplify" the logic, although maybe overkill here:
  • Victory
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Variable Victory[0] = True
      • For each (Integer A) from 1 to Victory_Condition_Count do (Actions)
        • Loop - Actions
          • If Victory[(Integer A)] Equal to False then Set Variable Victory[0] = False Else do nothing
      • If all conditions are true then do Actions
        • If - Conditions
          • Victory[0] Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Run VictoryCinematic <gen> (checking conditions)
        • Else - Actions
That will be very useful if I ever have multiple quest requirements to trigger several different events or something like that. Thanks.
 
Back
Top