Lua Widget Request: Allies Under Attack
Moderator: Moderators
Lua Widget Request: Allies Under Attack
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?
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?
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.
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
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.
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.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
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...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.
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...
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...
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
(and uses a maxHealth based yellow flash for unit deaths)
http://trepan.homelinux.net/spring/gui_ ... mages2.lua
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).
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).