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

Change owner when...

Status
Not open for further replies.
Level 5
Joined
Oct 6, 2010
Messages
85

I have special buildings all around my map and I need a trigger to Change the owner of those buildings when a player puts a flag in a specific region.


I imagine that it would go something like this:

Event - A building is built in [Region]
Condition - Owner of built structure is equal to [Player]
Action - Change owner and colour of 'unit' to [Player]
 
Something like this:
  • Untitled Trigger 035
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Barracks
      • (region contains (Constructed structure)) Equal to True
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Gryphon Aviary) and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to (Triggering player) and Change color
 
This seems to work but I don't know if it works for all players

197680-albums4574-picture44889.png
 
It should be Owner of Triggering Unit, not Triggering Player. Change that, and the trigger he made for you should work.

Both can be used:
Owner of Triggering unit
Triggering player
Owner of Triggering unit = Triggering player

Triggering player executes at a higher rate speed.

Trigger Example:
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Banish
    • Actions
      • Unit - Change ownership of (Target unit of ability being cast) to (Triggering player) and Change color
 
Status
Not open for further replies.
Back
Top