Difference between revisions of "Broom Items"

From wiki
Jump to: navigation, search
m (Small copy paste error.)
m (Oops.)
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
</pre>
 
</pre>
  
Brooms, currently, do have any extra components when compared to [[Craft Items]], but requires those extra components to be set when it is spawned. This will also activate the item to work exactly like a Broom. This item reacts to items on the ground, no matter what type they are.
+
These items must also include a [[Broom Component]] in order to work. Brooms allow you to sweep items around. They also break to [[Tile|Tiles]] that have the [[Sweepable Component]] in their specifications.
  
  
 
= Creating a Broom Item =
 
= Creating a Broom Item =
Brooms are created in 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.Broom".
+
Brooms 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.Broom".
  
= Spawning in a Shovel 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.Broom" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.
+
  
You can also add the following to the file in order to adjust the broom;
 
<pre>
 
"sweepRadius": 1.5,
 
"usageDistance": 3.0,
 
"pushVelocity": 7.0,
 
</pre>
 
Each property is self evident. Sweep radius affects how far items can be from the point you aim at. Usage distance affects how far you can aim. Push velocity affects how fast the items are thrown.
 
  
= 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 "broom".
  
== "pushVelocity" ==
 
'''Valid options (Float): <code>A decimal number.</code>'''
 
  
'''Default Value:''' 7.0. (Currently only available when spawning an item)
+
Once that is done, the Asset Manager should have selected your new component. Check out the three properties and change them to suit your needs.
  
  
This is how fast an item will get pushed.
+
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.
  
  
== "sweepRadius" ==
+
== Text Files ==
'''Valid options (Float): <code>A positive decimal number.</code>'''
+
The second step is to add the following to the end of the item file created;
 +
<pre>
 +
"broom": {
 +
  "sweepRadius": 1.5,
 +
  "usageDistance": 3.0,
 +
  "pushVelocity": 7.0
 +
},
 +
</pre>
  
'''Default Value:''' 1.5. (Currently only available when spawning an item)
+
With that out of the way, it is time to start editing these values. The outermost property "broom" is known as a [[:Category:Component Modding|Component]] that holds all the information. (Specifically the [[Broom Component]]).
  
  
This is the radius of the sphere that the game will use to search for items. A unit of 1 is a single block.
+
Inside of that it includes three properties. "sweepRadius" determines how large the area of effect will be. "usageDistance" determines how far away from the character that the broom can be used. "pushVelocity" determines how much force will be used to push the items. Any of these properties can be removed in order to give the default values.
  
 +
After you finished editing the values, rerun <code>Content Builder</code> and you are good to go.
  
== "usageDistance" ==
 
'''Valid options (Float): <code>A positive decimal number.</code>'''
 
  
'''Default Value:''' 1.5. (Currently only available when spawning an item)
+
= Spawning in a Broom Item =
 +
Follow the guide at [[Items#How to Spawn an Item]]. When that guide mentions "kind", make sure to use "staxel.item.Broom" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.
  
  
This is how far away you can aim before it will no longer work. A unit of 1 is a single block.
+
= 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 [[Broom Component]] which needs to be added along with the item file.

Latest revision as of 07:40, 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 Broom.

Brooms are all items that have the following line;

"kind": "staxel.item.Broom",

These items must also include a Broom Component in order to work. Brooms allow you to sweep items around. They also break to Tiles that have the Sweepable Component in their specifications.


Creating a Broom Item

Brooms 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.Broom".

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


Once that is done, the Asset Manager should have selected your new component. Check out the three properties and change them to suit your needs.


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;

"broom": {
  "sweepRadius": 1.5,
  "usageDistance": 3.0,
  "pushVelocity": 7.0
},

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


Inside of that it includes three properties. "sweepRadius" determines how large the area of effect will be. "usageDistance" determines how far away from the character that the broom can be used. "pushVelocity" determines how much force will be used to push the items. Any of these properties can be removed in order to give the default values.

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


Spawning in a Broom Item

Follow the guide at Items#How to Spawn an Item. When that guide mentions "kind", make sure to use "staxel.item.Broom" 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 Broom Component which needs to be added along with the item file.