Hmm, alright, well first let me premise this by saying:
Everything I'm about to say is how the system currently works. The system as released may be simpler, more complex, entirely different or much the same.
Five design requirements dictated the radio comms system:
A) It must be simple
B) It must require zero scripting or description.ext input by the mission designer
C) It must work in MP
D) It must be modular and separable from the function of the firing units.
E) The interface has to be specifiable in a series of .sqf files, so later addons can "plug into" the CoC_Arty.pbo without necessitating a new release of the pbo. In other words, if two weeks later, we (or someone else) decide to release an M224 60mm mortar or a cruise missile launcher, or a nuclear mine, the interface has to be able to handle it.
As a result:
1) you can see we're using action menus/hint displays. I wanted to do dialogs but that ran against B). In any case, the dialogs have to be completely asset-specific, and while I can handle the metavariable-fu to do that, I don't have the experience with dialogs.
2) Currently, only human players can use the radio interface. AI can of course control the assets, but that would require some scripting, and it's probably better to do so ont he mission level. This could be as easy as the following example:
let's say I've got a platoon of M109s on the map. By the order of registration (determined in each mission), these M109s count as the third asset overall (so Asset index number 2).
I want to have a trigger that, when the player sets it off, we order the platoon to fire at the first object in the trigger's activation field. Now, assuming nobody has control over the asset (if someone did, this list would be a little longer to get all the settings back to default),
The "On activation" field would be:
CoCIFAsset2t0 setpos getpos (thislist select 0);
-- this sets the first aimpoint to the first object in the field --
CoCIFAsset2t = 1;
--tells our platoon that this mission will have 1 aimpoint--
CoCIFAsset2o = 0;
--Call For Fire--
(n.b., I will probably change the variable stems to CoC_IFA and CoC_IFU)
When the trigger is fired, the paladins would line up, and within about 2 minutes send off their fire mission.
3) our main system right now is a "radio system", where the mission designer places objects labeled radios in the map, and these objects have init EHs that interface with UA to addactions. The advantage is that, again, no scripting is required.
We also have a "ForwardObserver" guy -- just a regular soldierWB, but with some EHs that give him the actions he needs.
In other words, you can add the "radio menu" to any player you like with a simple addaction.
If you wanted to have it based on the ownership or not of those cool "Weaponized" radios that BAS and SEB use, well that's not in my control. You could easily script it in an individual mission:
A) on each client, poll every five seconds or so to see if the player has a radio. When the player has a radio, add the action to bring up the menu (currently: player addaction ["IF Radio", "\CoC_Arty\scripts\OpenMenu.sqs"])
B) once the player has a radio, poll to see if the player drops the radio. When that happens, run the script to shut down comms (currently [] exec "\CoC_Arty\scripts\end.sqs", but I'll probably change it to EndMenu or something).
Now, if you guys wanted to make it so that, say, all units in your BAS soldiers class automatically did this, all you'd need in addition would be:
C) An init EH that looked like this:
init = "if ((_this select 0) == player) then {[] exec ""\myaddon\radiomon.sqs""}"
where radiomon.sqs is:
~5
?CoC_IFRunning == CoCIF_Running then goto "Green"
exit
#Green
@CoCIFInit
#NoRadioLoop
?player hasweapon "MyRadioName":player addaction ["IF Radio", "\CoC_Arty\scripts\OpenMenu.sqs"]; goto "HasRadioLoop"
~5
goto "NoRadioLoop"
#HasRadioLoop
?!(player hasweapon "MyRadioName":[] exec "\CoC_Arty\scripts\End.sqs"; goto "NoRadioLoop"
~5
goto "HasRadioLoop"
simple, huh?
actually, maybe I better just slop something like that into the script library.
Oh, the plan is for things like CSAR to plug into the system. at least, I think they can
hmmm.... maybe I better throw in a couple extra lines just to make sure