• 🏆 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!

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,208
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