
Looks like this:
Code: Select all
function widget:UnitDamaged (unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam)
local ud = UnitDefs[unitDefID]
if (ud.isCommander) then
current_time = widgetHandler:GetHourTimer()
if (current_time > last_attack+2) then
Echo( "OH FUCK! Commander under attack!" )
end
last_attack = current_time
end
end
In wiki it says "prints to the ingame chat and infolog.txt" but I also read somewhere "prints to console"
Also, will this also warn about your allys commander? (your enemies??) so that I have to check the attacked commanders team?
Or is this unneeded because UnitDamaged only gets called for "your" units anyway?
---------
So I want to draw some basic stuff, like lines or rectangles. For example make the screenborders flash red when the commander is attacked.
Whats the easiest way to do so? OpenGL scares me atm with renderlists and matrix and stuff. I was told to use something like chiliUI - this seems very overkill? What would you recommend?