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

Getting start location

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,763
Hey is there a way, if a unit dies, to obtain its start location? not where it died.

Im trying to make a respawn trigger but if i make it respawn where it dies, that could be abused.
 
I think the easiest way would be to give every unit another custom value and get the location by this value.
This would look like this:
  • Respawnthings
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set Counter = (Counter + 1)
          • Unit - Set the custom value of (Picked unit) to Counter
          • Set SpawnPoint[Counter] = (Position of (Picked unit))
  • Respawnthings Copy
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Create 1 (Unit-type of (Dying unit)) for (Owner of (Dying unit)) at SpawnPoint[(Custom value of (Dying unit))] facing Default building facing (270.0) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Dying unit))

EDIT: With vJass you could also use the solution I posted here.
 
at SpawnPoint[(Custom value of (Dying unit))]

I cant find out how to do that. when i load a variable, SpawnPoint doesnt show up. Yes, ive made it.]

Edit: nvm, testing.
 
Status
Not open for further replies.
Back
Top