More than 200 variables?
Posted: Fri Aug 14, 2020 1:46 pm
Hi! I've included many scripts like this one in game:supply.lua > function SetUnitMovePenalty(unit):
Robotron, are you on holidays?
And now this error appears:local koenigsberg = game:GetHex(112, 17)
if koenigsberg.unit ~= nil
and unit.hex ~= nil
and unit.hex.x == 112
and unit.hex.y == 17
and unit.prototype.name == "garrison" then
unit.mp = 0
end
Any idea about how to include more variables without breaking the function? Is it possible to clone the same function with no more than 200 variables each one? I don't know how to do it[15:34:35][1104][C]:-1(global dofile) std::exception: 'Lua Error:game/game_supply.lua:1958: function at line 94 has more than 200 local variables'