expected to close at line 108 ?

Place to get help with not working mods / modding interface.
Post Reply
Jean_Jaques
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Nov 21, 2019 4:29 pm
Contact:

expected to close at line 108 ?

Post by Jean_Jaques »

hello, uhm
so, this is my first time at modding on factorio and in lua.
was i wanted was just a simple turret that close the gab betwen the big arty and the small turrets
i mostly tried to do it myself and with a bit of stitching of already in game used code.

i got some error which luckely i could fix but i have no idea how to fix that

Code: Select all

data:extend{
{
	type = "ammo-turret",
    name = "shockwave-cannon",
    icon = "__base__/graphics/icons/gun-turret.png",
    icon_size = 32,
    flags = {"placeable-player", "player-creation"},
    minable = {mining_time = 0.5, result = "assult-turret"},
    max_health = 800,
    corpse = "medium-remnants",
    collision_box = {{-0.7, -0.7 }, {0.7, 0.7}},
    selection_box = {{-1, -1 }, {1, 1}},
    rotation_speed = 0.055,
    preparing_speed = 0.38,
    folding_speed = 0,
    dying_explosion = "medium-explosion",
    inventory_size = 2,
    automated_ammo_count = 10,
    attacking_speed = 0.1,
    alert_when_attacking = true,
    open_sound = { filename = "", volume = 0.85 },
    close_sound = { filename = "", volume = 0.75 },
    folded_animation =
    {
      layers =
      {
      }
    },
    preparing_animation =
    {
      layers =
      {
        shockwave_cannon_sheet{},
      }
    },
    prepared_animation = 
	{
      layers =
      {
        shockwave_cannon_sheet{},
      }
    },
    attacking_animation =
	{
      layers =
      {
        shockwave_cannon_sheet{},
      }
    },
    folding_animation =
    {
      layers =
      {
      }
    },
    base_picture =
    {
      layers =
      {
        {
          filename = "",
          priority = "high",
          width = 90,
          height = 75,
          axially_symmetrical = false,
          direction_count = 1,
          frame_count = 1,
          shift = {0, -0.046875},
        },
        {
          filename = "",
          flags = { "mask" },
          line_length = 1,
          width = 100,
          height = 100,
          axially_symmetrical = false,
          direction_count = 1,
          frame_count = 1,
          shift = {0, -0.234375},
          apply_runtime_tint = true
        }
      }
    },
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
	{                                                                                                                                 line 108
		type = "projectile",
		ammo_category = "cannon-shell"
		cooldown = 100,                                                                                                     line 111
		projectile_creation_distance = 2.0,
		projectile_center = {0.0, 0.5},
		damage_modifier = 1.5,
		min_range = 30.0,
		range = 100,
		turn_range = 1,
		shell_particle =
		{
			name = "shell-particle",
			direction_deviation = 0.1,
			speed = 0.1,
			speed_deviation = 0.03,
			center = {0, 0},
			creation_distance = -1.925,
			starting_frame_speed = 0.2,
			starting_frame_speed_deviation = 0.1
		},
		sound = 
		{
			{
				filename = "",
				volume = 0.75
			}
		}
	},
	call_for_help_radius = 40
}}
i did ask a friend, who work with lua a long time, and even he have no clue whats the problem is.
of corse i tried to look up the error in google but no solution.

thank you in advance
Attachments
message.PNG
message.PNG (43.74 KiB) Viewed 1411 times

Hiladdar
Fast Inserter
Fast Inserter
Posts: 214
Joined: Mon May 14, 2018 6:47 pm
Contact:

Re: expected to close at line 108 ?

Post by Hiladdar »

I looked at your code, and the first place I would look at lines 82-87, specifically the highlighted part:

...
}
},
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
{ line 108
type = "projectile",
ammo_category = "cannon-shell"
...

Hiladdar

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: expected to close at line 108 ?

Post by eradicator »

key=value pairs in tables must be seperated by a comma.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Re: expected to close at line 108 ?

Post by PyroFire »

line 110 missing a comma
ammo_category = "cannon-shell" ,
cooldown = 100,
Your "lua friend" musn't be very savvy :O

Jean_Jaques
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Nov 21, 2019 4:29 pm
Contact:

Re: expected to close at line 108 ?

Post by Jean_Jaques »

to be honest im abit embarrassed because of this. but it works now.
thanks

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: expected to close at line 108 ?

Post by eradicator »

Btw i specifically didn't mention where exactly the comma is missing because the error is so common and basic that not being able to spot it yourself means you're essentially unable to write any lua at all. And frankly your friend is either a liar or he didn't actually look at the code.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”