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

CanBeOccupied

From ModEnc
Jump to navigation Jump to search
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: CanBeOccupied
File(s): rules(md).ini
Values: Boolean values: yes or no, true or false, 1 or 0
Default: no
Applicable to: BuildingTypes


This flag determines whether or not a building can be garrisoned by infantry controlled by the same player. Buildings owned by the neutral house can be garrisoned by infantry controlled by any player, but never by multiple players at once.

In order for this logic to work as desired, the building will also need MaxNumberOccupants set to a positive integer greater than 0, and CanOccupyFire=yes in Yuri's Revenge.

Notes

Such buildings can only rely on the occupier to grant them weapons and use them to fire, even though in Red Alert 2, this weapon is originally written in the building itself. For details, see the Occupier page.

In other words, the occupier only provides weapons to the buildings, while the one who actually fires is the building itself[1].

In Red Alert 2

In non-expanded Red Alert 2, CanBeOccupied was intended to be used for civilian structures only. If a building with CanBeOccupied=yes is constructed by a player, it will revert to being owned by the neutral house. Correspondingly, the effects brought by flags like GapGenerator=yes will also belong to the neutral house.

  • In this case, FreeUnit will not give the vehicle to either the player who built the building or to neutral.
  • If that building's Art(md).ini entry also has a Buildup animation, the AI of the neutral house will sell the building immediately upon construction.

In Yuri's Revenge

Yuri's Revenge expanded the behavior of this logic: only buildings with TechLevel=-1 will perform the actions from Red Alert 2, while buildings with other TechLevel values (including other negative values) will retain their original house like normal buildings, just like Soviet Battle Bunker.

Nevertheless, the AI still tends to regard them as civilian structures in certain determinations.

Buildings using this logic have a special image sequence.

  • If it is a civilian building (TechLevel=-1), then the third frame (and the corresponding shadow frame) is used as the image for the occupied state, and the fourth frame (and the corresponding shadow frame) is used as the rubble left after destruction.
  • If it is not a civilian building, then the fourth frame will also be used for the damaged image in the occupied state, so it will be difficult to pair with LeaveRubble.

Here is an example of incorrect display for a building with TechLevel not equal to -1 when it is damaged under occupied state.

Bugs/Side-Effects/Unexpected Limitations

Occupiable neutral structures are abandoned by their occupants when they are damaged to red health. As long as the building isn’t repaired, no infantry could occupy it again. Battle Bunkers will not throw out their occupiers once they reach red health, though new infantry still could not enter them.

  • This bug has been fixed in Ares 0.6, and infantry will still allowed to enter Battle Bunkers when in red health.

Units occupying civilian structures or Battle Bunkers unconditionally gain experience from kills even if Trainable=no is set.

  • This bug has been fixed in Ares 0.9.

Infantry could gain experience killing enemies while occupying a structure, but unlike units in OpenTopped vehicles (and with Ares with Gunner vehicles also), occupiers are not promoted immediately. They had to exit the building first, and only after doing this would they use the elite weapon when occupying a structure again.

  • This bug has been fixed in Ares 0.D. With Ares, the promotion now happens immediately and without exiting, but it is silent, that is, no sound will play.

When infantry are about to enter an occupiable building that has been removed and is not real dead will trigger EIP#7FB178

  • This bug has been fixed in Phobos Build#47.

Occupyable structure won't redraw when press deploy hotkey to release all occupants.

  • This bug has been fixed in Phobos Build#48.

If the garrison unload occupants when there is no open space around it would result in the disappearance of the occupants

  • This bug has been fixed in Phobos Build#48.

Footnotes

  1. Accordingly, if a player's infantry enters a neutral building and it does not change owner, then it will attack the player's objects just like normal neutral buildings do, for example, by placing a Soviet Battle Bunker that belongs to a neutral house on the map.

References

Starting from Ares 0.1, you can now specify that Battle Bunkers, for example, can be captured by enemy infantry just by having them walk in and garrison the building as if it were their own. Refer to Ares documentation.

See Also