For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Quick Question

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
KillerSkaarj
OldUnreal Member
Posts: 935
Joined: Fri Jan 25, 2008 2:04 am

Quick Question

Post by KillerSkaarj »

So I'm making a little practice mod called "TauntBox" and it works just fine.

However, there's one thing I want to know. Let me post the script first:

Code: Select all

//=============================================================================
// TauntBox.
//=============================================================================
class TauntBox expands Pickup;

Var(Taunts) sound Taunt1;
var(Taunts) string Text1;

state Activated
{
   function endstate()
   {
     bActive = false;            
   }

Exec Function TargetA()
{
   Playsound(Taunt1);
}
      
Begin:
}

state DeActivated
{
begin:
}
Would the above code only emit the sound so that it can only be heard if you're near the player using it? That's all I want to know. After all, this IS a test mod and I don't plan to make it a full blown mod.
Last edited by KillerSkaarj on Tue Feb 05, 2008 3:21 am, edited 1 time in total.
fxsr789

Re: Quick Question

Post by fxsr789 »

Okay then. *growls*

The "PlaySound" function does NOT use byte's for Volume, Radius, and Pitch; Volume and Pitch are percentages, Radius is expressed in Unreal Units.

These are the following defaults for those variables:

For radius, it's 4096.0
For both Volume and Pitch it's 1.0


This could work for your tastes.


Code: Select all

//=============================================================================
// TauntBox.
//=============================================================================
class TauntBox expands Pickup;

Var(Taunts) sound Taunt1;
var(Taunts) string Text1;

state Activated
{
   function endstate()
   {
      bActive = false;            
   }

Exec Function TargetA()
{
   Owner.Playsound(Taunt1,SLOT_None,1.0,false,6590.0,1.0);
}
      
Begin:
}

state DeActivated
{
begin:
}
I hope I'm a helpful dragon, if not the most hated, insulted individual in the Unreal community. *snarls*

- Fenix
User avatar
KillerSkaarj
OldUnreal Member
Posts: 935
Joined: Fri Jan 25, 2008 2:04 am

Re: Quick Question

Post by KillerSkaarj »

Sooo... will this code make the sound be able to be heard throughout the entire level?

Also, did you read the whole post? 0.o It sounds like you stopped reading at the PlaySound part.
fxsr789

Re: Quick Question

Post by fxsr789 »

You asked if you wanted only players near that player to hear it, there's the sound radius fit for that. Set the sound radius to 2147483647 if you want it throughout the level.


- Fenix
Pcube

Re: Quick Question

Post by Pcube »

Or manually call ClientPlaySound in each playerpawn actor.

Code: Select all

local pawn P;
For(P=Level.PawnList;P!=None;P=P.NextPawn)
  If(P.IsA('Playerpawn')) 
    Playerpawn(P).ClientPlaySound( . . . );
fxsr789

Re: Quick Question

Post by fxsr789 »

mew mew! mmmew!

That could work to, do NOT set volume beyond 4.0 - 10 or so or it will distort or sound awful.. (2.0 - 4.0 is good enough)


- Fenix
User avatar
KillerSkaarj
OldUnreal Member
Posts: 935
Joined: Fri Jan 25, 2008 2:04 am

Re: Quick Question

Post by KillerSkaarj »

Well, thanks for the help, guys. Oh and Pcube, whatever happened to your website? Too many people spamming up the guestbook?
fxsr789

Re: Quick Question

Post by fxsr789 »

No, he took it down because of people like Jackrabbit.


- Fenix
Jâçkrâßßit

Re: Quick Question

Post by Jâçkrâßßit »

Hey Fenix and Pcube, if you two guys are so good at this "sound" stuff, why can't you help with OpenAL/FMOD? All I see you do is sit in the server all day pissing time away ::)
fxsr789

Re: Quick Question

Post by fxsr789 »

Burn in hell. Your god dammed immaturity and childish antics are going to get you killed. This is why we both have you banned from the server, and why >MewTwo
User avatar
KillerSkaarj
OldUnreal Member
Posts: 935
Joined: Fri Jan 25, 2008 2:04 am

Re: Quick Question

Post by KillerSkaarj »

Oh... Anyone wish to lock this now?

Oh, and why did Fenix get banned? Is it because of the post below?

Return to “UScript Board”