[MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Topics and discussion about specific mods
Cyres
Inserter
Inserter
Posts: 24
Joined: Fri Mar 11, 2016 12:29 am
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by Cyres »

Did you changed them in the named file? (gui_helpers.lua)
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by bNarFProfCrazy »

The download on reddit is down. Can someone reupload it here?

Maybe with the latest patches for 0.12.20+ (if there are any necessary)
djoslin
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu May 05, 2016 2:52 am
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by djoslin »

This mod was exactly what I was looking for, but I could not find a working mirror.
I learned a bit about Lua and Factorio modding and ported it to the current version, it seems to work but I can not provide any guarantees.
Tested on version: 0.12.33
Link to new unofficial patch
mirror

Edit: see newer version below
Last edited by djoslin on Thu May 05, 2016 10:22 pm, edited 2 times in total.
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by bNarFProfCrazy »

@djoslin: Thanks for this update. :D :D :D
I can confirm that the mod works. (I haven't found any issues yet).


Could you please add support for a horizontal rail? (Maybe x%2 == y%2 => horizontal; else vertical)
(Don't forget to update the version number.)


I also created a German (de) translation:
Please embed it in your unofficial update, so everyone can use it.

Just ping/pm me if you need translation updates or new ones.
Attachments
de.cfg
German (de) translation
(1.62 KiB) Downloaded 146 times
djoslin
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu May 05, 2016 2:52 am
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by djoslin »

bNarFProfCrazy wrote:@djoslin: Thanks for this update. :D :D :D
I can confirm that the mod works. (I haven't found any issues yet).


Could you please add support for a horizontal rail? (Maybe x%2 == y%2 => horizontal; else vertical)
(Don't forget to update the version number.)


I also created a German (de) translation:
Please embed it in your unofficial update, so everyone can use it.

Just ping/pm me if you need translation updates or new ones.
Thanks for providing a German translation, I've added it to the unofficial update.
The rail switch lamp only worked vertically previously, which was quite frustrating for me as well. After trying a few ideas that didn't work out, I've discovered how to fix it.
In this new unofficial 0.0.9 release, place down the vertical or horizontal rails before placing the rail switch lamp. (It should toggle properly after that)

Tested on version: 0.12.33
Link to unofficial 0.0.9 patch
Mirror
Attachments
RailLogicSystem_0.0.9.zip
(1.01 MiB) Downloaded 152 times
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by bNarFProfCrazy »

Nice update. Works like a charm.

Although I have to cheat a little bit to avoid "No Path messages", but that is not an issue of your update, but the way this mod is/has to be designed.
Rail path issue bypass cheat
Rail path issue bypass cheat
RailPathCheat.png (222.52 KiB) Viewed 7469 times
Has anybody a better idea?


PS: Are they going to add something like "smart signals" in 0.13?
craftoBot
Inserter
Inserter
Posts: 37
Joined: Sun Dec 28, 2014 7:39 pm
Contact:

Re: [MOD 0.12.X][0.0.8] Rail logic system

Post by craftoBot »

Mod updated for 0.13!

Some features removed because reading and setting rail signals add intro base game, but train cargo reader and station goto controller remains and updated.
Igie
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Aug 03, 2016 9:36 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Igie »

A feature to dynamically set Station name based on the signal would be great. Overall a really nice mod.
gixbit
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Jul 27, 2015 11:52 am
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by gixbit »

Your most recent version just drops the on_save event as i'm assuming that the api has been changed and dropped this event. Either way, I'm not familiar with factorio API whatsoever, but, I do know some lua basics. On the mods.factorio site, i posted a bug discussion, and the appropriate fix. Or the general things that need to be done to fix this. And tested it, and it seems to work. The former problem was when saving and leaving the game, the global.railLogicSystem wasn't being pushed to the map. Because from what I can tell, your older versions did this, and your newer version does nothing to the global table for your mod. So, you need only update the global table when new data is added, I didn't test the removal, but, if lua is anything like what i know, just doing global.railLogicSystem = data, like you were doing will update any changes to the current table, after all you do data = global.railLogicSystem or {}. So either that global exists or a new table is made, current version just defaults to {}. My guess anyway. I dont really know what i'm talking about, I'm a C#/Java programmer and I only know a bit of lua. If i'm wrong just call me out and tell me off. Just trying to help out.

Although this is a cheap fix, There is probably a better way that you know much better than a novice to the api like me. I had to study this for a bit to get the full idea of what was going on from other mods similar to this.
Jelgadis
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Feb 23, 2016 8:53 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Jelgadis »

can you add Rail switch again plz?
my trains are stupid.
so sometimes train needs unlinked rail(no path) to recalculate path.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Nexela »

Jelgadis wrote:can you add Rail switch again plz?
my trains are stupid.
so sometimes train needs unlinked rail(no path) to recalculate path.
The latest .13 and .14 versions of factorio should have this fixed. Can you post a screenshot or video/gif of it not working?
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Anson »

Jelgadis wrote:can you add Rail switch again plz?
Nexela wrote:The latest .13 and .14 versions of factorio should have this fixed.
Can you post a screenshot or video/gif of it not working?
before installing and using the mod myself, i just looked up this thread and was a bit confused
about what is included in the mod now, and what isn't :
in the top post, craftoBot wrote:Some features removed because reading and setting rail signals add intro base game,
but train cargo reader and station goto controller remains and updated.
no word about the other items (which are listed at the top, like rail switch and train detector)
also remaining in the mod ...
bdarnz
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Sep 01, 2016 12:53 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by bdarnz »

Sorry. Newb to mods for Factorio but this one sounds cool. I've downloaded and installed the mod and activated it in the main menu. I don't see these new objects in my crafting menu. Did I do something wrong?

DOH! You have to research it first!
Last edited by bdarnz on Thu Sep 01, 2016 7:17 pm, edited 1 time in total.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Nexela »

I believe there is some technology you have to research.
craftoBot
Inserter
Inserter
Posts: 37
Joined: Sun Dec 28, 2014 7:39 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by craftoBot »

Jelgadis wrote:can you add Rail switch again plz?
You can use rail signal for this, rail switch no more needed.
I would like to add rail switch but it produce so much bugs and i not know any situation where it need to be used in 0.13 and 0.14.
Rail signal reader removed by the same reason.
Train detector removed because now you can use rail signal to detect train.
But if you want something which is not present in the base game i try to add it.
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Anson »

thank you for the hints. i hadn't yet experimented with what is possible and what isn't. but now i did and found a few small differences and different "side conditions" between the different options ...

>> You can use rail signal for this, rail switch no more needed.
>> I would like to add rail switch but it produce so much bugs
>> and i not know any situation where it need to be used in 0.13 and 0.14.

when i disable a signal, it just acts like a normal red signal for the pathfinding of trains. as a result, trains prefer other routes with green signals, but if all available paths have a red signal, the train just advances to a random(?) signal and waits there, even if that is the signal that i have disabled. by interrupting the track with a rail switch, the train would never have tried that path, either going to another (red) signal and waiting there, or when there is no path, even stopping with the "no path" floating text much earlier, eg in the unloaderstation and not near a distant outpost.
i can't tell which of these versions is better or whether it matters at all, but there IS some difference ...
of course, when it is difficult to do the rail switch and might cause bugs etc, it probably is not worth the effort.

>> Rail signal reader removed by the same reason.

true, reading the color of the train signal is easily possible now, and it's even possible to adjust the circuit signals that are sent (instead of only red/yellow/green).

but for all of the above (reading as well as enabling/disabling train signals), one limitation exists: chain signals can not be connected to circuit networks !!!

i didn't encounter a situation yet where that might be important, but the follwing situation comes to my mind:
at a merge/split you have two incoming and two outgoing rails. thus two normal signals are put behind the crossing and two chain signals in front of it. now i want to select by circuits which of the two waiting trains (eg one incoming line for iron and one for copper) should be allowed to continue. how do i do that ? setting both normal signals to red would disable everthing, setting one to red wouldn't select which incoming train gets priority, and the chain signals in front of the crossing can't be connected. if there is enough space, more normal signals (which can be connected) can be placed in front of the crossing, but on big networks and/or with long trains, that might become difficult.

of course, the best solution would be if chain signals could be connected to circuits too, thus being able to read their four possible status values and also enabling and disabling them. but that would have to be added to vanilla by the devs ...

>> Train detector removed because now you can use rail signal to detect train.

again, some small difference: with a train detector, you can check whether a train is at some specific location, and with several detectors you might be able to detect the number of wagons or where the end of a stopped train is (eg to send different length trains to different unloaders or different refuel stations). with the new vanilla check of signals, you can only detect in which block a train is, and maybe you'll even get a "train in block" (red) signal from a train on another track that only crosses/splits/merges. of course, putting down signals every few tiles (at least 2 per wagon) and checking the middle of wagon locations, you still can count the number of wagons, but it would be quite ugly, and most of all, you couldn't be sure whether the train you get indicated is the end of one train or already the start of the next train.

>> But if you want something which is not present in the base game i try to add it.

during my few tests now, i noticed that the cargo inventory reader shows the total cargo of the entire train but without fuel. it would be nice to see the cargo of separate wagons (just the wagon in front of the cargo detector), and also the fuel of the engine(s) ...

more important than new features: fixing bugs :-) :-(
(see next posting, so that this subject can be finished)
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Anson »

while testing the cargo reader, i found a bug :

i had several trains going in a circle and at one location looked at the output of a cargo reader. as long as trains have only one type of cargo or are empty, it works, but if they have more than one type of cargo, some of it is not properly cleared when the train leaves the area.

in detail :
  • first train had copper ore, displayed correctly on arrival
  • and cleared properly after leaving the area
  • second train empty, counter cleared properly
  • third train with copper and iron, both are displayed correctly
  • on leaving, only the first slot is cleared and the second item type still shows
  • it still shows with no train nearby
  • even when a fourth empty train arrives, the second item type still shows
i tested with several item types, and always the first slot was cleared and all the rest kept their values.

and now for some strange effect:
when that fourth train is NOT empty but holds eg wooden chests, the second slot is cleared and only wooden chests are shown (which later are properly cleared when the train leaves)

now i needed to know ...
  • three types of items in the third train displayed properly
  • on leaving, only the first slot is cleared, still showing two types from slots 2+3
  • fourth train with only chests, displays the chests properly, also clears the second slot, and still displays the third item type from the previous train
  • on leaving, the chests are cleared but the third slot remains
my guess would be that there are two problems :
1. when a train leaves, you clear only the first slot no matter how many types that train had
2a. for new trains you rely on everything being cleared, showing that cargo properly,
2b. but additionally clearing one slot behind what that train really needs (this won't hurt, unless you try to fill ALL slots in the grid and then an additional empty slot has no space in the grid). just tested also this, and besides vanilla only having 40 slot wagons and your grid having 60 slots, also adding more wagons and/or bigger wagons doesn't crash the mod, but it simply forgets some items types (number 61+). no need to make it variable or even bigger than it is, but a hint in the OP would be nice.
craftoBot
Inserter
Inserter
Posts: 37
Joined: Sun Dec 28, 2014 7:39 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by craftoBot »

Anson wrote:while testing the cargo reader, i found a bug
Thanks, i uploaded fixed version (1.1.1).
I add train fuel reader and cargo wagon reader in next few days.
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by Anson »

craftoBot wrote:Thanks, i uploaded fixed version (1.1.1).
I add train fuel reader and cargo wagon reader in next few days.
thanks for the quick reaction.

but it will take a while until i can use that new version 1.1.1. :-(
I'm stuck with 1.0.1 since quite a few mods are not updated to 0.14 yet and i didn't want to disable/delete half my factory or start a new map with only half the mods. too bad that people no longer can use many/most mods when they want to play with the most current stable version of factorio ...

edit: since during the day, 7 more mods were updated, I'm trying a 0.14 game now anyway, although there are still 30 mods missing :-) :-( LOL
Last edited by Anson on Thu Sep 08, 2016 7:04 pm, edited 1 time in total.
craftoBot
Inserter
Inserter
Posts: 37
Joined: Sun Dec 28, 2014 7:39 pm
Contact:

Re: [MOD 0.12.X 0.13.X][1.0.0] Rail logic system

Post by craftoBot »

I uploaded fixed version for 0.13.
Post Reply

Return to “Mods”