← Home SEEBIE90 DOCS
The RIM-116 & Phalanx mod is published under the Arma Public License (APL)Example code is free to useSuggestions: Discord to the author

RIM-116 & Phalanx

Chaff and flares

Vanilla Arma Reforger has no infrared system at all – no heat signature, no seeker, no countermeasures. Reacting to another mod's flares without depending on it takes a name filter and two checks that are easy to miss.

In plain wordsFlares pull a missile away, chaff breaks a radar lock. Both come from other mods, and this one reacts to them without requiring them.

There is nothing to hook into

A search across all vanilla scripts for infrared, IRSeeker, heatSignature and ThermalSignature returns nothing. The only “flare” in vanilla is illumination – a light source with a trajectory, not a countermeasure.

So detection checks found entities by their prefab name instead of by class. Without the other mod loaded those entities do not exist and the logic simply runs empty rather than failing to compile. The price: the emitters' heat values cannot be read this way.

Which name you match on is the whole problem

Matching "flare" is wrong. Vanilla has dozens of prefabs with “flare” in the name and none of them is a countermeasure: hand signal flares, grenade-launcher illumination, mortar illumination, parachute flares. With that filter, lighting up the battlefield decoyed the seeker.

Fragment (example)MatchesA real countermeasure?
armament_ammo_flarethe flying decoy of an armament modyes
countermeasurea Weapons/Countermeasures/ folder, and one mod's particle-only effectthe particle is not – no physics, no heat
flare alonedozens of vanilla illumination prefabsno – never use this

Keep the fragments in an attribute, so a mod that names its countermeasures differently needs no code change.

Two checks beyond the name

A name filter alone is never enough, and both failures were silent.

The dispenser is not a decoy

A dispenser sits in the same folder as its ammunition and carries the same name fragments. Without a class check a missile homed on the dispenser – away from the helicopter, onto a part of the same helicopter – and flares were useless. Telling them apart by name is hopeless, because every mod names its dispenser differently. By class it is unambiguous: a released decoy is a Projectile, a mounted dispenser never is.

Example code – free to use
bool MyAD_Seeker_OnCandidate(IEntity ent)
{
	if (!Projectile.Cast(ent))		// a flying decoy is a projectile, its dispenser is not
		return true;

	string name = ent.GetPrefabData().GetPrefabName();

	// ToLower() changes the string IN PLACE and returns nothing - copy first
	string lower = name;
	lower.ToLower();

	if (MatchesHint(lower) && InSeekerCone(ent.GetOrigin()))
		m_Found = ent;

	return true;
}

Loaded ammunition is not a decoy either

The subtle one. In Reforger, ammunition is a Projectile, so a chaff bundle still sitting in its dispenser passes the class test exactly like one in the air – but it hangs on its carrier and is therefore always nearby. In testing, a mount followed a helicopter with its tubes for minutes and never fired, with “chaff jamming” in the log the whole time, while the pilot had thrown nothing. Without the check, every so-equipped aircraft would be permanently immune to radar-guided mounts.

Example code – free to use
bool MyAD_Radar_OnChaffCandidate(IEntity ent)
{
	if (!Projectile.Cast(ent))
		return true;

	// an ejected body stands free in the world; a loaded one hangs as a child on its carrier
	if (ent.GetParent())
		return true;

	...
}
PitfallAn ejected decoy stands FREE in the world; a loaded one hangs as a child on its carrier. The name cannot tell them apart. The hierarchy can.

The search radius decides whether flares are worth anything

A radius that is too small makes flares useless. At missile speed a few hundred metres pass in well under a second – between “decoyed the seeker” in the log and detonation there were tens of milliseconds. The seeker noticed the decoy and hit the target anyway. A radius that leaves the missile about a second to turn away gives the intended shape: late flares are useless, early ones work.

Example code – free to use
// Not every flare works - the susceptibility keeps the countermeasure a chance, not a guarantee.
// Graded by seeker quality: a good seeker tells target and decoy apart better.
float susceptible = Math.Clamp(m_fSusceptibility * (2.0 - m_fSeekerQuality), 0.0, 1.0);

if (Math.RandomFloat01() > susceptible)
	return;

Following the decoy down

Sample the decoy position once on lock and hold it, and the seeker aims at a point in empty air at the helicopter's altitude – because a flare falls, and fast. Follow the burning flare instead. It pulls the missile down and away, which is both the point and what a real infrared seeker does: it follows the brightest source, and that source is sinking. When the flare burns out, the lock falls back onto the real target.

CountermeasureEffect
Flarepulls the seeker away, by chance, scaled by seeker quality
Chaffbreaks the radar lock for a limited time within a radius around the target
Example code on this page is free to use in your own projects (credit appreciated). The RIM-116 & Phalanx mod is published under the Arma Public License (APL). Suggestions: Discord. Arma Reforger / Enfusion are trademarks of Bohemia Interactive.
Impressum · Privacy Policy