Enemy Respawn, Random Positions?

Matemeo

New Member
Reaction score
20
In the map I'm making I want enemies that die, to be respawned, in a random spot, inside of 1 big region. So..If I was to kill Enemy 1, then I would want him to respawn somewhere random inside the region, is this possible? Would hopefully like to stick to GUI. Thanks in advance.
 

hi_im_bob

......and you are?
Reaction score
44
Dont have WE open but something like this:

Event- A Unit Dies

Condition- Unit Equal to YOUR UNIT

Action- Create 1 YOUR UNIT for YOUR PLAYER In Random Point in Region YOUR REGION Facing ..... Degrees
 

Curuinor

New Member
Reaction score
7
Set a temporary point var to a random point in the big region then destroy it after spawning, because that trigger is going to trigger a hell of a lot, and you don't want a leak in a trigger like that.
 
P

Peanuthead

Guest
I once designed a respawn trigger that went something like this. At init you set all possible regions the unit can respawn in to a array variable like this. And its no good to use big regions because the unit may end up somewhere unaccessible.
Code:
Set ReSpawnRegions[1] = Region 001
Set RespawnRegions[2] = Region 002

Then create a integer variable which tracks the amount of enemies alive. Set it to the number of alive at init.
Code:
E A Unit Dies
C Unit is Creepy = True
A Set CreepyCount = CreepyCount - 1

Then a periodic trigger which will respawn units if there is too little.
Code:
E Ever 5 seconds
A
If 
CreepyCount < 90
    Then 
    For Each Integer from 1 to (total number of respawn regions)
       Loop - Actions
       If 
       Initeger Comparison - (Number of Units Matching Condition (Matching Unit) is a hero = true) in RespawnRegion[A] = 0
       Integer Comparison - (Number of Units Matching Condition (Matching Unit) is creepy = true) in RespawnRegion[A] < 5
             Then
             Unit - Create 1 CreepyThing at Random Point in RespawnRegion[A]
             Else
             Do Nothin
It would go through all of the possible respawn regions and make sure that A - there is no player there at the moment and B - theres not too many creeps there already. Its bad to respawn a unit while a player is there, makes you look like a noob. And the method is filled with memory leaks, i'd patch all them leaks up.
 

Curuinor

New Member
Reaction score
7
That trigger won't stop if the creepycount goes below 90; add a creepycount = creepycount + 1 in the trigger.
 
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