How to make creep respawn without used region and position of dying unit

Daisuke Niwa

New Member
Reaction score
0
How to make creep respawn without used Region and (Position of (Dying Unit)). Example [Nazel <-- (name player)] has killed a creep. Then after 2 second, the creep was respawn in position of start playing game. Thank you.....
 

trees123

New Member
Reaction score
6
It saves the starting location. The op asked for no region, or the position of the dying unit. They aren't the same in my book. If you want an example here -

Using regions in an RPG would cause you to make many, many regions for the creep spawns
Using position of the dying unit could be abused by the player. A unit could end up at the other side of the map.

Thanks for your opinion though.
 

ZugZugZealot

New Member
Reaction score
33
This will take all creeps in the map and bind their locations for when they die and their replacement will inherit the spawn location.

Trigger:
  • Creep Respawn Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set creepGroup = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in creepGroup and do (Actions)
        • Loop - Actions
          • Set i = (i + 1)
          • Set creepLocations<i> = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to i
      • Custom script: call DestroyGroup( udg_creepGroup )
    • </i>


Trigger:
  • Creep Respawn Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 2.00 game-time seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at creepLocations[(Custom value of (Triggering unit))] facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))


On a side note, for the point array "creepLocations[]" I made the size 200, of course you could make it larger, but 200 units is quite much. (I know, 0 counts making it 201, but I just figure skip it for GUI since doing the correcting arithmetic is annoying).
 

Summoned

New Member
Reaction score
51
This will take all creeps in the map and bind their locations for when they die and their replacement will inherit the spawn location.

Trigger:
  • Creep Respawn Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set creepGroup = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in creepGroup and do (Actions)
        • Loop - Actions
          • Set i = (i + 1)
          • Set creepLocations<i> = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to i
      • Custom script: call DestroyGroup( udg_creepGroup )
    • </i>


Trigger:
  • Creep Respawn Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 2.00 game-time seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at creepLocations[(Custom value of (Triggering unit))] facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))


On a side note, for the point array "creepLocations[]" I made the size 200, of course you could make it larger, but 200 units is quite much. (I know, 0 counts making it 201, but I just figure skip it for GUI since doing the correcting arithmetic is annoying).

You'll also want additional checks on things like whether the unit is summoned or an illusion. It's also "safer" to use an array for the unit type Id and a local variable to store the custom value, because if someone messes around with the target's corpse (i.e. some custom corpse explosions spell), you won't be able to get the triggering unit after 2 seconds.
 

Joccaren

You can change this now in User CP.
Reaction score
54
Spawn at Player X's start location?
It is an actual action.
Trigger:
  • Actions
    • Unit - Create 1 Footman for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
 

TheTempest

New Member
Reaction score
6
Sorry to bump the thread, but I'm trying to implement a similar method that ZugZug presented and I can't find anywhere in the triggers where you can set a custom value to a unit "Unit - Set the custom value of (Picked unit) to i"

EDIT: Woops. Sorry, I found it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top