A couple of more things on respawning players that probably belongs here, seeing as its supposed to be a reference post
____________________________________________________________________
Creating random respawn areasie where a soldier respawns in one of X amount of respawn zones
Script as follows
--------------------------------------------------------------------------
;Respawn.sqs (random respawn)
_player = _this select 0
_numzone = _this select 1
_radius = 50
_respawnzone = "Respawn_West"
;randomly choose a respawn zone:
_num = random(_numzone)
;get integer
_num = _num - (_num mod 1)
-------------------------------------------------------------------------------
Create a marker for each respawn zone you want
Call them (if you want west to have the random respawn location)
respawn_west
respawn_west1
respawn_west2 etc etc
--------------------------------------------------------------------------------
For each soldier you want to respawn in these randon locations, create the following trigger
(As seen in mission.sqm file)
class Item0
{
position[]={8654.632813,9.634197,12625.308594};
a=0.000000;
b=0.000000;
repeating=1;
age="Actual";
text="A1_Respawn";
name="A1_Respawn";
expCond="!(alive A1)";
expDesactiv="[A1,6]exec ""respawn.sqs""";
class Effects
{
};
};
--------------------------------------------------------------------------
Where A1 is the name of the soldier
and "expDesactiv="[A1,6]"
the 6 denotes the number of respawn zones you created
ie respawn_west to respawn_west5
________________________________________________________________________
_________________________________________________________________________
If you want an extra respawn zone in addition to respawn_west; rescue_respawn.sqs
; Script that respawns players in a specific zone.
; Simplified from Backoff's multiple respawn script.
;
; Syntax: [player name, respawn marker name] exec "respawn_rescue.sqs"
;
; "Player name" is the name given to the player.
; "respawn marker name" is the name of the respawn marker the player
; should respawn in.
;
; Example: [Rescue1, "rescuers_area"] exec "respawn_rescue.sqs"
;
_player = _this select 0
_zone = _this select 1
_radius = 10
_pos = getMarkerPos _zone
; Create random number to set the player position
_randx = random (_radius)
? ( random(10) < 5 ): _randx = _randx * -1
_randy = random(_radius)
? ( random(10) < 5 ): _randy = _randy * -1
; Set the position.
_player setpos [(_pos select 0) + _randx, (_pos select 1) + _randy, 0]
Exit
-------------------------------------------------------------------------------------
Create a marker for it, calling it ****_respawn
in the following example this is called "rescue_respawn"
----------------------------------------------------------------------------
and then a trigger for each player that is required to respawn at this other location
In this example player is called "RP5"
------------------------------------------------------------------------------
class Item19
{
position[]={8673.614258,6.824206,12584.245117};
a=0.000000;
b=0.000000;
repeating=1;
age="UNKNOWN";
text="RP5 respawn trigger";
name="RP5_Respawn_";
expCond="alive RP5";
expActiv="[RP5, ""rescue_respawn""] exec ""rescue_respawn.sqs""";
class Effects
{
};
};
};
};