[MOD 0.13] EfficienSee : optimise your factory !

Topics and discussion about specific mods
Post Reply
Qon
Smart Inserter
Smart Inserter
Posts: 1240
Joined: Thu Mar 17, 2016 6:27 am
Contact:

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

Post by Qon » Sat Jul 30, 2016 4:17 pm

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.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Sat Jul 30, 2016 7:08 pm

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.
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Sat Jul 30, 2016 7:39 pm

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
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Sat Jul 30, 2016 11:48 pm

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.
My mods on the Factorio Mod Portal :geek:

Camalie
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Apr 28, 2016 1:00 pm
Contact:

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

Post by Camalie » Thu Aug 18, 2016 7:05 pm

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.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Thu Aug 18, 2016 7:57 pm

It's normal. Please update Efficiensee mod, because there is a mandatory update for factorio 0.13.17 concerning recipe products
My mods on the Factorio Mod Portal :geek:

Tlmitf
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 18, 2016 7:54 am
Contact:

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

Post by Tlmitf » Tue Aug 30, 2016 1:00 am

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?

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Tue Aug 30, 2016 7:07 am

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.
My mods on the Factorio Mod Portal :geek:

Tlmitf
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 18, 2016 7:54 am
Contact:

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

Post by Tlmitf » Tue Aug 30, 2016 1:47 pm

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.

brehmluke
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Nov 09, 2016 4:42 am
Contact:

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

Post by brehmluke » Wed Nov 09, 2016 4:46 am

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

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Wed Nov 09, 2016 8:01 am

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.
My mods on the Factorio Mod Portal :geek:

OvermindDL1
Fast Inserter
Fast Inserter
Posts: 164
Joined: Sun Oct 05, 2014 6:12 am
Contact:

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

Post by OvermindDL1 » Sun Dec 04, 2016 4:09 am

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.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Sun Dec 04, 2016 9:14 am

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
My mods on the Factorio Mod Portal :geek:

DarkShadowsX5
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Dec 06, 2016 11:10 am
Contact:

bug and bugfix suggestion

Post by DarkShadowsX5 » Tue Dec 06, 2016 11:24 am

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

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: bug and bugfix suggestion

Post by binbinhfr » Wed Dec 07, 2016 10:48 am

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
My mods on the Factorio Mod Portal :geek:

riun355
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jul 01, 2016 12:01 am
Contact:

Crash from certain recipe

Post by riun355 » Sat Feb 18, 2017 2:10 am

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.

Eugenii10
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Mar 07, 2017 1:30 pm
Contact:

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

Post by Eugenii10 » Tue Mar 28, 2017 10:27 am

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!

dispensershell
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Apr 20, 2016 12:55 pm
Contact:

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

Post by dispensershell » Fri Apr 28, 2017 1:02 am

Are there plans for this to be upgraded for 0.15?

sparr
Smart Inserter
Smart Inserter
Posts: 1095
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

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

Post by sparr » Fri Apr 28, 2017 1:16 am

It would help if you tell the developer what doesn't work in 0.15

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1523
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

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

Post by binbinhfr » Fri Apr 28, 2017 7:53 am

i will look at it, be patient
My mods on the Factorio Mod Portal :geek:

Post Reply

Return to “Mods”

Who is online

Users browsing this forum: Google [Bot]