• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Need help with Unit has died condition!

Status
Not open for further replies.
Level 2
Joined
Jan 12, 2014
Messages
6
Hello, I've been stuck with this problem for a while and I just cant figure out how to make a system where it checks that if 2 specific units have died and if it is true it launches another trigger.

  • GoForsakenRequirements2
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to The City of Lordaeron 0182 <gen>
          • (Triggering unit) Equal to Stratholme 0156 <gen>
    • Actions
      • Trigger - Turn on forsakenspawnlauncer <gen>
      • Game - Display to (All players) the text: forsakenreq2 is wor...
I have tried Dying unit and Triggering unit and it just doesn't seem to work. Does this system require both of them dying at the same time or something?

If you manage to help me I will credit you.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
You don't need to try and entice people with the prospect of credits btw people here are happy to help.

I'm going to make the assumption that those units cannot respawn.

So right now your problem is that when a unit dies you check does this unit meet some conditions and if so lets do some actions. But you're checking does the triggering unit equal 2 different units at the same time. Which will never happen.

To remedy this problem we should keep track with a counter.

Event
Unit dies
Conditions
Blank
Actions
Set tempunit == triggering unit

If tempunit == buliding1
Then
Set goforesakenInteger == goforesakenInteger +1
Else
If tempunit == builiding2
Then
Increment as shown above
Else
Blank

If goforesakenInteger == 2
TheN
Turn on your spawn trigger
Turn off this trigger
Else
Blank
 
Level 2
Joined
Jan 12, 2014
Messages
6
Could you be abit more specific, because i am quite new with the world editor. I understand that tempunit is a variable but what kind of variable?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
A unit cannot be 2 different units at the same time. As such the condition will always evaluate false and the actions will never run.

Either...
1. Check if both units are dead. This is usually done by checking if life is less than 0.405 but will be inaccurate if the unit does not decay and is healed by faulty triggers or tranquillity.
2. Use a counter to keep track of how many buildings still need to die. Each time one days you decrement the counter. A unit group keeps track of the buildings for speed (allows fast condition) or specific unit events are used. When counter is set to 0 then you run your actions.
 
Status
Not open for further replies.
Top