Hi there,
I'm new to triggering on SC2 and I was wondering how I would go about making something like this:
I want a certain building (representing a city) that when destroyed respawns in the location it was placed and changes possession to the player that killed said city. If possible I would like to do this with any number of these buildings around a given map without an individual trigger/location for each. If there is an intuitive and simple way to do this that is what I'd like know. If this requires the data editor I would also like to know what is necessary in that case.
Thank you!
None.
An artist's depiction of an Extended Unit Death
RespawnUnitForKillingPlayer
Events
Unit - Any Unit dies
Local Variables
unitType = (Unit type of (Triggering unit)) <Game Link - Unit>
killingPlayer = (Owner of (Killing unit)) <Integer>
deathPoint = (Position of (Triggering unit)) <Point>
Conditions
Or
Conditions
unitType == Supply Depot
unitType == Barracks
unitType == Pylon
Actions
Unit - Create 1 unitType for player killingPlayer at deathPoint using default facing (No Options)
Basically, on the event where a unit dies, you want to check if that unit is the certain unit you want. In the example above, this checks if the unit is a supply depot, barracks, or pylon. Then you just need to grab the killing player and the position of the dying unit. I put them in color-coded variables so you can see them easily.
If you only need to do this for one type of unit, you don't need the "Or" condition.
Hope this helps!
Wow thank you so much, I'm going to try to implement this later. If I have any trouble I'll come back here.
Once again though, that was really helpful.
Edit 1: Under variables I can't seem to find killingPlayer, I foudn unitType though.
Edit 2: never mind figured it out, (seriously like the first trigger I've ever made on galaxy) thank you again
Edit 3: Question do I need to add a preserve trigger to make this trigger fire always?
Post has been edited 2 time(s), last time on Jun 20 2011, 1:20 am by Roy. Reason: Don't double/triple/quadruple post
None.
An artist's depiction of an Extended Unit Death
No, everything is assumed as preserved unless you disable the trigger (there's an action called "Turn Trigger On/Off").
Thanks mate, I ended up figuring it out but you've been very helpful. Gonna send some good karma your way.
None.