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

PowersUnit: Difference between revisions

From ModEnc
Jump to navigation Jump to search
No edit summary
 
Bbglas007 (talk | contribs)
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DeeZireInclusion}}<br />
{{flag
Specifies the unit that this BuildingType powers. At least one of these structures must be present or else the specified units deactivate.<br />
|files={{categ|ini=rules}}
(Yuri's Revenge Only)
|values={{values|strings|VehicleTypes}}
|types={{Categ|Technoes}}
|yr=yes
|rp=yes}}
 
<br>
{{HorizontalBar|Although all TechnoTypes parse this flag, it only has the expected effect when applied to BuildingTypes.}}
 
Specifies a unit that is "powered" by the presence of this object. All instances of the specified VehicleType owned by HouseX will be deactivated whenever HouseX has no powered instances of this BuildingType.
 
{{SourceCode|http://dc.strategy-x.com/src2/HouseClass/GotPoweredCenter.cpp}}
{{SourceCode|http://dc.strategy-x.com/src2/HouseClass/LostPoweredCenter.cpp}} <!-- template needs extending -->
 
{{Automatictypelist|VehicleTypes|VehicleTypes}}
 
<br>{{W}}Although all TechnoTypes parse this flag, it only has the expected effect when applied to BuildingTypes. Applying it to other TechnoTypes will only parse the flag and append the VehicleTypes array if necessary.
 
{{Bugs}}
The logic only works properly when one house owns only one BuildingType with this function. When a house owns several different BuildingTypes, problems will ensue - only one of them will deactivate and reactivate the powered units correctly. When multiple powered units are owned by one house, the very last powered center to shutdown/die will turn off its own powered units. The very first one constructed after that will reactivate its own powered units.
Units powered by other powered centers that are explicitly specified as {{f|PoweredUnit|yes|link}} will be deactivated when they try to move and the powering building is not present, but not reactivated. Units that do not have said flag will remain oblivious to the fact their control structure is not present and remain functional (assuming their control center wasn't the very last one to shut down, see above).
 
IE; (You must sacrifice the robot tanks logic to use this on another unit instead).

Latest revision as of 03:03, 19 July 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: PowersUnit
File(s): rules(md).ini
Values: Strings: Normal text. (Limited to: VehicleTypes)
Applicable to: TechnoTypes:

AircraftTypes, BuildingTypes, InfantryTypes and VehicleTypes




Although all TechnoTypes parse this flag, it only has the expected effect when applied to BuildingTypes.

Specifies a unit that is "powered" by the presence of this object. All instances of the specified VehicleType owned by HouseX will be deactivated whenever HouseX has no powered instances of this BuildingType.

Relevant pseudocode is available at http://dc.strategy-x.com/src2/HouseClass/GotPoweredCenter.cpp. Relevant pseudocode is available at http://dc.strategy-x.com/src2/HouseClass/LostPoweredCenter.cpp.

Automatic List Inclusion

VehicleTypes used as values for this flag are automatically listed under the internal [VehicleTypes] array. However no harm can be done by listing them manually.


Although all TechnoTypes parse this flag, it only has the expected effect when applied to BuildingTypes. Applying it to other TechnoTypes will only parse the flag and append the VehicleTypes array if necessary.

Bugs/Side-Effects/Unexpected Limitations

The logic only works properly when one house owns only one BuildingType with this function. When a house owns several different BuildingTypes, problems will ensue - only one of them will deactivate and reactivate the powered units correctly. When multiple powered units are owned by one house, the very last powered center to shutdown/die will turn off its own powered units. The very first one constructed after that will reactivate its own powered units. Units powered by other powered centers that are explicitly specified as PoweredUnit=yes will be deactivated when they try to move and the powering building is not present, but not reactivated. Units that do not have said flag will remain oblivious to the fact their control structure is not present and remain functional (assuming their control center wasn't the very last one to shut down, see above).

IE; (You must sacrifice the robot tanks logic to use this on another unit instead).