Item Giver Gui


A mod that adds a Gui that allows input of item names and amount to give/remove with auto complete when clicking on a suggested item

Content
6 years ago
0.14 - 0.16
167
Cheats

g Update for0.17?

5 years ago

Is there a chance that this will be updated for 0.17?

5 years ago
(updated 5 years ago)

there is no inventory-like quickbar in 0.17 anymore. so you need to modify control.lua a bit :)

remove line 87-95
script.on_event(defines.events.on_player_quickbar_inventory_changed, function(event)
local player = game.players[event.player_index]
if player.gui.center.igg_gui then
igg.update_gui(player)
end
end)

remove line 124-131
local bar = player.get_inventory(defines.inventory.player_quickbar).get_contents()
for k,v in pairs(bar) do
if main[k] then
main[k] = main[k] + v
else
main[k] = v
end
end

remove line 343
local bar = player.get_inventory(defines.inventory.player_quickbar)

modify line 344
from: if main.find_item_stack(i) or bar.find_item_stack(i) then
to: if main.find_item_stack(i) then

save the file control.lua and you are all set

i have tested it with 0.17.17 and it worked.
thanks to coltonj96 for the mod :)

5 years ago

Thanks, but it doesn't work - shift + enter does nothing...

5 years ago
(updated 5 years ago)

I followed krangpow's directions and it worked for me.

Did you update the .json to update references to .17 instead of .16? Maybe that's the glitch.

EDIT: Oh, Also, when you do the edits, make sure you start at the bottom of the list, or when you remove lines, the numbers will change. So, start with "modify line 344" then work your way up the list of edits. :)

5 years ago

does not work

5 years ago

pushing <shift> <enter> crashes the game

5 years ago
(updated 5 years ago)

@krangpow it works, noobs

    remove line 87-92!!!!!! not 95
    script.on_event(defines.events.on_player_quickbar_inventory_changed, function(event)
    local player = game.players[event.player_index]
    if player.gui.center.igg_gui then
    igg.update_gui(player)
    end
    end)

    remove line 124-131
    local bar = player.get_inventory(defines.inventory.player_quickbar).get_contents()
    for k,v in pairs(bar) do
    if main[k] then
    main[k] = main[k] + v
    else
    main[k] = v
    end
    end

    remove line 343
    local bar = player.get_inventory(defines.inventory.player_quickbar)

    modify line 344
    from: if main.find_item_stack(i) or bar.find_item_stack(i) then
    to: if main.find_item_stack(i) then

@brains_ironically
...make sure you start at the bottom of the list... !!!!! important

5 years ago

@krangpow it works, noobs

    remove line 87-92!!!!!! not 95
    script.on_event(defines.events.on_player_quickbar_inventory_changed, function(event)
    local player = game.players[event.player_index]
    if player.gui.center.igg_gui then
    igg.update_gui(player)
    end
    end)

    remove line 124-131
    local bar = player.get_inventory(defines.inventory.player_quickbar).get_contents()
    for k,v in pairs(bar) do
    if main[k] then
    main[k] = main[k] + v
    else
    main[k] = v
    end
    end

    remove line 343
    local bar = player.get_inventory(defines.inventory.player_quickbar)

    modify line 344
    from: if main.find_item_stack(i) or bar.find_item_stack(i) then
    to: if main.find_item_stack(i) then

@brains_ironically
...make sure you start at the bottom of the list... !!!!! important

@mountain5

This works for me on .17.50

[Make sure to change the json.info file to ".17" in two places.]

5 years ago

pls update

5 years ago

Adding Items seems to be okay with the edits mentioned above, but removing Items crashes the Game for me.

4 years ago
  • Open control.lua with an editor
  • Go to Line 331 (in the "take" function)
  • replace this line

local main = player.get_inventory(defines.inventory.player_main)

with this

local main = player.get_main_inventory()


save the file again. and you are all set :)

that worked for me. factorio 0.17.79

4 years ago

krangpow can you upload zip on google drive or somewhere ?

4 years ago
(updated 4 years ago)

I have uploaded an updated version of the mod.
https://mods.factorio.com/mod/ItemGiverGuiFix

All credits go to coltonj96. Thanks for this awesome mod :)

4 years ago

great krangpow , you are the best :)

and thank for coltonj96 for making this mod

4 years ago

No problem!
;)

New response