Page 5 of 15
Re: [MOD 0.12.x] Autofill
Posted: Wed Oct 07, 2015 10:52 pm
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:
edit: seems there isn't actually a bob-gun-turret-1, had to manually delete it and it seems to work fine now.
Re: [MOD 0.12.x] Autofill
Posted: Thu Oct 08, 2015 11:53 am
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:
Re: [MOD 0.12.x] Autofill
Posted: Thu Oct 08, 2015 10:15 pm
by rk84
I like how item in hand is used in that gui.
I updated
Github to "unreleased" 1.3.7.
Re: [MOD 0.12.x] Autofill
Posted: Fri Oct 09, 2015 3:52 pm
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?
Re: [MOD 0.12.x] Autofill
Posted: Fri Oct 09, 2015 10:08 pm
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.
Re: [MOD 0.12.x] Autofill
Posted: Mon Oct 12, 2015 5:56 pm
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?
Re: [MOD 0.12.x] Autofill
Posted: Tue Oct 13, 2015 3:39 pm
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!
Re: [MOD 0.11.x] Autofill
Posted: Thu Oct 15, 2015 1:34 pm
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.
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 9:46 am
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
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 10:01 am
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?
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 10:09 am
by pederbonde
sorry, was a bit quick there. i was using a older version. 1.3.4.
Didnt notice there was a new one.
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 4:47 pm
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.
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 4:52 pm
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!
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 5:34 pm
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.
Re: [MOD 0.12.x] Autofill
Posted: Sat Oct 17, 2015 6:19 pm
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.
Re: [MOD 0.12.x] Autofill
Posted: Sun Oct 18, 2015 2:12 am
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 :/
Re: [MOD 0.12.x] Autofill
Posted: Sun Oct 18, 2015 2:55 pm
by antisocialian
I'm getting a different error in the same place, loader.lua:6
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.
Re: [MOD 0.12.x] Autofill
Posted: Sun Oct 18, 2015 11:52 pm
by rk84
Update 1.3.8 Fixed for for factorio 0.12.11
I will think the wildcard idea.
Re: [MOD 0.12.x] Autofill
Posted: Tue Oct 20, 2015 1:16 pm
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
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.
Re: [MOD 0.12.x] Autofill
Posted: Wed Oct 21, 2015 9:13 am
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.
XD