[MOD 0.12.x] Autofill

Topics and discussion about specific mods
dixbutts
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Oct 07, 2015 10:41 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by dixbutts »

HeilTec wrote:Autofill for boblogistics, bobpower and bobwarefare.

Here is how I envision the glue placed in autofill control.lua
autofill_1.3.6.zip
Partially tested - no gamebreaker.
I'm using the TestMode mod to spawn in turrets and ammo to test this out. Anytime I try to place a turret when I have ammunition in my inventory, I receive this error:

Image

edit: seems there isn't actually a bob-gun-turret-1, had to manually delete it and it seems to work fine now.
User avatar
HeilTec
Filter Inserter
Filter Inserter
Posts: 258
Joined: Tue Jul 08, 2014 1:14 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by HeilTec »

I have been recommended to try incorporating the configuration gui of the ModuleInserter to make the autofill configurations easy.

I wish I had more lua experience, but this may be an opportunity.

Thanks to the post by dixbutts I discovered the same mistake for the locomotives - there is no "diesel-locomotive-1" - one more line to be removed.

Update:
autofillbob_1.3.7.zip
(44.89 KiB) Downloaded 369 times
Google is my friend. Searching the forum and the wiki is always a first.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

I like how item in hand is used in that gui.

I updated Github to "unreleased" 1.3.7.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Colossus
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Mon Mar 10, 2014 8:31 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by Colossus »

I've been poking around trying to get autofill to work with FARL locomotives but I don't have enough coding know-how in this area. Any chance this could get added, or at least help with what I need to change, if it's possible?
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

Colossus wrote:I've been poking around trying to get autofill to work with FARL locomotives but I don't have enough coding know-how in this area. Any chance this could get added, or at least help with what I need to change, if it's possible?
Added "farl" -locomotive. Download for 1.3.7 in first post.

I also copied HeilTec's settings for bob mods. Hopefully it will now be easier to add new settings.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Colossus
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Mon Mar 10, 2014 8:31 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by Colossus »

Thanks, works like a charm.

The new issue I've come up with is Colored trains from this mod: https://forums.factorio.com/forum/vie ... 44&t=13907

Is there any way I can add a wildcard to the locomotives so I can fill each of them when placed?
The Lone Wolfling
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Tue Oct 28, 2014 3:33 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by The Lone Wolfling »

I second the wildcard idea.

Or rather, it would be useful for the config to be a list of either entity names or prototypes, where the first matching entry on the list is used. So you can specify, for instance, "anything that inherits from ammo-turret gets <x>".

Or ideally it'd read the config for what item(s) get shift-clicked into it, and if those items are in a whitelist it'll autofill them.

Also, thanks for the updated configs!
Taoh
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jun 28, 2015 12:23 am
Contact:

Re: [MOD 0.11.x] Autofill

Post by Taoh »

goblinm wrote:
db48x wrote: The offensive power of autofill is only a problem if players choose to abuse it. My main interest is for thinking of ways to limit the imbalance to encourage Factorio devs to include some fashion of it into the main game! Cause, yeah, autofill is that core to my gameplay.
Having played some with a friend with Bob's mod, and not knowing we could update Autofill to work with the sniper/standard turret we still found it quite easy to use them offensive. e.g. have turrets on hotkey 1, and bullets on 2. to drop a series of turrets would be.

1 -> hold down left and run a small stretch -> 2 -> hold down ctrl + right click turrets and they are loaded.

So in my opinion at least this would only make this move less tedious and hardly change the balance, except being able to put less ammo in each turret as a default. That said deploy time on turrets/buildings or similar would be more of a fixer than preventing automation.
pederbonde
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Oct 17, 2015 9:38 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by pederbonde »

Did a temporary fix for 0.12.11.
Its a terrible hack but atleast it will load.
search replace for game.on_ to script.on_
replace function loadFuels with this

function loadFuels()
fuels = { all = {}, high = {} }
fuels.all[#fuels.all+1] = "coal";
fuels.high[#fuels.high+1] = "coal";
fuels.all[#fuels.all+1] = "solid-fuel";
fuels.high[#fuels.high+1] = "solid-fuel";
fuels.all[#fuels.all+1] = "liquid-fuel-canister";
fuels.high[#fuels.high+1] = "liquid-fuel-canister";
--[[ for name, item in pairs(game.item_prototypes) do
if item.fuel_value > 0 then
fuels.all[#fuels.all+1] = name
if item.fuel_value >= MINfuel_value then
fuels.high[#fuels.high+1] = name
end
end
end

local fuelHighToLow = function(a,b)
return game.item_prototypes[a].fuel_value > game.item_prototypes.fuel_value
end
table.sort(fuels.all, fuelHighToLow)
table.sort(fuels.high, fuelHighToLow)]]--
end
PiggyWhiskey
Filter Inserter
Filter Inserter
Posts: 255
Joined: Wed May 13, 2015 5:28 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by PiggyWhiskey »

pederbonde wrote:Did a temporary fix for 0.12.11.
Its a terrible hack but atleast it will load.
search replace for game.on_ to script.on_
replace function loadFuels with this

function loadFuels()
fuels = { all = {}, high = {} }
fuels.all[#fuels.all+1] = "coal";
fuels.high[#fuels.high+1] = "coal";
fuels.all[#fuels.all+1] = "solid-fuel";
fuels.high[#fuels.high+1] = "solid-fuel";
fuels.all[#fuels.all+1] = "liquid-fuel-canister";
fuels.high[#fuels.high+1] = "liquid-fuel-canister";
--[[ for name, item in pairs(game.item_prototypes) do
if item.fuel_value > 0 then
fuels.all[#fuels.all+1] = name
if item.fuel_value >= MINfuel_value then
fuels.high[#fuels.high+1] = name
end
end
end

local fuelHighToLow = function(a,b)
return game.item_prototypes[a].fuel_value > game.item_prototypes.fuel_value
end
table.sort(fuels.all, fuelHighToLow)
table.sort(fuels.high, fuelHighToLow)]]--
end


O.o I don't have that function in 1.3.7
What am I meant to be replacing?
pederbonde
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Oct 17, 2015 9:38 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by pederbonde »

sorry, was a bit quick there. i was using a older version. 1.3.4.
Didnt notice there was a new one.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by Outsider »

I have a modified version with a fix for 0.12.11 that i have been using until an official update comes around.. didn't bother bumping the version.

BTW realized this probably won't work for people using the mod for the first time, in this case you probably need to remove the initMod() function call from the on_load event.. that's at line 31 in control.lua

Edit : updated the attached file should also work for new saves now.
Attachments
autofill_1.3.7.zip
(6.88 KiB) Downloaded 298 times
Last edited by Outsider on Sat Oct 17, 2015 6:17 pm, edited 1 time in total.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
branetown
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Dec 29, 2014 4:49 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by branetown »

Maybe someone can help me figure out this error? :(

Fresh install,
Bob's mods
Autofill 1.3.7

I must be missing something.....

Edit: Removed screenshot to save page-length- thank you!
Last edited by branetown on Sat Oct 17, 2015 5:56 pm, edited 1 time in total.
The Lone Wolfling
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Tue Oct 28, 2014 3:33 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by The Lone Wolfling »

You'll get that if you attempt to use a mod designed for an older version of Factorio with the newest version.

Either downgrade Factorio or wait for the mod to update, or attempt to upgrade it yourself, or see if there is an unofficial update.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by Outsider »

branetown wrote:Maybe someone can help me figure out this error? :(

Fresh install,
Bob's mods
Autofill 1.3.7

I must be missing something.....

Edit: Removed screenshot to save page-length- thank you!
try using the modified version i just posted above.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
PiggyWhiskey
Filter Inserter
Filter Inserter
Posts: 255
Joined: Wed May 13, 2015 5:28 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by PiggyWhiskey »

Outsider wrote:
branetown wrote:Maybe someone can help me figure out this error? :(

Fresh install,
Bob's mods
Autofill 1.3.7

I must be missing something.....

Edit: Removed screenshot to save page-length- thank you!
try using the modified version i just posted above.

Tried that, with an error :/

Image
antisocialian
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Jan 20, 2015 6:54 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by antisocialian »

I'm getting a different error in the same place, loader.lua:6

Image

I get this error when loading either pre-existing saves or creating a new game. I have tested with only the Autofill mod installed and I get the same error, so I know it isn't an incompatibility with other mods.

I tried looking into it, but my lua skills are limited and I don't think I have enough coffee and doritos to stumble thru it. :)
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

Update 1.3.8 Fixed for for factorio 0.12.11

I will think the wildcard idea.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Bartimaeus
Inserter
Inserter
Posts: 42
Joined: Sun Aug 16, 2015 10:23 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by Bartimaeus »

rk84 wrote:Update 1.3.8 Fixed for for factorio 0.12.11
Initially I fixed Autofill_1.3.4 for myself. Now I tried to replace it with your 1.3.8 update and when I load one of my old saves that started with 1.3.4 I get the following error:
Unknown key:"Error while running the on_load: __autofill__/loader.lua:29: attempt to index global 'game' (a nil value)"
However, 1.3.8 works on freshly created games and their saves (those that start with 1.3.8. or old saves with no Autofill mod), but not on old saves that were saved with 1.3.4 at any point.
Do you have any idea, how to fix this?

EDIT2: managed to fix this with loading and saving the save with autofill mod switched off and then loading with the 1.3.8 version (everything works from there ;-) )

EDIT: Nevermind ... Autofill is broken by 0.12.12 anyways :D :D :D
It loads the game but when you try to place anything that would trigger the autofill mod I get this:
Error while running the event handler: __autofill__/control.lua:108: LuaGameScript doesn't contain key get_localised_item_name.
when placing furnace without any coal in my inventory

and
Error while running the event handler: __autofill__/control.lua:182: LuaGameScript doesn't contain key get_localised_item_name.
when placing furnace with some coal in my inventory.
Deathtopia
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Aug 07, 2015 10:40 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by Deathtopia »

Hey, Noticed something mentioned in the 12.12 update page about this, but I'm also having the issue with the following error since updating,
Error while running event handler: __autofill__/Control.lua:108: LuaGameScript doesn't contain key get _localised_Item_name.

Is this going to be an issue with a lot of mods as I've recently restarted a campaign and don't wish to continue without them. Thanks.

P.S. Sorry, Just noticed the edit from the above post. :P XD
Post Reply

Return to “Mods”