Jump to content
Ry4nD

Update to multiplayer Support requester

Recommended Posts

On 23/05/2018 at 7:26 AM, avibird 1 said:

@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

Again, I am not familiar with teamswitch. Sorry. It works as intended for multiplayer, as designed. If you change your player class, you lose the ability to call in support.

Share this post


Link to post
Share on other sites

I love this way of adding support.

How would I still enable the use of lobby params to change the cooldown for supports. Or should this method still work.

class PARAM_Supports
			{
				title = ":: Support Settings";
				values[] = {0,0};
				texts[] = {"",""};
				default = 0;
			};

			class PARAM_Supports_Ammo
			{
				title = "    Ammo Drop:";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
			
			class PARAM_Supports_Transport
			{
				title = "    Helicopter Transport:";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
			
			class PARAM_Supports_CAS_Heli
			{
				title = "    CAS (Helicopter Attack):";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
			
			class PARAM_Supports_CAS_Bomb
			{
				title = "    CAS (Bombing Run):";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
				
			class PARAM_Supports_Artillery
			{
				title = "    Artillery:";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};

 

Share this post


Link to post
Share on other sites
1 hour ago, Jnr4817 said:

I love this way of adding support.

How would I still enable the use of lobby params to change the cooldown for supports. Or should this method still work.


class PARAM_Supports
			{
				title = ":: Support Settings";
				values[] = {0,0};
				texts[] = {"",""};
				default = 0;
			};

			class PARAM_Supports_Ammo
			{
				title = "    Ammo Drop:";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
			
			class PARAM_Supports_Transport
			{
				title = "    Helicopter Transport:";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
			
			class PARAM_Supports_CAS_Heli
			{
				title = "    CAS (Helicopter Attack):";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
			
			class PARAM_Supports_CAS_Bomb
			{
				title = "    CAS (Bombing Run):";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};
				
			class PARAM_Supports_Artillery
			{
				title = "    Artillery:";
				values[] = {0,2,5,10,15,20,30};
				texts[] = {"Disabled","Every 2 Mins","Every 5 Mins","Every 10 Mins","Every 15 Mins","Every 20 Mins","Every 30 Mins"};
				default = 10;
			};

 

Interesting, possibly if the name was the same as the support module? You can also set the support module parameters in the module itself. 

Share this post


Link to post
Share on other sites
//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 "player") 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;
};

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

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/15/2018 at 8: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.

  Hide 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.

  Hide 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.


I tried to make this working but it is not ... run from init.sqf or initPlayerLocal.sqf in SP, it doesn not work with Team Switch to a new spawn unit. 
EDIT: 
Made it working, SP scenario, JIP _newUnit 

//MAKE SUPPORT MODULE AVAIBLE TO A NEW UNIT
//make support provider module variable name "Support" 
//make suppport requester module variable name "Requester"
//do not link with player or any unit 
//you have to disable the link to the previous unit even if its dead 
[Requester, Support] call BIS_fnc_removeSupportLink;
//and establish a new link 
[_newUnit, Requester, Support] call BIS_fnc_addSupportLink;

I hope its useful to some necromancer.
Edit: 
Nope, it links the Requester module with JIP player once but after second death no support link anymore ... 

Share this post


Link to post
Share on other sites

Yep! I have tested some times ago the team switch thingies for all these support links. That doesn't work at all!

The BI functions (like BIS_fnc_addSupportLink) or even commands (used inside them, like synchronizeObjectsAdd) are useful for conditions you can imagine: player have a radio backpack or else,  respawning or not... , triggering some scripts...

But, for a reason I duno, there is no mean with team switching (of course, I tested the team switch code by some hints, it's not an EH problem). Good luck with that.

  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, kibaBG said:

I tried to make this working but it is not

5 hours ago, pierremgi said:

That doesn't work at all! 

 

MP Support Module

See MP_supportModule.VR\LARs\MPSupports\MPSupportsSettings.data for settings.

Quickly tested SP, MP, Dedicated, JIP all with teamSwitch and still seems to work ok. This was initially written 10 days after my previous post in this thread back in May of 2018.

 

You need to make sure when teamSwitching in MP that the _to unit is local before doing changes. I have updated the code in my previous post to reflect this.

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

@Larrow thank you for finally getting this to work with team switch and with respawning in a multiplayer environment. However is there any way that the number of usage per support modules can be carried over rather than resetting the amount each time you switch into a unit that has access to the modules. To have unlimited support availability is overkill for some mission designs. Is there a way that you can put an option for mission designers to either keep it with the reset or limited the amount of usage during a mission. One again thank you this has been a long-standing issue that Bohemia should have fixed years ago. Avibird 

Share this post


Link to post
Share on other sites
11 hours ago, avibird 1 said:

@Larrow thank you for finally getting this to work with team switch and with respawning in a multiplayer environment. However is there any way that the number of usage per support modules can be carried over rather than resetting the amount each time you switch into a unit that has access to the modules. To have unlimited support availability is overkill for some mission designs. Is there a way that you can put an option for mission designers to either keep it with the reset or limited the amount of usage during a mission. One again thank you this has been a long-standing issue that Bohemia should have fixed years ago. Avibird 

 

The number of usage are carried, tested in 3den. And you can set the number of support requests in the module.  

 

Share this post


Link to post
Share on other sites

@kibaBG I have tested in game yes you can set the number let's say 3 artillery usage and you are right when I use three the artillery icon disappears from the support menu but if you switch into a new unit and then switch back or switch into a different unit that has access to the support modules they both get three again. Test in game.

Share this post


Link to post
Share on other sites

@avibird 1 In the scenario I work on, the old unit dies and then new Team Switch unit spawns, its basically JIP for SP. Maybe this is the reason for different results. I don't Team Switch between two alive units. 🙂

Share this post


Link to post
Share on other sites

Yes that is the issued when you team switch to a new unit they has access to support modules it is reset. Usage does not carry over

Share this post


Link to post
Share on other sites

@Larrow Hi, I run into unexpected new bug. On dedicated server (bluefor and opfor playable) support requester can access both support modules resulting in calling the helicopter of the opposite side. MPSupportSettings.data file looks like this

 


#include "functions\MPSupports_macros.hpp"

class LARs_MPSupports {
	//Enable automatic support for teamSwitch
	//TeamSwitched units will get access to the requesters list below in supportRequesterNames
	enabledForTeamSwitch = false;

	//Transfer provider used counts to the new unit ( teamSwitch only )
	transferUsedCount = false;

	//Support requesters used for automatic access
	//Units will receive access to all providers linked to the requesters
	//Names given to support requesters in editor ( as STRING )
	supportRequesterNames[] = {
		"BlueRequester","RedRequester"
	};

	//Unit types given automatic access to the support requesters listed above
	supportUnitTypes[] = {
		"gm_pl_army_squadleader_akm_80_win","gm_pl_army_demolition_akm_80_win","gm_pl_army_machinegunner_pk_80_win","gm_pl_army_marksman_svd_80_win",
		"gm_ge_army_sf_squadleader_mp5sd3_p2a1_parka_80_win","gm_ge_army_sf_antitank_mp5a2_pzf84_parka_80_win","gm_ge_army_sf_machinegunner_g8a2_parka_80_win","gm_ge_army_sf_marksman_g3a3_parka_80_win"
	};

	//Units in editor that get automatic access to the support requesters listed above
	//Names given to units in editor( 'vehicle name' attribute ) ( as STRING )
	supportUnitNames[] = {
		"BOB"
	};
};

   

Share this post


Link to post
Share on other sites
On 6/25/2023 at 10:38 PM, kibaBG said:

On dedicated server (bluefor and opfor playable) support requester can access both support modules

 

Updated download, see MPSupportSettings.data where supportRequesterNames now has a section for each side. Players are synced to requesters based on their side.

Think that should fix it, let me know how it goes.

Share this post


Link to post
Share on other sites

@Larrow what did you do different. In the old version I have no syn is need. With this new version can you select which support each unit has by syn the unit to which one you want that unit to have.  

 

One of the issues I have is you can limit the number of uses as long as you don't team switch out. Once you team switch out and team switch back in to the unit that has access you get all the numbers of uses back. I wish there was a way to limit the number of uses regardless if you team switch out or not.  Avibird 

Share this post


Link to post
Share on other sites

@Larrow Dedicated server helicopter transport (virtual) requester got broken, the helicopter comes but when you enter there is no option for showing where you want to be transported.  Paradrop (virtual) is ok and works fine.    

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

×