Home   Help Search Login Register  

Author Topic: Effective Limited Respawning  (Read 1848 times)

0 Members and 1 Guest are viewing this topic.

EbolaBoy

  • Guest
Effective Limited Respawning
« on: 28 May 2003, 01:36:41 »
Does anyone know of a simple and effective method for this? The only other method I found was rediculously complicated.

Offline CrashDome

  • Members
  • *
Re:Effective Limited Respawning
« Reply #1 on: 28 May 2003, 01:39:36 »
 ???  What was so complicated? and How much easier does it need to be?

EbolaBoy

  • Guest
Re:Effective Limited Respawning
« Reply #2 on: 28 May 2003, 06:13:41 »
Wich one are you talking about? The one I was citing involved various scripts and markers....

I was looking for a one line command or something simple.

Offline CrashDome

  • Members
  • *
Re:Effective Limited Respawning
« Reply #3 on: 29 May 2003, 00:25:59 »
Well, here is a single script... untested, but I am sure it will work...

Create a file called "RespawnLimit.sqs"

Insert this code:
Code: [Select]
PrivateVariable ["_limit"]

? !(player):exit; Will exit if not a player
_limit=3; Enter your respawn limit here

#WaitForRespawn
@!(alive player); Waits for player to be dead
@(alive player);Waits for them to respawn
_limit=_limit-1; subtracts 1 from _limit
? _limit>0:goto "WaitForRespawn";if player has not reached limit then jump to beginning of loop

#EndScript
;Put whatever action you want here - such as move player to safe zone and go to spectator mode
 exit

Then, all you have to do is add the following to the init line of each playable unit
Code: [Select]
this exec "RespawnLimit.sqs"
This script is designed with the idea that you DO NOT respawn into your group. Also, make sure you place some sort of action to be taken in the #EndScript routine that moves the player out of battle zone, because the player will have respawned and could be killed again - which will completely negate the idea behind this script.

Note: Playable units that have AI will continue to respawn when killed. Take out the "? !(player):exit" if you want playable AI to have limited respawn also.
« Last Edit: 29 May 2003, 00:28:44 by CrashDome »