Lua Widget Request: Allies Under Attack

Lua Widget Request: Allies Under Attack

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

Moderator: Moderators

Post Reply
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Lua Widget Request: Allies Under Attack

Post by Neddie »

The spring community is international, if small, and this poses a number of communication issues. I am proposing that someone code a lua widgit which sends you a message when your allies are "Under Attack" preferably placing a point at the front and then erasing it immediately. This would repeat every few minutes until the "engagement threshold" drops below a certain percentage, set by the widgit.

The "engagement threshold" would be calculated from the proportion of allied units in a zone currently attacking or taking damage. The zones would be measured out in cubes of 1x1 or so?

Any ideas? Work? Who can do this?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

This could have been done via gorupAI a logn tiem ago if ti werent for the same problem that mires the ally cursor groupAI, in that you cant delete a marker or a line specifically, rather you delete everything within 100 pixels of a point. This is regardless of wether the AI lua widget or player drew them.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Well, we could just scrap the marker and have it send an audio signal with "West" or "Southeast" tagged on as a smaller direction designator.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

While this would be possible, I don't think it would be useful. Really, you need to be watching the minimap and know when your ally is being attacked. How many people actually pay attention to the unit under attack messages we get now?
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

I have to say, you're the only person I've seen who doesn't see the potential in this.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

I just think I would end up ignoring it, if it was automated. I watch the minimap A LOT, and so I know when my ally is being attacked anyways. Someone feel free to make it, but I probably won't use it.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Post by TheFatController »

Its hard to think of something more obnoxious that a widget that automatically adds points especially if your ally put them in your base when you were getting attacked, it's not something I could see myself tolerating.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Hence why it would merely be audio based, as we can't use points effectively due to the erase radii.

Interestingly enough, I'm proposing this on the suggestion of a game designer elsewhere, but before I said anything I checked up with some people about the relevance of such a widget. It seems to be another BA vs Other discussion.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

most allies tend to inform you when they are under attack. this would only really be useful for keeping watch of noobs on your team.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

1v0ry_k1ng wrote:most allies tend to inform you when they are under attack. this would only really be useful for keeping watch of noobs on your team.
Or those who speak other languages. We have interesting German and French players sometimes. Besides, we are going to have a forced influx of new players when I finish one of my projects, so...
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

As demonstrated by the following, you do not need to use
the standard minimap markers. If you grab control of the
minimap (slavemode), then you can draw over it.

http://trepan.homelinux.net/spring/gui_ ... amages.lua

NOTES:

1. This was a quick hack, mostly untested (ie: expect bugs)

2. A lot of factors could be tweaked for better values:
alpha factor, scale factor and clamping, grid size, decay rate, etc...

3. This is slow (I faked the UnitDamaged() call-in)

4. This code also maxspects the minimap within pre-defined limits
(I started from my gui_relative_minimap.lua widget). You lose the
ability to resize it and move it. The damage display does not work
if you maximize the map, etc...
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

5. I don't think it's all that useful ;)
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

fwiw, the same thing but done per-unit instead of by location
(and uses a maxHealth based yellow flash for unit deaths)

http://trepan.homelinux.net/spring/gui_ ... mages2.lua
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Thank you, trepan. I'm not going to press the issue, as my support seems to have evaporated.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

That latest version of the widget will pretty much do what you want.
You probably won't notice much of a slowdown for most games (try
it out and see, I did most of what little testing was done in replays).

I'll probably add a DrawMinimap(xsize, ysize) call-in so that drawing
to the minimap is easier (especially for modrules scripts). The call-in
would set the glViewport to the minimap size, and put it in a "pixel
space" transformation for drawing. That way, you won't have to bother
with putting the minimap in slavemode (although I'll leave that capability,
it has other uses).
Post Reply

Return to “Lua Scripts”