Sound alert when reaching certain speeds

Milk-Man

<b><font color="lightsteelblue">Veteran</font><fon
Something set to trigger different sounds at 2 different speeds reached. I'd like to add it to this flag sounds file so I can keep local sound events all together. No center print needed. Can anyone hook it up?

Code:
$Flag::DropSound[enemyflag]		="mine_act";
$Flag::DropSound[friendlyflag]		="shieldhit";

function Flag::DropSounds( %team, %cl ) {
	return ( %team == Client::GetTeam( getManagerId() ) ) ? ( localSound( $Flag::DropSound[friendlyflag] ) ) : ( localSound( $Flag::DropSound[enemyflag] ) );
}

Event::Attach(eventFlagDrop, Flag::DropSounds);
 
this is awesome!
If anyone gets this working you should use krogoths ascend sounds and use the wind ripple sound effect. I think there are two different ones low speed ripple and high speed rippling sounds.
 
u would need to schedule a speed check via script rather than adding to that

p.s. I think I "wrote" that flag sound script
 
there's code for a speed hud lying around somewhere

that might be enough to put it all together
 
technically its not exactly hard but

as lemon said you'd have to schedule a check to $speed regularly and it would probably trigger repeatedly if you were going over that speed unless you kept some kind of log or set a flag or something like that. can't just say if $speed > %threshold = play sound cuz it would just keep triggering on every schedule
 
here is a serverside script that would give you a bottom print screen message of your current speed in MPH

I think you can hack it and make it clientside or instead of triggering a bottom print you could trigger an overlay texture that will blur the edges giving a perception of motion blur and trigger the sounds you want.

http://library.theexiled.pwnageservers.com/download.php?id=498

and worst case, fuck it just install into the LT server cause that should have been done a long time ago. fuck this metric bs

edit: I just realized this is for 1.11 and presto+newopts... sooo idk sry lol
 
I started putting one together but it's far from completely functional. Like groove said ud have to set a flag to keep it from repeating. My example just checks every 2 seconds.

It would be nice if more people learned how to code Tribes...

Code:
$Low::Speed=30;
$High::Speed=60;

function Speed::Sounds() {
	if( $speed > $Low::Speed && $speed < $High::Speed ) {
		localSound( flierrocket );
		Schedule::Add("Speed::Sounds();", 2);
		return;
		}
		
	else if( $speed > $High::Speed ) {
		localSound( float_explode );
		Schedule::Add("Speed::Sounds();", 2);
		return;
		}
		
		
	echoc(1, "Speed = " @ $speed );
	Schedule::Add("Speed::Sounds();", 0.5);
}

Event::Attach(eventConnected, Speed::Sounds);
 
Solid lemon, thx. The repeated triggering actually isn't necessarily a bad thing as long as I can toggle it off and on and use sounds that aren't too annoying. What am I missing here with the toggle and notification print added in?

Code:
$Low::Speed=30;
$High::Speed=60;

echo("Executing - SpeedCheck");
EditActionMap("actionMap.sae");
bindCommand(keyboard0, make, "/", TO, "Speed::SoundsToggle();");

function Speed::SoundsToggle()
{
	if($Speed::Sounds == true)
	{
		$Speed::Sounds = false;
		Speed::SoundsbottomPrint("Deactivated!",3);
	}
	else if($Speed::Sounds == false)
	{
		$Speed::Sounds = true;
		Speed::SoundsbottomPrint("Activated!",3);
	}
}

function Speed::SoundsbottomPrint(%msg,%time) {
	$centerPrintId++;
	Client::centerPrint("<jc><f1>Speed Check <f0>v3.0 - By: <f1>Lemon\n<jc><f2>" @ %msg,1);
	schedule("clearCenterPrint(" @ $centerPrintId @ ");", %time);

}

function Speed::Sounds() {
	if( $speed > $Low::Speed && $speed < $High::Speed ) {
		localSound( flierrocket );
		Schedule::Add("Speed::Sounds();", 2);
		return;
		}
		
	else if( $speed > $High::Speed ) {
		localSound( float_explode );
		Schedule::Add("Speed::Sounds();", 2);
		return;
		}
		
		
	echoc(1, "Speed = " @ $speed );
	Schedule::Add("Speed::Sounds();", 0.5);
}

Event::Attach(eventConnected, Speed::Sounds);
 
working toggle
no repeats
easier sound switching

Code:
$Low::Speed=30;
$Low::Sound = "flierrocket";
$High::Speed=60;
$High::Sound = "float_explode";
$Speed::Sounds = false;


echo("Executing - SpeedCheck");
EditActionMap("actionMap.sae");
bindCommand(keyboard0, make, "/", TO, "Speed::SoundsToggle();");

function Speed::SoundsToggle()
{
	if($Speed::Sounds == true)
	{
		$Speed::Sounds = false;
		Speed::SoundsbottomPrint("Deactivated!",3);
		Schedule::Cancel("Speed::Sounds();");
	}
	else if($Speed::Sounds == false)
	{
		$Speed::Sounds = true;
		Speed::SoundsbottomPrint("Activated!",3);
		Speed::Sounds();
	}
}

function Speed::SoundsbottomPrint(%msg,%time) {
	$centerPrintId++;
	Client::centerPrint("<jc><f1>Speed Check <f0>v0.3 - By: <f1>Lemon\n<jc><f2>" @ %msg,1);
	schedule("clearCenterPrint(" @ $centerPrintId @ ");", %time);

}

function Speed::Sounds() {
	if( $speed > $Low::Speed && $speed < $High::Speed && $lastspeed != "Low" ) { 
		localSound( $Low::Sound );
		Schedule::Add("Speed::Sounds();", 0.5);
		$lastspeed = "Low";
		return;
		}
		
	else if( $speed > $High::Speed && $lastspeed != "High") {
		localSound( $High::Sound );
		Schedule::Add("Speed::Sounds();", 0.5);
		$lastspeed = "High";
		return;
		}
		
		
	echoc(1, "Speed = " @ $speed );
	Schedule::Add("Speed::Sounds();", 0.5);
}
 
Last edited:
Back
Top