I remember a similar request some time ago, but had a much more complex use case. I'll guess it won't hurt performance adding one more virtual signal with a static value. Working on some changes right now, maybe i get to it after i'm done.Slimey wrote:Is it possible for a train/line to send out a unique signal? Or to add that to this mod?
I´m thinking something like this:
IF train A stops at a station it send out signal "trainA". A smart inserter then loads coal on a transport belt which get delivered and loaded to the train.
Train B later stop at the same station and then send out signal "trainB". Another inserter now load iron on the belt.
I guess I could do something similiar with a dummy item in one of the wagons but it would be a lot easier if the train itself sent a signal like that.
[MOD 0.15] SmartTrains 2.0.5
Re: [MOD 0.12.12+] SmartTrains 0.3.75
Re: [MOD 0.12.12+] SmartTrains 0.3.75
Updated to SmartTrains 0.3.78
Upgrading should work without problems, some trains that are set to wait forever might go to the next station even if their rule isn't valid. But that shouldn't be too much of an issue.
In case you're wondering, 2^32-1 ticks are about 828 days, which is pretty much forever as far as a single save is concerned?!
- change trains waiting forever to wait 2^32-1 ticks instead of going into manual mode
- check for full/empty only if needed
- better rules display in Traininfo window
- minimal Factorio version is 0.12.27
- added virtual signal for line number
- now works with Logistics Railway (1.0.5+)
Upgrading should work without problems, some trains that are set to wait forever might go to the next station even if their rule isn't valid. But that shouldn't be too much of an issue.
In case you're wondering, 2^32-1 ticks are about 828 days, which is pretty much forever as far as a single save is concerned?!
Last edited by Choumiko on Mon Mar 28, 2016 8:33 am, edited 1 time in total.
Re: [MOD 0.12.27+] SmartTrains 0.3.77
I cannot update the mod. When both mods are in, the Factorio shuts down with a warning about duplicate mods, when I remove the old version, the save game returns an error:
Code: Select all
Error while running the
on_configuration_changed>
__SmartTrains__/control.lua:159: attempt to
index field 'rules' (a boolean value)
Re: [MOD 0.12.27+] SmartTrains 0.3.78
Download-Link in the OP doesn't work, the one in the post above this one does, however.
Re: [MOD 0.12.27+] SmartTrains 0.3.78
Updated to SmartTrains 0.3.79
Hopefully the last necessary bugfix release for a while, sorry
- fixed "full rule" never being true
Thanks, fixed.Creat wrote:Download-Link in the OP doesn't work, the one in the post above this one does, however.
Hopefully the last necessary bugfix release for a while, sorry
-
- Fast Inserter
- Posts: 159
- Joined: Mon Mar 21, 2016 1:19 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.79
Is there a way using this mod (or base game I guess) to have a train choose a open station?
For instance, if you have two stations right next to each other, could the train go to the open station? I haven't seen a way to do that, but I'm pretty new to any of the logic systems.
For instance, if you have two stations right next to each other, could the train go to the open station? I haven't seen a way to do that, but I'm pretty new to any of the logic systems.
Re: [MOD 0.12.27+] SmartTrains 0.3.79
If you name the stations the same then the train will go to the open one. That's base game behaviour, if you need them named differently then SmartTrains could probably do it with a third station and some combinator/smartTrain station stuff.
-
- Fast Inserter
- Posts: 159
- Joined: Mon Mar 21, 2016 1:19 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.79
Sweet. Thanks for the answer.
Also, awesome mod. Really liking it.
Also, awesome mod. Really liking it.
Re: [MOD 0.12.27+] SmartTrains 0.3.79
Hello Choumiko,
i upgraded from *.73 to *.79 and created a new line.
Now i get the attached error message everytime the train reaches a station of the line.
Greetings steinio
i upgraded from *.73 to *.79 and created a new line.
Now i get the attached error message everytime the train reaches a station of the line.
Greetings steinio
- Attachments
-
- SmartTrains.png (186.13 KiB) Viewed 8719 times
-
- Filter Inserter
- Posts: 549
- Joined: Fri Jan 29, 2016 2:48 am
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.79
Likewise. I presume the error occurs while manipulating the schedule, as after this message I notice my trains did not get their routes updated as expected.steinio wrote:Hello Choumiko,
i upgraded from *.73 to *.79 and created a new line.
Now i get the attached error message everytime the train reaches a station of the line.
Greetings steinio
-
- Filter Inserter
- Posts: 549
- Joined: Fri Jan 29, 2016 2:48 am
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.79
Just figured out how to repro this. The bug is triggered while building the GUI panel to show the route of a line with multiple visits to the same station. There is a second error message, I think, which happens before this one:
Once that happens,__SmartTrains__/control.lua:737: Error while running the event handler: __SmartTrains__/gui.lua:216: attempt to perform arithmetic on field 'time_to_wait' (a nil value)
- The partially constructed GUI panel intended to show the line's route stays on-screen, permanently, until the next successful attempt to build a gui panel of the same type
- The route is unable to be installed into the train schedules, causing the error reported a few posts above by steinio
Re: [MOD 0.12.12+] SmartTrains 0.3.75
Updated to SmartTrains 0.3.80
For completeness sake the recent bugfix releases:
For completeness sake the recent bugfix releases:
- fix lines not updating
- add/remove rules after copying a line with changed # of stations
- fixed "full rule" never being true
- fixed upgrading saves that had lines without rules
The error came from some wierd code removing unused rules. I believe it could have been fixed without code changes by simply opening the rules for that line and saving..Choumiko wrote:The line number can be set in the rules window
- change trains waiting forever to wait 2^32-1 ticks instead of going into manual mode
- check for full/empty only if needed
- better rules display in Traininfo window
- minimal Factorio version is 0.12.27
- added virtual signal for line number
- now works with Logistics Railway (1.0.5+)
Yeah, one station in a schedule more than once was how i reproduced it, your error is a result of a missing ruleset for a line. When opening the GUI it tried to check if the train is set to wait forever to display it in the Traininfo, fixed now.golfmiketango wrote:Just figured out how to repro this. The bug is triggered while building the GUI panel to show the route of a line with multiple visits to the same station.
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Thanks Choumiko,
works like a charm.
works like a charm.
Re: [MOD 0.12.27+] SmartTrains 0.3.80
I just been trying this mod out recently and have a few issues:
I'm trying to set up a station that:
1. tells the train where to go if resource X is required
2. spend the amount of time specified on the train to stay at that station before returning to the home station
3. auto refuel the train
I got #1 to work but only if I don't use the station timer to specify how long a train waits at the station, instead i needed to use the station at resource X to give the train the green light to go, if the train uses its timer to go, it will simply go to the next station in its schedule
Seems auto refuel doesn't work when I'm telling the train to go to specific stations....
I'm trying to set up a station that:
1. tells the train where to go if resource X is required
2. spend the amount of time specified on the train to stay at that station before returning to the home station
3. auto refuel the train
I got #1 to work but only if I don't use the station timer to specify how long a train waits at the station, instead i needed to use the station at resource X to give the train the green light to go, if the train uses its timer to go, it will simply go to the next station in its schedule
Seems auto refuel doesn't work when I'm telling the train to go to specific stations....
-
- Fast Inserter
- Posts: 159
- Joined: Mon Mar 21, 2016 1:19 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.80
I'm trying to setup a train to only depart a smart stop if a resource is below a certain amount in a series of smart chests.
Figured it would be simple but I must be missing something. I connected the chests to a powerline and it is showing 46k. I then connect that to the light on the stop and put in coal less than 40k. Tried greater than too. One makes the light go on and the other makes it turn off, so it seems to be reading right.
Neither holds the train at the station though. What am I missing?
Figured it would be simple but I must be missing something. I connected the chests to a powerline and it is showing 46k. I then connect that to the light on the stop and put in coal less than 40k. Tried greater than too. One makes the light go on and the other makes it turn off, so it seems to be reading right.
Neither holds the train at the station though. What am I missing?
Re: [MOD 0.12.27+] SmartTrains 0.3.80
You need to tell the train to actually react to the signal: Go to the train line window where you can tell it to leave when full, empty and so on. There's a check box called "signal". Tick that and the train will leave when the signal lights up.NoriSilverrage wrote:I'm trying to setup a train to only depart a smart stop if a resource is below a certain amount in a series of smart chests.
Figured it would be simple but I must be missing something. I connected the chests to a powerline and it is showing 46k. I then connect that to the light on the stop and put in coal less than 40k. Tried greater than too. One makes the light go on and the other makes it turn off, so it seems to be reading right.
Neither holds the train at the station though. What am I missing?
Keep in mind that if you specify multiple conditions, they have to all be true for the train to leave. For example, if you tick "full" and "signal it will only leave if it's full and the signal is lit up. Hope it's clear now
-
- Fast Inserter
- Posts: 159
- Joined: Mon Mar 21, 2016 1:19 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Ahh, that is it. Thanks! Didn't realize it needed to be a line. So many more options now. The magic combo was wait forever, and for signal.Creat wrote:You need to tell the train to actually react to the signal: Go to the train line window where you can tell it to leave when full, empty and so on. There's a check box called "signal". Tick that and the train will leave when the signal lights up.NoriSilverrage wrote:I'm trying to setup a train to only depart a smart stop if a resource is below a certain amount in a series of smart chests.
Figured it would be simple but I must be missing something. I connected the chests to a powerline and it is showing 46k. I then connect that to the light on the stop and put in coal less than 40k. Tried greater than too. One makes the light go on and the other makes it turn off, so it seems to be reading right.
Neither holds the train at the station though. What am I missing?
Keep in mind that if you specify multiple conditions, they have to all be true for the train to leave. For example, if you tick "full" and "signal it will only leave if it's full and the signal is lit up. Hope it's clear now
Re: [MOD 0.12.27+] SmartTrains 0.3.80
If i understand 1 and 2 right you want: A train waits for example 30 seconds at Station A. If during that time the green light turns on, it goes to a specified station in the schedule(#3 in picture below). If the time passes without the light going green it should go to another station?supagu wrote:I just been trying this mod out recently and have a few issues:
I'm trying to set up a station that:
1. tells the train where to go if resource X is required
2. spend the amount of time specified on the train to stay at that station before returning to the home station
3. auto refuel the train
I got #1 to work but only if I don't use the station timer to specify how long a train waits at the station, instead i needed to use the station at resource X to give the train the green light to go, if the train uses its timer to go, it will simply go to the next station in its schedule
Seems auto refuel doesn't work when I'm telling the train to go to specific stations....
If that's what you want you can add the home station directly after Station A or create a combinator setup that starts a timer when it detects when a train arrives and after a certain time sets the value of the green light to the number of the home station (check "signal value" and "wait forever" in the rules then)
To 3: Yes, auorefuel is kind of useless in combination with the signal/Go to station/signal value rules. For it to work the last station in the schedule should have none of these rules.
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Hello,
I really like the idea of this mod but...
Im running in an issue with the Refuel Feature. I've named the Station "Refuel L-CC"
I don't know what i'm doing wrong.
Here is the error:
Error in SmartTrains.
__SmartTrains__/gui.lua:608: attempt to index field '?' (a nil value)
Thanks
I really like the idea of this mod but...
Im running in an issue with the Refuel Feature. I've named the Station "Refuel L-CC"
I don't know what i'm doing wrong.
Here is the error:
Error in SmartTrains.
__SmartTrains__/gui.lua:608: attempt to index field '?' (a nil value)
Thanks
- Attachments
-
- No crafting.zip
- My Safe File
- (4.87 MiB) Downloaded 131 times