Jump to content
Casio91Fin

Fire support for the player's group

Recommended Posts

My coop idea is how players would get fire support for their missions.

If there are more than 3 players in a player group then group leader could get a fire support command. (Radio commands 1. artillery, 2. air support, 3.missile attack and something else )

Is it possible to do?

Share this post


Link to post
Share on other sites

You can check for the number of players in a group (loop) then add or remove the link between the leader (player!) and the BI module requester.
All other links, so between requester <> support module(s) + support module(s) <> supporting assets (if not virtual) can be present in editor (preferably).

 

something like, in init.sqf:

say your requester module is named:   request  in editor

 

[] spawn {
  waitUntil {allPlayers isNotEqualTo []};
  private _candidateGroups = [];
  private "_leaderSup";
  while {true} do {
    {
      _x setVariable ["passedForSup",TRUE,TRUE];
      _x spawn {
        _grp = _this;
        while {!isNull _grp} do {
          waitUntil {sleep 1;  isPlayer leader _grp && {isPlayer _x} count units _grp >2 };
          _leaderSup = leader _grp;
          if (local _leaderSup) then {
            [_leaderSup,request,objNull] call BIS_fnc_addSupportLink;
          };
          waitUntil {sleep 1;  !isPlayer leader _grp or {isPlayer _x} count units _grp <=2 };
          if (local _leaderSup) then {
            [_leaderSup,request] call BIS_fnc_removeSupportLink;
          };
        };
      };
    } forEach (allGroups select {isNil {_x getVariable "passedForSup"}});
    sleep 2;
  };
};

Not tested, sorry.

  • Like 2

Share this post


Link to post
Share on other sites

@pierremgi I'm going to test today

- Works well. I tested with artificial intelligence and it works flawlessly.

Edited by Casio91Fin

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

×