• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Respawns are not in the right place

Status
Not open for further replies.
Level 1
Joined
Jul 30, 2009
Messages
5
Hey i really could use some help here, I've followed a few respawn tutorials but i cant figure out what the problem with my trigger is. Here's the first part of the trigger...

  • Start
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Set Integer = 1
          • Unit - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())

and heres the 2nd part.

  • Respawn Units
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Player 12 (Brown)) and ((Triggering unit) Not equal to (Summoned unit))
    • Actions
      • Wait 15.00 seconds
      • Set tempPoint[1] = (Center of (Entire map))
      • Set tempPoint[2] = (tempPoint[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Player 12 (Brown) at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
      • Custom script: call RemoveLocation(udg_tempPoint[1])
      • Custom script: call RemoveLocation(udg_tempPoint[2])
Okay, the units do respawn, but they just clump up in the northeastern part of the map. Any suggestions on fixing this or a complete new way to make the trigger? I want them to respawn in the same spot they were placed.
 
Last edited by a moderator:
Level 4
Joined
Mar 23, 2008
Messages
87
Integer is never increased in the loop.
  • Set Integer = 1
should be:
  • Set Integer = (Integer + 1)
 
Level 1
Joined
Jul 30, 2009
Messages
5
Alright I'm sorry to bother again after your help. After i got that trigger working perfectly on a map that i was merely testing it on, i remade it exactly on the actual map I'm working on. Well things respawn but again they're respawning in the wrong spot, only now directly in the middle of the map. The triggers the same but with your integer+1 change.

I changed the size of the map using the max 96x96 bounds which i suspect may be the problem... So idk, it's frustrating me dearly and I'd appreciate anymore help.
 
Status
Not open for further replies.
Top