Some changes regarding sounds in mods

Some changes regarding sounds in mods

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Some changes regarding sounds in mods

Post by Auswaschbar »

After recent failures with beep9.wav and stuff, we made a few modifications regarding sounds used by the engine in a mod:

You can place a file "sounds.lua" in your gamedata-folder, which may look like this:

Code: Select all

--- Valid entries: IncomingChat, MultiSelect, MapPoint
local Sounds = {
	engineEvents = {
		IncomingChat = "sounds/beep4.wav",
		MultiSelect = "sounds/button9.wav",
		MapPoint = "sounds/beep6.wav",
	},
}

return Sounds
So when a chat messge is recieved, beep4.wav is played. MultiSelect is played when you select multiple units.

The exmple above whould give the exact behaviour like it has been before, if no such file is present, no sounds are played. Keep in mind, that you need to have this sound either in your mod, or you have to use ota-content which is why we don't enable this by default.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Some changes regarding sounds in mods

Post by KDR_11k »

If the .lua file is needed for those sounds to work can't it be put into springcontent? After all there are tons of mods that don't use otacontent and they are pretty much guaranteed to have the wavs.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Some changes regarding sounds in mods

Post by Argh »

If we already have the WAVs in our /sounds directory, will this work, or result in an error?
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Some changes regarding sounds in mods

Post by Auswaschbar »

The exmple above whould give the exact behaviour like it has been before
if no such file is present, no sounds are played
none of this 3 sounds, your other sounds will work as before
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: Some changes regarding sounds in mods

Post by SeanHeron »

Sounds to me like, if you have those .wav's, but not the lua file, the wav's simply won't be played (no error but no those 3 sounds either). Though I'm guessing - or just stating my understanding, I don't actually know.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Some changes regarding sounds in mods

Post by KDR_11k »

Auswaschbar wrote:none of this 3 sounds, your other sounds will work as before
So why exactly would you break all non-OTA mods?
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: Some changes regarding sounds in mods

Post by SeanHeron »

I see this as added functionality, not breaking non-OTA mods... I'm would have expected the list to give you greater control (ie further sounds, etc.) over sounds [edit: if not now then perhaps at a later point of time]. Also, I don't see the problem with dropping in such a file with the next update you do of a game - and yea, so the sounds don't play till then. Well ?
Sean
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Some changes regarding sounds in mods

Post by KDR_11k »

I mean why do you put it into otacontent instead of springcontent?
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Some changes regarding sounds in mods

Post by Auswaschbar »

KDR_11k wrote:I mean why do you put it into otacontent instead of springcontent?
I didn't put it into neither otacontent nor springcontent.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Some changes regarding sounds in mods

Post by imbaczek »

why otacontent? referenced files are in otacontent, but this file itself won't be...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Some changes regarding sounds in mods

Post by lurker »

You didn't put it into otacontent? So as of now 0 mods will have the sounds?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Some changes regarding sounds in mods

Post by smoth »

I already have those sound files covered, however, will I hear it?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Some changes regarding sounds in mods

Post by Argh »

Not until you have the Lua stuck in.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Some changes regarding sounds in mods

Post by smoth »

ewwwwwwwwwwwwwwwww :oops:
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: Some changes regarding sounds in mods

Post by SeanHeron »

I can hardly believe how conservative you guys are... here our engine devs go, fixing what I see as an bug/error (a mod not starting if you don't have 3 arbitrarily named sound files in your sound folder), and all you can do is complain that you're going to have to add the lua file - way to go, I'm sure this is really motivating for them :/.
Sean
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Some changes regarding sounds in mods

Post by KDR_11k »

Sean, I get the feeling that you have no clue what I'm complaining about.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Some changes regarding sounds in mods

Post by smoth »

yes kdr, yes he did :\.

sean, personally I am just joking around. I don't care what they need me to include as long as it isn't a virus infected file. It isn't a big deal gundam always had those files because at some point spring required(it might not any more) them. I just wanted to know if they work without the lua file. Not a big deal.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Some changes regarding sounds in mods

Post by BrainDamage »

tl;dr : spring used to have such sound filenames hardcoded, now they are read from a variable, if you want from them to still be loaded again, add the variable in sounds.tdf/sounds.lua
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Some changes regarding sounds in mods

Post by KDR_11k »

BUT WHY IS THERE NO DEFAULT FILE IN SPRINGCONTENT?
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Some changes regarding sounds in mods

Post by thesleepless »

KDR_11k wrote:BUT WHY IS THERE NO DEFAULT FILE IN SPRINGCONTENT?
make a free one and put it in there?
Post Reply

Return to “Game Development Tutorials & Resources”