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

FreeUnit: Difference between revisions

From ModEnc
Jump to navigation Jump to search
m Replacing Template:TTL with Template:F.
Testid123 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Flag
{{Flag
|name={{PAGENAME}}
|name={{PAGENAME}}
|values={{Values|Strings|VehicleTypes}}
|values={{Values|Strings|[[VehicleTypes]]}}
|default=<none>
|types={{Categ|BuildingTypes}}
|types={{Categ|BuildingTypes}}
|ts=yes
|ts=yes
|fs=yes
|fs=yes
|ets=yes
|hp=yes
|ra2=yes
|ra2=yes
|yr=yes
|yr=yes
|rp=yes
|ares=yes
}}
}}


Specifies the [[VehicleType]] that should appear beside this [[BuildingType]] when it is placed after being constructed by the player (the '''unit''' comes '''free''' with the building).
Specifies the [[VehicleType|vehicle]] that should appear beside this [[BuildingType|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.
This logic is only used by the two Ore Refineries in the unmodded game.


You cannot have a [[BuildingType]] that costs less than its {{f|FreeUnit|link}}.
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 [[BuildingType|building]]).
If the {{f|Cost|link}} of the {{f|FreeUnit|link}} is higher than the {{f|Cost|link}} of the [[BuildingType]], then the price of the [[BuildingType]] will be overridden to match the {{f|Cost|link}} of the {{f|FreeUnit|link}}.<br>
For example, if you have a [[BuildingType]] with {{f|Cost|500|link}} and its {{f|FreeUnit|link}} has {{f|Cost|2000|link}} then the [[BuildingType]] will actually cost 2000 in-game (although note that the construction speed of the [[BuildingType]] is not affected by this change in price).<br>
 
If the [[BuildingType]] is sold then the {{f|FreeUnit|link}} {{f|Cost|link}} is not taken into account - the [[BuildingType]]'s {{f|Soylent|link}} is based on the {{f|Cost|link}} of the [[BuildingType]] only, so you need to set the {{f|Soylent|link}} for the [[BuildingType]] manually.
In the case of the Ore Refinery, {{f|Soylent|link}} is set to 300 because the Ore Refinery has {{f|Cost|2000|link}} and its {{f|FreeUnit|link}} has {{f|Cost|1400|link}} (in the unmodded game, you get 50% refund when you sell a [[BuildingType]]).


== FreeUnit and Industrial Plant logic ==
== FreeUnit and Industrial Plant logic ==
Line 25: Line 20:
As far as [[FactoryPlant|Industrial Plant logic]] is concerned, 'free units' are not actually free.
As far as [[FactoryPlant|Industrial Plant logic]] is concerned, 'free units' are not actually free.
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.
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.
Assuming the original [[FactoryPlant|Industrial Plant]] settings are used, [[VehicleType]] prices are reduced to 75% and [[BuildingType]] prices are not reduced.
Assuming the original [[FactoryPlant|Industrial Plant]] settings are used, [[VehicleType|vehicle]] prices are reduced to 75% and [[BuildingType|building]] prices are not reduced.
Therefore the price of the Ore Refinery becomes:
Therefore the price of the Ore Refinery becomes:
  (0.75 x 1400) + 600 = 1650
  (0.75 x 1400) + 600 = 1650


If you changed the [[FactoryPlant|Industrial Plant]] so that [[BuildingType]] prices were reduced to 50% as well (or made a new [[FactoryPlant|Industrial Plant]]), then the price of the Ore Refinery would become:
If you changed the [[FactoryPlant|Industrial Plant]] so that [[BuildingType|building]] prices were reduced to 50% as well (or made a new [[FactoryPlant|Industrial Plant]]), then the price of the Ore Refinery would become:
  (0.75 x 1400) + (0.5 x 600) = 1350
  (0.75 x 1400) + (0.5 x 600) = 1350


Line 36: Line 31:


{{Bugs}}
{{Bugs}}
If you own an [[FactoryPlant|Industrial Plant]] that reduces the cost of [[VehicleTypes]] and/or [[BuildingTypes]] (whether one or both of these causes the problem has not been established) using a very small multiplier, say 0.01, then [[FreeUnit]] will cease to function on all your buildings - i.e. the free unit will not appear.
*You cannot have a [[BuildingType|building]] that costs less than its {{f|FreeUnit}}. 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.
*If you own an [[FactoryPlant|Industrial Plant]] that reduces the cost of [[VehicleTypes|vehicles]] and/or [[BuildingTypes|buildings]] (whether one or both of these causes the problem has not been established) using a very small multiplier, say 0.01, then [[FreeUnit]] will cease to function on all your buildings - i.e. the free unit will not appear.
*Even if you specify name <b>[[VehicleTypes]]</b> that do not exist, such as <b>FreeUnit=AAA</b>
tags <b>FreeUnit</b> will work as expected, along with <b>[[VehicleTypes]]</b> that do not contain images. There is no information and <b>{{f|Locomotor|{4A582747-9839-11d1-B709-00A024DDAFD1}|Link}}</b>.
 
(If you specify the name of [[AircraftTypes]] You must have complete information of specified [[AircraftTypes]] and importantly it will become [[VehicleTypes]] completely even if there is a match, e.g. ORCA)<br>
*[[VehicleTypes]] with [[TechLevel]] equal to 1 or greater than 1 which we specified in the section <b>FreeUnit</b> is in the list of [[VehicleTypes]] automatically, even if we don't specify it (It can actually be created only if the conditions for creating it are followed, such as [[Prerequisite]],[[Owner]],[[ForbiddenHouses]][[RequiredHouses]]).


[[Category:General_Editing_Information]]
[[Category:General_Editing_Information]]
[[Category:INI_Flags]]
[[Category:INI_Flags]]

Latest revision as of 16:32, 23 September 2024

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: 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, vehicle prices are reduced to 75% and building prices are not reduced. Therefore the price of the Ore Refinery becomes:

(0.75 x 1400) + 600 = 1650

If you changed the Industrial Plant so that building 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 [unmodded] 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

  • You cannot have a building that costs less than its FreeUnit. 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 you own an Industrial Plant that reduces the cost of vehicles and/or buildings (whether one or both of these causes the problem has not been established) using a very small multiplier, say 0.01, then FreeUnit will cease to function on all your buildings - i.e. the free unit will not appear.
  • Even if you specify name VehicleTypes that do not exist, such as FreeUnit=AAA

tags FreeUnit will work as expected, along with VehicleTypes that do not contain images. There is no information and Locomotor={4A582747-9839-11d1-B709-00A024DDAFD1}.

(If you specify the name of AircraftTypes You must have complete information of specified AircraftTypes and importantly it will become VehicleTypes completely even if there is a match, e.g. ORCA)