Powerup spawns: Difference between revisions

From Fortress Blast
Jump to navigationJump to search
m (THE EARTH IS FLAT!)
(Added link and changed to use integers)
Line 1: Line 1:
Powerup locations in a map are defined by the file <code>tf/scripts/fortress_blast/powerup_spots/<map name here>.json</code>. Below is an example of a valid .json file. If there is a syntax error in a .json file, it will not be used by Fortress Blast to spawn powerups, but it will be treated as a valid file by [[ConVars]].
Powerup locations in a map are defined by the file <code>tf/scripts/fortress_blast/powerup_spots/<map name here>.json</code>. Below is an example of a valid .json file. If there is a syntax error in a .json file, it will not be used by Fortress Blast to spawn powerups, but it will be treated as a valid file by [[ConVars]].
<!--- spaces in the beginning are important -- they add the code formats -->
 
  {
  {
     "flipx": false, "flipy": true, "centerx": "0.0", "centery": "0.0",
     "flipx": false, "flipy": true, "centerx": "0", "centery": "0",
     "1-x": "64.0", "1-y": "0.0", "1-z": "0.0",
     "1-x": "64", "1-y": "0", "1-z": "0",
     "2-x": "0.0", "2-y": "64.0", "2-z": "0.0"
     "2-x": "0", "2-y": "64", "2-z": "0"
  }
  }
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 14: Line 15:
| <code>"flipy": <boolean></code> || Sets whether powerup spawns should be duplicated across the Y-axis along the coordinate set by the center attributes. If X-axis flipping is false, spawns situated along the Y-axis of the center coordinate will not be duplicated. Otherwise, rotational symmetry will occur and only the spawn located at the exact center will not be duplicated.
| <code>"flipy": <boolean></code> || Sets whether powerup spawns should be duplicated across the Y-axis along the coordinate set by the center attributes. If X-axis flipping is false, spawns situated along the Y-axis of the center coordinate will not be duplicated. Otherwise, rotational symmetry will occur and only the spawn located at the exact center will not be duplicated.
|-
|-
| <code>"centerx": <string></code> || Sets the X-axis center coordinate of the map, which is used when duplicating and flipping powerups. The string must contain a decimal value.
| <code>"centerx": <string></code> || Sets the X-axis center coordinate of the map, which is used when duplicating and flipping powerups. The string must contain an integer or decimal value.
|-
|-
| <code>"centery": <string></code> || Sets the Y-axis center coordinate of the map, which is used when duplicating and flipping powerups. The string must contain a decimal value.
| <code>"centery": <string></code> || Sets the Y-axis center coordinate of the map, which is used when duplicating and flipping powerups. The string must contain an integer or decimal value.
|-
|-
| <code>"<#>-x": <string></code> || Sets the X-axis coordinate of a single powerup spawn. The string must contain a decimal value.
| <code>"<#>-x": <string></code> || Sets the X-axis coordinate of a single powerup spawn. The string must contain an integer or decimal value.
|-
|-
| <code>"<#>-y": <string></code> || Sets the Y-axis coordinate of a single powerup spawn. The string must contain a decimal value.
| <code>"<#>-y": <string></code> || Sets the Y-axis coordinate of a single powerup spawn. The string must contain an integer or decimal value.
|-
|-
| <code>"<#>-z": <string></code> || Sets the Z-axis coordinate of a single powerup spawn. The string must contain a decimal value.
| <code>"<#>-z": <string></code> || Sets the Z-axis coordinate of a single powerup spawn. The string must contain an integer or decimal value.
|}
|}


In order to ensure a valid .json file, the following rules should be adhered to:
When editing or [[Custom powerup locations|creating a .json file]], the following rules should be adhered to:
 
* If flipping is required, keep the flipping and map center attributes on the topmost content line. Otherwise, the entire line and its attributes can safely be removed.
* If flipping is required, keep the flipping and map center attributes on the topmost content line. Otherwise, the entire line and its attributes can safely be removed.
* Keep the X-axis, Y-axis and Z-axis coordinate attributes together in triplets on each other content line, in order from 1 onwards.
* Keep the X-axis, Y-axis and Z-axis coordinate attributes together in triplets on each other content line, in order from 1 onwards.
* Make sure to place a comma at the end of every content line except for the last.
* Make sure to place a comma at the end of every content line except for the last.

Revision as of 18:29, 24 November 2019

Powerup locations in a map are defined by the file tf/scripts/fortress_blast/powerup_spots/<map name here>.json. Below is an example of a valid .json file. If there is a syntax error in a .json file, it will not be used by Fortress Blast to spawn powerups, but it will be treated as a valid file by ConVars.

{
    "flipx": false, "flipy": true, "centerx": "0", "centery": "0",
    "1-x": "64", "1-y": "0", "1-z": "0",
    "2-x": "0", "2-y": "64", "2-z": "0"
}
Attribute Description
"flipx": <boolean> Sets whether powerup spawns should be duplicated across the X-axis along the coordinate set by the center attributes. If Y-axis flipping is false, spawns situated along the X-axis of the center coordinate will not be duplicated. Otherwise, rotational symmetry will occur and only the spawn located at the exact center will not be duplicated.
"flipy": <boolean> Sets whether powerup spawns should be duplicated across the Y-axis along the coordinate set by the center attributes. If X-axis flipping is false, spawns situated along the Y-axis of the center coordinate will not be duplicated. Otherwise, rotational symmetry will occur and only the spawn located at the exact center will not be duplicated.
"centerx": <string> Sets the X-axis center coordinate of the map, which is used when duplicating and flipping powerups. The string must contain an integer or decimal value.
"centery": <string> Sets the Y-axis center coordinate of the map, which is used when duplicating and flipping powerups. The string must contain an integer or decimal value.
"<#>-x": <string> Sets the X-axis coordinate of a single powerup spawn. The string must contain an integer or decimal value.
"<#>-y": <string> Sets the Y-axis coordinate of a single powerup spawn. The string must contain an integer or decimal value.
"<#>-z": <string> Sets the Z-axis coordinate of a single powerup spawn. The string must contain an integer or decimal value.

When editing or creating a .json file, the following rules should be adhered to:

  • If flipping is required, keep the flipping and map center attributes on the topmost content line. Otherwise, the entire line and its attributes can safely be removed.
  • Keep the X-axis, Y-axis and Z-axis coordinate attributes together in triplets on each other content line, in order from 1 onwards.
  • Make sure to place a comma at the end of every content line except for the last.