Page 3 of 7

Posted: Tue Jul 22, 2003 8:30 pm
by Alcoholic
im making a huge secondary ubersound fiile which uses this method. basically, al my maps wil use it, and i just put the right map names for each sound. sort of like a 2nd ubersound.

Silly note

Posted: Tue Jul 29, 2003 8:21 am
by jv_map
Oh one more thing I found out. Sometimes you'll want to use the local channel (no 3D localization) for your sounds. In this case 'local' has to be written within quotes, like "local", otherwise the game 'reads' local as the current thread (a bit like local.variable :wink: ) which results in loads of errors and the sound not working.

Example:
local.master aliascache soundalias wavfile soundparms numbers "local" loaded maps "mapname"

Note that any of the parameters may be variables, they don't have to be predefined like in ubersound.scr.

Here is a simple piece of code that can be used to retrieve the mapname. You can now use maps local.mapname instead of maps "giant list of map names here".

Code: Select all

local.mapcvar = getcvar mapname
if(local.mapcvar[2] == "/" && local.mapcvar[0] == d) // dm/
	local.mapname = dm
else if(local.mapcvar[3] == "/" && local.mapcvar[0] == o) // obj/
	local.mapname = obj
else
	local.mapname = local.mapcvar
Example:
local.master aliascache soundalias wavfile soundparms numbers channel loaded maps local.mapname

Re: New ubersound work-around!

Posted: Wed Jul 30, 2003 6:54 am
by Klaus
Hi jv_map :P
jv_map wrote:Woohoo no more messing with TIKIs 8-)

I found an easier way which seems to work on both client and server directly from the map script.

Here's how I did it (put this above level waittill spawn):

Code: Select all

local.master = spawn ScriptMaster
local.master aliascache soundalias wavfile soundparms numbers channel loaded maps "mapname"
// local.master remove // me = confused about this
You can add a great number of aliases this way :).

If there is a demand for it I can probably make a global script for it.

This work if you put custom Music or Ambient Music
(EA GAMES\MOHAA\main\sound\music) to replace this folder into pk3 ? :roll:

Byes :D

Posted: Wed Jul 30, 2003 10:24 am
by jv_map
Well music works a little different than normal sounds. It doesn't require an alias but the bad thing is it has to be streamed rather than loaded. This means music cannot be in a pk3 :(

Posted: Wed Jul 30, 2003 3:31 pm
by bdbodger
Can you stream custom sounds over a server ? What else can be sent over a server ?

Posted: Wed Jul 30, 2003 4:56 pm
by jv_map
bdbodger wrote:Can you stream custom sounds over a server ? What else can be sent over a server ?
I don't think you can stream anything over a server :? Would be kind of a waste of bandwith wouldn't it? :?

Posted: Thu Jul 31, 2003 1:10 am
by small_sumo
I have an idea to help you and also some questions for jv.

idea: The other day I made an alias for an mp3 and it isplayed by the speaker or you know the script model fxdummy.tik. I did the alias (ooh I like saying that word Genifer Garner lol) auto loaded. Strange thing was when you arrived in the area the sound started then, and if you left the area when you return it would start at the start again?????? So my idea for you is to set it up as written above and write the alias so it plays far enough to cover the whole map.

:)

And my Q for superman is, I want to script play a sound at start of round do I need the script model for this. I just have a funny oneliner to play at the start of each round for players to here, also would like to play a message (or sound) while the camera ending is on, and cos all the while the players are all over the map and botsare making noises....

Hmmmmm.

Posted: Thu Jul 31, 2003 7:26 am
by jv_map
small_sumo wrote:I want to script play a sound at start of round do I need the script model for this. I just have a funny oneliner to play at the start of each round for players to here, also would like to play a message (or sound) while the camera ending is on, and cos all the while the players are all over the map and botsare making noises....

Hmmmmm.
I think you need an alias on the local channel (remember to write "local" ;)) for this. You can make it play on any entity (with a model) if you just set the soundparms so that it will be heard at full volume anywhere and make the entity alwaysdraw. For example you could use a player as a speaker :) (no more than one sound per non-auto channel per player).

Posted: Thu Jul 31, 2003 7:58 am
by Bilko
Anyone know a good tutorial or anything like that for this sound/ubersound stuff. I'm new to all this but it looks interesting..

Bilko.

Here:

Posted: Fri Aug 01, 2003 1:38 am
by tltrude
/tutorials/custom_sounds.php

Posted: Fri Aug 01, 2003 10:36 am
by Bilko
Thanks tltrude.

Bilko.

Posted: Fri Aug 01, 2003 1:28 pm
by Bilko
Hey, that bit of code works. Nice one JV! :)

Bilko.

Posted: Tue Aug 05, 2003 8:33 am
by jv_map
Heh I found another cheesy bug with this method (nothing serious though): if your script has errors and doesn't compile the first time, but you fix it with the in-game notepad and restart the map, it'll crash with the 'a reliable command was cycled out' error :?

Posted: Tue Aug 05, 2003 2:09 pm
by small_sumo
Lol you should have kept this one under your shirt bro, only people like you would be doing that kind of thing and they should know anyway hehe.

:P

Posted: Wed Aug 06, 2003 1:15 am
by Bjarne BZR
Sumo, admit it: you are one of the guys that would have run in to that prob. You just see your chance to lash out and accuse someone else of beeing a nerd ( A nerd is someone that knows WAY more than everyone else ). :wink:

( I think I'm funny, if not: flame me :twisted: )