Announcement

Collapse
No announcement yet.

Playsound question...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Playsound question...

    I want to have a sound play when an explosion happens, (in addition to the actual explosion), that plays ontop of any player within a certain radius of the explosion.

    The sound file is the sound of ringing, what you'd hear if you were near an explosion...so it needs to be on the player and move with him.

    That being said, I've tried:

    Code:
    PlaySound=(Sound'RC321Sounds.RC321EarRinging',SLOT_Misc,3*TransientSoundVolume,,10.0,,true);
    With the above, I hear the ringing sound if the explosion is within 10.0 (whatever measurement that is), but it spawns where the explosion was. So if I walk away from it, it fades away. I think I'm on the right track, but I can't think straight. There was mention of using AmbientSounds to do this.

    Any ideas how to stick the sound on the player?

    (Hope all this made sense....im so tired right now)

    #2
    If you have access to the Pawn do something like

    Code:
    Pawn.PlaySound(correctparams);

    Comment


      #3
      I tried that and got Bad command or expression. Heres the fuction:

      Code:
      simulated function SpawnEffects( vector HitLocation, vector HitNormal )
      {
      	local PlayerController PC;
      
      
      	PlaySound(ExplosionSound,,3*TransientSoundVolume);
              Pawn.PlaySound=(Sound'RC321Sounds.RC321EarRinging',SLOT_Misc,3*TransientSoundVolume,,10.0,,true);
              
      	if ( EffectIsRelevant(Location,false) )
      	{
      		PC = Level.GetLocalPlayerController();
      		if ( (PC.ViewTarget != None) && VSize(PC.ViewTarget.Location - Location) < 3000 )
      			spawn(class'FlakExplosion',,,HitLocation + HitNormal*16 );
      		spawn(class'FlashExplosion',,,HitLocation + HitNormal*16 );
      		spawn(class'RocketSmokeRing',,,HitLocation + HitNormal*16, rotator(HitNormal) );
      		if ( (ExplosionDecal != None) && (Level.NetMode != NM_DedicatedServer) )
      			Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
      	}
      }
      Could I set up a local variable to make Pawn useable?

      Comment


        #4
        get rid of the = sign . read the other post mr evil just made about sounds... you might have to use a small visiblecolliding actors to find close pawns. and set up a local Pawn variable ...

        EDIT: a better example

        Code:
        simulated function SpawnEffects( vector HitLocation, vector HitNormal )
        {
        	local PlayerController PC;
                        local Pawn P;
        
        	PlaySound(ExplosionSound,,3*TransientSoundVolume);
        foreach VisibleCollidingActors(class'xPawn', P, /*Radius*/)
          {
                P.PlaySound(Sound'RC321Sounds.RC321EarRinging',SLOT_Misc,3*TransientSoundVolume,,10.0,,true);
          }
                 ///the way you have it under here may work too
         //try something like Pc.Pawn.PlaySound(Sound'RC321Sounds.RC321EarRinging',SLOT_Misc,3*TransientSoundVolume,,10.0,,true);
        	if ( EffectIsRelevant(Location,false) )
        	{
        		PC = Level.GetLocalPlayerController();
        		if ( (PC.ViewTarget != None) && VSize(PC.ViewTarget.Location - Location) < 3000 )
        			spawn(class'FlakExplosion',,,HitLocation + HitNormal*16 );
        		spawn(class'FlashExplosion',,,HitLocation + HitNormal*16 );
        		spawn(class'RocketSmokeRing',,,HitLocation + HitNormal*16, rotator(HitNormal) );
        		if ( (ExplosionDecal != None) && (Level.NetMode != NM_DedicatedServer) )
        			Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));

        Comment


          #5
          Thanx man.

          Code:
          local Actor Victims;
          
          	foreach VisibleCollidingActors( class 'Actor', Victims, DamageRadius)
            {
                  Victims.PlaySound(Sound'RC321Sounds.RC321EarRinging', SLOT_None, 255,,10.0,1.0);
            }
          Thats all I needed =D

          Comment

          Working...
          X