• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Trigger that kills units when another dies

Status
Not open for further replies.
Level 4
Joined
Jun 27, 2018
Messages
25
So I have this boss altered from the Forgotten One in the middle of my map. I also added 4 tentacles to it, making it look like this:
Skärmbild (191).png

Now, This is a killable creep. But how do you make it so that when the Forgotten One is killed, the tentacles dies too?

Also, how do you make it so that if one kills a tentacle while the Forgotten one is still alive it just respawns?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I'd assume that there is only one boss in your map?
  • Trigger 1
    • Events
      • Unit - Forgotten One Boss Dies
    • Conditions
    • Actions
      • Trigger - Turn off Trigger2
      • Destroy Trigger2
      • Set TemporaryUnitGroup = Unit group - All units in playable map area
      • Unit Group - Pick all units in TemporaryUnitGroup and do actions
        • Loop actions
          • If (Unit type of (Picked unit) equal to Forgotten One Tentacle)
            • Unit - Kill (picked unit)
      • Destroy Trigger 2
      • Destroy (This Trigger)
  • Trigger2
    • Events
      • Unit - A unit dies
    • Conditions
      • (Unit type of (Triggering unit)) equal to Forgotten One Tentacle
    • Actions
      • Wait 10.00 seconds
      • If (Forgotten One Boss is alive equal to true)
        • Unit - Revive (Triggering unit)
Those two should work well.

regards
-Ned
 
Last edited:
Level 4
Joined
Jun 27, 2018
Messages
25
I'd assume that there is only one boss in your map?
  • Trigger 1
    • Events
      • Unit - Forgotten One Boss Dies
    • Conditions
    • Actions
      • Trigger - Turn off Trigger2
      • Destroy Trigger2
      • Set TemporaryUnitGroup = Unit group - All units in playable map area
      • Unit Group - Pick all units in TemporaryUnitGroup and do actions
        • Loop actions
          • If (Unit type of (Picked unit) equal to Forgotten One Tentacle)
            • Unit - Kill (picked unit)
      • Destroy This Trigger)
  • Trigger2
    • Events
      • Unit - A unit dies
    • Conditions
      • (Unit type of (Triggering unit)) equal to Forgotten One Tentacle
    • Actions
      • Wait 10.00 seconds
      • If (Forgotten One Boss is alive equal to true)
        • Unit - Revive (Triggering unit)
Those two should work well.

regards
-Ned
Thanks for this reply, this looks really nice!

But for example under trigger2, how do you add a condition and an event connected to the action; "Wait 10,00 seconds"? For me they just end up under Conditions and Events.

Sorry for my noobiness
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Are you asking about this?:
  • If (Forgotten One Boss is alive equal to true)
    • Unit - Revive (Triggering unit)
It is an action called "If / Then / Else, Multiple actions"

I wrote that up there as an example. In reality it would look more like:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Forgotten Boss is Alive Equals to True
    • Then - Actions
      • Unit - Revive (Triggering unit)
    • Else - Actions
By the way, in my first trigger I have let a memory leak slip through.
I have missed to destroy the Unit Group.

Before destroying the Triggers, you have to destroy the Unit group with this:
  • Custom script: call DestroyGroup(udg_TemporaryUnitGroup)
Also, the code for destroying the triggers is a custom script which syntax I do not remember...

regards
-Ned
 
Level 4
Joined
Jun 27, 2018
Messages
25
Are you asking about this?:
  • If (Forgotten One Boss is alive equal to true)
    • Unit - Revive (Triggering unit)
It is an action called "If / Then / Else, Multiple actions"

I wrote that up there as an example. In reality it would look more like:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Forgotten Boss is Alive Equals to True
    • Then - Actions
      • Unit - Revive (Triggering unit)
    • Else - Actions
By the way, in my first trigger I have let a memory leak slip through.
I have missed to destroy the Unit Group.

Before destroying the Triggers, you have to destroy the Unit group with this:
  • Custom script: call DestroyGroup(udg_TemporaryUnitGroup)
Also, the code for destroying the triggers is a custom script which syntax I do not remember...

regards
-Ned
I see, Thank you!

But I can't find where I can choose "Unit - Revive (Triggering unit)"

Skärmbild (195).png


Am I doing something wrong?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
No such thing as revive unit from what memory preserves. You can only revive heroes.
Hero - Revive Hero

Units need to be recreated upon death, or you can enforce dummy Resurrection if they decays.
Oh....
Thanks, for correcting me !

@Mandriel In that case just give them the Tauren Chieftain's revive with 0 cooldown and X seconds delay. And do only the first trigger.
@Daffa, wouldn't that be easier and less fault-proof?


regards
-Ned
 
Status
Not open for further replies.
Top