Announcement

Collapse
No announcement yet.

Team Status Script Problem

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

  • Team Status Script Problem

    I'm trying to use the Team Status script on the ACE Island, Gaia. Although the script has always worked perfectly on Avgani and Afghan Village maps, for some reason I keep getting this error when I open up the team status dialogue for ACE Gaia. Anyone know what's wrong?



    pos2grid.cpp file:
    Code:
    private ["_x","_y","_cfg","_offsetX","_offsetY","_stepX","_stepY","_el","_smallZoom"];
    _cfg    =configFile>>"CfgWorlds">>worldName>>"Grid";
    
    _offsetX=getNumber(_cfg>>"offsetX");
    _offsetY=getNumber(_cfg>>"offsetY");
    
    _smallZoom = "Zoom1"; // Zoom1/Zoom2 is default used by BIS/ArmA/Sara - _smallZoom can be Zoom0/Zoom1/Zoom2
    if (isClass (_cfg>>"Zoom0")) then {_smallZoom = "Zoom0"}; // if Zoom0 exists, assume it uses Zoom0/Zoom1
    
    _stepX=getNumber(_cfg>> _smallZoom >>"stepX");
    _stepY=getNumber(_cfg>> _smallZoom >>"stepY");
    
    switch toLower(worldName) do
    {
      case 'sara': { _offsetY=-480*-1; }; // uses Zoom1 & Zoom2
      case 'saralite': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2
      case 'sakakah': { _offsetY=-480*11+160; }; // uses Zoom1 & Zoom2
      case 'vte_australianao': { _offsetY=-480*30; };
      case 'map_ssara': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2, offsetX = -4880; offsetY = -7480; 
      case 'intro': { _offsetY=-480*-1; };
      case 'porto': { _offsetY=480*10+320; }; // uses Zoom1 & Zoom2
      case 'syr_darain': { _offsetY=480*10+320; };
      case 'tolafarush': { _offsetY=480*11+320; };
      case 'schmalfelden': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
      case 'avgani': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
      case 'map_3demap': { _offsetY=-480*15+0; };
      case 'watkins': { _offsetY=-480*11+160; }; // uses Zoom0 & Zoom1
      case 'uhao': { _offsetY=480*11+320; }; // uses Zoom1 & Zoom2, offsetY = -15360;
    };
    
    _x=(_this select 0 select 0)-_offsetX;
    _y=(_this select 0 select 1)-_offsetY;
    
    
    _el=
    [
        ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],
        ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],
        ["0","1","2","3","4","5","6","7","8","9"],
        ["0","1","2","3","4","5","6","7","8","9"]
    ];
    
    _xs=([1,-1]select(_x<0));
    _x =((abs _x)-((abs _x)mod _stepX))/_stepX;
    
    _y=100*_stepY-_y;
    _ys=([1,-1]select(_y<0));
    _y=((abs _y)-((abs _y)mod _stepY))/_stepY;
    
    _xf=_x mod 10;
    _xc=(_x-_xf)/10;
    if(_xs<0)then{_xf=9-_xf;_xc=count(_el select 0)-1-_xc};_xc=_xc mod(count(_el select 0));_xc=_xc max 0;
    
    _yf=_y mod 10;
    _yc=(_y-_yf)/10;
    if(_ys<0)then{_yf=9-_yf;_yc=count(_el select 2)-1-_yc};_yc=_yc mod(count(_el select 2));_yc=_yc max 0;
    
    format["%1%2%3%4",_el select 0 select _xc,_el select 1 select _xf,_el select 2 select _yc,_el select 3 select _yf]

  • #2
    Re: Team Status Script Problem

    You need to disable map recognition by the script...I forget exactly where it is located but I'm guessing it should in the Init.sqs.

    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


    • #3
      Re: Team Status Script Problem

      Originally posted by LowSpeedHighDrag View Post
      You need to disable map recognition by the script...I forget exactly where it is located but I'm guessing it should in the Init.sqs.
      What does the code for map recognition look like exactly? And how do I disable it?

      Comment


      • #4
        Re: Team Status Script Problem

        I think this would be the map recognition:
        Code:
        switch toLower(worldName) do
        {
          case 'sara': { _offsetY=-480*-1; }; // uses Zoom1 & Zoom2
          case 'saralite': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2
          case 'sakakah': { _offsetY=-480*11+160; }; // uses Zoom1 & Zoom2
          case 'vte_australianao': { _offsetY=-480*30; };
          case 'map_ssara': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2, offsetX = -4880; offsetY = -7480; 
          case 'intro': { _offsetY=-480*-1; };
          case 'porto': { _offsetY=480*10+320; }; // uses Zoom1 & Zoom2
          case 'syr_darain': { _offsetY=480*10+320; };
          case 'tolafarush': { _offsetY=480*11+320; };
          case 'schmalfelden': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
          case 'avgani': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
          case 'map_3demap': { _offsetY=-480*15+0; };
          case 'watkins': { _offsetY=-480*11+160; }; // uses Zoom0 & Zoom1
          case 'uhao': { _offsetY=480*11+320; }; // uses Zoom1 & Zoom2, offsetY = -15360;
        };
        Maybe if you add a 'worldName' Gaia to case _offsetY would not be 0?
        Tom Wilson

        The M16A2 service rifle is a lightweight air-cooled, gas-operated, magazine-fed shoulder weapon.
        It fires a 5.56 mm ball projectile at a muzzle velocity of 2,800 feet per second. This is my rifle.

        Comment


        • #5
          Re: Team Status Script Problem

          Originally posted by TWilson View Post
          I think this would be the map recognition:
          Code:
          switch toLower(worldName) do
          {
            case 'sara': { _offsetY=-480*-1; }; // uses Zoom1 & Zoom2
            case 'saralite': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2
            case 'sakakah': { _offsetY=-480*11+160; }; // uses Zoom1 & Zoom2
            case 'vte_australianao': { _offsetY=-480*30; };
            case 'map_ssara': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2, offsetX = -4880; offsetY = -7480; 
            case 'intro': { _offsetY=-480*-1; };
            case 'porto': { _offsetY=480*10+320; }; // uses Zoom1 & Zoom2
            case 'syr_darain': { _offsetY=480*10+320; };
            case 'tolafarush': { _offsetY=480*11+320; };
            case 'schmalfelden': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
            case 'avgani': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
            case 'map_3demap': { _offsetY=-480*15+0; };
            case 'watkins': { _offsetY=-480*11+160; }; // uses Zoom0 & Zoom1
            case 'uhao': { _offsetY=480*11+320; }; // uses Zoom1 & Zoom2, offsetY = -15360;
          };
          Maybe if you add a 'worldName' Gaia to case _offsetY would not be 0?
          So you saying to add:
          case 'gaia': { _offsetY=????????; };

          Comment


          • #6
            Re: Team Status Script Problem

            The error is a Zero Divisior
            line 32 : _y=(_this select 0 select 1)-_offsetY; // will not generate error, but bad offset used.
            line 46 : _y=100*_stepY-_y; // inaccurate value of _y used from line 32.
            same deal on line 46, 47 & 48...

            line 54, 55 & 56 : _yf & _yc are generated from _y // inaccurate value of _y used from line 32.

            line 58 : format["%1%2%3%4",_el select 0 select _xc,_el select 1 select _xf,_el select 2 select _yc,_el select 3 select _yf] // Gives error...

            So yes... a value for _offsetY would require a value.
            I think a value for _stepX & _stepY are also required.

            You could debug this by adding a value to _offsetY before the switch is made on line 13.
            example : line 12 : _offsetY=1; // until correct value for _offsetY, _stepX & _stepY are found...
            the error would then change to something other than a Zero Divisor (or no error at all just inaccurate zoom and grid cords)
            Tom Wilson

            The M16A2 service rifle is a lightweight air-cooled, gas-operated, magazine-fed shoulder weapon.
            It fires a 5.56 mm ball projectile at a muzzle velocity of 2,800 feet per second. This is my rifle.

            Comment


            • #7
              Re: Team Status Script Problem

              line 12 : _offsetY=480*10+320; _stepX=100; _stepY=100; // Quick workaround...

              If you want I will help find the correct values for the offset and step...
              Tom Wilson

              The M16A2 service rifle is a lightweight air-cooled, gas-operated, magazine-fed shoulder weapon.
              It fires a 5.56 mm ball projectile at a muzzle velocity of 2,800 feet per second. This is my rifle.

              Comment


              • #8
                Re: Team Status Script Problem

                Originally posted by TWilson View Post
                line 12 : _offsetY=480*10+320; _stepX=100; _stepY=100; // Quick workaround...

                If you want I will help find the correct values for the offset and step...
                What happens if they are not correct values?

                Comment


                • #9
                  Re: Team Status Script Problem

                  Code:
                  private ["_x","_y","_cfg","_offsetX","_offsetY","_stepX","_stepY","_el","_smallZoom"];
                  _cfg    =configFile>>"CfgWorlds">>worldName>>"Grid";
                  
                  _offsetX=getNumber(_cfg>>"offsetX");
                  _offsetY=getNumber(_cfg>>"offsetY");
                  
                  _smallZoom = "Zoom1"; // Zoom1/Zoom2 is default used by BIS/ArmA/Sara - _smallZoom can be Zoom0/Zoom1/Zoom2
                  if (isClass (_cfg>>"Zoom0")) then {_smallZoom = "Zoom0"}; // if Zoom0 exists, assume it uses Zoom0/Zoom1
                  
                  _stepX=getNumber(_cfg>> _smallZoom >>"stepX");
                  _stepY=getNumber(_cfg>> _smallZoom >>"stepY");
                  _offsetY=480*10+320; _stepX=100; _stepY=100; //quick fix for gaia, untill proper offset and steps for island gaia are found, and placed in case.
                  switch toLower(worldName) do
                  {
                    case 'sara': { _offsetY=-480*-1; }; // uses Zoom1 & Zoom2
                    case 'saralite': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2
                    case 'sakakah': { _offsetY=-480*11+160; }; // uses Zoom1 & Zoom2
                    case 'vte_australianao': { _offsetY=-480*30; };
                    case 'map_ssara': { _offsetY=-480*5+120; }; // uses Zoom1 & Zoom2, offsetX = -4880; offsetY = -7480; 
                    case 'intro': { _offsetY=-480*-1; };
                    case 'porto': { _offsetY=480*10+320; }; // uses Zoom1 & Zoom2
                    case 'syr_darain': { _offsetY=480*10+320; };
                    case 'tolafarush': { _offsetY=480*11+320; };
                    case 'schmalfelden': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
                    case 'avgani': { _offsetY=480*10+320; _stepX=100; _stepY=100; }; // uses Zoom0 & Zoom1
                    case 'map_3demap': { _offsetY=-480*15+0; };
                    case 'watkins': { _offsetY=-480*11+160; }; // uses Zoom0 & Zoom1
                    case 'uhao': { _offsetY=480*11+320; }; // uses Zoom1 & Zoom2, offsetY = -15360;
                  };
                  
                  _x=(_this select 0 select 0)-_offsetX;
                  _y=(_this select 0 select 1)-_offsetY;
                  
                  
                  _el=
                  [
                      ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],
                      ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],
                      ["0","1","2","3","4","5","6","7","8","9"],
                      ["0","1","2","3","4","5","6","7","8","9"]
                  ];
                  
                  _xs=([1,-1]select(_x<0));
                  _x =((abs _x)-((abs _x)mod _stepX))/_stepX;
                  
                  _y=100*_stepY-_y;
                  _ys=([1,-1]select(_y<0));
                  _y=((abs _y)-((abs _y)mod _stepY))/_stepY;
                  
                  _xf=_x mod 10;
                  _xc=(_x-_xf)/10;
                  if(_xs<0)then{_xf=9-_xf;_xc=count(_el select 0)-1-_xc};_xc=_xc mod(count(_el select 0));_xc=_xc max 0;
                  
                  _yf=_y mod 10;
                  _yc=(_y-_yf)/10;
                  if(_ys<0)then{_yf=9-_yf;_yc=count(_el select 2)-1-_yc};_yc=_yc mod(count(_el select 2));_yc=_yc max 0;
                  
                  format["%1%2%3%4",_el select 0 select _xc,_el select 1 select _xf,_el select 2 select _yc,_el select 3 select _yf]
                  Tom Wilson

                  The M16A2 service rifle is a lightweight air-cooled, gas-operated, magazine-fed shoulder weapon.
                  It fires a 5.56 mm ball projectile at a muzzle velocity of 2,800 feet per second. This is my rifle.

                  Comment


                  • #10
                    Re: Team Status Script Problem

                    ICE_GridRefCoords = {"n/a"}; // empty function
                    Copy and paste that into your init.sqf

                    #include "Scripts\TeamStatusDialog\TeamStatusDialog.hpp "
                    In your description.ext

                    Also make sure to add a gamelogic called the 'server'

                    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


                    • #11
                      Re: Team Status Script Problem

                      TWilson got it to work for me, thanks for the help.

                      Comment

                      Connect

                      Collapse

                      TeamSpeak 3 Server

                      Collapse

                      Advertisement

                      Collapse

                      Twitter Feed

                      Collapse

                      Working...
                      X