[MOD 0.12.11+] Robotic Combinators

Topics and discussion about specific mods
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by binbinhfr »

ssilk wrote:As far as I understand this, there is missing an script.on_load()-routine for reinitialization after load.

... btw: Same problem as with the logistic combinator mod.
In my case, it is not only at the loading of the map, but afterwards : the combinator's numbers does not update correctly, or only once in a while (but I did not understand when...).
Numbers of robots on the roboport dialog changes but no the combinator numbers...
My mods on the Factorio Mod Portal :geek:
WaylandSmith
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Mar 24, 2016 11:53 pm
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by WaylandSmith »

binbinhfr wrote:
ssilk wrote:As far as I understand this, there is missing an script.on_load()-routine for reinitialization after load.

... btw: Same problem as with the logistic combinator mod.
In my case, it is not only at the loading of the map, but afterwards : the combinator's numbers does not update correctly, or only once in a while (but I did not understand when...).
Numbers of robots on the roboport dialog changes but no the combinator numbers...
I'm seeing exactly the same problem. The combinator outputs the correct numbers when it is first placed, but does not seem to ever update.

I've been poking around in the code for about an hour (I'm a progressional software developer but have never looked at Factorio before) and from what I can see,

Code: Select all

global.robotic_combinators
and its contents are always turning up empty when the map's loaded! My impression from the documentation is that everything inside global should be automatically persisted. I have no idea what's going on here!
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by orzelek »

It looks like some issue with references of locals to global.
There is a set of local variables that are placed in global and modified after that.

If you are seeing tha t they are not saved you could try to change all references to name like this:

Code: Select all

global.robotic_combinators.rcs_network
It might help but I'm wild guessing here :D
WaylandSmith
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Mar 24, 2016 11:53 pm
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by WaylandSmith »

I figured it out, sorta. It appears that there's something weird about accessing the globals table from outside of an event handler, i.e. in the main body of the control.lua file. The global table EXISTS in this state, but always appears to be empty. Looking in data.dat of a save game shows that the contents of the globals table is being saved, it's not being read correctly in the particular manner that the mod is doing it right now, at least not with the very latest release version of Factorio.

The solution seems to be to make an init() function that's called from both the on_init and on_load events that creates the globals if they don't exist and then loads them into the locals.

I've made a fork of the current version of the mod that you can try out: https://github.com/cherrydev/robotic-combinators

I'll make a pull request and see if the author wants to use it to make a new official release.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by binbinhfr »

yes, there was a mess with the globals. I also did a correction, and also simplify unused code (rc_local, rc_perso) and now it works fine. Let's see if the author accept your new version.

Mine is here :
robotic-combinators_0.3.5.zip
(37.75 KiB) Downloaded 134 times
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 14355
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by Rseding91 »

binbinhfr wrote:yes, there was a mess with the globals. I also did a correction, and also simplify unused code (rc_local, rc_perso) and now it works fine. Let's see if the author accept your new version.

Mine is here :
robotic-combinators_0.3.5.zip
If the data's not stored in the global table it won't persist between saves and won't work at all in multiplayer.
If you want to get ahold of me I'm almost always on Discord.
WaylandSmith
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Mar 24, 2016 11:53 pm
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by WaylandSmith »

Rseding91 wrote:
binbinhfr wrote:yes, there was a mess with the globals. I also did a correction, and also simplify unused code (rc_local, rc_perso) and now it works fine. Let's see if the author accept your new version.

Mine is here :
robotic-combinators_0.3.5.zip
If the data's not stored in the global table it won't persist between saves and won't work at all in multiplayer.
I'm pretty sure that everyone in the discussion right now knows this. This problem is that the mod was attempting to make a reference from tables stored in global to local variables from within the bare body of the control.lua script. It appears that in the past this would work, but some recent change to the game engine made it so that when the bare body of the script is executed (before the main event loop starts) the global table will exist, but always be empty. I suspect that this change will subtly break a lot of scripts.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by binbinhfr »

Rseding91 wrote:
binbinhfr wrote:yes, there was a mess with the globals. I also did a correction, and also simplify unused code (rc_local, rc_perso) and now it works fine. Let's see if the author accept your new version.

Mine is here :
robotic-combinators_0.3.5.zip
If the data's not stored in the global table it won't persist between saves and won't work at all in multiplayer.
oh yes, I suppress the global-to-locals exchanges and kept everything into global, so that it is correctly saved and reload. I tested it today and it seems to work on my game. But maybe my changes won't work with already existing objets from the previous version. But it works if you make fresh objects.

But maybe WaylandSmith's version is better, because closer to the original and more compatible with previous versions.
My mods on the Factorio Mod Portal :geek:
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [MOD 0.12.5+] Robotic Combinators

Post by DaCyclops »

You know what's really fun? when phpBB decides you don't need to be notified about new updates on threads.....

Okay, Ive caught up with the thread, and agree that Wayland/cherrydev's update should be merged, as it makes sense. Wasn't aware of that slight change.

Version 0.3.5 has been offically released.
EDIT: And I forgot to update info.JSON. fixed download links, should work now.
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by DaCyclops »

Version 0.3.6 has been released, because I noticed an issue with starting new games...
ribsngibs
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Mar 28, 2016 5:42 am
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by ribsngibs »

Hi, I just downloaded the latest ver (0.3.6) yesterday and tried playing with it. I am still seeing the bug that others were reporting... I think. The combinator reports the correct values and continues updating them correctly. However, at some point they freeze and stop working (it may have been on game load - I can try to reproduce tonight). Replacing the combinator (used a blueprint with entire circuit to preserve wiring, just blueprinted the thing, deconstructed, re-placed with blueprint) fixed it.

Anybody else seeing that?
User avatar
Sauerkraut
Inserter
Inserter
Posts: 42
Joined: Fri Jul 17, 2015 3:37 pm
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by Sauerkraut »

ribsngibs wrote:Hi, I just downloaded the latest ver (0.3.6) yesterday and tried playing with it. I am still seeing the bug that others were reporting... I think. The combinator reports the correct values and continues updating them correctly. However, at some point they freeze and stop working (it may have been on game load - I can try to reproduce tonight). Replacing the combinator (used a blueprint with entire circuit to preserve wiring, just blueprinted the thing, deconstructed, re-placed with blueprint) fixed it.

Anybody else seeing that?
I'm having similar issues, however, i also run a lot of other mods that add/change robots, so maybe one of them causes this.
User avatar
MtnDew
Burner Inserter
Burner Inserter
Posts: 18
Joined: Sun Aug 02, 2015 3:29 am
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by MtnDew »

Any chance this will get an update to 0.13? The logistics built into 0.13 for robots just tends to be total active but what I want is to read active construction and logistic seperately.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14355
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by Rseding91 »

MtnDew wrote:Any chance this will get an update to 0.13? The logistics built into 0.13 for robots just tends to be total active but what I want is to read active construction and logistic seperately.
Have you actually looked at what roboports in 0.13 output signal wise? Because they do exactly what you're asking for already...
If you want to get ahold of me I'm almost always on Discord.
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by DaCyclops »

Im not really planning on updating this exact mod to 0.13 because ( as Rseding said) the Roboports can now be connected to the network directly. Though I have considered a spinoff that adds my fancy icons back in :P , and maybe create the "Personal Robotics Combinator" for tracking player's roboports...
User avatar
MtnDew
Burner Inserter
Burner Inserter
Posts: 18
Joined: Sun Aug 02, 2015 3:29 am
Contact:

Re: [MOD 0.12.11+] Robotic Combinators

Post by MtnDew »

I will have another look at it. I thought it just had active robots but not seperately. Time for a closer look. Thank You.
Post Reply

Return to “Mods”