Broom Items

From wiki
Jump to: navigation, search

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.