Page 1 of 1

Settings.lua problem[0.17.x] SOLVED

Posted: Mon Sep 16, 2019 6:21 pm
by Tunasz
Hello everyone!

I am working on my mod and I want to add a settings into it, but I get a bug.
"No loader found for "bool-setting" ".
I tried to copy the tutorial's code into settings.lua, I tried other mods codes, but I got this bug every time.
Now this is how the files looks like.
Data.lua

Code: Select all

require("prototype.settings")
require("prototype.item-groups")
require("prototype.item")
require("prototype.entity")
require("prototype.recipe")
require("prototype.control")
settings.lua

Code: Select all

require("prototype.options-panel")
options-panel.lua

Code: Select all

data:extend({
    {
        type = "bool-setting",
        name = "wartorio-maximum-number-robots-both",
        setting_type = "runtime-global",
        order="a",
        default_value = true
    },
    {
        type = "int-setting",
        name = "wartorio-maximum-number-robots",
        setting_type = "runtime-global",
        order="b",
        minimum_value = 0,
        maximum_value = 1000,
        default_value = 100
    },
    {
        type = "int-setting",
        name = "wartorio-maximum-number-robots-iron",
        setting_type = "runtime-global",
        minimum_value = 0,
        order="c",
        maximum_value = 1000,
        default_value = 0
    },
    {
        type = "int-setting",
        name = "wartorio-maximum-number-robots-copper",
        setting_type = "runtime-global",
        order="d",
        minimum_value = 0,
        maximum_value = 1000,
        default_value = 0
    }
})
Do I need to put extra code into other places or do I missed something?
I would be glad if someone could help!

Re: Settings.lua problem[0.17.x]

Posted: Mon Sep 16, 2019 6:45 pm
by eradicator
Tunasz wrote: Mon Sep 16, 2019 6:21 pm options-panel.lua

Code: Select all

data:extend({
    {
        type = "bool-setting",
        name = "wartorio-maximum-number-robots-both",
        setting_type = "runtime-global",
        order="a",
        default_value = true
    },
    {
        type = "int-setting",
        name = "wartorio-maximum-number-robots",
        setting_type = "runtime-global",
        order="b",
        minimum_value = 0,
        maximum_value = 1000,
        default_value = 100
    },
    {
        type = "int-setting",
        name = "wartorio-maximum-number-robots-iron",
        setting_type = "runtime-global",
        minimum_value = 0,
        order="c",
        maximum_value = 1000,
        default_value = 0
    },
    {
        type = "int-setting",
        name = "wartorio-maximum-number-robots-copper",
        setting_type = "runtime-global",
        order="d",
        minimum_value = 0,
        maximum_value = 1000,
        default_value = 0
    }
})
That works just fine if i copy/paste it into my own settings.lua. So your bug must be somewhere else.

Re: Settings.lua problem[0.17.x]

Posted: Mon Sep 16, 2019 6:49 pm
by Bilka
Don't require the settings in the data stage.

Re: Settings.lua problem[0.17.x]

Posted: Mon Sep 16, 2019 8:40 pm
by Tunasz
Ok I put it into settings.lua, but this no loader for bool-setting issue only appeared, when I put in the settings.lua with some code and this was the last thing that I implemented.
Could the version cause this?
The other things what I have is entities, items, recipes and the local.
But only the local has something to do with the settings.lua.

Re: Settings.lua problem[0.17.x]

Posted: Tue Sep 17, 2019 9:56 am
by Tunasz
SOLVED.
I had 2 problems which caused the error.
1. I had the data.lua request the settings.
2. I had the setting.lua inside the prototypes file.