• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Getting start location

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
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.
 
Level 4
Joined
Aug 30, 2009
Messages
70
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.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
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.
Top