Page 1 of 1

Hard-coded audio messages

Posted: 21 May 2012, 17:38
by aubergine
Inspired by Shadow Wolf's Enhanced SitRep Mod, I've embarked on a complete new version of rules.js to add better audio message reporting of game events.

However, there's a number of audio messages hard-coded in to the C++ code which are causing problems because they cause multiple messages to be played for certain game events.

For example, pcv336.ogg ("construction completed") is played when certain buildings are created - I'd like to have custom audio messages based on the type of building but when I do that the hard-coded audio message also gets played resulting in something like "defensive structure completed. construction completed." when a defence gets built ("defensive structure completed" is an audio message from my rules.js).

So, could some of the hard-coded audio messages be removed from the C++ code - the messages would be better put in rules.js where they are more easily/centrally scripted and modded.

The following messages in C++ code are currently causing me pain:

* pcv336.ogg - construction completed (when some buildings constructed)
* pcv367.ogg - production completed (when unit produced)
* pcv344.ogg - power resource (when power resource detected)
* pcv399.ogg - unit under attack (when unit attacked)
* pcv337.ogg - structure under attack (when structure attacked)
* pcv486.ogg - units transferred (when units gifted to ally)

I'll list more here as I find them. I'll be uploading my version of the Enhanced SitMod addon to Shadow Wolf's topic linked above.

Re: Hard-coded audio messages

Posted: 23 May 2012, 05:56
by Shadow Wolf TJC
I'd like that as well. In fact, could we also move the unit voice-overs to rules.js, and add events (such as, say, eventObjectSelected() or eventObjectOrdered()) for selecting a unit, group, or structure, or giving it certain orders? That would open up a whole bunch of possibilities for different kinds of unique unit-specific voice-overs, such as one for tanks, another for cyborgs, a 3rd for VTOLs, a 4th for artillery units, etc.

Re: Hard-coded audio messages

Posted: 23 May 2012, 16:09
by aubergine
Those extra events would also allow better AI scripting too. +1 for that!

Re: Hard-coded audio messages

Posted: 13 Jun 2012, 14:10
by Shadow Wolf TJC
Bumped because I just wanted to say that I find it annoying when the adviser constantly blurts out "Production Completed" or "Construction Completed" non-stop. It's quite possible to have enough factories produce lots of units at such a rate that, by the time I hear "Production Complete" finish, 1 or more units were already built. When setting factories that produce units at such high rates to loop production, I couldn't care less about hearing what I already know is going to happen. :stressed:

Re: Hard-coded audio messages

Posted: 14 Jun 2012, 09:05
by Saberuneko
You can disable the voices. There's a separate volume setting for them, after all.
I always have that volume to 0 when the voice starts to get annoying.

Re: Hard-coded audio messages

Posted: 14 Jun 2012, 09:41
by Shadow Wolf TJC
I fear that it would also disable the other voice messages that I actually find more helpful, like "Structure Under Attack" or "Unit Under Attack". I actually don't mind hearing "Production Completed" or "Construction Completed" every 5-10 seconds, but hearing the same thing over and over non-stop does tend to get annoying fast.

Re: Hard-coded audio messages

Posted: 14 Jun 2012, 09:44
by aubergine
@Saberuneko: The audio settings screen affects all audio - so if you disable voices there it disables all the voices, including those from scripts (specifically it affects playSound() function), so unfortunately it doesn't solve the problem.