Retry count - 3

Ncrackz

New Member
Reaction score
2
Basically In my map it is VERY EASY to die, soo I figured is there a way to make after everyone dies, they respawn to a certain checkpoint? :)

Any help is appreciated.
 

FireBladesX

Eating my wings!
Reaction score
123
Make the units that you want to respawn in a unit group. Then, every time a unit dies, check the number of units in the group that are alive.
If none of them are alive, respawn (or create, if they aren't heroes) the units at your checkpoint.

I don't know if you already have a checkpoint system, but in my opinion you could have periodic buildings around the map (checkpoints), and when you kill them you get a unit (the checkpoint) there. You remove the old checkpoint (a variable), and set the last created unit to your checkpoint variable.
 

Ncrackz

New Member
Reaction score
2
I can put them in a unit group, but i don't know how to actually make it so that if they ALL die they respawn at a region.
 

Cheesy

some fucker
Reaction score
95
Something among these lines:

1. Create an integer variable to represent number of user-controlled players. (playersAlive)
2. Create a unit group variable to represent the players' maze runners. (runnerGroup)
3. Create a region variable to represent the current respawn region.
4. Create Regions at all of your checkpoints.
5. Create a Trigger like this: (Freehand)
Code:
     Events -
          A unit dies
     Conditions -
         Owner of (Dying Unit) equal to (Controlled by a (User))
     Actions -
          Set playersAlive = (playersAlive - 1)

6. Create a second trigger that checks the number of players that are alive. (Freehand)
Code:
     Events -
          Every 0.5 seconds of game-time
     Conditions -
          playersAlive (less than or equal to) 0
     Actions -
          Pick every unit in runnerGroup and do Actions -
          Loop - Actions
               Revive (Picked Unit) at (Random Point in (currentRegion)) show revival graphics
          set playersAlive = Number of players controlled by a user

7. Create a third and final trigger*that sets the current respawn region. (Freehand)
Code:
     Events -
           A Unit enters <YOUR REGION>
     Conditions -
          Entering Unit equal to <YOUR UNIT TYPE>
     Actions -
          set currentRegion = <YOUR REGION>

* - You will need to create multiple instances of this trigger for each respawn region.




Good luck, hope this helped! I hope I didn't leave anything out.

Happy to help,
CheesyBeefy :thup:
 
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