Commander Under Attack v2.00

Commander Under Attack v2.00

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

Moderator: Moderators

User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Commander Under Attack v2.00

Post by TechnoTone »

Current version available at UF:
Image

Command Under Attack widget by TechnoTone and BigHead
Version 2.00

--------------------------------------------------------------------------------------------------------------------------

Display a warning message and plays a sound when your commander is under attack. The warning sound can be found in the LuaUI\Sounds folder and can be replaced with a sound of your own if you wish - just give it the same filename. It is currently using the original TA sound effect.

Configurable options (editing of the lua file required):

local criticalHealthPercent = 40
local drawNoobHint = true
local disableWhenSpectating = false
local SOUND_DIRNAME = LUAUI_DIRNAME .. 'Sounds/'

--------------------------------------------------------------------------------------------------------------------------

Update Log:

1.01 - Fixed a typo which caused the script to fail when a commander was lost.
1.01 - Removed a debugging message that echo'd to the console when a commander is attacked.
1.02 - Disables when player is/becomes a spectator.
1.02 - Renamed (was called "Commander Under Fire").

Update by BigHead (many thanks!):
2.00 - Alarm is sounded only if commanders health is below configurable % (default 40%).
2.00 - Alarm is sounded only if the commander is not selected.
2.00 - No longer alarmed when allies are attacked.
2.00 - Configurable noob hint; enabled by default and which should be disabled by anyone with at least some self-respect

--------------------------------------------------------------------------------------------------------------------------
Last edited by TechnoTone on 30 Sep 2007, 22:17, edited 7 times in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

What does it do?
User avatar
LathanStanley
Posts: 1429
Joined: 20 Jun 2005, 05:16

Post by LathanStanley »

(clicked the link)
file: unit_comm_under_fire.lua
brief: shows and sounds a warning when your commander is under attack
author: TechnoTone
version: 1.00

Copyright (C) 2007.
Licensed under the terms of the GNU GPL, v2 or later.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Hmm, that would make it the third widget that does this. :P Unfortunately the author of the one I use didn't want to release it. :( And the first one me and quantum made was kinda sucky (at least my part was :P).
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

This is my first attempt at a widget. It was as much a learning experience as it was to produce something worthwhile.
Last edited by TechnoTone on 31 Aug 2007, 12:51, edited 3 times in total.
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Widget Updated.
User avatar
url_00
Posts: 163
Joined: 15 Apr 2007, 22:44

Post by url_00 »

What changed?
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

A couple of fixes. One typo which caused a problem when the commander died and one debugging message that I left in.
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Finally got around to updating this widget.

Updates:

1.02 - Disables when player is/becomes a spectator.
1.02 - Renamed (was called "Commander Under Fire").


Let me know if you experience any problems with it.
User avatar
VonGratz
Posts: 471
Joined: 03 May 2005, 05:25

Post by VonGratz »

Hi! When the game starts appears it in screen and after in infolog:
LuaUI: bound CTRL+F11 to tweak mode
Failed to load: unit_comm_under_attack.lua (Include() could not load 'LuaUI/Headers/spring.h.lua'
)
Notes:
Im utilizing the SNV 4269 :!:
Vongratz
Edited: I also played with normal last version 0.75b2 XTA and it is the same.
Last edited by VonGratz on 08 Sep 2007, 00:31, edited 1 time in total.
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Excuse my ignorance: Is that a development build?
User avatar
VonGratz
Posts: 471
Joined: 03 May 2005, 05:25

Post by VonGratz »

Yes, but Ive tested also with the 0.75b2 and its the same.
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Please edit your unit_comm_under_attack.lua file and remove the "include" lines for "opengl.h.lua" and for "spring.h.lua". Let me know if that helps.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

You widget was giving me errors so I had to stop using it. Something would trigger it to select all units, and then it often would stop working completely. :(
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

I'm not sure how it would even be possible for it to select all units. There's no code in it that could do that as far as I'm aware.

:?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

My apologies it looks like I have the widget by a strange character named Dave Rodgers. :P I'll contact him for a bug report and redownload your widget.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

This widget is alarming when one of your allies coms is attacked also, which is not as helpful (you zoom to your own com only to find that he is okay). Could that feature be made optional?
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Hmm, I thought I'd fixed that. I'll check it out.

Cheers.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

I've played with this widget a bit and added some features:
- Alarm is sounded only if commanders health is below certain critical level, which can be modified (default 50%). No more alarm if a single flash runs around your commander.
- Alarm is sounded only if the commander is not selected. No need to hear the awfully stresful sound if you're already trying to save your commander.
- You are alarmed only if your commander is under attack (= not your stupid ally)
- Noob hint which is enabled by default and which should be disabled by anyone with at least some self-respect :wink:

Credits go to TechnoTone

Download:
http://spring.unknown-files.net/file/36 ... er_Attack/

Enjoy!
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Credits go to BigHead!

Nice job!
Post Reply

Return to “Lua Scripts”