Problem with launching mod - Lua error
Problem with launching mod - Lua error
I am learning programming only a few days
Here's original mod which i want to modify
So that was different from the original I call it like this - Smarter Inserters
I simply delete long smart inserter and and left one simple smart inserter - here's my text from entity file
______________________________________________________________________________________________
data:extend(
{
β ****************************
β Note: Graphics are from base mod, but copied
β here in case custom graphics are used.
β ****************************
β ****************************
β Smart Basic Inserter
β ****************************
{
type = "inserter",
name = "SB-inserter",
icon = "__Smart-Inserters__/graphics/icons/SB-inserter.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "SB-inserter"},
max_health = 40,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 90
}
},
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
working_sound =
{
match_progress_to_activity = true,
sound =
{
{
filename = "__base__/sound/inserter-fast-1.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-2.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-3.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-4.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-5.ogg",
volume = 0.75
}
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
energy_per_movement = 7000,
energy_per_rotation = 7000,
hand_size = 1.25,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.12,
rotation_speed = 0.035,
pickup_position = {0, -1},
insert_position = {0, 1.8},
filter_count = 5,
programmable = true,
uses_arm_movement = "basic-inserter",
fast_replaceable_group = "inserter",
circuit_wire_max_distance = 7.5,
circuit_wire_connection_point =
{
shadow =
{
red = {0, 0},
green = {0, 0}
},
wire =
{
red = {0, 0},
green = {0, 0}
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
pickup_position = {0, -1},
insert_position = {0, 1.2},
energy_per_movement = 5000,
energy_per_rotation = 5000,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.028,
fast_replaceable_group = "inserter",
hand_base_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-base.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-closed.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-open.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_base_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
platform_picture =
{
sheet=
{
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-platform.png",
priority = "extra-high",
width = 46,
height = 46
}
},
rotation_speed = 0.014
}
)
________________________________________________________________________________
And my error
Here's original mod which i want to modify
So that was different from the original I call it like this - Smarter Inserters
I simply delete long smart inserter and and left one simple smart inserter - here's my text from entity file
______________________________________________________________________________________________
data:extend(
{
β ****************************
β Note: Graphics are from base mod, but copied
β here in case custom graphics are used.
β ****************************
β ****************************
β Smart Basic Inserter
β ****************************
{
type = "inserter",
name = "SB-inserter",
icon = "__Smart-Inserters__/graphics/icons/SB-inserter.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "SB-inserter"},
max_health = 40,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 90
}
},
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
working_sound =
{
match_progress_to_activity = true,
sound =
{
{
filename = "__base__/sound/inserter-fast-1.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-2.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-3.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-4.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-fast-5.ogg",
volume = 0.75
}
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
energy_per_movement = 7000,
energy_per_rotation = 7000,
hand_size = 1.25,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.12,
rotation_speed = 0.035,
pickup_position = {0, -1},
insert_position = {0, 1.8},
filter_count = 5,
programmable = true,
uses_arm_movement = "basic-inserter",
fast_replaceable_group = "inserter",
circuit_wire_max_distance = 7.5,
circuit_wire_connection_point =
{
shadow =
{
red = {0, 0},
green = {0, 0}
},
wire =
{
red = {0, 0},
green = {0, 0}
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
pickup_position = {0, -1},
insert_position = {0, 1.2},
energy_per_movement = 5000,
energy_per_rotation = 5000,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.028,
fast_replaceable_group = "inserter",
hand_base_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-base.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-closed.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-open.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_base_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
platform_picture =
{
sheet=
{
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-platform.png",
priority = "extra-high",
width = 46,
height = 46
}
},
rotation_speed = 0.014
}
)
________________________________________________________________________________
And my error
- Attachments
-
- Lua error 226.png (6.82 KiB) Viewed 3793 times
Last edited by aklesey1 on Wed Jun 22, 2016 7:11 pm, edited 1 time in total.
Nickname on ModPortal - Naron79
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: Problem this launching mod - Lua error
Do those comments (the "****" bits) have 2 hyphens in front, or just 1? Because they need 2
Re: Problem this launching mod - Lua error
Where i did mistake? Please showDedlySpyder wrote:Do those comments (the "****" bits) have 2 hyphens in front, or just 1? Because they need 2
I don't any hyphen's in code
I understand that this error tell about this symbol " } " and its usage
Last edited by aklesey1 on Wed Jun 22, 2016 7:17 pm, edited 1 time in total.
Nickname on ModPortal - Naron79
- DedlySpyder
- Filter Inserter
- Posts: 254
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: Problem with launching mod - Lua error
These lines need to start with "--" instead of "β". 2 hyphens not a dashβ ****************************
β Note: Graphics are from base mod, but copied
β here in case custom graphics are used.
β ****************************
β ****************************
β Smart Basic Inserter
β ****************************
Re: Problem with launching mod - Lua error
No result
But you show me the commentary? i don't see any problems - there is underscore in commentary block now
But you show me the commentary? i don't see any problems - there is underscore in commentary block now
Nickname on ModPortal - Naron79
Re: Problem with launching mod - Lua error
Do you have Notepad++?aklesey1 wrote:No result
But you show me the commentary? i don't see any problems - there is underscore in commentary block now
download/file.php?id=12526 - error in entities.lua- line #3
Re: Problem with launching mod - Lua error
Yes i have, i'm often use it
Nickname on ModPortal - Naron79
Re: Problem with launching mod - Lua error
Delete this block and the mod will work.β ****************************
β Note: Graphics are from base mod, but copied
β here in case custom graphics are used.
β ****************************
β ****************************
β Smart Basic Inserter
β ****************************
Re: Problem with launching mod - Lua error
No resultDaveMcW wrote:Delete this block and the mod will work.β ****************************
β Note: Graphics are from base mod, but copied
β here in case custom graphics are used.
β ****************************
β ****************************
β Smart Basic Inserter
β ****************************
Can you write correct variant, so i can paste it in to file
I just started to learn lua programming, i can't find error in code
Nickname on ModPortal - Naron79
Re: Problem with launching mod - Lua error
Here's my full work now https://yadi.sk/d/uyNDstLHsjjKE folder with the mod
Nickname on ModPortal - Naron79
Re: Problem with launching mod - Lua error
Here's original mod entities lua file text
data:extend(
{
-- ****************************
-- Note: Graphics are from base mod, but copied
-- here in case custom graphics are used.
-- ****************************
-- ****************************
-- Smart Basic Inserter
-- ****************************
{
type = "inserter",
name = "SB-inserter",
icon = "__Smart-Inserters__/graphics/icons/SB-inserter.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "SB-inserter"},
max_health = 40,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 90
}
},
working_sound =
{
match_progress_to_activity = true,
sound =
{
{
filename = "__base__/sound/inserter-basic-1.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-2.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-3.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-4.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-5.ogg",
volume = 0.75
}
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
pickup_position = {0, -1},
insert_position = {0, 1.2},
energy_per_movement = 5000,
energy_per_rotation = 5000,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.028,
fast_replaceable_group = "inserter",
hand_base_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-base.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-closed.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-open.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_base_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
platform_picture =
{
sheet=
{
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-platform.png",
priority = "extra-high",
width = 46,
height = 46
}
},
rotation_speed = 0.014
},
-- ****************************
-- Smart Long-handed Inserter
-- ****************************
{
type = "inserter",
name = "SLH-inserter",
icon = "__Smart-Inserters__/graphics/icons/SLH-inserter.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "SLH-inserter"},
max_health = 40,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 90
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
pickup_position = {0, -2},
insert_position = {0, 2.2},
energy_per_movement = 5000,
energy_per_rotation = 5000,
rotation_speed = 0.02,
hand_size = 1.5,
programmable = true,
filter_count = 5,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.04,
fast_replaceable_group = "inserter",
working_sound =
{
match_progress_to_activity = true,
sound =
{
{
filename = "__base__/sound/inserter-long-handed-1.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-2.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-3.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-4.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-5.ogg",
volume = 0.75
}
}
},
hand_base_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/long-handed-inserter-hand-base.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/long-handed-inserter-hand-closed.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/long-handed-inserter-hand-open.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_base_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
platform_picture =
{
sheet =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/smart-inserter-platform.png",
priority = "extra-high",
width = 46,
height = 46
}
}
}
}
)
And all wotks !
I compare one with the other and not know what I could do wrong
data:extend(
{
-- ****************************
-- Note: Graphics are from base mod, but copied
-- here in case custom graphics are used.
-- ****************************
-- ****************************
-- Smart Basic Inserter
-- ****************************
{
type = "inserter",
name = "SB-inserter",
icon = "__Smart-Inserters__/graphics/icons/SB-inserter.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "SB-inserter"},
max_health = 40,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 90
}
},
working_sound =
{
match_progress_to_activity = true,
sound =
{
{
filename = "__base__/sound/inserter-basic-1.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-2.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-3.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-4.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-basic-5.ogg",
volume = 0.75
}
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
pickup_position = {0, -1},
insert_position = {0, 1.2},
energy_per_movement = 5000,
energy_per_rotation = 5000,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.028,
fast_replaceable_group = "inserter",
hand_base_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-base.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-closed.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SB-inserter/basic-inserter-hand-open.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_base_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
platform_picture =
{
sheet=
{
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-platform.png",
priority = "extra-high",
width = 46,
height = 46
}
},
rotation_speed = 0.014
},
-- ****************************
-- Smart Long-handed Inserter
-- ****************************
{
type = "inserter",
name = "SLH-inserter",
icon = "__Smart-Inserters__/graphics/icons/SLH-inserter.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "SLH-inserter"},
max_health = 40,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 90
}
},
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.4, -0.35}, {0.4, 0.45}},
pickup_position = {0, -2},
insert_position = {0, 2.2},
energy_per_movement = 5000,
energy_per_rotation = 5000,
rotation_speed = 0.02,
hand_size = 1.5,
programmable = true,
filter_count = 5,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
drain = "0.4kW"
},
extension_speed = 0.04,
fast_replaceable_group = "inserter",
working_sound =
{
match_progress_to_activity = true,
sound =
{
{
filename = "__base__/sound/inserter-long-handed-1.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-2.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-3.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-4.ogg",
volume = 0.75
},
{
filename = "__base__/sound/inserter-long-handed-5.ogg",
volume = 0.75
}
}
},
hand_base_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/long-handed-inserter-hand-base.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/long-handed-inserter-hand-closed.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_picture =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/long-handed-inserter-hand-open.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_base_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
priority = "extra-high",
width = 8,
height = 34
},
hand_closed_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
hand_open_shadow =
{
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
priority = "extra-high",
width = 18,
height = 41
},
platform_picture =
{
sheet =
{
filename = "__Smart-Inserters__/graphics/entity/SLH-inserter/smart-inserter-platform.png",
priority = "extra-high",
width = 46,
height = 46
}
}
}
}
)
And all wotks !
I compare one with the other and not know what I could do wrong
Nickname on ModPortal - Naron79