Page 1 of 1

LUA Unit type

Posted: Fri Apr 02, 2021 1:55 pm
by cicciopastic
how do i identify a unit kind (e.g. Infantry or CapitalShip). I tried a lot and i thought something as the following condition (with or without quotes), but is not working

if unit.type.kind == "Infantry" then
unit.max_strength = 15
end

Is anybody able to help me plz?

Re: LUA Unit type

Posted: Fri Apr 02, 2021 4:15 pm
by cicciopastic
i got it! unit kind is a numeric value with infantry code equal to 0 so the correct script is

if unit.type.kind == 0 then
unit.max_strength = 15
end