Author Topic: Adding Yell sounds.  (Read 2302 times)

0 Members and 1 Guest are viewing this topic.

Lidge Farkley

  • Uber Menace
  • *******
  • Posts: 1,357
  • Reputation: +2/-3
    • http://www.angelfire.com/ca2/psychosworld2/
Adding Yell sounds.
« on: November 17, 2003 07:52 pm CST »
Hey!

I just thought it would be kind of neat to add a function that triggers your character to yell if your velocity is fast enough.  I figure it would be a kinda cool/funny thing to hear as your character plumets from the Den or when you and a friend are bashing one an other accross the map. :-)

This could be vertical as well as horizontal speed... but I would not know where to start or where to implement such a thing.  For example; #recall works on your velocity, but the player triggers that themself, so this would not be a practical way to implement such a thing.

The only thing I can think of is to have each player velocity to report somewhere and when the value for a given player gets greater than or equal to the yell-start velocity, then it does start the yelling.  How to do this with out causing too much procesor use... I don't know?  Maybe the client side could be in charge of it some how... so it would not be a required part of the mod to play, just a funny bonus?  (if that is possible... I don't know much about this stuff any more, and I'm just brainstorming at work.)

hmmmmm.......  thanks for reading. :-)
« Last Edit: December 31, 1969 06:00 pm CST by Lidge Farkley »
Lend your heart unto the divine mineral TOPAZ;
from which our reverent hearts and minds sprang.
Also Known As:  Alcoholic 007
My Page of tribes Tools and Helpful "FAQ" Stuff

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #1 on: November 17, 2003 08:57 pm CST »
Note: With this current sound it is client-side. If you don't wish to have it client-side then change the sound to one everyone has. If you don't know how to change the sound, then you shouldn't be thinking about this anyway.

Code: [Select]
//This goes in nsound.cs This is for the custom sound
SoundData SoundScream
{
wavfilename = "fallscream.wav";
profile = Profile3dMedium;
};

// This goes in gameevents.cs at the bottom of the recrusiveworld function before the schedule that recalls the function
%slist = GetEveryoneIdList();
for(%p = 0; GetWord(s%list, %p) != -1; %p++){

%pid = GetWord(%slist, %p);
%pvel = Item::getVelocity(%pid);
GameBase::getLOSinfo(%pid, 50000);
if(getWord(%pvel, 1) < -29)
playsound(SoundScream, $los::position);
else if(getWord(%pvel, 1) > 29)
playsound(SoundScream, $los::position);
else if(getWord(%pvel, 2) < -29)
playsound(SoundScream, $los::position);
else if(getword(%pvel, 2) > 29)
playsound(SoundScream, $los::position);
else if(getWord(%pvel, 3) < -29)
playsound(SoundScream, $los::position);
}


This will check your velocity every 5 seconds. I added it to the recrusive function so you wouldn't have to write another laggy loop. So.. In other words.. When you fall, how long you fall, and how fast you fall determines if the sound plays or not. If you fall long enough, it will play the sound over.. More intense I guess.

Oh.. and for the custom sound.. Hang on let me upload it to my web site..

here we go..

http://urn.ath.cx/fallscream.rar
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

Lidge Farkley

  • Uber Menace
  • *******
  • Posts: 1,357
  • Reputation: +2/-3
    • http://www.angelfire.com/ca2/psychosworld2/
(No subject)
« Reply #2 on: November 17, 2003 09:54 pm CST »
wow!

Talk about an instant result! :-D
Thanks Ozzy.

..doh!  It's in a rar... and IE keeps trying to load it into a browser window for some odd reason :-/

If you ever played Hexen, you may know of the yell I want to add... it's the one that plays when you fall in a lava pit... very good I think.

In any case, this is awesome of you to do, and I might add it to the download section of my site some time soon. :-)  (soon meaning... never?)
« Last Edit: December 31, 1969 06:00 pm CST by Lidge Farkley »
Lend your heart unto the divine mineral TOPAZ;
from which our reverent hearts and minds sprang.
Also Known As:  Alcoholic 007
My Page of tribes Tools and Helpful "FAQ" Stuff

Hersh

  • Elvin Legion
  • *****
  • Posts: 413
  • Reputation: +0/-0
(No subject)
« Reply #3 on: November 18, 2003 01:36 am CST »
Save Target As.
And change the extension to .rar (It will try to download as .htm)
Nice scream...sounds like he hits something hard.  :twisted:

Just out of curosity, how many checks can you add on to SaveWorld's loop before it gets too laggy? Or will it just depend on the computer?


Hersh
« Last Edit: December 31, 1969 06:00 pm CST by Hersh »

I kissed a drunk girl on the lips.
This post, by its very length, defends itself against the risk of being read.

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #4 on: November 18, 2003 03:01 am CST »
It really depends on the computer.

I'm sure that with the more checks the more stress it will cause.

Oh, and the fall is from CS.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"