I've been trying to get this quick Lua script to work, but I'm having trouble. It doesn't do anything, so I commented out everything except for the print function. The Lua.log doesn't reveal anything, no errors and no "does this work" message.
"UNIT_ARMY" is the Type for a custom unit I made.
Code:
-- Support
-- Author: Offisir
-- DateCreated: 2/11/2014 11:39:16 AM
--------------------------------------------------------------
print( "does this work?" )
function Support( unit )
local baseStrength = unit:GetBaseCombatStrength();
if ( unit:GetUnitType() == GameInfoTypes[ "UNIT_ARMY" ] ) then
if ( unit:IsFriendlyUnitAdjacent) then
unit:SetBaseCombatStrength( baseStrength + 100 );
end
else return end
end
end
"UNIT_ARMY" is the Type for a custom unit I made.