-
Notifications
You must be signed in to change notification settings - Fork 27
Creating a new Bush
In order to create functioning bush you will need both a seed and a bush. The former is the method to create the bush in game.
The seed is any item containing a SeedDefinitionComponent
. This component marks the item as a seed and allows it to plant a bush when it is used. The seed component contains a single field, prefab
which is the name of the prefab containing the bush information, namely a BushDefinitionComponent
. If a prefab is not specified then the prefab used is the one containing the seed info. This allows for all the bush and seed information to exist on the one prefab file.
If this is instead a seed for a Vine then the prefab
should point to a prefab containing a VineDefinitionComponent
. The prefab linked should only contain one of the two DefinitionComponent options, as using both can lead to confusion over which takes priority.
For example, this is the seed prefab for AdditionalFruits:Pineapple
The second part is the actual bush itself. The data for this is stored within a BushDefinitionComponent
. The main section of the component is the growthStages
section which lists the blocks to use in each stage and how long to spend in each stage. Once the final stage is reached the bush can be harvested for it's produce. If the sustainable
field is set to false
then the bush will also be destroyed in this stage and drop seeds alongside the produce. If the field is set to true
then the bush will simply regress one stage and be able to grow again.
This is the blueberry bush demonstrating this. (Note that each stage has been drastically sped up)
If the bush is destroyed during the final stage it will drop the item specified in the seed
field. If the bush is destroyed in any other stage then nothing will be dropped. Additionally if the seed field is not set on the component it will default to the produce item. This allows for plants like carrots and potatoes, where the seed item is the produce.
For example this is the bush prefab for AdditionalFruits:Pineapple