HLDJ: Soundboard style

Cool tips, tricks, FAQs, scripts, binds, etc.
Post Reply
Sinistar
Game DJ
Posts: 3
Joined: Fri Apr 09, 2010 3:27 pm

HLDJ: Soundboard style

Post by Sinistar »

So, I'm looking to make a set of keys act as a "soundboard" for a few canned responses I've got audio files for.
Example: Pressing F1 selects and plays file1. The same goes for F2::file2 F3::file3 and so on.

I have created an alias in console in an attempt to recreate this soundboard style: alias "play1" "bind = file1; hldjsf; hldj_playaudio;"
And of course, bound F1 to "play1".
When I press F1, it selects and plays file1. However, upon selecting a second file to play, it plays file1 again, instead of file2. If, after playing the file1 bind, I double-tap F2, it will play file2.

I'm not quite sure what is the cause of this. It seems to be queuing file1 after I've already played it once... Any help?
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: HLDJ: Soundboard style

Post by Renegade »

that behaviour is somewhat expected since hldj_playaudio works like a toggle (tap once for on, again for off); you might find it more convenient to use hldj_playaudio_on/off instead. So your alias might look like:

Code: Select all

alias "play1" "bind = file1; hldjsf; hldj_playaudio_off; hldj_playaudio_on"
which first stops whatever might be playing, then starts the loaded file. You may need to add a few waits before issuing hldj_playaudio_on but with the latest version of HLDJ it's usually not necessary.

Also, in case you haven't already, be sure to check out the sticky/tutorial in this forum on binding songs to keys.
Sinistar
Game DJ
Posts: 3
Joined: Fri Apr 09, 2010 3:27 pm

Re: HLDJ: Soundboard style

Post by Sinistar »

Bonus points for the quick reply.

Okay, cool. I figured it would involve something like that but I think I kept using the _off command in the wrong places.
I'll try to set it up using that advice and let you know how it works.
Sinistar
Game DJ
Posts: 3
Joined: Fri Apr 09, 2010 3:27 pm

Re: HLDJ: Soundboard style

Post by Sinistar »

No joy.

Putting the command in that spot doesn't appear to work. It seems like it's stopping the audio I just selected, leaving the current audio as none.
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: HLDJ: Soundboard style

Post by Renegade »

Seems I lied, a bit of a wait is necessary (though last time I tested, load times were near instantaneous).

Code: Select all

alias "play1" "bind = file1; hldjsf; wait 10; hldj_playaudio_off; hldj_playaudio_on"
If the game uses a pre-Source2007 engine, you'll need to replace "wait 10" with ten actual "wait"s or "hldjw" or however many you find is necessary.
Game Zombie
Game DJ
Posts: 13
Joined: Fri Feb 12, 2010 8:12 pm

Re: HLDJ: Soundboard style

Post by Game Zombie »

Renegade wrote:Seems I lied, a bit of a wait is necessary (though last time I tested, load times were near instantaneous).

Code: Select all

alias "play1" "bind = file1; hldjsf; wait 10; hldj_playaudio_off; hldj_playaudio_on"
If the game uses a pre-Source2007 engine, you'll need to replace "wait 10" with ten actual "wait"s or "hldjw" or however many you find is necessary.
Actually if your using hldj with a older Source game you can just put into your autoexec.cfg

Code: Select all

 alias "wait 10" "wait; wait; wait; wait; wait; wait; wait; wait; wait; wait" 
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: HLDJ: Soundboard style

Post by Renegade »

To add to that, "hldjw" / "hldj_wait" is aliased to about 70 waits.
Post Reply