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!
By that I mean the way in TAF or games like that after you take a city it becomes yours. If theres a Tutorial That explains this, I must have missed it, but if there isnt one please give me help with the Trigger.
Hey there, AngryRedMidget
If you want individual buildings to be captured and turned over to the player whose units have captured the building, there are several ways to do it.
The most common way is to damage the building:
Example: Capture damaged building
Events
Unit - <Building>'s life becomes less than <value>
Conditions
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
Unit - Set life of <Building> to 100%
-----
Another way is to use an ability to capture the building:
Example: Capture Building with Ability
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Capture Building
((Target unit of ability being cast) is A structure) Equal to True
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
(Remember to use an ability that can be cast on buildings for this one. "Capture Building" is just used as an example; it should be replaced by the name of the ability you have made to suit this purpose.)
-----
Finally, another way is to use or bring an item to the building. This can be done in two ways; bring an item to the building, or use an item on the building.
The first way I'll show as an example is to bring an item to the building:
First off, you need to create a unit variable which is assigned to the carrier of the unit. Make a trigger that sets the variable to the unit whenever it acquires or picks up the item. Remember to also make a trigger that nulls the variable (sets it to nothing) when the carrier of the item drops it. (In my example, it will be called ItemCarrier.)
Example: Capture Building With Item Brought
Events
Unit - A unit comes within 150.00 of ItemCarrier
Conditions
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
The other way is to use the item on the building itself:
Example: Capture Building With Use of Item
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Building Capture Item
((Target unit of issued order) is A structure) Equal to True
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
Unit - <Building>'s life becomes less than <value>
Conditions
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
Unit - Set life of <Building> to 100%
should be
"Unit - Change ownership of <attacked unit> to (Owner of (attacking unit)) and Change Color
Unit - Set life of <attacked unit> to 100%
Example: Capture Building with Ability
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Capture Building
((Target unit of ability being cast) is A structure) Equal to True
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
should be
"Unit - Change ownership of <targeted of ability being cast> to (Owner of (casting unit))
Example: Capture Building With Item Brought
Events
Unit - A unit comes within 150.00 of ItemCarrier
Conditions
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
should be
Conditions
triggering unit is a unit of type "your building goes here"
Actions
Unit - Change ownership of <triggering unit> to (Owner of (ItemCarrier)) and Change Color note "ItemCarrier" must be set as variable in another trigger
Example: Capture Building With Use of Item
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Building Capture Item
((Target unit of issued order) is A structure) Equal to True
Actions
Unit - Change ownership of <Building> to (Owner of (Killing unit)) and Change Color
should be
((Target unit of issued order) is A structure) Equal to True (NO NEED OF THIS)
conditions
unit type of unit being targeted is "your unit goes here"
actions
Unit - Change ownership of <targeted unit> to (Owner of (casting unit)) and Change Color
I admit I did have a few minor errors in my answer, but it was a very rough calculation - I was on a computer that did not Warcraft, so I could not access World Editor to check. My apologies.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.