[Solved] lua:15: unexpected symbol near 'for'
Posted: Tue Dec 20, 2022 9:49 pm
So I am trying to write a function, which given some inputs automatically creates a valid fluid prototype, however whenever I run my mod with this code I get the error in the title, and I am unable to pinpoint its source. Also I have attached the full mod below.
Code In Question:
Code In Question:
Code: Select all
--Functions
function create_gas(parameters)
return--Takes gas name,flow color,default temperature and when it turns into a gas and
{ --puts this into a form that can be passed into data:extend
icon="__highfleet-ships__/graphics/icons/"..parameters.name..".png",
icon_mipmaps=4,
icon_size=64,
type="fluid",
name=parameters.name,
subgroup="fluid",
base_color={},
flow_color=parameters.flow_color,
default_temperature=parameters.default_temperature,
gas_temperature=parameters.gas_temperature,
for keys,values in ipairs(flow_color) do
table.insert(base_color,math.floor(0.5*values))
end
}
end