• 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.

[Trigger] Unit death trigger location check

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2006
Messages
293
K im trying to figure out how to make a trigger that checks if a certain unit type dies in a region where if it does it creates a doodad at a different region.

I need to have it recognize a units death in a region of a certain unit type and then have it create a doodad after the death of the unit in a region. Maybe break it up into 2 triggers since for now its just a one time trigger.
 
Level 8
Joined
Feb 20, 2007
Messages
338
I have a similar trigger already: It has several regions (Holy Wood, Dark Wood) and several unit types rabbit, stag, etc) I'm only posting a bit of it here:

  • Reg Unit death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Rabbit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Darkwood <gen> contains (Dying unit)) Equal to True
        • Then - Actions
          • Destructible - Create a Ashenvale Tree Wall seedling at (Random point in Village 2 <gen>) facing (Random angle) with scale 1.00 and variation 0
  • Else: do nothing
Region contains dying unit is under boolean conditions:

Unit- unit in region (rect in WEU)

Of course I direct you to: http://www.hiveworkshop.com/forums/showthread.php?t=35124 to clean it up.

I use WEU which has point - remove location in this case it reads:

Point - Remove (Position of (Last created destructible))
 
Level 8
Joined
Feb 20, 2007
Messages
338
The if-then-else stuff should be moved into the conditions, for efficiency.

And you can remove locations with the normal WE:

If you're using GUI, it's just

  • Custom script: call RemoveLocation(udg_VarName)

I believe I said: "I have a similar trigger already: It has several regions (Holy Wood, Dark Wood) and several unit types rabbit, stag, etc) I'm only posting a bit of it here:"


However I agree if you only have one dying place for only one spawn area then move all conditions to conditions and just leave the action and take out the if/then/else.
 
Status
Not open for further replies.
Top