I'm trying to make a quick and dirty mod that combines a solar panel and an accumulator, making a solar-battery and saving tons of space. I mean it's not like we are in some 2D universe where you can't have stuff on top of other stuff
I've followed the wiki tutorial as close as possible while not making a bomber, but now that I think my mod is complete and want to test it in-game I get an error saying "Error in assignID, 'solar-battery' was not recognized id of entity". I've searched for that error on the forums and found a few things to try but none worked, maybe those fixes were for older game versions or I have an error between the keyboard and my chair.
In my C:\Users\jcewazhere\AppData\Roaming\Factorio\mods folder I have the "solar-battery" folder and mod-list.json. (windows 7 64 bit version)
In the solar-battery folder I have a folder for graphics, I just made a quick solar-battery.png in paint.net, and I have the stock accumlator graphics in a folder as well. Then I have a prototypes folder, and a sound folder. The sounds are direct cut/paste from the basic accumulator.
Then I have control.lua, but I'm not sure what to put there. I've been mostly taking code from the stock items and putting it where I think it needs to go, but the tutorial is for a bomber and the control.lua's from the main game are not very forthcoming with ideas.
Then I have data.lua:
require("prototypes.item")
require("prototypes.recipe")
require("prototypes.entity")
like the tutorial says.
Then I have info.json:
{
"name": "solar-battery",
"version": "0.1.1",
"title": "My first mod",
"author": "Jcewazhere",
"description": "Solar panel and accumulator in the same block space"
}
Inside the prototypes folder I have the following files:"name": "solar-battery",
"version": "0.1.1",
"title": "My first mod",
"author": "Jcewazhere",
"description": "Solar panel and accumulator in the same block space"
}
entity.lua
data:extend({
type = "item",
name = "solar-battery",
icon = "__solar-battery__/graphics/icons/solar-battery.png",
flags = {"placeable-neutral", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "solar-battery"},
max_health = 100,
corpse = "big-remnants",
collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
selection_box = {{-1, -1}, {1, 1}},
energy_source =
{
type = "electric",
buffer_capacity = "5MJ",
usage_priority = "terciary",
input_flow_limit = "300kW",
output_flow_limit = "300kW"
},
picture =
{
filename = "__solar-battery__/graphics/entity/solar-panel/solar-battery.png",
priority = "extra-high",
width = 124,
height = 103,
shift = {0.7, -0.2}
},
charge_animation =
{
filename = "__solar-battery__/graphics/entity/basic-accumulator/basic-accumulator-charge-animation.png",
width = 138,
height = 135,
line_length = 8,
frame_count = 24,
shift = {0.482, -0.638},
animation_speed = 0.5
},
charge_cooldown = 30,
charge_light = {intensity = 0.3, size = 7},
discharge_animation =
{
filename = "__solar-battery__/graphics/entity/basic-accumulator/basic-accumulator-discharge-animation.png",
width = 147,
height = 128,
line_length = 8,
frame_count = 24,
shift = {0.395, -0.525},
animation_speed = 0.5
},
discharge_cooldown = 60,
discharge_light = {intensity = 0.7, size = 7},
working_sound =
{
sound =
{
filename = "__solar-battery__/sound/accumulator-working.ogg",
volume = 1
},
idle_sound = {
filename = "__solar-battery__/sound/accumulator-idle.ogg",
volume = 0.4
},
max_sounds_per_type = 5
},
production = "60kW"
})
type = "item",
name = "solar-battery",
icon = "__solar-battery__/graphics/icons/solar-battery.png",
flags = {"placeable-neutral", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "solar-battery"},
max_health = 100,
corpse = "big-remnants",
collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
selection_box = {{-1, -1}, {1, 1}},
energy_source =
{
type = "electric",
buffer_capacity = "5MJ",
usage_priority = "terciary",
input_flow_limit = "300kW",
output_flow_limit = "300kW"
},
picture =
{
filename = "__solar-battery__/graphics/entity/solar-panel/solar-battery.png",
priority = "extra-high",
width = 124,
height = 103,
shift = {0.7, -0.2}
},
charge_animation =
{
filename = "__solar-battery__/graphics/entity/basic-accumulator/basic-accumulator-charge-animation.png",
width = 138,
height = 135,
line_length = 8,
frame_count = 24,
shift = {0.482, -0.638},
animation_speed = 0.5
},
charge_cooldown = 30,
charge_light = {intensity = 0.3, size = 7},
discharge_animation =
{
filename = "__solar-battery__/graphics/entity/basic-accumulator/basic-accumulator-discharge-animation.png",
width = 147,
height = 128,
line_length = 8,
frame_count = 24,
shift = {0.395, -0.525},
animation_speed = 0.5
},
discharge_cooldown = 60,
discharge_light = {intensity = 0.7, size = 7},
working_sound =
{
sound =
{
filename = "__solar-battery__/sound/accumulator-working.ogg",
volume = 1
},
idle_sound = {
filename = "__solar-battery__/sound/accumulator-idle.ogg",
volume = 0.4
},
max_sounds_per_type = 5
},
production = "60kW"
})
item.lua
data:extend({
{
type = "item",
name = "solar-battery",
icon = "__solar-battery__/graphics/icons/solar-battery.png",
flags = {"goes-to-quickbar"},
subgroup = "energy",
order = "b[solar-battery]-a[solar-battery]",
place_result = "solar-battery",
stack_size = 50
}
})
and finally recipe.lua
{
type = "item",
name = "solar-battery",
icon = "__solar-battery__/graphics/icons/solar-battery.png",
flags = {"goes-to-quickbar"},
subgroup = "energy",
order = "b[solar-battery]-a[solar-battery]",
place_result = "solar-battery",
stack_size = 50
}
})
extend({
{
type = "recipe",
name = "solar-battery",
enabled = "true",
ingredients =
{
{"steel-plate", 5},
{"electronic-circuit", 15},
{"copper-plate", 5},
{"iron-plate", 2},
{"battery", 5}
},
result = "solar-battery"
}
})
I planned on tweaking things like the crafting recipe, power generation rate and storage once I had it working. Right now I'm just trying to get it to work. Any help would be appreciated, thanks in advance.{
type = "recipe",
name = "solar-battery",
enabled = "true",
ingredients =
{
{"steel-plate", 5},
{"electronic-circuit", 15},
{"copper-plate", 5},
{"iron-plate", 2},
{"battery", 5}
},
result = "solar-battery"
}
})
I hope spoilers just don't work in the preview, if not I'm sorry for the long post, at least I tried to use them
PS: Whoever decided the text box and the cursor should be the pretty much the same color is a very annoying person