[T1]Calling a custom sound for local, client side

HashPipe
03-30-2007, 07:41 PM
Hey guys. I'm coming from T2c, and I just recently got into T1 a few weeks ago. It's taking some time to get used to, but I'm coming along. However, there's a few things I'm just so used to with T2 that I can't live without in T1. One of them is the sounds for the flag (ie. flag taken, capture, returned, and dropped). I grabbed the T2 sounds, renamed them, and put them into sound.vol with no problems. I can hear the flag taken, returned, and captured. However, I can't hear flag dropped. I'm guessing this is flagflap in sound.vol?


So last weekend I spent some time looking through the code. I couldn't find where flagflap is called at all so I thought I'd find a way to call a custom sound myself. Unfortunately, I can't figure it out. Basically, I took the code from waypoint.cs and told it to send me a local client side T1 sound whenever the flag dropped. I would like to call that custom T2 sound though. I'm guessing it has something to do with remoteEval, but I don't understand how that method works. Does anyone know how I can do this?

random
03-30-2007, 09:40 PM
I don't think there is a default drop-flag sound.

Depending on your script pack, you just need something that executes sound("flag_dropped.wav"); on your Event::FlagDropped or something.
Someone who uses an Events config and reads this can probably script this up for you.

Lemon
03-31-2007, 02:38 AM
bump this thread tomorrow and I'll code whatever t1 flag event sounds you want for whatever config....
im just too drunk/high in a minute right now...
seriously...easy money...

Plasmatic
03-31-2007, 05:36 AM
Yes this is easy, but I'm le tired.

HashPipe
03-31-2007, 10:45 AM
Well, have a nap. THEN FIRE Z MISSILES!!!

Yeah, I downloaded this setup from whatever Severed posted a long time ago. I didn't realize that configurations differed that much. Flag awareness in T2 is about simple with the iff indicators. But I'm having a helluva time in T1 though. Half the time I'm skiing around the base trying to figure where the enemy fc is at. I just figured putting up the T2 sounds would keep me a bit more focused since that's what I've been used to for so long.

But anyway, if someone to code that up for me, that would be amazing. I'd definitely appreciate it.

Lemon
03-31-2007, 12:02 PM
At the bottom of autoexec.cs in your config folder put this
Event::Attach(eventFlagDr opped, "sound(\"flagflap.wav\");");

HashPipe
03-31-2007, 02:43 PM
That's awesome! One line of code, and it works great. I spent so many hours trying to figure this out. Thanks a bunch.

Also, what scope is the sound() function? Can anyone else hear it? Should I rename the flagflap.wav file to something custom?

Thanks again.

Lemon
03-31-2007, 04:24 PM
sound() is clientside only and is built into 1.3. Your .wav can be pretty much any sound in your sounds.vol or in voices. You could also do localmessage("yourwav.wav"); and make it a local sound.

I just made this for my config. Different sounds depending on which flag drops.

Event::Attach(eventFlagDr opped, flagsounds);

$mydrop="mine_act.wav";
$nmedrop="shieldhit.wav";

function flagsounds(%teamid, %playerid){
if(%teamid==Client::GetTe am(getmanagerId()))
sound($mydrop);
else
sound($nmedrop);
}

CoJack
04-24-2007, 09:33 AM
edit: so if i was to copy the above code, throw it in a .cs file and execute it, it should work ya? using presto and newopts btw.

edit2: that is awesome! thx. <3