Upgrades
| Flag: | Upgrades |
| File(s): | Rules(md).ini |
| Values: | unsigned integers |
| Default: | 0 |
| Applicable to: | BuildingTypes |
This flag specifies the number of upgrades this BuildingType can accept.
Tutorial
If you have ever played Tiberian Sun, you should remember the upgrade system that GDI had. Upgrades are buildable animations placed on top of buildings that provide additional features such as extra power or different weapons. Although not used, this system also works in RA2 and YR.
This is an example of the basic statements that Complete Upgrade System needs to have. ;Rules(md).ini [Animations] ...= ...(List all the animations you have used.) ;Rules(md).ini [PARENT_BUILDING] Image=... Upgrades=... [UPGRADE_BUILDING] PowersUpBuilding=PARENT_BUILDING PowersUpToLevel=... ; Art(md).ini [PARENT_BUILDING] PowerUpXAnim=... PowerUpXDamagedAnim=... PowerUpXLocXX=... PowerUpXLocYY=... PowerUpXLocZZ=... PowerUpXYSort=...
Actually, PowerUpXAnim=... is not used, correspondingly, the Image=... in Rules(md).ini setting of the Parent BuildingType will be added to the animation on the Parent BuildingType, after the Upgrade BuildingType is built. However no harm can be done by listing them manually.
Flag List
What Upgrades CAN Have or Do
Upgrade is more like the override of specific building properties, rather than the actual buildings. Therefore, only certain flags can take effect. However, there are still some things that are "added" rather than "overridden".
- SuperWeapon - Add
- SuperWeapon2 - Add
- Power - Add
- Primary - Override
- Secondary - Override
- WeaponX - Override
In addition, the flags related to the construction can also function normally. For example, TechLevel, AIBasePlanningSide, Prerequisite......
What Upgrades CANNOT Have or Do
- BuildLimit
- Credit production/drain
- Radar
- SpySat
- GapGenerator/GapRadiusInCells
- CloakGenerator/CloakRadiusInCells
- Sensors/SensorArray/SensorsSight
- DetectDisguise/DetectDisguiseRange
- PsychicDetectionRadius
- HasRadialIndicator/ConcentricRadialIndicator
- PowersUnit
- Upgrades cannot add to (or take away from) the Sight of their parent structure.
- Upgrades cannot add to (or take away from) the DebrisAnims list of their parent structure.
- Alter, add to, or take away from the Explosion, Explodes statement and DeathWeapon of their parent structure.
- Alter, add to, or take away from the maximum Strength of the parent structure.
- However, if a structure is upgraded, regardless of its maximum Strength, current Strength and the Strength of the upgrade structure, its' current Strength will be set to its maximum Strength. In effect, this means that upgrades do not require a Strength value at all, as they cannot be independently damaged anyway.
- Alter the Armor of its' parent structure.
- Likewise, upgrades cannot override the ImmuneTo* statements on their parent structure.
- Override the Crew statement of the parent structure.
- Using Ares, upgrades cannot add to, take away from, or alter in any way, the Survivors listing, TechnicianChance and EngineerChance settings.
- RevealToAll
- UnitReload
- UnitRepair
- Helipad
- Factory
- UnitsGainSelfHeal
- InfantryGainSelfHeal
- Gate+DeployTime+GateCloseDelay
- FreeUnit
- LightVisibility
- LightIntensity
- LightRedTint
- LightGreenTint
- LightBlueTint
- BridgeRepairHut
- CanC4
- ProduceCashStartup
- ProduceCashAmount
- ProduceCashDelay
- SecretLab
- AlphaImage
- DeploysInto
- UndeploysInto
- AirRangeBonus
- CanDisguise
- PermaDisguise
- DisguiseWhenStill
- Immune
- ImmuneToPsionics
- ImmuneToPoison
- ImmuneToRadiation
- ImmuneToPsionicWeapons
- Bombable
- Parasiteable
- Unnatural
- PipScale
- Ammo
- PipWrap
- InitialAmmo
- RadialFireSegments
- Reload
- EmptyReload
- ReloadIncrement
Weapon Overrides
Normal Setting(Only One Upgrade)
Upgrade BuildingType will change most of the weapon settings in the Parent BuildingType. When the Parent BuildingType uses normal weapon settings(Primary and Secondary), BuildingType must follow the following rules to enable it to fire normally after being placed.
- Both Primary and Secondary must be set as valid weapons, otherwise they will not be able to actually fire. Even if Secondary=none.
Meanwhile, you should pay attention to this information to better debug your Upgrade BuildingType.
- When Primary and Secondary do not point to the same weapon, ROF will be ignored. Both weapons will fire at an extremely fast frequency. On the contrary, follow ROF normally.
- Attack Targeting Rules is always determined by the primary, including but not limited to Range and Verses, AG...... But specifically, when Primary has AA=no and Secondary has AA=yes, it will select ground targets with the settings of Primary and select air targets with the settings of Secondary.
- Primary and Secondary must fire simultaneously and attack the same target at the same time. This means that regardless of Verses, Range, or AA, as long as one of them can fire, the other will also attack together, although theoretically it should not do so. Please refer to the previous section for attack rules. This may be one of the factors leading to the ROF issues, but even though both weapons have the same ROF, it still cannot be solved.
Gattling System(Only One Upgrade)
When Gattling Weapon System is used in the Parent BuildingType, Upgrades BuildingType can perform limited overrides on the weapon system under correct settings if If you specify the WeaponX for its weapons. In addition, all flags will be determined by Weapon1. Meanwhile, in this situation, the weapons at the same stage should also follow the normal rules of Upgrade BuildingType to ensure that they can fire normally. Weapon1 and Primary, Weapon2 and Secondary are basically the same. The stage timer, number of weapons and other settings are all determined by the Parent BuildingType.
- What The New Weapon Stage Of Upgrade BuildingType CAN Override
This is an example of the basic statements that Upgrade BuildingType needs to have. [Upgrades_Building] ....... TurretCount= WeaponCount= Weapon1= Weapon2= Weapon3= Weapon4= .......
Spawner
Upgrade BuildingType can enable the Spawn Settings on the Parent BuildingType using the weapon with Spawner=yes.
AI Build This
In Tiberium Sun, AIBuildThis works normally. The Upgrade BuildingTypes of Upgrade Center are built in this way. As well as IsBaseDefense, Component Tower works in this way.
In Yuri's Revenge, add Upgrade BuildingType to the Base Defense BuildingType (AlliedBaseDefenses, SovietBaseDefenses, ThirdBaseDefenses) so that AI can normally build them under appropriate conditions. This is seen as a more convenient way. But during testing, it appears that AntiInfantryValue, AntiArmorValue, and AntiAirValue are not effective.
Known Upgrade Problems
- Upgrades can not add/override the DeploysInto/UndeploysInto= on their parent building.
- Upgrades can not give the player ability to build new unit(s). If you attempt to do so, each building built after the plugin causes the new unit(s) to disappear from the sidebar, making them unbuildable again.
- The AuxBuilding superweapon logic does not work when upgrades are involved: Upgrade BuildingType will ignore AuxBuilding and add super weapons; When Upgrade BuildingTyoe is the key value of AuxBuilding, this condition will never be met.
- Although unused in the vanilla games, the flags PowerUp#DamagedAnim are listed in art(md).ini – albeit with a spelling error. The last two words of the flags are switched around: e.g. they are listed as PowerUp#AnimDamaged while the correct format is PowerUp#DamagedAnim. The flags themselves, when typed in correctly, work as expected.
- Normally, An Upgraded BuildingType cannot select units that do not meet the attack rules as the first target for attack. But when the Upgraded BuildingType fires and then commands it to switch attack target, it can ignore the attack rules and attack any unit.