Page 3 of 3

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Mon Mar 21, 2016 9:24 am
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...

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 1:46 am
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!

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 9:45 am
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

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 10:43 pm
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.

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 10:50 pm
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 136 times

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 11:07 pm
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.

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 11:37 pm
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.

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Fri Mar 25, 2016 11:44 pm
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.

Re: [MOD 0.12.5+] Robotic Combinators

Posted: Sat Mar 26, 2016 2:21 am
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.

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Wed Apr 06, 2016 6:49 am
by DaCyclops
Version 0.3.6 has been released, because I noticed an issue with starting new games...

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Thu Apr 21, 2016 10:33 pm
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?

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Sun Apr 24, 2016 12:07 pm
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.

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Sat Jul 16, 2016 6:03 am
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.

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Sat Jul 16, 2016 10:13 am
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...

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Sat Jul 16, 2016 10:53 am
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...

Re: [MOD 0.12.11+] Robotic Combinators

Posted: Sun Jul 17, 2016 4:14 am
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.