Product Chat / Can't get sound to play for my fire

Author
Message
Ostbanditen
8
Years of Service
User Offline
Joined: 28th Sep 2015
Location:
Posted: 22nd Feb 2016 19:52
So I put the fire 1 decal in my level, I'm trying to make it play a fire sound. When I put the file I have inside the Sound 0 or 1 nothing happens when I test it and the sound file gets deleted from the decal.. What to do? :o
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 22nd Feb 2016 20:00
There are no sound statements in the default decal scripts.

Add them in and you should be able to get sound from them.
I would put in a distance check from the decal to 75 to 100 units, to when you can hear it, so you dont get a bunch trying to play at the same time. Just the ones that are in range of the player.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Feb 2016 17:41 Edited at: 23rd Feb 2016 17:45
As Pirate Myke says you will have to attach a script to the object to play the sound.

Something like this should work. Not tested but can't see any obvious issues.


You probably want LoopSound for a fire as the above will play the sound once only until you move in and out of range again.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
Ostbanditen
8
Years of Service
User Offline
Joined: 28th Sep 2015
Location:
Posted: 23rd Feb 2016 23:48
Thank you, both of you! Now I am not a big coder... I know more or less nothing about it.. Where should I put this code snippet to get this to work?
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 24th Feb 2016 10:18 Edited at: 24th Feb 2016 10:20
Ok try this .... This is a soundtest.lua file I think Lee created in a twitchfeed..
Download the Lua file below and copy it to your scriptbank folder

To test it ....it needs to be attached to a dynamic model (explosive barrel for example )
Place the barrel on the map .... select its properties
In the "Main" field it will say "Default .lua" browse to the "soundtest.lua"
In the "sound 0" field browse to a stock music track.
then run test game

As you get close the music plays and vanishes as you get further away ....
Once you have worked out the procedure you can create a fire.wav and use that ....

You can attach the script to any dynamic object near the fire for the effect ( A small rock for example) or something inconspicuous
Hope this helps
The only person ever to get all his work done by "Friday" was Robinson Crusoe..

Attachments

Login to view attachments
PM
Uman
GameGuru TGC Backer
19
Years of Service
User Offline
Joined: 22nd Oct 2004
Location:
Posted: 24th Feb 2016 12:19
I found an easy way to do this if you don't want to work with script editing is to add a Sound zone and scale/shape it to the area you want the sound (loop sound) to play, in relative to the fire decal. That's what I did and had not even considered using a script as suggested here.

Might not be the most efficient way as far as performance is concerned by easy and works fine. Not sure if I had to add a sound set in an .fpe anywhere as I cant remember off hand and adding sound set (choose sounds) in editor properties for anything crashes GG so if needed inside the entity .fpe is the only way.

System : Advent Windows 7 Home Premium 64bit. Intel(R). i5-2310 CPU @ 2.90GHz. 8.00 GB RAM DDR3. Storage : 1389 GB : 1088 GB Free (1389 GB Total). Graphics : NVIDIA GeForce GT 530. Total Available Graphics Memory : 4095 MB. Dedicated : 1024 MB. Shared : 3071 MB. Direct X10

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 24th Feb 2016 14:14 Edited at: 24th Feb 2016 14:15
Quote: "That's what I did and had not even considered using a script as suggested here."


Just different approaches. I use sound zones for music and such mainly. Any objects I want to have sounds I normally use a script for them. I normally avoid zones because I think they clutter up the map and can make it difficult to select things within them; also if the object has the sound attached, it allows you to move them around which wouldn't be possible with a zone.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Login to post a reply

Server time is: 2024-05-24 15:50:18
Your offset time is: 2024-05-24 15:50:18