Gatherable Component

From wiki
Revision as of 08:30, 2 March 2018 by Callum (Talk | contribs) (Updated removed properties from catchable gatherables)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 Gatherable Component, signified by the following;

"gatherable": {
  =Content=
}

Gatherable Components are used to specify one of three different types of gatherable items in the world. The three types are:

  • Fishing gatherables. (Stuff you get from fishing.)
  • Catchable gatherables. (Stuff you catch with a net.)
  • Harvestable gatherables. (Stuff you can grab out of the ground.)

This page may contain information that is not currently out on the public build. Refer to the game's files in order to find out what is there.


When and How to use

Gatherable Components can be used in different situations, and each type of gatherable has it's own conditions that need to be met. This section will be split into 3 separate tutorials, each focusing on explaining the particular circumstance.

Catchables

Catchables should be used whenever you want to have a tile that is to be caught with a net. This section will require a Tile that has a Tile#"tileStateKind" equal to "staxel.tileState.Catchable". This tile should have some AutoTiling, in order to place the gatherable in proper spots, but may not be required.

This component however goes onto an Item, which will be the result of "catching" the tile. When you have your item and tile complete, add this to the end of the Item file;

"gatherable": {
  "isCatchable": true,
  "catchable": {
    "tile": "staxel.tileObject.gatherable.Bee",
    "idleSound": "staxel.sounds.bugs.BeeBuzzing",
    "spawnChance": 0.15
  }
},

The line "isCatchable" says that this item is something that can be caught. The rest of the information is kept within "catachable". Firstly, "tile" is the Tile you have created earlier. This will be spawned in the world in order to catch. "idleSound" is the Sound you want to play continiously, which can be skipped to have no sound. And finally "spawnChance" is the chance of this gatherable spawning in a specific location.

Fishables

Fishables should be used whenever you want to have a tile that is to be caught with a fishing rod. This component however goes onto an Item, which will be the result when fishing. When you have your item complete, add this to the end of the Item file;

"gatherable": {
  "isFishable": true,
  "fishable": {
    "size": "medium",
    "spawnsOn": [
      "staxel.tile.retrotest.water",
      "staxel.tile.temple.Water",
      "staxel.tileObject.serverVillage.exterior.WaterBlock",
      "staxel.tile.ocean.OceanTile"
    ],
    "spawnChanceWeight": 1.0
  }
},

The line "isFishable" says that this item is something that can be fished. The rest of the information is kept within "fishable". Firstly, "size" is the difficulty you want for this fish. Valid options are "Small", "Medium", "Large", "Legendary". "spawnsOn" is a list of Tiles that can be fished in and be able to get this fish. "spawnChanceWeight" is the weighted chance of this fish being the fish to be caught when compared to others. There are other options, which limit the times the fish can be caught, which are listed in "Config".


Harvestables

Harvestables should be used whenever you want to have a plant that is to be spawned in the world to be harvested. This component goes onto an Plant, which will be the plant that will be placed. When you have your plant complete, add this to the end of the plant file;

"gatherable": {
  "isHarvestable": true,
  "harvestable": {
    "spawnChance": 0.25,
    "spawnWeather": "staxel.weather.Rainy"
  }
},

The line "isHarvestable" says that this item is something that can be harvested in the world. The rest of the information is kept within "harvestable". Firstly, "spawnChance" is the chance of this gatherable spawning in a specific location. And "spawnWeather" is the Weather you would like to spawn this in. Skipping this will allow it to be able to spawn in any weather.


Config Options

All config options must be inside the body of;

"gatherable": {
  =Config Here=
}

"isCatchable"

Valid options (Bool): True or False.

Default Value: If not specified will default to false


This determines whether or not this is catchable with a net. Should only be specified for *.item files.


"catchable"

This describes all that is needed in order to make a catchable item. The value "isCatchable" needs to be true for this to be used in game. This part will commonly look like;

"catchable": {
  =Content=
}

"tile"

Valid options (String): A string pointing to a Tile's code.

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


This will be the tile that it will spawn in the middle of the world. This tile should have a Tile#"tileStateKind" of "staxel.tileState.Catchable" in order to behave correctly. For more information on how to create this tile, look in the /Staxel.Content/Content/Staxel/Gatherables/ folder and check out the *.tile files.


"avoidBuildingArea"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This determines if the Catchable will avoid spawning near the buildings in the village.


"avoidVillageArea"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This determines if the Catchable will avoid spawning near the village. This is a further distance than #"avoidBuildingArea".


"idleSound"

Valid options (String): A string pointing to a Sound's code.

Default Value: If not specified, will default to playing nothing.


This will be the sound that the tile will play continuously.


"ignoreInitialWorldGen"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This allows the Catchable to avoid spawning when the player walks around the world. Used for more strict Catchables that might accidentally spawn out of their proper circumstances.


"leaveDuringOffWeather"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This determines if the Catchable will "leave" during weathers that it can't spawn in. Enforces the fact that you can only collect this in certain weathers.


"seasons"

Valid options (List of Strings): A list of strings that specify a Season. "Summer", "Winter", "Autumn", "Spring".

Default Value: If not specified, will default to All seasons.


These are the seasons that the fish can be fished in.


"spawnChance"

Valid options (Float): A positive decimal number.

Default Value: If not specified, will default to a spawn chance of 1.


This is the chance that the gatherable will respawn in a valid spot.


"spawnChanceWeight"

Valid options (Float): A positive decimal number.

Default Value: If not specified, will default to a spawn chance of 0.


This is the chance that the gatherable will spawn when compared to other gatherables. (i.e. When two gatherables want to spawn in the same spot.) Spawning should still favour the gatherable best suited to a spot.

"isFishable"

Valid options (Bool): True or False.

Default Value: If not specified will default to False.


This determines whether or not this is fishible from water. Should only be specified for *.item files.


"fishable"

This describes all that is needed in order to make a fishable item. The value "isFishable" needs to be true for this to be used in game. This part will commonly look like;

"fishable": {
  =Content=
}

"dayTimePeriod"

Valid options (Vector 2 - Float): {"x": 0.0, "y":1.0}

Default Value: If not specified, will default to All Day. (i.e. {"x": 0.0, "y":1.0})


This is the period of time in which you can catch the fish. A value of "0" is the start of the day while "1" is the end of the day. The order does matter for what periods of a day you can do;

  • If the two numbers are in ascending order (i.e. x < y), then the fish will be available in-between the two times. (e.g. {"x": 0.4, "y":0.5} means that the fish is available between 40% and 50% through the day.)
  • If the two numbers are in descending order (i.e. x > y), then the fish will be available outside of the two times.(e.g. {"x": 0.5, "y":0.4} means that the fish is available between 0-40% and 50%-100% of the day.)


"seasons"

Valid options (List of Strings): A list of strings that specify a Season. "Summer", "Winter", "Autumn", "Spring".

Default Value: If not specified, will default to All seasons.


These are the seasons that the fish can be fished in.


"size"

Valid options (String): "Small", "Medium", "Large", "Legendary"

Default Value: If not specified, will default to "Small".


This is the "size" of the fish. This mainly effects how difficult it is to catch this fish. (i.e. Whether more buttons are needed to be pressed.)


"spawnChanceWeight"

Valid options (Float): A positive decimal number.

Default Value: If not specified will default to a spawn chance of 0.


This is the chance that the fishable gatherable will spawn when compared to other fishable gatherables. (i.e. This will be compared with other fishes that are valid for that specific cast.)


"spawnsOn"

Valid options (List of Strings): A list of string that each point to a Tile's code.

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


This is all the tiles that this particular fish can be fished in. Use this to change whether the fish can be fished from the pond or at sea.


"weathers"

Valid options (List of Strings): A list of strings that specify a Weather's code.

Default Value: If not specified will default to All weathers.


These are the weathers that the fish can be fished in.


"isHarvestable"

Valid options (Bool): True or False.

Default Value: If not specified will default to False.


This determines whether or not this is able to be grabbed off the ground. Should only be specified for *.plant files.


"harvestable"

This describes all that is needed in order to make a harvestable item. The value "isHarvestable" needs to be true for this to be used in game. This part will commonly look like;

"harvestable": {
  =Content=
}


"avoidBuildingArea"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This determines if the Catchable will avoid spawning near the buildings in the village.


"avoidVillageArea"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This determines if the Catchable will avoid spawning near the village. This is a further distance than #"avoidBuildingArea".


"ignoreInitialWorldGen"

Valid options (String): True or False.

Default Value: If not specified, will default to False.


This allows the Catchable to avoid spawning when the player walks around the world. Used for more strict Catchables that might accidentally spawn out of their proper circumstances.


"spawnChance"

Valid options (Float): A positive decimal number.

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


This is the chance that the gatherable will spawn in a valid spot.

"spawnChanceWeight"

Valid options (Float): A positive decimal number.

Default Value: If not specified will default to a spawn chance of 0.


This is the chance that the gatherable will spawn when compared to other gatherables. (i.e. When two gatherables want to spawn in the same spot.) Spawning should still favour the gatherable best suited to a spot.


"spawnWeather"

Valid options (String): A string that specifies a Weather's code.

Default Value: If not specified will default to All weathers.


The weather that this gatherable can spawn in.