Difference between revisions of "Mixed Seeds Items"
DeamonHunter (Talk | contribs) (Initial commit.) |
DeamonHunter (Talk | contribs) (Update Page.) |
||
Line 9: | Line 9: | ||
</pre> | </pre> | ||
− | + | These items must also include a [[Mixed Seeds Component]] in order to work. These items allow you to plant any random seed that coincides with the filters chosen in the component. | |
− | + | ||
= Creating a Mixed Seeds Item = | = Creating a Mixed Seeds Item = | ||
− | Mixed Seeds are created in | + | Mixed Seeds are created in much the same way as [[Craft Items]]. In fact you should follow the guide, [[Items#How to Make a Normal Item]], until you finish all of the steps there. |
+ | Once you have gone through that guide, there are two more steps you will need to do. The first step is to change the "kind" from "staxel.item.CraftItem" to "staxel.item.MixedSeeds". | ||
− | + | The second step depends on what you are using to create items. | |
− | + | ||
− | = | + | == Asset Manager == |
− | + | Navigate to the item you had created before. Head to the components property and click on the <code>[...]</code>. When the new window pops up, click on "Add" and select "mixedseeds". | |
− | |||
− | |||
− | + | Once that is done, the Asset Manager should have selected your new component. Click on the "PlantOptions" property and click on the <code>[...]</code> there. Click on "Add" in the newest window. | |
− | + | With that you will be greeted with three more properties, the first "PlantCategories" are all the categories of plant you want to spawn. The second "ExcludeCategories" are all the categories of plant you want to exclude. "Chance" is the relative chance of pulling this section when compared to other sections (Which are added by pressing "Add" again). | |
+ | |||
+ | |||
+ | When you are done, close both windows by clicking "OK". Save the asset and continue to "Build and Validate Assets" like the normal item tutorial. | ||
+ | |||
+ | |||
+ | == Text Files == | ||
+ | The second step is to add the following to the end of the item file created; | ||
+ | <pre> | ||
+ | "mixedSeeds": { | ||
+ | "plantOptions": [ | ||
+ | { | ||
+ | "chance": 100.0, | ||
+ | "plantCategories": [ | ||
+ | "crop" | ||
+ | ], | ||
+ | "excludeCategories": [ | ||
+ | "bush", | ||
+ | "tree", | ||
+ | "gold", | ||
+ | "large" | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | With that out of the way, it is time to start editing these values. The outermost property "mixedSeeds" is known as a [[:Category:Component Modding|Component]] that holds all the information. (Specifically the [[Mixed Seeds Component]]). | ||
+ | |||
+ | |||
+ | Inside of that it includes single property. This property contains a [[Modding_Key_Terms#List|List]] of weighted outcomes. Inside these weighted outcomes are three properties. "chance" determines how likely it is to get this particular item. "plantCategories" are all the categories of plant you want to spawn. The second "excludeCategories" are all the categories of plant you want to exclude. | ||
+ | |||
+ | |||
+ | After you finished editing the values, rerun <code>Content Builder</code> and you are good to go. | ||
+ | |||
+ | |||
+ | = Spawning in a Mixed Seeds Item = | ||
+ | Follow the guide at [[Items#How to Spawn an Item]]. When that guide mentions "kind", make sure to use "staxel.item.MixedSeeds" instead of "staxel.item.CraftItem" else you won't be able to spawn the item. | ||
+ | |||
+ | You can also add one extra line to this file to force a [[Plant]] to be used next. This line is labelled "nextPlant" and as long as the item doesn't stack with another item, the next will be this one. This property is only available during spawning, and cannot be set as a part of the normal file. |
Latest revision as of 06:38, 12 December 2017
Items are fairly broad in their types. Each type has it's own properties and uses.
This page is for items that will act as if they were a Bag of Mixed Seeds.
Scythes are all items that have the following line;
"kind": "staxel.item.MixedSeeds",
These items must also include a Mixed Seeds Component in order to work. These items allow you to plant any random seed that coincides with the filters chosen in the component.
Contents
Creating a Mixed Seeds Item
Mixed Seeds are created in much the same way as Craft Items. In fact you should follow the guide, Items#How to Make a Normal Item, until you finish all of the steps there.
Once you have gone through that guide, there are two more steps you will need to do. The first step is to change the "kind" from "staxel.item.CraftItem" to "staxel.item.MixedSeeds".
The second step depends on what you are using to create items.
Asset Manager
Navigate to the item you had created before. Head to the components property and click on the [...]
. When the new window pops up, click on "Add" and select "mixedseeds".
Once that is done, the Asset Manager should have selected your new component. Click on the "PlantOptions" property and click on the [...]
there. Click on "Add" in the newest window.
With that you will be greeted with three more properties, the first "PlantCategories" are all the categories of plant you want to spawn. The second "ExcludeCategories" are all the categories of plant you want to exclude. "Chance" is the relative chance of pulling this section when compared to other sections (Which are added by pressing "Add" again).
When you are done, close both windows by clicking "OK". Save the asset and continue to "Build and Validate Assets" like the normal item tutorial.
Text Files
The second step is to add the following to the end of the item file created;
"mixedSeeds": { "plantOptions": [ { "chance": 100.0, "plantCategories": [ "crop" ], "excludeCategories": [ "bush", "tree", "gold", "large" ] } ] }
With that out of the way, it is time to start editing these values. The outermost property "mixedSeeds" is known as a Component that holds all the information. (Specifically the Mixed Seeds Component).
Inside of that it includes single property. This property contains a List of weighted outcomes. Inside these weighted outcomes are three properties. "chance" determines how likely it is to get this particular item. "plantCategories" are all the categories of plant you want to spawn. The second "excludeCategories" are all the categories of plant you want to exclude.
After you finished editing the values, rerun Content Builder
and you are good to go.
Spawning in a Mixed Seeds Item
Follow the guide at Items#How to Spawn an Item. When that guide mentions "kind", make sure to use "staxel.item.MixedSeeds" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.
You can also add one extra line to this file to force a Plant to be used next. This line is labelled "nextPlant" and as long as the item doesn't stack with another item, the next will be this one. This property is only available during spawning, and cannot be set as a part of the normal file.