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

pick each structure in region ?

Status
Not open for further replies.
Level 1
Joined
May 21, 2011
Messages
4
i have about 20 regions. in each region is a unit called Capitol. if a player destroys Capitol in a particular region, i want a new capitol to be placed, and all of the other structures in that region to turn to the killing player's color.

what's the simplest way to go about this?
 
Level 9
Joined
Dec 21, 2006
Messages
490
should be done with one simple trigger.

event - unit is killed
condition - unittype is capitol
actions - replace killed unit with capitol for player (unitowner of unit killer)
pick all units in REGION owned by player (unitowner of killed unit)
change owner to player( unitwoner of unit killer)

you could also just revive the capitol and change the owner.
or give capitol the herobehavior which stops dying and change owner.
 
Level 1
Joined
May 21, 2011
Messages
4
thanks
"pick all units in REGION owned by player (unitowner of killed unit)"

that's not a command that i can find o.o

nevermind

i'm used to sc1, the unit group thing confused me
 
Last edited by a moderator:
If you're doing a risk type of thing,

Event - (Any Unit) health < 5% (or insert value here)
Condition - (Unit Type) = (capital)
Action - Change ownership of (triggering unit) to (owner of (attacking unit))
Set (triggering unit) health 100% (or insert value here)

or

Instead of needing all of those freakin regions (unless you're just using them to spawn the original unit)

Event - (Any Unit) dies
Condition - (Unit Type) = (capital)
Action - Create 1 (capital) for (owner of unit (attacking unit)) at (position of (triggering unit))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
He wants all nearby buildings to change ownership as well. The definition of nearby in his case is in a region (which is a composite of rectangular and circular positive and negative areas).

Sorry for my nonsense last post. You will just have to do a linear search to find which region the capital was in that triggers the kill event.
 
Status
Not open for further replies.
Top