A simple widget for self-d alert

A simple widget for self-d alert

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

A simple widget for self-d alert

Post by Jools » 26 Jun 2011, 15:14

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.
Attachments
siren3.rar
alert sound
(126.94 KiB) Downloaded 8 times
pop.rar
pop sound
(7.09 KiB) Downloaded 9 times
tp_autodestruction_alert.lua
Autodestruction alert
(1.3 KiB) Downloaded 107 times
Last edited by Jools on 12 Jul 2011, 19:11, edited 1 time in total.
0 x

User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: A simple widget for self-d alert

Post by manolo_ » 26 Jun 2011, 15:19

missing pop-file
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: A simple widget for self-d alert

Post by Jools » 26 Jun 2011, 15:34

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.
Last edited by Jools on 12 Jul 2011, 19:12, edited 1 time in total.
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: A simple widget for self-d alert

Post by Jools » 26 Jun 2011, 15:41

Hmmm, I didn't test whether every player can hear the sound, I hope not :)
0 x

Google_Frog
Moderator
Posts: 2434
Joined: 12 Oct 2007, 09:24

Re: A simple widget for self-d alert

Post by Google_Frog » 26 Jun 2011, 16:12

Jools wrote:Hmmm, I didn't test whether every player can hear the sound, I hope not :)
It's a widget. They can't.
0 x

User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: A simple widget for self-d alert

Post by manolo_ » 27 Jun 2011, 08:00

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)
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: A simple widget for self-d alert

Post by knorke » 27 Jun 2011, 08:30

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
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: A simple widget for self-d alert

Post by Jools » 27 Jun 2011, 18:00

Yup, that would have been better, then it would work for any mod.
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6103
Joined: 29 Apr 2005, 01:14

Re: A simple widget for self-d alert

Post by FLOZi » 27 Jun 2011, 18:06

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
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: A simple widget for self-d alert

Post by knorke » 27 Jun 2011, 20:16

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.
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: A simple widget for self-d alert

Post by Jools » 27 Jun 2011, 22:25

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.
0 x

Post Reply

Return to “Lua Scripts”