Spearhead and sound aliases problem

Post your scripting questions / solutions here

Moderator: Moderators

Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Spearhead and sound aliases problem

Post by Rookie One.pl »

Hi,

I've got a really weird problem. I'm working on the SH version of my FFE mod, and I can't get the sound aliases working... I mean, they work OK after a restart, but never for the first time the map is loaded... The same exact code works perfectly in AA! What the hell?

Code: Select all

level waittill prespawn
	
	println "[FIRE-FOR-EFFECT]: Initializing Fire-For-Effect! script (version " level.ffe_version " [" level.ffe_version_date "])..."

// here goes some other crap

	local.master = spawn ScriptMaster
	local.master aliascache steamloop sound/mechanics/Mec_SteamLoop_01.wav soundparms 1.0 0.3 1.0 0.0 320 2200 auto loaded maps "dm obj"
	local.master alias airstrike_invalid_target1 sound/dialogue/M3L2/A/dfr_m3l3_344k.wav soundparms 1.0 0.0 1.0 0.0 80 112 dialog streamed subtitle "That's not a target. Over." maps "m3l2 dm obj"
	local.master alias airstrike_invalid_target2 sound/dialogue/M3L3/A/dfr_m3l3_345o.wav soundparms 1.0 0.0 1.0 0.0 80 112 dialog streamed subtitle "Give me a target. Over." maps "m3l3 dm obj"
	local.master alias airstrike_valid_target1 sound/dialogue/M3L2/A/dfr_m3l3_346k.wav soundparms 1.0 0.0 1.0 0.0 80 112 dialog streamed subtitle "Roger. Target acquired." maps "m3l2 dm obj"
	local.master alias airstrike_valid_target2 sound/dialogue/M3L3/A/dfr_m3l3_347o.wav soundparms 1.0 0.0 1.0 0.0 80 112 dialog streamed subtitle "Roger. Consider it done." maps "m3l3 dm obj"
	local.master alias airstrike_already_enroute1 sound/dialogue/M3L2/A/dfr_m3l3_348k.wav soundparms 1.0 0.0 1.0 0.0 80 112 dialog streamed subtitle "Target already acquired. Over." maps "m3l2 dm obj"
	local.master alias airstrike_already_enroute2 sound/dialogue/M3L3/A/dfr_m3l3_349o.wav soundparms 1.0 0.0 1.0 0.0 80 112 dialog streamed subtitle "Already enroute to a target. Over." maps "m3l3 dm obj"
	local.master aliascache arty_leadinmp1 sound/weapons/explo/Exp_LeadIn_06.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp2 sound/weapons/explo/Exp_LeadIn_07.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp3 sound/weapons/explo/Exp_LeadIn_08.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp4 sound/weapons/explo/Exp_LeadIn_09.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp5 sound/weapons/explo/Exp_LeadIn_10.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp6 sound/weapons/explo/Exp_LeadIn_11.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp7 sound/weapons/explo/Exp_LeadIn_12.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"
	local.master aliascache arty_leadinmp8 sound/weapons/explo/Exp_LeadIn_13.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "dm obj"

	println "[FIRE-FOR-EFFECT]: Caching models..."
	cache models/animate/fx_mortar_dirt.tik
	cache models/items/binoculars.tik
	
	level waittill spawn
As I said, this code works perfectly in AA! I tried putting it before level waittill prespawn and after level waittill spawn as well, nothing works until the map gets restarted...

Any ideas?

Rookie One
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

i always put it right after main:
and seemed to work,but i never tried it for SH :(
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I said it does work with AA, it does not in SH, unless you do a restart... :?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

It dosn't work for SH mate, I usually remove those and make an ubersound. If there are a lot of aliases and sounds playing at the same time on a server it may cause SH to crash. It's an SH thing :?
Grassy
An ambiguous question will get a similar answer...
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Well, they are just stock sounds redeclared to make them work in all MP maps... And I don't think messing with ubersound is a good idea... :?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Rookie One wrote:I said it does work with AA, it does not in SH, unless you do a restart... :?
if its a single player sound it will not work,unless the client also has the file.so actually NO it dont work in AA.(not server side anyways)
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

It does work with AA, I tested it.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

That's one of the reasons why I decided to make a seperate SH version of my map. The other reason was that in 16bit mode SH replaces the sky with a very thick fog... bleh! However before I made a seperate version I did get my sounds to work in both AA and SH without having to restart the map. But I needed two scripts for it. As far as I know AA only reads the standard ubersound.scr from the ubersound folder so having your own little add-on script for SH won't conflict with the original.

For SH:
//=============================================
// UBERCRAP add-on for SH.
//=============================================
settiki none

aliascache gate_iron_locked sound/mechanics/gate_iron_locked.wav soundparms 1.3 0.2 0.9 0.2 160 1600 item loaded maps "dm obj"
aliascache gate_iron_open3 sound/mechanics/GateMetalOpen_05.wav soundparms 1.3 0.2 0.8 0.2 160 1600 item loaded maps "dm obj"
etc...

end


(Save it as "whatever.scr" and put it in the ubersound folder. Spearhead will automatically read it as being an add-on to the original ubersound file.)
-------------------

Then for AA:
//=============================================
// UBERCRAP add-on for AA.
//=============================================
local.master = spawn scriptMaster
local.master aliascache gate_iron_locked sound/mechanics/gate_iron_locked.wav soundparms 1.3 0.2 0.9 0.2 160 1600 item loaded maps "dm obj"
local.master aliascache gate_iron_open3 sound/mechanics/GateMetalOpen_05.wav soundparms 1.3 0.2 0.8 0.2 160 1600 item loaded maps "dm obj"
etc...

end


(Save it as "whatever_aa.scr" and put it in e.g. the global folder. MoH:AA will not automatically read it as being an add-on to the original ubersound file, so you have to execute it from the maps' script above prespawn):
exec global/whatever_aa.scr

Since it's in the global folder SH will also read it and report an error in the console the first time you load the map saying something about "local.master...blabla ScriptThread", but this way the sounds will play in SH and AA. Perhaps you can even execute it from the maps folder, I don't know for sure. I guess it's worth the shot.
(Also note that some sounds that aren't cached for all maps in AA may already be fixed in SH).
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Now that's interesting... Thanks, panTera, I'll give it a try! 8-)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

I think I will have to do a complete tutorial on SH sounds and the impact they have on mp servers. Pantera is correct, there is no "messing" with the orriginal ubersounds at all (big no no), just an addon for your map aliases.
Tute on it's way soon..
Grassy
An ambiguous question will get a similar answer...
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Thanks, panTera, it works! Yay! :D
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

yey..sorry. i just know i will need this in the fuure. What about breakthrough?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I guess it will be the same, SH and BT engines aren't that much different.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

you say this works for AA,did u test it server side.not of ur computer,a actual server?
because i did,and it will work if u host off of ur comp,but when i uploaded to the server...NO SOUND!!
this was talked about in another post about getting SP dog sounds to work server side 8-)
Image
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

It seems to work when I start a dedicated server, why would it be different with an "actual" dedicated server? I think that as long as the client has the necessary files on his computer he will hear sounds. (Those dog-sounds aside then).
I always hear people saying does this and that work serverside or clientside. But why would something like sound (loaded, not streamed) need to work serverside. I mean if I pack sounds and everything else that's needed to play them in a pk3 and the client has that pk3 (with the sounds etc) on his computer, why would it not work?

So what exactly did you test and how did you cache the sounds? Just the SP dog sounds? I'm not saying I don't believe you but those dog sounds seem to be a special case.
Post Reply