Nuke Button

Nuke Button

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

Moderator: Moderators

Post Reply
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Nuke Button

Post by very_bad_soldier »

Displays a graphical button that informs you about loading progress of your nuke launchers.
Left-Click to select next nuke launcher.
Double-Click to actually aim with next nuke launcher.
Next nuke launcher is the one that has the most stockpiled nukes ready.

Compatible mods: CA,BA,XTA
(Others can be added by extending the internal unit list)

Idea by manolo_.

Download via SpringDownloader or at http://www.springinfo.info/?p=695.
Attachments
screen000.png
screen000.png (26.04 KiB) Viewed 2500 times
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Nuke Button

Post by hoijui »

coool! :D

is the nuke icon hidden as long as you dont have nuke silos?
would be good i think, would make nukes/this part of the widget more special when it is visible.

also, when seeng this, i immediatly though on "the big red button" :D

maybe an other icon.. then, when you have like 4 or 5 nukes (in one or better multiple silos), you select a target for each of them...
and when you press the big red button, they all launch, and the widget plays Wagner (as in Apocalypse Now).

:D
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Nuke Button

Post by very_bad_soldier »

lol yeah, would be nice ;)

I would even have a proper icon for it (from my first try), looks a bit more "brutal" :mrgreen:

PS. Yes, button is only visible when you actually got at least one nuke silo.
Attachments
Alternative Icon
Alternative Icon
nuke_button_64_old.png (5.05 KiB) Viewed 2475 times
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Nuke Button

Post by hoijui »

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

Re: Nuke Button

Post by manolo_ »

thx :)

edit: suggestion: when i click on the nuke button, dont select the building, i want to have the attack command inserted
Last edited by manolo_ on 26 Jul 2009, 10:57, edited 1 time in total.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Nuke Button

Post by manolo_ »

double post
User avatar
ChaosMonkey
Posts: 180
Joined: 06 Jul 2009, 21:21

Re: Nuke Button

Post by ChaosMonkey »

i find it annoying that it shows allies nukes aswell
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Nuke Button

Post by very_bad_soldier »

manolo_ wrote:thx :)
edit: suggestion: when i click on the nuke button, dont select the building, i want to have the attack command inserted
This is considered a feature to protect yourself from nuking yourself by accident. Just double-click.
ChaosMonkey wrote: i find it annoying that it shows allies nukes aswell
oops yes. Its fixed hopefully, thx for the hint. Could not test the fix though.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Nuke Button

Post by manolo_ »

what about mininukes? ;)
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: Nuke Button

Post by thedude »

How can I use it with other mods?
I added this lines to the widgetcode

Code: Select all

unitList["shortnameofmymod"] = {} --initialize table

unitList["shortnameofmymod"]["mysuperweapon"] = {}

But the Widget/Spring tells me "Unsupported Game, shutting down...".
Have I to change things in my mod like adding some files or else?
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Nuke Button

Post by very_bad_soldier »

Hm, thats the correct way to do it. But I did something stupid probably:
curModID = upper(Game.modShortName or "")
if ( unitList[curModID] == nil ) then
spEcho("<Nuke Icon> Unsupported Game, shutting down...")
widgetHandler:RemoveWidget()
return
end
I compare to the uppercase version of modShortName. So if your mods shortname is "myMod", try entering "MYMOD" in the table. I dont know why I did it in the first place frankly.

If it still doesnt work, maybe send me your mod and I will take a look.
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: Nuke Button

Post by thedude »

Thx it works.
At first I tried to change the shortname of my mod (modinfo.tdf). When I started spring the shortname was the same as before. Only after replace the whole mod from the modfolder and starting spring again then exit spring and put the mod into the modfolder spring changed the name. Doesn't spring look on eveery start for the modnames or is there a bug? (I use 0.79.1.0)
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Nuke Button

Post by NTG »

it would be nice if clicking on button wouldn't select nuke launcher that already have attack command... otherwise, if you have 2 silos (or more) and launch first missile, you need to wait before nuke launches or manually select another silo :(
also, may i suggest to add a possibility to select all silos ready to fire?
Post Reply

Return to “Lua Scripts”