Author Topic: PlaySoundByStrRef  (Read 404 times)

Legacy_Tolkiens Padawan

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
PlaySoundByStrRef
« on: September 20, 2013, 12:13:41 am »


               Hi,
I want a sound to play instantly, so I can't use "PlaySound". It's not played at a specific place, so soundobjects are no solution either. With "PlaySoundByStrRef" it seems to be possible, but I can't find those StrRef-Ints. The Lexicon says they are in the tlk. Let's say the SoundName is "as_an_dogbark3". This line is not in the tlk (neither dialog.tlk nor custom), so where do I get its StrRef?
Thank you.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
PlaySoundByStrRef
« Reply #1 on: September 20, 2013, 12:52:50 am »


               Are you saying you want the sound to come from a specific place?
If that's the case then PlaySound is what you want.

I use it myself, to play hearbeat sounds when my players enter stealth mode.

The only thing I would warn you about - is that its location based, emitted from the object that is told to 'PlaySound'

Players around that location can hear the sound too: if they can perceive the player who is emitting it.

As for what argument you provide - it accepts the filename of the sound file.
If your sound file is in the override folder : you can provide the name without extension:
Note  file names must be 16 or less chars long.

You can test your sounds with sound objects in toolset, to make sure they are playable in game.
               
               

               
            

Legacy_Tolkiens Padawan

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
PlaySoundByStrRef
« Reply #2 on: September 20, 2013, 01:43:10 am »


               Thank you, but the problem with PlaySound is that the sound is played as an action, so it is not played if the pc is moving. PlaySoundByStrRef includes the option to set "Play as action" to false. But here the StrRef (an int) is needed, not the filename as used by PlaySound.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
PlaySoundByStrRef
« Reply #3 on: September 24, 2013, 04:41:02 pm »


               There is not a StrRef for things like "as_an_dogbark3" and other plain sounds or sound effects. The StrRefs being referenced are for audio clips that match text in the OCs. As an example, if you instead used "vs_favhen4m_050" you hear Tomi Under Gallows say "Eh? What can Tomi do for ya?". Dogs barking, twigs snapping, wind blowing, etc... however lack the StrRefs you seek to call.
               
               

               
            

Legacy_Tolkiens Padawan

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
PlaySoundByStrRef
« Reply #4 on: September 24, 2013, 09:43:44 pm »


               Thank you. So it seems there is no way to play the sound while the pc is moving. This is sad, but I'll have to deal with it.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
PlaySoundByStrRef
« Reply #5 on: September 25, 2013, 12:18:03 am »


               I myself use triggers scattered throughout areas that cause a sound to be played, but as a fallback, I also have them send a message in emote form as well. I.e., when a call to play a twig snap is made, the scripts also send a floating text message that says "You hear a twig snap nearby*.
               
               

               


                     Modifié par kalbaern, 24 septembre 2013 - 11:18 .
                     
                  


            

Legacy_Tolkiens Padawan

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
PlaySoundByStrRef
« Reply #6 on: September 26, 2013, 12:25:22 am »


               I already do the same, but thanks for the suggestion ;-)