Difference between revisions of "Feeder Helper Component"

From wiki
Jump to: navigation, search
(Initial commit.)
 
m (Formatting changes.)
Line 63: Line 63:
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
  
 
This is the amount of food to add to the tile when it is spawned.
 
This is the amount of food to add to the tile when it is spawned.
Line 71: Line 72:
  
 
'''Default Value:''' If not specified, will not play any sound.
 
'''Default Value:''' If not specified, will not play any sound.
 +
  
 
This specifies a sound to play when switching the tiles around.
 
This specifies a sound to play when switching the tiles around.

Revision as of 02:40, 20 July 2017

Category:Component Modding are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon.

On this page, we go over the Feeder Helper component, signified by the following;

"feederHelper": {
  =Content=
}

Feeder Helper components are used to specify items that can turn Feeder Tiles into Feeder Tiles with food. This component basically only has the information to fill feeder tiles. This component also complements the Feeder Component, which provides information on creating feeders.

When and How to use

Feeder Helper component is used whenever you want to make a item that can fill feeders. Specifically, most animal food items should have this property

To start off with first, you will need to create an Item. Once that is done, you can add the following below the last property of the file;

"feederHelper": {
  "canReplace": [
    {
      "from": "staxel.tileObject.animalFurniture.SlopTroughEmpty",
      "to": "staxel.tileObject.animalFurniture.SlopTroughFeed"
    }
  ],
  "feedAmount": 8,
  "replaceSound" : "staxel.sound.whatever"
},

"canReplace" contains a list of blobs which have two properties. "from" is the Tile to check for, "to" is the tile to change to. "feedAmount" is how much food this will add to the feeder. "replaceSound" is the Sound to play when filling the feeder.

With that, this component is complete. You may want to also look into Feeder Component for making the feeder.


Config Options

All config options must be inside the body of;

"feederHelper": {
  =Config Here=
}

"canReplace"

This is a list of blobs that contain exactly two properties. This property can often look like;

"canReplace": [
  {
    "from": "staxel.tileObject.animalFurniture.SlopTroughEmpty",
    "to": "staxel.tileObject.animalFurniture.SlopTroughFeed"
  },
  {
    "from": "staxel.tileObject.animalFurniture.SlopTroughEmpty",
    "to": "staxel.tileObject.animalFurniture.SlopTroughFeed"
  }
]

"from" is the Tile code to check for.

"to" is the Tile code for the tile to switch to.


"feedAmount"

Valid options (Int): A positive integer number

Default Value: No default value is specified. Always need to provide your own.


This is the amount of food to add to the tile when it is spawned.


"replaceSound"

Valid options (String): A string matching the food type an Sound eats

Default Value: If not specified, will not play any sound.


This specifies a sound to play when switching the tiles around.