Error: '}' expected (to close '{' at line 3) near = (solved)

Place to get help with not working mods / modding interface.
guldakh
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Nov 19, 2016 10:45 pm
Contact:

Error: '}' expected (to close '{' at line 3) near = (solved)

Post by guldakh »

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"
}
}
)
Last edited by guldakh on Sun Nov 20, 2016 11:57 am, edited 1 time in total.
skratic
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Nov 19, 2016 7:55 pm
Contact:

Re: Error: '}' expected (to close '{' at line 3) near =

Post by skratic »

it looks like you need to start with a parenthesis data:extend ( { {
guldakh
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Nov 19, 2016 10:45 pm
Contact:

Re: Error: '}' expected (to close '{' at line 3) near =

Post by guldakh »

Nope, I just tried it and it won't work
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Error: '}' expected (to close '{' at line 3) near =

Post by daniel34 »

guldakh wrote:

Code: Select all

energy_usage = "1,5mW"
It should be 1.5 MW, with a dot, not a comma:

Code: Select all

energy_usage = "1.5 MW"
Also, skratic is right, you did start the code with the wrong parentheses.
quick links: log file | graphical issues | wiki
guldakh
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Nov 19, 2016 10:45 pm
Contact:

Re: Error: '}' expected (to close '{' at line 3) near =

Post by guldakh »

I meant i tried it changing the order of the parenthesis and it didn't work but for the other thing thanks
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Error: '}' expected (to close '{' at line 3) near =

Post by prg »

energy-source should be energy_source.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
guldakh
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Nov 19, 2016 10:45 pm
Contact:

Re: Error: '}' expected (to close '{' at line 3) near =

Post by guldakh »

Thanks to you all because i solved it :D
Post Reply

Return to “Modding help”