Page 1 of 2

Spearhead and sound aliases problem

Posted: Mon Mar 21, 2005 7:11 pm
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

Posted: Mon Mar 21, 2005 7:25 pm
by Green Beret
i always put it right after main:
and seemed to work,but i never tried it for SH :(

Posted: Mon Mar 21, 2005 7:28 pm
by Rookie One.pl
I said it does work with AA, it does not in SH, unless you do a restart... :?

Posted: Mon Mar 21, 2005 7:31 pm
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

Posted: Mon Mar 21, 2005 7:40 pm
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... :?

Posted: Mon Mar 21, 2005 8:41 pm
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)

Posted: Mon Mar 21, 2005 8:43 pm
by Rookie One.pl
It does work with AA, I tested it.

Posted: Mon Mar 21, 2005 8:46 pm
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).

Posted: Mon Mar 21, 2005 8:55 pm
by Rookie One.pl
Now that's interesting... Thanks, panTera, I'll give it a try! 8-)

Posted: Tue Mar 22, 2005 5:48 am
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

Posted: Tue Mar 22, 2005 10:40 am
by Rookie One.pl
Thanks, panTera, it works! Yay! :D

Posted: Tue Mar 22, 2005 12:17 pm
by Elgan
yey..sorry. i just know i will need this in the fuure. What about breakthrough?

Posted: Tue Mar 22, 2005 1:43 pm
by Rookie One.pl
I guess it will be the same, SH and BT engines aren't that much different.

Posted: Tue Mar 22, 2005 4:05 pm
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-)

Posted: Tue Mar 22, 2005 5:12 pm
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.