Custom powerup spawns
From Fortress Blast
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.
Basic method
This method is preferred for maps without symmetry or a need to have powerups centered on a specific surface. It is also the easiest of the two methods and can be executed without opening the Hammer Editor.
- 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. Open the map you are referencing. - Point at a place you want a powerup to spawn.
- Type the command
sm_coordsjson
into console (or /coordsjson into chat), copy the output and paste it on a new line inbetween the curly brackets. - Repeat steps 2 and 3 until you have placed all powerups necessary. If the map has rotational or mirror symmetry (180 degrees only), don't place powerups on both sides of the map.
- Replace all of the # signs with the position of the coordinate in the .json file, from 1 onwards. Confirm that your .json file is acceptable by saving it and reloading the map.
- If the map has symmetry, add
"flipx": false, "flipy": false, "centerx": "0", "centery": "0",
before all the coordinates. Usesm_coordsjson
to find 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). You may have to usecl_showpos 1
if you don't know what axes need to be duplicated and flipped. - Add a tab space in front of every line between the curly brackets and remove the comma from the last coordinate in the .json file.
- 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.
Advanced and more accurate method
- 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.
- Open the .vmf version of the map in Hammer, found in
steamapps/common/Team Fortress 2/bin/hammer.exe
. - 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. - Repeat step 3 but for
info_null
. - 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.
- 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.
- 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. - 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. - 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). - 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). - 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.