Design PointTemplate with hammer map editor

From SigMod
Jump to navigation Jump to search

For complex PointTemplates, it may be beneficial to use the map editor to speed up design process. In this guide, it is expected that you have basic Hammer knowledge

Limitations[edit | edit source]

  • Only point and brush entities can be used in PointTemplates. World brushes and entities like func_detail, prop_static, light, will not work
  • Brush entities are not visible
  • Brush entities are automatically converted to axis aligned bounding boxes
  • Brush entities only rotate if their parent rotates

Design[edit | edit source]

Tank / Bot PointTemplate[edit | edit source]

Start up Hammer and create a new file. In the origin of the map, create a prop_detail entity with the model of the tank or bot (models/bots/boss_bot/boss_tank.mdl and other bots models are in /models/bots directory).

Tank prop used to preview how the tank would be seen in the game

Create additional entities as you would like to see them in the game, like this:

Tank with entities

Save the map file somewhere, then open it with a text editor. Copy all sections with "entity". Open the popfile, then in WaveSchedule, create a new section:

PointTemplates
{
	TemplateName
	{
		Paste the copied text from map file here
	}
}

Example:

PointTemplates [$SIGSEGV]
{
	TemplateName
	{
		entity
		{
			"id" "10"
			"classname" "light_dynamic"
			"_cone" "45"
			"_inner_cone" "30"
			"_light" "255 255 255 0"
			"angles" "0 0 0"
			"brightness" "0"
			"distance" "0"
			"pitch" "0"
			"spawnflags" "3"
			"spotlight_radius" "80"
			"style" "0"
			"target" "turretSpider_trackdir"
			"targetname" "turretSpider_projected"
			"origin" "44 -6.001 199.999"
		}
		entity
		{
			"id" "18"
			"classname" "logic_timer"
			"RefireTime" "0.35"
			"spawnflags" "0"
			"StartDisabled" "1"
			"targetname" "turretSpider_firetimer"
			"UseRandomTime" "0"
			connections
			{
				"OnTimer" "turretSpider_firerelay,Trigger,,0,-1"
			}
			"origin" "-196 -48.352 12.004"
		}
	}
}

Now, in Tank/TFBot spawner, create a new value

SpawnTemplate TemplateName [$SIGSEGV]

This will spawn the entities parented to the bot/tank

Mission / Wave Point Template[edit | edit source]

Download BSPSource https://github.com/ata4/bspsrc/releases and use it to decompile the map. Load the map in hammer. In menu, select Instancing->Create Manifest. Select View->Screen Elements->Manifest Bar if not already selected.

On the right side, a panel named Manifest would appear. Right click on it and select Insert->Empty Sub Map.

Manifest Panel

In the window that appears, Set the filename and friendly name. Now click on the newly created item in the manifest panel. Any entity created in this mode will be spawned by the pointtemplate. To switch back, click the unnamed item.

Once you are done creating entities, save the map. Now, navigate to the directory where the map was saved, then to the newly created directory with the same name as the map name. Open the file that has the same name as specified in New Sub Map dialog, in the text editor. Now follow the same steps as with the section above, but now, the SpawnTemplate value should be put in WaveSchedule or Wave.