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

IsTrain

From ModEnc
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: IsTrain
File(s): rules(md).ini
Values: Boolean values: yes or no, true or false, 1 or 0
Default: no
Applicable to: TechnoTypes:

AircraftTypes, BuildingTypes, InfantryTypes and VehicleTypes



Determines whether or not this VehicleType should be considered a train.

Notes

This causes a unit to have several special behaviours in order to act like a train:

  • It causes the unit to be immune to capture by a VehicleThief type unit as player control can cause the unit to do things that break the illusion of train like behavior.
    • Note that improperly setting up target waypoints for train movements does the same, see fooage below.
  • It also prevents the unit from turning a full 180° and face backwards like normal vehicles. This prevents it from turning back on itself as normal units can but as a real train could not.
    • Note that train locomotives, if MovementRestrictedTo is either undefined or the valid LandType is placed appropriately, can turn 135° at maximum without needing to actually move (135° is almost a 180° turn but lacking just one more 45° increment for a 180°).
      • For ground units, this will make them ignore commands to move to the grid position behind themselves, including those with Locomotor=Walk. However, for Tunnel[1], Jumpjet, and Fly, they are not constrained by this. For more locomotors, see .
  • IsTrain also has the effect of causing any unit or building, in a cell the IsTrain unit is moving into to be destroyed using the warhead specified by [CombatDamage]C4Warhead=. The unit's pathfinding sometime will ignore buildings in the way to its destination and simply move into them, including buildings owned by the same player, though it will not do so consistently, nor will the buildings the train locomotive moves into be destroyed consistently.
    1. IsTrain causes crush to have a hardcoded minimum interval[2].
      • As a result, when a large number of units with IsTrain=yes move together, although they will crush each other and be destroyed, a small number will still manage to escape unscathed.
    2. Each time IsTrain crushes, it inflicts hardcoded 10,000[3] damage on the target and inflicts hardcoded 20 damage upon itself[4].
    3. If the crushed object is an OverlayType (e.g., wall), the vehicle will pass directly through it without any effect, unless MovementZone=CrusherAll is additionally set.
    4. If the crushed object is a TerrainType (e.g., tree), the vehicle will pass through and cause damage to itself as usual, but the terrain types remain physically present at their original location.
      • This differs from regular crush behavior which successfully destroys objects, though their images may linger until the screen is refreshed.
  • This flag also determines what units leave a crate when destroyed if [Basic]TrainCrate=yes in a map file. The train logic works best when the unit is restricted to a specific terrain type that is laid in one cell "Tracks" for the unit to follow using MovementRestrictedTo. The terrain type most commonly used for this is RailRoad and is placed using a dedicated overlay set or terrain tiles.
  • IsTrain units are unable to perform Scatter moves on their own; might be a deal-breaker for those who want a special "crush everything" unit that ignores OmniCrushResistant=yes.

Bugs/Side-Effects/Unexpected Limitations

Locomotor={4A582742-9839-11d1-B709-00A024DDAFD1} (Hover) should not be used on such Vehicles unless they're on a straight line.

  • Hovering train locomotives and compartments will stop at each corner to rotate, which eventually leads to bigger and bigger gaps within the train.

As mentioned earlier, the effect of 135° on units using different Locomotors varies. The specific effect of IsTrain does not depend on the Type to which the unit belongs, but on the Locomotor used by the unit. Most ground locomotives are similar to Drive. However, if the unit uses one of the three Locomotors: Walk, Mech, or Hover, it will not pathfind correctly and will treat buildings on the path as obstacles, attempting to destroy them to pass through.

Footnotes

  1. For vehicles that move short distances and actually use Drive as their locomotor, they are obviously not included in this.
  2. However, for the infantry that this unit runs over, it often ensures that they will meet God with 100% certainty.
  3. Due to the previous characteristic, if the unit's movement speed is slow enough, it is still possible to cause 2 (or more) instances of damage to the same object.
  4. The values here are not affected by [CombatDamage]MaxDamage= and the Verses parameters of C4Warhead, etc.

References

Starting from Phobos Build#45, you can use a new feature to make a building be treated as a pathfinding obstacle by units with IsTrain=no, and they will attempt to destroy it to pass through. Refer to Phobos documentation.

This is footage of how trains behave in YR+Ares DLL 3.0; it also shows how the illusion of train-behaviour can be broken by either modder when placing waypoints inappropriately with the map editor or player-control.

Search YouTube for "Trains | C&C Dune mod". https://www.youtube.com/watch?v=2XCoss_YMs4

See Also