New ubersound work-around!

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Silly note

Post 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
Image
User avatar
Klaus
Sergeant
Posts: 64
Joined: Fri Jun 07, 2002 6:11 am
Location: Chile

Re: New ubersound work-around!

Post 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
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :(
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Can you stream custom sounds over a server ? What else can be sent over a server ?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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? :?
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post 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.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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).
Image
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post 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.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Here:

Post by tltrude »

Tom Trude,

Image
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

Thanks tltrude.

Bilko.
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

Hey, that bit of code works. Nice one JV! :)

Bilko.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :?
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post 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
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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: )
Admin .MAP Forums
Image
Head above heels.
Post Reply