Announcement

Collapse
No announcement yet.

Noob: How to play sound?

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

    Noob: How to play sound?

    Hi,

    I'm new to UnrealScript and currently playing around with Mutators..

    I just tried to add some custom sounds to vehicle enter/exit events, so I've extended the Mutator class and implemented the functions DriverLeftVehicle/DriverEnteredVehicle.

    The functions both get called correctly, but think I don't know enough to get a custom sound working..

    I've found tutorials about making Voice Packs, so i made a .uax containing some sounds, but how can I play my sounds in the mutator?

    In other sourcecodes I found some PlaySound calls, so I tried this:

    PlaySound(sound'MutSIWSounds.raus_he',,2.5*Transie ntSoundVolume);

    But how can I control where the Sound gets played? And what do the Different SLOT's mean? And finally I don't hear anything, even with higher volume levels and original game sounds!

    Is there a tutorial about that? Or can anyone explain the basics of playing sound for me, please?

    Thanks,
    lupo

    #2
    When you use the PlaySound function, the actor it is called from plays the sound. In your case the mutator actor plays the sound. Mutators probably exist at the world origin and so aren't suitable for doing what you want.

    Luckily it is very easy to make a different actor play the sound, in your case the vehicle, from within the DriverEnteredVehicle function:
    Code:
    V.PlaySound(sound'MutSIWSounds.raus_he',,2.5*V.TransientSoundVolume);
    The different slots are a convenient way to control which sounds play at the same time. Each slot can play only one sound at a time, so for instance if a sound is playing in SLOT_Interact for a particular actor and you call PlaySound with SLOT_Interact for it, the old sound will stop playing and they new one will start instead, whereas if you used a different slot, the one already playing in SLOT_Interact would keep playing. I hope that makes sense!

    Comment


      #3
      great that works.
      thanks a lot :noob:

      Comment

      Working...
      X