Page 1 of 1

Modding Help

Posted: Mon Jan 19, 2015 6:35 am
by Mezdonian
Hello i am getting an error when starting up a mod i have been trying to create i am just fiddling with some of the turret code but cant seem to get it to work i get this error upon startup

Image

And this is all my code for the file it is gving me the error for.
require "util"

missile_turret_extension =
{
filename = "__MezTurrets_0.1.1__/graphics/entity/missile-turret/missile-turret-extension.png",
priority = "medium",
width = 171,
height = 102,
direction_count = 4,
frame_count = 5,
axially_symmetrical = false,
shift = {1.34375, -0.5 + 0.6}
}


data:extend(
{

type = "ammo-turret",
name = "missile_turret",
icon = "__MezTurrets_0.1.1__/graphics/icons/gun-turret.png",
flags = {"placeable-player", "player-creation"},
minable = {mining_time = 0.5, result = "missile_turret"},
max_health = 300,
corpse = "small-remnants",
collision_box = {{-0.4, -0.9 }, {0.4, 0.9}},
selection_box = {{-0.5, -1 }, {0.5, 1}},
rotation_speed = 0.015,
preparing_speed = 0.08,
folding_speed = 0.08,
dying_explosion = "huge-explosion",
inventory_size = 1,
automated_ammo_count = 10,
folded_animation = (function()
local res = util.table.deepcopy(missile_turret_extension)
res.frame_count = 1
res.line_length = 1
return res
end)(),
preparing_animation = gun_turret_extension,
prepared_animation =
{
filename = "__MezTurrets_0.1.1__/graphics/entity/missile-turret/missile-turret.png",
priority = "medium",
width = 178,
height = 107,
direction_count = 64,
frame_count = 1,
line_length = 8,
axially_symmetrical = false,
shift = {1.34375, -0.46875 + 0.6}
},
folding_animation = (function()
local res = util.table.deepcopy(missile_turret_extension)
res.run_mode = "backward"
return res
end)(),
base_picture =
{
filename = "__MezTurrets_0.1.1__/graphics/entity/missile-turret/missile-turret-base.png",
priority = "high",
width = 43,
height = 28,
shift = { 0, -0.125 + 0.6 }
},
attack_parameters =
{
ammo_category = "bullet",
cooldown = 6,
projectile_center = {0, 0.6},
projectile_creation_distance = 1.2,
shell_particle =
{
name = "shell-particle",
direction_deviation = 0.1,
speed = 0.1,
speed_deviation = 0.03,
center = {0, 0.6},
creation_distance = 0.6,
starting_frame_speed = 0.2,
starting_frame_speed_deviation = 0.1
},
range = 17,
sound =
{
{
filename = "__MezTurrets_0.1.1__/sound/missile.ogg",
volume = 0.3
}
}
}



}


If anyone can help it would be great (trying to make a personal or public mod for new base defenses)

Re: Modding Help

Posted: Mon Jan 19, 2015 8:31 am
by Choumiko
add a ) to the end of your file. And get a editor like Notepad++ (if you havent already) that shows matching brackets, really helps with this kind of errors ;)

Re: Modding Help

Posted: Mon Jan 19, 2015 9:14 am
by L0771
I don't know if it work, but you missed 1 {, 2 } and 1 )

Code: Select all

  require "util"

missile_turret_extension =
	{
	filename = "__MezTurrets_0.1.1__/graphics/entity/missile-turret/missile-turret-extension.png",
	priority = "medium",
	width = 171,
	height = 102,
	direction_count = 4,
	frame_count = 5,
	axially_symmetrical = false,
	shift = {1.34375, -0.5 + 0.6}
	}


data:extend(
{
	{
	type = "ammo-turret",
	name = "missile_turret",
	icon = "__MezTurrets_0.1.1__/graphics/icons/gun-turret.png",
	flags = {"placeable-player", "player-creation"},
	minable = {mining_time = 0.5, result = "missile_turret"},
	max_health = 300,
	corpse = "small-remnants",
	collision_box = {{-0.4, -0.9 }, {0.4, 0.9}},
	selection_box = {{-0.5, -1 }, {0.5, 1}},
	rotation_speed = 0.015,
	preparing_speed = 0.08,
	folding_speed = 0.08,
	dying_explosion = "huge-explosion",
	inventory_size = 1,
	automated_ammo_count = 10,
	folded_animation = (function()
	local res = util.table.deepcopy(missile_turret_extension)
	res.frame_count = 1
	res.line_length = 1
	return res
	end)(),
	preparing_animation = gun_turret_extension,
	prepared_animation =
		{
		filename = "__MezTurrets_0.1.1__/graphics/entity/missile-turret/missile-turret.png",
		priority = "medium",
		width = 178,
		height = 107,
		direction_count = 64,
		frame_count = 1,
		line_length = 8,
		axially_symmetrical = false,
		shift = {1.34375, -0.46875 + 0.6}
		},
	folding_animation = (function()
	local res = util.table.deepcopy(missile_turret_extension)
	res.run_mode = "backward"
	return res
	end)(),
	base_picture =
		{
		filename = "__MezTurrets_0.1.1__/graphics/entity/missile-turret/missile-turret-base.png",
		priority = "high",
		width = 43,
		height = 28,
		shift = { 0, -0.125 + 0.6 }
		},
	attack_parameters =
		{
		ammo_category = "bullet",
		cooldown = 6,
		projectile_center = {0, 0.6},
		projectile_creation_distance = 1.2,
		shell_particle = 
			{
			name = "shell-particle",
			direction_deviation = 0.1,
			speed = 0.1,
			speed_deviation = 0.03,
			center = {0, 0.6},
			creation_distance = 0.6,
			starting_frame_speed = 0.2,
			starting_frame_speed_deviation = 0.1
			},
		range = 17,
		sound =
			{
				{
				filename = "__MezTurrets_0.1.1__/sound/missile.ogg",
				volume = 0.3
				}
			}
		}
	}
}
)