Jump to content
Ry4nD

Update to multiplayer Support requester

Recommended Posts

https://github.com/rcantec/Support-Requester

 

//Support Requester By RCANTEC(RyanD) 2018
_this select 0 synchronizeObjectsAdd [SupportRequester];
SupportRequester synchronizeObjectsAdd [_this select 0];
BIS_supp_refresh = TRUE;
publicVariable "BIS_supp_refresh";
if (typeOf (_this select 0) isEqualTo "B_T_Sniper_F") then {
[_this select 0, SupportRequester, ArtilleryProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, CasProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, TransportProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, AmmoProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, HelicasProvider] call BIS_fnc_addSupportLink;
};

Add initPlayerLocal.sqf to your mission root folder, place labeled support modules.

Place Support requester module named SupportRequester

Then place virtual Support modules for each named;

ArtilleryProvider, CasProvider, TransportProvider, AmmoProvider, HelicasProvider

Sync each virtual module back the the main SupportRequester module.

The line containing if (typeOf (_this select 0) isEqualTo "B_T_Medic_F") then {

Whereas quoted class type can be any playable unit "B_T_Medic_F"

playable units with same class name will have the support enabled.

 

If you want to see how it is implemented in a multiplayer mission, you can try my Malden Insurgency https://github.com/rcantec/Malden_Insurgency_R1.Malden

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

So you can have multiple units using the support modules now. If this is true great work I never understood why boheima did that in the vallina game. 

  • Like 1

Share this post


Link to post
Share on other sites

Yes which ever units you white-list, will have the support available ;-) 

Share this post


Link to post
Share on other sites

Does this still work after a player respawns in a coop game, MP, or dedicated.

 

Thanks,

  • Like 1

Share this post


Link to post
Share on other sites
On 21/04/2018 at 9:59 AM, Jnr4817 said:

Does this still work after a player respawns in a coop game, MP, or dedicated.

 

Thanks,

Yes, if you die, or respawn it will still work in multiplayer and or on a dedicated server

  • Like 1

Share this post


Link to post
Share on other sites

@Doctor-Vanilla I just got around updating some old mission however I can' t get this to work. followed you directions

 

 

Add initPlayerLocal.sqf to your mission folder, place labeled support modules.

Place Support requester module named SupportRequester

Then place virtual Support modules for each named;

ArtilleryProvider, CasProvider, TransportProvider, AmmoProvider, HelicasProvider

Sync each virtual module back the the main SupportRequester module.

The line containing if (typeOf (_this select 0) isEqualTo "B_T_Medic_F") then {

Whereas quoted class type can be any playable unit "B_T_Medic_F"

playable units with same class name will have the support enabled.

 

I just added  B_Soldier_UAV_F and  B_Recon_JTAC_F

I have four groups each has one of the soldiers nothing shows up when I sink the  Support requester module to one of them it works for him only and not the other three soldiers if I DON'T sink none of them get the ability. What am I doing wrong. Avibird

Share this post


Link to post
Share on other sites

Has anyone used this. Does this work with Teamswitch enable or does this only work with human players. 

 

I open his demo mission insurgence and enable Teamswitch but only the first unit I picked has the support. It works with the five different units he has in the script but I think only for human players. So if you use Teamswitch into one of the other units who have the ability to call support it will not work ? 

 

I would like to get this to work with Teamswitch Avibird

 

 

 

 

Share this post


Link to post
Share on other sites
On 07/05/2018 at 8:23 PM, avibird 1 said:

Has anyone used this. Does this work with Teamswitch enable or does this only work with human players. 

 

I open his demo mission insurgence and enable Teamswitch but only the first unit I picked has the support. It works with the five different units he has in the script but I think only for human players. So if you use Teamswitch into one of the other units who have the ability to call support it will not work ? 

 

I would like to get this to work with Teamswitch Avibird

 

 

 

 

You can see how it is configured in one of my mission files, https://github.com/rcantec/Pre-packed-Missions

Share this post


Link to post
Share on other sites
On 07/05/2018 at 8:23 PM, avibird 1 said:

Has anyone used this. Does this work with Teamswitch enable or does this only work with human players. 

 

I open his demo mission insurgence and enable Teamswitch but only the first unit I picked has the support. It works with the five different units he has in the script but I think only for human players. So if you use Teamswitch into one of the other units who have the ability to call support it will not work ? 

 

I would like to get this to work with Teamswitch Avibird

 

 

 

 

It should work regardless of teams, as it uses your player class, the pre-defined class as you chose in the lobby, once in game, if you switch teams, you would still be a "sniper" so if if (typeOf (_this select 0) isEqualTo "B_T_Sniper_F") then { 

than remains true, you would still have the support enabled for that class. Hope that helps.

Share this post


Link to post
Share on other sites

Hey like I said. 

 

I open his demo mission insurgence and enable Teamswitch but only the first unit I picked has the support. It works with the five different units that you have in the script but if you teamswitch into one of the other units you set in the script it does not work. I hope you understand what I am saying.

 

 

 

 

 

Share this post


Link to post
Share on other sites

I took a look to see if it would work in SP as it looks like it should if it works in MP  but it gives the same result only first unit has support.

I also tried using onteamswitch to run the code again but it still doesn't work.

  • Thanks 1

Share this post


Link to post
Share on other sites

I have a script code block that allows the player to keep their request modules  link to him during teamswitch into any unit. But  that's not exactly what I want. I just want to have the ability to have one unit within a  Squad  to have the ability but have multiple squads in a mission each with one unit who has the ability.

Share this post


Link to post
Share on other sites

Yes  I can do that as well but this script was little simpler if it worked.

I used teamswitch to force the script to run again  after switching just to see if that would work but it didn't.

Share this post


Link to post
Share on other sites
On 11/05/2018 at 8:04 PM, f2k sel said:

I took a look to see if it would work in SP as it looks like it should if it works in MP  but it gives the same result only first unit has support.

I also tried using onteamswitch to run the code again but it still doesn't work.

Yes only the defined unit will have support B_T_Sniper_F anyone else in the group does not have it. If you want additional units to have the same abilities, you can just whitelist them, as defined by their class name. 

Share this post


Link to post
Share on other sites
On 11/05/2018 at 11:21 PM, avibird 1 said:

I have a script code block that allows the player to keep their request modules  link to him during teamswitch into any unit. But  that's not exactly what I want. I just want to have the ability to have one unit within a  Squad  to have the ability but have multiple squads in a mission each with one unit who has the ability.

Yes, so define a TL in each squad, and then all TL will have the support. 

Share this post


Link to post
Share on other sites
22 minutes ago, Doctor-Vanilla said:

Yes only the defined unit will have support B_T_Sniper_F anyone else in the group does not have it. If you want additional units to have the same abilities, you can just whitelist them, as defined by their class name. 

 

 

I had several units all same type but not grouped but when switching to them they had no support.

I can't test right now do they need to be in the same group?

Share this post


Link to post
Share on other sites

same here f2k sel .  @Doctor-Vanillaeven in your demo mission. All five units have the ability to call support only if you start with that unit. If you team switch into one of the other four units you setup  it does not work during the mission sorry to say.  I don't think you understand. You can't have multiple units at the same time during the mission to call for support in your demo mission. I hope I am wrong. Please let us know how you are getting this to work. I have your demo mission and unpbo  to see what you did. But it does not work in your demo at this time. When was the last time you use the demo.   

Share this post


Link to post
Share on other sites
On 4/16/2018 at 1:36 AM, Doctor-Vanilla said:

_this select 0 synchronizeObjectsAdd [SupportRequester];
SupportRequester synchronizeObjectsAdd [_this select 0];
BIS_supp_refresh = TRUE;
publicVariable "BIS_supp_refresh";

 

No need to do this part as the following call to BIS_fnc_addSupportLink already does this for you.

 

On 4/21/2018 at 1:21 AM, Doctor-Vanilla said:

Yes which ever units you white-list, will have the support available 😉

Only if they are players. BIS_supp_refresh causes any supports to refresh their users, but if they are not a player they are ignored.

 

On 5/8/2018 at 1:23 AM, avibird 1 said:

Has anyone used this. Does this work with Teamswitch enable or does this only work with human players.

You will need to run the code once the player has changed into the appropriate unit. There are also many other variables needed on the player object for supports to work properly.

 

This will transfer all supports and their providers to the unit the player team switches into. No used support amounts are transferred and everything is reset as if from fresh.

Spoiler

addMissionEventHandler [ "TeamSwitch", {
	_nul = _this spawn {
		params[ "_from", "_to" ];

		_allrequestors = synchronizedObjects _from select { typeOf _x == "SupportRequester" };
		_requestProviders = _allrequestors apply { synchronizedObjects _x select { typeOf _x in BIS_SUPP_providerTypes } };

		waitUntil { local _to && { player isEqualTo _to } };

		{
			_requestor = _x;
			{
				{
					_provider = _x;
					[ _to, _requestor, _provider ] call BIS_fnc_addSupportLink;
				}forEach _x;
			}forEach _requestProviders;
		}forEach _allrequestors;

		{
			_to setVariable [format ["BIS_SUPP_used_%1", _x], 0, true]
		} forEach [
			"Artillery",
			"CAS_Heli",
			"CAS_Bombing",
			"UAV",
			"Drop",
			"Transport"
		];
		_to setVariable ["BIS_SUPP_transmitting", false, true];
		if (!(_to kbHasTopic "BIS_SUPP_protocol")) then {
			_to kbAddTopic ["BIS_SUPP_protocol", "A3\Modules_F\supports\kb\protocol.bikb", "A3\Modules_F\supports\kb\protocol.fsm", {call compile preprocessFileLineNumbers "A3\Modules_F\supports\kb\protocol.sqf"}]
		};
		if (isNil {_to getVariable "BIS_SUPP_HQ"}) then {
			_to setVariable ["BIS_SUPP_HQ", missionNamespace getVariable format ["BIS_SUPP_HQ_%1", side group _to ]]
		};
	};
}];

 

 

This will setup support access from the named requester and it providers, when the player team switches into a unit of a specific type or named unit.

Spoiler

TAG_allowedSupportUnitTypes = [ "B_T_Sniper_F" ]; //Or/And unit var names
TAG_supportRequestors = [ NameGivenToRequestorModules ];

addMissionEventHandler [ "TeamSwitch", {
	_nul = _this spawn {
		params[ "_from", "_to" ];

		if ( _to in TAG_allowedSupportUnitTypes || { { typeOf _to == _x }count TAG_allowedSupportUnitTypes > 0 } ) then {

			_requestProviders = TAG_supportRequestors apply { synchronizedObjects _x select { typeOf _x in BIS_SUPP_providerTypes } };

			waitUntil { local _to && { player isEqualTo _to } };

			{
				_requestor = _x;
				{
					{
						_provider = _x;
						[ _to, _requestor, _provider ] call BIS_fnc_addSupportLink;
					}forEach _x;
				}forEach _requestProviders;
			}forEach TAG_supportRequestors;

			{
				_to setVariable [format ["BIS_SUPP_used_%1", _x], 0, true]
			} forEach [
				"Artillery",
				"CAS_Heli",
				"CAS_Bombing",
				"UAV",
				"Drop",
				"Transport"
			];
			_to setVariable ["BIS_SUPP_transmitting", false, true];
			if (!(_to kbHasTopic "BIS_SUPP_protocol")) then {
				_to kbAddTopic ["BIS_SUPP_protocol", "A3\Modules_F\supports\kb\protocol.bikb", "A3\Modules_F\supports\kb\protocol.fsm", {call compile preprocessFileLineNumbers "A3\Modules_F\supports\kb\protocol.sqf"}]
			};
			if (isNil {_to getVariable "BIS_SUPP_HQ"}) then {
				_to setVariable ["BIS_SUPP_HQ", missionNamespace getVariable format ["BIS_SUPP_HQ_%1", side group _to ]]
			};
		};
	};
}];

 

 

Both of these rely on mission teamSwitch EH so will need to be applied during intPlayerLocal.sqf or equivalent. Have put through very little testing so may still need some adjusting, I have just quickly put something together to get you heading in the right direction. Its pretty much the same as previous code I have shared on this forum, without the extra code to transfer support used counts.

Share this post


Link to post
Share on other sites

@Larrow hi I think you give me that code block a while back. Yes it give the human player the ability to have the support with ever unit he team switches into very cool but not may preference. 

 

I usually play with a few squads of playabke/switchable units. I prefer that each squad has the ability to use certain things and if that unit goes down that's the way the cookie crumbles lol. I appreciate your input but the the Doctor vanilla made it sound that it would work with the team switch enabled to the various classes of units defined in the script. 

 

Unfortunately I never understood why he Bohemia never made the modules for multiplayer with access from multiple units to use it.

 

Share this post


Link to post
Share on other sites

@Larrow so in your second code block you provided ie TAG_allowedSupportUnitTypes ect.......

 

This would let me setup the support for let's say two other units in a different squad. Both of the having the class of B_T_Sniper_F. 

 

I just need to added the code to a intPlayerLocal.sqf.  

 

If yes I still need to setup the support modules the old-fashioned way to the first unit link to all of the the modules I want?

Share this post


Link to post
Share on other sites
On 15/05/2018 at 4:00 PM, avibird 1 said:

@Larrow hi I think you give me that code block a while back. Yes it give the human player the ability to have the support with ever unit he team switches into very cool but not may preference. 

 

I usually play with a few squads of playabke/switchable units. I prefer that each squad has the ability to use certain things and if that unit goes down that's the way the cookie crumbles lol. I appreciate your input but the the Doctor vanilla made it sound that it would work with the team switch enabled to the various classes of units defined in the script. 

 

Unfortunately I never understood why he Bohemia never made the modules for multiplayer with access from multiple units to use it.

 

I am sorry I am not familiar with teamswitch, I have never used that. The support works based on the player class, and they have to be a playable unit. If you enable it for each playable unit, every playable unit will have the support. I am not sure how I can help you. 

Share this post


Link to post
Share on other sites
On 15/05/2018 at 1:01 PM, Larrow said:

No need to do this part as the following call to BIS_fnc_addSupportLink already does this for you.

 

Only if they are players. BIS_supp_refresh causes any supports to refresh their users, but if they are not a player they are ignored.

 

You will need to run the code once the player has changed into the appropriate unit. There are also many other variables needed on the player object for supports to work properly.

 

This will transfer all supports and their providers to the unit the player team switches into. No used support amounts are transferred and everything is reset as if from fresh.

  Reveal hidden contents


addMissionEventHandler [ "TeamSwitch", {
	_nul = _this spawn {
		params[ "_from", "_to" ];

		_allrequestors = synchronizedObjects _from select { typeOf _x == "SupportRequester" };
		_requestProviders = _allrequestors apply { synchronizedObjects _x select { typeOf _x in BIS_SUPP_providerTypes } };

		waitUntil { player isEqualTo _to };

		{
			_requestor = _x;
			{
				{
					_provider = _x;
					[ _to, _requestor, _provider ] call BIS_fnc_addSupportLink;
				}forEach _x;
			}forEach _requestProviders;
		}forEach _allrequestors;

		{
			_to setVariable [format ["BIS_SUPP_used_%1", _x], 0, true]
		} forEach [
			"Artillery",
			"CAS_Heli",
			"CAS_Bombing",
			"UAV",
			"Drop",
			"Transport"
		];
		_to setVariable ["BIS_SUPP_transmitting", false, true];
		if (!(_to kbHasTopic "BIS_SUPP_protocol")) then {
			_to kbAddTopic ["BIS_SUPP_protocol", "A3\Modules_F\supports\kb\protocol.bikb", "A3\Modules_F\supports\kb\protocol.fsm", {call compile preprocessFileLineNumbers "A3\Modules_F\supports\kb\protocol.sqf"}]
		};
		if (isNil {_to getVariable "BIS_SUPP_HQ"}) then {
			_to setVariable ["BIS_SUPP_HQ", missionNamespace getVariable format ["BIS_SUPP_HQ_%1", side group _to ]]
		};
	};
}];

 

 

This will setup support access from the named requester and it providers, when the player team switches into a unit of a specific type or named unit.

  Reveal hidden contents


TAG_allowedSupportUnitTypes = [ "B_T_Sniper_F" ]; //Or/And unit var names
TAG_supportRequestors = [ NameGivenToRequestorModules ];

addMissionEventHandler [ "TeamSwitch", {
	_nul = _this spawn {
		params[ "_from", "_to" ];

		if ( _to in TAG_allowedSupportUnitTypes || { { typeOf _to == _x }count TAG_allowedSupportUnitTypes > 0 } ) then {

			_requestProviders = TAG_supportRequestors apply { synchronizedObjects _x select { typeOf _x in BIS_SUPP_providerTypes } };

			waitUntil { player isEqualTo _to };

			{
				_requestor = _x;
				{
					{
						_provider = _x;
						[ _to, _requestor, _provider ] call BIS_fnc_addSupportLink;
					}forEach _x;
				}forEach _requestProviders;
			}forEach TAG_supportRequestors;

			{
				_to setVariable [format ["BIS_SUPP_used_%1", _x], 0, true]
			} forEach [
				"Artillery",
				"CAS_Heli",
				"CAS_Bombing",
				"UAV",
				"Drop",
				"Transport"
			];
			_to setVariable ["BIS_SUPP_transmitting", false, true];
			if (!(_to kbHasTopic "BIS_SUPP_protocol")) then {
				_to kbAddTopic ["BIS_SUPP_protocol", "A3\Modules_F\supports\kb\protocol.bikb", "A3\Modules_F\supports\kb\protocol.fsm", {call compile preprocessFileLineNumbers "A3\Modules_F\supports\kb\protocol.sqf"}]
			};
			if (isNil {_to getVariable "BIS_SUPP_HQ"}) then {
				_to setVariable ["BIS_SUPP_HQ", missionNamespace getVariable format ["BIS_SUPP_HQ_%1", side group _to ]]
			};
		};
	};
}];

 

 

Both of these rely on mission teamSwitch EH so will need to be applied during intPlayerLocal.sqf or equivalent. Have put through very little testing so may still need some adjusting, I have just quickly put something together to get you heading in the right direction. Its pretty much the same as previous code I have shared on this forum, without the extra code to transfer support used counts.

"BIS_supp_refresh" is needed to make the support repeatable in multiplayer. Otherwise after you use it the first time, It disappears. 

Share this post


Link to post
Share on other sites

My latest mission I have it setup like this;

 

//Support Requester By RCANTEC(RyanD) 2018
_this select 0 synchronizeObjectsAdd [SupportRequester];
SupportRequester synchronizeObjectsAdd [_this select 0];
BIS_supp_refresh = TRUE;
publicVariable "BIS_supp_refresh";
if (typeOf (_this select 0) isEqualTo "rhsusf_army_ocp_squadleader", "rhsusf_army_ocp_teamleader", "rhsusf_socom_marsoc_teamleader", "rhsusf_socom_marsoc_teamchief", "rhsusf_socom_marsoc_sniper") then {
[_this select 0, SupportRequester, ArtilleryProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, CasProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, TransportProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, AmmoProvider] call BIS_fnc_addSupportLink;
[_this select 0, SupportRequester, HelicasProvider] call BIS_fnc_addSupportLink;
};

Works just fine, not sure about the teamswitch though, I can't find any information regarding. I may update the github, once I test this configuration some more. 

  • Like 1

Share this post


Link to post
Share on other sites

@Doctor-Vanilla if you could get this to work using team switch it would be greatly appreciated and need it with this basic function that should have been included in the vanilla game Avibird

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

×