• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Creep Respawn

Status
Not open for further replies.
Level 4
Joined
Mar 12, 2009
Messages
64
Ive used this trigger in other maps and it has no problem working. on this new map the creeps are not spawning at their starting points. they just kept spawning some where else.

  • Creep Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Creep_Integer = (Creep_Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Creep_Integer
          • Custom script: set udg_Creep_X[udg_Creep_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Creep_Integer] = GetUnitY(GetEnumUnit())
  • Creep Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    • Actions
      • Wait 45.00 seconds
      • Set Temp_Point[1] = ((Center of (Playable map area)) offset by (0.00, 0.00))
      • Set Temp_Point[2] = (Temp_Point[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 Neutral Hostile at Temp_Point[2] facing Default building facing degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
      • Custom script: call RemoveLocation(udg_Temp_Point[1])
      • Custom script: call RemoveLocation(udg_Temp_Point[2])
is there anything wrong with it?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Center of Playable map isn't (0,0) its (half of your playable map, half of your playable map) so whenever your respawning half of the playable map up and half of the playable map to the right. (killing at bottomleft will respawn at center, killing at center will respawn topright, killing topright will glitch)

you can do 4 things

1) Do Shadowvzs's method (never tested it before)

2) You can use my efficient system that someone made for me (ill link you it if u need it, its written in vJass so make sure u know what that is)

3) Change the setting of TempPoint 2 to a conversion of X and Y co-ordinates to a point

4) Change it to, rather setting an X and Y, set TempPoint = Position of unit, CreepPoint[custom value] = temppoint. and destroy temppoint
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Center of Playable map isn't (0,0) its (half of your playable map, half of your playable map) so whenever your respawning half of the playable map up and half of the playable map to the right. (killing at bottomleft will respawn at center, killing at center will respawn topright, killing topright will glitch)

you can do 4 things

1) Do Shadowvzs's method (never tested it before)

2) You can use my efficient system that someone made for me (ill link you it if u need it, its written in vJass so make sure u know what that is)

3) Change the setting of TempPoint 2 to a conversion of X and Y co-ordinates to a point

4) Change it to, rather setting an X and Y, set TempPoint = Position of unit, CreepPoint[custom value] = temppoint. and destroy temppoint

1) that methode around 5 year or or older :D long long time ago, before hashtable patch i used when i worked on another map around 2006 on thehelper.net, so its not a new thing the saveing to global variable array the X,Y where index is the custom value

3/4 both have useless functions calls, i mean with useing CreateUnit(Player(x),'rawcode',x,y,ang) dont need point, just +1 custom script but less with creating location from coordinated/removelocation etc
 
Status
Not open for further replies.
Top