Hello, I am new to modding in factorio. I was testing my first mod and got this error. I am trying to make a nuclear cannon that shoots a missile to anywhere in the map. I tried to fix it but i couldn't find anywhere what was causing the error. The error occurred in the entity.lua file
When opening factorio it shows __Nuclearcannon__/prototypes/entity.lua:21: '}' expected (to close '{' at line 3)
Here is the code:
data:extend{
(
{
type = "electric-turret",
name = "Nuclear-cannon",
icon = "__Nuclearcannon__/graphics/entity/nuclearcannon.png",
flags = {"player-creation", "placeable-neutral"},
minable = {hardness = 0.2, mining_time = 3, result = "Nuclear-cannon"},
max_health = Health.Tier8,
resistances = Resistances.Tier6,
corpse = "medium-remnants",
selection_box = {{-1.2, -1,2}, {1.2, 1.2}},
collision_box = {{-0.7, -0,7}, {0.7, 0.7}},
vehicle_impact_sound = {filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65},
rotation_speed = 0.5,
preparing_speed = 0.75,
folding_speed = 0.25,
dying_explosion = "big-explosion",
inventory_size = 1,
automated_ammo_count = 5,
energy-source =
{
type = "electric",
buffer_capacity = "500kJ",
emmisions = 0.067 / 1.5,
usage_priority = "secondary-input",
},
energy_usage = "1,5mW"
}
}
)
Error: '}' expected (to close '{' at line 3) near = (solved)
Error: '}' expected (to close '{' at line 3) near = (solved)
Last edited by guldakh on Sun Nov 20, 2016 11:57 am, edited 1 time in total.
Re: Error: '}' expected (to close '{' at line 3) near =
it looks like you need to start with a parenthesis data:extend ( { {
Re: Error: '}' expected (to close '{' at line 3) near =
Nope, I just tried it and it won't work
Re: Error: '}' expected (to close '{' at line 3) near =
It should be 1.5 MW, with a dot, not a comma:guldakh wrote:Code: Select all
energy_usage = "1,5mW"
Code: Select all
energy_usage = "1.5 MW"
Re: Error: '}' expected (to close '{' at line 3) near =
I meant i tried it changing the order of the parenthesis and it didn't work but for the other thing thanks
Re: Error: '}' expected (to close '{' at line 3) near =
energy-source should be energy_source.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Error: '}' expected (to close '{' at line 3) near =
Thanks to you all because i solved it