Difference between revisions of "Goal Component"

From wiki
Jump to: navigation, search
(Initial commit.)
 
(Update Page.)
 
(4 intermediate revisions by the same user not shown)
Line 35: Line 35:
 
This component will look somewhat similar to [[Fireworks Launcher Component]] but it is greatly simplified.
 
This component will look somewhat similar to [[Fireworks Launcher Component]] but it is greatly simplified.
  
The "goalFireworkItem" is the item is should spawn when a goal is scored. Look at [[Items#Universal Spawning Rules]] for more information. "fireworkItemQuantity" is how many fireworks it should launch. "fireworkLaunchVelocity" is how much base speed the firework should launch at. "fireworkLaunchVelocitySpread" is the additional random speed that the firework can have. "fireworkFlightSeconds" is how long these fireworks can fly for. "fireworkFlightSecondsSpread" is the amount of additional time that these fireworks can launch for. "scoreWithItemCategories", is the item categories it will look for in order to declare a goal. "hitBoxScale" is how much the hitbox of the goal will be scaled by.
+
The "goalFireworkItem" is the item is should spawn when a goal is scored. Look at [[Items#How to Spawn an Item]] for more information. "fireworkItemQuantity" is how many fireworks it should launch. "fireworkLaunchVelocity" is how much base speed the firework should launch at. "fireworkLaunchVelocitySpread" is the additional random speed that the firework can have. "fireworkFlightSeconds" is how long these fireworks can fly for. "fireworkFlightSecondsSpread" is the amount of additional time that these fireworks can launch for. "scoreWithItemCategories", is the item categories it will look for in order to declare a goal. "hitBoxScale" is how much the hitbox of the goal will be scaled by.
  
 
With that, this component is complete.
 
With that, this component is complete.
Line 49: Line 49:
  
  
=== "flightSeconds" ===
+
=== "fireworkFlightSeconds" ===
'''Valid options (Float): <code>A positive decimal number</code>'''
+
'''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number</code>'''
  
 
'''Default Value:''' If not specified, will last 0.7 seconds.
 
'''Default Value:''' If not specified, will last 0.7 seconds.
  
  
This is the amount of seconds that the item will fly upwards. Will only work if the item has a [[Fireworks Component]].
+
This is the amount of seconds that the item will fly upwards. Will only work if the item has a [[Firework Component]].
  
  
=== "flightSecondsSpread" ===
+
=== "fireworkFlightSecondsSpread" ===
'''Valid options (Float): <code>A positive decimal number</code>'''
+
'''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number</code>'''
  
 
'''Default Value:''' If not specified, will not have any variance.
 
'''Default Value:''' If not specified, will not have any variance.
  
  
This is the maximum amount of seconds that can be randomly added to "flightSeconds". Will only work if the item has a [[Fireworks Component]]
+
This is the maximum amount of seconds that can be randomly added to "fireworkFlightSeconds". Will only work if the item has a [[Firework Component]]
 +
 
 +
 
 +
=== "fireworkItemQuantity" ===
 +
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer number</code>'''
 +
 
 +
'''Default Value:''' If not specified, will fire 1 item.
 +
 
 +
 
 +
This is the amounnts of items it will shoot off as fireworks.
  
  
 
=== "fireworkLaunchVelocity" ===
 
=== "fireworkLaunchVelocity" ===
'''Valid options (Int): <code>A positive integer number</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer number</code>'''
  
 
'''Default Value:''' If not specified, will spawn 1 firework.
 
'''Default Value:''' If not specified, will spawn 1 firework.
Line 77: Line 86:
  
 
=== "fireworkLaunchVelocity" ===
 
=== "fireworkLaunchVelocity" ===
'''Valid options (Vector 3 - Double): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>'''
+
'''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Double|Double]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>'''
  
 
'''Default Value:''' If not specified, will be {"x": 0.0, "y": 17.5, "z": 0.0}.
 
'''Default Value:''' If not specified, will be {"x": 0.0, "y": 17.5, "z": 0.0}.
Line 86: Line 95:
  
 
=== "fireworkLaunchVelocitySpread" ===
 
=== "fireworkLaunchVelocitySpread" ===
'''Valid options (Vector 3 - Double): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>'''
+
'''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Double|Double]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>'''
  
 
'''Default Value:''' If not specified, will just have a zero vector (No variance).
 
'''Default Value:''' If not specified, will just have a zero vector (No variance).
Line 95: Line 104:
  
 
=== "goalFireworkItem" ===
 
=== "goalFireworkItem" ===
'''Valid options (Spawn Item): <code>See [[Items#Universal Spawning Rules]] for more information</code>'''
+
'''Valid options (Spawn Item): <code>See [[Items#How to Spawn an Item]] for more information</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 103: Line 112:
  
 
=== "hitBoxScale" ===
 
=== "hitBoxScale" ===
'''Valid options (Float): <code>A positive decimal number</code>'''
+
'''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number</code>'''
  
 
'''Default Value:''' If not specified, will be scaled by 0.5.
 
'''Default Value:''' If not specified, will be scaled by 0.5.
Line 111: Line 120:
  
 
=== "scoreWithItemCategories" ===
 
=== "scoreWithItemCategories" ===
'''Valid options (List of Strings): <code>A list of strings that are categories on items.</code>'''
+
'''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|Strings]]): <code>A list of strings that are categories on items.</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 list of categories it will look for in order to declare a goal.
 
This is the list of categories it will look for in order to declare a goal.

Latest revision as of 05:06, 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 Goal component, signified by the following;

"goal": {
  =Content=
}

Goal components are used to add customisation to the functionality of the Goal Tile. This component includes some aesthetic and functional changes.

When and How to use

Goal component is needed whenever you want to make an Goal. Specifically, an Goal component is needed whenever a Tile has it Tile#"tileStateKind" equal to "staxel.tileState.FireworksLauncher". Otherwise Fireworks Launcher component will do nothing.

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

"goals": {
  "goalFireworkItem": {
    "kind": "staxel.item.CraftItem",
    "code": "staxel.item.generic.GoalFirework"
  },
  "fireworkItemQuantity": 3,
  "fireworkLaunchVelocity": {"x": 0.0, "y": 17.5, "z": 0.0},
  "fireworkLaunchVelocitySpread": {"x": 5.0, "y": 0.0, "z": 5.0},
  "fireworkFlightSeconds": 0.7,
  "fireworkFlightSecondsSpread": 0.0
  "scoreWithItemCategories": [
    "ball"
  ],
  "hitBoxScale": 0.5
  },
},

This component will look somewhat similar to Fireworks Launcher Component but it is greatly simplified.

The "goalFireworkItem" is the item is should spawn when a goal is scored. Look at Items#How to Spawn an Item for more information. "fireworkItemQuantity" is how many fireworks it should launch. "fireworkLaunchVelocity" is how much base speed the firework should launch at. "fireworkLaunchVelocitySpread" is the additional random speed that the firework can have. "fireworkFlightSeconds" is how long these fireworks can fly for. "fireworkFlightSecondsSpread" is the amount of additional time that these fireworks can launch for. "scoreWithItemCategories", is the item categories it will look for in order to declare a goal. "hitBoxScale" is how much the hitbox of the goal will be scaled by.

With that, this component is complete.


Config Options

All config options must be inside the body of;

"goal": {
  =Config Here=
}


"fireworkFlightSeconds"

Valid options (Float): A positive decimal number

Default Value: If not specified, will last 0.7 seconds.


This is the amount of seconds that the item will fly upwards. Will only work if the item has a Firework Component.


"fireworkFlightSecondsSpread"

Valid options (Float): A positive decimal number

Default Value: If not specified, will not have any variance.


This is the maximum amount of seconds that can be randomly added to "fireworkFlightSeconds". Will only work if the item has a Firework Component


"fireworkItemQuantity"

Valid options (Integer): A positive integer number

Default Value: If not specified, will fire 1 item.


This is the amounnts of items it will shoot off as fireworks.


"fireworkLaunchVelocity"

Valid options (Integer): A positive integer number

Default Value: If not specified, will spawn 1 firework.


This is the number of fireworks that will spawn.


"fireworkLaunchVelocity"

Valid options (Vector 3 - Double): {"x": 0.0, "y": 0.0, "z": 0.0}

Default Value: If not specified, will be {"x": 0.0, "y": 17.5, "z": 0.0}.


This is the amount of speed the item will be given when spawned.


"fireworkLaunchVelocitySpread"

Valid options (Vector 3 - Double): {"x": 0.0, "y": 0.0, "z": 0.0}

Default Value: If not specified, will just have a zero vector (No variance).


This is the additional amount of random speed that will be added to the launch velocity.


"goalFireworkItem"

Valid options (Spawn Item): See Items#How to Spawn an Item for more information

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

This is the item that will be spawned in. If the item has a Fireworks component, it will do extra things but it is not needed.


"hitBoxScale"

Valid options (Float): A positive decimal number

Default Value: If not specified, will be scaled by 0.5.

This is how much the hitbox of the goal will be scaled by.


"scoreWithItemCategories"

Valid options (List of Strings): A list of strings that are categories on items.

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

This is the list of categories it will look for in order to declare a goal.