ingteb

by ixu

Ingame technology browser including... - backwards search: report any place where it is referenced - initiate research from information panels - initiate crafting from information panels - "pipette": selection from information panels - filter information panel by research status - reminder panel with autoresearch and autocrafting [de, en, ja, zn-CH]

Utilities
1 year, 7 months ago
1.0 - 1.1
363

b [fixed in 0.5.8] crash when making empty-barrel a capsule

2 years ago

the code:

    local function apply(src,dst)
        for k,v in pairs(src) do
            if(v=="setnil") then
                dst[k]=nil;
            else
                dst[k]=v;
            end
        end
    end
    local function register(inobj)
        data:extend{inobj}
    end

    --actual code:
if(1==1) then
    local barrel=table.deepcopy(data.raw.item["empty-barrel"]);
    local barrel_setting=
    {
        type="capsule",
        capsule_action=
        {
            type="throw",uses_stack=false,
            attack_parameters=
            {
                type="beam",range=5,cooldown=(60/10),
                activation_type="activate",
                ammo_type=
                {
                    category="capsule",
                    target_type="position",
                    action={type="direct",action_delivery={type="instant",target_effects={
                        {type="script",effect_id="using_barrel"},
                    },},},
                },
            },
        },
    };
    apply(barrel_setting,barrel);
    data.raw.item["empty-barrel"]=nil;
    register(barrel);
end

the log:

Error while running event ingteb::on_gui_click (ID 1)
__ingteb__/ingteb/Database.lua:31: attempt to index local 'data' (a nil value)
stack traceback:
    __ingteb__/ingteb/Database.lua:31: in function 'EnsureKey'
    __ingteb__/ingteb/Database.lua:359: in function 'AddRecipe'
    __ingteb__/ingteb/Database.lua:493: in function 'ScanFuel'
    __ingteb__/ingteb/Database.lua:513: in function 'ScanItem'
    __ingteb__/ingteb/Database.lua:149: in function 'ScanBackLinks'
    __ingteb__/ingteb/Database.lua:196: in function 'Ensure'
    __ingteb__/ingteb/EventManager.lua:40: in function <__ingteb__/ingteb/EventManager.lua:38>
    (...tail calls...)
    __ingteb__/core/classclass.lua:58: in function '__index'
    __ingteb__/ingteb/Selector.lua:213: in function 'GetAllItemsGui'
    __ingteb__/ingteb/Selector.lua:119: in function 'GetGuiInnerVariant'
    __ingteb__/ingteb/Selector.lua:101: in function 'GetGui'
    __ingteb__/ingteb/Selector.lua:36: in function 'Open'
    __ingteb__/ingteb/EventManager.lua:113: in function 'ToggleFloating'
    __ingteb__/ingteb/Gui.lua:39: in function 'OnGuiEvent'
    __ingteb__/ingteb/EventManager.lua:378: in function <__ingteb__/ingteb/EventManager.lua:370>
2 years ago

Please send a save file.

2 years ago

because it is producable by starting new game and open the gui,so I would rather give the mod file:
in dev hardcraft_2 1.9.7

you can toggle the startup setting to enable/disable the manual barreling,and it only crash when it is enabled.(the manual barreling is in data-final-fixes.lua)

2 years ago
(updated 2 years ago)

oh,I just created one with only barrel change,but the crash is not happened somehow :\
only when I have full mod then this crash is producable

2 years ago

Just send me a save file just before the crash.

2 years ago

I cannot reproduce. Perhaps it is because I use different versions of some mods. Could you please update all mods?
This is an excerpt of my log:

0.498 Loading mod core 0.0.0 (data.lua)
0.544 Loading mod base 1.1.64 (data.lua)
0.728 Loading mod bobinserters 1.1.5 (data.lua)
0.737 Loading mod creative-mod 1.7.2 (data.lua)
0.759 Loading mod flib 0.10.1 (data.lua)
0.768 Loading mod rocky_optima 0.0.12 (data.lua)
0.778 Loading mod hardCrafting_2 1.9.6 (data.lua)
0.810 Loading mod ingteb 0.5.6 (data.lua)
0.820 Loading mod base 1.1.64 (data-updates.lua)
0.829 Loading mod bobinserters 1.1.5 (data-updates.lua)
0.837 Loading mod rocky_optima 0.0.12 (data-updates.lua)
0.858 Loading mod hardCrafting_2 1.9.6 (data-updates.lua)
0.880 Loading mod creative-mod 1.7.2 (data-final-fixes.lua)
0.921 Loading mod rocky_optima 0.0.12 (data-final-fixes.lua)
0.930 Loading mod hardCrafting_2 1.9.6 (data-final-fixes.lua)
1.052 Checksum for core: 1720724266
1.052 Checksum of base: 2195340303
1.052 Checksum of bobinserters: 2948625692
1.052 Checksum of creative-mod: 3989919788
1.052 Checksum of flib: 2594110821
1.052 Checksum of rocky_optima: 3783348685
1.052 Checksum of hardCrafting_2: 519957961
1.052 Checksum of on_research_queue_changed: 1189972631
1.052 Checksum of ingteb: 2387390019

2 years ago

I updated the hardCrafting_2 to 1.9.7 ,you should be able to reproduce it now

2 years ago

Now I can reproduce it.

New response