Jump to content
Wisp

Multiple support requesters

Recommended Posts

I have a single player mission where the player controls a squad and has to call in a helicopter for transport. There are no respawns, but the player can swap to another squad members if his character dies. The problem is the helicopter transport stops working if I swap. I tried linking the support requester module to all the squad members, but it still doesn't work. Only when a unit is listed as "player" can the request be made. "Playable" doesn't.

Is there some way the modules need to be configured for this to work? Or a script?

Share this post


Link to post
Share on other sites

The first script is nice, but I still can't get it to work with multiple people.

Share this post


Link to post
Share on other sites

I have also the same problem.

It seems module support doesn't work for playable unit

What is the problème? any solutions?

Share this post


Link to post
Share on other sites

Thanks!

I'm not very friendly with scripts.

The problem :

In a SP mission I have one unit as player and two others units as playable.

The support (via support module) works for the initial player but when I switch to others units, it doesn't work.

I try to use "SynchroniseObjetcAdd" and "SynchroniseObjectRemove" (with BIS_supp_refrech fix) via radio trigger

and it works for enable/disable support for the initial player but not for others.

Is anybody can help me with a little script?

Sorry for my english...

Share this post


Link to post
Share on other sites

You could try something like.....

EDIT: code removed due to onTeamSwitch not working, see next post for revised code

UNTESTED - Just quickly put that script from the second link into a function and used the onTeamSwitch event to call it.

IndeedPete maybe able to help you here i know (as of that post) he uses something similar in his mission and will be able to tell you if anything has changed.

Let me know how it goes

Edited by Larrow

Share this post


Link to post
Share on other sites

Just a question, are those playable units in the same group? If so, maybe it is not working because support can only be called by group leaders?

Share this post


Link to post
Share on other sites
maybe it is not working because support can only be called by group leaders?
This is incorrect supports can be called by anyone that has access to a supply_requester.

Ok just had a spare halfhour to test this out, onTeamSwitch does not seem to work, even something simple like a hint in onTeamSwitch does not occur.

This does...

init.sqf

if (! isDedicated) then {
waitUntil {!isNull player};

TransferProviders = {

	_oldUnit = _this select 0;
	_oldProviders = _oldUnit getVariable ["BIS_SUPP_allProviderModules",[]];
	_HQ = _oldUnit getVariable ["BIS_SUPP_HQ",nil];

	if (isNil {player getVariable ["BIS_SUPP_HQ",nil]}) then {
		if ((count _oldProviders) > 0) then {
			{
				_providerModule = _x;
				{
					if (typeOf _x == "SupportRequester" && _oldUnit in (synchronizedObjects _x)) then {
						[player, _x, _providerModule] call BIS_fnc_addSupportLink;
					};
				}forEach synchronizedObjects _providerModule;
			}forEach _oldProviders;
		};

		player setVariable ["BIS_SUPP_transmitting", false];
		player 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"}];
		player setVariable ["BIS_SUPP_HQ", _HQ];
	};

	{
		_used = _oldUnit getVariable [format ["BIS_SUPP_used_%1",_x], 0];
		player setVariable [format ["BIS_SUPP_used_%1", _x], _used, true]
	} forEach [
		"Artillery",
		"CAS_Heli",
		"CAS_Bombing",
		"UAV",
		"Drop",
		"Transport"
	];
};


_thread = [] spawn {
	_unit = player;
	while {true} do {
		waitUntil {_unit != player };
		hintSilent " Player has changed";
		[_unit] call TransferProviders;
		_unit = player;
	};
};

};

Constantly monitors for the player changing to a different unit and then transfer supports across to the new unit.

Without the loop on changing back to the previous unit the supports would still be there but any used during the time you were the other unit would not be accounted for so the loop makes sure all counts are transferred back.

Edited by Larrow
  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites

Ok Thank you! It works.

Is there a solution to replace constantly monitoring for the player changing by a radio activation trigger of the script?

Edited by kanakbob

Share this post


Link to post
Share on other sites

I'm working on a sp mission without script.

Is there a solution to adapt Larrow's script to a radio trigger activation?

if (! isDedicated) then {

waitUntil {!isNull player};

TransferProviders = {

_oldUnit = _this select 0;

_oldProviders = _oldUnit getVariable ["BIS_SUPP_allProviderModules",[]];

_HQ = _oldUnit getVariable ["BIS_SUPP_HQ",nil];

if (isNil {player getVariable ["BIS_SUPP_HQ",nil]}) then {

if ((count _oldProviders) > 0) then {

{

_providerModule = _x;

{

if (typeOf _x == "SupportRequester" && _oldUnit in (synchronizedObjects _x)) then {

[player, _x, _providerModule] call BIS_fnc_addSupportLink;

};

}forEach synchronizedObjects _providerModule;

}forEach _oldProviders;

};

player setVariable ["BIS_SUPP_transmitting", false];

player 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"}];

player setVariable ["BIS_SUPP_HQ", _HQ];

};

{

_used = _oldUnit getVariable [format ["BIS_SUPP_used_%1",_x], 0];

player setVariable [format ["BIS_SUPP_used_%1", _x], _used, true]

} forEach [

"Artillery",

"CAS_Heli",

"CAS_Bombing",

"UAV",

"Drop",

"Transport"

];

};

_thread = [] spawn {

_unit = player;

while {true} do {

waitUntil {_unit != player };

hintSilent " Player has changed";

[_unit] call TransferProviders;

_unit = player;

};

};

};

Share this post


Link to post
Share on other sites

Sorry for bring this old post back up. I am trying to edit the code above so only the link/syn units can use/call the support modules. Can anyone who has more insight to see what needs to be changed or if it can at all. Thanks AVIBIRD.

Share this post


Link to post
Share on other sites

I apologize as well for digging this back up.... however, like others have, I have been able to get the transfer of support to work when switching units which is awesome! (Thank you Larrow!!!)

My question is, how can I use this to incorporate the ALiVE supports for this? 

The BiS modules are a bit quirky and fail quite often, but I can get the ALiVE supports to work 100% of the time but ONLY on my player.

Even when all playable units are sync'd to the ALiVE player support module, upon switching to other playable units after dying, I lose the ability to call supports from ALiVE( ctrl+win key no longer has ALiVE option..).

I do not know enough about scripting to alter Larrow's to incorporate the ALiVE supports.

Any thoughts?

Share this post


Link to post
Share on other sites

Somewhat reviving an old thread, Larrow's post solved my issue, thanks Larrow!

I sent you some beer money ;)

 

Since my mission is SP for those who are doing something similar and want the support to be able to transfer to the next team switched player:

 

Make sure all those who you want to have access to support is synced to the support requester module, when you die

and team switch the support will transfer to the new character unit you take over.

 

For the dedicated server only tho which this code at the start of his code --->    if (! isDedicated) then { waitUntil {!isNull player};

For hosting the mission in MP lan which is local then you want to swap that code with this ----->  if (!(isServer)) then {waitUntil {!(isNull player)};

 

On 1/13/2018 at 9:17 AM, viperBAT44 said:

My question is, how can I use this to incorporate the ALiVE supports for this? 

Ask on the ALIVE thread surely they would know better its their code with their modules, just tell them what your trying to do and link this thread.

  • Thanks 1

Share this post


Link to post
Share on other sites

Adding to this, just to let you guys know who wants to implement the transfer providers script

which does work np, in combination with AIS https://www.armaholic.com/page.php?id=24088

as soon as you on teamswitch, spawn into a new playable unit, AIS breaks something with this.

     You lose all function in terms of accessing anything, cannot open doors, pickup objects without using inventory,

etc. you become a spectator on foot.

 

Share this post


Link to post
Share on other sites

If you  get wounded where you're incapacitated once you get healed from the AIS system first stabilize then heal you should get all functionality back. Try that I almost positive it will work. 

 

I modify the AIS system to be used in  small co-op groups of players using team switch functionality.  If you get wounded your original unit is incapacitated well crawling slow with no aim in the AIS wound animations when you switch to a new unit you have limited ability using various menus and inventory just like you are describing.

 

You can see shoot reload and move normal in the new units body (the one you team switched into) but you can't heal enter vehicles place mines ECT. 

The idea is players will not just leave the wounded unit incapacitated because they don't have full functionality they need to bring a new unit to the injured unit once the area is fairly safe switch back to the injured (original) unit call for support and the unit you brought over will automatically heal you.

You will see a flash of red on the screen and all functionalities are restored to you.

I'm pretty much sure if a unit gets injured and then gets healed he should have the ability to use support modules again. Try it and let me know

 

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

×