Staredit Network > Forums > SC2 Assistance > Topic: [Solved] Diplomacy type trigger
[Solved] Diplomacy type trigger
This topic is locked. You can no longer write replies here.
Jun 19 2011, 10:20 pm
By: Veta  

Jun 19 2011, 10:20 pm Veta Post #1



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.

Jun 19 2011, 11:20 pm Roy Post #2

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!




Jun 19 2011, 11:31 pm Veta Post #3



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.

Jun 20 2011, 1:20 am Roy Post #4

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").




Jun 20 2011, 3:53 am Veta Post #5



Thanks mate, I ended up figuring it out but you've been very helpful. Gonna send some good karma your way.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: lil-Inferno, IlyaSnopchenko, Roy