[*Back to Index*](index.md.html)
Farm Crop
=========
This mod item type allows you to create new crops for Farms and change their properties.
New crops will automatically appear in the Farms of the specified type and can be locked behind technologies
by using the **LockCrop** and **UnlockCrop** functions. Note that a single crop can be locked multiple times
and will only become available when all the lock conditions are met.
Crop Properties
=========
Name (*self.name*)
-------
The ID of this crop.
Display Name (*self.DisplayName*)
-------
The name of the crop, as shown to the users.
Display Name (plural) (*self.DisplayNamePlural*)
-------
The plural name of the crop, as shown to the users.
Description (*self.Desc*)
-------
The description text of the crop.
Icon (*self.icon*)
-------
The game icon used to represent the crop.
Food Output (*self.FoodOutput*)
-------
The maximum food production a farm can achieve growing the crop.
Initial Growth Time (*self.InitialGrowthTime*)
-------
The time it takes to grow when the previous crop was different.
Initial Growth Sequence (*self.InitialGrowthSequence*)
-------
A comma-separated list of the states used for the growing animation when the crop was planted after growing a different one.
Leave blank to use the default sequence.
Growth Time (*self.GrowthTime*)
-------
The time it takes to grow when the previous crop was the same as this one.
Growth Sequence (*self.GrowthSequence*)
-------
A comma-separated list of the states used for the growing animation when the crop was planted after growing the same one.
Leave blank to use the default sequence.
Water Demand (*self.WaterDemand*)
-------
The Water consumption of the Farm while growing this crop.
Oxygen Production (*self.OxygenProduction*)
-------
The Oxygen production of the Farm while growing this crop.
Soil Demand (*self.SoilDemand*)
-------
The minimum *Soil Quality* the Farm must have in order to grow this crop.
Soil Effect (*self.SoilEffect*)
-------
A number value added to the Soil Quality of the Farm upon finishing the growth cycle of the crop.
Positive numbers mean the crop improves the quality while crops with negative *Soil Effect* reduce it.
The effect is limited by the values of *Soil Quality Min* and *Soil Quality Max* properties.
Soil Quality Min (*self.SoilQualityMin*)
-------
The minimum value of *Soil Quality* this crop can achieve by applying its *Soil Effect*.
Soil Quality Max (*self.SoilQualityMax*)
-------
The maximum value of *Soil Quality* this crop can achieve by applying its *Soil Effect*.
Farm Class (*self.FarmClass*)
-------
The Lua class name of the building which can grow this crop.
Entity (*self.CropEntity*)
-------
The entity used for the visualization of growing this crop in a Farm.
Priority (*self.Priority*)
-------
A number value used to order the available crops when listing them in the crop selection interface.
Crops with the same *Priority* will be sorted alphabetically.
Produce (*self.OnProduce(dome, farm, amount)*)
-------
A custom function member which will be called when the production happens. It receives as parameters the parent dome
of the farm, the farm itself and the amount of food produced.
Modifier Target (*self.modify_target*)
-------
Used to apply a modification to an object or a group of objects while growing this crop.
It can have one of the following values:
* "" (empty string) - no modifications are applied.
* "dome" - the modification is applied to the parent dome of the farm.
* "farm" - the modification is applied to the farm growing the crop.
* "dome buildings" - the modification is applied to all *Buildings* inside the parent dome of the farm.
* "dome colonists" - the modification is applied to all *Colonists* living in the parent dome of the farm.
Modified Property (*self.modify_property*)
-------
The property modified on the *Modifier Target* object(s) while growing this crop.
Modification amount (*self.modify_amount*)
-------
The amount added to the value of <*Modified Property*> on the *Modifier Target* object(s).
Modification percent (*self.modify_percent*)
-------
The percentage added to the value of <*Modified Property*> on the *Modifier Target* object(s).
Locking/Unlocking
=========
LockCrop(crop, lock_id)
-------
The function will lock the crop (making it unavailable).
**crop** is the *name* of the crop to lock.
UnlockCrop(crop, [lock_id])
-------
The function will remove the specified *lock_id* from the requirements for this crop.
If no *lock_id* is specified, it will instead remove all of the requirements, instantly making the crop available.
**crop** is the *name* of the crop to lock.
IsCropAvailable(crop)
-------
The function will return **true** if the crop is available to grow and **false** otherwise.
**crop** is the *name* of the crop to check.
(insert footer.md.html here)