Jump to content

PowersUnit: Difference between revisions

From ModEnc²
en>Nighthawk200
Updated with DCoder's info.
en>DCoder
Rewriting with exe info
Line 1: Line 1:
{{flag
{{flag
|name={{PAGENAME}}
|files={{categ|ini=rules}}
|files=rulesmd.ini
|values={{values|strings|VehicleTypes}}
|values={{values|strings|VehicleType IDs}}
|types={{Categ|Technoes}}
|types=[[BuildingTypes]]
|yr=yes
|yr=yes
|rp=yes}}<br />
|rp=yes}}
Specifies the unit that this BuildingType powers. At least one of these structures must be present or else the specified units deactivate. This can only accept one unit, any more causes errors.<br />
 
(Yuri's Revenge Only)
<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.

Revision as of 19:40, 10 June 2008

Tiberian Dawn Red Alert Tiberian Sun Firestorm Red Alert 2 Yuri's Revenge
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.