Unknown problem >.>

Place to get help with not working mods / modding interface.
midnight109
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 27, 2013 3:59 pm
Contact:

Unknown problem >.>

Post by midnight109 »

Without a logger or debugger kinda hard for me to see the problem, prob something simple just not familier with coding on this prog yet.
It was working, then for some reason I broke it somehow >.>

Aside from the image files, here is all the code
if You can see the issues please let me know :)

Code: Select all

info.json

{
	"name": "ralmodpk1",
	"version": "0.0.3",
	"title": "RAL Basic Mod Pack 1",
	"author": "Robert A Lee",
	"contact": "midnight43605@mail.com",
    "dependencies": ["base >= 0.5.0"],
	"description": "Adds options for getting started as well as remote mines, allows small solar construction at the start, and a higher output electric driller"
}

Code: Select all

data.lua

require("prototypes.entity")
require("prototypes.item")
require("prototypes.recipe")

Code: Select all

control.lua

require "util"
require "defines"

Code: Select all

item.lua
data:extend(
{
	{
		type = "item",
		name = "mini-solar-panel",
		icon = "__ralmodpk1__/graphics/icons/solar-panel_1.png",
		flags = {"goes-to-quickbar"},
		group = "energy",
		order = "h-h-c",
		place_result = "mini-solar-panel",
		stack_size = 64
	},
	{
		type = "item",
		name = "fast-mining-drill",
		icon = "__ralmodpk1__/graphics/icons/fast-mining-drill.png",
		flags = {"goes-to-quickbar"},
		group = "production",
		order = "h-c-c",
		place_result = "fast-mining-drill",
		stack_size = 32
	},
	{
		type = "item",
		name = "adv-accumulator",
		icon = "__ralmodpk1__/graphics/icons/adv-accumulator.png",
		flags = {"goes-to-quickbar"},
		order = "h-h-g-b",
		place_result = "adv-accumulator",
		group = "energy",
		stack_size = 16
	}
})

Code: Select all

recipe.lua
data:extend(
{
  {
    type = "recipe",
    name = "fast-mining-drill",
    energy_required = 15,
    enabled = "true",
    ingredients =
    {
      {"steel-plate", 5},
      {"electronic-circuit", 5},
      {"iron-gear-wheel", 9},
	  },
    result = "fast-mining-drill"
  },
    {
    type = "recipe",
    name = "mini-solar-panel",
    enabled = "true",
    ingredients =
    {
      {"iron-plate", 1},
      {"copper-plate", 1}
    },
    result = "mini-solar-panel"
  },
	{
		type = "recipe",
		name = "adv-accumulator",
		enabled = "true",
		ingredients = {
			{"iron-plate", 3},
			{"copper-plate", 5},
		},
		result = "adv-accumulator"
	}
})

Code: Select all

entity.lua
data:extend(
{
{
    type = "solar-panel",
    name = "mini-solar-panel",
    icon = "__ralmodpk1__/graphics/icons/solar-panel_1.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.5, result = "mini-solar-panel"},
    max_health = 25,
    collision_box = {{-.75, -.75}, {.75, .75}},
    selection_box = {{-.75, -.75}, {.75, .75}},
    energy_source =
    {
      type = "electric",
      input_priority = "none",
      output_priority = "primary"
    },
    picture =
    {
      filename = "__ralmodpk1__/graphics/entity/solar_1.png",
      priority = "high",
      width = 52,
      height = 48
    },
    production = 5
  },
  {
    type = "mining-drill",
    name = "fast-mining-drill",
    icon = "__ralmodpk1__/graphics/icons/fast-mining-drill.png",
    flags = {
      "placeable-neutral",
      "player-creation"
    },
    minable = {
      mining_time = 1,
      result = "fast-mining-drill"
    },
    max_health = 70,
    collision_box = {
      {
        -1.4,
        -1.4
      },
      {
        1.4,
        1.4
      }
    },
    selection_box = {
      {
        -1.5,
        -1.5
      },
      {
        1.5,
        1.5
      }
    },
    animations =
    {
      north =
      {
        priority = "extra-high",
        frame_width = 110,
        frame_height = 114,
        line_length = 8,
        shift = {0.2, -0.2},
        filename = "__ralmodpk1__/graphics/entity/fast-mining-drill/north.png",
        frame_count = 64
      },
      east =
      {
        priority = "extra-high",
        frame_width = 129,
        frame_height = 100,
        line_length = 8,
        shift = {0.45, 0},
        filename = "__ralmodpk1__/graphics/entity/fast-mining-drill/east.png",
        frame_count = 64
      },
      south =
      {
        priority = "extra-high",
        frame_width = 109,
        frame_height = 111,
        line_length = 8,
        shift = {0.15, 0},
        filename = "__ralmodpk1__/graphics/entity/fast-mining-drill/south.png",
        frame_count = 64
      },
      west =
      {
        priority = "extra-high",
        frame_width = 128,
        frame_height = 100,
        line_length = 8,
        shift = {0.25, 0},
        filename = "__ralmodpk1__/graphics/entity/fast-mining-drill/west.png",
        frame_count = 64
      }
    },
    effectivity = 0.5,
    energy_source = {
      type = "electric",
      input_priority = "secondary"
    },
    energy_usage_per_tick = 3.0,
    animation_speed_modifier = 0.5,
    mining_speed = 6,
    pipe_length = 2,
    resource_searching_radius = 3.49,
    vector_to_place_result = {
      0,
      -1.75
    }
  },
	{
		type = "accumulator",
		name = "adv-accumulator",
		icon = "__ralmodpk1__/graphics/icons/adv-accumulator.png",
		flags = {"placeable-neutral", "player-creation"},
		minable = {hardness = 0.2, mining_time = 0.5, result = "adv-accumulator"},
		max_health = 75,
		collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
		selection_box = {{-1, -1}, {1, 1}},
		picture = {
			filename = "__ralmodpk1__/graphics/entity/adv-accumulator.png",
			priority = "extra-high",
			width = 124,
			height = 103,
			shift = {0.7, -0.2}
		},
		charge_animation = {
			filename = "__ralmodpk1__/graphics/entity/adv-accumulator-charge-animation.png",
			priority = "high",
			frame_width = 138,
			frame_height = 135,
			line_length = 8,
			frame_count = 24,
			shift = {0.482, -0.638}
		},
		charge_frame_rate = 2,
		charge_cooldown = 30,
		discharge_animation = {
			filename = "__ralmodpk1__/graphics/entity/adv-accumulator-discharge-animation.png",
			priority = "high",
			frame_width = 147,
			frame_height = 128,
			line_length = 8,
			frame_count = 24,
			shift = {0.395, -0.525}
		},
		discharge_frame_rate = 2,
		discharge_cooldown = 60,
		discharge_light = {intensity = 0.7, size = 7},
		inventory_size = 3,
		energy_source = {
			type = "electric",
			output_priority = "terciary",
			input_priority = "terciary",
			buffer_capacity = 250
		}
	}
})

Code: Select all



midnight109
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 27, 2013 3:59 pm
Contact:

Re: Unknown problem >.>

Post by midnight109 »

some of the numbers like the solar panel production at 5 is supposed to be .25 just changed it to 5 while tweaking some other stuff but that wasent what broke it <.<
What I remember doing was changing the name of the dir in the mods dir over and moving the stuff over so i can keep a backup of the original to tweak and add more stuff to, changed over the file locations for the graphics, and it stoped working, now not even the backup works for some reason so im assuming while i copy/pasting i acidently deleted something important <.<

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Unknown problem >.>

Post by FreeER »

The assumption I would make (since I can't see anything obviously wrong with the code you posted) is that you forgot to change the info name property to the exact same as the name of the mod directory (or that you changed the name of an internal directory, eg graphics). As far as backups go you should just be able to store your mod in a zip file (factorio ignores them), or simply copy the mod folder into a backup folder on your desktop/documents. Also, it might be easier to zip your mod folder and attach it to the post (assuming it's relatively small, could also use dropbox or filehosting and include a link) this way it's easy to see everything you have and we can make changes to test for ourselves we have found a proper solution to your issue :D
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

midnight109
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 27, 2013 3:59 pm
Contact:

Re: Unknown problem >.>

Post by midnight109 »

when you say the dir and mod name to match >.>
The dir in the mods folder is ral-mod-pk1 and the name in the info.json file is ralmodpk1 is that the issue? i went through and even replaced all the images with stock using the __base__ for everything still dosent load
The total size is almost 3mb with all the images zipped
i uploaded to my google drive - https://docs.google.com/file/d/0B4AHlTU ... sp=sharing

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Unknown problem >.>

Post by FreeER »

Yep that's the issue, the name field in the info must be exactly the same as the name of the mod directory. In this case ral-pk-1, though it is likely easier to simply change the name of the directory to ralpk1 (which is what I did, otherwise you have to change all of the __ralpk1__ to __ral-pk-1__ though it wouldn't be that bad using find and replace). After that there are two graphics errors with the mini-solar panel, the descriptions tell it to look for solar_1 (entity) and solar-panel_1 (icon in both entity and item) and the file is named sp1.
After those changes it loads perfectly.
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Unknown problem >.>

Post by ficolas »

midnight109 wrote:when you say the dir and mod name to match >.>
The dir in the mods folder is ral-mod-pk1 and the name in the info.json file is ralmodpk1 is that the issue? i went through and even replaced all the images with stock using the __base__ for everything still dosent load
The total size is almost 3mb with all the images zipped
i uploaded to my google drive - https://docs.google.com/file/d/0B4AHlTU ... sp=sharing
The images arent the problem, if they were, factorio would send an error telling "__blabla__/bla/bla.png" coulnt be found.
The dir and the mod name needs to be the same, that same thimg happened to me and to somebody else.

I cant download it now because im using a smartphone, so that is what I can tell.

midnight109
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 27, 2013 3:59 pm
Contact:

Re: Unknown problem >.>

Post by midnight109 »

The image files I changed over back and fourth messing with them trying to find out why it broke, for a bit thought maybe while editing the images in Gimp i messed up so was also loading stock images to see if it corrected.

Much thanks for the info though.
So on all mods for this program, in the info.json file, the "name" = the dir name its placed in, not the name or a shortcut to the mod like a call sign, thats what I was thinking that was setting up so didnt even think about changing that around, i thought the name was giving the rest of the files in the mod a call tag to use like a link __mod_name__ points to the main dir of the mod with that link not to the accual mod dir kinda confusing compared to how im used to doing it but, i will manage to get used to it sooner or later

Ok, back to tweaking the balancing out some and will put up the finished mod with the tech research added and a few other changes

ty all again :)

Post Reply

Return to “Modding help”