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

Respawning creeps?

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
The best idea would be to set up a table that memorises the position of the creeps at map init, when the creep dies, revive him at the point where he initially started (this is to avoid creeps ganging, or creeps being at places where they shouldn't be).

Erm... I don't really know how to explain this in newb-terms.

You can also just do the unoriginal, buggy "A unit dies - wait X seconds, create 1 unit type of triggering unit at position of triggering unit".
But a map containing that trigger has a high chance of getting rejected ^^
 
Level 6
Joined
Aug 26, 2009
Messages
221
  • creep respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 60.00 seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
a very, very, very simple trigger, and sure it can leak or not MUI
if you not want it, here another:
  • creep respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Custom script: local unit killedunit
      • Custom script: local integer respwnedTime
      • Custom script: set killedunit = GetTriggerUnit()
      • Custom script: set respwnedTime = 60
      • Custom script: call PolledWait(respwnedTime)
      • Custom script: call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetTriggerUnit()), GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()) )
EDIT: @ap0calypse : are you mean this?
  • Creep Revival System 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 Integer = (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())
  • Revive Creeps
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    • Actions
      • Custom script: local integer respwnedTime
      • Custom script: set respwnedTime = 60
      • Custom script: call PolledWait(respwnedTime)
      • 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 Neutral Hostile at tempPoint[2] 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])
 
Last edited:

Spo

Spo

Level 6
Joined
Jun 1, 2009
Messages
122
  • creep respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 60.00 seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
a very, very, very simple trigger, and sure it can leak or not MUI
if you not want it, here another:
  • creep respawn
    • Events-
      • Unit - A unit Dies
    • Conditions-
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions-
      • Custom script: local unit killedunit
      • Custom script: local integer respwnedTime
      • Custom script: set killedunit = GetTriggerUnit()
      • Custom script: set respwnedTime = 60
      • Custom script: call PolledWait(respwnedTime)
      • Custom script: call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetTriggerUnit()), GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()) )
EDIT: @ap0calypse : are you mean this?
  • Creep Revival System 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 Integer = (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())
  • Revive Creeps
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    • Actions
      • Custom script: local integer respwnedTime
      • Custom script: set respwnedTime = 60
      • Custom script: call PolledWait(respwnedTime)
      • 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 Neutral Hostile at tempPoint[2] 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])

I have this trigger:
  • Events
  • Time - Elapsed Game Time 0.00 Seconds
  • Conditions
  • Actions
  • Wait 5.00 Seconds
  • Unit - Create Banshee For Neutral Hostille at (Center of hero spawn <gen>) facing default building faceing degrees
But it only does it one time :(
 
Level 11
Joined
Feb 14, 2009
Messages
884
Because the elapsed time happens once. Do as The-Rave suggests, after fixing the leaks of course ^^
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • creep respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 60.00 seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
a very, very, very simple trigger, and sure it can leak or not MUI
if you not want it, here another:
  • creep respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Custom script: local unit killedunit
      • Custom script: local integer respwnedTime
      • Custom script: set killedunit = GetTriggerUnit()
      • Custom script: set respwnedTime = 60
      • Custom script: call PolledWait(respwnedTime)
      • Custom script: call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetTriggerUnit()), GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()) )
EDIT: @ap0calypse : are you mean this?
  • Creep Revival System 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 Integer = (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())
  • Revive Creeps
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    • Actions
      • Custom script: local integer respwnedTime
      • Custom script: set respwnedTime = 60
      • Custom script: call PolledWait(respwnedTime)
      • 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 Neutral Hostile at tempPoint[2] 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])
Lol at your first answer... (though I'm serious: a map with that trigger will probably get rejected xD)

It's somehow what I meant, though I like a timer-system (with a real) a lot more than the polled wait.
It's also easier to edit the time needed to respawn, which doesn't necessarily have to be the same for each creep and it's very precise.
Also, custom value van be changed with another variable (it's a good option, but it may have been used for something else).
And when you have time, fix the unit group leak ^^

But it's a good trigger, probably the best option for Spo.

@ Spo: Do not double post, please... you can use the "edit" button on top of your post when you want to add something, double posting is against the rules.
 
Last edited:
Status
Not open for further replies.
Top