Page 1 of 1

A simple widget for self-d alert

Posted: 26 Jun 2011, 15:14
by Jools
A simple widget for playing a sound when commander is about to self destruct. Plays a "pop" sound when self-d is cancelled. Tested with xta.

Where have the self-d countdown sounds gone anyway?

(NB: it plays a soundfile called siren3.ogg ands pop-wav in folder LuaUi/sounds. Can be changed.)

Edit: changed to filetype to ogg to save space, and to enable stopping the soundstream if self-d is cancelled.

Re: A simple widget for self-d alert

Posted: 26 Jun 2011, 15:19
by manolo_
missing pop-file

Re: A simple widget for self-d alert

Posted: 26 Jun 2011, 15:34
by Jools
Here it is. I had one already included with spring so I thought it was present by default.

I'd like to set the volume a bit higher, but didn't immediately find out how to. Even tried amplifying the sample with audacity, but no change.

Re: A simple widget for self-d alert

Posted: 26 Jun 2011, 15:41
by Jools
Hmmm, I didn't test whether every player can hear the sound, I hope not :)

Re: A simple widget for self-d alert

Posted: 26 Jun 2011, 16:12
by Google_Frog
Jools wrote:Hmmm, I didn't test whether every player can hear the sound, I hope not :)
It's a widget. They can't.

Re: A simple widget for self-d alert

Posted: 27 Jun 2011, 08:00
by manolo_
i wanted to upload it on the wddb, thats why i asked fot the pop.wav (just to make it complete, dunno if this wave file is included in a blank install-pack)

Re: A simple widget for self-d alert

Posted: 27 Jun 2011, 08:30
by knorke
instead of manually adding all commander unit names to the list:

Code: Select all

local commDefs =	{
					UnitDefNames["arm_commander"].id,
					UnitDefNames["arm_ucommander"].id,
					UnitDefNames["arm_u0commander"].id,

...
...
you could loop through unitDefs and do

Code: Select all

if (unitDef.isCommander==true) then add to list end

Re: A simple widget for self-d alert

Posted: 27 Jun 2011, 18:00
by Jools
Yup, that would have been better, then it would work for any mod.

Re: A simple widget for self-d alert

Posted: 27 Jun 2011, 18:06
by FLOZi
Actually it wouldn't, start units don't need to have iscommander.

You could use GetTeamInfo + GetSideData to find the start unit or just catch the first unit spawned for each team using UnitCreated

Re: A simple widget for self-d alert

Posted: 27 Jun 2011, 20:16
by knorke
start units don't need to have iscommander.
in *A mods, they usually are.

Actually, thinking about it instead of playing a sound it should prevent you from blowing up the commande accidently. ie make you confirm the command a second time.

Re: A simple widget for self-d alert

Posted: 27 Jun 2011, 22:25
by Jools
But sometimes you want to commbomb, and then you don't have time to confirm stuff. No matter how cowardous it is to do so, we can't deny that in some situations it's a smart choice.

But OTA had countdown sounds on self-d, like this: choop, choop, cheep, chiip, chiiip, BOOM.