ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.
IsTrain
Jump to navigation
Jump to search
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Flag: | IsTrain |
File(s): | rules(md).ini |
Values: | Boolean values: yes or no, true or false, 1 or 0 |
Default: | no |
Applicable to: | VehicleTypes |
Can be set to 'yes' or 'no' and determines whether or not this VehicleType should be considered a train. 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°).
- 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.
- IsTrain causes crush to have a hardcoded minimum interval.
- 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.
- Each time IsTrain crushes, it inflicts 20 hardcoded damage upon itself.
- If the crushed object is an OverlayType (e.g., wall), the vehicle will pass directly through it without any effect, unless OmniCrushResistant=yes is additionally set.
- 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.
- IsTrain causes crush to have a hardcoded minimum interval.
- 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.
Notes
- The effect of setting IsTrain on TechnoTypes which are not VehicleTypes is not researched.
- 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.
Footage
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