Jump to content

Disguise Logic: Difference between revisions

From ModEnc²
ATHSE (talk | contribs)
No edit summary
Rain-Islet (talk | contribs)
m [bot] Batch update {{Bugs}} templates.
 
(29 intermediate revisions by 2 users not shown)
Line 18: Line 18:


== Infantry Disguises (RA2 & YR) ==
== Infantry Disguises (RA2 & YR) ==
By default, InfantryType with PermaDisguise=yes and CanDisguise=yes can automatically disguise as enemy basic infantries if its [[MakeUpKit]] weapon is not used, which is the case when there is no enemy InfantryTypes on the map. In vanilla game this is applied to vanilla Allied Spy and blinks to original image only to the owner.
By default, infantry with PermaDisguise=yes and CanDisguise=yes can automatically disguise as more basic [[InfantryTypes]] without a [[MakeUpKit]] weapon. In game this is applied to vanilla Allied Spy, but not to the Cuban Terrorist, so that enemies can't tell which unit is a spy even before a disguise is chosen, although enemies are still warned by the [[CreateSound]] on the Spy unless removed.  
 
The automatic disguise of said Infantry is automatically assigned to Owner unit, and utilized when a faction outside of Allied side captured their Barrack whilst having their Battle Lab in the vanilla game. The disguises are as follow:


The automatic disguise lists are as follow:
# [[AlliedDisguise|AlliedDisguise=]] will show enemies the specified unit as an Allied player
# [[AlliedDisguise|AlliedDisguise=]] will show enemies the specified unit as an Allied player
# [[SovietDisguise|SovietDisguise=]] will show enemies the specified unit as a Soviet player
# [[SovietDisguise|SovietDisguise=]] will show enemies the specified unit as a Soviet player
# [[ThirdDisguise|ThirdDisguise=]] (YR only) will show enemies the specified unit as a Yuri Country player
# [[ThirdDisguise|ThirdDisguise=]] (YR only) will show enemies the specified unit as a Yuri Country player
If a disguise is acquired on enemy unit, enemy combat units and structures will ignore them until manually ordered so by the enemy player. Unless those enemy TechnoTypes have {{f|DetectDisguise|yes|link}}, then they can automatically target/attack them as normal. In vanilla RA2/YR, any Attack Dogs and Yuri Clones can detect disguised units. DetectDisguise is not functional in {{ts}}. The [[House]] color (remap) of the newly disguised infantry will be that of the target infantry the disguise was taken from.
* To periodically remind the player/owner of their units disguised status, the original image will briefly appear before reverting to its disguise.


== Vehicle Disguises (RA2 & YR) ==
== Vehicle Disguises (RA2 & YR) ==
The only disguising vehicle in the unmodded game is the Mirage Tank. This kind of disguise requires {{f|CanDisguise|yes|link}}, but not {{f|PermaDisguise|yes|link}}. Also, the vehicle that uses it should not have a [[turret]] or a [[barrel]] as the disguising logic can't turn several [[voxel]]s into a single [[shp]], so it'll end up with multiple trees - one for vehicle body, drawn at ground level, one for [[turret]], drawn on top of the first one, and optionally one for barrel.
The only disguising vehicle added in RA2/YR is the Mirage Tank, and it operates entirely differently to the infantry described above. This kind of disguise requires {{f|CanDisguise|yes|link}}, but not {{f|PermaDisguise|yes|link}}, since it cycles through a list of [[DefaultMirageDisguises]] values. This means on any given map, the same trees by default are chosen for the effect. A map author will wisely consider what trees are used on their map, and set the available disguise trees manually to match, inside the map code, thereby giving Mirage Tanks the best chance of concealment.


Note: Ares fixed that. Mirage Tank can now retain their core functionality whilst having Turret and Barrel [[https://ares-developers.github.io/Ares-docs/bugfixes/type2/miragelogicwithturretsbarrels.html| Mirage logic with Turrets/Barrels]]
If you want to let vehicles pick their own disguises, you once again need a [[warhead]] with {{f|MakesDisguise|yes|link}}, but since the Mirage Tank uses [[TerrainTypes|terrain objects]] instead of infantry as disguise, you will also want to add {{f|TerrainFire|yes|link}} to the weapon, which makes the vehicle able to target trees and other terrain objects without having to use force-fire.


If you want to let vehicles pick their own disguises, you once again need a [[warhead]] with {{f|MakesDisguise|yes|link}}, but since the Mirage Tank uses [[TerrainTypes|terrain objects]] instead of infantry as disguise, you will also want to add {{f|TerrainFire|yes|link}} to the weapon, which makes the vehicle able to target trees and other terrain objects without having to use force-fire.
Modders can make Mirage Tanks able to pick their tree disguise by making trees targetable using {{f|TreeTargeting|yes|link}}. Keep in mind the effect of this tag works differently in YR compared to base RA2.
 
* To periodically remind the player/owner of their units disguised status, the original image will briefly appear before reverting to its disguise. Unlike disguised infantry, disguised vehicles like the Mirage Tank will drop their disguise when firing, revealing their location.
 
=={{Bugs}}==
Disguising units cannot disguise as other voxel units ie. [[VehicleTypes]].  


{{f|AlliedDisguise|link}}, {{f|SovietDisguise|link}}, and {{f|ThirdDisguise|link}} (YR only) tags define which infantry the units with {{f|PermaDisguise|yes|link}} look as when the owner hasn't disguised them yet, for each side respectively.
Giving a vehicle {{f|PermaDisguise|yes|link}}, it will use the <tt>Allied/Soviet/ThirdDisguise</tt> instead of {{f|DefaultMirageDisguises|link}}, and end up looking like infantry with nasty side-effects!


{{f|DefaultMirageDisguises|link}} defines a list of terrain objects that a {{f|CanDisguise|yes|link}} unit ''without'' {{f|PermaDisguise|yes|link}} will try to look like when it doesn't have a custom disguise.
Disguising units like the Mirage Tank can't have a turret and/or barrel by default, graphical glitches will result. Each individual voxel that's part of the unit will be disguised separately, and appear as multiple trees drawn over top of each other.
* Fixed in Ares: https://ares-developers.github.io/Ares-docs/bugfixes/type2/miragelogicwithturretsbarrels.html


So if you give a vehicle {{f|PermaDisguise|yes|link}}, it will look stupid - it will use the <tt>Allied/Soviet/ThirdDisguise</tt> instead of {{f|DefaultMirageDisguises|link}}, end up looking like an infantry, and because SHP vehicles (SHP is the only way infantry can look like) use a different method to reference proper art frames, you'll see a GI with his gun spinning around as the tank moves (the game then sets {{f|WalkFrames|1|link}} and uses the first frames of the infantry SHP as it's walking animation).
If adding more [[Sides]] to a mod, those countries will be lacking the default disguise lists.
* Ares can add new default lists for those sides: https://ares-developers.github.io/Ares-docs/new/sidescountries/defaultside.html?highlight=disguise


Note #2: It is remain unknown if Vehicles can take an image of another VehicleType as disguise. If you see the note on Bugs in original ModENC that said otherwise. Take it with a grain of salt.
Infantry able to disguise draw from the same default lists normally, there is no per-unit customization.
* Phobos allows each infantry to have their own disguise list: https://phobos.readthedocs.io/en/latest/New-or-Enhanced-Logics.html#default-disguise-for-individual-infantrytypes


[[Category:RA2/YR Tutorials]]
[[Category:RA2/YR Tutorials]]

Latest revision as of 17:20, 2 July 2025

Tiberian Dawn Red Alert Tiberian Sun Firestorm Red Alert 2 Yuri's Revenge
Flag: Disguise Logic
File(s): Rules(md).ini
Values: Strings (names of InfantryTypes)
Default: none
Applicable to: General


The Disguise mechanic has been around since Red Alert for the Allied spy, and persists right through to Yuri's Revenge.

The summary below will focus on YR functionality as it is more extensive.

Infantry Disguises (RA2 & YR)

By default, infantry with PermaDisguise=yes and CanDisguise=yes can automatically disguise as more basic InfantryTypes without a MakeUpKit weapon. In game this is applied to vanilla Allied Spy, but not to the Cuban Terrorist, so that enemies can't tell which unit is a spy even before a disguise is chosen, although enemies are still warned by the CreateSound on the Spy unless removed.

The automatic disguise lists are as follow:

  1. AlliedDisguise= will show enemies the specified unit as an Allied player
  2. SovietDisguise= will show enemies the specified unit as a Soviet player
  3. ThirdDisguise= (YR only) will show enemies the specified unit as a Yuri Country player

If a disguise is acquired on enemy unit, enemy combat units and structures will ignore them until manually ordered so by the enemy player. Unless those enemy TechnoTypes have DetectDisguise=yes, then they can automatically target/attack them as normal. In vanilla RA2/YR, any Attack Dogs and Yuri Clones can detect disguised units. DetectDisguise is not functional in Tiberian Sun. The House color (remap) of the newly disguised infantry will be that of the target infantry the disguise was taken from.

  • To periodically remind the player/owner of their units disguised status, the original image will briefly appear before reverting to its disguise.

Vehicle Disguises (RA2 & YR)

The only disguising vehicle added in RA2/YR is the Mirage Tank, and it operates entirely differently to the infantry described above. This kind of disguise requires CanDisguise=yes, but not PermaDisguise=yes, since it cycles through a list of DefaultMirageDisguises values. This means on any given map, the same trees by default are chosen for the effect. A map author will wisely consider what trees are used on their map, and set the available disguise trees manually to match, inside the map code, thereby giving Mirage Tanks the best chance of concealment.

If you want to let vehicles pick their own disguises, you once again need a warhead with MakesDisguise=yes, but since the Mirage Tank uses terrain objects instead of infantry as disguise, you will also want to add TerrainFire=yes to the weapon, which makes the vehicle able to target trees and other terrain objects without having to use force-fire.

Modders can make Mirage Tanks able to pick their tree disguise by making trees targetable using TreeTargeting=yes. Keep in mind the effect of this tag works differently in YR compared to base RA2.

  • To periodically remind the player/owner of their units disguised status, the original image will briefly appear before reverting to its disguise. Unlike disguised infantry, disguised vehicles like the Mirage Tank will drop their disguise when firing, revealing their location.

Bugs/Side-Effects/Unexpected Limitations

Disguising units cannot disguise as other voxel units ie. VehicleTypes.

Giving a vehicle PermaDisguise=yes, it will use the Allied/Soviet/ThirdDisguise instead of DefaultMirageDisguises, and end up looking like infantry with nasty side-effects!

Disguising units like the Mirage Tank can't have a turret and/or barrel by default, graphical glitches will result. Each individual voxel that's part of the unit will be disguised separately, and appear as multiple trees drawn over top of each other.

If adding more Sides to a mod, those countries will be lacking the default disguise lists.

Infantry able to disguise draw from the same default lists normally, there is no per-unit customization.