Hard-coded audio messages

For code related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Hard-coded audio messages

Post by aubergine » 21 May 2012, 17:38

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.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: Hard-coded audio messages

Post by Shadow Wolf TJC » 23 May 2012, 05:56

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.
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Hard-coded audio messages

Post by aubergine » 23 May 2012, 16:09

Those extra events would also allow better AI scripting too. +1 for that!
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: Hard-coded audio messages

Post by Shadow Wolf TJC » 13 Jun 2012, 14:10

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:
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100

User avatar
Saberuneko
Regular
Regular
Posts: 558
Joined: 15 Jan 2010, 18:20
Contact:

Re: Hard-coded audio messages

Post by Saberuneko » 14 Jun 2012, 09:05

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.

User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: Hard-coded audio messages

Post by Shadow Wolf TJC » 14 Jun 2012, 09:41

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.
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Hard-coded audio messages

Post by aubergine » 14 Jun 2012, 09:44

@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.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

Post Reply