Difference between revisions of "Coins Items"

From wiki
Jump to: navigation, search
(Initial commit.)
 
m (Oops.)
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
 
</pre>
 
</pre>
  
And also must include a [[Currency Component]], otherwise it may not work as intended.
+
These items must also include a [[Currency Component]] in order to work. Currency items will add to the player's petals upon picking up rather than go to the inventory.
 
+
Coin items actually act as normal [[Craft Items]] but have the ability to be spawned whenever currency is thrown into the world. Upon pickup, all Coins will disappear instead of being located in the inventory.
+
  
  
 
= Creating a Coin Item =
 
= Creating a Coin Item =
Coin are created in much the same way as [[Craft Items]]. In fact you should follow the guide, [[Craft Items#Creating a Craft Item]], until you finish all of the steps there.
+
Coins 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. First, change the "kind" from "staxel.item.CraftItem" to "staxel.item.Coin". Secondly add the following to the end of the file;
+
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.Coin".  
 +
 
 +
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 "currency".
 +
 
 +
 
 +
Once that is done, the Asset Manager should have selected your new component. Check out the single property and change it to suit your need.
 +
 
 +
 
 +
When you are done, close the window 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>
 
<pre>
 
"currency": {
 
"currency": {
   "petalWorth": 10.0,
+
   "petalWorth": 1
 
},
 
},
 
</pre>
 
</pre>
  
It's as simple as that. "petalWorth" is just how much this item will give upon being picked up.
+
With that out of the way, it is time to start editing these values. The outermost property "currency" is known as a [[:Category:Component Modding|Component]] that holds all the information. (Specifically the [[Currency Component]]).
 +
 
 +
 
 +
Inside of that it includes a single properties. "petalWorth" determines how much the coin will be worth.
 +
 
 +
After you finished editing the values, rerun <code>Content Builder</code> and you are good to go.
  
  
 
= Spawning in a Coin Item =
 
= Spawning in a Coin Item =
Follow the guide at [[Craft Items#Spawning in a Craft Item]]. When that guide mentions "kind", make sure to use "staxel.item.Coin" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.
+
Follow the guide at [[Items#How to Spawn an Item]]. When that guide mentions "kind", make sure to use "staxel.item.Coin" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.
  
  
 
= Config Options =
 
= Config Options =
The list of basic properties is included at [[Craft Items#Config Options]].  
+
The list of basic properties is included at [[Items#Config Options]].  
  
All additional information being included at [[Currency Component#Config Options]].
+
This item does need additional information. This additional information is contained in a [[Currency Component]] which needs to be added along with the item file.

Latest revision as of 06:41, 12 December 2017

Items are fairly broad in their types. Each type has it's own properties and uses.

This page is for coins, which will add to the player's money instead of being placed into the inventory.

Coin items are all items that have the following line;

"kind": "staxel.item.Coin",

These items must also include a Currency Component in order to work. Currency items will add to the player's petals upon picking up rather than go to the inventory.


Creating a Coin Item

Coins 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.Coin".

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 "currency".


Once that is done, the Asset Manager should have selected your new component. Check out the single property and change it to suit your need.


When you are done, close the window 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;

"currency": {
  "petalWorth": 1
},

With that out of the way, it is time to start editing these values. The outermost property "currency" is known as a Component that holds all the information. (Specifically the Currency Component).


Inside of that it includes a single properties. "petalWorth" determines how much the coin will be worth.

After you finished editing the values, rerun Content Builder and you are good to go.


Spawning in a Coin Item

Follow the guide at Items#How to Spawn an Item. When that guide mentions "kind", make sure to use "staxel.item.Coin" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.


Config Options

The list of basic properties is included at Items#Config Options.

This item does need additional information. This additional information is contained in a Currency Component which needs to be added along with the item file.