or you could try load&save your game without autofill and then load the game with autofill active again.
Re: [MOD 0.12.x] Autofill
Posted: Tue Sep 08, 2015 9:23 pm
by Ratzap
rk84 wrote:
or you could try load&save your game without autofill and then load the game with autofill active again.
That worked thanks. I disabled autofill, loaded the save, saved it to a fresh file, quit game, restart, enable autofill and on loading the new files it's working.
Re: [MOD 0.12.x] Autofill
Posted: Sun Sep 13, 2015 1:47 am
by Kane
Fresh time install. When I'm inside a tank and place a turret down I get the following error:
Re: [MOD 0.12.x] Autofill
Posted: Tue Sep 22, 2015 5:16 pm
by Tritano
Doing a quick grep in the lua code of factorio says that there is no function getlocalisedentityname but one that is named get_localised_entity_name. It's probably a leftover code part from factorio 0.11
How to fix
Open the zip of autofill, edit control.lua, change the word getlocalisedentityname in line 173 to getlocalised_entity_name
Re: [MOD 0.12.x] Autofill
Posted: Fri Sep 25, 2015 3:43 pm
by rk84
Sorry for wait the "getlocalised_entity_name" is fixed and new release is in first post.
I also changed code and interface a bit. There is now one table holding settings, but players can still have personal settings in separated table.
Re: [MOD 0.12.x] Autofill
Posted: Sun Sep 27, 2015 2:09 am
by Kane
Thanks mate.
Re: [MOD 0.12.x] Autofill
Posted: Wed Sep 30, 2015 11:39 pm
by khozmo
I am having no luck getting autofill to fill bobs turrets and gun turrets.
This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.
khozmo wrote:I am having no luck getting autofill to fill bobs turrets and gun turrets.
This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.
You should try to put your user name from settings in the "". And if it won't help run reset af command and then try to run custom insert commands.
Re: [MOD 0.12.x] Autofill
Posted: Thu Oct 01, 2015 9:04 am
by MalwareByDesign
khozmo wrote:I am having no luck getting autofill to fill bobs turrets and gun turrets.
This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.
function isValidSet(set)
if (set == nil) or (set == 0) then
globalPrint("autofill.isValidSet: set is nil or 0 (success)")
return true -- supported for clearing sets
elseif type(set) == "table" then
globalPrint("autofill.isValidSet: set is a table")
for i = 1, #set do
if set[i] == "fuels-all" then
set[i] = global.fuels.all
globalPrint("autofill.isValidSet: accepted preset: fuels-all")
elseif set[i] == "fuels-high" then
set[i] = global.fuels.high
globalPrint("autofill.isValidSet: accepted preset: fuels-high")
elseif set[i] == "ammo-bullets" then
set[i] = global.ammo.bullets
globalPrint("autofill.isValidSet: accepted preset: ammo-bullets")
elseif set[i] == "ammo-shells" then
set[i] = global.ammo.shells
globalPrint("autofill.isValidSet: accepted preset: ammo-shells")
elseif type(set[i]) == "table" then
globalPrint("autofill.isValidSet: no preset used, checking item prototypes (might still cause errors)")
for j = 1, #set[i] do
if game.item_prototypes[set[i][j]] == nil then
globalPrint( {"autofill.isValidSet: invalid item: ", tostring(set[i][j])} )
return false
end
end
end
end
return true -- table handled
end
globalPrint("autofill.isValidSet: unknown set format")
return false
end
Seems its missing item array, but I will make it handel single items in next release.
Edit:sorry I missread that command.
Re: [MOD 0.12.x] Autofill
Posted: Thu Oct 01, 2015 11:28 pm
by khozmo
MalwareByDesign wrote:
khozmo wrote:I am having no luck getting autofill to fill bobs turrets and gun turrets.
This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.
function isValidSet(set)
if (set == nil) or (set == 0) then
globalPrint("autofill.isValidSet: set is nil or 0 (success)")
return true -- supported for clearing sets
elseif type(set) == "table" then
globalPrint("autofill.isValidSet: set is a table")
for i = 1, #set do
if set[i] == "fuels-all" then
set[i] = global.fuels.all
globalPrint("autofill.isValidSet: accepted preset: fuels-all")
elseif set[i] == "fuels-high" then
set[i] = global.fuels.high
globalPrint("autofill.isValidSet: accepted preset: fuels-high")
elseif set[i] == "ammo-bullets" then
set[i] = global.ammo.bullets
globalPrint("autofill.isValidSet: accepted preset: ammo-bullets")
elseif set[i] == "ammo-shells" then
set[i] = global.ammo.shells
globalPrint("autofill.isValidSet: accepted preset: ammo-shells")
elseif type(set[i]) == "table" then
globalPrint("autofill.isValidSet: no preset used, checking item prototypes (might still cause errors)")
for j = 1, #set[i] do
if game.item_prototypes[set[i][j]] == nil then
globalPrint( {"autofill.isValidSet: invalid item: ", tostring(set[i][j])} )
return false
end
end
end
end
return true -- table handled
end
globalPrint("autofill.isValidSet: unknown set format")
return false
end
I can finally stop sitting in the corner rocking back and forth muttering! Thanks for this fix. I see that RK has already posted as well!
Re: [MOD 0.12.x] Autofill
Posted: Sun Oct 04, 2015 11:42 am
by The Lone Wolfling
Useful mod. Does anyone have a complete config set for Bob's mods, by any chance?
(Also: I would appreciate it if autofill read from a config file for default settings when starting a new world. As-is, you have to add per-world or edit the source, which gets old quickly.)
Also, personally, the default limit of 10 for gun turrets is too low.
Re: [MOD 0.12.x] Autofill
Posted: Sun Oct 04, 2015 9:32 pm
by rk84
The Lone Wolfling wrote:Useful mod. Does anyone have a complete config set for Bob's mods, by any chance?
Thanks. I'm hoping to improve the interface for modders, so they can edit the default settings. Current version has get&set -method for the table at least.
The Lone Wolfling wrote:(Also: I would appreciate it if autofill read from a config file for default settings when starting a new world. As-is, you have to add per-world or edit the source, which gets old quickly.)
Seems like good idea. I have to think if there is any desync pitfalls. Another way could be custom scenarior script that edits settings on init.
Re: [MOD 0.12.x] Autofill bobwarfare
Posted: Tue Oct 06, 2015 2:37 pm
by HeilTec
The Lone Wolfling wrote:Useful mod. Does anyone have a complete config set for Bob's mods, by any chance?(...)
I have played a bit with bobs and autofill.
I am unsure where the glue between the mods should be placed.
As an intermediate solution I placed a config.lua in the bobswarfare mod for the autofill of turrets.
-- control.lua for Bob's Warfare to enable Autofill for bullet turrets
require "defines"
game.on_init(function()
for index,player in ipairs(game.players) do
initAutofill(player.name)
end
end
)
game.on_event(defines.events.on_player_created, function(event)
local player = game.get_player(event.player_index)
initAutofill(player.name)
end)
function initAutofill(username)
if remote.interfaces.af then
local turretFillset = {priority=1, group="turrets", limits= {10}, "ammo-bullets"}
remote.call("af","insertset",username,"bob-gun-turret-2",turretFillset)
remote.call("af","insertset",username,"bob-gun-turret-3",turretFillset)
remote.call("af","insertset",username,"bob-gun-turret-4",turretFillset)
remote.call("af","insertset",username,"bob-gun-turret-5",turretFillset)
remote.call("af","insertset",username,"bob-sniper-turret-1",turretFillset)
remote.call("af","insertset",username,"bob-sniper-turret-2",turretFillset)
remote.call("af","insertset",username,"bob-sniper-turret-3",turretFillset)
end
end
Like looking code is needed for every other mod that introduced any entity to be filled.
-- control.lua for Bob's Logistics to enable Autofill for locomotives
require "defines"
game.on_init(function()
for index,player in ipairs(game.players) do
initAutofill(player.name)
end
end
)
game.on_event(defines.events.on_player_created, function(event)
local player = game.get_player(event.player_index)
initAutofill(player.name)
end)
function initAutofill(username)
if remote.interfaces.af then
local locomotiveFillset = {priority=1, group="locomotives", slots={1}, {"solid-fuel", "coal", "raw-wood"}}
remote.call("af","insertset",username,"diesel-locomotive",locomotiveFillset)
remote.call("af","insertset",username,"diesel-locomotive-2",locomotiveFillset)
remote.call("af","insertset",username,"diesel-locomotive-3",locomotiveFillset)
remote.call("af","insertset",username,"armoured-diesel-locomotive",locomotiveFillset)
end
end
Re: [MOD 0.12.x] Autofill
Posted: Wed Oct 07, 2015 4:00 pm
by HeilTec
This mod has already been a great feature.
I would like to contribute.
Is this on github?
Looking at the new code I now think the "glue" belongs inside the autofill mod.
Re: [MOD 0.12.x] Autofill
Posted: Wed Oct 07, 2015 7:49 pm
by HeilTec
Autofill for boblogistics, bobpower and bobwarfare.
Here is how I envision the glue placed in autofill control.lua