Jump to content
doomnet

How to disable respawn module for predefined players ???

Recommended Posts

Hi everyone,

 

I'm using respawn module for infantry, what i want to know, is there a way to disable a respawn module for a selected player or group ?

 

i have two respawn modules one is for all blufor players, and other one is for vip players, i want the respawn module for vip players to be invisible to other players.

 

is that possible, what do i have to put in the init of the respawn module ?

 

i tried with hide/module linked to players and respawn module, but it doesn't work.

Share this post


Link to post
Share on other sites

Hi everyone,

 

I'm using respawn module for infantry, what i want to know, is there a way to disable a respawn module for a selected player or group ?

 

i have two respawn modules one is for all blufor players, and other one is for vip players, i want the respawn module for vip players to be invisible to other players.

 

is that possible, what do i have to put in the init of the respawn module ?

 

i tried with hide/module linked to players and respawn module, but it doesn't work.

Help pls someone i'm sure its very simple to do this but i cannot find an answer on the internet have search all day long, i'm stuck cannot finish mission with this problem

Share this post


Link to post
Share on other sites

You cannot have different respawns for units on the same side (or in your case only have some BLUFOR units able to respawn).

 

You could have the VIPs on the GUER side (set friendly to BLUFOR) and have GUER with their own respawn markers (I'm assuming you can do this with the modules as well but have not used them before myself).

 

See here for more info:

 

https://community.bistudio.com/wiki/Arma_3_Respawn

  • Like 1

Share this post


Link to post
Share on other sites

You cannot have different respawns for units on the same side (or in your case only have some BLUFOR units able to respawn).

 

You could have the VIPs on the GUER side (set friendly to BLUFOR) and have GUER with their own respawn markers (I'm assuming you can do this with the modules as well but have not used them before myself).

 

See here for more info:

 

https://community.bistudio.com/wiki/Arma_3_Respawn

yes ok i think i'm gonna follow your suggestion, since i think its the best way to achieve this ! thank you for the reply !

Share this post


Link to post
Share on other sites

You cannot have different respawns for units on the same side (or in your case only have some BLUFOR units able to respawn).

 

You could have the VIPs on the GUER side (set friendly to BLUFOR) and have GUER with their own respawn markers (I'm assuming you can do this with the modules as well but have not used them before myself).

 

See here for more info:

 

https://community.bistudio.com/wiki/Arma_3_Respawn

 

well after thinking about my mission it will not be possible to use GUER as i am already using GUER faction and the mission is Team vs Team multiplayer so even if i use GUER as Vip faction i will not be able to have Vip on other faction because there is no other faction i can use, and i will not use OPFOR or CIV, so this is not working for me.

 

i thinks its possible with a marker on the map and some code like this:

 

if player is kind of B_officer_F then set respawn marker Vip ...........etc......

 

but as you see i'm a newbie in scripting

 

is this possible ?

could someone help me with some coding ?

Share this post


Link to post
Share on other sites

There are two ways to accomplish this..

 

1. By automatically moving VIPs to a marker position when they respawn. As you mention VIPs as by type B_Officer_F in your previous post.

onPlayerRespawn.sqf

if ( player isKindOf "B_Officer_F" || player isKindOf "O_Officer_F" ) then {
    player setPosATL getMarkerPos format[ "VIP_Respawn_%1", side player ];
};

2. By using the respawn template "menuPosition" as can be seen in the Arma3 Respawn documentation on the Wiki. So you have your normal respawn marker called respawn_west or what ever side.

In your initPlayerLocal.sqf

if ( player isKindOf "B_Officer_F" || player isKindOf "O_Officer_F" ) then {
    [ player, format[ "VIP_Respawn_%1", side player ] ] call BIS_fnc_addRespawnPosition;
};

So for either option, if the player is of type #_Officer_F then it selects either "east" or "west" based off of their side. This is then added to the string "VIP_Respawn_" and either the player is automatically moved there(1) or the marker name is added to the players available respawn positions(2).

Both these scripts onPlayerRespawn.sqf and initPlayerLocal.sqf are specail files that will be automatically run on respawn or at mission start (init).

  • Like 2

Share this post


Link to post
Share on other sites

There are two ways to accomplish this..

 

1. By automatically moving VIPs to a marker position when they respawn. As you mention VIPs as by type B_Officer_F in your previous post.

onPlayerRespawn.sqf

if ( player isKindOf "B_Officer_F" || player isKindOf "O_Officer_F" ) then {
    player setPosATL getMarkerPos format[ "VIP_Respawn_%1", side player ];
};

2. By using the respawn template "menuPosition" as can be seen in the Arma3 Respawn documentation on the Wiki. So you have your normal respawn marker called respawn_west or what ever side.

In your initPlayerLocal.sqf

if ( player isKindOf "B_Officer_F" || player isKindOf "O_Officer_F" ) then {
    [ player, format[ "VIP_Respawn_%1", side player ] ] call BIS_fnc_addRespawnPosition;
};

So for either option, if the player is of type #_Officer_F then it selects either "east" or "west" based off of their side. This is then added to the string "VIP_Respawn_" and either the player is automatically moved there(1) or the marker name is added to the players available respawn positions(2).

Both these scripts onPlayerRespawn.sqf and initPlayerLocal.sqf are specail files that will be automatically run on respawn or at mission start (init).

ok thanks i'm goona try this out later today!

Share this post


Link to post
Share on other sites

There are two ways to accomplish this..

 

1. By automatically moving VIPs to a marker position when they respawn. As you mention VIPs as by type B_Officer_F in your previous post.

onPlayerRespawn.sqf

if ( player isKindOf "B_Officer_F" || player isKindOf "O_Officer_F" ) then {
    player setPosATL getMarkerPos format[ "VIP_Respawn_%1", side player ];
};

2. By using the respawn template "menuPosition" as can be seen in the Arma3 Respawn documentation on the Wiki. So you have your normal respawn marker called respawn_west or what ever side.

In your initPlayerLocal.sqf

if ( player isKindOf "B_Officer_F" || player isKindOf "O_Officer_F" ) then {
    [ player, format[ "VIP_Respawn_%1", side player ] ] call BIS_fnc_addRespawnPosition;
};

So for either option, if the player is of type #_Officer_F then it selects either "east" or "west" based off of their side. This is then added to the string "VIP_Respawn_" and either the player is automatically moved there(1) or the marker name is added to the players available respawn positions(2).

Both these scripts onPlayerRespawn.sqf and initPlayerLocal.sqf are specail files that will be automatically run on respawn or at mission start (init).

 

well i have i tried it and it ddin't work. do i have to name the marker like this VIP_Respawn_ ?

Share this post


Link to post
Share on other sites

Yes name the markers "VIP_Respawn_1", "VIP_Respawn_2" or similar - the script will pick up any marker that starts with "VIP_Respawn_" and add it to the respawn list

i just tried it again with correct name but no respawn available, i tried both onrespawn and initplayer local files it does nothing and don't get it

Share this post


Link to post
Share on other sites

Sorry try VIP_Respawn_East, VIP_Respawn_West, etc

 

Little low on sleep today

Share this post


Link to post
Share on other sites

Sorry try VIP_Respawn_East, VIP_Respawn_West, etc

 

Little low on sleep today

 

I did that also, it doesn't come up i have only my normal base marker coming up respawn_guerrila, and a made a marker named like this:  VIP_Respawn_guerrila, and use your code in initPlayerlocal :

if ( player isKindOf "B_Officer_F" || player isKindOf "I_Officer_F" ) then {
    [ player, format[ "VIP_Respawn_%1", side player ] ] call BIS_fnc_addRespawnPosition;
};

but have only normal marker respawn_guerrila coming up no second VIP respawn

Share this post


Link to post
Share on other sites

maybe i'm wrong but if call the marker like this : respawn_guerrilaVIP_1 it works but then everybody can respawn in vip base that's is what we don't want to happen

 

 

 

 

 

???

Share this post


Link to post
Share on other sites

what if i use the respawn module, what can i put in his init field ?

 

is it possible to execute a script from respawn module with a condition, for exemple only I_officer_F can respawn on the module ???

Share this post


Link to post
Share on other sites

Heres a test mission showing both options.

 

West uses the automatic move to marker position on respawn option, if the player is of type "B_Officer_F".

The two markers are named..

"respawn_west" which is the default name used for the West side.

"VIP_Respawn_West" for the VIP respawn marker ("VIP_Respawn_#" where # is the players side).

 

On respawning if you are the rifleman you will be placed at the "respawn_west" marker out on the runway. If you are the officer you will be placed in the hanger.

NOTE: At game start every West player will be spawned at the "respawn_west" marker. If you want everyone start at their designated marker then set respawnOnStart to 1 in the description.ext.

This option works via the onPlayerRespawn.sqf where if you are a "B_Officer_F" you are moved to the marker "VIP_Respawn_West".

 

 

 

Guer (Independent) uses the menuPosition respawn template method.

The two markers are named..

"respawn_guerrila" which is the default name used for the Independent side.

"VIP_Respawn_guer" for the VIP respawn marker, ("VIP_Respawn_#" where # is the players side) NOTE : side player of an Independent unit returns GUER so the VIP respawn markers name is slightly different from the name you use on the base marker (guerrila).

 

On respawning you will be shown the respawn menu where you can choose the position to respawn at. If you are an officer you will have the added option of the VIP marker.

As like the previous option at the start of the mission every Independent player will spawn at the default "respawn_guerilla" marker. If you want everyone to be able to choose there starting position set respawnOnStart to 1 in the description.ext.

This option works by applying the menuPosition template to the guer side in the description.ext. It also uses initPlayerLocal.sqf where if you are a "I_Officer_F" it will add the marker position "VIP_Respawn_Guer" to your available respawn positions.

  • Like 1

Share this post


Link to post
Share on other sites

Ok thanks for the hard work and reply,

i found another way to do this but i miss some code !

 

i made respawnOnLeader.sqf:

if(isDedicated) exitWith {};
_side = side player;
waituntil {
  "respawn_guerrila" setMarkerPosLocal (getPos leader player);
  "respawn_west" setMarkerPosLocal (getPos leader player);
  sleep 0.5;
  0 > 1
};

i call this file from init.sqf : execVM "respawnOnLeader.sqf";

 

Then i made groups for exemple Vip group with the leader being AI soldier in Vip base, so only vip players in the same group can respawn in Vip base, that works, also i have a respawn module in normal base so Vip's can choose which base to respawn.

 

But one thing that is not working is for other groups, when they are killed, they respawn where they died. That's not what i want.

So i have the other piece of code i found but don't know how to put it together with the other code here above, maybe you can help me with this ?

// Call from init.sqf with:
//   [] execVM "data\scripts\respawnOnLeader.sqf";

if (not isDedicated) then {
	[] spawn {
		waitUntil { alive player };
		player addEventHandler ["KILLED", {
			[] spawn
			{
				private ["_leader", "_spawnPos"];
				waitUntil { alive player };
				_leader = leader player;
				if ((alive _leader) and (player != _leader)) then {
					// Move the player just behind the leader, but ensure they arrive on the ground.
					_spawnPos = (vehicle _leader) modelToWorld [0, -2, 0];
					_spawnPos set [2, 0]; // Ensure respawn on the ground.
					player setPos _spawnPos;
				};
			};
		}];
	};
};

This code doesn't work at all, but i need the player to respawn behind Team leader and not respawn where you die.

Btw why in this code here above it begins with "if (not isDedicated) then {" ?

 

how can i merge these two codes to work together ?

so that a player in squad gets killed he will respawn 2 meters behind squad leader, and if he is dead then you respawn at base.

That is what this code should do but it has no effects.

 

Exemple:

//working code !

if(isDedicated) exitWith {};
_side = side player;
waituntil {
  "respawn_guerrila" setMarkerPosLocal (getPos leader player);
  "respawn_west" setMarkerPosLocal (getPos leader player);
  sleep 0.5;
  0 > 1
};

//not working code but needed !

// Call from init.sqf with:
//   [] execVM "data\scripts\respawnOnLeader.sqf";

if (not isDedicated) then {
	[] spawn {
		waitUntil { alive player };
		player addEventHandler ["KILLED", {
			[] spawn
			{
				private ["_leader", "_spawnPos"];
				waitUntil { alive player };
				_leader = leader player;
				if ((alive _leader) and (player != _leader)) then {
					// Move the player just behind the leader, but ensure they arrive on the ground.
					_spawnPos = (vehicle _leader) modelToWorld [0, -2, 0];
					_spawnPos set [2, 0]; // Ensure respawn on the ground.
					player setPos _spawnPos;
				};
			};
		}];
	};
};

Ho to merge these script code together ?

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

×