PSA - Custom Script Files

Hey all,
So over the course of developing Stojkeholm (Have I announced that publicly? I guess I’m announcing that publicly. I’m making a short SP Map pack.) I had the need for some custom files. Due to the Steampipe updates way back the engine doesn’t (currently) allow overrides, so it’s basically impossible to override certain files, (namely the manifests needed to load custom scripts) and I had to go digging deep in the VDC and do a bit of first-hand research for workarounds. For anyone interested, the following files can be used to add custom content to your map that would otherwise require editing a manifest:

[table]
[tr]
[td]Soundscapes[/td]
[td]scripts/soundscapes_[mapname].txt[/td]
[/tr]
[tr]
[td]Particles[/td]
[td]maps/[mapname]_particles.txt[/td]
[/tr]
[tr]
[td]Soundscripts[/td]
[td]maps/[mapname]_level_sounds.txt[/td]
[/tr]
[/table]
I have confirmed firsthand that these files allow the loading of custom assets defined within them on the current Black Mesa branch of Source. To my knowledge, at the time of writing (July 23, 2017) no other script files requiring a manifest have per-map alternatives - if anyone else has knowledge to the contrary, please let me know by posting down below.

There is one more caveat - at present, tools mode (-tools -nop4) is non-functional in public builds of the steam version of Black Mesa. As such, if you want to make or modify particles, you’ll need to find a workaround involving another version of the engine - I personally used the mod version of Black Mesa so I wouldn’t have to extract a bunch of stuff from the VPKs. Unless you’re using CS:GO or DOTA 2, The format definitely hasn’t changed so they should be compatible with BM.

I hope this small info dump helps people who are looking to add some extra atmosphere to their BM maps, and I plan on updating this thread if I figure out ways to load more content or get word from the devs that the game has been updated to allow additional per-map scripts.
Happy Mapping!

An issue I’ve had in my custom maps with custom sounds:

Some sounds would not be recognised by the engine as the console whines about not finding them with the path put in for the sounds (ambient_generics).

However inputting a snd_restart in the console fixes this.
So the mapper would have to put in the snd_restart with a point_clientcommand at startup of the map.

The issue being that snd_restart stops all playing sounds so you can’t have any sound be looping at the start of the map,
and if the user loads a save from the map with a fresh startup of the game (thus missing the snd_restart) the sounds will not play.

Maybe the custom sound_scripts.txt fixes this. Guess I’ll have to test it.

Haven’t had any luck getting custom soundscripts to work- I’ve tried putting the file pd_c1a2a_level_sounds.txt in bms/scripts/maps, bms/scripts, and bms/maps and have not been able to get it to either show up in the Hammer sound browser or play from an ambient_generic in game. It contains the following text:

"OCPD.TURRET_IS_ON"
{
	"channel"		"CHAN_STREAM"
	"volume"		"1.0"
	"pitch"			"100"
	"soundlevel"	"SNDLVL_NORM"
	"wave"			"vox_overhead\c1a2_06.wav"
}

There is no text printed to the console, relating to not finding the .wav file or anything else.

I think you need to add the file to game_sounds_manifest.txt to make it show up in Hammer, but it should work when you run the map in game. Remember to remove the custom game_sounds_manifest.txt before you test the map.

	"precache_file"		"maps/pd_c1a2a_level_sounds.txt"

The tools isn’t working because of a missing file. Create a text file called enginetools.txt in the ...\Black Mesa\bin folder with the following contents:

"enginetools"
{
	"library"	"tools/actbusy.dll"
	"library"	"tools/commedit.dll"
	"library"	"tools/pet.dll"
	"library"	"tools/vcdblock.dll"
	"library"	"tools/vmt.dll"
}

The tools mode (-tools -nop4) should now work.

1 Like

Figured out what the problem was- the sound was actually loading fine, but the ent_fire console command I was using to trigger the ambient_generic that played it only works if developer 1 is set in the console. Linking the ambient_generic to an entity in the world or triggering it with ent_fire after setting developer mode both work, with or without a modified game_sounds_manifest.

You should post this over on the steam forums. This is rather helpful if you ask me.