Jump to content
Sign in to follow this  
fasterthanlight

Multiple respawn points

Recommended Posts

you can fake it:

example player units named name1 and name2.

place a trigger covering the respawn_west marker and make it a repeating anyone present.

condition:

name1 in thisList

place in on act:

name1 setPos (getMarkerPos "name1SpawnMarker");

do the same for name2, and or gather them all in a list and put in a collective trigger for all units.

Share this post


Link to post
Share on other sites

You don't get to pick which you respawn at though. He's asking so that Alpha ALWAYS respawns at a certain location, and Bravo always respawns at a certain location.

Demonized, your idea is actually really clever, I never would've thought of that.

Fasterthanlight are you looking for them to respawn on individual death or once the whole squad is dead?

Share this post


Link to post
Share on other sites

Give a name to your group and create a marker called "respawn_aplha"...Then in the init.sqf:

player AddEventHandler ["killed",{_this spawn BTC_Player_Killed;}];
BTC_Player_Killed = 
{
WaitUntil {Alive player};
switch (group player) do 
{
	case "B Alpha"  : {player setpos getMarkerPos "respawn_alpha";};
	case "B Bravo"  : {player setpos getMarkerPos "respawn_bravo";};
	case "B Charlie": {player setpos getMarkerPos "respawn_charlie";};
};

};

Share this post


Link to post
Share on other sites
Give a name to your group and create a marker called "respawn_aplha"...Then in the init.sqf:

player AddEventHandler ["killed",{_this spawn BTC_Player_Killed;}];
BTC_Player_Killed = 
{
WaitUntil {Alive player};
switch (group player) do 
{
	case "B Alpha"  : {player setpos getMarkerPos "respawn_alpha";};
	case "B Bravo"  : {player setpos getMarkerPos "respawn_bravo";};
	case "B Charlie": {player setpos getMarkerPos "respawn_charlie";};
};

};

Yes, I want to have the men auto respawn to a certain point, automatically.

I will try the above. I like it.

I am using the teleport script for now and I have this issue;

Can't respawn to height of USS Nimitz. It is 18m high.

I have this in an object name USSNIMITZ;

this setPosASL [getposASL this select 0, getposASL this select 1, 18];

But the man won't teleport there, he just drops in the water. Additionally, I can't seem to find how to make a marker show height. (That would be easiest.)

Can that be done?

Share this post


Link to post
Share on other sites

The player is spawning in the water in the lower left corner. It must be a 0,0 default axis?

No I did not. In what init would that go?

Share this post


Link to post
Share on other sites

I'm a little bit confusing :)

What do u want to do and what's your problem?

I don't understand if the multiple respawn points are fixed or the carrier is one of the possible respawn point...

Share this post


Link to post
Share on other sites

Okay. Let me try again. This kinda has 2 points now.

First, I wanted to just be able to make 3 different spawn points on the map. A group of alpha, bravo, and charlie spawns. Charlie has to spawn at height. 18m to be exact.

Then in the course of looking into this and asking about it here. I then started messing around with the teleport script.

The teleport script works very well as long as you are on the ground. I have tried to use the teleport to get a man to the Nimitz which is 18m high. The man only seems to spawn in the water. The marker that the teleport uses, I don't see a way to make it see height. I can, in place of a marker, place an object and name it Nimitz. Here I can add a spawn height for the bags. I was hoping that this would make the man teleport to the deck of the Nimitz. It does not though. He will either spawn in the water, under the carrier or at a x,y axis of 0,0.

Edited by fasterthanlight

Share this post


Link to post
Share on other sites

That's because you're spawning them on the marker's position. But the marker always has zero height... I think.

So you'll have to add 18meters to the z coord... eg:

_newpos = getMarkerPos "myMarker";

player setpos [_newpos select 0, _newpos select 1, 18]

Share this post


Link to post
Share on other sites

i used to use the setposASL but as I also wanted to use the same script to rescue the guy from the water if he stupidly fellin I made two triggers:


//this is an item placed on the ship
	class Item59
	{
		position[]={13620.6,16.5,1131.8199};
		azimut=340;
		id=89;
		side="EMPTY";
		vehicle="ZU23_CDF";
		skill=0.60000002;
		text="Boathouse";
		init="veh = [this, 60, 60] execVM ""vehicle.sqf"";this setPosASL [position this select 0, position this select 1, 16.6]";
	};
//this is a marker where the ship is
	class Item98
	{
		position[]={13653.849,16.6,1113.1461};
		name="HMS-GITS";
		text="HMS-GITS";
		type="n_mortar";
		colorName="ColorBlue";
		angle=180;
	};

//this is a sensor placed at the item
	class Item54
	{
		position[]={3919.7078,358.08487,9978.9688};
		a=0;
		b=0;
		repeating=1;
		age="UNKNOWN";
		text="Board";
		expCond="Player distance Boathouse < 50";
		expActiv="ID_Beaml = Player addAction [""~Board Ship"",""data\scripts\gocarrier.sqs""]";
		expDesactiv="Player removeAction ID_Beaml";
		class Effects
		{
		};
	};
//this is a sensor placed in the normal respawn base
	class Item57
	{
		position[]={3919.7078,358.08487,9978.9688};
		a=0;
		b=0;
		repeating=1;
		age="UNKNOWN";
		text="Transfer to Ship";
		expCond="Player distance HMSGITStransfer < 10 && basebeam >0";
		expActiv="ID_Beamj = Player addAction [""~Transfer to HMS GITS"",""data\scripts\gocarrier.sqs""]";
		expDesactiv="Player removeAction ID_Beamj";
		class Effects
		{
		};
	};

this is one script to manage sending players to the carrier

gocarrier.sqs

	_dir = random 359

//	player SetPosASL [(getMarkerPos "HMS-GITS" select 0)-15*sin(_dir),(getMarkerPos "HMS-GITS" select 1)-15*cos(_dir), 16.5]

//latest
//	player SetPosASL [(getMarkerPos "HMS-GITS" select 0),(getMarkerPos "HMS-GITS" select 1), 16.5]

_zone = getmarkerpos "HMS-GITS";
_base = "ZU23_CDF" createVehicleLocal [_zone select 0,_zone select 1,16.5];
_base setVehicleAmmo 0;
_base setposASL [_zone select 0,_zone select 1,16.5];
player moveInCargo _base;
player action ["Eject",_base];
waitUntil {Vehicle player = player};
deletevehicle _base;

exit

the sum total of this lot means you can respawn on theship from the water or another location using the same script.

this enter/eject trick stops him from still being in the swimming animation when he goes back on the ship from the water

now for your respawn logic, instead of using the sensor at base, just exec the gocarrier script on the dead guy in your respawn script

Edited by eggbeast

Share this post


Link to post
Share on other sites

I know this thread is old but after searching around I could not find a solution to fit my requirement. I devised a simple method for 2 different automatic respawn points.

Scenario is adversarial TvT type game with 3 squads per side using playable AI slots. Opfor has 1 base and always spawn/respawns there. Blufor side has 2 bases. I wanted one 4 man squad (Yellow Squad) of Blufor to always spawn/respawn in a northeast base. The remaining 2 squads of Blufor spawn/respawn on another base, marker "Respawn_West". This uses no scripts, only triggers and markers. This method toggles respawn point between 2 bases depending on which squad member dies.

Example:

Create your marker where majority Blufor spawns. Use this exact name: Respawn_West

Create a marker where squad Yellow should spawn ex. named: yellowspawn

Put this in the initialization of yellow squad leader. It will group all members of Yellow Squad.

yellowsqd = group this

Create a trigger anywhere on map.

Axis a: 0

Axib b: 0

Activation: None, Once, Present

Type: None

Name: optional

Condition:

({alive _x} count units yellowsqd) < 4

This condition describes if 1 or more members of squad yellow dies.

On Act.:

"Respawn_West" setMarkerPos getMarkerPos "yellowspawn"

This acivates the relocation of Respawn_West marker to yellowspawn marker.

Now since someone of yellow squad has died and the respawn marker has been moved to Yellow's base, we need to set the same type of triggers and markers for the other 2 squads on Blufor. This will relocate spawn marker to the other Blufor base in case of their death.

Create a marker where Blue Squad should spawn ex. named: mainspawn

Put this in the initialization of Blue squad leader. It will group Blue Squad.

bluesqd = group this

Create a trigger anywhere on map.

Axis a: 0

Axib b: 0

Activation: None, Once, Present

Type: None

Name: optional

Condition:

({alive _x} count units bluesqd) < 4

On Act.:

"Respawn_West" setMarkerPos getMarkerPos "mainspawn"

Now do the same for the last squad of Blufor and change their variables accordingly.

They could share the same marker mainspawn.

This could be done for Opfor as well, giving them multiple respawn points based on squad groups. Change their variables accordingly.

---------- Post added at 01:12 PM ---------- Previous post was at 12:29 PM ----------

I noticed one problem with this method. If I choose a yellow squad member slot and one yellow member dies, Respawn_West does not update to yellowspawn point. I must teleport back to other base and shoot him or wait for him to die again of other unnatural causes. All following respawns then function properly. I'm shure there are much more elegant solutions or maybe an extra command to force the first respawn location update for yellow squad. Any ideas?

Share this post


Link to post
Share on other sites
_respawnLocation = switch (group player) do {
   case yellowGroup: {"yellowspawn"};
   case blueGroup: {"bluespawn"};
};

_respawnMarker = createMarkerLocal ["respawn_west", getMarkerPos _respawnLocation];
_respawnMarker setMarkerShapeLocal "ICON";
_respawnMarker setMarkerTypeLocal "EMPTY";

Edited by kylania
silly syntax error :P

Share this post


Link to post
Share on other sites

Thanks for your reply kylania. I've tried running this as a script , putting this in the init and also tried putting this in a trigger. No luck yet. Any place in particular I should put this?

Share this post


Link to post
Share on other sites

In my test I put it in the init.sqf file. You'd need to make sure each group has this in it's editor placed leader's init field:

yellowGroup = group this;

and that you had "yellowSpawn" marker where you wanted them to respawn at. Same for the blue version of the group as well.

Share this post


Link to post
Share on other sites

No luck getting it to work. Your code for the init.sqf doesn't seem to have an affect. I started a new mission thinking something else maybe mucking it up with only the neccessary components to test. Its 100% repeatable. Not sure what else to do. I noticed you added a local variable to the equation which would help in MP, but still can't get past this.

I've tried adding an eventhandler such as Giallustio's and modifiying your solution kylania. The result is the same. its as if the instructions in the init.sqs have no effect or consequence. Removing triggers eliminates all concurrent respawns in the preffered spot for yellowGroup. Using -showScriptErrors in startup reveals no errors.

player AddEventHandler ["killed",{_this spawn _respawnLocation;}];
_respawnLocation = 
{
   WaitUntil {Alive player};
   switch (group player) do 
   {
       case yellowGroup: {"yellowspawn"};
       case blueGroup: {"bluespawn"};
       case redGroup: {"bluespawn"};
   };
_respawnMarker = createMarkerLocal ["respawn_west", getMarkerPos _respawnLocation];
_respawnMarker setMarkerShapeLocal "ICON";
_respawnMarker setMarkerTypeLocal "EMPTY";
};

Edited by Jigsor
addition made

Share this post


Link to post
Share on other sites

*Push*

Is there now a working solution to let TeamA & TeamB & TeamC Respawn on different Places?

Share this post


Link to post
Share on other sites
*Push*

Is there now a working solution to let TeamA & TeamB & TeamC Respawn on different Places?

Pick one.

player AddEventHandler ["killed",{_this spawn BTC_Player_Killed;}];
BTC_Player_Killed = 
{
WaitUntil {Alive player};
switch (group player) do 
{
	case "B Alpha"  : {player setpos getMarkerPos "respawn_alpha";};
	case "B Bravo"  : {player setpos getMarkerPos "respawn_bravo";};
	case "B Charlie": {player setpos getMarkerPos "respawn_charlie";};
};

};

player AddEventHandler ["killed",{_this spawn _respawnLocation;}];
_respawnLocation = 
{
   WaitUntil {Alive player};
   switch (group player) do 
   {
       case yellowGroup: {"yellowspawn"};
       case blueGroup: {"bluespawn"};
       case redGroup: {"bluespawn"};
   };
_respawnMarker = createMarkerLocal ["respawn_west", getMarkerPos _respawnLocation];
_respawnMarker setMarkerShapeLocal "ICON";
_respawnMarker setMarkerTypeLocal "EMPTY";
};

_respawnLocation = switch (group player) do {
   case yellowGroup: {"yellowspawn"};
   case blueGroup: {"bluespawn"};
};

_respawnMarker = createMarkerLocal ["respawn_west", getMarkerPos _respawnLocation];
_respawnMarker setMarkerShapeLocal "ICON";
_respawnMarker setMarkerTypeLocal "EMPTY";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×