Forged Alliance Forever Forums
Moderator: Morax
for UnitID, UnitBlueprint in __blueprints do
if UnitBlueprint.General.UnitWeight then
LOG('Unit '..UnitID..' has a value of '..UnitBlueprint.General.UnitWeight..' as UnitWeight')
if UnitBlueprint.CategoriesHash.TECH1 then
LOG('Unit '..UnitID..' is a TECH1 unit. Seting UnitWeight to 1')
UnitBlueprint.General.UnitWeight = 1
end
if UnitBlueprint.CategoriesHash.TECH2 then
LOG('Unit '..UnitID..' is a TECH2 unit. Seting UnitWeight to 2')
UnitBlueprint.General.UnitWeight = 2
end
if UnitBlueprint.CategoriesHash.TECH3 then
LOG('Unit '..UnitID..' is a TECH3 unit. Seting UnitWeight to 3')
UnitBlueprint.General.UnitWeight = 3
end
if UnitBlueprint.CategoriesHash.EXPERIMENTAL then
LOG('Unit '..UnitID..' is a EXPERIMENTAL unit. Seting UnitWeight to 4')
UnitBlueprint.General.UnitWeight = 4
end
else
LOG('Unit '..UnitID..' don\'t has a UnitWeight')
end
end
local overridden = ModBlueprints
function ModBlueprints(blueprints)
overridden(blueprints)
for id,bp in blueprints.Unit do
if bp.General.UnitWeight then
if table.find(bp.Categories, 'TECH1') then
bp.General.UnitWeight = 1
elseif table.find(bp.Categories, 'TECH2') then
bp.General.UnitWeight = 2
elseif table.find(bp.Categories, 'TECH3') then
bp.General.UnitWeight = 3
elseif table.find(bp.Categories, 'EXPERIMENTAL') then
bp.General.UnitWeight = 4
end
end
end
end
end
Users browsing this forum: No registered users and 1 guest