Commander under attack widget

Commander under attack widget

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

Moderator: Moderators

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

Commander under attack widget

Post by Jools »

Image

Because you can never have too many warnings.

This is just a graphical warning, because there are already unit under attack warning sound and text promts. This widget shows commander's current health for you. It disappears after 5 seconds of no attack.

Works with mods that have customParams.iscommander tag.
Attachments
gui_commanderwarning_gui.lua
Version 1
(4.62 KiB) Downloaded 36 times
Last edited by Jools on 01 Feb 2014, 00:09, edited 1 time in total.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Command under attack widget

Post by Jools »

Use tweakmode (ctrl+F11) to reposition, because this widget has no permanent GUI in normal mode
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Commander under attack widget

Post by dansan »

This widget is useful for me. Sometimes I overhear the warning sound and the "visual bell" cannot be overseen. Thank you!
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Commander under attack widget

Post by Jools »

Thanks. The problem with the audio alarms is to get the exactly right level of them. Not spamming too much, but still alerting when you need it.

If it alerts too much, then you start to ignore it. It's like a wife that reminds you every day that you have to clean the closet. Eventually you don't register the words anymore and just say "yes". Same thing when a flash attacks your windfarm :)
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Commander under attack widget

Post by Jools »

New version, get it from here: http://code.google.com/p/xta-springrts/ ... arning.lua

It adds commander state info, as you can see from this screenshot:

Image
100Gbps
Posts: 74
Joined: 30 Jan 2009, 13:19

Re: Commander under attack widget

Post by 100Gbps »

Willing to add centering the camera on the commander when is attacked? If you do it, add and the code here, just only the part for the camera. Ktnx
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Commander under attack widget

Post by Jools »

Do you think people would want that?
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Commander under attack widget

Post by dansan »

I wouldn't use it, I press "ctrl-c". Maybe a textual hint "Press Ctrl-C to focus commander."?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Commander under attack widget

Post by Jools »

You can also use F3 = view last reporting unit.
100Gbps
Posts: 74
Joined: 30 Jan 2009, 13:19

Re: Commander under attack widget

Post by 100Gbps »

Jools wrote:Do you think people would want that?
Yes. Some stats in plain text (last 100 DSD battles in local, including very long ones with chasing last comm):
  • Battles where comms were killed, but not moved - 76
  • Battles where comms were killed, but moved too late (at least 5sec after first attack) - 15
  • Battles where comms were killed, but moved first 3sec before/after first attack - 9
Overall percentage is bigger (data from 1000 battles), around 90-92%
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Commander under attack widget

Post by Jools »

I'll make it an option, as well a mode where also allied commanders are shown
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Commander under attack widget

Post by very_bad_soldier »

How many coms were NOT killed but an unwanted camera jump would have been issued?
100Gbps
Posts: 74
Joined: 30 Jan 2009, 13:19

Re: Commander under attack widget

Post by 100Gbps »

very_bad_soldier wrote:How many coms were NOT killed but an unwanted camera jump would have been issued?
Not understood ya very well, but for example most comm deaths are consequences of slow scrolling and trying to strafe him away from the danger. Most of the good micro'ers react in up to 3 seconds, while general mass of players usually do it for 5-6 seconds. So we are trying to automate part of player's reaction.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Commander under attack widget

Post by very_bad_soldier »

Yes, but you did only count how many coms died cause of a lack of players attention. But how many coms survived even if the player decided to spend his attention elsewhere (on purpose)? In this case the widget would have forced an unwanted camera switch to the com. This is hard to measure I admit but this is what I would be afraid of when using that feature.
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Commander under attack widget

Post by klapmongool »

Ctrl-c !
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Commander under attack widget

Post by very_bad_soldier »

I bound com to 'Q' :regret:
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Commander under attack widget

Post by abma »

why not make a click to the widget window center the camera on the com?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Commander under attack widget

Post by Jools »

I also thought of that, I think most people don't want this but it could be an option. Why not. I usually press F3 to get to last attacked unit, but maybe that's set by some widget not available in all games.

There is also IIRC a widget that let's you shift window between commander and base with space. If you are accidentally taken to some place you may want to go back.

Ctrl-C is also good, but it's so close to ctrl-d. (Why not press them both then?). Also, if you have many decoys it's a mess. Some games allow many commander decoys, and in some games people spam them for buildpower. You can easily have 50 commanders :)
100Gbps
Posts: 74
Joined: 30 Jan 2009, 13:19

Re: Commander under attack widget

Post by 100Gbps »

Set the Comm to some group number and point to it.

very_bad_soldier, we don't count survived comms. But this is too relatively - best micro'ers always can fail in this, in fact in teamgame if I was super-duper player, I'll leave my comm to die and kill medium to large group of enemy units. Then will go and eat dat metal, ofc with enough units to guard the area.
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Commander under attack widget

Post by klapmongool »

100Gbps wrote:Set the Comm to some group number and point to it.

very_bad_soldier, we don't count survived comms. But this is too relatively - best micro'ers always can fail in this, in fact in teamgame if I was super-duper player, I'll leave my comm to die and kill medium to large group of enemy units. Then will go and eat dat metal, ofc with enough units to guard the area.
100Gbps, he is probably trying to say that your investigation/research is one-sided. Therefore you cannot draw valid conclusions from it.
Post Reply

Return to “Lua Scripts”