YARD
YARD is a radio and voice communications mod for Arma 3. Players talk directly and over simulated radios, with signal loss over the terrain, vehicle intercoms, languages and more. It carries voice itself: the Arma server hosts the voice server, so no TeamSpeak or other voice program is needed.
YARD is a modified version of ACRE2 and keeps its API, so missions and mods made for ACRE2 work with it. See YARD and ACRE2 for what’s different.
Requires CBA A3.
Where to start
- Playing: Installation, then Basic Concepts.
- Running a server: Voice Server. Two settings and one UDP port.
- Making missions: Mission Making Intro and the Functions List.
- Coming from ACRE2: YARD and ACRE2.
Features
- Accurate simulations of the AN/PRC-343, AN/PRC-77, AN/PRC-148, AN/PRC-117F, AN/PRC-152, SEM 52 SL, SEM 70 and BF-888S.
- Vehicle racks (AN/VRC-64, AN/VRC-103, AN/VRC-110, AN/VRC-111, SEM 90), vehicle intercoms and infantry phones.
- Radio signal simulation over the terrain, with antenna patterns and several propagation models.
- Voice occlusion by buildings and objects, and vehicle sound attenuation.
- Babel: give sides or players their own languages.
- Radios with external speakers, and sharing radios with other players.
- Zeus and spectator integration.
- Built-in voice: voice activation with noise suppression, or push-to-talk.
- A documented framework for radios, antennas, intercoms, racks and game modes.
YARD is open source under the GNU General Public License v3. The source is on GitHub.
YARD and ACRE2
YARD is a modified version of ACRE2 by the ACRE2 Team (IDI-Systems). It is not affiliated with or endorsed by the ACRE2 Team. The name is a nod to its origin: an acre and a yard are both units of measure.
The radios, the signal simulation, the intercoms, babel and the rest of the gameplay come from ACRE2. What YARD changes is underneath: how voice gets from one player to another, and the extension that runs it.
At a glance
| ACRE2 | YARD | |
|---|---|---|
| Voice | TeamSpeak 3 with the ACRE2 plugin | Built in: the Arma server hosts the voice server |
| Players need | TeamSpeak 3, the plugin, and the right TeamSpeak server and channel | Nothing beyond the mod |
| Server needs | A TeamSpeak server | One open UDP port and its public address in the CBA settings |
| Direct speech | TeamSpeak’s activation | Voice activation (with noise suppression and speech detection) or push-to-talk |
| Extensions | acre_x64.dll (C++), the TeamSpeak plugin | One extension, yard_x64.dll / yard_x64.so (Rust) |
| Linux dedicated servers | Supported (the server needs no extension) | Supported: the server hosts voice with yard_x64.so (included) |
| API, classnames, configs | acre_api_fnc_*, ACRE_*, CfgAcreComponents | The same |
| Mod folder | @acre2 | @yard |
Compatibility
YARD keeps ACRE2’s API, so missions and mods made for ACRE2 work with it:
- The
acre_api_fnc_*functions, their arguments and return values. None were removed. - The
ACRE_*item and vehicle classnames,CfgAcreComponents, the vehicle attenuation, intercom and rack configs, and theacre_*CfgPatches, so addons that require ACRE2’s addons load. - The CBA events and the
acre_*variables. - CBA setting names, so existing settings files and mission settings still apply.
- Keybinds. They show under YARD in the controls menu, but keep ACRE2’s IDs, so binds carry over.
Important
YARD replaces ACRE2. Don’t load both: they use the same addon names.
Voice
ACRE2 used TeamSpeak 3: every player ran TeamSpeak with the ACRE2 plugin in the same channel, and each plugin decided what its player should hear. YARD carries voice itself:
- The Arma server hosts the voice server. There’s nothing extra to install or run. Admins set the server’s public address and open one UDP port (default 9987). See Voice Server.
- Players connect automatically with a one-time ticket from the Arma server, so only players on that server can join its voice. Voice is encrypted.
- The server routes voice: direct speech goes to players close enough to hear it, radio traffic to players with a radio on that channel. Everyone else never receives it, so bandwidth doesn’t grow with the size of the server the way TeamSpeak’s did.
- Radio effects, babel and positional sound are applied by each listener, as before. The radio and babel effects are the ACRE2 ones, ported and tested against the originals. Positional sound replaces Microsoft’s X3DAudio with a reimplementation of its behaviour, so stereo placement may differ slightly.
New for players:
- Pick your microphone and speakers in the addon options.
- Direct speech by voice activation (default) or push-to-talk. Noise suppression and speech-only activation are on by default, so fans and typing don’t transmit.
- A microphone test (
Escape → Options → YARD Microphone Test) that suggests voice activation levels. - A mute key (
Ctrl+Shift+M), a configurable push-to-talk release delay, and an option to hear yourself on your other radios tuned to the same channel. - A YARD Voice page on the map: connection, latency, packet loss and who you’re hearing.
Settings that only made sense with TeamSpeak are gone: TeamSpeak channel switching (ts3ChannelSwitch, ts3ChannelName, ts3ChannelPassword) and unmuteClients. acre_api_fnc_isVOIPConnected now reports the connection to the voice server.
New API functions: acre_api_fnc_getAudioDevices, acre_api_fnc_getMicrophoneLevel, acre_api_fnc_openMicrophoneTest.
Signal
The signal models are ported from ACRE2’s C++ extension and tested against it. Arcade, LOS Simple and LOS Multipath give the same results as ACRE2, except for one fix:
- LOS Multipath kept the terrain peaks it had found around every transmitter position it had ever computed, so results depended on what had been computed before. YARD uses the peaks around the current transmitter.
Longley-Rice (ITM) had two bugs in ACRE2, both fixed in YARD and reported upstream (#1435, #1436):
- Its line-of-sight attenuation used placeholder
cosandsinfunctions that always returned -1. - It was given the antennas’ heights above sea level instead of above the ground, so a radio on a hill was modelled as a mast as tall as the hill.
Both made ITM over-optimistic. Expect ITM signals in YARD to be much weaker than in ACRE2: typically around 20 dB, and more on hilly terrain. ITM is still marked experimental.
The signal map debug tool now works anywhere (it used to depend on a tool only the ACRE2 developers had).
For server administrators
- Set the public address in
Addon Options → YARD Voice Server(server settings), orYARD_VOICE_ADDRESS. The port defaults to 9987 (YARD_VOICE_PORT). - Open that UDP port in the firewall.
- Linux dedicated servers are supported. They need
yard_x64.soto host voice; it’s included in the release. - Logs go to
yard_ext.lognext to the RPT (YARD_LOG=debugfor more). The olderACRE2_VOICE_*andACRE2_LOGnames still work.
For modders
- Nothing changes for addons that use ACRE2’s API or configs.
- The extension is
yard("yard" callExtension […]), notacre. Nothing in the public API called the extensions directly. - Terrains whose WRP can’t be read still need a
.fakewrp(see Terrain Files); thefakewrptool replaces ACRE2’sfakewrpgen, andwav2b64replacesWav2B64.exe.
User Guides
Guides for players and server administrators.
- Installation: getting YARD, picking your microphone, and troubleshooting.
- Voice Server: setting up voice on your Arma server.
- Basic Concepts: how radios, channels and signal work in YARD.
- Feature List: everything YARD does, at a glance.
- Direct Speech, Radio Signal Loss, External Radios, Ground Spike Antenna
- Vehicle Intercom, Vehicle Racks
- Babel, Gestures, God Mode
Installation
YARD carries voice itself: there is no TeamSpeak or other voice program to install. The Arma server hosts voice (see Voice Server); players just join.
YARD replaces ACRE2: don’t load both.
Download
- Download the latest release and extract the
.zip. It contains the@yardfolder. - Put
@yardin your Arma 3 folder (replacing any older@yard). - Load it with the Arma 3 Launcher (
Mods → ... → Add watched local folder, or add@yardas a local mod), together with CBA A3. For a shortcut or server, add@CBA_A3;@yardto the-modparameter.
A Steam Workshop item is coming.
Microphone and speakers
YARD uses your system’s default microphone and output device unless you pick others. Everything is in the in-game addon options (Options → Addon Options → YARD):
- Microphone / Speakers / headphones: pick a device from the list, or System default.
- Direct speech activation: Voice activation (default) or Push to talk. With push to talk, bind the Direct Speech PTT key under
Options → Controls → Configure Addons → YARD. Radio, intercom, Zeus and god mode PTT keys always transmit, whatever this is set to. - Voice activation open / close level: direct speech starts when your microphone gets louder than the open level, and stops a moment after it drops below the close level.
- Noise suppression (on by default): removes steady background noise, such as fans, hum and room noise, from your microphone before it’s sent.
- Voice activation: speech only (on by default): voice activation only opens on sound that seems to be speech, so typing, mouse clicks and other loud noises don’t transmit. Push-to-talk keys are not affected.
- Push-to-talk release delay (0.2 s by default): how long any push-to-talk key (direct, radio, intercom, Zeus, god mode) keeps transmitting after you let go, so the end of your last word isn’t cut off.
- Hear yourself on other radios (on by default): while you transmit, your other radios tuned to the same channel play your own voice, and so do loudspeaker radios near you. The radio you’re transmitting on doesn’t.
To mute your microphone, press Ctrl+Shift+M (Mute Microphone (toggle), rebindable under Options → Controls → Configure Addons → YARD). While muted nothing is transmitted, push-to-talk included, and an icon shows in the top right corner (move it with Options → Game → Layout). Other players see a muted icon next to your name in the Players screen.
The easiest way to set the levels is the microphone test: Escape → Options → YARDMicrophone Test (also linked from the YARD Voice page on the map). It asks you to stay silent, type without talking, then talk, about 5 seconds each, and suggests levels that ignore your background and keyboard noise. Nothing is transmitted while it runs. If your typing is as loud as your voice and speech only is off, it suggests push to talk instead.
Connection status
The map has an YARD Voice page (in the diary, on the left) showing whether you’re connected, your latency, packet loss each way, bandwidth, who you’re hearing, and your microphone settings.
Configuration
You can configure YARD features to your needs. YARD uses the CBA Settings System, accessible via the in-game configuration. This applies to server, mission and client settings.
Server administrators can get available settings using the export/import features. The options then need to go into CBA’s userconfig or an addon. Server settings can be configured to override specific mission settings.
Troubleshooting
-
WARNING: YARD IS NOT CONNECTED TO THE VOICE SERVER!
The server’s voice port isn’t reachable, or your firewall blocks it. YARD retries on its own. If it persists, let your server administrator know (the server’s RPT log says why), and check that outgoing UDP to the voice server’s port (default 9987) is allowed. -
Nobody hears me / I transmit all the time
Run the microphone test, or switch Direct speech activation to Push to talk. Check Microphone is the device you talk into. -
Radio beeps not audible on dedicated server
Make sure yourserver.cfghas"b64"whitelisted inallowedLoadFileExtensions[]andallowedPreprocessFileExtensions[]if you are using that. Let your server administrator know if you have no idea what this means.
Voice Server
YARD carries voice itself instead of using TeamSpeak. The Arma server hosts the voice server: there is nothing extra to install or run.
How it fits together
players (Arma + YARD) ──UDP 9987──► Arma server (YARD, hosting voice)
- The server routes voice: direct speech to players close enough to hear it, radio traffic to players with a radio on that channel. Everything is encrypted.
- Only players on your Arma server can join it; each gets a one-time ticket from the server when they join.
- Players connect automatically. They need outgoing UDP to the voice port; nothing on their side needs configuring.
Setup
- In the addon options (
Options → Addon Options → YARD Voice Server, server settings), set:- Public address: the IP or hostname players reach this server at, e.g.
203.0.113.10orarma.example.com. Required. - Voice port (UDP):
9987by default.
- Public address: the IP or hostname players reach this server at, e.g.
- Open that UDP port in the server’s firewall (and forward it on your router if the server is behind one).
- Start the mission. The RPT log shows
Connected to the voice server. Players will connect to …, and players get an YARD connected notification.
Settings can also go in CBA’s server settings file:
force acre_sys_server_voiceAddress = "arma.example.com";
force acre_sys_server_voicePort = "9987";
Or as environment variables for the Arma server process, which take priority: YARD_VOICE_ADDRESS and YARD_VOICE_PORT (the older ACRE2_VOICE_* names also work).
Changing either needs a mission restart.
Troubleshooting
- RPT:
no voice server address set: set Public address. - RPT:
starting the voice server on UDP …: the port is in use (another Arma server on this machine? give each its own port) or not allowed. - Players see not connected to the voice server: the port isn’t reachable from outside (firewall, router), or Public address is wrong.
Bandwidth is roughly 25 kbit/s per speaker per listener while they talk, nothing while silent. Logs: yard_ext.log (set YARD_LOG=debug for more).
Basic Concepts
Half-duplex radios
All the radios currently included in YARD are what is commonly known as half-duplex radios. This means that they can only transmit or receive at any given time. In practice, this means that if you are transmitting on a radio, you cannot hear anyone else.
If there are multiple speakers on the same frequency, they will interfere with eachother in such a way that you will only receive the strongest (usually closest) speaker.
Half-duplex limitations can be turned off in missions by using the Full Duplex and Interference CBA Settings.
Radios
| Radio Name | Strength | City Range | Perfect Range |
|---|---|---|---|
| AN/PRC-343 | 100 mW | 400 m | 850 m |
| AN/PRC-148 | 5 W | 3-5 km | 5-7 km |
| AN/PRC-152(c) | 5 W | 3-5 km | 5-7 km |
| AN/PRC-117F | 20 W | 10-20 km | Horizon |
| AN/PRC-77 | 4 W | 1-3 km | 3-5 km |
| SEM 52 SL | 1 W | 1-2 km | 2-4 km |
| SEM 70 | 4 W | 1-3 km | 3-5 km |
| BF-888S | 5 W | 2-4 km | 4-6 km |
Classes can be found on the Class Names page.
Terrain and object interference
YARD realistically traces a signal path from the transmitting radio to any potential receivers. At the frequencies used on the currently available radios (VHF to UHF, 30 to 3000 megahertz), the radio waves act mostly like light, in the sense that they are blocked or attenuated by objects and the ground.
Unlike light these radio waves can still penetrate things like walls to some extent, but they will lose power and the range of the radio will be reduced. This might not affect a speaker if he is in a lone building in otherwise open terrain, but it will reduce signal strength and range inside a city or built-up area.
Terrain will outright block VHF and UHF signals. Some waves can bleed through via scattering and reflection, but generally radios on these bands are considered to be Line of Sight (LOS) radios as far as terrain is concerned.
The amount the signal is attenuated by objects and terrain can be reduced or removed using the Loss Model Scale CBA Setting.
Antennas
Following table shows a list of all antennas implemented in YARD. Currently, antennas cannot be swapped on the devices, default attached antennas are marked in bold.
Each antenna has a gain pattern (visualized in linked video), which is the signal pattern of the antenna over the supported range of frequencies. Gain patterns can be used to determine best frequencies to use in specific conditions with a given antenna. This is only relevant if using directional antennas (Ignore Antenna Direction setting disabled).
| Antenna Name | Type | Compatible Devices |
|---|---|---|
| 1M VHF TNC | TNC | AN/PRC-148, AN/PRC-152 |
| 1M VHF BNC | BNC | AN/PRC-148, AN/PRC-152 |
| 2.5 INCH UHF PRC343 | TNC | AN/PRC-343 |
| 0.4M SEM52/SEM70 | BNC | SEM 52 SL |
| 0.9M SEM52 | BNC | SEM 52 SL |
| 1.03M SEM70 | BNC | SEM 70 |
| AT-271 PRC-77 | 3/8“ | AN/PRC-77 |
| 1.23M VHF TNC | TNC | AN/PRC-117F |
| 2.7M MB VEH BNC | BNC | AN/VRC-103, AN/VRC-110, AN/VRC-111 |
| FA80 VEH BNC | BNC | SEM90 |
| AS-1729/VRC | 3/8“ | AN/VRC-64 |
| 2.43M Ground Spike | TNC | AN/PRC-148, AN/PRC-152, AN/PRC-117F, AN/PRC-77, SEM 70 |
| 6.43M Ground Spike | TNC | AN/PRC-148, AN/PRC-152, AN/PRC-117F, AN/PRC-77, SEM 70 |
| 22CM NA-701 | SMA | BF-888S |
Classes can be found on the Class Names page.
Feature List
An “at a glance” overview of what YARD does. YARD inherits ACRE2’s radios and simulation, built up by the ACRE2 Team over many years, and adds its own voice system. See YARD and ACRE2 for what differs.
High-Level Summary
- Provides realistic sounding radio and direct voice communications for ArmA3
- Signal loss and degradation is done using REAL WORLD ITU Terrain loss modeling and signal propagation techniques. We model everything from mapping terrain and creating loss maps to the antenna’s, power and frequencies of the radios
- ‘Regular’ talking can travel over 100 meters in ideal terrain
- Direct speaking occlusion, buildings and objects block your voice
- AI direct speaking detection; AI can also hear you talking and alert to you
- All radios are modeled and SIMULATED to their real world counterparts
- Easy to use, only a few buttons are required to play
- Babel feature & Radio configurations allows for immersive TVT and brings radios/communication in as a gameplay mechanic
- Extensive and documented API and example set for easy use
- Template setups for milsim community operations
- All vehicles have realistic attenuation, meaning different positions hear inside/outside differently
- Vehicle intercom system; Vehicles with intercoms automatically have crew communicate with them. Additionally some vehicles like tanks and IFVs have Infantry Telephones
- Vehicle racks; Vehicles can now have radio racks mounted that allow increasing the transmitting power of mounted radios. It is integrated into vehicle intercom functionality
- In-game speakers; you can put your radio on ‘speaker’ mode and everyone can listen. If you drop the radio, it keeps playing!
- Multiple Push-To-Talk keys, for assigning different radios to different hotkeys
- Preset naming and descriptions for radios that support it. Includes name showing in hints
- External radios; radios in other player’s inventory can be accessed and used
- Built-in voice: no TeamSpeak or other VoIP program needed
Radio Communications
- ITU Signal Loss and Terrain Modelling
- Radio Interfaces
- Easy to Use
- API/Pre-programming for milsim groups
- Antennas and Components
- Ground spike antenna
Direct Communications
- Babel (TVT Languages)
- Distance and Scaling
- Building/object Occlusion
- Vehicle Intercoms and Infantry Telephones
- Vehicle Attenuation
- AI Hears you
- Possibility to send voice and text messages to groups of players without attenuation (God Mode)
TVT
Example TVT Gameplay
You can have a TVT with 2 sides. Each side speaks its own babel language, except for some translators. Each side also has their own radio configurations. This would mean that even if you stole another sides radio, you can hear them transmit and hear what they are saying - but not understand it. You’ll need to get the radio to your translator to actually leverage that radio. Signal loss can play into this as well - maybe you can triangulate or discover enemies passed on their radio communications.
Babel
Babel provides a method for a mission maker to give each side or individual players their own languages. If you can’t understand a language, that persons speaking sounds garbled and reversed. People have described it sounding like pig latin. This allows for whole new levels of gameplay where you can hear people or steal their radios, but not understand them. You can also include translators who speak both languages, extending possible mission scenarios.
TVT Radio Setups
ACRE2 has always supported assigning different radios and frequencies to different sides, and made radios physical objects. This means that the radio’s configuration is tracked with the object. If a radio is dropped, or collected off a dead player, the other player sees that radios configuration and can use it. This, combined with babel, allows for many different TVT scenarios and added levels of great gameplay.
Creator DLC Compatibility
YARD carries ACRE2’s compatibility components for several Creator DLCs. These include terrain data for signal calculations, because the terrains are published encrypted and can’t be read on map load. Compatibility loads automatically with the Creator DLC.
| Creator DLC | Compatibility |
|---|---|
| Global Mobilization | Terrain data for signal calculations |
| S.O.G. Prairie Fire | Terrain data for signal calculations. AN/PRC-77 in the co-op campaign |
| Western Sahara | Terrain data for signal calculations |
| CSLA Iron Curtain | Terrain data for signal calculations |
| Spearhead 1944 | Terrain data for signal calculations. AN/PRC-77 in radio backpacks. Customised radio racks, including command vehicles with additional radios |
Note
The Creator DLC compatibilities were contributed to ACRE2 by their authors and other contributors.
Direct Speech
YARD’s direct speech simulates speech coming from a player’s mouth and be heard by players around them. If you broadcast on the radio you will also be heard by other players within range of you.
Direct speech slider
YARD has a built in direct speech slider allowing you to determine how far your voice in direct speech should travel. The system has five states and by default starts in the middle state. The below table contains an approximated table with empirical testing by Bullhorn.
| Volume state | Loud (m) | Quiet (m) | Barely audible (m) |
|---|---|---|---|
| 1/5 | 1 | 2 | 13 |
| 2/5 | 3 | 15 | 55 |
| 3/5 | 8 | 30 | 100 |
| 4/5 | 12 | 45 | 145 |
| 5/5 | 15 | 55 | 195 |
Changing the volume state
Simply hold your volume modifier key (default: TAB) and use your scroll wheel to move the slider. The bigger the slider gets (scroll up) the further your voice will go. The smaller the slider gets (scroll down) the shorter your voice will travel.
Object occlusion
Voice occlusion will occur if there is direct path for another player’s voice to be heard. There is a system which will reduce the volume of other players that are behind objects or in buildings they will close across as quieter.
Vehicle attenuation
Vehicle attenuation is the system where people outside and inside of a vehicle may hear each other at reduced volumes. This is particularly noticeable in armoured vehicles but generally isn’t in effect in open seats. This is can be different for each seat in the vehicle. Turning out of the vehicle will also reduce this effect. Generally firing from vehicles positions, helicopter door gunners) will have this effect weakened too. This should generally work well with most vehicles from mods.
For technical details for addon makers see vehicle attenuation configuration.
Radio Signal Loss
YARD seeks to provide a realistic fidelity when it comes to radio signal. The signal model is customisable and should able to fit the desired gameplay for most communities. See the ‘Configuration’ section below for further details.
The radio model in YARD uses the terrain height map to calculate multiple possible pathways the radiowaves travel. For performance reasons this is carried out with an extension and is not handled in SQF. Constructive and destructive interference from the multipath pathways is calculated.
Every radio also has its own transmission power which determines the initial strength of the radiowave. Antennas also play an important role in determining the directional strength of radiowaves being sent and received and are modelled in YARD. The frequency of a radiowave determines the wavelength and every antenna has its own properties for the ideal frequencies it can pick up. The strength of a radiowave is calculated by the receiving radio and if isn’t strong enough you will either not hear it or may hear some distortion.
The antenna direction for infantry is simulated as being relative to the direction of their back. If radio antenna direction is not ignored (see below) this can be observed by having difficulties receiving transmissions from other players who are prone if you are standing and vice versa as the antennas will be out of alignment.
However it is possible to manually align the antenna by bending it in order to improve signal quality. To keep it as simple as possible, there are only two possible antenna alignments, the player can choose between the two via ACE Interaction Menu or Custom Keybind (default: CTRL+ALT+UP). In addition to the manual method, there is always the possibility to activate an automatic antenna alignment via CBA Settings (see below). The current alignment of the antenna is shown in the Arma 3 Stance Indicator.
The radios in YARD by default are setup to use maximum transmission power and the frequencies their antennas are best suited for.
Note: In the present simulation model buildings and terrain objects do not effect radio signals due to technical limitations but this may change in future versions of YARD.
Configuration
These can be setup via CBA Settings.
Terrain Loss
This setting effects the signal loss that occurs due to terrain. The CBA Setting can be used to change the simulation model on the fly.
Default value: Enabled (0.5)
Interference
Multiple transmissions on the same frequency can be destructive this setting allows you disable that interference allowing you to hear multiple speakers on the same frequency at once. Otherwise you will hear destructive interference if multiple people are transmitting on the same frequency (if both transmissions are received and one does not dominate the other).
Default value: Enabled
Full Duplex
This setting allows a radio to broadcast and receive transmissions at the same time. Allowing you to hear others speaker on the same frequency as you talk. It is recommended to disable interference if you enable full duplex.
Default value: Disabled
Ignore Antenna direction (introduced in v2.2.0)
This setting can be used to disable the simulation of antenna radiation patterns for both the transmitting and receiving radios. It will make all antennas act with perfect omni-directional behaviour.
Default value: Disabled (antenna direction is taken into account)
Automatic Antenna direction
This setting enables an automatic antenna alignment to improve signal strength e.g. when being prone.
Default value: Disabled (antenna needs to be aligned manually)
Note: If the antenna direction is ignored, this setting will have no effect.
Radio Wave Propagation Models
This setting allows selecting the propagation model and it can be changed mid-mission with a global effect. For the moment the following models are supported:
- Arcade: This model is the simplest and it is targeted for a casual gameplay. It is a largely based on free-space path loss over the distance which does not take into account terrain. It is also provides a bit of a boost to the signal strength of the AN/PRC-343: the range of a AN/PRC-343 is around 500m and virtually all other radios will have no problems with Arma terrains (40km+). The terrain loss and antenna direction settings will have no effect in this model.
- LOS Simple: This model is based on free-space path loss but without multi-path capabilities.
- LOS Multipath: Is the default model in YARD.
- Longley-Rice (ITM): also known as the irregular terrain model (ITM) is as of 2.7.0 an experimental model in YARD. It is a model valid for radio waves between 20MHz and 20GHz. The terrain loss and antenna direction settings will have no effect in this model.
Default value: LOS Multipath.
External Radios
Important
Requires ACE3 Interaction Menu!
YARD offers the possibility of using radios in other player’s inventory. To do so, the player has to first allow the external use of the radio by “sharing” it: self-interaction, select the radio to be shared and finally choose the option to share the radio. In this mode, you can still access the radio and send/receive transmissions. However, facing a unit with a shared radio and interacting with it, allows taking the headset: you will be able to then use the radio externally (change frequencies, send/receive transmissions, …). From here, you can either return the headset or give it to another unit. The actual owner of the radio is not able to hear nor send any sort of transmissions from this radio in the current implementation.
As a radio owner you can also give the headset of any shared radio in your inventory. To do so, face the unit you want to give the headset to and interact with it. The option of giving the radio will appear. The headset cannot be retrieved unless the other player decides to do so.
Ground Spike Antenna
Important
Requires ACE3 Interaction Menu!
The GSA is a radio antenna which can be deployed in the field which allows for some radios to be connected. Doing so will increase the transmit power to 20 W and improves the quality of the transmission due to the increased height of the antenna, generally resulting in an improved quality over range.
The ground spike antenna supports the following radios:
- AN/PRC-77
- AN/PRC-117F
- AN/PRC-148
- AN/PRC-152
- SEM 70
The VHF30108 GS or Ground Spike (ACRE_VHF30108SPIKE) can have the VHF30108 Mast (ACRE_VHF30108MAST) mounted on afterwards which combines it into VHF30108 GSM or Ground Spike with Mast (ACRE_VHF30108). GSM can also be separated back into Ground Spike and Mast for easier carrying.
Vehicle Intercom
Vehicle Intercom
Vehicle intercom consists of two separate networks depending on the vehicle type: crew and passenger (pax) intercom. Intercom gives the ability to speak to other players within the same network using a headset. This allows them to communicate without the disturbance of the vehicle’s noise.
While crew intercom is limited to crew members and players in cargo positions cannot have access to it, pax intercom can be accessed by both crew and passengers. This allows the crew to communicate with the passengers if such network exist. In order to connect to the pax intercom, ACE3 Interaction Menu is needed: simply interact with the vehicle when being in a seat with access to pax intercom and select connect. Crew intercom is automatically assigned to players in “crew” positions.
Vehicle intercom system allows for an easier communication among crew members of a vehicle that has intercom functionality. It functions just like intercom in real life vehicles, giving the crew ability to speak to each other using a headset. Each station has three configurations:
- Receive: the unit will only be able to hear incomming messages and all outgoing messages will not be transmitted through intercom. This configuration is displayed as (R) in the HUD.
- Transmit: the unit will only be able to transmit messages through intercom but it will not hear any incomming messages. This configuration is displayed as (T) in the HUD.
- Receive and Transmit: the unit can hear and send messages through the intercom system. This configuration is displayed as (R/T) in the HUD.
In addition, two operating modes are available through ACE self interaction menu:
- Voice activation: the unit automatically uses intercom when starting speaking (P subsitutes the T entry in the HUD).
- PTT activation: the unit only transmit using the intercom when manually pressing the intercom PTT key (unbound by default) (B subsitutes the T entry in the HUD).
Some vehicles have additionally, restrictions on the amount of connections available in order to join the pax intercom. These positions are configured by default to be in PTT activation mode.
Optionally, each network has a master station. Such stations can broadcast a message (activation through intercom broadcast PTT key), temporarily disabling all transmit functionality in all stations. One useful feature in the master station is the accent feature. When enabled, incoming radio transmissions will have their volume reduced by 20% if intercom is being used by any crew member at the same time. All intercom stations are affected by this behaviour.
Full Functional Crew Station (FFCS)
This interface can be opened using the ACE Interaction menu or through a shortcut (default ⇧ Shift+Ctrl+Tab ⇥). The opened intercom will be displayed in green in the HUD.
Volume Knob
Sets the overall volume of the intercom and monitored/active radios. Red frange boosts the volume for noisy environments.
Monitor Knob
Monitors the selected radio or all radios. Radios in this configuration are set to receive only.
Work Knob
The selected radio is capable of receiving and transmitting.
Intercom Knob
It has 4 positions. When at PTT, the intercom will behave as PTT activation mode, LIVE and VOX is the equivalent of Voice activation and O/R allows the FFCS to transmit a priority message by temporarily disabling all other FFCS stations.
Infantry Telephone
Infantry also has the possibility, in vehicles like tanks or IFVs, to communicate with the crew and/or passengers without entering the vehicle. To do so, face the vehicle, interact with it and take the infantry telephone by selecting the appropriate network if it is not in use already. You can either put it back, give it to another player or switch networks.
Telephone can be mounted on the hull of the vehicle or in the center of the vehicle. If mounted on the hull (requires config support), maximum distance is 1.5m, otherwise it is 10m. The telephone will automatically be returned if the distance exceeds the maximum, either by player movement or vehicle movement.
Crew members (not passengers) can make the infantry telephone ring as long as it is not in use. In order to do so, interact with the vehicle from one of the allowed positions (driver, commander, gunner and turret positions) and select start/stop ringing. The ringing will automatically stop once the infantry telephone is picked up, the vehicle is destroyed or no crew members are aboard.
For technical details for addon makers see vehicle intercom configuration.
Vehicle Racks
Important
Requires ACE3 Interaction Menu if no Intercom is configured for a given vehicle!
YARD allows the possibility of using racks in vehicles in order to increase the transmission power of a particular radio. There are different types of vehicle racks:
- AN/VRC 64: Allows mounting an AN/PRC 77, increasing its transmitting power from 3.5W to 50W.
- AN/VRC 103: Allows mounting an AN/PRC 117F, increasing its transmitting power from 20W to 50W.
- AN/VRC 110: Allows mounting an AN/PRC 152, increasing its transmitting power from 5W to 20W.
- AN/VRC 111: Allows mounting an AN/PRC 148, increasing its transmitting power from 5W to 20W.
- SEM 90: Allows mounting a SEM 70, maintaining its transmitting power at 4W on low power or increasing it to 40W on high power.
In order to use and mount and unmount (when possible) a vehicle rack, ACE3 Interaction Menu is needed: simply interact with the vehicle when being in a seat with access to vehicle racks and select use radio. Multiple players will be able to use the radio simultaneously, except for the case of sending a transmission when the radio is already transmitting! Some vehicle racks, however, can be also accessed from outside the vehicle.
Configuring the vehicle rack (opening the radio GUI) is disabled for turned out positions.
Note: Vehicle Racks cannot be accessed by AI that is being remote controlled by a Zeus Gamemaster.
Vehicle intercom
In addition, vehicle racks are integrated into the intercom system. A rack with access to crew or passenger intercom allows players without access to the rack to hear incoming transmissions. These players however, will not be able to configure the radio nor transmit through it in the current implementation.
Radios that are connected to an intercom cannot be accessed using the ACE Interaction Menu. Instead, one must open the Intercom UI (default ⇧ Shift+Ctrl+Tab ⇥) and select the desired radio(s) using the upper two knobs as described in the intercom section
Babel
YARD introduces an exciting new voice feature for adversarial and cooperative play in the Babel System. This system allows mission makers to define a set of “languages” for players and assign players individually, however you choose, which languages from that set they speak, from one language to multiple languages. If a player speaks a language that another player doesn’t understand the voice of that speaker will be transformed into an unintelligible sound, but one that still retains the elements of language, such as inflection, tone of voice, and cadence of speech. If you speak multiple languages you are able to switch between which language you are speaking in, and will hear people speaking any of the languages you understand unaffected by the Babel System.
For adversarial play this allows you to hide all enemy communications from understanding unless there is someone defined as speaking that language. For cooperative play the use of interpreters between multiple language groups becomes essential, adding a new dynamic to the play experience.
Gestures
Important
Requires ACE3 Common!
By default, YARD plays a small animation when the player uses their radios. This is known as a gesture as it only impacts certain parts of the character and doesn’t prohibit movement.
To differentiate between using two types of radios, by default some radios will play a chest touching gesture, others will play an ear touching gesture. Currently, the radio lists are as follows:
| Chest | Ear |
|---|---|
| ACRE_PRC343 | ACRE_PRC148 |
| ACRE_PRC77 | ACRE_PRC152 |
| ACRE_SEM52SL | ACRE_PRC117F |
| ACRE_SEM70 |
There are two settings in regards to this component. You can enable/disable the overall functionality as well as prevent aim down sights.
Goal of preventing aiming down sights is to model a slightly more realistic environment. When this is enabled, if you’re talking on the radio, you cannot aim down your sights, this is because you’re using one hand to activate the radio. You can still fire one handed from this position but it’s less than accurate. Is you’re already aiming down your sights when you key the radio, you will stop aiming down sights.
God Mode
YARD offers the possibility of sending voice and text messages to groups of players without attenuation effects. This functionality is known as God Mode and consists of:
- Integration with Arma 3 Chat Channel: when pressing the corresponding Push-To-Talk (PTT), a voice message is going to be sent to those players matching the criteria of the current chat channel. Note: Custom chat channels are not supported. Custom, Direct and Command all behave same as Global.
- Group presets: up to three configurable group presets that can be accessed through their respective PTTs. When pressing it, a voice message without attenuation is going to be sent to those players, including dead ones. The group presets can be modified through the API.
- Sending a text message to group presets.
By default, Administrators and players in Zeus can access God Mode functionality. Its access can be further customized through the API.
For technical details for addon makers see God Mode configuration.
Radios
How to use each of YARD’s radios.
| Radio | Type |
|---|---|
| AN/PRC-343 PRR | Personal role radio |
| AN/PRC-148 | Handheld |
| AN/PRC-152 | Handheld |
| AN/PRC-117F | Manpack |
| AN/PRC-77 | Manpack |
| SEM 52 SL | Handheld |
| SEM 70 | Manpack |
| BF-888S | Handheld (civilian) |
AN/PRC-343 PRR
The AN/PRC-343 PRR is short range lightweight intra-squad personal role radio originally known as Marconi H4855 in British service. It is designed to be carried by every squad member and features 16 channel in 16 blocks (256 channels in total) with a range up to 500 meters.
Operation
Interface
The interface in YARD can be reached via two different ways:
- double click the AN/PRC-343 in your inventory
- press the “Open Radio” key as it is defined in the YARD keyboard controls (Default : Ctrl+Alt+CapsLock)
For the second option you need the AN/PRC-343 as your active radio. If another radio opens instead, use the ”Cycle Radio” key until the 343 is your active radio.
Volume Control
Left clicking the volume knob increases the radio’s volume by 20 % to a maximum of 100 % while right clicking decreases it to a minimum of 0 %.
Channel Control
Left clicking the channel knob increases the channel by 1 while right clicking decreases it. The current channel will also be shown in the lower left when you start transmitting. The channel knob has 16 different channels. If you want to access the other channels you have to left click the handle which offers you the following view:
Left clicking the channel block knob increases the block by one to a maximum of 16 while right clicking decreases it. The current block will be shown while transmitting. Changing the block has no influence on the volume and channel knob setting. If you are on block 1 channel 13 and change your block by one, you will be on block 2 channel 13 which is a different channel.
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_PRC343
Can be added using the following methods.
To a unit’s inventory:
- unit addItem{:target=“_blank”} “ACRE_PRC343”;
- unit addItemToVest{:target=“_blank”} “ACRE_PRC343”;
- unit addItemToUniform{:target=“_blank”} “ACRE_PRC343”;
- unit addItemToBackpack{:target=“_blank”} “ACRE_PRC343”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_PRC343”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_PRC343”,1];
Channel Preset Data Fields
| Field name | Description | | –––– | –––– | –––– | | frequencyTX | Transmit Frequency | | frequencyRX | Receive Frequency |
AN/PRC-148
The AN/PRC-148 Multiband Inter/Intra Team Radio (MBITR) is a secure handheld multiband, tactical software-defined radio. It was developed in the 1990’s entering service in 2000 with the US Army.
Basic Operation
Interface
Power/Volume Control Knob
Left clicking will increase the radio’s volume to a maximum of 100%. Right clicking will decrease the radio’s volume to a minimum of 20%.
You can turn the radio off by holding control and right clicking the volume knob while it is at the minimum setting of 20%. To turn the radio back on simply left click the volume knob.
Channel Knob
Left clicking the knob will increment the current channel selection through the 16 settings on the knob.
Right clicking will decrement the current channel selection through the 16 settings on the knob.
The channel knob has 16 settings, the channels available is dependant upon the current group selected. By default: Group 1: Channels 1 - 16, Group 2: Channels 17 - 32, etc.
LCD Display Screen
The LCD display screen is where all menus and information will be displayed. The primary/default display screen has two ‘modes’. These are detailed in the graphic above.
The primary default display shows the current Group label, channel label, audio mode icon, battery indicator, operating mode, and encryption mode.
The alternate default display shows the current receiving (RX) and transmitting (TX) frequencies, current receiving (R) and transmitting (T) squelch tones, encryption key, data/traffic rate, and operating mode.
Keypad
| Keypad | Function | ALT Function |
|---|---|---|
| ALT | Press and hold your keyboard ALT key for alternate functions | Not Applicable |
| MODE | Opens Mode Select screen | Opens Programming Menus screen |
| GR | Opens Group Select screen | Opens Scan Operation screen |
| ESC | Closest current screen / Returns to previous screen | Lock / Unlock keypad |
| ▼ | Decrement selection or value | Highlights character to left of current selection |
| ▲ | Increment selection or value | Highlights character to right of current selection |
In-Depth Operation
Group Select
The channel knob on the AN/PRC-148 can access 16 of the 100 programmable channels. These are organized into groups of 16 channels. The channels available through the channel knob depend on the currently selected group.
Press the GR key to open the group select menu.
This menu displays the label of the currently selected group. To select a new group, press the ▼ or ▲ keys.
With the desired group highlighted, press ENT to select the new group and return to the default screen.
Mode Menu
To change the radio Operating Mode, press the MODE key on the keypad.
The menu of available parameters appears on the display. To move the selection outline, use the ▼ or ▲.
To change the selected parameter, first press ENT to select the currently highlighted menu item and use the ▼ or ▲ to change the selection value. Press ENT to confirm the change and move the outline to the next line.
The first line selects the audio path: internal audio, external audio, or external audio with sidetones enabled (INT/EXT AUDIO, SIDETONE).
The INT AUDIO setting will enable the internal speakers of the radio, all other settings currently use the external headset. None of the other MODE Select options, such as Emergency Beacon, are currently implemented.
Programming Menu
To manually alter channel data for any of the AN/PRC-148’s 100 channels the Programming Menu needs to be accessed.
The Programming Menu screen is accessed by pressing and holding the ALT keyboard key and pressing the MODE button on the keypad.
To select a sub-menu of the Programming Menu use the ▼ or ▲ keys and press ENT to select the desired menu. Currently the only implemented Sub-Menu is the “Program” menu, all other will return “ACCESS DENIED”.
Within the Program menu there are a number of other options, currently the only functional option is the Channel programming menu, to enter this select Channel in the programming menu.
The Program Menu allows for the programming of a variety of radio functions. Currently only the “CHANNEL” sub-menu is implemented, which can be selected through the ▼ or ▲ and ENT.
Channel Programming
The “Channel” Menu allows the user to program general channel data (channel number, encryption mode, channel label, transmission power, etc.) and select the operating mode (the type of radio operation to be programmed in a channel).
The screen opens with the Channel Number outlined. To change the channel use the Channel Knob. To navigate the channel programming menu use the ▼ and ▲ keys, and ENT to select a channel setting you would like to change.
Encryption Mode
To change the encryption mode setting use the ▼ or ▲ keys to toggle between “PLAIN” and “SECURE”, press ENT to confirm.
Channel Label
The Channel Label setting allows the user to give the Channel a custom label.
When entering the Channel Label setting, the rightmost character will be in reverse video. To select a new character, scroll up or down using the ▼ or ▲ keys.
Holding the ALT key and pressing ▲ will move to the character to the right of the current selection. Holding the ALT key and pressing ▼ will move to the character to the left of the current selection.
When all the characters of the new label have been selected, press ENT to confirm.
Output Power
The Output Power (“PWE”) can be set to: 0.1W, 0.5W, 1.0W, 3.0W or 5.0). Use the ▼ or ▲ keys to scroll through the available power settings. Press ENT to confirm.
Operating Mode
WIP
RX & TX - Receive & Transmit Frequencies
The Receive Frequency (RX) is the frequency the radio will receive on when using the channel being edited. The Transmit Frequency (TX) is the frequency the radio will transmit on when using the channel being edited.
To change the frequency, press ENT. To change the selected value, scroll up or down using the ▼ or ▲ keys. To change the selected digit, hold the ALT key and press ▼ or ▲ to move selection left and right.
Note that the TX frequency automatically matches the RX frequency unless it is manually changed.
R & T - Receive & Transmit CTCSS Subtones
Modulation
Traffic Rate
Encryption Key
RPTR - Repeater Delay
FADE - Fade Bridge
PHASE - Crypto Synchronization
SQUELCH - Squelch Level
The squelch level determines the signal quality required to “break squelch” and activate the receiver.
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_PRC148
Can be added using the following methods.
To a unit’s inventory:
- unit addItem{:target=“_blank”} “ACRE_PRC148”;
- unit addItemToVest{:target=“_blank”} “ACRE_PRC148”;
- unit addItemToUniform{:target=“_blank”} “ACRE_PRC148”;
- unit addItemToBackpack{:target=“_blank”} “ACRE_PRC148”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_PRC148”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_PRC148”,1];
Channel Preset Data Fields
| Field name | Description | | –––– | –––– | –––– | | power | Power Setting | | frequencyTX | Transmit Frequency | | frequencyRX | Receive Frequency | | encryption | Encryption Mode | | channelMode | Operating Mode | | label | Channel Label | | CTCSSTx | RX CTCSS Subtone | | CTCSSRx | TX CTCSS Subtone | | modulation | Modulation Type | | trafficRate | Traffic / Data Rate | | TEK | Encryption Key | | RPTR | Repeater Delay | | fade | Fade Bridge | | phase | Crypto Synchronization | | squelch | Squelch Level |
Further Reading / External Links
AN/PRC-152
The AN/PRC-152 Multiband Handheld Radio (Harris Falcon III) is a portable, compact, tactical software-defined combat-net radio manufactured by Harris Corporation.
Basic Operation
Interface
Basic Use
Function Switch
Left and right clicking the function switch will cycle between the 1st 6 preset channels on the radio. Additionally this can be used to turn off the radio by placing the switch in the left most position, turning it back to any of the channel positions will turn the radio back on.
Volume Control
The radio volume can be adjusted using the volume control button on the left hand side of the radio, above the large press to talk key.
Left clicking on this will increase the volume, while right clicking will decrease the radio volume. The volume setting will be displayed on the LCD screen when you use this button.
Changing Channels
Click PRE +/- to change between channels. Alternatively, you can use the top knob to switch between channels 1-6.
In-depth Operation
Programming Instructions
The Farris radio operating system follows a standard across all farris radios for operational programming, usage, and menu navigation.
Navigation
Menus and items are navigated with either the UP-DOWN or LEFT-RIGHT arrows; depending on the menu type. CLR will take you back at any time, and ENT is generally used for saving values. If you use CLR to back out of a menu, those settings are not saved. As you navigate through a series of menus, those values are not saved to the radio until the cycle is complete.
Entering values
Numerical values are entered with the number pad, clicking left and right to navigate the digit. Alphanumeric values are entered the same way, by repeatedly pressing the given button and cycling through letter options. Upon pressing a different button, that value is entered and the menu is moved to the next digit.
Operational Programming
All operational programming modes are accessible through pressing 7-OPT button. Once entering this menu, you’ll receive the operational programming menu. Operational changes to a radio are erased when the current channel is changed, unless auto-saving is on.
Preset Programming
All operational programming modes are accessible through pressing 8-PGM->System Presets menu. Once entering this menu, you’ll receive the operational programming menu. Operational changes to a radio are erased when the current channel is changed, unless auto-saving is on.
Programming a NET Preset
Press PGM, select System Preset Settings, select System Presets, use UP/DOWN to navigate the preset to modify. Begin changing settings.
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_PRC152
Can be added using the following methods.
To a unit’s inventory:
- unit addItem{:target=“_blank”} “ACRE_PRC152”;
- unit addItemToVest{:target=“_blank”} “ACRE_PRC152”;
- unit addItemToUniform{:target=“_blank”} “ACRE_PRC152”;
- unit addItemToBackpack{:target=“_blank”} “ACRE_PRC152”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_PRC152”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_PRC152”,1];
Channel Preset Data Fields
| Field name | Description | | –––– | –––– | –––– | | frequencyTX | | | frequencyRX | | | power| | | encryption | | | channelMode | | | name | | | CTCSSTx | | | CTCSSRx | | | modulation | | | TEK | | | trafficRate | | | syncLength | | | squelch | | | deviation | | | optioncode | | | rxOnly | |
AN/PRC-117F
Work in progress, this radio and the documentation is not yet final.
See AN/PRC-152 for general operation guidelines.
Interface
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_PRC117F
Can be added using the following methods.
To a unit’s inventory:
As the PRC-117F is a manpack radio a unit is required to have a backpack to carry this. Additionally, the PRC-117F can only be added to a unit’s backpack.
- unit addItemToBackpack{:target=“_blank”} “ACRE_PRC117F”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_PRC117F”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_PRC117F”,1];
Channel Preset Data Fields
| Field name | Description | | –––– | –––– | –––– | | frequencyTX | | | frequencyRX | | | power| | | encryption | | | channelMode | | | name | | | CTCSSTx | | | CTCSSRx | | | modulation | | | TEK | | | trafficRate | | | syncLength | | | squelch | | | deviation | | | optioncode | | | rxOnly | | | active | |
AN/PRC-77
The AN/PRC-77 is a portable VHF FM manpack radio first introduced in 1968 during the Vietnam War. It served as the primary squad-level radio for US troops up to and including the Gulf War, after which it was phased out by the AN/PRC-119 SINCGARS system.
Video Guide{:target=“_blank”}
Basic Operation
Interface
The Radio Interface is opened using the YARD Open Radio Interface key (default ALT + CTRL + CAPSLOCK). Unlike the other combat net radios in YARD, the PRC-77 is an analogue device without any menus or screens or keypads.
Function switch
This is the primary function switch of the radio; it has five settings:
| Setting | Function |
|---|---|
| OFF | Turns radio power off |
| ON | Turns radio power on |
| Squelch | Enables 150 kHz subtone squelch |
| Retrans | Enables retrans mode |
| Lite | Momentarily lights up the frequency display |
Volume switch
Sets the receive volume of the radio. Left click to increase the volume, right click to decrease the volume.
Tuning knobs
Two knobs, one for 1 megahertz increments and another for 50 kilohertz (0.05 MHz) increments. The selected frequency is shown in the channel dial. Holding shift while clicking either of these will increment the selected knob by 5 steps.
Upper/lower frequency band switch
This switch toggles between the upper and lower frequency bands that are available. The lower, default, position lets you tune the radio to frequencies from 30.00 MHz to 52.95 MHz, and the upper position is for the 53.00-75.95 MHz range.
Transmit power
The radio’s maximum transmit power is 4W, but depending on the selected frequency its effective transmit power can be lower.
| MHz range (inclusive) | Effective Tx Power |
|---|---|
| 30-33 MHz | 3.5 W |
| 34-50 MHz | 4.0 W |
| 51-53 MHz | 3.5 W |
| 54-71 MHz | 3.0 W |
| 72-75 MHz | 2.6 W |
Preset buttons
You can save two presets on the PRC-77 by using the two buttons above each tuning knob. Right-click on the button to save the preset, and left-click to recall it.
Mision Editor Information
Classname: ACRE_PRC77
Note: The AN/PRC-77 is a manpack/backpack radio and as such unit’s require a backpack for the radio to be added to their inventory.
SEM 52 SL
The SEM 52 SL (Sender/Empfänger, mobil SEM 52 SL) is a small power radio for military purposes in the German Army. It was issued in 1995 and succeeds the SEM 52 S. As a modern radio it can transmit voice and data. To transmit voice a built-in loudspeaker / microphone is used. An external microphone can also be connected. The frequency band is from 46 to 65,975 MHz. The channel spacing is 25 KHz. 800 channels are available.
Technical Data
- Frequency band: 46,000 to 65,975 MHz
- Channel spacing: 25 KHz (default)
- Channel presets: 12 permanent + 1 volatiles (Channel H)
- Operating mode: Simplex or Semiduplex
- Operating voltage: 8 to 15 V
- Transmitting capacity: 1 W (selectable internally 0,3 – 2 W)
- Antenna: 0,4 m (modelled) or 0,9 m
Basic Operation:
Interface
Volume Control Knob
The volume control knob has 16 settings and is divided in volume control with (filled volume arrow) and without squelch (open volume arrow). Operating the radio without squelch is not modelled. Right and left clicking will decrease / increase the radio volume by 12.5%. The minimum volume is 0%.
Channel Knob
The radio can be turned on (EIN) and off (AUS). Left clicking the knob will increment the current channel presets. Right clicking will decrement the current channel presets. If you turn the radio to on (EIN) the last selected channel preset is displayed in the LCD.
The SEM 52 SL has 12 + 1 (Channel H) programmable channel presets. Channel H is volatile and the programmed frequency will be lost if you turn off your radio.
If a channel has been active for more than 3 seconds it will become the active one. If you turn your radio to on (EIN) this channel will bee shown in the LCD.
Channel P is used for programming the radio.
LCD Display Screen
The LCD display shows the current frequency if you have a channel preset selected. If the radio is turned to on (EIN) the current preset number is shown. If you have channel H selected and the channel is not programmed noFr (no Frequency) is shown in the display.
In-Depth Operation
Programming
The SEM 52 SL can be programmed by turning the channel preset knob to P.
Upon selecting channel P, the to be programmed channel can be selected by turning the volume knob one step to the right to increase the preset number or one step to the left to decrease it. The channel preset will increment / decrement automatically.
If your desired Channel is flashing in the display, press the PTT button once to enter the frequency. The MHz digits will start to flash. You can increase / decrease the MHz by turning the volume knob one step to the left or right. The MHz will change in 1 MHz steps. If you have reached your desired MHz press the PTT button once. The KHz will start to flash. You can now select the desired KHz accordingly. The KHz are set in 25 KHz steps. If you are finished press the PTT button once to save and exit the programming mode for the selected channel.
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_SEM52SL
Can be added using the following methods.
To a unit’s inventory:
- unit addItem{:target=“_blank”} “ACRE_SEM52SL”;
- unit addItemToVest{:target=“_blank”} “ACRE_SEM52SL”;
- unit addItemToUniform{:target=“_blank”} “ACRE_SEM52SL”;
- unit addItemToBackpack{:target=“_blank”} “ACRE_SEM52SL”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_SEM52SL”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_SEM52SL”,1];
Further Reading / External Links
- Greenradio.de{:target=“_blank”}
- Youtube Instructional Video{:target=“_blank”} (German)
- German Army manual: TDv 5820/357-13 - Funkgerätesatz VHF (tragbar) SEM 52-SL
SEM 70
The SEM 70 (Sender/Empfänger, mobil SEM 70) is a manpack radio for military purposes in the German Army. It was issued in 1984. As a modern radio it can transmit voice and data. The frequency band is from 30 to 79,975 MHz. The channel spacing is 25 KHz by default. It features a manual channel (Handwahl (HW)) and an automatic channel (Automatische Kanalwahl (AKW)) mode.
Technical Data
- Frequency band: 30,000 to 79,975 MHz
- Channel spacing: 25 KHz (default) or 50 kHz
- Channel presets: Manual channel and up to 10 memory slots for automatic channel selection
- Operating mode: Simplex or Semiduplex
- Operating voltage: 16.8 V
- Transmitting capacity: 4 W or 0.4 W
- Antenna: 0,4 m or 1,03 m
Primer On Automatic Channel Mode (AKW)
While in automatic channel mode, the operator can select from 10 Channels. Each channels combines 16 different frequencies, which can’t be changed by the operator. While no transmission is active, every radio continously scans all 16 frequencies in a loop. If a transmission is initiated, the sending radio randomly selects a frequency on which all receiving radios lock on. In real life this usually takes about 0.7 Seconds, in YARD there is no such delay (may be added at a later point). However, to establish a valid connection between two or more radios, the following parameters must be the same on all involved radios:
- Channel Setup (Channels/Frequencies must be identical for each radio)
- Memory Slot (Channel)
- Network Identifier (Three digit number)
Basic Operation
Interface
Volume Knob
Sets the overall volume of the radio, 6 settings are available.
Power Knob
The radio features two different power settings. On high power setting (GR) the output is 4 Watts and on low power setting (KL) the output is 0.4 Watts. If the knob is set to off (AUS), the radio can’t transmit or receive anything.
Mode Selector Knob
Currently the SEM 70 in YARD features both manual channel (HW) and automatic channel (AKW) mode. All other settings will be ignored at the moment.
Frequency Knobs
In manual channel mode, the frequency can be set to a fixed value. This is equivalent to other radios single channel mode. The MHz can be set with the knob on the left side of the display and the kHz with the knob on the right side.
Memory Slot Knob
In automatic channel mode, there are 10 channels available to be used.
Network Knobs
In automatic channel mode, the network number must be identical on every radio in order to establish a connection.
Display Knob
To show the current frequency (manual channel mode) or channel setting (automatic channel mode), the display knob can be depressed.
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_SEM70
Can be added using the following methods.
To a unit’s inventory:
- unit addItem{:target=“_blank”} “ACRE_SEM70”;
- unit addItemToVest{:target=“_blank”} “ACRE_SEM70”;
- unit addItemToUniform{:target=“_blank”} “ACRE_SEM70”;
- unit addItemToBackpack{:target=“_blank”} “ACRE_SEM70”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_SEM70”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_SEM70”,1];
Further Reading / External Links
- Greenradio.de{:target=“_blank”}
- Youtube Instructional Video{:target=“_blank”} (German)
- German Army manual: TDv 5820-135-12 - Funkanlagen A/VHF Funkgerät SEM 70
BF-888S
The BF-888S is a low cost portable UHF radio with range of up to 5km in ideal conditions. It has 16 programmable channel presets.
Operation
Interface
The BF-888S interface is extremely simple, consisting of only two dials.
Volume Dial
The right-hand dial sets the radio volume.
Channel Dial
The left-hand dial sets the radio channel, from 1 to 16 as programmed.
Mission Editor Reference
Adding radio to unit/object cargo inventory space
Class name: ACRE_BF888S
Can be added using the following methods.
To a unit’s inventory:
- unit addItem{:target=“_blank”} “ACRE_BF888S”;
- unit addItemToVest{:target=“_blank”} “ACRE_BF888S”;
- unit addItemToUniform{:target=“_blank”} “ACRE_BF888S”;
- unit addItemToBackpack{:target=“_blank”} “ACRE_BF888S”;
To an object’s cargo inventory:
- object addItemCargo{:target=“_blank”} [“ACRE_BF888S”,1];
- object addItemCargoGlobal{:target=“_blank”} [“ACRE_BF888S”,1];
Channel Preset Data Fields
| Field name | Description | | –––– | –––– | –––– | | frequencyTX | Transmit Frequency | | frequencyRX | Receive Frequency | | CTCSSTx | CTCSS Transmit Code | | CTCSSRx | CTCSS Receive Code | | Modulation | Modulation (AM / FM) |
API and Frameworks
For mission makers and modders. YARD keeps ACRE2’s API: functions are acre_api_fnc_*, classnames ACRE_*, and configs CfgAcreComponents, so existing ACRE2 missions and addons work unchanged.
- Missions: Mission Making Intro, Mission Making Guide, Functions List, Events List, Babel, God Mode, Spectator Displays
- Vehicles: Vehicle Intercom, Vehicle Racks, Vehicle Attenuation
- Radios and signal: Component System, Creating a New Radio, Adding a New Antenna, Custom Signal Processing, Radio Signal Debugging, Terrain Files
Mission Making Intro
Introduction
When making missions with YARD there are a few things you should be aware of to prevent problems with your missions. For this page we will also assume that you are loosely familiar with the basic features of YARD, notably babel. If you aren’t familiar with the basic features of YARD please read this first. We have split this page up into several parts starting with the basics and simple cases and slowly progressing into more detail, at the end we’ll give some full examples.
The default behaviour of YARD is to replace any vanilla radio items (classname: "ItemRadio") (which all the vanilla Arma 3 military units have) with AN/PRC 343 radios. If you want players to have custom radios you must add them yourself. All radios by default are set to the same settings and this allow players on other teams to hear each other on the radios. All players will also start out speaking the same babel language.
Several modules are provided by YARD to cater for typical simple setups. If you would rather avoid using the API I’d recommend checking them out first.
For simple mission setups where you just wish to quickly ensure that different teams speak different languages and/or use different radio frequencies so that they can’t hear either other on the same channel numbers; we created a simple function you can call.
[true, true] call acre_api_fnc_setupMission;
The first option is used to indicate if each side should have their own unique language The second is is used to indicate if the radio channels for each team should be on different frequencies. So that players on other teams can not hear your communications.
Most API calls in YARD only support being called on the client to which they are local. So it is advised to run all YARD for setting up radios and languages in init.sqf so that they are run on all clients.
List of things you can do with the YARD mission API (but not limited to):
- Give units different radios
- Change the settings of the radio before the unit gets it (Channel names/frequencies/transmission power)
- Change the radio channel to a particular channel (useful for channel allocation scripts)
- Assign players to speak different languages
- Enable spectator mode (Spectators have their own chat but they can also hear players speaking near their camera position)
Radio Settings
How to properly add radios to units
All radios in YARD are items and must be added via the ‘addItem’ command e.g.
player addItem "ACRE_PRC343";
Note: The ‘linkItem’ command is not supported in YARD as the linked radio slot has been removed by YARD. Here is a list the YARD Base radio class-names:
ACRE_PRC343
ACRE_PRC148
ACRE_PRC152
ACRE_PRC77
ACRE_PRC117F
NOTE: YARD provides every radio that is in use by a player with a unique ID. YARD will automatically replace the base radios with versions that have these IDs. You will most likely break YARD if you attempt to give any unit a radio with an ID, instead only use the base classes listed above. e.g. “ACRE_PRC343” to “ACRE_PRC343_ID_1”
How to setup different radio settings
Every radio that a player uses in YARD has its own settings. Every channel on a radio can have different frequencies to that of another radio of the same base type. YARD allows you set the default settings on a radio by creating radio setting ‘presets’. YARD by default has 4 presets for every radio with all the frequencies being offset for each preset, so that you can use different presets for different teams without having the teams hearing each other on the same channel numbers. To ensure that a player gets a radio with a specific preset change the default preset before giving the radio e.g.
["ACRE_PRC152", "default2"] call acre_api_fnc_setPreset;
player addItem "ACRE_PRC152";
List of default preset names (note presets are unique to a base class radio).
default
default2
default3
default4
default2/default3/default4 should be used if you want to have frequencies that are independent of other presets , typically in the case for pvp missions.
You can also create and modify your own presets by copying the default presets. Here we create a new preset ‘my_new_preset’ from the ‘default’ preset.
["ACRE_PRC152", "default", "my_new_preset"] call acre_api_fnc_copyPreset;
You can then edit that preset’s channel settings (For a full list of available channel settings see the wiki-page for the radio you are interested in). This example will set the display name of channel 1 on the 152 radio to “PLTNET 1” for the preset ‘my_new_preset’.
["ACRE_PRC152", "my_new_preset", 1, "label", "PLTNET 1"] call
acre_api_fnc_setPresetChannelField;
The three common channel settings are:
label - The channel name typically unused for on radios without screens.
frequencyTX - Frequency (MHz) the channel broadcasts on.
frequencyRX - Frequency (MHz) the channel listens to.
Putting this all together, we can give the player a 152 radio that uses frequencies from the default2 preset and changes the display name of channel 1 to ‘PLTNET 1’:
["ACRE_PRC152", "default2", "my_new_preset"] call acre_api_fnc_copyPreset;
["ACRE_PRC152", "my_new_preset", 1, "label", "PLTNET 1"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "my_new_preset", 1, "frequencyRX", 60.1] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "my_new_preset", 1, "frequencyTX", 60.1] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "my_new_preset"] call acre_api_fnc_setPreset;
player addItem "ACRE_PRC152";
Changing the current radio channel on mission start
Another common task is having the radios set to the correct channels at mission start. The YARD API provides a function just for this purpose ‘acre_api_fnc_setRadioChannel’. It requires the ID of a specific radio to carry out its task, for example the following would set that specific radio to channel 5.
["ACRE_PRC152_ID_123", 5] call acre_api_fnc_setRadioChannel;
The challenge here is that the IDs are provided by the server and will be unknown to the mission maker and could be different for different playthroughs of the same mission. The radio IDs are also not provided immediately, so we must wait until the radios are setup. The following code snippet addresses all these problems.
waitUntil { ([] call acre_api_fnc_isInitialized) };
[(["ACRE_PRC343"] call acre_api_fnc_getRadioByType), 2] call acre_api_fnc_setRadioChannel;
‘acre_api_fnc_isInitialized’ will return true once all the radios have been converted to versions with unique IDs. The ‘acre_api_fnc_getRadioByType’ function will take a a radio base class and return the first IDed radio that the local player has matching the radio type.
Babel
Simple setup
For setups where you would like to just set the same languages spoken by the entire team you can use the ‘acre_api_fnc_babelSetupMission’ function.
Example: This function creates the languages and will check the local unit and setup their languages automatically to match the settings.
[ [west, "English", "French"], [east, "Russian"], [civilian, "French"] ] call acre_api_fnc_babelSetupMission;
Defining the languages
Babel is straightforward to setup, first you must define the languages available. Here we create three languages to be used, we provide a name to reference with them in code and their display name. Note: You must define all the languages you use for every client.
["en","English"] call acre_api_fnc_babelAddLanguageType;
["fa","Farsi"] call acre_api_fnc_babelAddLanguageType;
["gr","Greek"] call acre_api_fnc_babelAddLanguageType;
Setting the speaking languages of a unit
There are two main commands API commands for setting the languages of a unit. Firstly ‘acre_api_fnc_babelSetSpokenLanguages’ is used to specify what languages a unit can understand, and then ‘acre_api_fnc_babelSetSpeakingLanguage’ should be used to set the language the unit speaks at mission start.
For a unit we wish to speak ‘English’ we would call the following of code.
["en"] call acre_api_fnc_babelSetSpokenLanguages;
["en"] call acre_api_fnc_babelSetSpeakingLanguage;
If we want a unit to speak multiple languages we can easily add more in:
["en", "fa", "gr"] call acre_api_fnc_babelSetSpokenLanguages;
["en"] call acre_api_fnc_babelSetSpeakingLanguage;
Examples
- Included in the
@ACRE2/extras/examples/folder you should find some sample scripts. - YARD API Functions List
Mission Making Guide
Overview
In an attempt to help provide more documentation and information on the availability of the vast configurability of YARD, below are sets of examples for different common scenarios YARD utilizes. Because we are utilized by many communities, ranging from persistent worlds to die-hard military simulation communities and everything in between, we’ve found a common set of examples which can help anyone integrate YARD fairly quickly.
In general, we’ve found that the majority of communities wish for examples and assistance in setting up their missions in such a way as to streamline the user process; this can include pre-programming radios, assigning channel names, deploying radios given the Arma 3 unit type, and modifying the YARD core settings such as signal loss for their play style. All of this is possible, and we’ve tried to provide the best possible summaries and examples below.
For Milsim Communities
YARD is heavily used within Military Simulation communities for gameplay purposes given that we provide a drastically higher fidelity of realistic communications. We understand that many communities operate the same way, and are generally looking for assistance in providing seamless experiences to their player base for operations. Chief among these needs is usually setting up consistent signals orders for their RTOs, commanders and units to follow. YARD provides functionality that a community can include either in their operational missions or in their modpack directly to provide setting up these parameters.
Such things that we have found milsim communities most commonly use are:
- Presetting channel names for given nets
- Switching players to their appropriate channels automatically
- Setting up their signals cards and channel setups
We’ve provided an example which is heavily documented to provide the information for a milsim community to set up a company-level signals order. This first example is strictly for signals, and does not include unit-level 343 setup. The second example provides a single squads 343 setup.
Mission Maker Scripts
Functions List
The public API: acre_api_fnc_*. YARD keeps ACRE2’s API, so these are the same functions ACRE2 missions and mods use.
This page is generated from the function headers in addons/api (docs/tools/document_functions.py).
acre_api_fnc_addDisplayPassthroughKeys
Description
Adds key handling compatibility to a custom display, which otherwise does not pass through CBA keybinds. Must be called after display has been loaded.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Display | DISPLAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Successfully added passthrough key handling | BOOL |
Example
[display] call acre_api_fnc_addDisplayPassthroughKeys
acre_api_fnc_addNotificationDisplay
Description
Adds notification system support to given display ID (IDD).
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Display ID | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Display priority index | NUMBER |
Example
[3333] call acre_api_fnc_addNotificationDisplay
acre_api_fnc_addRackToVehicle
Description
Initialises all racks in the vehicle. Must be executed in the server. If no condition is specified, the radio will be configured to match the vehicle preset defined using acre_api_fnc_setVehicleRacksPreset or the preset of the first player that matches the given condition if the vehicle preset is not defined.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | objNull |
| 1 | Rack configuration | ARRAY | |
| 0 | Base classname of the rack (Without ID) | STRING | “” |
| 1 | Rackname - this is diplayed to the user. Ideally short | STRING | “” |
| 2 | Rack short name - displayed in GUI information. Max 4 characters | STRING | “” |
| 3 | Is mounted radio removable | BOOLEAN | false |
| 4 | Access - Determines who can use the rack | ARRAY | [“inside”] |
| 5 | Disabled positions - Blacklist rack use positions | ARRAY | [] |
| 6 | Base classname of the mounted radio (Without ID). Empty string for no radio | STRING | “” |
| 7 | Components | ARRAY | [] |
| 8 | Connected intercoms | ARRAY | [] |
| 2 | Force initialisation | BOOL | false |
| 3 | Condition called with argument “_unit”. If a longer function is given, it should be precompiled. | CODE | {} |
Return Value
| Description | Datatype(s) |
|---|---|
| Rack added successfully | BOOL |
Example
[cursorTarget, ["ACRE_VRC103", "Upper Dash", "Dash", false, ["external"], [], "ACRE_PRC117F", [], ["intercom_1"]], false] call acre_api_fnc_addRackToVehicle
acre_api_fnc_addSpectatorRadio
Description
Adds a radio to the unit’s spectator radio list. Unit must be local.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Player unit | OBJECT | objNull |
| 1 | Unique Radio or Rack ID | STRING | “” |
Return Value
| Description | Datatype(s) |
|---|---|
| Radio successfully added | BOOL |
Example
[player, "acre_prc343_id_1"] call acre_api_fnc_addSpectatorRadio
acre_api_fnc_areVehicleRacksInitialized
Description
Checks whether the vehicle racks have been initialized for the given vehicle.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Vehicle racks initialized | BOOL |
Example
[cursorTarget] call acre_api_fnc_areVehicleRacksInitialized
acre_api_fnc_babelAddLanguageType
Description
Creates a new language to be used by the babel system.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Language ID (used internally for identifying the language or specifying languages via other API methods) | STRING | |
| 1 | Language display name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
["en", "English"] call acre_api_fnc_babelAddLanguageType;
acre_api_fnc_babelGetLanguageId
Description
Gets the babel language key from the display name.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Language display name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Language ID | STRING |
Example
["English"] call acre_api_fnc_babelGetLanguageId;
acre_api_fnc_babelGetLanguageName
Description
Gets the babel language display name from the language ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Language ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Language display name | STRING |
Example
["en"] call acre_api_fnc_babelGetLanguageName;
acre_api_fnc_babelGetSpeakingLanguageId
Description
Gets the ID of the language which is actively being spoken (set with babelSetSpeakingLanguage).
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Language ID | STRING |
Example
[] call acre_api_fnc_babelGetSpeakingLanguageId;
acre_api_fnc_babelSetSpeakingLanguage
Description
Sets the language the player will speak in.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Language ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
["en"] call acre_api_fnc_babelSetSpeakingLanguage;
acre_api_fnc_babelSetSpokenLanguages
Description
Sets the languages that the local player can speak.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| None | Language IDs | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
["en"] call acre_api_fnc_babelSetSpokenLanguages;
acre_api_fnc_babelSetupMission
Description
Provides functionality to allow for easy setup of side-specific languages. An array is provided for each configurable side which specifies the languages that side can speak.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| None | Array of sides and languages | ARRAY | |
| 0 | Side | SIDE | |
| 1 | Language display name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
[ [west, "English", "French"], [east, "Russian"], [civilian, "French"] ] call acre_api_fnc_babelSetupMission;
[ [west, "English", "French"], [east, "Russian", "French" ] ] call acre_api_fnc_babelSetupMission;
acre_api_fnc_copyPreset
Description
Copies all parameters of the source preset to a new destination preset name.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base type | STRING | |
| 1 | Preset name to copy | STRING | |
| 2 | Destination preset name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Copy preset successful | BOOLEAN |
Example
["ACRE_PRC152", "default2", "balls"] call acre_api_fnc_copyPreset
acre_api_fnc_filterUnitLoadout
Description
Filters unitLoadout for ACRE ID classes and replacing them for base classes.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Loadout | ARRAY or OBJECT or STRING or CONFIG | getUnitLoadout acre_player |
Return Value
| Description | Datatype(s) |
|---|---|
| Loadout | ARRAY |
Example
_loadout = [_loadout] call acre_api_fnc_filterUnitLoadout;
_loadout = [getUnitLoadout _unit] call acre_api_fnc_filterUnitLoadout;
_loadout = [player] call acre_api_fnc_filterUnitLoadout;
acre_api_fnc_getAllRadios
Description
Returns all radios defined in CfgAcreRadios. Caches result for future calls.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| 1: Radio Class Names | ARRAY |
Example
[] call acre_api_fnc_getAllRadios;
acre_api_fnc_getAllRadiosByType
Description
Returns a list of unique radio IDs of local player or unit possesses of a given type. In the case of a unit for the second parameter it will find the radio IDs for that unit instead of the local player.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio type | STRING | |
| 1 | Optional unit or List of String | ARRAY, OBJECT | [] |
Return Value
| Description | Datatype(s) |
|---|---|
| Array of Radio IDs | ARRAY |
Example
_radioIds = ["ACRE_PRC152"] call acre_api_fnc_getAllRadiosByType
_radioIds = ["ACRE_PRC152", _unit] call acre_api_fnc_getAllRadiosByType
acre_api_fnc_getAudioDevices
Description
Lists the audio devices ACRE can use. The ids go into the Microphone and Speakers / headphones addon options.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| [inputs, outputs], each an array of [id, name] | ARRAY |
Example
[] call acre_api_fnc_getAudioDevices
acre_api_fnc_getBaseRadio
Description
Takes an actual unique radio ID, and returns its actual base radio type
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio item name with ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| The base radio class | STRING |
Example
["ACRE_PRC148_ID_15"] call acre_api_fnc_getBaseRadio;
acre_api_fnc_getCurrentRadio
Description
Returns the unique radio ID of the currently active radio for the local player object.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Radio ID | STRING |
Example
[] call acre_api_fnc_getCurrentRadio;
acre_api_fnc_getCurrentRadioChannelNumber
Description
Returns the channel number that the currently active radio is on.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Channel number. Returns -1 if no active radio or the channel can’t be found. | NUMBER |
Example
[] call acre_api_fnc_getCurrentRadioChannelNumber;
acre_api_fnc_getCurrentRadioList
Description
Retrieves the array of current unique radio IDs that are on the local player.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Array of radio IDs which are strings | ARRAY |
Example
[] call acre_api_fnc_getCurrentRadioList;
acre_api_fnc_getDisplayName
Description
Gets the display name for a radio ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Radio display name | STRING |
Example
["ACRE_PRC343_ID_1"] call acre_api_fnc_getDisplayName
acre_api_fnc_getGlobalVolume
Description
Gets the current global output volume for all ACRE voices and radios.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| The current ACRE global volume (between 0 and 1) | NUMBER |
Example
[] call acre_api_fnc_getGlobalVolume;
acre_api_fnc_getMicrophoneLevel
Description
Current microphone level, for setting the voice activation sensitivity. -100 when silent or not connected.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Level in dB | NUMBER |
Example
[] call acre_api_fnc_getMicrophoneLevel
acre_api_fnc_getMountedRackRadio
Description
Gets the mounted rack radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Rack unique ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Mounted radio unique ID, “” if no radio is mounted | STRING |
Example
["ACRE_VRC103_ID_1"] call acre_api_fnc_getMountedRackRadio
acre_api_fnc_getMultiPushToTalkAssignment
Description
Returns the current radios assigned to Multiple Push-to-Talk keys, or Alternate PTT keys.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| The array of radio ID’s which are assigned to each PTT talk key. These are returned in order, from key 1-3 | ARRAY |
Example
_mpttRadioList = [] call acre_api_fnc_getMultiPushToTalkAssignment;
acre_api_fnc_getPTTDelay
Description
Gets the current delay value for releasing radio PTT events. The default value for this is 200ms, or 0.2
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| The delay time in seconds to release PTT radio events. | NUMBER |
Example
_delay = [] call acre_api_fnc_getPTTDelay
acre_api_fnc_getPreset
Description
Gets the preset name to utilize on the provided radio class during initialization.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| The string name of the current preset | STRING |
Example
_currentPreset = ["ACRE_PRC152"] call acre_api_fnc_getPreset;
acre_api_fnc_getPresetChannelData
Description
Returns the full ACRE2 channel Hash data of the specified preset name for the specified radio. The channel number must be a valid channel for that type of radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Base radio class | STRING | |
| 1 | Preset name | STRING | |
| 2 | Channel number | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Hash containing all the channel preset information | HASH |
Example
_presetData = ["ACRE_PRC152", "default", 4] call acre_api_fnc_getPresetChannelData;
acre_api_fnc_getPresetChannelField
Description
Returns the value of the channel field for the given radio preset.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio Base class | STRING | |
| 1 | Preset name | STRING | |
| 2 | Channel number | NUMBER | |
| 3 | Field name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Value of the given field | ANY |
Example
["ACRE_PRC148", "default", 2, "label"] call acre_api_fnc_getPresetChannelField;
acre_api_fnc_getPresetData
Description
Returns the full preset data of the specified preset name for the specified radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base class | STRING | |
| 1 | Preset Name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Preset data | HASH |
Example
_presetData = ["ACRE_PRC152", "default"] call acre_api_fnc_getPresetData;
acre_api_fnc_getRadioAudioSource
Description
Gets the audio source currently selected on the provided radio ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Audio Source | STRING |
Example
_audioSource = ["ACRE_PRC148_ID_123"] call acre_api_fnc_getRadioAudioSource
acre_api_fnc_getRadioByType
Description
Returns the unique radio ID of the first radio the local player or unit possesses of a given type. This function does not compensate for units with multiple radios of the same type. There is no guarantee of which radio it will return. In the case of a unit for the second parameter it will find the radio ID for that unit instead of the local player.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio type | STRING | |
| 1 | Optional unit or List of String | ARRAY, OBJECT | [] |
Return Value
| Description | Datatype(s) |
|---|---|
| Radio ID | STRING |
Example
_radioId = ["ACRE_PRC152"] call acre_api_fnc_getRadioByType
_radioId = ["ACRE_PRC152", _unit] call acre_api_fnc_getRadioByType
acre_api_fnc_getRadioChannel
Description
Returns the channel number of the currently active channel on the provided radio ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Channel number, 1-N depending on the radio | NUMBER |
Example
_currentChannel = ["ACRE_PRC152_ID_123"] call acre_api_fnc_getRadioChannel;
acre_api_fnc_getRadioOnOffState
Description
Gets the status (ON/OFF) for the given radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| TRUE if radio is ON, False if the radio is OFF | BOOLEAN |
Example
["ACRE_PR77_ID_1"] call acre_api_fnc_getRadioOnOffState
acre_api_fnc_getRadioSpatial
Description
Gets what spatialization zone the specified radio ID is currently in. “LEFT”, “RIGHT” or “CENTER”
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| “LEFT”, “RIGHT” or “CENTER” | STRING |
Example
["ACRE_PRC148_ID_1"] call acre_api_fnc_getRadioSpatial;
acre_api_fnc_getRadioVolume
Description
Gets the volume for the given radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Volume value between 0 and 1, -1 if error | NUMBER |
Example
["ACRE_PRC148_ID_1"] call acre_api_fnc_getRadioVolume
acre_api_fnc_getRevealToAI
Description
Returns whether the player reveal to AI direct speech system is enabled. Return value is only valid on a player client.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| AI enabled | NUMBER |
Example
[] call acre_api_fnc_getRevealToAI;
acre_api_fnc_getSelectableVoiceCurve
Description
Retrieves the scale of how far the local player’s voice will be heard from.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Voice curve scale | NUMBER |
Example
_ret = [] call acre_api_fnc_getSelectableVoiceCurve;
acre_api_fnc_getVOIPChannelName
Description
Get the VOIP channel name.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| VOIP Channel Name | STRING |
Example
[] call acre_api_fnc_getVOIPChannelName
acre_api_fnc_getVOIPChannelUID
Description
Get the VOIP channel UID.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| VOIP Channel UID | STRING |
Example
[] call acre_api_fnc_getVOIPChannelUID
acre_api_fnc_getVOIPServerName
Description
Get the VOIP server name.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| VOIP Server Name | STRING |
Example
[] call acre_api_fnc_getVOIPServerName
acre_api_fnc_getVOIPServerUID
Description
Get the VOIP server UID.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| VOIP Server UID | STRING |
Example
[] call acre_api_fnc_getVOIPServerUID
acre_api_fnc_getVehicleRacks
Description
Gets all racks in a vehicle.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| List of vehicle racks | ARRAY |
Example
[cursorTarget] call acre_api_fnc_getVehicleRacks
acre_api_fnc_getVehicleRacksPreset
Description
Gets the preset name used for initialising the vehicle racks.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | objNull |
Return Value
| Description | Datatype(s) |
|---|---|
| Preset name (“” if undefined) | STRING |
Example
[cursorTarget] call acre_api_fnc_getVehicleRacksPreset
acre_api_fnc_godModeConfigureAccess
Description
Configures the access to God Mode.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Access to the BI Chat Channel functionality | BOOL | false |
| 1 | Access to Group presets functionality | BOOL | false |
Return Value
| Description | Datatype(s) |
|---|---|
| Handled | BOOL |
Example
[true, false] call acre_api_fnc_godModeConfigureAccess
acre_api_fnc_godModeGetGroupTargets
Description
Returns given group’s current targets.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Group (0-based index or -1 for current channel) | NUMBER | 0 |
Return Value
| Description | Datatype(s) |
|---|---|
| Group targets | ARRAY |
Example
[0] call acre_api_fnc_godModeGetGroupTargets
acre_api_fnc_godModeModifyGroup
Description
Modifies who can hear a message from God Mode.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit or UID or array of either or code returning array of units | OBJECT, STRING, ARRAY, CODE | [] |
| 1 | Group to effect (0-based index) | NUMBER | 0 |
| 2 | Action. 0 for set, 1 for add and 2 for subtract | NUMBER | 0 |
Return Value
| Description | Datatype(s) |
|---|---|
| Group modified successfully | BOOL |
Example
[[unit1, unit2], 0, 1] call acre_api_fnc_godModeModifyGroup
[["76561198040512062", "76561198046921073"], 0, 1] call acre_api_fnc_godModeModifyGroup
[{allUnits select {alive _x}}, 0, 1] call acre_api_fnc_godModeModifyGroup
acre_api_fnc_godModeNameGroup
Description
Sets a visible name for the given God Mode group.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Name | STRING | |
| 1 | Group to effect (0-based index) | NUMBER | 0 |
Return Value
| Description | Datatype(s) |
|---|---|
| Group name set successfully | BOOL |
Example
["Admin", 0] call acre_api_fnc_godModeNameGroup
acre_api_fnc_godModeSendText
Description
Sends a text message to the specified God Mode group.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Text | STRING | “” |
| 1 | Group ID (0-based index) | NUMBER | 0 |
Return Value
| Description | Datatype(s) |
|---|---|
| Text message sent successfully | BOOL |
Example
["sample text", 2] call acre_api_fnc_godModeSendText
acre_api_fnc_hasBaseRadio
Description
Checks whether the given unit has a base radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Has base radio | BOOLEAN |
Example
_result = [player] call acre_api_fnc_hasBaseRadio;
acre_api_fnc_hasKindOfRadio
Description
Checks whether the provided unit has a radio of the specified radio type in their inventory.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit or array of item classnames | OBJECT, ARRAY | |
| 1 | Radio base type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Has kind of radio | BOOLEAN |
Example
_hasRadio = [player, "ACRE_PRC148"] call acre_api_fnc_hasKindOfRadio
acre_api_fnc_hasRadio
Description
Checks whether the provided unit has an ACRE radio in their inventory.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Whether the unit or player has a radio | BOOLEAN |
Example
_hasRadio = [player] call acre_api_fnc_hasRadio;
acre_api_fnc_initVehicleRacks
Description
Initialises all racks in the vehicle. Must be executed in the server. If no condition is specified, the radio will be configured to match the vehicle preset defined using acre_api_fnc_setVehicleRacksPreset or the preset of the first player that matches the given condition if the vehicle preset is not defined.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | |
| 1 | Condition called with argument “_unit”. If a longer function is given, it should be precompiled. | CODE | {} |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
[cursorTarget, {}] call acre_api_fnc_initVehicleRacks
acre_api_fnc_isBaseRadio
Description
Checks if a class name is a base radio or not. Base radios are ACRE radios without IDs. e.g. “ACRE_PRC148” would return true, “ACRE_PRC148_ID_1” would return false
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Item name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Is base radio | BOOLEAN |
Example
_result = ["ACRE_PRC343"] call acre_api_fnc_isBaseRadio;
acre_api_fnc_isBroadcasting
Description
Checks whether the provided unit is currently broadcasting on a radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Broadcasting | BOOLEAN |
Example
_isBroadcasting = [player] call acre_api_fnc_isBroadcasting;
acre_api_fnc_isInitialized
Description
Checks whether the ACRE radios have initialized. This means that they have been replaced with ID specified radios.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| All radios on unit are initialized | BOOLEAN |
Example
_status = [] call acre_api_fnc_isInitialized;
acre_api_fnc_isKindOf
Description
Checks whether the provided weapon/item is the specified ACRE radio type.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID/Item classname | STRING | |
| 1 | Radio base type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Whether the provided item is of the radio base type | BOOLEAN |
Example
_ret = ["ACRE_PRC117F_ID_123", "ACRE_PRC117F"] call acre_api_fnc_isKindOf;
acre_api_fnc_isRackRadioRemovable
Description
Checks wether a rack can have its radios unmounted.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unique rack ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Racked radio can be unmounted | BOOL |
Example
["ACRE_VRC103_ID_1"] call acre_api_fnc_isRackRadioRemovable
acre_api_fnc_isRadio
Description
Returns true or false whether the provided classname is a ACRE radio or not. This function returns false on Radio Base Classes.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Classname | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Whether the provided object class name is a radio or not | BOOLEAN |
Example
_isRadio = ["NVGoggles"] call acre_api_fnc_isRadio;
acre_api_fnc_isRadioSpeaker
Description
Returns true or false whether the provided radio ID has audio source set to speaker or not.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Is Audio Source Speaker | BOOL |
Example
_isSpeaker = ["ACRE_PRC148_ID_123"] call acre_api_fnc_isRadioSpeaker
acre_api_fnc_isSpeaking
Description
Checks whether the provided unit is currently speaking, either on radio or direct.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT |
Return Value
| Description | Datatype(s) |
|---|---|
| Is unit speaking | BOOLEAN |
Example
_isSpeaking = [player] call acre_api_fnc_isSpeaking;
acre_api_fnc_isSpectator
Description
Checks whether the provided unit (or by default local player) is spectating.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Unit | OBJECT | acre_player |
Return Value
| Description | Datatype(s) |
|---|---|
| Spectating | BOOL |
Example
_isSpectator = [] call acre_api_fnc_isSpectator;
_isSpectator = [player] call acre_api_fnc_isSpectator;
acre_api_fnc_isVOIPConnected
Description
Check if ACRE is connected to the voice server.
Parameters
None
Return Value
| Description | Datatype(s) |
|---|---|
| Is connected to the voice server | BOOL |
Example
[] call acre_api_fnc_isVOIPConnected
acre_api_fnc_mountRackRadio
Description
Sets the given radio as mounted. Must be executed on the server.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Rack ID | STRING | “” |
| 1 | Base radio to mount | STRING | “” |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
["ACRE_VRC103_ID_1", "ACRE_PRC117F"] call acre_api_fnc_mountRackRadio
acre_api_fnc_openMicrophoneTest
Description
Opens the ACRE microphone test, which measures silence, typing and speech and suggests voice activation levels. Also available from Escape → Options and the ACRE Voice map page.
Parameters
None
Return Value
None
Example
[] call acre_api_fnc_openMicrophoneTest
acre_api_fnc_removeAllRacksFromVehicle
Description
Removes all Racks from a vehicle. Must be executed on the server.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | objNull |
Return Value
| Description | Datatype(s) |
|---|---|
| Racks removed successfully | BOOL |
Example
[cursorTarget] call acre_api_fnc_removeAllRacksFromVehicle
acre_api_fnc_removeAllSpectatorRadios
Description
Removes all spectator radios. Unit must be local.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Player unit | OBJECT | objNull |
Return Value
| Description | Datatype(s) |
|---|---|
| Radios successfully removed | BOOL |
Example
[player] call acre_api_fnc_removeAllSpectatorRadios
acre_api_fnc_removeRackFromVehicle
Description
Removes a specific Rack from a vehicle. Must be executed on the server.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | objNull |
| 1 | Unique rack ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Rack removed successfully | BOOL |
Example
[cursorTarget, "ACRE_VRC103_ID_1"] call acre_api_fnc_removeRackFromVehicle
acre_api_fnc_removeSpectatorRadio
Description
Removes a radio from the unit’s spectator radio list. Unit must be local.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Player unit | OBJECT | objNull |
| 1 | Unique Radio or Rack ID | STRING | “” |
Return Value
| Description | Datatype(s) |
|---|---|
| Radio successfully removed | BOOL |
Example
[player, "acre_prc343_id_1"] call acre_api_fnc_removeSpectatorRadio
acre_api_fnc_replaceRacksOnVehicle
Description
Replaces all config-defined Racks on a vehicle with a different class of Rack, while keeping the same name, allowedPositions, etc. Must be executed on the server.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | objNull |
| 1 | Rack classname to remove | STRING | “” |
| 2 | Rack classname to add | STRING | “” |
| 3 | Condition called with argument “_unit” for rack init. If a longer function is given, it should be precompiled. | CODE | {} |
Return Value
| Description | Datatype(s) |
|---|---|
| Racks replaced successfully | BOOL |
Example
[cursorTarget, "ACRE_VRC103", "ACRE_VRC64", {}] call acre_api_fnc_replaceRacksOnVehicle
acre_api_fnc_setCurrentRadio
Description
Sets the currently active radio by radio ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = ["ACRE_PRC148_ID_7"] call acre_api_fnc_setCurrentRadio;
acre_api_fnc_setCurrentRadioChannelNumber
Description
Set the channel number that the currently active radio is on.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Channel number | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = [5] call acre_api_fnc_setCurrentRadioChannelNumber;
acre_api_fnc_setCurveModel
Description
Sets the curve model for all clients. This model affects the dropoff for direct speech. ACRE_CURVE_MODEL_ORIGINAL > The volume range is static and based off a custom curve. ACRE_CURVE_MODEL_SELECTABLE_A > This method allows you to use the acre_api_fnc_setSelectableVoiceCurve to change how far the voice curve goes. The curve that the it modifies in mode A is the default X3DAudio curve based off the inverse square law. ACRE_CURVE_MODEL_SELECTABLE_B > Same as above but it modifies the distance of the custom curve available when using the ACRE_CURVE_MODEL_ORIGINAL mode.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | “ACRE_CURVE_MODEL_ORIGINAL”, “ACRE_CURVE_MODEL_SELECTABLE_A” or “ACRE_CURVE_MODEL_SELECTABLE_B” | STRING |
Return Value
None
Example
["ACRE_CURVE_MODEL_ORIGINAL"] call acre_api_fnc_setCurveModel;
acre_api_fnc_setCurveModelScale
Description
Sets the curve scale for all clients. This can be used as a modifier for all voice curves.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Curve scale | NUMBER |
Return Value
None
Example
[1.0] call acre_api_fnc_setCurveModelScale;
acre_api_fnc_setCustomSignalFunc
Description
This overrides the signal calculation function in ACRE2 with a defined function. It is recommended to read this documentation page for further details and some examples: https://brettmayson.github.io/yard/frameworks/custom-signal-processing.html The arguments passed to the function are the frequency (MHz), power of transmitter (mA), classname of recieving radio, classname of broadcasting radio. Example - [30, 5000, “ACRE_PRC343_ID_1”, “ACRE_PRC343_ID_2”] The expected return of the function is [_signalStrengthPercent,_signalStrengthDBm] - where signal strength is a value between 0 and 1, and DBm strength of the radiosignal for the receiving radio. Calling the function with an empty code will remove the custom signal function.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Function to use | CODE |
Return Value
None
Example
[mySignalFunc] call acre_api_fnc_setCustomSignalFunc
[{}] call acre_api_fnc_setCustomSignalFunc
acre_api_fnc_setGlobalVolume
Description
Sets the global volume of the output from ACRE. 1 is normal, 0 is silent
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Volume between 0 and 1 | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Volume | NUMBER |
Example
[0.05] call acre_api_fnc_setGlobalVolume;
acre_api_fnc_setItemRadioReplacement
Description
DEPRECATED! Replaced by CBA Setting. Set the radio type to replace “ItemRadio” in unit inventories. By default this is the “ACRE_PRC343”
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base type | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Success | BOOLEAN |
Example
["ACRE_PRC148"] call acre_api_fnc_setItemRadioReplacement;
acre_api_fnc_setMultiPushToTalkAssignment
Description
Sets the assignment order for the Multi-Push-To-Talk keys, also known as Alternate Push-to-Talk keys. These assign the keys 1-3, in order, to the ID’s provided in the array. All radios must be valid assigned ACRE radio id’s and must be present on the local player.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Array of radio IDs | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_personalRadio = [“ACRE_PRC343”] call acre_api_fnc_getRadioByType;
_handheldRadio = [“ACRE_PRC152”] call acre_api_fnc_getRadioByType;
_manpackRadio = [“ACRE_PRC117F”] call acre_api_fnc_getRadioByType;
_success = [ [ _personalRadio, _handheldRadio, _manpackRadio ] ] call acre_api_fnc_setMultiPushToTalkAssignment;
acre_api_fnc_setPTTDelay
Description
The amount of time in seconds to delay releasing the radio PTT key.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Delay in seconds between 0 and 1. | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_delay = [0.2] call acre_api_fnc_setPTTDelay;
acre_api_fnc_setPreset
Description
Sets the preset name to utilize on the provided radio class during initialization.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base type | STRING | |
| 1 | Preset name | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = ["ACRE_PRC152", "default2"] call acre_api_fnc_setPreset;
acre_api_fnc_setPresetChannelData
Description
Sets the full data set to be utilized for the specified preset name. You should use the return value from getPresetChannelData to provide new data to this function. Improper data will most likely break ACRE on all clients. The channel number must be a valid channel for that type of radio. This function must be called on all clients and the server to work properly.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base type | STRING | |
| 1 | Preset name | STRING | |
| 2 | Channel number | NUMBER | |
| 3 | Preset data | HASH |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = ["ACRE_PRC152", "new_preset", 4, _presetData] call acre_api_fnc_setPresetChannelData;
acre_api_fnc_setPresetChannelField
Description
Sets the value of a given channel field for the given radio preset. This function must be called on all clients and the server to work properly.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio Base class | STRING | |
| 1 | Preset name | STRING | |
| 2 | Channel number | NUMBER | |
| 3 | Field name | STRING | |
| 4 | value | ANY |
Return Value
| Description | Datatype(s) |
|---|---|
| Success on setting the channel field data | BOOLEAN |
Example
["ACRE_PRC148", "default", 5, "label", "COY"] call acre_api_fnc_setPresetChannelField;
acre_api_fnc_setPresetData
Description
Sets the full data set to be utilized for the specified preset name. Improper data will most likely break ACRE on all clients. This function must be called on all clients and the server to work properly.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio base type | STRING | |
| 1 | Preset name | STRING | |
| 2 | Preset data | HASH |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = ["ACRE_PRC152", "new_preset", _presetData] call acre_api_fnc_setPresetData;
acre_api_fnc_setRadioAudioSource
Description
Sets the audio source on the provided radio ID. Possible Values for ACRE_PRC148: [“INTAUDIO”, “TOPAUDIO”, “TOPSIDETON”, “SIDEAUDIO”, “SIDESIDETON”] Possible Values for ACRE_PRC152: [“INTAUDIO”, “TOPAUDIO”] Possible Values for ACRE_SEM52SL: [“INTSPEAKER”, “HEADSET”] Possible Values for ACRE_SEM70: [“INTSPEAKER”, “HEADSET”]
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING | |
| 1 | Audio Source | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Success | BOOLEAN |
Example
_success = ["ACRE_PRC148_ID_123", "INTAUDIO"] call acre_api_fnc_setRadioAudioSource
acre_api_fnc_setRadioChannel
Description
Sets the channel number of the currently active channel on the provided radio ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING | |
| 1 | Channel number | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = ["ACRE_PRC152_ID_123", 5] call acre_api_fnc_setRadioChannel;
acre_api_fnc_setRadioSpatial
Description
Sets what spatialization zone the specified radio ID should be in. “LEFT”, “RIGHT” or “CENTER”.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING | |
| 1 | Spatial “LEFT”, “RIGHT” or “CENTER“ | STRING |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = ["ACRE_PRC148_ID_3", "LEFT" ] call acre_api_fnc_setRadioSpatial;
acre_api_fnc_setRadioSpeaker
Description
Sets the audio source to speaker or back to default on the provided radio ID.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING | |
| 1 | Speaker | BOOL |
Return Value
| Description | Datatype(s) |
|---|---|
| Success | BOOLEAN |
Example
_success = ["ACRE_PRC148_ID_123", true] call acre_api_fnc_setRadioSpeaker
_success = ["ACRE_PRC148_ID_123", false] call acre_api_fnc_setRadioSpeaker
acre_api_fnc_setRadioVolume
Description
Set the radio volume for the specified radio.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Radio ID | STRING | |
| 1 | Volume between 0 and 1 | NUMBER |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
["ACRE_PRC343_ID_1",0.5] call acre_api_fnc_setRadioVolume;
acre_api_fnc_setSelectableVoiceCurve
Description
Sets the selectable voice curve scale. This can be used to make the local player’s voice travel further or lesser. Typically 0.1 is used for whispering and 1.3 is used for shouting.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Voice Curve Level | NUMBER |
Return Value
None
Example
[0.7] call acre_api_fnc_setSelectableVoiceCurve
acre_api_fnc_setSpectator
Description
Pass true or false to set the unit as a “spectator” or not. This will override current alive status, and join the player to dead channel regardless.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | true or false on whether the unit should locally be considered a spectator | BOOLEAN |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_ret = [true] call acre_api_fnc_setSpectator;
acre_api_fnc_setVehicleRacksPreset
Description
Sets the preset name used for initialising the vehicle racks.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Vehicle | OBJECT | objNull |
| 1 | Preset name | STRING | “” |
Return Value
| Description | Datatype(s) |
|---|---|
| Successfully set the vehicle preset | BOOL |
Example
[cursorTarget, "default4"] call acre_api_fnc_setVehicleRacksPreset
acre_api_fnc_setupMission
Description
This function generically sets up a mission so that each side will have their own radios as well as speak their own separate languages. Further API calls will be needed to allow them to speak to each other, or configure specific intermingling channels. This function should allow for the most basic and common TVT and gameplay setups; allowing for different radios that do not interfere, as well as different languages. Call this on all clients.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Babel - true to set up a unique babel language for each side. | BOOLEAN | |
| 1 | Radio - true to set up different frequencies for each side by using different presets. | BOOLEAN |
Return Value
None
Example
[true, true] call acre_api_fnc_setupMission;
acre_api_fnc_setupRadios
Description
When run locally, it will set the currently carried radios to the selected channels.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| None | [RadioSetting1, RadioSetting2, …] | ARRAY | |
| 0 | Radio Type (Base Class) | STRING | |
| 1 | Radio Channel or [Channel, Block] or Frequency (MHz or [MHz, KHz]) <INTEGER> or | ARRAY |
Return Value
| Description | Datatype(s) |
|---|---|
| Successful | BOOLEAN |
Example
_success = [ ["ACRE_PRC343", [2,3]], ["ACRE_PRC152", 3], ["ACRE_PRC77", [31,15]] ] call acre_api_fnc_setupRadios;
// Will set PRC343 to Ch2 Blk3, PRC152 to Ch3 and PRC77 to 31.15 MHz
_success = [ ["ACRE_PRC343", 6], ["ACRE_PRC152", 2], ["ACRE_PRC152", 3] ] call acre_api_fnc_setupRadios;
// Will set PRC343 to Ch6 Blk1, the first PRC152 to Ch2 and the second PRC152 to Ch3
_success = [ ["ACRE_SEM52SL", 8], ["ACRE_SEM70", [34,075]] ] call acre_api_fnc_setupRadios;
// Will set SEM52SL to Ch8 and SEM70 to 34.075 MHz
acre_api_fnc_unmountRackRadio
Description
Removes a mounted radio. Must be executed on the server.
Parameters
| Index | Description | Datatype(s) | Default Value |
|---|---|---|---|
| 0 | Rack ID | STRING | “” |
| 1 | Radio to unmount | STRING | “” |
Return Value
| Description | Datatype(s) |
|---|---|
| Setup successful | BOOL |
Example
["ACRE_VRC103_ID_1", "ACRE_PRC117F_ID_1"] call acre_api_fnc_unmountRackRadio
Events List
Important
Following table lists only public API events!
| Name | Arguments | Type | Version |
|---|---|---|---|
acre_startedSpeaking | Unit <OBJECT>, On Radio <BOOL>, Radio ID <NUMBER>, Speaking Type <NUMBER> | Local | 2.7.0 |
acre_stoppedSpeaking | Unit <OBJECT>, On Radio <BOOL> | Local | 2.7.0 |
acre_remoteStartedSpeaking | Unit <OBJECT>, Speaking Type <NUMBER>, Radio ID <STRING> | Local | 2.7.2 |
acre_remoteStoppedSpeaking | Unit <OBJECT> | Local | 2.7.2 |
Babel
The Babel System uses a local API system that must be executed on all clients equally except for where the definition of a individual persons language is concerned, which can differ between clients. Language IDs are sent during the start of speaking events, with non-timely updates applied if a person changes languages in the middle of a conversation. It is imperative that languages be added in the same order on all machines, including JIP, otherwise the numerical values sent during speaking events will not match their literal values on the client. It is best to avoid manipulating the list of languages available after mission init or JIP init.
The following code snippet, will take care of unit side switching. It can be useful for Zeus controlled AI that need to speak a different language than the actual player unit.
["unit", {
params ["_player"];
switch ((getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "side"))) do {
case 1: { ["en"] call acre_api_fnc_babelSetSpokenLanguages; };
case 0: { ["ru"] call acre_api_fnc_babelSetSpokenLanguages; };
case 2: { ["ab"] call acre_api_fnc_babelSetSpokenLanguages; };
default { ["ab","en","ru"] call acre_api_fnc_babelSetSpokenLanguages; };
};
}, true] call CBA_fnc_addPlayerEventHandler;
God Mode
All God Mode configuration only applies to the local machine. This allows great flexibility in configuration and different group presets for each player.
Access
Current Chat Channel and Groups have separate access rights.
// Allow access to Chat Channel but not Group presets
[true, false] call acre_api_fnc_godModeConfigureAccess;
Group Presets
Group presets can be handled in various ways, from direct units, player UIDs, to a more advanced dynamic target selection (provided by caller code).
Groups are handled on the basis of a unit. Because all configuration is local, it is important target units do not change their locality to reach the same physical machine.
Direct
Most simple configuration, very useful for mid-sized missions. Simply put down the target units as wanted.
[[unit1, unit2], 0] call acre_api_fnc_godModeModifyGroup; // Group 1
[[unit3, unit4], 1] call acre_api_fnc_godModeModifyGroup; // Group 2
[allPlayers, 2] call acre_api_fnc_godModeModifyGroup; // Group 3
It is also possible to add or remove units dynamically. This can be used in a custom unit selection dialog for example.
[[unit10, unit11], 0, 1] call acre_api_fnc_godModeModifyGroup; // Add units to Group 1
[[unit5, unit6], 0, 2] call acre_api_fnc_godModeModifyGroup; // Remove units from Group 1
UID
When using systems that switch units or administrators are hard-coded, Steam UID of that player may be used.
[["75692039601236937"], 0] call acre_api_fnc_godModeModifyGroup;
Note: Using getPlayerUID UNIT will not work, as one player may load in before another does. Only editor-placed unit names are supported in this way.
Dynamic
It is also possible to provide target units dynamically, when the player presses his PTT button. This is achieved by passing target parameter as code which returns a list of target units that should receive transmission on that group.
This is an advanced configuration, make sure code is fast, otherwise it can cause delays between pressing the PTT and the beginning of the transmission!
// Transmit to all alive units only
[{
allUnits select {alive _x}
}, 0] call acre_api_fnc_godModeModifyGroup;
Note: Only 0 (set) operation is supported when providing targets dynamically.
Group Names
Groups can be named to give them a different name in Transmit and Receive notifications. Group names are also local, but receiving players will see the group name of the transmitting player. This is because both players might not have the same group presets, but want to see who the message is aimed at.
["Admins", 1] call acre_api_fnc_godModeNameGroup;
Text Messages
// Send a message to group 2 (0-based index)
["Server will restart...", 1] call acre_api_fnc_godModeSendText;
Spectator Displays
Overview
The YARD spectator displays framework allows users to easily integrate YARD spectator radios functionality into their spectator systems.
It provides a radio list control that allows spectators to select which radios to listen in on. In addition, there is a speaking control that displays the unit and channel names for spectator radio transmissions.
Implementation
Integrating the above functionality into custom spectator systems requires the acre_sys_spectator_RscRadios and acre_sys_spectator_RscSpeaking controls to be added to the display. This can be done either through config or through scripting when the display is initialized.
The acre_sys_spectator_RscRadios control should be added to the spectator display’s focus info widget that shows information about the currently selected unit. The acre_sys_spectator_RscSpeaking control should be positioned in the top-right of the display.
Next, the acre_sys_spectator_fnc_initDisplay function must be called to initialize the controls. This function adds the handling necessary for updating the controls as well as adding support for the “Clear Spectator Radios” keybind. The arguments for this function are as follows:
| # | Description | Type |
|---|---|---|
| 0 | Spectator Display | DISPLAY |
| 1 | Target Function | CODE |
| 2 | Visible Function | CODE |
The Target Function must return an OBJECT which is the currently focused entity, objNull if there is none. The Visible Function must return a BOOL that is true if the interface is currently visible.
Example
This section showcases how spectator radios support is added by YARD to BI’s EG Spectator.
Adding the Controls:
Since the EG Spectator is the default spectator system for Arma 3, the default values for the controls are setup best for it. While most spectator displays have similar characteristics, you may need to adjust values such as control positioning to best suit your display.
class RscDisplayEGSpectator {
class Controls {
class FocusInfo: RscControlsGroupNoScrollbars {
y = POS_Y(21);
h = POS_H(7.1);
class controls {
class acre_sys_spectator_radios: acre_sys_spectator_RscRadios {};
};
};
class acre_sys_spectator_speaking: acre_sys_spectator_RscSpeaking {};
};
};
Calling the Initialization Function:
[
_display,
{uiNamespace getVariable ["RscEGSpectator_focus", objNull]},
{uiNamespace getVariable ["RscEGSpectator_interfaceVisible", true]}
] call acre_sys_spectator_fnc_initDisplay;
Vehicle Intercom
Both features are currently supported only for vanilla classes and their children to maximize performance. Support for other classes can be added per request on the issue tracker.
Important
Requires ACE3 Interaction Menu!
Vehicle Intercom
Vehicle intercom is the system where units in a vehicle can easily communicate among each other without noise disturbances. In YARD several intercoms can coexist in a vehicle.
By default, intercom is enabled for the following classes and their children:
Wheeled_APC_FMRAP_02_base_FTankHelicopterPlaneSDV_01_base_F
If you are inheriting from one of those classes, no extra configuration is required for vehicle intercom functionality. The basic configuration includes an intercom network for crew members ("commander", "driver", "gunner" and those positions labelled as "turret" excluding firing from vehicle (FFV) turrets) and another network for cargo positions or passengers in case they are present.
The system can be further modified in order to customise which positions have access to intercom. The following configuration entries illustrate some of the possibilities:
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class AcreIntercoms {
class Intercom_1 { // Each entry defines a network
displayName = "Crew intercom"; // Name of the intercom network displayed to the players
shortName = "Crew"; // Short name of the intercom network. Maximum of 5 characters
// Seats with stations configured that have intercom access. In this case, units in commander, driver, gunner and turret (excluding FFV) have access to this intercom
// If left empty it has the same effect
allowedPositions[] = {"crew"};
// In this case the commander turret does not have access to crew intercom (unit is "turned out"). This can be useful for historical vehicles (default: {})
disabledPositions[] = {{"Turret", {0,0}}};
// Despite not having regular access to the network, units in cargo positions can have limited connections to communicate with the crew. These positions do not transmit automatically in the limited network; units in this position must toggle the functionality manually. (default: {})
limitedPositions[] = {{"cargo", "all"}};
// This is the number of simultaneous connections that units defined in the previous array can have (default: 0)
numLimitedPositions = 1;
// Seats with master stations have the possibility of broadcasting a message in that network (default: {})
masterPositions[] = {"commander"};
// The intercom initial configuration is enabled upon entering a vehicle (default: 0)
connectedByDefault = 1;
};
class Intercom_2: Intercom_1 {
displayName = "Pax intercom";
shortName = "Pax";
// Both crew and cargo positions have access to passenger intercom
allowedPositions[] = {"crew", {"cargo", "all"}};
limitedPositions[] = {};
numLimitedPositions = 0;
// The intercom initial configuration is disabled upon entering a vehicle (default behaviour)
connectedByDefault = 0;
};
};
};
};
The following example enables an intercom network for only driver and commander positions and the turret positions different from [1] and [2] as well as the commander’s turn out turret position. A second intercom network is enabled to all stations except for gunner, cargo index 1 and all FFV turrets, while a third intercom is available for some of the cargo positions. The master position is defined for the commander seat only.
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class AcreIntercoms {
class Intercom_1 { // Each entry defines a network
displayName = "Crew intercom"; // Name of the intercom network displayed to the players
shortName = "Crew";
// "all" is a wildcard that selects, in this case, all turrets (not including ffv)
allowedPositions[] = {"driver", "commander", {"turret", "all"}};
// Commander FFV turret and turret positions [1] and [2] do not have access to crew intercom
disabledPositions[] = {{"Turret", {0,0}, {1}, {2}}};
// Noone else can have access to this intercom network
limitedPositions[] = {};
masterPositions[] = {"commander"};
numLimitedPositions = 0;
connectedByDefault = 1;
};
class Intercom_2: Intercom 1 {
displayName = "Passenger intercom";
shortName = "Pax";
// Units in crew and in cargo positions have access to the passenger intercom
allowedPositions[] = {"crew", {"cargo", "all"}};
// Excludes units from accessing the passenger intercom. In this example, gunner, cargo index 1 and all FFV turrets do not have access to passenger intercom
disabledPositions[] = {"gunner", {"cargo", 1}, {"ffv", "all"}};
connectedByDefault = 0;
};
class Intercom_3: Intercom 2 {
displayName = "Cargo intercom";
shortName = "Crg";
// Units in cargo positions 1 and 2 and all FFV turrets have access to the passenger intercom
allowedPositions[] = {{"cargo", 1, 2}, {"ffv", "all"}};
// Excludes unit in FFV turret [4] to access from accessing passenger intercom, as well as cargo index 1 and turret [1]
// when they are turned out
disabledPositions[] = {{"ffv", [4]}, {"turnedOut", 1, {1}}};
}
};
};
};
Infantry Telephone
Infantry telephone is the system where infantry can communicate with units inside tanks and IFVs using a telephone mounted on the outside of the vehicle.
By default, infantry telephone is enabled only for Tank class and its children.
To add infantry telephone to a vehicle class and configure its properties, use the following config entry:
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
acre_hasInfantryPhone = 1; // 1 - enabled, 0 - disabled (default: 0)
acre_infantryPhoneDisableRinging = 0; // If set to 1, the ringing funtionality will not be available (default: 0)
acre_infantryPhoneCustomRinging[] = {}; // An array used in order to override the default sound for the ringing functionality (default: {})
// List of intercom names (intercom_1, intercom_2) or "all" in order to specify which intercom networks the phone can connect to
acre_infantryPhoneIntercom[] = {"all"};
acre_infantryPhoneControlActions[] = {"intercom_1"}; // Only those units in "intercom_1" can have access to ringing functionality
// Here a custom function can be defined that is called when the infantry phone is picked up, put back, given to another unit or the intercom network is switched
acre_eventInfantryPhone = QFUNC(noApiFunction);
};
};
Ringing and ringing sound
The infantry phone has the ringing functionality configured by default. However, it can be disabled by setting acre_infantryPhoneDisableRinging to 1. In addition, the default ringing sound in YARD can be also overwritten, on a class basis, through the acre_infantryPhoneCustomRinging entry. This entry consists of an array of five elements and it will do nothing if left blank. The five entries are mandatory in order for the function playSound3D to work as intended in YARD.
- 0: Path to sound file <STRING>
- 1: Duration (sound is a PFH so we need to specify a duration) <NUMBER>
- 2: Volume the sound plays at <NUMBER>
- 3: Sound pitch <NUMBER>
- 4: How far the sound is audible <NUMBER>
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
acre_hasInfantryPhone = 1; // 1 - enabled, 0 - disabled
acre_infantryPhoneDisableRinging = 0; // If set to 1, the ringing funtionality will not be available
acre_infantryPhoneCustomRinging[] = "A3\Sounds_F\sfx\alarm_independent.wss", 5.0, 1.0, 1.0, 50}; // The alarm sound will be played every 5 seconds and will be audible until 50m. Volume and sound pitch are both set to 1
acre_infantryPhoneIntercom[] = {"all"};
acre_infantryPhoneControlActions[] = {"intercom_1"}; // Only those units in "intercom_1" can have access to ringing functionality
// Here a custom function can be defined that is called when the infantry phone is picked up, put back, given to another unit or the intercom network is switched
acre_eventInfantryPhone = QFUNC(noApiFunction);
};
};
Position
Additionally, infantry telephone interaction is put on the main interaction node (center of vehicle) if no custom position is defined in config. Custom position can be set using a config entry to put the interaction node anywhere on the hull of the vehicle. This position will also be used as a sound source for the ringing functionality.
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
acre_infantryPhonePosition[] = {-1.1, -4.86, -0.82}; // Coordinates in model space or a string with a memory point.
};
};
YARD provides helper functions for retrieving the position and quickly making sure they are correct. If you build YARD locally, you can uncomment defines in sys_intercom/script_component.hpp:
DRAW_INFANTRYPHONE_INFOdraws text with class name of the vehicle and current position at the current position on the model (when pointing at the vehicle).DRAW_CURSORPOS_INFOdraws an arrow where your cursor is pointing to. Current position is saved inxPosModelvariable which can easily be watched in the debug console to retrieve precise coordinates in model space for direct use in config.
Custom function
An entry is provided in order to be able to execute a custom function if the infantry phone is picked up, put back, given to another unit or the intercom network is switched. By default a dummy function is called, but any other function could be defined instead on a class basis. This can be useful if the vehicle has a hatch that gets opened when the infantry phone is picked up for example. The arguments passed to this function are:
- 0: Vehicle with infantry phone (OBJECT)
- 1: Infantry phone unit (OBJECT)
- 2: Infantry phone action (1: return, 2: pick-up, 3: give, 4: switch network) (NUMBER)
The following configuration would execute, in a unscheduled enviroment, myCustomFunction:
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
acre_hasInfantryPhone = 1;
acre_infantryPhonePosition[] = {-1.1, -4.86, -0.82};
acre_eventInfantryPhone = "myCustomFunction";
};
};
Entries and wildcards
The framework recognises the following entries and wildcards for the configuration files:
- Entries:
"cargo","commander","driver","gunner","copilot"(only helicopters and planes),"turret"(non FFV),"ffv"(FFV turrets) and"turnedOut". The"turnedOut"entry is only valid for theexceptionconfiguration array and it can be combined with any other entries ("commander","driver","gunner","copilot"), cargo indexes and turrets. For example{{"turnedOut", 1, [3], "driver"}}will prevent access to cargo index 1, driver and turret [3] when they are turned out. - Wildcards:
"crew": selects all crew members"commander","driver","gunner","turret"(non FFV) and it can be combined with other entries. For example{"crew", {"cargo", 1}}."inside": selects all units inside a vehicle."all"can be combined with"cargo","turret","ffv"and"turnedout"and selects all entries of this category. For example{{"cargo", 1}, {"ffv", "all"}}.
Configuration examples
The following vehicle has crew and passenger intercom as well as infantry telephone.
- Crew intercom is enabled for all the default crew positions (
"commander","driver","gunner"and those positions labelled as"turret"excluding firing from vehicle (FFV) turrets) with the exception of"driver"and when player is turned out in all positions. Units in cargo positions can access the intercom, but only two units simultaneously. - Passenger intercom is available for all the previously defined crew members plus all
"cargo"positions and for the"driver"with the exception of the"commander","cargo"index 1, all FFV turrets and turned out positions in the"driver","gunner","cargo"index 2 and"turrent"[2]. - The infantry telephone that can have access to both crew and passenger intercom networks. Units can interact with the infantry telephone at
{-1.1, -4.86, -0.82}model space coordinates. Only those units in the crew intercom can make the phone ring.
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class AcreIntercoms {
class Intercom_1 {
displayName = "Crew intercom";
shortName = "Crew";
allowedPositions[] = {"crew"};
disabledPositions[] = {"driver", {"turnedout", "all"}};
limitedPositions[] = {{"cargo", "all"}};
numLimitedPositions = 2;
masterPositions[] = {"commander"};
connectedByDefault = 1;
};
class Intercom_2: Intercom 1 {
displayName = "Passenger intercom";
shortName = "Pax";
allowedPositions[] = {"crew", {"cargo", "all"}};
disabledPositions[] = {"commander", {"Cargo", 1}, {"ffv", "all"}, {"turnedout", 2, "driver", "gunner", [2]}};
limitedPositions[] = {};
numLimitedPositions = 0;
connectedByDefault = 0;
};
};
// Infantry Phone
acre_hasInfantryPhone = 1;
acre_infantryPhoneIntercom[] = {"all"};
acre_infantryPhoneControlActions[] = {"intercom_1"};
acre_infantryPhonePosition[] = {-1.1, -4.86, -0.82};
acre_infantryPhoneDisableRinging = 0; // If set to 1, the ringing funtionality will not be available
acre_infantryPhoneCustomRinging[] = {"A3\Sounds_F\sfx\alarm_independent.wss", 5.0, 1.0, 1.0, 50}; // The alarm sound will be played every 5 seconds and will be audible until 50m. Volume and sound pitch are both set to 1
};
};
Vehicle Racks
Both features are currently supported only for vanilla classes and their children to maximize performance. Support for other classes can be added per request on the issue tracker.
Important
Requires ACE3 Interaction Menu!
Vehicle Racks and Intercom
Vehicle racks is the system where units inside a vehicle can use mounted radios or mount personal radios in order to increase the transmission power.
By default, vehicle racks are enabled for the following classes and their children:
MRAP_01_base_FHelicopter_Base_FPlane_Base_FTank_FWheeled_APC_F
If you are inheriting from one of those classes, no extra configuration is required for vehicle racks functionality. The default positions where the racks can be configured and can be used for transmitting and receiving incoming transmissions include "commander", "driver", "gunner" and those positions labelled as "turret" excluding firing from vehicle (FFV) turrets. Other seats in the intercom network will not be able to configure it. By default, turned out positions have the open radio GUI functionality disabled. For those racks without access to intercom, one can use the keyword "none" in the intercom[] configuration entry.
The system can be further modified in order to customise the type of racks, the amount of them, which positions can open and configure the radio and to what intercoms the rack is connected to. The following configuration entries illustrate some of the possibilities. The first example configures two racks on an MRAP, a VRC110 which allows mounting a PRC152 for the "driver" and front seat passenger ("cargo" 0) and, a VRC103 with a PRC117F mounted by default that cannot be removed accessible from "driver", "commander" and "gunner" positions.
class CfgVehicles {
class Car_F;
class MRAP_01_base_F : Car_F {
class AcreRacks {
class Rack_1 {
displayName = "Dashboard Upper"; // Name displayed in the interaction menu
shortName = "D.Up"; // Short name displayed on the HUD. Maximum of 5 characters
componentName = "ACRE_VRC110"; // Able to mount a PRC152
allowedPositions[] = {"driver", {"cargo", 1}}; // Who can configure the radio and open the radio GUI. Same wildcards as the intercom. It also allows transmitting/receiving
disabledPositions[] = {}; // Who cannot access the radio (default: {})
defaultComponents[] = {}; // Use this to attach simple components like Antennas, they will first attempt to fill empty connectors but will overide existing connectors. Not yet fully implemented. (default: {})
mountedRadio = ""; // Predefined mounted radio (default: "", meaning none)
isRadioRemovable = 1; // Radio can be removed (default: 0)
intercom[] = {}; // Radio not wired to any intercom. All units in intercom can receive/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface) (default: {})
};
class Rack_2 {
displayName = "Dashboard Lower"; // Name displayed in the interaction menu
shortName = "D.Low"; // Short name displayed on the HUD. Maximum of 5 characters
componentName = "ACRE_VRC103"; // Rack type (able to mount a PRC117F)
allowedPositions[] = {"driver", "commander", "gunner"}; // Who can configure the radio and open the radio GUI. Same wildcards as the intercom. It also allows transmitting/receiving
disabledPositions[] = {};
defaultComponents[] = {};
mountedRadio = "ACRE_PRC117F"; // Predefined mounted radio
isRadioRemovable = 0; // Radio cannot be removed
intercom[] = {}; // Radio not wired to any intercom. All units in intercom can receive/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface)
};
};
};
};
The next example configures a rack with a PRC117F already mounted and with full access (open GUI and transmitting/receiving functionality) to the "driver", "commander" and "gunner", while other members in "intercom_1" mesh can only receive incoming transmissions.
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class AcreRacks {
class Rack_1 {
displayName = "Dash"; // Name is displayed in the interaction menu.
shortName = "Dash";
componentName = "ACRE_VRC103";
allowedPositions[] = {"driver", "commander", "gunner"}; // Who has access. "inside" - anyone inside, "external" - provides access upto 10m away, "driver", "gunner", "copilot", "commander"
disabledPositions[] = {};
defaultComponents[] = {};
mountedRadio = "ACRE_PRC117F"; // Predefined mounted radio
isRadioRemovable = 0;
intercom[] = {"intercom_1"}; // All units in intercom can receive/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface).
};
}
};
};
This last example configures a single VRC103 rack with a mounted PRC117F for the pilot and copilot and with access to the intercom network "intercom_1" intercom.
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class AcreRacks {
class Rack_1 {
displayName = "Dash"; // Name is displayed in the interaction menu.
shortName = "Dash";
componentName = "ACRE_VRC103";
allowedPositions[] = {"driver", "copilot"}; // Who has access. "inside" - anyone inside, "external" - provides access upto 10m away, "driver", "gunner", "copilot", "commander"
disabledPositions[] = {};
defaultComponents[] = {};
mountedRadio = "ACRE_PRC117F"; // Predefined mounted radio
isRadioRemovable = 0;
intercom[] = {"intercom_1"}; // All units in intercom will be able to hear/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface)
};
}
};
};
Entries and wildcards
The framework recognises the following entries and wildcards for the configuration files:
- Entries:
"cargo","commander","driver","gunner","copilot"(only helicopters and planes),"turret"(non FFV),"ffv"(FFV turrets) and"turnedOut". The"turnedOut"entry is only valid for theexceptionconfiguration array and it can be combined with any other entries ("commander","driver","gunner","copilot"), cargo indexes and turrets. For example{{"turnedOut", 1, [3], "driver"}}will prevent access to cargo index 1, driver and turret [3] when they are turned out. - Wildcards:
"crew": selects all crew members"commander","driver","gunner","turret"(non FFV) and it can be combined with other entries. For example{"crew", {"cargo", 1}}."inside": selects all units inside a vehicle."external": rack can be used only externally."all"can be combined with"cargo","turret","ffv"and"turnedout"and selects all entries of this category. For example{{"cargo", 1}, {"ffv", "all"}}.
- Racks:
"ACRE_VRC64": Can mount a"ACRE_PRC77"."ACRE_VRC103": Can mount a"ACRE_PRC117F"."ACRE_VRC110": Can mount a"ACRE_PRC152"."ACRE_VRC111": Can mount a"ACRE_PRC148"(20W version)."ACRE_SEM90": Can mount a"ACRE_SEM70"(4W on low power and 40W on high).
Configuration examples
The following vehicle has crew and passenger intercom as well as infantry telephone and Three radio racks are mounted: two VRC110 (one for the "driver" and "commander" and the other for "cargo" positions) and a VRC103 with a mounted PRC117F with full access to "commander" and "driver" and receive functionality for those in other crew positions or units connected to the passenger intercom, except those in "ffv" positions.
- Crew intercom is enabled for all the default crew positions (
"commander","driver","gunner"and those positions labelled as"turret"excluding firing from vehicle (FFV) turrets) with the exception of"driver"and when player is turned out in all positions. Units in cargo positions can access the intercom, but only two units simultaneously. - Passenger intercom is available for all the previously defined crew members plus all
"cargo"positions and for the"driver"with the exception of the"commander","cargo"index 1, all FFV turrets and turned out positions in the"driver","gunner","cargo"index 2 and"turrent"[2]. - The infantry telephone that can have access to both crew and passenger intercom networks. Units can interact with the infantry telephone at
{-1.1, -4.86, -0.82}model space coordinates. Only those units in the crew intercom can make the phone ring.
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class AcreIntercoms {
class Intercom_1 {
displayName = "Crew intercom";
shortName = "Crew";
allowedPositions[] = {"crew"};
disabledPositions[] = {"driver", {"turnedout", "all"}};
masterPositions[] = {"commander"};
limitedPositions[] = {{"cargo", "all"}};
numLimitedPositions = 2;
connectedByDefault = 1;
};
class Intercom_2: Intercom_1 {
displayName = "Passenger intercom";
shortName = "Pax";
allowedPositions[] = {"crew", {"cargo", "all"}};
disabledPositions[] = {"commander", {"Cargo", 1}, {"ffv", "all"}, {"turnedout", 2, "driver", "gunner", [2]}};
limitedPositions[] = {};
numLimitedPositions = 0;
connectedByDefault = 0;
};
};
// Infantry Phone
acre_hasInfantryPhone = 1;
acre_infantryPhoneIntercom[] = {"all"};
acre_infantryPhoneControlActions[] = {"intercom_1"};
acre_infantryPhonePosition[] = {-1.1, -4.86, -0.82};
acre_infantryPhoneDisableRinging = 0; // If set to 1, the ringing funtionality will not be available
acre_infantryPhoneCustomRinging[] = {"A3\Sounds_F\sfx\alarm_independent.wss", 5.0, 1.0, 1.0, 50}; // The alarm sound will be played every 5 seconds and will be audible until 50m. Volume and sound pitch are both set to 1
class AcreRacks {
class Rack_1 {
displayName = "Dashboard Upper"; // Name displayed in the interaction menu
shortName = "D.Up";
componentName = "ACRE_VRC110"; // Able to mount a PRC152
allowedPositions[] = {"driver", "commander", "gunner"}; // Who can configure the radio and open the radio GUI. Same wildcards as the intercom. It also allows transmitting/receiving
disabledPositions[] = {};
defaultComponents[] = {}; // Use this to attach simple components like Antennas. Not yet fully implemented
mountedRadio = ""; // Predefined mounted radio
isRadioRemovable = 1; // Radio can be removed
intercom[] = {}; // No access to intercoms. All units in intercom will be able to hear/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface)
};
class Rack_2 {
displayName = "Dashboard Upper"; // Name displayed in the interaction menu
shortName = "D.Up";
componentName = "ACRE_VRC110"; // Able to mount a PRC152
allowedPositions[] = {{"cargo", "all"}}; // Who can configure the radio and open the radio GUI. Same wildcards as the intercom. It also allows transmitting/receiving
disabledPositions[] = {{"ffv", "all"}};
defaultComponents[] = {}; // Use this to attach simple components like Antennas. Not yet fully implemented
mountedRadio = ""; // Predefined mounted radio
isRadioRemovable = 1; // Radio can be removed
intercom[] = {}; // No access to intercoms. All units in intercom will be able to hear/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface)
};
class Rack_3 {
displayName = "Dashboard Lower"; // Name displayed in the interaction menu
shortName = "D.Low";
componentName = "ACRE_VRC103"; // Rack type (able to mount a PRC117F)
allowedPositions[] = {"driver", "commander", "gunner"}; // Who can configure the radio and open the radio GUI. Same wildcards as the intercom. It also allows transmitting/receiving
disabledPositions[] = {};
defaultComponents[] = {};
mountedRadio = "ACRE_PRC117F"; // Predefined mounted radio
isRadioRemovable = 0; // Radio cannot be removed
intercom[] = {"intercom_1", "intercom_2"}; // All units in intercom will be able to hear/send transmittions (ACE3 interaction menu) but they cannot manipulate the radio (GUI interface)
};
};
};
};
Assigning presets to vehicle racks
It is now possible to assign a specific radio preset to a racked radio. This can be done using the API function acre_api_fnc_setVehicleRacksPreset before racks are initialised or calling it in the init field in the editor: [this, "myCustomPreset"] call acre_api_fnc_setVehicleRacksPreset.
Assigning racks mid-mission or to non-enterable vehicles
Racks can also be dynamically added, removed or initialised using API functions.
acre_api_fnc_addRackToVehicleallows adding a rack to the vehicle. The following line adds a AN/VRC-103 with an AN/PRC 117F connected tointercom_1. The rack can be accessed from outside only:
[cursorTarget, ["ACRE_VRC103", "Upper Dash", "Dash", false, ["external"], [], "ACRE_PRC117F", [], ["intercom_1"]], false, {}] call acre_api_fnc_addRackToVehicle
It is possible through this API function to add and initialise a rack on non-enterable objects like drones or communication tables.
acre_api_fnc_removeRackFromVehicleallows removing a rack with a unique ID from a vehicle.acre_api_fnc_removeAllRacksFromVehicleremoves all racks from a vehicle.acre_api_fnc_initVehicleRacksinitialises all racks in a vehicle. This API function can be used to initialise racks on non-enterable vehicles.acre_api_fnc_replaceRacksOnVehiclecan be used to replace the config-defined racks of a vehicle with a different rack class.
Vehicle Attenuation
Introduction
Vehicle attenuation is the system where people outside and inside of a vehicle hear each other at reduced volumes. The old implementation was to simply use the insideSoundCoef in the vehicle config. This value was used by the game engine to determine the sound level heard internally.
Arma 3 has introduced new config options for sound attenuation that replace the previous system.
Attenuation config
Attenuation effect types
Every vehicle has a config property attenuationEffectType which references an attenuation effect. Each attenuation effect has its own class in ConfigFile >> CfgSoundEffects >> AttenuationsEffects. We added new config parameters for these effects to define the attenuation used in YARD.
YARD defines two attenuation values in CfgSoundEffects:
acreAttenuation: A value ranging 0-1 which is used to determine the attenuation between people inside and outside of the vehicles.acreAttenuationTurnedOut: A value ranging 0-1 which is used to determine the attenuation between people inside (turned in) and turned out in the same vehicle (refers to isTurnedOut command).
If the value is 1, the sound will be blocked completely and if it is 0 no sound will be absorbed.
If a config for a specific attenuationEffectType does not exist, the default values acreDefaultAttenuation and acreDefaultAttenuationTurnedOut will be used. The default config can be found on GitHub.
Note
The system also takes into account the sound effects on a turret using the value of
soundAttenuationTurret. There is also the option to disable attenuation on a turret usingdisableSoundAttenuation = 1;
Compartments
YARD also provides a system to adjust the attenuation between compartments. A compartment is a virtual space where vehicle seats can be grouped together. A vehicle can have multiple compartments. BI already provides compartments. Each compartment is called CompartmentX where X is a number. It is up to the developer of the vehicle to use compartments.
YARD adds compartment config parameters for every vehicle that look something like this:
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class ACRE {
// Attenuation between players inside (turned in) separate in compartments
class attenuation {
class Compartment1 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
class Compartment2 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
class Compartment3 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
class Compartment4 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
};
// Attenuation between a turned out player and turned in player sitting in separate compartments
class attenuationTurnedOut {
class Compartment1 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
class Compartment2 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
class Compartment3 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
class Compartment4 {
Compartment1 = 0;
Compartment2 = 0;
Compartment3 = 0;
Compartment4 = 0;
};
};
};
};
};
In this case the attenuation class defines the attenuation between players inside (turned in) separate compartments and attenuationTurnedOut between a player which is turned out and one that is sitting inside in a separate compartment.
If two players talk with each other from separate compartments, the attenuation between the speaker and the local unit (listener)
is first determined by the speaker compartment class and then by the listener compartment parameter (... >> _speakerCompartment >> _listenerCompartment).
Illustration
IFV with one compartment
Let’s illustrate all the attenuation systems. First we will keep it simple and look at a vehicle with only one compartment. The following picture represents all possible scenarios a player can talk to another one. A connection ↔ of the same color is the same scenario. For easier explanation, we will consider the vehicle an IFV or tank but the concepts are applicable to other types of vehicles too.
Attenuation system in an IFV with one compartment.
Let’s start with the person outside the vehicle named Bob who talks to Tom (violet ↔). Because Tom is turned out, the attenuation is 0 (hardcoded). If Bob talks to Kim or vice versa (pink ↔) the attenuation value is acreAttenuation which is defined in the config ConfigFile >> CfgSoundEffects >> AttenuationsEffects >> TankAttenuation >> acreAttenuation. In our case this value is 0.6.
Because everyone is in one compartment, there is no attenuation (hardcoded) between Chad, Jim and Kim (blue ↔).
Tom and Hans are turned out. All players turned out have no attenuation (hardcoded) between them (green ↔). If Tom or Hans talk to someone inside e.g. Jim (brown ↔) the attenuation value is acreAttenuationTurnedOut defined in ConfigFile >> CfgSoundEffects >> AttenuationsEffects >> TankAttenuation >> acreAttenuationTurnedOut, so 0.3.
IFV with two compartments
Now let’s split the vehicle in two compartments. Hans and Chad will be in Compartment1 and Jim, Kim, Tom will be in Compartment2. The scenarios for Bob did not change, so we leave him out.
Attenuation system in an IFV with two compartments.
Chad talks to Jim (red ↔). Because they are in separate compartments the attenuation value is looked up in the config ConfigFile >> CfgVehicles >> myTank >> ACRE >> attenuation >> Compartment1 >> Compartment2 (from the perspective of Jim) which is 1 meaning that Jim cannot hear Chad.
The same applies between Hans and Jim (yellow ↔)
but the config ConfigFile >> CfgVehicles >> myTank >> ACRE >> attenuationTurnedOut >> Compartment1 >> Compartment2 is looked up which is also 1.
Note
The path in the yellow scenario is different because the value is looked up in the
attenuationTurnedOutclass instead ofattenuation.
Debugging
You can toggle the ability to view attenuation behaviour at runtime to diagnose issues with compartment configs. It will draw the current attenuation value over all units and a hint will be shown with information about your crew (and their detected compartments) as well as the attenuation values of units outside of a vehicle. You’ll also get a short rundown of the configured compartment connection attenuation values for the current vehicle.
Attenuation debug info dialog
Usage
Use the debug console in a mission or editor preview with some units and/or vehicles placed down and execute call acre_sys_attenuate_fnc_toggleDebugInfo;.
Disable and Force Attenuation
Most if not all FFV seats inherit disableSoundAttenuation = 1 from their CargoTurret config parent. This causes all FFV seats to ignore any configured sound attenuations.
forceSoundAttenuation is available as a shortcut. This avoids having to edit each individual turret and can be used like this:
class CfgVehicles {
class ParentVehicle;
class MyVehicle: ParentVehicle {
class ACRE {
class attenuation {
// Force enable attenuation
forceSoundAttenuation = 1;
class Compartment1 {
Compartment1 = 0;
Compartment2 = 0.6;
};
class Compartment2 {
Compartment1 = 0.6;
Compartment2 = 0;
};
};
class attenuationTurnedOut {
class Compartment1 {
Compartment1 = 0.3;
Compartment2 = 0;
};
class Compartment2 {
Compartment1 = 0;
Compartment2 = 0;
};
};
};
};
};
Component System
Overview
The YARD component system is designed to build physical links between different YARD components, be it radios, antennas, fill devices, racks, etc. Using a tree like topology components can define connections to other components through compatible connectors on each device. Connected components can be simple components (non-unique, no custom parameters, such as simple antennas) with no further connections or complex components (for example radios) that can link to other components, including themselves, through multiple connectors.
Each connection has attributes that explain the nature of the connection. These attributes are defined as free form and functionality can be built around definitions of attributes. This allows for thing such as defining the physical characteristics of a connection, such as the type of wire, the physical wire in the game world (for example when attaching a radio to a remote antenna) and other things that are needed by the connection.
The component system implements the same data system that radios use in YARD (as of the current release YARD radios are defined as complex YARD components). All complex components implement events for handling new connections to other components and disconnecting from components. Furthermore all complex components that are connected can exchange messages with each other as events. This allows for programming specific inter-device functionality.
Components now also extend to in game vehicle objects. Early in YARD the data system only handled unique ID’d items in an inventory. That is not the case now. In game objects can now define themselves as unique YARD components and the data system will handle them appropriately, allowing you to extend the same functionality to them that was previously only available to items in your inventory (or in the cargo of a vehicle). This includes the ability to define component connections.
Core Concepts
Components
Components exist as two types, simple and complex.
Simple
A simple component is any component that has no further available connections. It can be thought of as a terminating point for any chain of connected components. This would include things like speakers or antennas that do not have any complex functionality nor do any further devices attach to them. It is important to remember though that things traditionally defined as a simple component do not have to be simple components. For example an antenna or a speaker can just as easily be a complex component.
Complex
A complex component is any component that is uniquely identifiable and has the ability to maintain a unique state. Furthermore they are able to have more than one connector. A complex component for example is a radio. A radio retains a unique state, has multiple connectors, and is fully unique in the game world.
Connectors
Connectors are defined in both complex and simple components. A simple component only has one connector where as a complex component can have as many connectors as needed. A connector has a type defined that determines it’s ability to connect to another component.
Connections
With a component and a connector you can establish connections. In the component system these exist purely as a data structure. There is no physical restrictions implemented beyond their ability to connect to each others connectors. There is no need for a device to physically exist in the same container or near each other for them to be connected in the component system. Physical restrictions will be added through helper functionality that can maintain the physical constraints of a system (for example, objects being required to be in the same parent container, or within a certain distance of each other). The component’s data system is purely concerned with the data relationship between components.
Attributes
Attributes are defined for connections (technically defined on connectors, but at the moment only defined for a connection). A connections attributes are shared between both components connectors. Attributes allow for the definition of anything that is needed to define the nature of the connection. For example a remote antenna would define the physical linkage (read wire) it has with the radio through an attribute. This attribute can be inspected by any system to determine additional needed functionality, such as signal loss, or if the connection is physically sound.
Creating New Radio
For best artwork results you should have your own textured model to create the in-game radio interface. To simplify things we’ll assume you already have one and are able to render images of it.
In YARD every radio object is treated as a unique object with its own settings (volume, channel frequencies etc). To a player this means if they pick up someone else’s radio it will be in the exact same state the last player left it in (knob positions, selected channel, etc). As such every radio model has its own a data model behind it that is responsible for storing the settings. YARD automatically syncs this data model of every radio between clients as long as you stick with the data model as described below.
The existing radios in YARD should serve as good examples of what is possible. I would recommend getting loosely familiar with them. The SEM52SL and AN/PRC-343 in particular are fairly simple radios.
Creating the data model
When a radio is given to a player it is ‘initialized’, this creates an instance of the radio model. Every radio type typically has a set of presets available to it, each of these typically store their own frequencies. When a radio is initialized, the channel data is set to that of the currently active preset by default, this is ‘default’ unless an API call is made (e.g. ["ACRE_PRC343","default2"] call acre_sys_api_fnc_setPreset)
Radio Presets
The radio presets typically store the channel settings. Typically there should always be 4 presets, ideally they should be set to be independent frequencies of each other so they can be used by different teams:
default - This is the default preset
default2 - Given to east side by modules
default3 - Given to west side by modules
default4 - Given to independent side by modules
Each of these is created in:
RADIO/functions/fnc_presetInformation.sqf - This files creates the radio presets.
General radio settings
General radio settings (On state/Volume) are setup in the initialize radio function.
radio/fnc_initializeRadio.sqf - This file sets up the data.
Getters/Setters
Most data states also have their own getters and setters these are typically setup in radio/CfgAcreRadios.hpp under class interfaces. In the radio framework template these are all already defined.
Some static data isn’t initialized in the presetInformation/initializeRadio functions to save on the need. Below is a loosely annotated list on what most of these scripts are for.
getChannelData - Get the data for the specified channel
getChannelDescription - Get the information to display in the yellow and black broadcasting hint
getCurrentChannel - Get the channel number
getCurrentChannelData - Get data for the current channel
getExternalAudioPosition - Used for position of speaker
getListInfo - Get the information to display in the yellow and black broadcasting hint
getOnOffState - Is the radio on/off
getSpatial - Get the radio output mode: "LEFT", "CENTER" or "RIGHT"
getState - Generic get data function
getStates -
getVolume - Get the radio volume
isExternalAudio - Is the radio outputting as a speaker
setChannelData
setCurrentChannel
setOnOffState
setSpatial
setState
setVolume
handlePTTDown
handlePTTUp
handleSignalData
openGui
Signal Processor
The following events are available for handling incoming signals. The handleMultipleTransmission is the most important and is used to determine which incoming radios can be heard. This is useful for implementing custom crypto.
handleBeginTransmission
handlEndTransmission
handleMultipleTransmission
The sensitivity (minimum signal strength the radio can pick up) should also go in here as well. In the below code the sensitivity of the radio is -117, any signal with a strength less than it is discarded.
_squelch = -117 + HASH_GET(_channel,"squelch");
if(_signalDbM < _squelch) then {
Components
YARD also has a component system where components can be added and removed from radios. Antennas are treated as components and must be setup in radio/CfgAcreRadios.hpp. Appropriate connectors must also be specified for the radio. Typically radios use either BNC or TNC connectors for the antennas. The components a radio starts with are determined in the defaultComponents property.
connectors[] = {
{"Antenna", ACRE_CONNECTOR_BNC},
{"Audio/Data", ACRE_CONNECTOR_U_283}
};
defaultComponents[] = {
{0, "ACRE_120CM_VHF_BNC"} // Connector index, Component name
};
Antennas themselves are defined in the sys_antennas component of YARD. You can find the available antennas in the sys_antennas\CfgAcreComponents.hpp.
Create the dialog config
The easiest approach for handling the artwork is to use a layer based system where all artwork is .paa files of size 2048x2048. Each control/knob should have its own set of textures with a texture for each state that will be rendered on top of a background image and alongside the other knobs/controls.
Graphical parts
Typically RADIOTYPE_RadioDialog.hpp is used to define the radio dialog. A control should be defined for every graphical element that needs to be displayed and altered. All ‘graphical’ controls should be the same size and use the same positions/sizes in the config file. If you want to tweak the scale/size of the radio on screen tweak the NEW_SCALE macro. This is used to ensure compatibility with multi screen setups. Wide radios should be based off safeZoneH and Tall radios should be based off safeZoneW (for wide radios see the AN/PRC-117F or AN-PRC77 configs - for tall radios see the AN/PRC-343, AN/PRC-148 or AN/PRC-152 configs.
Typically this should follow this format:
BEGIN_CONTROL(CONTROL_GRAPHICAL_PART_NAME, RADIO_RscPicture, 300)
x=safeZoneX + safeZoneW - NEW_SCALE * SafeZoneH - 1/16 * safeZoneW;
y=SafeZoneY + SafeZoneH - NEW_SCALE * SafeZoneH + 2/8 * safeZoneW;
w=NEW_SCALE * SafeZoneH;
h=NEW_SCALE * SafeZoneH;
text = "RADIO\data\knobs\CONTROL\PATH_TO_PAA.paa";
END_CONTROL
Clickable controls
A config control should be defined for every clickable area/control but these should be separate of the graphical part of the control which will serve as a background. The clickable part should use a tool tip to indicate it is a clickable area. Typically each clickable control should also have its function script e.g. fn_onCONTROLPress.sqf.
BEGIN_CONTROL(CONTROL_CLICKABLE_PART_NAME, RADIO_RscButton, 201)
x=((((0.416-0.543)*(1.15/0.8))+0.5) * SafeZoneH) + SafeZoneY; // This needs tweaking to the correct position
y=((((0.595-0.5)*(1.15/0.8))+0.5) * SafeZoneH) + SafeZoneY; // This needs tweaking to the correct position
w=(1.15/0.8)*0.050*SafeZoneH;
h=(1.15/0.8)*0.050*SafeZoneH;
text = ""; // This should always be blank
onMouseButtonUp = QUOTE(_this call FUNC(onCONTROLPress));
tooltip = "Change channel"; // Tool tip this text
END_CONTROL
Adding New Antenna
Every radio in YARD can be equipped with at least one antenna. Since radios usually have specific antennas designed and tuned for the radio and the frequency range used, it is likely one must add a new antenna if a new radio is created for YARD.
In order to allow an antenna to work properly in YARD, there are a few required config entries and most importantly a set of gain data covering the desired frequency range. The gain data is used by the signal processing functions for calculation of signal strengths. For basics refer to Radio Loss.
Example Antenna Config
Antennas themselves are defined in the sys_antennas component of YARD sys_antennas/CfgAcreComponents.hpp. The parameters should be self explanatory as the following examples shows.
class CfgAcreComponents {
class ACRE_ComponentBase;
class ACRE_BaseAntenna: ACRE_ComponentBase {
type = ACRE_COMPONENT_ANTENNA;
simple = true;
polarization = VERTICAL_POLARIZE;
heightAG = AVERAGE_MAN_HEIGHT;
orient = 90; // in degrees off of flat plane
name = "Default Antenna";
connector = ACRE_CONNECTOR_TNC;
height = 1.2; //meters
binaryGainFile = QPATHTOF(binary\VHF_1.2m_whip_gain.aba);
};
class ACRE_2HALFINCH_UHF_TNC: ACRE_BaseAntenna {
name = "2.5 Inch UHF Antenna AN/PRC-343 ONLY";
connector = ACRE_CONNECTOR_TNC;
height = 0.062457; //meters
binaryGainFile = QPATHTOF(binary\prc343_gain.aba);
};
};
Generating Antenna Gain Data
As YARD tries to simulate radios as close to reality as possible, the gain data used is coming from a tool used for antenna and electromagnetic effects simulation. This tool is called 4NEC2 and can be obtained for free: 4NEC2. For installation instructions and a bunch of good tutorials, please refer to the website.
Setting up the antenna
The first step after opening 4NEC2 is to create a model of the antenna. Usually it is more than sufficient to use a vertical wire and a simple ground setting. These models are stored in the .nec format which is basically a text file. The .nec files from all existing antennas could be found in the extras/antenna folder and a good practice is to simply take an existing file and change the parameters either in a text editor or directly in 4NEC2.
Ground Settings: It is highly recommended to set the ground setting to Perfect gnd and check the Connect wire(s) for Z=0 to ground setting as well. Other ground settings may lead to more realistic results regardings the antenna gain field but in contrary to the real world, YARD does not simulate ground effects like ground propagation. The end result in-game would be unexplainable transmission-losses even in perfect conditions.
Calculating antenna gain
Calculation of antenna gain can be done directly in 4NEC2 by pressing F7. To ensure the result to be usable by YARD, the setup shown in the figure below is highly recommended.
A resolution of 5 Degrees is a good trade-off between file size/calculation speed and later in-game precision. Before calculating the frequency range must be set correctly. The actual values depend on the frequency range of the antenna/radio and a step size of 1(MHz) is recommended. While the lower limit can be on the minimal frequency, the higher limit must be 1-2 MHz over the highest used frequency. To perform the calculation, press the button TBC. Note: As 4NEC2 is only capable of 256 frequency steps, the step size must be set to a higher value of the frequency range is higher than 256.
The resulting files
4NEC2 creates two files after finishing the calculation process. One with the ending *.inp and the other one with *.out. The input file *.inp looks very similar to the *.nec file, with the difference that it contains the specific input data for the calculation (the parameters, we entered in the calculation window earlier). The output file *.out contains all the generated gain data plus a bunch of additional data.
Note: 4NEC2 sometimes doesn’t name the two files correctly. The input file’s name seems to be cut off after a few characters. As the file names need to be the same for the python script to work properly, rename them.
Writing binary files to YARD
The first step is to copy both *.inp and *.out files to the correct location in your YARD development folder. E.g. <ACRE2 development directory>\extras\antennas. After that simply start a Command Prompt (Win) or Terminal (Linux) instance and navigate to the tools folder. The python script we are looking for is antenna_create_binary.py. Start it with a single parameter: The name of the input/output files. If we stay at the PRC343 antenna as an example, the command should be like this: python antenna_create_binary.py prc343. After waiting for a few seconds, the script will tell you how many bytes were written to which file.
Create Antenna config entry
The final step is to create a config entry for the antenna like shown at the beginning of this page. Of course you need to bind the antenna to the radio as described in new radio. A detailed testing should always be mandatory to ensure there is no error in the generated gain file.
Custom Signal Processing
YARD allows replacing its default signal strength calculator with a custom signal strength function: This can be done by using the following API function acre_api_fnc_setCustomSignalFunc. This page aims to assist in creating your own and provide examples.
The default signal calculator is sophisticated and complex and as such is largely calculated in the C++ extension. However this signal model doesn’t always appeal to every community and it doesn’t always afford possibilites for various mission mechanics such as radio jammers. This function is intended to be used by communities seeking a specific signal experience or for highly ambitious mission makers.
Function Usage
You can see the default function here but note this is mainly just a dispatcher that sends data to the C++ extension. It gives an idea as to what data might be useful. It does not provide insight into the default signal model that is used though.
Input
The input to your custom function will be of the format: [30, 5000, "ACRE_PRC343_ID_1", "ACRE_PRC343_ID_2"]
- The first element is the frequency (megahertz) e.g.
30. - The second element is the power of the transmitter (milliwatts) e.g.
5000. - Then the classname of the recieving radio e.g.
"ACRE_PRC343_ID_1". - Lastly the classname of the broadcasting radio e.g.
"ACRE_PRC343_ID_2".
Output
The output of your function should be an array of size 2 with two numerical values:
- The power as a percentage (0-1). This value is what will be used by the voice extension to adjust the audio of the player being heard on the radio.
- The decibel signal strength value (dBm). A typical value that is heard is between 0 to about -110 (radio specific). Lower values are not heard.
The decibel signal strength value value is used to determine if the specific radio is capable of hearing the transmission. This process is typically carried out in the handleMultipleTransmissions function for that particular radio radio (i.e. AN/PRC-148). Firstly there exists a minimum signal sensitivity that each radio can pick up - This can be thought of as the minimum signal strength the hardware is capable of registering. The minimum that is registered is typically around -100 (AN/PRC343) to -117 (AN/PRC-117F) which is defined in configFile >> 'CfgAcreComponents' >> RADIO_BASECLASS >> 'sensitivityMin'. Some radios also make use of Squelch - If you are curious to see this is all handled in the radio specific handleMultipleTransmissions function.
Helper functions
The provided inputs are a bit lacking as they don’t provide the position or any antenna information there are some handy functions you can use to retrieve these. Note these are internal functions and are subject to change.
acre_sys_radio_fnc_getRadioObject- In YARD every radio is typically associated with a game object this returns the associated object. e.g.["ACRE_PRC343_ID_1"] call acre_sys_radio_fnc_getRadioObject;acre_sys_radio_fnc_getRadioPos- This will return the position (ASL) of a radio e.g.["ACRE_PRC343_ID_1"] call acre_sys_radio_fnc_getRadioPos;acre_sys_components_fnc_findAntenna- This will return data on all the attached antennas to a specified radio["ACRE_PRC343_ID_1"] call acre_sys_components_fnc_findAntenna;. The return format is an array of antennas where each antenna contains data on the antenna class name, its position and its orientation.acre_sys_signal_fnc_getSignalCore- This will call YARD’s default implementation of the signal calculation in C++, with currently selected signal model. It will return Power and Maximum signal strenth (dBm) which can be further adjusted with custom processing.
Examples
Simple calculation
Below is an example of a simple calculation that is based on how ACRE1 calculated signal loss. It is a largely based on free-space path loss over the distance which does not take into account terrain. It is also provides a bit of a boost to the signal strength of the AN/PRC-343. In this example the range of a AN/PRC-343 is around 500m and virtually all other radios will have no problems with Arma terrains (40km+).
Note
As of 2.7.0 this model has been implemented in C++ and it can be selected using the Arcade Mode via CBA Settings.
MY_CUSTOM_ACRE_FUNC = {
params ["_f", "_mW", "_receiverClass", "_transmitterClass"];
private _realRadioRx = toLower (configName (inheritsFrom (configFile >> "CfgWeapons" >> _receiverClass)));
private _sinadRating = getNumber (configFile >> "CfgAcreComponents" >> _realRadioRx >> "sinadRating");
private _txPos = [_receiverClass] call acre_sys_radio_fnc_getRadioPos;
private _rxPos = [_transmitterClass] call acre_sys_radio_fnc_getRadioPos;
private _distance = _txPos distance _rxPos; /*Add distance if terrain in the way */
private _Lfs = -27.55 + 20*log(_f) + 20*log(_distance); /* Free Space Path Loss model */
private _Ptx = 10 * (log ((_mW)/1000)) + 30; /* Transmitter Power (mW to dBm) */
if (_realRadioRx isEqualTo "acre_prc343") then { // AN/PRC-343
_Lfs = _Lfs - 17; // 17 dB boost.
};
private _ituLoss = 36; /* base loss level (based on empirical testing...) */
/* Transmitter/Receiver cable/internal loss. */
private _Ltx = 3; /* Transmitter */
private _Lrx = 3; /* Receiver */
/* Loss from fading, obstruction, noise, etc (including ITU model) */
private _Lm = _ituLoss + ((random 1) - 0.5);
/* Total Link Budget - SIGNAL STRENGTH */
private _Lb = _Ptx - _Ltx - _Lfs - _Lm - _Lrx; /* Assume antenna gain is 0 for both*/
/* Signal percentage variables */
private _Sl = (abs _sinadRating)/2;
private _Slp = 0.075;
/* Signal Percentage equation based on the dB value */
private _bottom = _sinadRating - (_Sl*_Slp);
private _Snd = abs ((_bottom - (_Lb max _bottom))/_Sl);
private _Px = 100 min (0 max (_Snd*100));
_Px = _Px/100;
private _signal = _Lb;
// Required to ensure the signal trace for RPT logging works.
if (ACRE_SIGNAL_DEBUGGING > 0) then {
private _signalTrace = missionNamespace getVariable [_transmitterClass + "_signal_trace", []];
_signalTrace pushBack _signal;
missionNamespace setVariable [_transmitterClass + "_signal_trace", _signalTrace];
};
[_Px, _signal];
};
[MY_CUSTOM_ACRE_FUNC] call acre_api_fnc_setCustomSignalFunc;
Signal modification
Below is an example of a modification of the signal as calculated by YARD’s C++ extension, based on the currently selected signal model. This can be used to modify the resulting signal further with custom processing, eg. simple jamming.
[{
// ACRE signal processing
private _coreSignal = _this call acre_sys_signal_fnc_getSignalCore;
_coreSignal params ["_Px", "_maxSignal"];
// Modify signal (eg. zero-out if in jam area)
if (player inArea myTrigger) then {
_Px = 0;
};
// Return final signal
[_Px, _maxSignal]
}] call acre_api_fnc_setCustomSignalFunc;
Reset
To reset the signal handling to default simply call the function with empty code:
[{}] call acre_api_fnc_setCustomSignalFunc;
Debugging
Radio Signal Debugging
YARD does log a few things to your RPT file already, however these are not extensive. For info on where to find your RPT file see the Arma 3 wiki.
Radio signal
Signal strength in YARD is measured as the dBm that the recieving antenna picks up. A value that can be recieved will be typically be between 0 and -100. Different radios have different sensitivites but the lower limits are around -105 to -117 depending on the radio. Anything less will not be recieved or heard.
Radio signal strength hint
If you want to test the incoming signal strength feel free to enable the signal hint. This will display a hint with data on all transmissions you are recieving.
acre_sys_signal_showSignalHint = true;
Log signal traces to RPT
If you want to log radio transmissions to your rpt use ACRE_SIGNAL_DEBUGGING = 1;. Signal traces will now appear in the RPT.
Sample trace in the RPT.
ACRE TX from Snippers (on radio ACRE_PRC343_ID_1, distance at end: 67m), duration 1.1s: [-992,-992,-85,-85,-85,-85]
The signal trace is the array at the end (starts with ‘[’ and ends with ‘]’). The value -992 is used as a placeholder signal strength value while YARD awaits the signal calculation result from the extension. While waiting for a result YARD will keep checking every 0.06 seconds. Once a non-placeholder is retrieved the radio signal is updated every 0.2 seconds apart.
If this signal debugging mode is active. Acre.dll will also log the inputs which are outputted to Arma 3/logs/acre_dll.log
2016-07-08 23:41:23,732-{INFO }- SIGNAL: ACRE_PRC343_ID_17_ACRE_2HALFINCH_UHF_TNC_ACRE_PRC343_ID_12_ACRE_2HALFINCH_UHF_TNC,27859.7,25269.6,54.3022,-0.754939,-0.111193,-0.646299,ACRE_2HALFINCH_UHF_TNC,27917.2,25384,54.7164,0.559324,-0.504565,-0.6577,ACRE_2HALFINCH_UHF_TNC,2400,100,0,2459.39,-85.0606,1.24914e-05
Signal map visualization debug tool
This tool allows you to render radio signals on the map. The tool renders squares as an approximate for radio signal strength for each cell (size controlled by ‘sample size’). The colour and transparency of the cell transitions from bright green at full signal to red and transparent at minimum signal receivable strength. This range of colours is configured by the sensitivity min and max. Anything outside of the minimum range (or not receivable) will be fully transparent and the radio signal would not be received.
Prerequisites
- Have Arma 3 Tools Installed.
- Mount the work drive. Ensure
P:\TexView2\Pal2PacE.exeexists. This may involve copyingTexView2from the Arma 3 Tools installation folder or setting up a symlink (viamklink). - Ensure Arma 3 is running as Administrator to ensure write access for the tool to create textures (these will be dumped in your
Arma 3/userconfigfolder)
Usage
- Use debug console in a mission or editor preview and execute
[] call acre_sys_signalmap_fnc_open;. - Open in-game map, the tool should now be visible on the right side. Use the buttons to select a TX (Transmit position) and an RX (Receiving) area and click ‘Process’ to generate the map. Note: selecting very large areas will take some time to process.
Terrain Files (fakewrp)
YARD computes radio signal over the terrain. When a mission starts it finds the terrain’s .wrp file in the game’s loaded PBOs and reads its heights. Some terrains can’t be read that way, usually because they’re published encrypted. For those, YARD needs a .fakewrp: a file with just the terrain’s heights and peaks, referenced from CfgAcreWorlds.
YARD’s Creator DLC compatibility addons ship .fakewrp files for the Creator DLC terrains.
Without terrain data, signal falls back to the Arcade model (no terrain).
Making a fakewrp
The fakewrp tool (built with the extension, see Building the Extension) makes one either from a WRP it can read, or from heights dumped in game.
From a WRP
fakewrp convert path/to/terrain.wrp terrain.fakewrp
From heights dumped in game
Run this in the debug console on the terrain (it takes a while on big terrains), then paste the clipboard into a file, heights.csv:
private _mapSize = worldSize;
private _gridSize = 4096;
private _interval = _mapSize / _gridSize;
private _heights = [];
for "_y" from 0 to (_mapSize - _interval) step _interval do {
for "_x" from 0 to (_mapSize - _interval) step _interval do {
_heights pushBack getTerrainHeightASL [_x, _y];
};
};
copyToClipboard (_heights joinString ",");
Then:
fakewrp generate --world-size <worldSize> --map-size 4096 heights.csv terrain.fakewrp
Using it
Put the .fakewrp in your addon and point YARD at it:
class CfgAcreWorlds {
class YourWorldName {
wrp = "\your\addon\path\terrain.fakewrp";
};
};
The class name is the terrain’s worldName.
Class Names
Radios
ACRE_PRC77- AN/PRC-77ACRE_PRC117F- AN/PRC-117FACRE_PRC148- AN/PRC-148ACRE_PRC152- AN/PRC-152ACRE_PRC343- AN/PRC-343ACRE_SEM52SL- SEM 52 SLACRE_SEM70- SEM 70ACRE_BF888S- BF-888S
Vehicle Racks
ACRE_VRC64- AN/VRC-64ACRE_VRC103- AN/VRC-103ACRE_VRC110- AN/VRC-110ACRE_VRC111- AN/VRC-111ACRE_SEM90- SEM90
Ground Spikes
ACRE_VHF30108SPIKE- VHF30108 GSACRE_VHF30108- VHF30108 GSMACRE_VHF30108MAST- VHF30108 Mast
Antennas
ACRE_100CM_VHF_TNC- 1M VHF TNCACRE_100CM_VHF_BNC- 1M VHF BNCACRE_2HALFINCH_UHF_TNC- 2.5 INCH UHF PRC343ACRE_SEM52_SHORT_BNC- 0.4M SEM52/SEM70ACRE_SEM52_LONG_BNC- 0.9M SEM52ACRE_SEM70_LONG_BNC- 1.03M SEM70ACRE_AT271_38- AT-271 PRC-77ACRE_123CM_VHF_TNC- 1.23M VHF TNCACRE_270CM_VEH_BNC- 2.7M MB VEH BNCACRE_FA80_BNC- FA80 VEH BNCACRE_AS1729_38- AS-1729/VRCACRE_243CM_VHF_TNC- 2.43M Ground SpikeACRE_643CM_VHF_TNC- 6.43M Ground Spike
Development
Working on YARD itself.
- Building: setting up a development environment and making builds.
- Building the Extension: the Rust extension and tools.
- SQF Coding Guidelines
- Translating
- Releasing: GitHub releases and the Steam Workshop (
hemtt publish). - Documentation: this site.
- Tips and Tricks
The design, decisions and status of the voice and signal work are in plan.md.
Building
This page describes how you can setup your development environment for YARD, allowing you to properly build YARD and utilize file patching. YARD currently supports HEMTT (recommended) on Windows and Linux and Mikero Tools on Windows.
Requirements
- Arma 3
- Arma 3 Tools (available on Steam)
- P-drive
- Run Arma 3 and Arma 3 Tools directly from Steam once to install registry entries (and again after every update)
- CBA mod (release or development version)
- (Recommended) ACE3 mod (release or development version)
HEMTT: (recommended)
- [Windows] PowerShell v3.0+ (pre-installed on Windows 8 or newer)
- HEMTT (>=v1.6.0) in project root (Windows users can double-click
tools/setup.bat)
Mikero Tools:
- Python 3.x
- Mikero Tools: DePbo, DeOgg, Rapify, MakePbo, pboProject
*.hppremoved from PboProject’s “Exclude From Pbo” list-F rebuild RequiredAddonsdisabled
- Python, Mikero Tools and Git in PATH environment variable
Why so complicated?
YARD uses macros to simplify things and give the developer access to a better debug process, which requires a stricter build environment.
Additionally, HEMTT and Mikero’s Tools are stricter and report more errors than Addon Builder does. The structure of this development environment also allows for file patching, which is very useful for debugging.
Not offering executables for the Python scripts we use allows us to make easy changes without the hassle of compiling self-extracting exes all the time.
Getting Source Code
To actually get the YARD source code on your machine, it is recommended that you use Git. Tutorials for this are all around the web, and it allows you to track your changes and easily update your local copy.
You can clone YARD with any Git command line client using the following command:
git clone https://github.com/BrettMayson/yard.git
If you just want to create a quick and dirty build, you can also directly download the source code using the “Download ZIP” button on the front page of the GitHub repo.
Setup and Building (HEMTT)
Replace hemtt with hemtt.exe on Windows. P-drive is not required for HEMTT or file patching.
Initial Setup
Execute tools\setup.bat (double-click on Windows) or download HEMTT and place the executable in project root (Windows and Linux - binarization supported only on Windows at this time).
You will also need the extension, yard_x64.dll, placed in the idi\acre folder. You can obtain it from the last release or build it yourself. The server hosts voice itself; see Voice Server.
File Patching Setup
Not available on Linux as there is no officially supported Arma 3 client for Linux.
YARD comes pre-configured for testing with file patching using only CBA’s and ACE3’s latest published versions. You must subscribe to CBA_A3 and ACE on the Workshop. Note: YARD can run with only CBA, however ACE3 is natively supported and recommended to be used for full radio interaction fidelity.
If you intend to test using file patching with CBA/ACE3 versions different than latest published, or with other mods, further setup is required. First, create a folder called idi in your Arma 3 directory. Then run the following command as admin, replacing the text in brackets with the appropriate paths:
mklink /J "[Arma 3 installation folder]\idi\acre" "[location of the ACRE2 project]/.hemttout/dev"
Create a Development Build
Run $ hemtt dev to build the mod for use with file patching (with links to the original addon folders) without binarization (faster and often not needed for development). This will populate the .hemttout/dev folder with unbinarized PBOs, with links back to the original addon folders. You cannot distribute this build to others.
Run $ hemtt launch to run YARD with pre-configured file patching. Uses $ hemtt dev before launching Arma.
To launch a development build using file patching with CBA/ACE3 versions different than latest published, or with other mods, you must build the mod with $ hemtt dev and start the game by providing a modline:
-mod=@CBA_A3;@ace;idi\acre -skipIntro -noSplash -showScriptErrors -debug -filePatching
Create a Test Build
To create a development build to test changes or to debug something, execute build.bat (double-click on Windows) or run $ hemtt build in the root folder. This will populate the .hemttout/build folder with binarized PBOs. This type of build is meant for sharing, group testing, but not for release.
To start the game using this build, you can use the following modline:
-mod=@CBA_A3;@ace;idi\acre -skipIntro -noSplash -showScriptErrors -debug
Create a Release Build
To create a complete build that you can use without the source files, with full binarization and all optimizations, run $ hemtt release in the root folder. This will populate the .hemttout/releases folder with binarized PBOs and an archive in releases that you can redistribute. These handle like those of any other mod.
Setup and Building (Mikero Tools)
Initial Setup
Navigate to tools folder in command line.
cd <path-to-cloned-repository>\tools
Execute setup.py to create symbolic links to P-drive and Arma 3 directory required for building.
Should the script fail, you can create the required links manually. First, create idi folders both in your Arma 3 directory and on your P-drive. Then run the following commands as admin, replacing the text in brackets with the appropriate paths:
mklink /J "[Arma 3 installation folder]\idi\acre" "[location of the ACRE2 project]"
mklink /J "P:\idi\acre" "[location of the ACRE2 project]"
Then, copy the cba folder from the include\x folder to P:\x\cba. Create the x folder if needed. That folder contains the parts of the CBA source code that are required for the macros to work.
Create a Test Build
To create a development build of YARD to test changes or to debug something, execute build.py in the tools folder. This will populate the addons folder with binarized PBOs. These PBOs still point to the source files in their respective folders however, which allows you to use file patching. This also means that you cannot distribute this build to others.
To start the game using this build, you can use the following modline:
-mod=@CBA_A3;idi\acre
You will also need the extension, yard_x64.dll, placed in the idi\acre folder. You can obtain it from the last release or build it yourself. The server hosts voice itself; see Voice Server.
Create a Release Build
To create a complete build of YARD that you can use without the source files you will need:
- All extension requirements
- Ensure
.hppis NOT in pboProject’s “Exclude From Pbo” list
When the requirements are met:
- Execute
make.py version increment_build <other-increment-args> compile force releasein thetoolsfolder, replacing<other-increment-args>with the part of version you want to increment (options described below)
This will populate the release folder with binarized PBOs, compiled extensions, copied extras, bisigns and a bikey. Additionally, 2 archive files will also be created in the folder, one general and one for Steam. The folder and archives handle like those of any other mod.
Different make.py command line options include:
version- update version number in all files and leave them in working directory (leaving this out will still update the version in all files present in thereleasefolder, but they will be reverted to not disturb the working directory)increment_build- increments build version numberincrement_patch- increments patch version number (ignored withincrement_minororincrement_major)increment_minor- increments minor version number and resets patch version number to0(ignored withincrement_major)increment_major- increments major version number and resets minor and patch version numbers to0compile- compile extensions incrementally (leaving this out will simply copy extensions if already present)force- force rebuild all PBOs, even those already present in thereleasedirectory (combined withcompileit will also rebuild all extensions)release- create release packages/archives<component1> <component2>- build only specified component(s) (incompatible withrelease)force <component1> <component2>- force rebuild specified component(s) (incompatible withrelease)
File Patching
File Patching allows you to change the files in an addon while the game is running, requiring only a restart of the mission. This makes it great for debugging, as it cuts down the time required between tests.
To run Arma 3 with file patching add the -filePatching startup parameter.
Files must exist in the built PBOs for file patching to work. If you create a new file you must rebuild the PBO or Arma will not find it in your file paths.
Disable CBA Function Caching
By default CBA caches a compiled version of functions to reduce mission load times. This interferes with file patching. There are three ways to disable function caching:
- Load
cba_cache_disable.pbo(included in CBA’soptionalsfolder - simply move it toaddonsfolder for the time being) - Add the following to your test missions description.ext:
class CfgSettings {
class CBA {
class Caching {
compile = 0;
xeh = 0;
functions = 0;
};
};
};
- To only disable caching for a single module, hence greatly improving mission restart time, add the following line to the
script_component.hppfile of said module:
#define DISABLE_COMPILE_CACHE
Restrictions
Configs are not patched during run time, only at load time. You do not have have to rebuild a PBO to make config changes, just restart Arma. You can get around this though if you are on the dev branch of Arma 3 and running the diagnostic exe. That includes diag_mergeConfig which takes a full system path (as in p:\idi\clients\acre\addons\my_module\config.cpp) and allows you to selectively reload config files.
Building the Extension
YARD has one extension, yard_x64.dll (yard_x64.so for Linux dedicated servers), written in Rust in the rust/ folder. It carries voice (client, and the voice server the Arma server hosts) and computes radio signal strength over the terrain. See rust/README.md for how the crates fit together.
Requirements
- Rust (stable; the toolchain and targets are pinned in
rust/rust-toolchain.toml) - CMake, to build the bundled Opus codec for release builds
- Windows: the Visual Studio C++ build tools (MSVC)
- Linux: ALSA headers (
libasound2-dev) for the client build - Linux server releases: cargo-zigbuild and Zig (
cargo install cargo-zigbuild,pip install --user ziglang)
Build
The release workflow builds everything for releases; build-extension.sh builds both binaries on Linux.
From the rust/ folder:
# Windows: the extension, and the wav2b64 tool shipped in extras/
cargo build --release -p acre2_ext -p acre2_tools --features acre2_voice_codec/bundled
# Linux dedicated server (no audio devices), linked against glibc 2.28
cargo zigbuild --release -p acre2_ext --target x86_64-unknown-linux-gnu.2.28 --no-default-features --features acre2_voice_codec/bundled
Copy target/release/yard.dll to the repository root as yard_x64.dll (or target/x86_64-unknown-linux-gnu/release/libyard.so as yard_x64.so), and wav2b64.exe to extras/.
Warning
Don’t ship a Linux
.sobuilt with plaincargo build: it needs the build machine’s glibc, and Arma servers on older distros can’t load it (Call extension 'yard' could not be loaded:with no reason). Check withobjdump -T yard_x64.so | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1, which should printGLIBC_2.28.
Tests
cargo test --workspace
The signal propagation tests compare the Rust models with the original C++ ones on a real terrain (rust/acre/signal/tests/golden).
Tools
wav2b64 input.wav [output.b64]: converts a mono 16-bit 48 kHz WAV into a sound file forCfgAcreSounds.fakewrp: makes a.fakewrpterrain file for terrains whose WRP the extension can’t read. See Terrain Files.
Coding Guidelines (SQF)
Disclaimer: Not all YARD’s code complies with the below coding guidelines, we are working towards improving as much as we can!
Naming Conventions
Variable Names
Global Variable naming
Global variables used in a specific component only shall start with the YARD prefix followed by the component, separated by underscores. Global variables shall not contain the fnc_ prefix if the value is not callable code. In case where global variables are used in multiple modules, component may be omitted.
Example: acre_component_myVariableName or acre_myVariableName
For YARD this is done automatically through the usage of the GVAR macro family.
Private Variable naming
To make code as readable as possible, try to use self explanatory variable names and avoid using single character variable names.
Example: _velocity instead of _v
Function naming
Internal functions shall start with the YARD prefix followed by the component, separated by underscores, as well as the fnc_ prefix behind the component name. Public API functions should not have the component specified.
Example: PREFIX_COMPONENT_fnc_functionName or PREFIX_fnc_functionName
For YARD this is done automatically through the usage of the PREP macro.
Files & Config
SQF File extension
Files containing sqf scripts will always have a file name extension of .sqf.
Header files
All header files will always have the file name extension of .hpp.
Own SQF File
All functions shall be put in their own .sqf file.
Config elements
Config files shall be split up into different header files, each with the name of the config and be included in the config.cpp of the component.
Example:
#include "CfgAcreComponents.hpp"
And in CfgAcreComponents.hpp:
class CfgAcreComponents {
// Content
};
Macro Usage
Module/PBO Specific Macro Usage
The family of GVAR macros define global variable strings or constants for use within a module. Please use these to make sure we follow naming conventions across all modules and also prevent duplicate/overwriting between variables in different modules. The macro family expands as follows, for example inside the component radio:
| Macros | Expands to |
|---|---|
GVAR(signal) | acre_radio_signal |
QGVAR(signal) | "acre_radio_signal" |
QQGVAR(signal) | ""acre_radio_signal"" used inside QUOTE macros where double quotation is required. |
EGVAR(rack,signal) | acre_rack_signal |
QEGVAR(rack,signal) | "acre_rack_signal" |
QQEGVAR(rack,signal) | ""acre_rack_signal"" used inside QUOTE macros where double quotation is required. |
There also exists the FUNC family of macros:
| Macros | Expands to |
|---|---|
FUNC(signal) | acre_radio_fnc_signal or the call trace wrapper for that function. |
EFUNC(rack,signal) | acre_rack_fnc_signal or the call trace wrapper for that function. |
DFUNC(signal) | acre_radio_fnc_signal and will ALWAYS be the function global variable. |
DEFUNC(rack,signal) | acre_rack_fnc_signal and will ALWAYS be the function global variable. |
QFUNC(signal) | "acre_radio_fnc_signal" |
QEFUNC(rack,signal) | "acre_rack_fnc_signal" |
QQFUNC(signal) | ""acre_radio_fnc_signal"" used inside QUOTE macros where double quotation is required. |
QQEFUNC(rack,signal) | ""acre_rack_fnc_signal"" used inside QUOTE macros where double quotation is required. |
The FUNC and EFUNC macros shall NOT be used inside QUOTE macros if the intention is to get the function name or assumed to be the function variable due to call tracing (see below). If you need to 100% always be sure that you are getting the function name or variable use the DFUNC or DEFUNC macros. For example QUOTE(FUNC(signal)) == "acre_radio_fnc_signal" would be an illegal use of FUNC inside QUOTE.
Using FUNC or EFUNC inside a QUOTE macro is fine if the intention is for it to be executed as a function.
Function Macros, Call Tracing, and Non-ACRE2/Anonymous Functions
YARD implements a basic call tracing system that can dump the call stack on errors or wherever you want. To do this the FUNC macros in debug mode will expand out to include metadata about the call including line numbers and files. This functionality is automatic with the use of calls via FUNC and EFUNC, but any calls to other functions need to use the following macros:
| Macro | Example |
|---|---|
CALLSTACK(functionName) | [] call CALLSTACK(cba_fnc_someFunction) |
CALLSTACK_NAMED(function,functionName) | [] call CALLSTACK_NAMED(_anonymousFunction,'My anonymous function!') |
These macros will call these functions with the appropriate wrappers and enable call logging into them (but to no further calls inside obviously).
General Purpose Macros
CBA script_macros_common.hpp{:target=“_blank”}
QUOTE() is utilized within configuration files for bypassing the quote issues in configuration macros. So, all code segments inside a given config should utilize wrapping in the QUOTE() macro instead of direct strings. This allows us to use our macros inside the string segments, such as QUOTE(_this call FUNC(signal))
String Macros
Note that you need the strings in component’s stringtable.xml file in the correct format: STR_ACRE_<component>_<string>.
Script strings (still require localize to localize the string):
| Macro | Expands to |
|---|---|
LSTRING(signal) | "STR_ACRE_radio_signal" |
ELSTRING(rack,signal) | "STR_ACRE_rack_signal" |
Config strings (require $ as first character):
| Macro | Expands to |
|---|---|
CSTRING(signal) | "$STR_ACRE_radio_signal" |
ECSTRING(rack,signal) | "$STR_ACRE_rack_signal" |
Path Macros
The family of path macros define global paths to files for use within a module. Please use these to reference files in the YARD project. The macro family expands as follows, for the example inside the component balls:
| Macro | Expands to |
|---|---|
PATHTOF(data\radio.p3d) | \idi\acre\addons\radio\data\radio.p3d |
QPATHTOF(data\radio.p3d) | "\idi\acre\addons\radio\data\radio.p3d" |
PATHTOEF(rack,data\radio.p3d) | \idi\acre\addons\rack\data\radio.p3d |
QPATHTOEF(rack,data\radio.p3d) | "\idi\acre\addons\rack\data\radio.p3d" |
Functions
Functions shall be created in the component directory, named fnc_functionName.sqf. They shall then be indexed via the PREP(functionName) macro in the XEH_PREP.hpp file.
The PREP macro allows for CBA function caching, which drastically speeds up load times. Beware though that function caching is enabled by default and as such to disable it you need to disable CBA function caching!
Headers
Every function should have a header of the following format as the start of their function file:
/*
* Author: ACRE2Team
* Description in sentence(s).
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: The third optional argument <BOOL> (default: true)
* 3: The fourth unused argument <ARRAY> (unused)
*
* Return Value:
* The return value <BOOL> / None
*
* Example:
* ["something", player] call acre_main_fnc_example
*
* Public: [Yes/No]
*/
This is not the case for inline functions or functions not containing their own file.
Includes
Every function includes the script_component.hpp file just below the function header. Any additional includes or defines must be below this include.
All scripts written must be below this include and any potential additional includes or defines.
Reasoning
This ensures every function starts of in an uniform way and enforces function documentation.
Code Style
Braces placement
Braces { } which enclose a code block will have the first bracket placed behind the statement in case of if, switch statements or while, waitUntil and for loops. The second brace will be placed on the same column as the statement but on a separate line.
- Opening brace on the same line as keyword
- Closing brace in own line, same level of indentation as keyword
Yes:
class Something: Or {
class Other {
foo = "bar";
};
};
No:
class Something : Or
{
class Other
{
foo = "bar";
};
};
Also no:
class Something : Or {
class Other {
foo = "bar";
};
};
When using if/else, it is encouraged to put else on the same line as the closing brace to save space:
if (alive player) then {
player setDamage 1;
} else {
hint ":(";
};
In cases where there are a lot of one-liner classes, it is allowed to use something like this to save space:
class One {foo = 1;};
class Two {foo = 2;};
class Three {foo = 3;};
Reasoning
Putting the opening brace in it’s own line wastes a lot of space, and keeping the closing brace on the same level as the keyword makes it easier to recognize what exactly the brace closes.
Indentation
Ever new scope should be on a new indent. This will make the code easier to understand and read. Indentations consist of 4 spaces. Tabs are not allowed.
Good:
call {
call {
if (condition) then {
code
};
};
};
Bad:
call {
call {
if (condition) then {
code
};
};
};
Spacing
All command shall be separated from its parameters with a space.
Good:
params ["_player"];
if (alive _player) then { hint ":)" };
private _config = getNumber (configFile >> "CfgWeapons" >> _parent >> "acre_hasUnique");
Bad:
params["_player"];
if(alive _player) then { hint ":(" };
private _config = getNumber(configFile >> "CfgWeapons" >> _parent >> "acre_hasUnique");
Inline comments
Inline comments should use //. Usage of /* */ is allowed for larger comment blocks.
Example:
//// Comment // Incorrect
// Comment // Correct
/* Comment */ // Correct
Comments in code
All code should be documented by comments that describe what is being done. This can be done through the function header and/or inline comments.
Comments within the code should be used when they are describing a complex and critical section of code or if the subject code does something a certain way because of a specific reason. Unnecessary comments in the code are not allowed.
Good:
// find the object with the most damage inflicted
_highestObj = objNull;
_highestDmg = -1;
{
if (damage _x > _highestDmg) then {
_highestDmg = damage _x;
_highestObj = _x;
};
} foreach _units;
Good:
// Check if the unit is an engineer
(_obj getvariable [QGVAR(engineerSkill), 0] >= 1);
Bad:
// Get the engineer skill and check if it is above 1
(_obj getvariable [QGVAR(engineerSkill), 0] >= 1);
Bad:
// Get the variable myValue from the object
_myValue = _obj getvariable [QGVAR(myValue), 0];
Bad:
// Loop through all units to increase the myValue variable
{
_x setvariable [QGVAR(myValue), (_x getvariable [QGVAR(myValue), 0]) + 1];
} forEach _units;
Brackets around code
When making use of brackets ( ), use as few as possible, unless doing so decreases readability of the code. Avoid statements such as:
if (!(_value)) then { };
However the following is allowed:
_value = (_array select 0) select 1;
Any conditions in statements should always be wrapped around brackets. Example:
if (!_value) then {};
if (_value) then {};
Magic Numbers
There should be no magic numbers. Any magic number should be put in a define either on top of the .sqf file (below the header), or in the script_component.hpp file in the root directory of the component (recommended) in case it is used in multiple locations.
Magic numbers are any of the following:
- A constant numerical or text value used to identify a file format or protocol
- Distinctive unique values that are unlikely to be mistaken for other meanings
- Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants
Code Standards
Error testing
If a function returns error information, then that error information will be tested.
Unreachable Code
There shall be no unreachable code.
Function Parameters
Parameters of functions must be retrieved through the usage of the param or params commands. If the function is part of the public API, parameters must be checked on allowed data types and values through the usage of the param and params commands.
Return Values
Functions and code blocks that specific a return a value must have a meaningful return value. If no meaningful return value, the function should return nil.
Private Variables
All private variables shall make use of the private keyword on initialization. When declaring a private variable before initialization, usage of the private array syntax is allowed. All private variables must be either initialized using the private keyword, or declared using the private array syntax. Exceptions to this rule are variables obtained from an array. Note that this may only be down by making use of the params command family, as this ensures the variable is declared as private.
Good:
private _myVariable = "hello world";
Good:
_myArray params ["_elementOne", "_elementTwo"];
Bad:
_elementOne = _myArray select 0;
_elementTwo = _myArray select 1;
Lines of Code
Any one function shall contain no more than 250 lines of code, excluding the function header and any includes.
Variable declarations
Declarations should be at the smallest feasible scope.
Good:
if (call FUNC(myCondition)) then {
private _areAllAboveTen = true; // Smallest feasible scope
{
if (_x >= 10) then {
_areAllAboveTen = false;
};
} forEach _anArray;
if (_areAllAboveTen) then {
hint "all values are above ten!";
};
}
Bad:
private _areAllAboveTen = true; // Bad because it can be initialized in the if statement
if (call FUNC(myCondition)) then {
{
if (_x >= 10) then {
_areAllAboveTen = false;
};
} forEach _anArray;
if (_areAllAboveTen) then {
hint "all values are above ten!";
};
};
Variable initialization
Private variables will not be introduced until they can be initialized with meaningful values.
Good:
private _myVariable = 0; // Good because the value will be used
{
_x params ["_value", "_amount"];
if (_value > 0) then {
_myVariable = _myVariable + _amount;
};
} forEach _array;
Bad:
private _myvariable = 0; // Bad because it is initialized with a zero, but this value does not mean anything
if (_condition) then {
_myVariable = 1;
} else {
_myvariable = 2;
};
Good:
private _myvariable = [1, 2] select _condition;
Initialization expression in for loops
The initialization expression in a for loop shall perform no actions other than to initialize the value of a single for loop parameter.
Increment expression in for loops
The increment expression in a for loop shall perform no action other than to change a single loop parameter to the next value for the loop.
getVariable
When using getVariable, there should either be a default value given in the statement or the return value should be checked for correct data type as well as return value. A default value may not be given after a nil check.
Bad:
_return = obj getvariable "varName";
if (isnil "_return") then {_return = 0 };
Good:
_return = obj getvariable ["varName", 0];
Good:
_return = obj getvariable "varName";
if (isnil "_return") exitwith {};
Global Variables
Global variables should not be used to pass along information from one function to another. Use arguments instead.
Bad:
fnc_example = {
hint GVAR(myVariable);
};
GVAR(myVariable) = "hello my variable";
call fnc_example;
Good:
fnc_example = {
params ["_content"];
hint _content;
};
["hello my variable"] call fnc_example;
Temporary Objects & Variables
Unnecessary temporary objects or variables should be avoided.
Commented out Code
Code that is not used (commented out) shall be deleted.
Constant Global Variables
There shall be no constant global variables, constants shall be put in a #define.
Logging
Functions should whenever possible and logical, make use of logging functionality through the logging and debugging macros from CBA and YARD.
Constant Private Variables
Constant private variables that are used more as once should be put in a #define.
Code used more than once
Any piece of code that could/is used more than once, should be put in a function and its separate .sqf file, unless this code is less as 5 lines and used only in a per frame handler.
Design considerations
Readability vs Performance
This is a large open source project that will get many different maintainers in it’s lifespan. When writing code, keep in mind that other developers also need to be able to understand your code. Balancing readability and performance of code is a non black and white subject. The rule of thumb is:
- When improving performance of code that sacrifices readability (or vice-versa), first see if the design of the implementation is done in the best possible way.
- Document that change with the reasoning in the code.
Scheduled vs Unscheduled
Avoid the usage of scheduled space as much as possible and stay in unscheduled. This is to provide a smooth experience to the user by guaranteeing code to run when we want it. See Performance considerations, Spawn & ExecVm for more information.
This also helps avoid various bugs as a result of unguaranteed execution sequences when running multiple scripts.
Event driven
All YARD components shall be implemented in an event driven fashion. This is done to ensure code only runs when it is required instead of continous checking.
Event handlers in YARD are implemented through the CBA event system. They should be used to trigger or allow triggering of specific functionality.
More information on the CBA Events System{:target=“_blank”} and CBA Player Events{:target=“_blank”} pages.
Hashes
When a key value pair is required, make use of the Hash implementation.
Hashes are a variable type that store key value pairs. They are not implemented natively in SQF, so there are a number of macros and functions for their usage in YARD. If you are unfamiliar with the idea, they are similar in function to setVariable/getVariable but do not require an object to use.
The following example is a simple usage using our macros which will be explained further below.
_hash = HASHCREATE;
HASH_SET(_hash,"key","value");
if (HASH_HASKEY(_hash,"key")) then {
player sideChat format ["val: %1", HASH_GET(_hash,"key"); // will print out "val: value"
};
HASH_REM(_hash,"key");
if (HASH_HASKEY(_hash,"key")) then {
// this will never execute because we removed the hash key/val pair "key"
};
A description of the above macros is below.
| Macro | Use |
|---|---|
HASHCREATE | Creates an empty hash. |
HASH_SET(hash,key,val) | Sets the hash key to that value, a key can be anything, even objects. |
HASH_GET(hash,key) | Returns the value of that key (or nil if it doesn’t exist). |
HASH_HASKEY(hash,key) | Returns true/false if that key exists in the hash. |
HASH_REM(hash,key) | Removes that hash key. |
Hashlists
A hashlist is an extension of a hash. It is a list of hashes! The reason for having this special type of storage container rather than using a normal array is that an array of normal hashes that are are similar will duplicate a large amount of data in their storage of keys. A hashlist on the other hand uses a common list of keys and an array of unique value containers. The following will demonstrate it’s usage.
_defaultKeys = ["key1","key2","key3"];
// create a new hashlist using the above keys as default
_hashList = HASHLIST_CREATELIST(_defaultKeys);
//lets get a blank hash template out of this hashlist
_hash = HASHLIST_CREATEHASH(_hashList);
//_hash is now a standard hash...
HASH_SET(_hash,"key1","1");
//to store it to the list we need to push it to the list
HASHLIST_PUSH(_hashList,_hash);
//now lets get it out and store it in something else for fun
//it was pushed to an empty list, so it's index is 0
_anotherHash = HASHLIST_SELECT(_hashList,0);
// this should print "val: 1"
player sideChat format["val: %1", HASH_GET(_anotherHash,"key1")];
//Say we need to add a new key to the hashlist
//that we didn't initialize it with? We can simply
//set a new key using the standard HASH_SET macro
HASH_SET(_anotherHash,"anotherKey","another value");
As you can see above working with hashlists are fairly simple, a more in depth explanation of the macros is below.
| Macro | Use |
|---|---|
HASHLIST_CREATELIST(keys) | Creates a new hashlist with the default keys, pass [] for no default keys. |
HASHLIST_CREATEHASH(hashlist) | Returns a blank hash template from a hashlist. |
HASHLIST_PUSH(hashList,hash) | Pushes a new hash onto the end of the list. |
HASHLIST_SELECT(hashlist,index) | Returns the hash at that index in the list. |
HASHLIST_SET(hashlist,index,hash) | Sets a specific index to that hash. |
Pass by reference
Hashes and hashlists are implemented with SQF arrays, and as such they are passed by reference to other functions. Remember to make copies (using the + operator) if you intend for the hash or hashlist to be modified with out the need for changing the original value.
Performance Considerations
Adding Elements to Arrays
When adding new elements to an array, pushBack shall be used instead of the binary addition or set. When adding multiple elements to an array append may be used instead of pushBack.
Good:
_a pushBack _value;
Also good:
_a append [1,2,3];
Bad:
_a set [ count _a, _value];
_a = a + _[value];
When adding an new element to a dynamic location in an array or when the index is pre-calculated, set may be used.
When adding multiple elements to an array, the binary addition may be used for the entire addition.
createVehicle
createVehicle array shall be used instead of createVehicle.
createVehicle(Local) position
createVehicle(Local) used with a non-[0, 0, 0] position performs search for empty space to prevent collisions on spawn.
Where possible [0, 0, 0] position shall be used, except on # objects (e.g. #lightsource, #soundsource) where empty position search is not performed.
This code requires ~1.00ms and will be higher with more objects near wanted position:
_vehicle = _type createVehicleLocal _posATL;
_vehicle setposATL _posATL;
While this one requires ~0.04ms:
_vehicle = _type createVehicleLocal [0, 0, 0];
_vehicle setposATL _posATL;
Unscheduled vs Scheduled
All code that has a visible effect for the user or requires time specific guaranteed execution shall be written in unscheduled space.
Avoid spawn & execVM
execVM and spawn are to be avoided wherever possible.
Empty Arrays
When checking if an array is empty, isEqualTo shall be used.
for Loops
for "_y" from # to # step # do { ... }
shall be used instead of
for [{ ... },{ ... },{ ... }] do { ... };
whenever possible.
while Loops
while is only allowed when used to perform a unknown finite amount of steps with unknown or variable increments. Infinite while loops are not allowed.
Good:
_original = _obj getvariable [QGVAR(value), 0];
while {_original < _weaponThreshold} do {
_original = [_original, _weaponClass] call FUNC(getNewValue);
}
Bad:
while {true} do {
// anything
};
waitUntil
The waitUntil command shall not be used. Instead, make use of a per-frame handler:
[{
params ["_args", "_id"];
_args params ["_unit"];
if (_unit getvariable [QGVAR(myVariable), false]) exitwith {
[_id] call CBA_fnc_removePerFrameHandler;
// Execute any code
};
}, [_unit], 0] call CBA_fnc_addPerFrameHandler;
Translating
Overview
This page describes how to help in translating YARD to different languages. Most of the things can be translated, however radio dialogs are not one of them, as they require precise positioning and sizing to correctly fit.
Guide
- If you don’t already have a GitHub account create one at http://github.com
- Open the YARD repository at https://github.com/BrettMayson/yard
- In the top right corner press the
Forkbutton - You are being redirected to your personal fork, a version that is hosted on your GitHub account (it says
yourUsername/acre2) - Clone that fork to your PC (There are a lot of tools and tutorials how to do this (e.g. GitHub for Windows))
- Download tabler and extract it somewhere
- Open the
tabler.exeand in the menu clickFile > Open language files - Point tabler to the cloned YARD directory
- Start translating
- When done go to the menu and click
File > Save language files - Commit your changes to your local cloned repository
- Sync (Push) your commit(s) to your fork
- Create a Pull Request for your changes
(The last three steps require some git knowledge, but there are a lot of tutorials out there) GitHub for Windows help
Releasing
A release goes to two places: a GitHub release (built by CI from a tag) and the Steam Workshop (uploaded with hemtt publish from a machine running Steam).
1. Version and changelog
- Set the version in
addons/main/script_version.hpp(MAJOR,MINOR,PATCHLVL). Versions have three parts: there’s noBUILDthere, becausehemtt publishlooks the version up in the changelog, and its parser only acceptsx.y.z. - In
CHANGELOG.md, move the notes under[Unreleased]into a new## [x.y.z] - YYYY-MM-DDsection. It follows Keep a Changelog, and this section becomes the Workshop change note. - Commit, tag
vx.y.zand push the tag. The release workflow builds the mod and the extension and drafts a GitHub release with the zip.
2. The extension
hemtt publish packs whatever extension binaries are in the repository root, so put the release ones there first: yard_x64.dll, yard_x64.so and extras/wav2b64.exe. Either:
- run
./build-extension.sh(Linux, cross-compiles the Windows DLL), or - take them from the zip the release workflow built.
Warning
Without them the Workshop item has no extension, and YARD can’t connect to voice or compute signal.
3. Steam Workshop
The Workshop page is configured in .hemtt/publish.toml: title, visibility, tags, CBA as a required item, the description (workshop/description.md, converted from Markdown to Steam BBCode) and the images in workshop/.
-
Check everything first, without connecting to Steam:
hemtt publish --dry-runIt builds the release and prints the title, tags, images, description and change note that would be sent. Check that
.hemttout/releasecontainsyard_x64.dllandyard_x64.so. -
With Steam running and logged in to the account that owns the item:
hemtt publish
The first time, HEMTT asks to create the Workshop item and writes its ID to meta.cpp (there is no meta.cpp until then). Commit meta.cpp: later runs update that item. Steam keeps a new item hidden until its owner has accepted the Workshop legal agreement.
tags, required_items and additional_previews in publish.toml replace what’s on the Workshop page on every publish, so change them there, not on the page.
4. GitHub release
Publish the draft release the workflow created, with the changelog section as its notes.
Note
The DLLs aren’t BattlEye-signed or whitelisted yet, so servers running BattlEye block the extension.
Documentation
This site is built with mdBook from the docs/ folder, and published to GitHub Pages by the docs workflow on every push to main.
Building locally
cargo install mdbook
cd docs
mdbook serve --open
mdbook serve rebuilds and reloads the page as you edit.
Writing pages
- Pages are Markdown in
docs/src/. Add new pages todocs/src/SUMMARY.md, which is the sidebar. - Link to other pages with relative
.mdpaths (../user/installation.md); mdBook checks them and turns them into links to the HTML pages. - Images go in
docs/src/images/. - Callouts use GitHub’s syntax:
> [!NOTE],> [!TIP],> [!IMPORTANT],> [!WARNING].
Functions List
Functions List is generated from the headers of the public functions in addons/api:
python3 docs/tools/document_functions.py api --output docs/src/frameworks/functions-list.md
The docs workflow regenerates it on every build. --debug (as CI runs it) only checks the headers.
Tips and Tricks
This page lists various development methods for easier testing and debugging.
Arma 3
Signal
Reference Radio Signal Debugging page.
Extensions
Voice
Local voice server
A local multiplayer host hosts voice like a dedicated server does: set Public address to 127.0.0.1. To test without Arma, run cargo run -p acre2_voice_server -- -c voice/server/acre2_voice_server.example.toml in rust/ and join it with cargo run -p acre2_voice_testkit --features devices --bin acre2_voice_cli -- talk … (see rust/README.md).
Logs
The voice extension logs to %LOCALAPPDATA%\Arma 3\yard_ext.log (set YARD_LOG=debug for more).
Credits
YARD is built on ACRE2, created and maintained by the ACRE2 Team at IDI-Systems, and on the work of everyone who contributed to it: radios, signal simulation, intercoms, racks, babel, translations, Creator DLC compatibilities and documentation. Most of what’s in YARD, and most of this documentation, is theirs. The list of contributors includes ACRE2’s history.
YARD itself (the built-in voice, the Rust extension and these docs) is by the YARD Team.
YARD is not affiliated with or endorsed by the ACRE2 Team or IDI-Systems.
Licence
YARD is licensed under the GNU General Public License v3, as ACRE2 is. Some folders contain their own LICENSE file for items licensed differently.
Libraries
The extension uses, among others: arma-rs, quinn (QUIC), rustls, Opus, nnnoiseless (RNNoise), cpal and tokio. The Longley-Rice model is a port of the public-domain NTIA Irregular Terrain Model.