Announcement

Collapse
No announcement yet.

Discussion - Best Way to Implement Preset Radio Frequencies in Missions

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

  • Discussion - Best Way to Implement Preset Radio Frequencies in Missions

    I've just been toying with this in an initPlayerLocal.sqf file for a mission (Road Patrol on Bystrica)

    Code:
    //TFR radios available via addActions
    if (isClass(configFile/"CfgPatches"/"task_force_radio")) then
    {
        player sideChat "Task Force Radio has been detected. Standby for channel configuration to be applied...";
    
        //add any units that you want TaskForceRadio addActions to be put on in the next line
        _unitsToPutTfrRadioActionOn = [ammobox];
        {
            _x addAction ["Get Short Range Radio","TG\getShortRangeRadio.sqf"];
            _x addAction ["Get Long Range Radio","TG\getLongRangeRadio.sqf"];
        }forEach _unitsToPutTfrRadioActionOn;
    
        sleep 6;
        //set short wave radio channels
        [(call TFAR_fnc_activeSwRadio), 1, "100"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 2, "102"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 3, "104"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 4, "106"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 5, "108"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 6, "200"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 7, "202"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeSwRadio), 8, "204"] call TFAR_fnc_SetChannelFrequency;
      //  [(call TFAR_fnc_activeSwRadio), 5] call TFAR_fnc_setAdditionalSwChannel;  //actually makes the additional channel 6 when you put in 5
        [(call TFAR_fnc_ActiveSWRadio), 1] call TFAR_fnc_setSwStereo;
     //   [(call TFAR_fnc_ActiveSWRadio), 0] call TFAR_fnc_setAdditionalSwStereo;
    
        //set longe range radio channels
        [(call TFAR_fnc_activeLrRadio), 1, "50"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 2, "52"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 3, "54"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 4, "56"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 5, "58"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 6, "60"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 7, "62"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 8, "64"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio), 9, "30"] call TFAR_fnc_SetChannelFrequency;
        [(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, 2] call TFAR_fnc_setLrStereo;
        [(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, 5] call TFAR_fnc_setAdditionalLrChannel; //actually makes the additional channel 6 when you put in 5
        [(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, 1] call TFAR_fnc_setAdditionalLrStereo;
    
        player sideChat "Your radio has been programmed.";
    
    
        /*
        LIST OF RADIOS AND FREQUENCY RANGES BY RADIO TYPE AND FACTION
        Radio AN/PRC-152 (personal)    BLUEFOR    30-512Mhz / 5 km
        Radio RF-7800S-TR (rifleman)    BLUEFOR    30-512Mhz / 2 км
        Radio RT-1523G (ASIP) (long range)    BLUEFOR    30-87Mhz / 20 km (30 for inbuilt)
        Radio AN/ARC-210 (airborne)    BLUEFOR    30-87Mhz / 40 km
        Radio AN/PRC-154 (rifleman)    INDEPENDENT    30-512Mhz / 2 km
        Radio AN/PRC148-JEM (personal)    INDEPENDENT    30-512Mhz / 5 km
        Radio AN/PRC-155 (long range)    INDEPENDENT    30-87Mhz / 20 km (30 for inbuilt)
        Radio AN/ARC-164 (airborne)    INDEPENDENT    30-87Mhz / 40 km
        Radio FADAK (personal)    OPFOR    30-512Mhz / 5 km
        Radio PNR-1000A (rifleman)    OPFOR    30-512Mhz / 2 km
        Radio MR3000 (long range)    OPFOR    30-87Mhz / 20 km (30 for inbuilt)
        Radio MR6000L (airborne)    OPFOR    30-87Mhz / 40 km
        Underwater transceiver    All    32-41kHz / 70-300 m. (depending on waves)
    
        Radio class names by type
        BLUFOR                    Independent                    OPFOR
                                commander
        TFAR_anprc152            TFAR_anprc148jem            TFAR_fadak
    
                                squadmate
        TFAR_rf7800str            TFAR_anprc154                TFAR_pnr1000a
    
                                manpack / vehicle-mounted
        TFAR_rt1523g            TFAR_anprc155                TFAR_mr3000
        TFAR_rt1523g_big        TFAR_anprc155_coyote        TFAR_mr3000_multicam
        TFAR_rt1523g_black                                    TFAR_mr3000_rhs
        TFAR_rt1523g_fabric        
        TFAR_rt1523g_green
        TFAR_rt1523g_rhs
        TFAR_rt1523g_sage
    
                                airborne
        TFAR_anarc210            TFAR_anarc164                TFAR_mr6000l
        */
    };
    This will set all the frequencies for all channels on the current short range and long range radio. It also sets up additional channels and sets their sterio configurations for all radios when you load into the mission.

    This script has a bunch of lists of frequency ranges and class names to make it easy to custom configure it upon each mission. I've also adjusted my "getShortRangeRadio.sqf" and "getLongRangeRadio.sqf" files but it is a clunky way of doing this. I'm going to test it on the server, get your feedback here before scripting a better function on how to do this.

    Any thoughts on how to do this best or what should be changed?
    Last edited by Unkl; 05-18-2017, 08:11 AM. Reason: commented out the additional channel for Short Range
    |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
    These worked so well in Bastam control. I am adding these also to the getShortRadio and getLongRadio functions as well. I am calling these function at the initPlayerLocal.sqf to make sure they are executed once in the beginning. Have been given up on trying to tame TFAR but this is an elegant solution.

    EDIT:
    Some things did not work like Long range freq not being set. Further testing is needed to understand why.

    EDIT:
    So there was some sleep to wait for the unique ID for the radio. Because of that I think we ave to spawn instead of call to ensure they are ran concurrently. Will post once confirmed.
    Last edited by |TG| B; 04-16-2017, 09:26 AM.

    Comment


    • #3
      https://github.com/michail-nikolaev/..._setLrSettings

      Code:
       
       _settings = (call TFAR_fnc_activeLrRadio) call TFAR_fnc_getSwSettings; _settings set [0, 2]; // sets the active channel to 2 [(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, _settings] call TFAR_fnc_setLrSettings;
      ^^ Check this out B...

      I think that if we wait until the first radio is set up there may be a way to automate some of it by uploading it's settings to the server. I'm not sure how many of the settings are saved. But it might reduce some of the individual stuffs. You would want to do this for the first connected player only.

      If we just put this code in your function then we could call it from the initPlayerLocal.sqf and from any object we want to add the add action to. I think the trick would be to make an easy way for mission makers to add objects that will have the addActions "Get Short Range Radio" or "Get Long Range Radio".

      Going to have to do some more testing for sure.

      You are right, the sleep was there to allow the server to set the player's radio settings then this script will overwrite those settings.
      |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
        I've started to move towards an addAction on players so they can "Program Radios" when they need. Like when you go into an arsenal and your radios get messed up. I also added it to all editor placed vehicles since you cease to be the same unit when you occupy a vehicle. It doesn't work for Zeus created vehicles.

        However, I think a better solution is to have the first player to spawn in...automatically gets a short and long range radio automatically. Then those settings are the copied to the server via the TFAR function that is copySwSettings or something like that. If this works, then we should all get the same radio config from then on.

        I also want to move away from setting up the alternate channels. This only is creating a needless Global channel that does more harm than good. The mission maker can add this in as needed or the players can do this on their own I think.
        |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
          Originally posted by Unkl View Post
          I've started to move towards an addAction on players so they can "Program Radios" when they need. Like when you go into an arsenal and your radios get messed up. I also added it to all editor placed vehicles since you cease to be the same unit when you occupy a vehicle. It doesn't work for Zeus created vehicles.

          However, I think a better solution is to have the first player to spawn in...automatically gets a short and long range radio automatically. Then those settings are the copied to the server via the TFAR function that is copySwSettings or something like that. If this works, then we should all get the same radio config from then on.

          I also want to move away from setting up the alternate channels. This only is creating a needless Global channel that does more harm than good. The mission maker can add this in as needed or the players can do this on their own I think.
          I would appreciate any tips on how to accomplish this. Would you have any time to discuss this on TS sometime this week?

          Thanks.

          Current ARMA Development Project: No Current Project

          "An infantryman needs a leader to be the standard against which he can judge all soldiers."

          Friend of |TG| Chief

          Comment


          • #6
            I placed this script in the Unk folder: reprogramRadios.sqf
            //set short wave radio channels
            [(call TFAR_fnc_activeSwRadio), 1, "100"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 2, "102"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 3, "104"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 4, "106"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 5, "108"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 6, "200"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 7, "202"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeSwRadio), 8, "204"] call TFAR_fnc_SetChannelFrequency;
            //[(call TFAR_fnc_activeSwRadio), 5] call TFAR_fnc_setAdditionalSwChannel;
            [(call TFAR_fnc_ActiveSWRadio), 1] call TFAR_fnc_setSwStereo;
            //[(call TFAR_fnc_ActiveSWRadio), 0] call TFAR_fnc_setAdditionalSwStereo;

            //set longe range radio channels
            [(call TFAR_fnc_activeLrRadio), 1, "50"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 2, "52"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 3, "54"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 4, "56"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 5, "58"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 6, "60"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 7, "62"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 8, "64"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio), 9, "30"] call TFAR_fnc_SetChannelFrequency;
            [(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, 2] call TFAR_fnc_setLrStereo;
            //[(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, 5] call TFAR_fnc_setAdditionalLrChannel;
            //[(call TFAR_fnc_activeLrRadio) select 0, (call TFAR_fnc_activeLrRadio) select 1, 1] call TFAR_fnc_setAdditionalLrStereo;

            player sideChat "Your radio has been programmed.";
            Then in the initPlayerLocal.sqf add this line:
            //addAction to player to reset radios as needed
            if (isClass(configFile/"CfgPatches"/"task_force_radio")) then
            {
            player addAction ["Reprogram Radios","Unk\reprogramRadios.sqf",player,-999,false,false,"","_this == _target",-1,true];
            };
            In the init of each vehicle that has a long range radio put this:
            this addAction ["Reprogram Radios","Unk\reprogramRadios.sqf",player,-999,false,false,"","_this == driver _target",-1,true];
            And if you have a vehicle respawn module for those vehicles put this in the Expression field so that this action is added when the vehicle is respawned:
            (_this select 0) addAction [""Reprogram Radios"",""Unk\reprogramRadios.sqf"",player,-999,false,false,"""",""_this == driver _target"",-1,true];
            Last edited by Unkl; 05-19-2017, 11:54 AM. Reason: edited file name for script as referenced elsewhere
            |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


            • #7
              Originally posted by Unkl View Post
              I placed this script in the Unk folder: programRadios.sqf
              I will be updating my missions with this and should have time to test this evening. Thank you for the assistance!

              Current ARMA Development Project: No Current Project

              "An infantryman needs a leader to be the standard against which he can judge all soldiers."

              Friend of |TG| Chief

              Comment


              • #8
                Originally posted by Dimitrius View Post
                I will be updating my missions with this..
                Fixed a mistake in the above....the script obviously was named reprogramRadios.sqf. I've fixed the post above.
                |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


                • #9
                  Originally posted by Unkl View Post
                  Fixed a mistake in the above....the script obviously was named reprogramRadios.sqf. I've fixed the post above.
                  Noted. Thank you again for your assistance.

                  Current ARMA Development Project: No Current Project

                  "An infantryman needs a leader to be the standard against which he can judge all soldiers."

                  Friend of |TG| Chief

                  Comment

                  Connect

                  Collapse

                  TeamSpeak 3 Server

                  Collapse

                  Advertisement

                  Collapse

                  Twitter Feed

                  Collapse

                  Working...
                  X