• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

pick each structure in region ?

Status
Not open for further replies.

gosperglider

G

gosperglider

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?
 
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.
 
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))
 
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.
Back
Top