ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

NavalTargeting

From ModEnc
Revision as of 00:05, 13 October 2024 by Testid123 (talk | contribs)
Jump to navigation Jump to search
Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: NavalTargeting
File(s): rules(md).ini
Values: Unsigned integers: All non-negative whole numbers from 0 to either 32767, 2147483647 or 4294967295. (Limited to: 0 to 7)
Default: 0
Applicable to: TechnoTypes:

AircraftTypes, BuildingTypes, InfantryTypes and VehicleTypes



This flag determines whether an object can fire on naval units (as opposed to land units) or not. It has several more options to choose from than LandTargeting, and YR expanded it by one more, adding the possible restriction to only use the primary weapon on naval targets.

This flag, along with LandTargeting, was likely introduced because technically, ships are ground-level units as well, and a simple AG=yes would have does allow Submarines, for example, to fire torpedoes through the water, over the ground, into a tank. This, of course, is not desired. Therefore, the additional target area distinction between "Land" and "Naval" was created. The originally intended AN and AS were probably dismissed because they were not "complex" enough, allowing only a simple "Can fire on submarines? Yes." rather than something like "Can fire on submarines? Yes, but only with it's Secondary.".


The logic only operating when the target is on cell which LandType=Water or Beach.
And actually executed after LandTargeting.
(although not conflicting)


Value Basic game interpretation Explanation from rules The Real Effect
0 UNDERWATER_NEVER Can't shoot at all at underwater Cannot attack UNDERWATER which have not been released from cloaking.
Normally for other.
1 UNDERWATER_SECONDARY Use Second weapon against underwater ← is real, and normally for other.
2 UNDERWATER_ONLY Can only shoot underwater Only Use Primary
NoWeapon for other.
3 ORGANIC_SECONDARY Use second Weapon on organic ← and UNNATURAL([SQD] hit [BSUB] in YR).
Use Primary for other
4 SEAL_SPECIAL Primary on Amphibious and organic, Second on Naval and underwater-not-organic Use Primary for ORGANIC and HOVER
Use Secondary for other.³
5 NAVAL_ALL Go ahead and shoot everything with Primary¹ ← is real
6 NAVAL_NONE Don't even shoot into the water ← is real
7 NAVAL_PRIMARY Able to shoot ground target with secondary weapon, but Naval is the primary target² ← It's completely nonsense!
In fact, after a huge number of tests, it is really no different from 5.
We even extracted the working mode from gamemd.idb.
Whether not actively attacking targets on land
or using Secondary on targets on land,
they are controlled by LandTargeting=2
instead of NavalTargeting=7 ! ! !


ORGANIC refers to units with Organic=yes set.
HOVER refers to units with SpeedType=Hover set.
UNNATURAL refers to units with Unnatural=yes set.
UNDERWATER refers to units with Underwater=yes set.


¹ Note: According to The Guide, this actually only means that everything with Naval=yes set will be attacked with the primary weapon. That leaves the secondary undocumented. It could mean a boomer, was it set NavalTargeting=5, would shoot torpedos on ships, but fire Cruise Missiles to kill Robot Tanks, Amphibious Transporters and Tanyas in the water. This, however, is pure speculation by this revision's author.
(Confirmed that this issue does not exist)
² Also note that DeeZire mentioned a NavalTargeting=7 unit could get confused if ordered to attack amphibious units.
(However, we never knew exactly what he was going to say)

³Due to the logic only operating when the target is on water and beach, a SpeedType non Hover vehicle will still be attacked with the main weapon on normal land until it moves to the surface and beach before switching to the secondary weapon based on the effect of NavalTargeting=4.

What is the difference between 5 and 7

By analyzing the operation mode of the program, it can be seen that this is actually a multi branch selection structure, but the special value is 012346. Other values are the same, such as -1, 5, 7, 8, etc. Correspondingly, there is no difference between NavalTargeting=5 and 7 in fact. The comment on line 3684 of YR1.001-rulesmd.ini was completely written by Westwood haphazardly, and it also misled many authors of tutorials and editing manuals, which was a mistake that lasted for 24 years in various modification manuals and tutorials. Now we have corrected it correctly.

Primary/Secondary Land/Naval issues

NavalTargeting=1
LandTargeting=2
NavalTargeting=3
LandTargeting=2
NavalTargeting=7
LandTargeting=1
NavalTargeting=4
LandTargeting=2

This section is just ment to show that Naval- & LandTargeting aren't mutually exclusive, and can confuse the hell out of you as well as the game. Apart from the usual checks, you should watch them double closely if you're doing any extended Primary/Secondary magic.

Bug? I think this should be called a 'feature' :P

For a Vehicle that uses a SpawnLauncher as Secondary (such as [DEST]), if it simultaneously sets NavalTargeting=5 (or 7, it's the same, and the actual testing and inspection are indeed the same.) and LandTargeting=2, then as long as the carrier based aircraft is launched once, even if it switches to using Primary for fire, the SpawnLauncher will continue to load and issue attack commands to the carrier based aircraft.

Bugs/Side-Effects/Unexpected Limitations

  • This feature only used for carrier based aircraft as Spawns, not applicable to missiles.
  • Even if you specify NavalTargeting=x (x must not use 6 because 6 does not allow attacks into water) but attacksInfantryTypes andVehicleTypes will give different results.
    Even if you create InfantryTypes and VehicleTypes to be the same (all information is the same).
  • When Giant Squid uses NavalTargeting=4, it will attack Dolphin+InfantryTypes with Primary+ElitePrimary(Even the Unnatural=yes tag couldn't prevent Giant Squid's attack in capture form)
    and attack ships. Amphibious vehicles (Hover) + boats + submarines + structures in the water with Secondary, EliteSecondary As for Giant Squid, they cannot attack each other.

See also

LandTargeting
AA
AG
Overcoming_Paratrooper_Targeting_Issues
SpeedType
Organic
Unnatural
Underwater
Primary
Secondary
Spawner
Spawns