Let’s look at another useful trigger ability to be activated by radio. I’m sure you have heard this many times, “Trigger is activated by radio Aplha” etc. And I’m pretty sure some of you have no clue what this means. I know I was like this for a while myself. But I’m pretty sure I have something interesting to add to what most Arma users already know.

So, radio triggers. When radio activation is enabled, trigger area is ignored and so is on deactivation statement. What matters is trigger condition, which has still to return true for on activation statement to execute.  Trigger condition is only checked when you activate trigger radio and checked only once. Return false in it and you will stop the trigger from executing on activation statement when radio trigger is activated.

Just to remind what trigger radio is. It is a communication menu which has radio triggers listed. This menu could be accessed via following keyboard shortcut, for example:

0 (zero) -> 0 (zero) -> 3 (Radio Charlie)

You can see communication menu changing with each press of a key, and radio availability depends on whether or not radio trigger has been set up. So let’s set it up:

_tr1 = createTrigger ["EmptyDetector", [0,0,0]]; _tr1 setTriggerActivation ["Charlie", "PRESENT", false]; _tr1 setTriggerStatements ["this", "hint 'Charlie'", ""];

radio

I assigned  Radio Charlie activation to this trigger. So when you press 0 -> 0 you will see “3 Charlie” menu item. Pressing 3 will activate the hint and remove the menu item. And since I set it to be activated only once, the radio menu will become unavailable as there are no more radio triggers. Let’s make a few more:

_tr1 = createTrigger ["EmptyDetector", [0,0,0]]; _tr1 setTriggerActivation ["Charlie", "PRESENT", true]; _tr1 setTriggerStatements ["this", "hint 'Charlie'", ""]; _tr2 = createTrigger ["EmptyDetector", [0,0,0]]; _tr2 setTriggerActivation ["Echo", "PRESENT", true]; _tr1 setTriggerStatements ["this", "hint 'Echo'", ""]; _tr3 = createTrigger ["EmptyDetector", [0,0,0]]; _tr3 setTriggerActivation ["Juliet", "PRESENT", true]; _tr1 setTriggerStatements ["this", "hint 'Juliet'", ""];

radio1

Now you have 3 triggers set for repeated activation. Pretty simple to set up and use. But you have to remember what radio you set to what. Can the menu items be more descriptive? Yes, they can. There is a command to change default text displayed and it is called setRadioMsg. Yeah, pretty “explicit” name to leave people guessing what it does. Should have been called “setRadioTriggerText” because this is exactly what it does. You can also set this in the editor in “TEXT” field for the trigger.

  • <radio> setRadioMsg <menu text>
    • <radio> – number from 1 to 10
      1. Alpha (key 1)
      2. Bravo (key 2)
      3. Charlie (key 3)
      4. Delta (key 4)
      5. Echo (key 5)
      6. Foxtrot (key 6)
      7. Golf (key 7)
      8. Hotel (key 8)
      9. India (key 9)
      10. Juliet (key 0)
    • <menu text> – The title shown in the radio menu. “NULL” will remove the menu item from menu, “” will reset it back to default radio name.

Let’s set some custom titles:

3 setRadioMsg "Press 3 To Activate Charlie"; 5 setRadioMsg "Press 5 To Activate Echo"; 10 setRadioMsg "Press 0 To Activate Juliet";

radio2

Let’s remove Charlie from the menu and set Echo to default:

3 setRadioMsg "NULL"; 5 setRadioMsg ""; 10 setRadioMsg "Press 0 To Activate Juliet";

radio3

And is there a way to bring up Radio menu without going trough keyboard sequence every time? Sure it is:

showCommandingMenu "RscRadio";

Enjoy,
KK

EDIT: You can also use setTriggerText and triggerText to set and get text of the radio menu item. However, while with setRadioMsg the radio index is used to set up custom title, setTriggerText uses trigger object:

tr setTriggerText "Radio Title 1"; triggerText tr; //Radio Title 1

In case there are multiple triggers linked to the same radio trigger, in order to set custom title with setTriggerText, you need to know which trigger was placed first and set title on it. For setRadioMsg you do not need to know this.