So, I thought it would be neat to set up a radial menu in L4D that one could use to play sound bytes during a game with HLDJ. Going off of a radial menu tutorial (http://www.fpsbanana.com/tuts/7509), I came up with this formula:
I attempted to combine the code for binding songs to keys with the code for setting up radial menus. Unfortunately, this did not work, as it apparently had issues with recognizing the structure of the bind command with a file rather than a command. Instead, it plays whatever file was already set up in HLDJ.
If anyone can think of a way that this can be done, or if anyone knows that this cannot be done, please let me know.
Does the game specifically complain about your bind syntax? If so, remember that it cannot contain any spaces. As explained in the binding tutorial, HLDJ provides a workaround for this by allowing you to substitute spaces with the "*" character:
"bind = >$\this*path\had*spaces\in*it.wav; hldjsf; wait 80; playaudio"
Since it takes a moment to actually copy the wav file, you should introduce a delay between selecting and playing the file, as above. You can play around with this duration by adjusting the number (In pre-SDK2007 games you can use HLDJ's built-in wait command, "halfsec" (which will be deprecated and replaced by "hldj_wait" in future versions), but this will not work for L4D).
That might explain it. After some tinkering, I threw in some "halfsec" commands in, but that didn't seem to make a difference - and that would be why. As for the bind syntax, I compensated for the spaces (or just avoided them altogether), but when I looked in the console after issuing the radial command, I saw that it had responded with something like "bind [key] <command>", possibly suggesting that I had used improper syntax.
Another option, though it would have to be adjusted every time music is added, might be to have it execute the necessary commands to load a song manually (as in, for the first song in the main directory, "la; 3" or something along those lines).
Thanks for your help. I'll try it again and see if I can get it to work.
Admittedly, attempting it for the first time was a bit tedious since the game required restarting before any changes to the menus took effect, but aside from that, everything worked as expected. Again, make sure you haven't got any spaces or other weird characters in your path.
For reference, here's the script I just setup for some quick testing:
Also, if you don't want to make too much of a mess in this file, you can always simplify the binds into a single alias which you can define elsewhere. I.E. for each radial menu option, use aliases like "load_song_X" or "my_radial_north" and then define this to load whatever song you want in your hldj_custom.cfg file.