Difference between revisions of "Feeder Helper Component"

From wiki
Jump to: navigation, search
(Initial commit.)
 
(Update formatting.)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
[[: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.
 
[[: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;
+
On this page, we go over the Feeder Helper Component, signified by the following;
 
<pre>
 
<pre>
 
"feederHelper": {
 
"feederHelper": {
Line 8: Line 8:
 
}
 
}
 
</pre>
 
</pre>
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.
+
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 =
 
= 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
+
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 [[Items|Item]]. Once that is done, you can add the following below the last property of the file;
 
To start off with first, you will need to create an [[Items|Item]]. Once that is done, you can add the following below the last property of the file;
Line 40: Line 40:
  
 
== "canReplace" ==
 
== "canReplace" ==
This is a list of blobs that contain exactly two properties. This property can often look like;
+
This is a [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]] that contain exactly two properties. This property can often look like;
 
<pre>
 
<pre>
 
"canReplace": [
 
"canReplace": [
Line 60: Line 60:
  
 
== "feedAmount" ==
 
== "feedAmount" ==
'''Valid options (Int): <code>A positive integer number</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer number</code>'''
  
 
'''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 68: Line 69:
  
 
== "replaceSound" ==
 
== "replaceSound" ==
'''Valid options (String): <code>A string matching the food type an [[Sound]] eats</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string containing the code to a [[Sound]].</code>'''
  
 
'''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.

Latest revision as of 00:12, 21 November 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 (Integer): 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 containing the code to a Sound.

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


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