Drawing a Threat map
Moderator: Moderators
Drawing a Threat map
Hi I was wondering what the best (simplest) way would be to draw the threat map my AI is using onto the actual game map. I noticed in the aiCallback there are some draw line etc. funtions should I use these to draw my threat map? I was thinking of either drawing the threat grid and having it be different color and darker or lighter based on the influence in the grid cell. Or/also drawing the threat cirlce generated by individual units. If anyone has any advice on how to do either that would be great!
Re: Drawing a Threat map
To draw your grid cells the CreateLineFigure() callback is
probably the most useful (just have it draw lines equal in
width to the cells themselves), for coloring them by their
threat-values you could call SetFigureColor(). Circles are
trickier though, you'll have to combine a bunch of splines
if you really need them (or let your AI run some Lua draw
callins).
probably the most useful (just have it draw lines equal in
width to the cells themselves), for coloring them by their
threat-values you could call SetFigureColor(). Circles are
trickier though, you'll have to combine a bunch of splines
if you really need them (or let your AI run some Lua draw
callins).

Re: Drawing a Threat map
Thanks for the adivce, I have a nice little threat map now. The one problem I am having is I don't understand how the setFigureColor() parameters work, they are RGBA and I assume they are from 0-255 but when I try to set them to values in this range they behave strangely (darker when I would expect them to be lighter). Could someone please explain what mistake I am making here I am too tired to figure it out 

Re: Drawing a Threat map
Not sure but quite a few of the colour values use 0.0 to 1.0 as their range... at least give it a try.
Re: Drawing a Threat map
Yeah that seems to be the problem, I was confused because I was feeding it numbers like say 100 then 100.5 so it seemed to work but then when it hit 101 it restarted the scale. Keeping the values between 0 and one fixed the weirdness. thanks!