Page 1 of 1
Lua Widget Request: Allies Under Attack
Posted: 23 Feb 2007, 05:17
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?
Posted: 23 Feb 2007, 12:07
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.
Posted: 23 Feb 2007, 18:28
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.
Posted: 24 Feb 2007, 01:00
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?
Posted: 24 Feb 2007, 01:35
by Neddie
I have to say, you're the only person I've seen who doesn't see the potential in this.
Posted: 24 Feb 2007, 01:39
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.
Posted: 24 Feb 2007, 16:12
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.
Posted: 24 Feb 2007, 19:32
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.
Posted: 24 Feb 2007, 19:41
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.
Posted: 24 Feb 2007, 19:53
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...
Posted: 24 Feb 2007, 20:43
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...
Posted: 24 Feb 2007, 20:48
by trepan
5. I don't think it's all that useful

Posted: 24 Feb 2007, 23:55
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
Posted: 25 Feb 2007, 21:27
by Neddie
Thank you, trepan. I'm not going to press the issue, as my support seems to have evaporated.
Posted: 25 Feb 2007, 22:37
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).