• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

2 Units Die Problem

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
Why doesn't this register when I have 2 units die and want to execute the rest of this trigger. I want it so both units have to be dead, which is why I put the "And" .

  • OroKabutoDie
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) Equal to |cffffd700Orochimaru|r) and ((Unit-type of (Dying unit)) Equal to |cffdaa520Kabuto|r)
    • Actions
      • Trigger - Turn off OroKabuto Energy Update <gen>
      • Trigger - Turn off Kabuto Mana Gain <gen>
      • Trigger - Turn off Orochimaru Mana Gain <gen>
      • Trigger - Turn off Kabuto Skill 1 <gen>
      • Trigger - Turn off OroKabuto Life <gen>
      • Trigger - Turn off OroChiSkill1 <gen>
This way doesn't work either:
  • OroKabutoDie
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) Equal to |cffffd700Orochimaru|r 0265 <gen>) and ((Dying unit) Equal to |cffdaa520Kabuto|r 0271 <gen>)
    • Actions
      • Trigger - Turn off OroKabuto Energy Update <gen>
      • Trigger - Turn off Kabuto Mana Gain <gen>
      • Trigger - Turn off Orochimaru Mana Gain <gen>
      • Trigger - Turn off Kabuto Skill 1 <gen>
      • Trigger - Turn off OroKabuto Life <gen>
      • Trigger - Turn off OroChiSkill1 <gen>
 
Level 11
Joined
Oct 13, 2005
Messages
233
The trigger can only go off for one unit at a time so you can't have 2 dying units at once. Instead, when a unit dies, you want to check that both of the specified units are dead:
Code:
Event - A unit Dies
Conditions:
    Orochimaru is dead
    Kabuto is dead
Actions:
Your actions here

This approach assumes that the units you are referring to are specific units either preplaced on the map or assigned to variables. You also probably want to disable the trigger after it's run as well.

Hope this helps.
 
Level 8
Joined
Feb 17, 2007
Messages
368
You should put:
  • Conditions:
    • (Orochimaru 0265 <gen> is dead) equal to true
    • (Kabuto 0271 <gen> is dead) equal to true

Yeah thats what I did, but see there's a problem with that. Anytime after that a unit dies, the trigger runs because those conditions only say that they have to be dead, and the even is a unit dies. So what's the solution to this? Is the only way to turn off the trigger?
 
Level 8
Joined
Feb 17, 2007
Messages
368
The trigger can only go off for one unit at a time so you can't have 2 dying units at once. Instead, when a unit dies, you want to check that both of the specified units are dead:
Code:
Event - A unit Dies
Conditions:
    Orochimaru is dead
    Kabuto is dead
Actions:
Your actions here

This approach assumes that the units you are referring to are specific units either preplaced on the map or assigned to variables. You also probably want to disable the trigger after it's run as well.

Hope this helps.

Ah ok, so I have to turn it off. Thats what I thought, thanks. :p
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Your initial trigger used makes no sense which is why they fail to work...
A unit can not be 2 different unit types at the same time (first trigger).
A unit can not be 2 different units at the same time (second trigger).

Like menitoned, you are after checking if both units are dead when eithor of them dies. Unit 1 is dead and Unit 2 is dead.

Further more, you should use specific unit events if it will affect 2 preplaced units (reference them specifically) rather than a generic unit event. This saves wasting time when a unit dies by reducing the event scope size to only the units the trigger affects.
 
Level 8
Joined
Feb 17, 2007
Messages
368
Your initial trigger used makes no sense which is why they fail to work...
A unit can not be 2 different unit types at the same time (first trigger).
A unit can not be 2 different units at the same time (second trigger).

Like menitoned, you are after checking if both units are dead when eithor of them dies. Unit 1 is dead and Unit 2 is dead.

Further more, you should use specific unit events if it will affect 2 preplaced units (reference them specifically) rather than a generic unit event. This saves wasting time when a unit dies by reducing the event scope size to only the units the trigger affects.

Yeah I understand that, but the actions I specify should only happen when they're both dead, which is why I need to have both of them in 1 trigger. I already have 2 other separate triggers where it has the specific unit event for each of them being dead. I also need the separate ones because I need to turn off specific triggers to that boss when he dies.
 
Status
Not open for further replies.
Top