Announcement

Collapse
No announcement yet.

Access Leaders Map

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Access Leaders Map

    Here is a script to allow you to use an addAction on a unit so you can view "their" map when you don't have one. It is an attempt to simulate a "huddle" where you view your leader's map.

    You can only place this unit on leaders and it would only work if they have a map on their person. Unfortunately this script does not follow the map so if another player picks it up you then would have to pass the map around instead of "huddle" to see it.

    Code:
    //to view a leaders map used by an add action on your leader  **  Script by Unkl for TacticalGamer.com
    //this addAction ["Show Map","Unk\viewLeaderMap.sqf","",-999,true,false,"","!(_this == _target)",2,false]; 
    
    _unit = _this select 0;
    _caller = _this select 1;
    _run = true;
    _removeMap = false;
    
    if !("itemMap" in assignedItems _unit) exitWith {hint "This unit does not have a map to view.";};
    
    _caller addItem "itemMap";
    _caller assignItem "itemMap";
    sleep .5;
    openMap [true,false];
    
    while {_run} do
    {
        if (player distance _unit > 4) then {_removeMap = true;};
        if !(visibleMap) then {_removeMap = true;};
        if (_removeMap) then
        {
            openMap [false,false];
            _caller unassignItem "itemMap";
            _caller removeItem "itemMap";
            hint "You lost access to your leader's map.";
            _run = false;
        };
        sleep .2;
    };
    Last edited by Unkl; 11-12-2016, 11:13 AM. Reason: bug fix
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member

    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

  • #2
    Fixed a bug already. The unit you place the addAction on can no longer see the action and remove their own map!
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member

    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

    Comment


    • #3
      Possible bug #2

      Ensure that your "leaders" have the map as an assigned item. Can do this by putting this in the init of the unit:

      Code:
      this assignItem "itemMap";
      Will test and report back.
      |TG-189th| Unkl
      ArmA 3 Game Officer
      Dean of Tactical Gamer University
      189th Infantry Brigade Member

      SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

      Comment


      • #4
        Yep, serious flaw detected and of course it is an MP locality issue. I've attempted a fix but also attempted to change how the script works in the sense that it would:
        • remove all maps from enemy units that have been placed in the editor
        • will follow the maps around that you allow for players so they can pick them up and still share them "over the shoulder"
        • you would allow or disallow a map by setting a variable on each player "hasMap" to true or false

        I"m in the middle of testing the resulting locality issues with regards to adding addActions via remoteExec to make sure we don't end up with X different addActions for the same thing (where X is the number of connected clients).
        |TG-189th| Unkl
        ArmA 3 Game Officer
        Dean of Tactical Gamer University
        189th Infantry Brigade Member

        SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

        Comment


        • #5
          FYI: GPS = map

          TGU Instructor TG Pathfinder

          Former TGU Dean Former ARMA Admin Former Irregulars Officer

          "Do not seek death. Death will find you. But seek the road which makes death a fulfillment." - Dag Hammarskjold

          Comment

          Connect

          Collapse

          TeamSpeak 3 Server

          Collapse

          Advertisement

          Collapse

          Twitter Feed

          Collapse

          Working...
          X