Page 4 of 15

Re: [MOD 0.12.x] Autofill

Posted: Thu Sep 03, 2015 8:16 pm
by Ratzap
rk84 wrote:
Ratzap wrote:Autofill is giving me an error with 12.5. Presumably if everyone else is having similar trouble we'll get a fix soon?
What does the error message say?
I haven't played since, I just updated to 12.6 and tried again - my save loads, I put down a burner inserter and this pops up

Image

Re: [MOD 0.12.x] Autofill

Posted: Sun Sep 06, 2015 4:57 pm
by P1h3r1e3d13
Ratzap wrote:
rk84 wrote:
Ratzap wrote:Autofill is giving me an error with 12.5. Presumably if everyone else is having similar trouble we'll get a fix soon?
What does the error message say?
I haven't played since, I just updated to 12.6 and tried again - my save loads, I put down a burner inserter and this pops up

...
I'm on 1.6 and AutoFill 1.3.4 and no such error.

It is refusing to fill furnaces, though, when I have coal in inventory. I'm new to this mod, so I don't know whether that's a new bug.

Re: [MOD 0.12.x] Autofill

Posted: Sun Sep 06, 2015 9:01 pm
by rk84
Ratzap wrote:
rk84 wrote:
Ratzap wrote:Autofill is giving me an error with 12.5. Presumably if everyone else is having similar trouble we'll get a fix soon?
What does the error message say?
I haven't played since, I just updated to 12.6 and tried again - my save loads, I put down a burner inserter and this pops up
...
its possibly compatibility issue between autofill versions. Sorry.
This might help

Code: Select all

/c remote.call("af", "default")
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:
Image

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.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.

Re: [MOD 0.12.x] Autofill

Posted: Thu Oct 01, 2015 1:27 am
by irbork
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.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
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.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
It's a bug in 1.3.5.
Replace the isValidSet function in control.lua with this one:

Code: Select all

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

Re: [MOD 0.12.x] Autofill

Posted: Thu Oct 01, 2015 7:35 pm
by rk84
Thanks for report. Sorry for typo.
khozmo wrote:/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})
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.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
It's a bug in 1.3.5.
Replace the isValidSet function in control.lua with this one:

Code: Select all

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

Re: [MOD 0.12.x] Autofill boblogistics

Posted: Tue Oct 06, 2015 4:51 pm
by HeilTec
boblogistics

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
autofill_1.3.6.zip
patched for bob
(44.14 KiB) Downloaded 312 times
Partially tested - no gamebreaker.

Re: [MOD 0.12.x] Autofill

Posted: Wed Oct 07, 2015 8:25 pm
by rk84
HeilTec wrote:This mod has already been a great feature.
I would like to contribute.
Is this on github?
Actually yes... oh I havent updated it for 2 years :oops:
HeilTec wrote:Looking at the new code I now think the "glue" belongs inside the autofill mod.
In some degree I feel it should be outside, but I'm open for both.