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

Difference between revisions of "IsTrain"

From ModEnc
Jump to: navigation, search
(Updated with new Template)
 
(5 intermediate revisions by 3 users not shown)
Line 14: Line 14:
 
|yr=yes
 
|yr=yes
 
|rp=yes
 
|rp=yes
}}
+
}}<br />
{{DeeZireInclusion}}<br />
+
Can be set to 'yes' or 'no' and determines whether or not this VehicleType should be considered a train.
Can be set to 'yes' or 'no' and determines whether or not this VehicleType should be considered a Train which is residual from Tiberian Sun. This forms a special case only for units with the drive Locomotor= and setting this to 'yes' forces the unit to move and remain only on an OverlayType with Land=Railroad set and use the rules for 'tracked' movement rather than 'wheeled'. Setting the TrainCrate= flag to 'yes' in your map file will also result in this unit leaving a crate when it is destroyed. This also prevents the unit from 'turning' to move in a new direction - it will move in the direction faced, along the track, until it reaches it's new designated destination, provided it is on an overlay tile which has Land=Railroad set. NOTE: use of this tag on a standard VehicleType renders the unit able to instantly destroy any other object it comes into contact with - this property is residual from Tiberian Sun where trains would destroy anything that got in their path when driving on a railroad - the result is however that the unit invariably destroys the Factory= from which it is produced.
+
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 [[LandTypes|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 [[C4Warhead]], with the exception of other units which have IsTrain set: a unit set to IsTrain may move into the same cell as another unit set to IsTrain, and both units can occupy the same cell at the same time. The unit's pathfinding 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. The train locomotive doesn't get destroyed as a result, though it may be damaged.
 +
* This flag also determines what units leave a crate when destroyed if [[TrainCrate]] flag is set to '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 {{f|OmniCrushResistant|yes|link}}.
 +
 
 +
==Notes==
 +
* The effect of setting IsTrain on ObjectTypes which are not VehicleTypes is not researched.
 +
* The effect of ObjectTypes with IsTrain on OverlayTypes is not researched, but it appears that IsTrain cannot destroy OverlayTypes (e.g. walls).
 +
* Hover [[Locomotor]] 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

Latest revision as of 11:08, 4 May 2021

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: Booleans
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 C4Warhead, with the exception of other units which have IsTrain set: a unit set to IsTrain may move into the same cell as another unit set to IsTrain, and both units can occupy the same cell at the same time. The unit's pathfinding 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. The train locomotive doesn't get destroyed as a result, though it may be damaged.
  • This flag also determines what units leave a crate when destroyed if TrainCrate flag is set to '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 ObjectTypes which are not VehicleTypes is not researched.
  • The effect of ObjectTypes with IsTrain on OverlayTypes is not researched, but it appears that IsTrain cannot destroy OverlayTypes (e.g. walls).
  • Hover Locomotor 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