How to Make this trigger

Status
Not open for further replies.
Level 9
Joined
Oct 3, 2006
Messages
302
okay, i think this is kind of easy, but I don’t know how to do it.

There are 3 units on the map.

I need the “Action” to occur if all 3 units have been killed.
The “Action” should not occur if any one of the three units die.
The Action should only occur if all 3 units are dead.
The action can still occur even if all 3 units did not die at the same time.
 
Something like this, maybe?
  • Events
    • Unit - A unit Dies
  • Conditions
    • Or - (Conditions)
      • (Dying unit) Equal to Unit1
      • (Dying unit) Equal to Unit2
      • (Dying unit) Equal to Unit3
  • Actions
    • If (All Conditions are True) then Do (Actions) else Do (Actions)
      • If - Conditions
        • (Unit1 is dead) Equal to True
        • (Unit2 is dead) Equal to True
        • (Unit3 is dead) Equal to True
      • Then - Actions
        • (Action)
      • Else - Actions
 
Something like this, maybe?
  • Events
    • Unit - A unit Dies
  • Conditions
    • Or - (Conditions)
      • (Dying unit) Equal to Unit1
      • (Dying unit) Equal to Unit2
      • (Dying unit) Equal to Unit3
  • Actions
    • If (All Conditions are True) then Do (Actions) else Do (Actions)
      • If - Conditions
        • (Unit1 is dead) Equal to True
        • (Unit2 is dead) Equal to True
        • (Unit3 is dead) Equal to True
      • Then - Actions
        • (Action)
      • Else - Actions
Yup, this should work.
 
Ok thanks.
But I already found a different approach. Kinda weird tho’

I made three triggers

- One trigger had an action where -map intializxn and has an event of set resources of player 2 to 4 gold

- Then a trigger where if one unit dies there would be a -1 gold

- Last trigger has an action of If player 2 has gold equal to 1. Then the events unfold

I didn’t know what to do abt it. Yours is definitely easier tho’.
I’ll try it out on my next quest
 
@creyzi4zb12 - as @Chaosy said: it's clunky and you really shouldn't do it like this, because while it might work in this particular scenario, there are a number of others where it simply won't work and thus it's better if you just learn how to do it properly right now.

You can do what you want with this simple trigger:

  • Events
    • Unit - <unit 1> Dies
    • Unit - <unit 2> Dies
    • Unit - <unit 3> Dies
  • Conditions
    • (<unit 1> is dead) Equal to True
    • (<unit 2> is dead) Equal to True
    • (<unit 3> is dead) Equal to True
  • Actions
    • <your actions>
Why do it like this?

1. It's actually easier and faster to make.
2. It's more "friendly" for the game engine to run.
3. It's much easier to edit later on.
4. It won't potentially get bugged as you add things.
5. It just looks better.
 
You can do what you want with this simple trigger:

  • Events
    • Unit - <unit 1> Dies
    • Unit - <unit 2> Dies
    • Unit - <unit 3> Dies
  • Conditions
    • (<unit 1> is dead) Equal to True
    • (<unit 2> is dead) Equal to True
    • (<unit 3> is dead) Equal to True
  • Actions
    • <your actions>
Why do it like this?

1. It's actually easier and faster to make.
2. It's more "friendly" for the game engine to run.
3. It's much easier to edit later on.
4. It won't potentially get bugged as you add things.
5. It just looks better.

side note: This will only work if the units were pre-placed in the map, but is much cleaner.
 
Boolean.

Click on the ((Triggering unit) is A structure) part and select Function: Unit - Unit is Alive.

Edit: obviously meant the Unit - Unit is Dead function.
 
Last edited:
I feel you need a bit more explanation.

The condition should be called "Boolean comparison"
Basically, it checks the true/false of a statement. It could be either "yes" or "no"

  • (<unit 1> is dead) Equal to True
The (<unit 1> is dead) part is either "yes" or "no". "True" or "false".
So, if the unit is dead the (<unit 1> is dead) part would be "True" otherwise it would be "False".

regards
-Ned
 
Status
Not open for further replies.
Back
Top