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

NavalTargeting: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Vinifera7 (talk | contribs)
m Testing new values limitations =D
Testid123 (talk | contribs)
mNo edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 10: Line 10:


This flag, along with <tt>LandTargeting</tt>, was likely introduced because technically, ships are ground-level units as well, and a simple AG=yes <strike>would have</strike> 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 <tt>AN</tt> and <tt>AS</tt> 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.".
This flag, along with <tt>LandTargeting</tt>, was likely introduced because technically, ships are ground-level units as well, and a simple AG=yes <strike>would have</strike> 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 <tt>AN</tt> and <tt>AS</tt> 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.".
 
<br><br><br>
 
<font style="color:red">The logic only operating when the target is on cell which '''LandType=Water''' or '''Beach'''.<br>
And actually executed after [[LandTargeting]].</font>(although not conflicting)
<br><br><br>
{| align="center" cellpadding="4" class="table_descrowdesccol"
{| align="center" cellpadding="4" class="table_descrowdesccol"
!Value
!Value
!Basic game interpretation
!Basic game interpretation
!Explanation from rules
!Explanation from rules
!The Real Effect
|-
|-
!0
!0
|UNDERWATER_NEVER
|UNDERWATER_NEVER
|Can't shoot at all at underwater
|Can't shoot at all at underwater
|Cannot attack UNDERWATER which have not been released from cloaking.<br>Normally for other.
|-
|-
!1
!1
|UNDERWATER_SECONDARY
|UNDERWATER_SECONDARY
|Use Second weapon against underwater
|Use Second weapon against underwater
|← is real, and normally for other.
|-
|-
!2
!2
|UNDERWATER_ONLY
|UNDERWATER_ONLY
|Can only shoot underwater
|Can only shoot underwater
|Only Use [[Primary]]<br>NoWeapon for other.
|-
|-
!3
!3
|ORGANIC_SECONDARY
|ORGANIC_SECONDARY
|Use second Weapon on organic
|Use second Weapon on organic
|← and UNNATURAL([SQD] hit [BSUB] in [[YR]]).<br>Use [[Primary]] for other
|-
|-
!4
!4
|SEAL_SPECIAL
|SEAL_SPECIAL
|Primary on Amphibious and organic, Second on Naval and underwater-not-organic
|Primary on Amphibious and organic, Second on Naval and underwater-not-organic
|Use [[Primary]] for ORGANIC and HOVER<br>Use [[Secondary]] for other.³
|-
|-
!5
!5
|NAVAL_ALL
|NAVAL_ALL
|Go ahead and shoot everything with Primary¹
|Go ahead and shoot everything with Primary¹
|← is real
|-
|-
!6
!6
|NAVAL_NONE
|NAVAL_NONE
|Don't even shoot into the water
|Don't even shoot into the water
|← is real
|-
|-
!7{{yro}}
!7{{yro}}
|NAVAL_PRIMARY
|NAVAL_PRIMARY
|Able to shoot ground target with secondary weapon, but Naval is the primary target²
|Able to shoot ground target with secondary weapon, but Naval is the primary target²
|<font style="color:red">'''← It's completely nonsense!''' </font><br>In fact, after a huge number of tests, it is really no different from 5.<br>We even extracted the working mode from gamemd.idb.<br>Whether not actively attacking targets on land<br>or using [[Secondary]] on targets on land,<br>they are controlled by '''[[LandTargeting]]=2'''<br>instead of '''[[NavalTargeting]]=7'''<b><font style="color:red"> ! ! !</font></b>
|}
|}




'''UNDERWATER_*''' refers to units with <tt>[[Underwater]]=yes</tt> set.<br>
'''ORGANIC''' refers to units with <tt>[[Organic]]=yes</tt> set.<br>
'''ORGANIC_*''' refers to units with <tt>[[Organic]]=yes</tt> set.<br>
'''HOVER''' refers to units with <tt>[[SpeedType]]=Hover</tt> set.<br>
'''NAVAL_*''' refers to units with <tt>[[Naval]]=yes</tt> set.
'''UNNATURAL''' refers to units with <tt>[[Unnatural]]=yes</tt> set.<br>
'''UNDERWATER''' refers to units with <tt>[[Underwater]]=yes</tt> set.<br>
 


¹ <small>'''Note:''' According to [[DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide|The Guide]], this actually only means that everything with <tt>Naval=yes</tt> set will be attacked with the primary weapon. That leaves the secondary undocumented. It ''could'' mean a boomer, was it set <tt>NavalTargeting=5</tt>, 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.</small><br>(Confirmed that this issue does not exist)<br>
² <small>'''Also note''' that [[DeeZire]] mentioned a <tt>NavalTargeting=7</tt> unit could get confused if ordered to attack amphibious units.</small><br>(However, we never knew exactly what he was going to say)<br><br>
³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.


¹ <small>'''Note:''' According to [[DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide|The Guide]], this actually only means that everything with <tt>Naval=yes</tt> set will be attacked with the primary weapon. That leaves the secondary undocumented. It ''could'' mean a boomer, was it set <tt>NavalTargeting=5</tt>, 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.</small><br>
==What is the difference between '''5''' and '''7'''==
² <small>'''Also note''' that [[DeeZire]] mentioned a <tt>NavalTargeting=7</tt> unit could get confused if ordered to attack amphibious units.</small>
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==
==Primary/Secondary Land/Naval issues==
Line 72: Line 88:
  LandTargeting=2
  LandTargeting=2
This section is just ment to show that Naval- &amp; 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.
This section is just ment to show that Naval- &amp; 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, [https://www.bilibili.com/opus/953193697038565393 the SpawnLauncher will continue to load and issue attack commands to the carrier based aircraft.]
{{Bugs}}
*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 attacks[[InfantryTypes]] and[[VehicleTypes ]] will give different results.<br>Even if you create [[InfantryTypes]] and [[VehicleTypes]] to be the same (all information is the same).<br>[[File:NavalTargeting and InfantryTypes+VehicleTypes.gif]]
*When '''Giant Squid''' uses '''NavalTargeting=4''', it will attack '''Dolphin'''+[[InfantryTypes]] with [[Primary]]+[[ElitePrimary]](Even the {{f|Unnatural|yes|link}} tag couldn't prevent '''Giant Squid''''s attack in capture form)<br>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==
==See also==
*[[LandTargeting]]
[[LandTargeting]]<br>
*[[AA]]/[[AG]]'s notes on paratroopers.
[[AA]]<br>
[[AG]]<br>
[[Overcoming_Paratrooper_Targeting_Issues]]<br>
[[SpeedType]]<br>
[[Organic]]<br>
[[Unnatural]]<br>
[[Underwater]]<br>
[[Primary]]<br>
[[Secondary]]<br>
[[Spawner]]<br>
[[Spawns]]<br>

Latest revision as of 00:40, 13 October 2024

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