Difference between revisions of "Mixed Seeds Items"

From wiki
Jump to: navigation, search
(Initial commit.)
 
(Update Page.)
 
Line 9: Line 9:
 
</pre>
 
</pre>
  
Mixed Seeds, currently, has one extra component when compared to [[Craft Items]], the [[Mixed Seeds Component]]. Adding this allows you to specify what seeds should be placed. This item will place a random plant when activated. If the placing fails, it will not select a new random plant until it is used.
+
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 almost the exact same way as [[Craft Items]]. In fact you should follow the guide, [[Craft Items#Creating a Craft Item]], just replace the "kind" property with "staxel.item.MixedSeeds". When you have completed this, add a [[Mixed Seeds Component]] to the file by following the instructions there.
+
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".
  
= Spawning in a Mixed Seeds Item =
+
The second step depends on what you are using to create items.  
Follow the guide at [[Craft Items#Spawning in a Craft 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 add one extra line to this file. This line is labelled "nextPlant" which contains the code of the next plant to be placed. Use this to force a plant to be placed. (As long as the item doesn't stack with another.) THis property is only available during spawning, and cannot be set as a part of the normal file.
+
  
  
= Config Options =
+
== Asset Manager ==
The list of basic properties is included at [[Craft Items#Config Options]].
+
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".
  
== "nextPlant" ==
 
'''Valid options (String): <code>A string pointing to a [[Plants|Plant's]] code.</code>'''
 
  
'''Default Value:''' If not specified will just random as normal
+
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.
  
  
This will be the plant that will be spawned next. As a note, this is only used on spawning an item.
+
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.

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.