Difference between revisions of "Spawner Component"

From wiki
Jump to: navigation, search
(Initial commit.)
 
(Update Page.)
 
(2 intermediate revisions by the same user not shown)
Line 38: Line 38:
 
This particular section spawns a Villager however it is fairly easy to specify and/or a FarmAnimal as well.
 
This particular section spawns a Villager however it is fairly easy to specify and/or a FarmAnimal as well.
  
Firstly, the universal properties. "suppressRendering" is used to stop the tile from rendering in the world. This is often used for things already placed in the world as part of a building. "spawnParticles" is the [[Particles]] that it will play while spawning. "spawnEmote" is the [[Emotes|Emote]] that will play while spawning. "spawnDelay" is how much delay, in microseconds after activation, there will be before any items or entities spawn. "destroyDelay" is how much delay, in microseconds after activation, there will be before the tile destroys itself.
+
Firstly, the universal properties. [[#"suppressRendering"]] is used to stop the tile from rendering in the world. This is often used for things already placed in the world as part of a building. [[#"spawnParticles"]] is the [[Particles]] that it will play while spawning. [[#"spawnEmote"]] is the [[Emotes|Emote]] that will play while spawning. [[#"spawnDelay"]] is how much delay, in microseconds after activation, there will be before any items or entities spawn. [[#"destroyDelay"]] is how much delay, in microseconds after activation, there will be before the tile destroys itself.
  
After there are three different properties depending on what you want to spawn. "farmAnimalCode" is used to spawn a [[Farm Animals|Farm Animal]]. "treasure" is used to spawn items from a [[Treasures|Treasure]]. Finally, "villager" is used to spawn a [[Villager NPCs|Villager]]. There are two different ways for "villager", the first and simplest is using the "code" value and using a code of a [[Villager NPCs|Villager NPC]] file. The second is to specify [[Villager Personalities|"personality"]], [[Villager Designs|"design"]], [[Villager Outfits|"outfit"]] and a "name". Each of these need their respective codes, although "name" is just whatever you want to name this villager.
+
After there are three different properties depending on what you want to spawn. [[#"farmAnimalCode"]] is used to spawn a [[Farm Animals|Farm Animal]]. [[#"treasure"]] is used to spawn items from a [[Treasure Pools|Treasure Pool]]. Finally, [[#"villager"]] is used to spawn a [[Villager NPCs|Villager]]. There are two different ways for "villager", the first and simplest is using the [[#"code"]] value and using a code of a [[Villager NPCs|Villager NPC]] file. The second is to specify [[Villager Personalities|"personality"]], [[Villager Designs|"design"]], [[Villager Outfits|"outfit"]] and a [[#"name"]]. Each of these need their respective codes, although "name" is just whatever you want to name this villager.
  
 
With that you have specified everything needed to spawn something.
 
With that you have specified everything needed to spawn something.
Line 54: Line 54:
  
 
== "destroyDelay" ==
 
== "destroyDelay" ==
'''Valid options (Int): <code>A positive integer value.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer value.</code>'''
  
'''Default Value:''' False.
+
'''Default Value:''' No default value is specified. Always need to provide your own.
  
  
Line 63: Line 63:
  
 
== "farmAnimalCode" ==
 
== "farmAnimalCode" ==
'''Valid options (String): <code>A string which points to a [[Farm Animals|Farm Animal]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Farm Animals|Farm Animal]] code.</code>'''
  
'''Default Value:''' If not specifies, will not spawn any farm animals.
+
'''Default Value:''' If not specified, will not spawn any farm animals.
  
  
Line 72: Line 72:
  
 
== "spawnDelay" ==
 
== "spawnDelay" ==
'''Valid options (Int): <code>A positive integer value.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer value.</code>'''
  
'''Default Value:''' False.
+
'''Default Value:''' No default value is specified. Always need to provide your own.
  
  
Line 81: Line 81:
  
 
== "spawnEmote" ==
 
== "spawnEmote" ==
'''Valid options (String): <code>A string which points to a [[Emotes|Emote]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Emotes|Emote]] code.</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.
Line 90: Line 90:
  
 
== "spawnParticles" ==
 
== "spawnParticles" ==
'''Valid options (String): <code>A string which points to a [[Particles|Particle System]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Particles|Particle System]] code.</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.
Line 99: Line 99:
  
 
== "suppressRendering" ==
 
== "suppressRendering" ==
'''Valid options (Bool): <code>True or False</code>'''
+
'''Valid options ([[Modding_Key_Terms#Bool|Bool]]): <code>True or False</code>'''
  
 
'''Default Value:''' If not specified, will be false.
 
'''Default Value:''' If not specified, will be false.
Line 108: Line 108:
  
 
== "treasure" ==
 
== "treasure" ==
'''Valid options (String): <code>A string which points to a [[Treasures|Treasure]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Bool|Bool]]): <code>A string which points to a [[Treasure Pools|Treasure Pool]] code.</code>'''
  
'''Default Value:''' If not specifies, will not spawn any treasure.
+
'''Default Value:''' If not specified, will not spawn any treasure.
  
  
Line 137: Line 137:
  
  
== "code" ==
+
=== "code" ===
'''Valid options (String): <code>A string which points to a [[Villager NPCs|Villager NPC]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Villager NPCs|Villager NPC]] code.</code>'''
  
 
'''Default Value:''' If not specified, will not use an already made file, but will use the other properties specified below.
 
'''Default Value:''' If not specified, will not use an already made file, but will use the other properties specified below.
Line 146: Line 146:
  
  
== "design" ==
+
=== "design" ===
'''Valid options (String): <code>A string which points to a [[Villager Designs|Villager Design]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Villager Designs|Villager Design]] code.</code>'''
  
 
'''Default Value:''' Only used when [[#"code"]] is not specified. Otherwise if not specified, may lead to a random design.
 
'''Default Value:''' Only used when [[#"code"]] is not specified. Otherwise if not specified, may lead to a random design.
Line 155: Line 155:
  
  
== "name" ==
+
=== "name" ===
'''Valid options (String): <code>Any string.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>Any string.</code>'''
  
 
'''Default Value:''' Only used when [[#"code"]] is not specified. Otherwise if not specified, may not spawn a villager.
 
'''Default Value:''' Only used when [[#"code"]] is not specified. Otherwise if not specified, may not spawn a villager.
Line 164: Line 164:
  
  
== "personality" ==
+
=== "personality" ===
'''Valid options (String): <code>A string which points to a [[Villager Personalities|Villager Personality]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Villager Personalities|Villager Personality]] code.</code>'''
  
 
'''Default Value:''' Only used when [[#"code"]] is not specified.
 
'''Default Value:''' Only used when [[#"code"]] is not specified.
Line 173: Line 173:
  
  
== "outfit" ==
+
=== "outfit" ===
'''Valid options (String): <code>A string which points to a [[Villager Outfits|Villager Outfit]] code.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which points to a [[Villager Outfits|Villager Outfit]] code.</code>'''
  
 
'''Default Value:''' Only used when [[#"code"]] is not specified. Otherwise if not specified, may lead to a random ourfit.
 
'''Default Value:''' Only used when [[#"code"]] is not specified. Otherwise if not specified, may lead to a random ourfit.

Latest revision as of 06:04, 14 December 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 Spawner component, signified by the following;

"spawner": {
  =Content=
},

Spawner components are components which specify something that should be spawned. These components have a couple different things they can spawn;

  • Villagers
  • Treasure
  • Farm Animals

It also specifies extra aesthetic affects to go along with the spawning animation.


When and How to use

Spawner component is needed whenever you want to spawn any of the things listed aboce. A Spawner component is specifically used whenever a Tile has it Tile#"tileStateKind" equal to "staxel.tileState.SpawningCrate". Otherwise Spawner component will do nothing.

To start off with first, you will need to create a Tile with Tile#"tileStateKind" equal to "staxel.tileState.Spawner". Once that is done, you can add the following below the last property of the file;

"spawner": {
  "suppressRendering": true,
  "spawnParticles": "",
  "spawnEmote": "",
  "spawnDelay": 0,
  "destroyDelay": 1000000,
  "villager": {
    "code": "staxel.village.character.Maximilian"
  }
}

This particular section spawns a Villager however it is fairly easy to specify and/or a FarmAnimal as well.

Firstly, the universal properties. #"suppressRendering" is used to stop the tile from rendering in the world. This is often used for things already placed in the world as part of a building. #"spawnParticles" is the Particles that it will play while spawning. #"spawnEmote" is the Emote that will play while spawning. #"spawnDelay" is how much delay, in microseconds after activation, there will be before any items or entities spawn. #"destroyDelay" is how much delay, in microseconds after activation, there will be before the tile destroys itself.

After there are three different properties depending on what you want to spawn. #"farmAnimalCode" is used to spawn a Farm Animal. #"treasure" is used to spawn items from a Treasure Pool. Finally, #"villager" is used to spawn a Villager. There are two different ways for "villager", the first and simplest is using the #"code" value and using a code of a Villager NPC file. The second is to specify "personality", "design", "outfit" and a #"name". Each of these need their respective codes, although "name" is just whatever you want to name this villager.

With that you have specified everything needed to spawn something.


Config Options

All config options must be inside the body of;

"spawner": {
  =Config Here=
}

"destroyDelay"

Valid options (Integer): A positive integer value.

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


This is the amount of microseconds that will need to pass before destroying the original tile.


"farmAnimalCode"

Valid options (String): A string which points to a Farm Animal code.

Default Value: If not specified, will not spawn any farm animals.


This is the Farm Animal that will spawned.


"spawnDelay"

Valid options (Integer): A positive integer value.

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


This is the amount of microseconds that will need to pass before anything is spawned.


"spawnEmote"

Valid options (String): A string which points to a Emote code.

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


This is the emote that will be used when spawning. Having no value (i.e. Using "") will mean that no emote plays.


"spawnParticles"

Valid options (String): A string which points to a Particle System code.

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


These are the particles that will be used when spawning. Having no value (i.e. Using "") will mean that no particles play.


"suppressRendering"

Valid options (Bool): True or False

Default Value: If not specified, will be false.


This will be whether or not the tile will be visible. This is useful for hiding the spawning tiles of Villagers and similar that are in the village already.


"treasure"

Valid options (Bool): A string which points to a Treasure Pool code.

Default Value: If not specified, will not spawn any treasure.


This is the Treasure pool that will be used to spawn items.


"villager"

This specifies a villager that is to be spawned. There are two major types of spawning. The first is as follows;

"villager": {
  "code": "staxel.village.character.Maximilian"
}

This specifically calls for a Villager NPC code, and will spawn that NPC.

The second is as follows;

"villager": {
  "personality": "staxel.village.personilty.whatever",
  "design": "staxel.village.design.whatever",
  "outfit": "staxel.village.outfit.whatever",
  "name": "Villager 1"
}

This specifies each individual trait of a villager. This is mainly kept as backwards compatibility. Try using the Villager NPC method first.


"code"

Valid options (String): A string which points to a Villager NPC code.

Default Value: If not specified, will not use an already made file, but will use the other properties specified below.


This is the already created villager that it will spawn.


"design"

Valid options (String): A string which points to a Villager Design code.

Default Value: Only used when #"code" is not specified. Otherwise if not specified, may lead to a random design.


This is the design of the villager that is to be spawned. As mentioned already, if "code" is specified this will not be used.


"name"

Valid options (String): Any string.

Default Value: Only used when #"code" is not specified. Otherwise if not specified, may not spawn a villager.


This is the name of the villager that is to be spawned. As mentioned already, if "code" is specified this will not be used.


"personality"

Valid options (String): A string which points to a Villager Personality code.

Default Value: Only used when #"code" is not specified.


This is the personality of the villager that is to be spawned. As mentioned already, if "code" is specified this will not be used.


"outfit"

Valid options (String): A string which points to a Villager Outfit code.

Default Value: Only used when #"code" is not specified. Otherwise if not specified, may lead to a random ourfit.


This is the outfit of the villager that is to be spawned. As mentioned already, if "code" is specified this will not be used.