VeteranXX
|
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);
|
|
|
VeteranX
|
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.
|
|
|
Sour++ Contributor
|
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
|
|
|
VeteranXX
|
Thx lemon. Sounds like more trouble than it's probably worth.
|
|
|
VeteranXX
|
there's code for a speed hud lying around somewhere
that might be enough to put it all together
|
|
|
VeteranXX
|
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
|
|
|
VeteranX
|
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.pwnageserve...oad.php?id=498
and worst case, **** it just install into the LT server cause that should have been done a long time ago. **** this metric bs
edit: I just realized this is for 1.11 and presto+newopts... sooo idk sry lol
|
|
|
VeteranX
|
edit didnt read thread
|
|
Last edited by broast; 04-10-2017 at 10:39..
|
Sour++ Contributor
|
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);
|
|
|
VeteranXX
|
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);
|
|
|
VeteranXX
|
You're grammer will suffer
|
|
|
VeteranXX
|
Quote:
Originally Posted by Exodus
You're grammer will suffer
|
grammar
|
|
|
VeteranXX
|
what i typed wasnt a joke. you are korrect
|
|
|
VeteranXV
|
correct
korrect
korean
|
|
|
Sour++ Contributor
|
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 by lemon; 04-13-2017 at 22:09..
|
VeteranXX
|
Nice! I'll test it out tomorrow. Thx lems
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
AGENT: claudebot / Y
All times are GMT -4. The time now is 09:39.
|