Custom powerup spawns

From Fortress Blast
Revision as of 18:30, 24 November 2019 by Jack5 (talk | contribs) (Changed to use integers)
Jump to navigationJump to search

It is wise to fully understand how powerup locations are defined before reading this page. What follows are instructions on how to make a custom .json file.

  1. If you don't have a .vmf version of the map you want to create a .json file for, decompile the map's .bsp using BSPSource.
  2. Open the .vmf version of the map in Hammer, found in steamapps/common/Team Fortress 2/bin/hammer.exe.
  3. Select the Entity Tool on the left pane, change the value of the Objects box in the right pane to info_powerup_spawn and click somewhere in the 3D view to place this entity down.
  4. Repeat step 3 but for info_null.
  5. Using the 2D views, move these two entities so that both of their origins are at the same point in 3D space. You should try to keep the entities as close to the ground as possible, without too much of the outlined bounding box going through the floor.
  6. Use a combination of cutting, copying and pasting to place these two entities in several positions around the map. Make sure that you move both at the same time, otherwise they will become out of sync. If the map has rotational or mirror symmetry (180 degrees only), don't place the entities on both sides of the map.
  7. Create a .json file in tf/scripts/fortressblast/powerup_spots/<map name here>.json. Start with three lines: a { in the first, a } in the second and nothing in the third.
  8. If you want to order the coordinates in your .json file, use the 3D view to fly around the map and click on the small box (info_null) underneath each info_powerup_spawn you placed (do not select the powerups). If you are not concerned about order, select Map > Entity Report... in the topbar, and check the box that says By class, typing INFO_NULL into the box beneath it, and clicking on each entry one by one.
  9. As you click through each info_null, you will see a string in the bottom-right corner of Hammer that reads something like 0w 0l 0h @(0, 0, 0). The three values in the brackets are the X, Y and Z coordinates for that powerup. Add a new line inbetween the curly brackets of the .json for each info_null, specifying their order and coordinates like so: "5-x": "123", "5-y": "-1337", "5-z": "0", (Do not include a comma at the end if it is the last powerup).
  10. If the map has symmetry, add "flipx": false, "flipy": false, "centerx": "0", "centery": "0", before all the coordinates. Set the X and Y coordinates of the center of the map, and specify whether the map should flip by X or Y (mirror) or both (rotational).
  11. After testing the .json file to make sure it works as expected in Fortress Blast, you can optionally submit the file to the Fortress Blast maps repository by forking it, adding your file and sending a pull request. Your file will be reviewed by someone on the Fortress Blast team and added if the map and powerup placements are of high quality.