Page 5 of 7

Re: [MOD 0.13.X] EfficienSee : optimise your factory !

Posted: Sat Jul 30, 2016 4:17 pm
by Qon

Code: Select all

Error while running the event handler: __EfficienSee__/control.lua:124: attempt to index field 'selected_machine' (a nil value)
Happened when I placed down a chem plant.

ES 1.0.40
Factorio 0.13.12

Edit:
I used shift/ghost place to put it down, and I have instant blueprint mod. Might be related.

Re: [MOD 0.13.X] EfficienSee : optimise your factory !

Posted: Sat Jul 30, 2016 7:08 pm
by binbinhfr
Qon wrote:Edit:
I used shift/ghost place to put it down, and I have instant blueprint mod. Might be related.
Yes it's related, because classic blueprinting works fine.
I reproduced the bug with instant blue print AND cheat_mode on. Not a classic setup I guess, thats' why nobody claimed before ;-)

I 'm hunting for the problem, but I have no clue for the moment.

For the moment, you can softly disable the mod, using the upper left icon in the ES window.

Re: [MOD 0.13.X] EfficienSee : optimise your factory !

Posted: Sat Jul 30, 2016 7:39 pm
by binbinhfr
I found it ! Not an easy one...
And I do not consider it as a bug of ES. ;-)

explanation :
It's not the cheat mode itself.
But the way "instant blueprint" works when creating an object :
it uses

Code: Select all

ev.created_entity.revive()
i.e. it revives the ghost of an object that was never created before.
And apparently, it does not trigger the "on-creation" event again, that I use to follow all entities creation.

So this mod is not good : most mods (like mine) are waiting for classical behaviour, not cheated turnarounds...

Anyway, I added a little test to avoid the error (please update on portal), but beware that any object created this way cannot be detected by any mod.

And now Qon, please, be serious, STOP CHEATING !!! It is giving me heart-attacks finding those impossible bugs... :lol:

PS : have a look at my new mod, very useful for mega factories : viewtopic.php?f=92&t=30163

Re: [MOD 0.13.X] EfficienSee : optimise your factory !

Posted: Sat Jul 30, 2016 11:48 pm
by binbinhfr
Well, after some report to the dev, it seems that this behaviour is normal :
revive does not trigger the on_built event.
It should be the mod Instant Blueprint that should do it. But it is obvioulsy a very simple mod...
So this mod is only for cheat, you cannot use it for normal gameplay.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Thu Aug 18, 2016 7:05 pm
by Camalie
I just got this:

Image

Using EfficienSee 1.0.42, Factorio 0.13.17 w/ Bob's mods, Factorissimo, [+ convenience mods like YARM, RSO, EvoGUI, KBlueprints, ...]

Edit: It happened as soon as I pressed the ES button.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Thu Aug 18, 2016 7:57 pm
by binbinhfr
It's normal. Please update Efficiensee mod, because there is a mandatory update for factorio 0.13.17 concerning recipe products

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Tue Aug 30, 2016 1:00 am
by Tlmitf
I dont know if I missed this, so Ill ask.

Are you able to put a button into the GUI that shows you your most critical bottleneck? IE the one thing that you are the furthest behind in producing?

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Tue Aug 30, 2016 7:07 am
by binbinhfr
Tlmitf wrote:I dont know if I missed this, so Ill ask.

Are you able to put a button into the GUI that shows you your most critical bottleneck? IE the one thing that you are the furthest behind in producing?
Hi, I tought about that in the past, but I did not find a solution. Because it is not easy to determinate which recipes are really part of the "useful" production and which are not.
Some production are stopped but it's intentional.
But if you press the 'b' button that shows you every machine status, while zooming out wide (using my Zoom mod for that), you can see which part of the factory are blocked
and decide (after a "human" analysis) if it's part of the useful process or not.

If you have a precise idea on how to determine where is the main bottleneck, I'm listening to your proposition, but I am afraid that such an "intelligent" process will be complex to
program and very CPU consuming.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Tue Aug 30, 2016 1:47 pm
by Tlmitf
The only thing that springs to mind is to simply pull the data for the most under utilised process and use that.
If people what that function to operate correctly (enough) then they will have to turn stuff off when the... ohh, fluids... Nope, ignore me.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Wed Nov 09, 2016 4:46 am
by brehmluke
As soon as I click the Efficiensee icon I get the following error:
Error while running event on_gui_click (ID 1)
__EfficienSee__/control.lua:1422: attempt to concatenate field 'amount' (a nil value)

I am running the most recent stable build of Factorio, I believe its 14.18
I'm using DyTech and some other mods that don't add new items.
Very small factory, just starting out.
If anymore information will help let me know!
Thanks very much

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Wed Nov 09, 2016 8:01 am
by binbinhfr
Hi brehmluke,

I tested Efficiensee and cannot trigger the problem you have, or imagine why it happens in the code.
It must come from one of your mods.
If you want, please try without any mods, and add them progressively to see which one is the culprit... If you find it, tell me, so that I can reproduce the problem on my side and correct it.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Sun Dec 04, 2016 4:09 am
by OvermindDL1
Bug report, no other mods, just EfficienSee (though it was on a custom map):

Code: Select all

__EfficienSee__/control.lua:2138: attempt to index field 'recipes_stat' (a nil value)
The line and surrounding lines for context from __EfficienSee__/control.lua is:

Code: Select all

	for _, effect in pairs(research.effects) do
		if effect.type == "unlock-recipe" then
			recipe_stat = force_mem.recipes_stat[effect.recipe]
			recipe_stat.enabled = true
			recipe_new = true
		end
	end
Which resides in the function

Code: Select all

on_research_finished
where line 2138 is the

Code: Select all

recipe_stat = force_mem.recipes_stat[effect.recipe]
line. It appears if a custom mission has pre-researched researches then this mod breaks due to receiving the research callbacks before its on_init is processed. Probably just need a check to see if it has been init'd yet and if not then just return in addition to adding a check on_init to if its custom research is researched then perform the unlock. That is precisely what I did to fix my local copy, specifically I changed the

Code: Select all

on_research_finished
function to be this instead:

Code: Select all

local function on_research_finished(event)
	local research = event.research
	local force = research.force
	local force_mem = global.force_mem[force.name]
	if force_mem then return end
	-- debug_print( "on_research_finished ", research.name, " force ", force.name )
	
	-- close_guis()
	
	local recipe_new = false
	local recipe_stat
	
	for _, effect in pairs(research.effects) do
		if effect.type == "unlock-recipe" then
			recipe_stat = force_mem.recipes_stat[effect.recipe]
			recipe_stat.enabled = true
			recipe_new = true
		end
	end
	
	if recipe_new then
		for _, player in pairs(game.players) do
			if player.connected and player.force == force then
				update_gui(player,true,true)
			end
		end
	end
end
Where it has the line of this added near the top:

Code: Select all

if force_mem then return end
And I'd not changed anything else (yet) to handle the checking of existing researches when "init_force" is called but it should be done somewhere in its callstack from the looks of it.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Sun Dec 04, 2016 9:14 am
by binbinhfr
Hi, thx for the report.

your "if force_mem then return end" statement is working, but not for teh good reason : it avoids any call to the rest of the function, so of course there is no more bug ;-)

probably you meant to write :

Code: Select all

if force_mem == nil then return end
force_mem is normally always initialized when calling this funtion. So the problem is not coming from here.

infact , you'd better try :

Code: Select all

if force_mem == nil or force_mem.recipes_stat == nil then return end
because for some forces (ennemy and neutral) "force_mem.recipes_stat" is not initialized.
Is it possible that you tried to make research on the ennemy or the neutral forces ?

I updated the mod to v1.0.49

bug and bugfix suggestion

Posted: Tue Dec 06, 2016 11:24 am
by DarkShadowsX5
i have updated official factorio (not experimental) and updated mod (1.0.49)
but when i clicked on the icon it said bla blaa bla line 1422: error accessing "amount" is null (or something like that)

i changed line 1422 to add a null check. before attempting to add another gui element

Code: Select all

if uplist_link.amount ~= null then
    gui.add({type = "label", caption = uplist_link.amount .. "x", style = "label_effic_style"})
end
and it works perfectly now. just add that test it and update. yw (*^ω^)
its probably something to do with one of my other mods and causing the issue. this just makes sure the value "amount" isn't null before adding the gui element. but you can probably guess that. lol :D

Re: bug and bugfix suggestion

Posted: Wed Dec 07, 2016 10:48 am
by binbinhfr
thx for the report, even if I do not understand why you have an error.

anyway, the right check should be :

Code: Select all

	if uplist_link.amount == nil then
		gui.add({type = "label", caption = "0x", style = "label_effic_style"})
	else
		gui.add({type = "label", caption = uplist_link.amount .. "x", style = "label_effic_style"})
	end

Crash from certain recipe

Posted: Sat Feb 18, 2017 2:10 am
by riun355
I'm using a pretty heavily modded save, mostly with bob's and angel's mods. I'm getting a consistent crash when I try to view the production statistics for any of the "chunk" recipes in Angel's Refining.
The error code I'm getting is:

Code: Select all

__EfficienSee__/control.lua:1352: attempt to compare number with nil
The only cause I can think of for the error is that the chunk recipes all output 0.5 of an item, which is pretty unusual behavior that the mod might not be set up to handle.

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Tue Mar 28, 2017 10:27 am
by Eugenii10
Hello! First of all, Thanks for a great mod !
I have the same error as
riun355 wrote:The error code I'm getting is:
__EfficienSee__/control.lua:1352: attempt to compare number with nil
It is produced by opening EfficienSee screen ('N' hotkey) on the Angel's Refining building.
Here is screenshot
Screenshot
Thanks for a work in advance!

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Fri Apr 28, 2017 1:02 am
by dispensershell
Are there plans for this to be upgraded for 0.15?

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Fri Apr 28, 2017 1:16 am
by sparr
It would help if you tell the developer what doesn't work in 0.15

Re: [MOD 0.13] EfficienSee : optimise your factory !

Posted: Fri Apr 28, 2017 7:53 am
by binbinhfr
i will look at it, be patient