Page 1 of 1
unit reply sounds/voices
Posted: 20 Mar 2011, 15:13
by knorke
My main problem with them is that if you quickly click a unit multiple times the sounds play multiple times. Also happens if you give alot of orders in short time. This only allows the use of really short samples like "yea" or engine sounds. But something like "mega tank ready for mega battle, prepare for mega attack" will just become distorted noise.
Only game where it does not happen is zero K because they play the unit sounds via Lua.
Was that done because it allowed more features or as workaround because the engines unit reply system does not work so good?
Things I need help with:
-playing sounds should cut off if a new one starts.
-If you select more than one units, the "select" sound is not played at all, even if the units are of the same type.
-The "ok" plays on every order, like just pressing stop or changing move state. Is it possible to only play on move or attack?
-Is there a tag to give units an "engine sound" that loops as long as they are moving? (or on other events)
Atm in the unitdef I just do:
Code: Select all
sounds = {
select = {
"unitreply/yea.ogg",
},
ok = {
"unitreply/battle.ogg",
},
},
Re: unit reply sounds/voices
Posted: 20 Mar 2011, 16:16
by bobthedinosaur
for some of those issues can you fill it with a blank sound file?
Re: unit reply sounds/voices
Posted: 20 Mar 2011, 16:18
by knorke
what do you mean?
Re: unit reply sounds/voices
Posted: 20 Mar 2011, 16:32
by bobthedinosaur
a silent sound file to fill some of the alternative spots, as a cheap hack.
Re: unit reply sounds/voices
Posted: 20 Mar 2011, 16:36
by knorke
Code: Select all
ok = {
"unitreply/battle.ogg",
"5_seconds_of_silence.ogg",
"5_seconds_of_silence.ogg",
"5_seconds_of_silence.ogg",
"5_seconds_of_silence.ogg",
},
Like this?
I think the sounds are randomly chosen, so you would mostly get silence.
If they loop, it might somewhat work, depending on clickspeed.
Re: unit reply sounds/voices
Posted: 26 Mar 2011, 19:21
by knorke
tried it, does not really work. fast clicking obviously still gives annoying echoes. The sound needs to stop when a new one starts...
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 04:56
by bobthedinosaur
request an engine feature for more control over response sounds
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 07:21
by Google_Frog
Why don't you use a modified version of the Zero-K reply sound widget? You have shown you can write lua so modifying a widget to play sounds exactly when you want should be easy, a lot of the work is done for you already.
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 07:48
by knorke
bobthedinosaur wrote:request an engine feature for more control over response sounds
made a mantis report
http://springrts.com/mantis/view.php?id=2389
Google_Frog wrote:sound widget
yes but imo this is such a basic feature of an RTS engine that it is worth fixing.
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 17:52
by CarRepairer
I don't think it's worth fixing. If it can be done in lua more easily than in the engine, why should time be wasted in engine development? In fact, by making this thread you prove the point that each mod and modder has different needs. Thus a lua widget is the best way to achieve this solution. Making a sound playing widget is very simple (and it was done many years ago already). If something is impossible or extremely difficult or costly to do in lua, that's when it should be an engine request.
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 18:11
by knorke
each mod and modder has different needs
which modder has the need to hear annoying echo noises when he clicks on a unit?
lua sounds:
can they be made to obey the "unit reply volume" value in springsettings.exe or is there a way to read it?
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 18:29
by FLOZi
They can in next Spring, not sure if its available in current,
...
Damn I thought this had been added to the wiki.
And of course now I can't find it in the gitlog, because github search is dreadful.
Suffice to say, jK added a new parameter to PlaySoundFile which lets you specify which channel (general, unitreply, battle etc) it is played on.
I'm afraid I can't even tell you which number argument it is.
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 18:34
by knorke
typical spring moment.
Re: unit reply sounds/voices
Posted: 27 Mar 2011, 18:38
by FLOZi
[17:31:27] <[S44]FLOZi> can you update wiki with new argument to playsoundfile? I could have sworn it was on there at some point

[17:31:37] <[S44]FLOZi> (and that is 0.83 right?)
[17:39:28] <[LCC]jK> done
[17:41:20] <[S44]FLOZi> <3
http://springrts.com/wiki/Lua_UnsyncedCtrl#Sounds
Code: Select all
Spring.PlaySoundFile Plays WAV or OGG sounds.
( string "soundfile" [, number volume = 1.0
[, number posx, number posy, number posz
[, number speedx, number speedy, number speedz ] ] ], [string/number channel ] ) -> nil | boolean
`channel` is new in Spring0.83, and can be one of those:
"battle" || "sfx" | 1
"unitreply" || "voice" || 2
"userinterface" || "ui" || 3

Re: unit reply sounds/voices
Posted: 27 Mar 2011, 18:47
by knorke
nice.
closeenough.jpg