Jump to content

FreeUnit: Difference between revisions

From ModEnc²
en>Marshall
m (author alias correction)
Rain-Islet (talk | contribs)
m [bot] Batch update {{Bugs}} templates.
 
(32 intermediate revisions by 15 users not shown)
Line 1: Line 1:
== FreeUnit and Industrial Plant logic (by Marshall) ==
{{Flag
|name={{PAGENAME}}
|values={{Values|Strings|[[VehicleTypes]]}}
|default=<none>
|types={{Categ|BuildingTypes}}
|ts=yes
|fs=yes
|hp=yes
|ra2=yes
|yr=yes
|ares=yes
}}
Specifies the [[VehicleType|vehicle]] that should appear beside this [[BuildingTypes|building]] when it is placed after being constructed by the player (the '''unit''' comes '''free''' with the building). In the unmodded games, this logic is only used by Tiberium/Ore Refineries to spawn free Harvesters/Miners.


If any building comes with a free vehicle (such as the Ore
The {{f|FreeUnit}} {{f|Cost|link}} is not taken into account when the building is sold. In {{ra2}} and {{yr}}, the building's {{f|Soylent|link}} is based on the {{f|Cost}} of the building only, so you need to set the {{f|Soylent}} for the building manually. In the case of the Ore Refinery, {{f|Soylent}} is set to 300 because the Ore Refinery has {{f|Cost|2000}} and its {{f|FreeUnit}} has {{f|Cost|1400}} (in the unmodded game, you get 50% refund when you sell a building).
Refinery), then owning a Soviet Industrial Plant will reduce
the cost of the building.<br>
This is because the 'FreeUnit' isn't free. As far as the
game is concerned, you are paying for the vehicle and the
building at the same time.<br>
In the case of the Ore Refinery, you are paying for a 1400
credit Ore Miner and a 600 credit Ore Refinery.


Further more, you cannot have a building that costs less
== FreeUnit and Industrial Plant Logic ==
than the FreeUnit. If the FreeUnit costs 2000 and the
As far as [[FactoryPlant|Industrial Plant logic]] is concerned, 'free units' are not actually free.
building costs 500, in game the building cost will actually
In the case of the Ore Refinery ({{f|Cost|2000|link}}), the game thinks you are paying for a 1400 credit ore miner and a 600 credit Ore Refinery at the same time.
be 2000.


Assuming the original Industrial Plant settings are used,
Assuming the original Industrial Plant settings are used, VehicleTypes prices are reduced to 75% and BuildingTypes prices are not reduced. Therefore the price of the Ore Refinery becomes:
Vehicle costs are reduced to 0.75 and building costs are
(0.75 x 1400) + 600 = 1650
not reduced.


Therefore the cost of the Ore Refinery would become:<br>
If the Industrial Plant is set so that BuildingTypes prices were reduced to 50% as well (or made a new Industrial Plant), then the price of the Ore Refinery would become:
(0.75 x 1400) + 600 = 1650
(0.75 x 1400) + (0.5 x 600) = 1350


If you changed the Industrial Plant so that building costs
Note that multiple Industrial Plants stack their bonuses. For example, owning two Industrial Plants would cause the price of the Ore Refinery to become:
were reduced to 0.5 as well (or made a new FactoryPlant
(0.75 x (0.75 x 1400)) + 600 = 1387.5
building), then the cost of the Ore Refinery would become:<br>
(0.75 x 1400) + (0.5 x 600) = 1350


When changing bonuses in Yuri's Revenge, don't forget that
=={{Bugs}}==
the Allied Ore Processor gives 25% ore bonus, which is sort
If the {{f|Cost|link}} of the {{f|FreeUnit}} is higher than the {{f|Cost}} of the building, then the price of the building will be overridden to match the {{f|Cost}} of the {{f|FreeUnit}}. For example, if you have a building with {{f|Cost|500}} and its {{f|FreeUnit}} has {{f|Cost|2000}} then the building will actually cost 2000 in-game. However, the construction speed of the building is not affected by this change in price.
of equivalent to a FactoryPlant with 0.75 cost multipliers
for Infantry, Vehicles, Aircraft and Buildings.
Yuri's [[Cloning]] Vats give an equivalent cost multiplier of
0.5 to Infantry.


Also note that multiple Industrial Plants and/or Cloning
If the player owns an Industrial Plant that reduces the cost of vehicles and/or buildings, using a very small multiplier, such as 0.01, then {{f|FreeUnit}} logic will cease to function on all other buildings. The free unit will not be created.
Vats stack their bonuses.<br>
EG: Two Factory Plants for a Flak Track would result in:<br>
0.75 x 0.75 x 500 = 281.25


I don't know if the Ore Purifier bonus can stack.
[[Category:General_Editing_Information]]
 
[[Category:INI_Flags]]
=== Appendix by DCoder ===
Considering the AI has more than one VirtualPurifiers, I would say that it stacks the same way.

Latest revision as of 17:25, 2 July 2025

Tiberian Dawn Red Alert Tiberian Sun Firestorm Red Alert 2 Yuri's Revenge
Flag: FreeUnit
File(s): rules(md).ini
Values: Strings: Normal text. (Limited to: VehicleTypes)
Default: <none>
Applicable to: BuildingTypes


Specifies the vehicle that should appear beside this building when it is placed after being constructed by the player (the unit comes free with the building). In the unmodded games, this logic is only used by Tiberium/Ore Refineries to spawn free Harvesters/Miners.

The FreeUnit Cost is not taken into account when the building is sold. In Red Alert 2 and Yuri's Revenge, the building's Soylent is based on the Cost of the building only, so you need to set the Soylent for the building manually. In the case of the Ore Refinery, Soylent is set to 300 because the Ore Refinery has Cost=2000 and its FreeUnit has Cost=1400 (in the unmodded game, you get 50% refund when you sell a building).

FreeUnit and Industrial Plant Logic

As far as Industrial Plant logic is concerned, 'free units' are not actually free. In the case of the Ore Refinery (Cost=2000), the game thinks you are paying for a 1400 credit ore miner and a 600 credit Ore Refinery at the same time.

Assuming the original Industrial Plant settings are used, VehicleTypes prices are reduced to 75% and BuildingTypes prices are not reduced. Therefore the price of the Ore Refinery becomes:

(0.75 x 1400) + 600 = 1650

If the Industrial Plant is set so that BuildingTypes prices were reduced to 50% as well (or made a new Industrial Plant), then the price of the Ore Refinery would become:

(0.75 x 1400) + (0.5 x 600) = 1350

Note that multiple Industrial Plants stack their bonuses. For example, owning two Industrial Plants would cause the price of the Ore Refinery to become:

(0.75 x (0.75 x 1400)) + 600 = 1387.5

Bugs/Side-Effects/Unexpected Limitations

If the Cost of the FreeUnit is higher than the Cost of the building, then the price of the building will be overridden to match the Cost of the FreeUnit. For example, if you have a building with Cost=500 and its FreeUnit has Cost=2000 then the building will actually cost 2000 in-game. However, the construction speed of the building is not affected by this change in price.

If the player owns an Industrial Plant that reduces the cost of vehicles and/or buildings, using a very small multiplier, such as 0.01, then FreeUnit logic will cease to function on all other buildings. The free unit will not be created.