Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom sound files when interacting with objects...
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Custom sound files when interacting with objects...

(09-20-2011, 04:30 PM)ZyLogicX Wrote: I have this awesome Idea for my conversion mod. But I dont know how I should appraoch it.

Basically, I want the player to say things when interacting with objects... so like when you pick up a broom, the audio file starts and says 'I dont know how that is going to work'

Is it possible for me to do, and How?
You're going to have to add a PlayerInteract callback (which can be made directly from the level editor) that calls a PlaySoundAtEntity function.

Example:
void PlayBroomPickup(string &in asEntity)
{
PlaySoundAtEntity("", "[customsound + .snt extension]", "Player", 0, false);
}

Making sure that you have PlayBroomPickup as your item interact callback in the level editor. If you want this to happen every time you pick up the broom, don't have "callbackautoremove" checked in the editor.

Hopefully this solves your problem. Smile

09-20-2011, 04:45 PM
Find


Messages In This Thread
RE: Custom sound files when interacting with objects... - by Obliviator27 - 09-20-2011, 04:45 PM



Users browsing this thread: 1 Guest(s)