sound problem

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

sound problem

Post by agentmad007 »

hi ,

Checked via forum if i could find my answer , but no one seems to had this problem.

i want to load sound from several place at the same moment .

I tried with script origin , script_model(fx/dummy.tik), script object

with script_origin and scrip_model only one load the sound then others stay quiet .

with script_object , it dont work anymore

Code: Select all

main:
////////////////////////sound////////////////////////////


local.master = spawn ScriptMaster
local.master aliascache vortex sound/amb/gogate.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"


level waittill prespawn 

	exec global/DMprecache.scr 
	level.script = "maps/dm/voyage.scr" 

level waittill spawn 

end



tunnel_teleport:

local.gateuser = parm.other
wait .01
$destination1 playsound vortex
$vortex1 playsound vortex
$vortex2 playsound vortex
//local.gateuser freezeplayer
local.gateuser physics_off
local.mover = spawn script_model model "fx/dummy.tik"
local.mover.origin =  local.gateuser.origin
local.gateuser glue local.mover
local.mover time 2
local.mover moveto $t1
local.mover waitmove
local.gateuser unglue local.mover
local.mover remove
local.gateuser tele $origine
//local.gateuser releaseplayer
local.gateuser physics_on



end
thx if someone have an idea .........
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

Code: Select all

$destination1 playsound vortex
$vortex1 playsound vortex
$vortex2 playsound vortex 
Which one of these is the one that is working? Is it $destination1? The obvious thing would be to check your target names for your dummy.tik objects.

In my map, I have 3 locations for a fireplace loopsound. At first only one worked. So I made copies of the aliascache sounds for the other 2 like this:

Code: Select all

local.master aliascache vortex sound/amb/gogate.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
local.master aliascache vortex2 sound/amb/gogate.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
local.master aliascache vortex3 sound/amb/gogate.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
----------------------------------

$destination1 playsound vortex
$vortex1 playsound vortex2
$vortex2 playsound vortex3
That fixed it for me as a loopsound, but that probably was not the most ideal way to do it.

You can also change what audio channels the other sounds are playing on. Instead of using "auto" in your aliascashe, try "voice, local, or dialogue".

I'm currently experimenting with this stuff myself because I have a similar problem. I have an alarm sound that doesn't work everytime. It appears that other custom sounds I have in the map may be preventing it from working even though they are set to run on different channels.

If these sounds are getting cached, perhaps there is a limit to how many MB of sound we can use before they just don't work anymore?
Diego
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

the first sound loaded is the one that leave from $destination1

i tried voice, local, dialogue nothing work==> it do the same.


when i open the console i have this :

Code: Select all


Script ERROR: Command 'playsound' applied to NULL listener

Hm...?????
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

in moh breakthrough with ubersound file
it dont work :?
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

agentmad007 wrote:Script ERROR: Command 'playsound' applied to NULL listener
That means you try to play a sound from an object that does not exist. Double check that you are really using targetnames that really exist.
Admin .MAP Forums
Image
Head above heels.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

yes i had written targeRtname hehe

But the problem is still here script origin or model only the first is loaded

no console error .

tested with loopsound and playsound
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

local

Post by tltrude »

If you use channel "local", with local.master, you must put quotes around the word.

local.master aliascache vortex sound/amb/gogate.wav soundparms 2.0 0.0 1.0 0.0 32 64 "local" loaded maps "m dm obj"

It is probably not a good idea to use a sound alias name that is the same as a targetname in the map.

Btw, the player himself can play the sound. local.gateuser playsound vortex
Tom Trude,

Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

thanks , its excatly what i wanted ........
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Re: local

Post by diego »

tltrude wrote:If you use channel "local", with local.master, you must put quotes around the word.

local.master aliascache vortex sound/amb/gogate.wav soundparms 2.0 0.0 1.0 0.0 32 64 "local" loaded maps "m dm obj"
That's odd. I've seen plenty of scripts posted here that do not use quotes around that channel variable. Of course, all of them were using auto as the value.

So what happens if you use "voice" without the "" marks. Does it just default to auto - channel 0?

And is there a limit to how many MB of sound files we can use with this uberscript? I have been using 5-12 mb of custom sounds depending on what I am debugging. I'm still having troulbe with my alarm only working intermittently even though the trigger fires evertime.
Diego
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

local

Post by tltrude »

That "local" channel problem is only in the (local.mater) ubersound work-around.

Sounds have a bad habbit of not loading, if the game starts quickly. I sometimes have to add a pause "wait 1" before starting the sounds in a map. Also, it is a good idea to cache the sound files in your map's precache script. It helps the game run smoother because it does not have to pause to load a sound file--just like the models.

exec global/DMprecache.scr

cache sound/dialogue/m3l1/A/dfr_panic_05g.wav
cache sound/dialogue/Generic/A/over/dfr_over_18f_2.wav
cache sound/dialogue/Generic/A/cover/dfr_cover_01j_1.wav
cache sound/dialogue/M4L1/A/dfr_M4L1_401h_1.wav
cache sound/dialogue/M3L1/A/dfr_m3l1_022h2.wav
cache models/fx/bh_paper_lite.tik
cache models/fx/bh_paper_hard.tik
cache models/fx/bh_wood_lite.tik
cache models/fx/bh_wood_hard.tik
cache models/fx/bh_metal_lite.tik
etc...
Tom Trude,

Image
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

LOL

I thought aliascache WAS caching the sounds. I'll do that and add the wait statement tonight. I'm just about finished with my map. But this bug has been aggravating me for a while--- well, that and the fact that it would crash every 5 minutes. :)

But so far my map has been perfectly stable since I've been debugging my audio. (knock on wood).
Diego
vkdawg
Private
Posts: 9
Joined: Mon Jan 26, 2004 8:51 pm

Re: local

Post by vkdawg »

tltrude wrote:That "local" channel problem is only in the (local.mater) ubersound work-around.

Sounds have a bad habbit of not loading, if the game starts quickly. I sometimes have to add a pause "wait 1" before starting the sounds in a map. Also, it is a good idea to cache the sound files in your map's precache script. It helps the game run smoother because it does not have to pause to load a sound file--just like the models.

exec global/DMprecache.scr

cache sound/dialogue/m3l1/A/dfr_panic_05g.wav
cache sound/dialogue/Generic/A/over/dfr_over_18f_2.wav
cache sound/dialogue/Generic/A/cover/dfr_cover_01j_1.wav
cache sound/dialogue/M4L1/A/dfr_M4L1_401h_1.wav
cache sound/dialogue/M3L1/A/dfr_m3l1_022h2.wav
cache models/fx/bh_paper_lite.tik
cache models/fx/bh_paper_hard.tik
cache models/fx/bh_wood_lite.tik
cache models/fx/bh_wood_hard.tik
cache models/fx/bh_metal_lite.tik
etc...
Would this needing to "pause" explain why I have to RESTART a map to get my sounds to load???

Here's some code from my .scr file:

Code: Select all

local.master = spawn ScriptMaster
local.master aliascache garage_door_open sound/mechanics/m6l3a_SlidingDoors_Open.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m moh dm obj "
local.master aliascache garage_door_close sound/mechanics/m6l3a_SlidingDoors_Close.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m moh dm obj "
local.master aliascache transformer_snd sound/mechanics/Mec_GeneratorRun_01.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m moh dm obj "
local.master aliascache radio_snd sound/mechanics/Mec_RadioMusic_01.wav soundparms 0.7 0.0 1.0 0.0 250 1600 local streamed maps "m moh dm obj "
local.master aliascache siren_snd sound/mechanics/Mec_Alarm_10.wav soundparms 1.2 0.0 1.0 0.0 12000 12000 item streamed maps "m moh dm obj "
local.master aliascache bell_snd sound/mechanics/Mec_Alarm_02.wav soundparms 1.2 0.0 1.0 0.0 600 5000 item loaded maps "m moh dm obj "
	
	level waitTill prespawn
I ALWAYS have to do a RESTART to get these to work.

Would adding a "wait 1" before they load FIX THIS problem???

Like this:

Code: Select all

wait 1

local.master = spawn ScriptMaster
local.master aliascache garage_door_open sound/mechanics/m6l3a_SlidingDoors_Open.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m moh dm obj "
local.master aliascache garage_door_close sound/mechanics/m6l3a_SlidingDoors_Close.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m moh dm obj "
local.master aliascache transformer_snd sound/mechanics/Mec_GeneratorRun_01.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m moh dm obj "
local.master aliascache radio_snd sound/mechanics/Mec_RadioMusic_01.wav soundparms 0.7 0.0 1.0 0.0 250 1600 local streamed maps "m moh dm obj "
local.master aliascache siren_snd sound/mechanics/Mec_Alarm_10.wav soundparms 1.2 0.0 1.0 0.0 12000 12000 item streamed maps "m moh dm obj "
local.master aliascache bell_snd sound/mechanics/Mec_Alarm_02.wav soundparms 1.2 0.0 1.0 0.0 600 5000 item loaded maps "m moh dm obj "
	
	level waitTill prespawn
This is starting to drive me crazy!!!

Thanks....
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

wait 1

Post by tltrude »

Well, I would try the wait just after the "local.master" lines. But what I ment was a pause just before the sounds are used, like this.

//------------------------------------------->
// Loop Sounds
//------------------------------------------->

start_sounds:

wait 1
$e_object loopsound elev_muzac
$surf_speaker loopsound wave_snd
$lamp loopsound lighthouse_run .5

end

Your problem might be somthing else, though. Is it Mohaa or spearhead/BT? Dedicated server? You should probably post a new thread for it in the scripting forum. Your problem has been discussed before.
Tom Trude,

Image
Post Reply