I have the same problem.xiffix wrote: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)
[MOD 0.15] SmartTrains 2.0.5
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Fixed in SmartTrains 0.3.81xiffix wrote:Error in SmartTrains.
__SmartTrains__/gui.lua:608: attempt to index field '?' (a nil value)
Re: [MOD 0.12.27+] SmartTrains 0.3.81
I wanted you already write, but it was just fixed time. Thank you
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Thanks, the only problem that I continue to have that I don't understand how of it works, there is very little documentation. What does a checkbox like "active", "marked" , "refuel","depart" do?Choumiko wrote:Fixed in SmartTrains 0.3.81xiffix wrote:Error in SmartTrains.
__SmartTrains__/gui.lua:608: attempt to index field '?' (a nil value)
1. If "refuel" is checked, does that mean that the train will automatically refuel at the refuel station that is assigned? If so....why do we have such an option to be begin with, since every train needs to be refueled eventually.
2. What does "depart" do? I check it but nothing happens. When a trains stop at a station, I thought that checking "depart" might manually force a train to depart, after which the checkbox should go empty, but that's not the case.
3. "active"... what does that do? I'm assuming that it allows me to select the details of a train line in the top window, but why does it show 0 for "#trains" in the first train line and 1 in the other with the "active" checkbox of the 2nd train line selected, but switches to 1 for "#trains in the first train line and 0 in the second, once I check "active" of the first train line? There is 1 train on each train line, so I expected to see 1 for "#trains" in both train lines or do you ONLY show the #trains for the line that has "Active" checkbox checked?
4. "marked", what is that used for"? Only to mark a train line for deletion?
5. How do I use "signal value" in "rules"? I can check it, but then the checked box quickly returns to an empty box.
6. How do I find a station number that I can set in rules?
7. How do I set the signal for having both "FULL (AND)" with "signal" checked?
Sorry if this was explained before, but it wasn't in your first post and nobody likes to dig through the other 230 posts in this thread.
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Hey Choumiko,
I've started on my next combinator build and I've decided to make a rather large system that dynamically controls my outpost trains. Trains will be sent to the various outposts depending on the amount being mined at a given time, amount of ore in chests at the station etc. This would mean that once an outpost gets low on outputting ores a train is sent only occasionally and finally once it runs dry trains are never sent; basically supplying trains depending on demand.
I am finding this rather difficult to do however due to the way stations are identified by signal value. Currently the signal value is taken from the order that the station appears in the schedule list and unfortunately this becomes problematic when (for example) a station is removed from the schedule (ie. outpost is removed) as it bumps each station up a value and thus throws the system out of order.
Would it be possible to instead be able to set the signal value for a smart station and have that value remain regardless of the order in the schedule? This would mean that if the player dropped a station and set it as "Iron 1" (signal value = 3) then that station would always be signal value 3 regardless of what was happening in the schedule.
This would also benefit stations that are part of multiple lines, as a particular station will always have the same signal value.
Furthermore if it was possible to output that value from the smart station (or the cargo box thing) it would make identifying outposts through the circuit network much easier.
Hope this all makes sense, just an idea that I thought I'd throw your way and see if it were possible!
Cheers!
I've started on my next combinator build and I've decided to make a rather large system that dynamically controls my outpost trains. Trains will be sent to the various outposts depending on the amount being mined at a given time, amount of ore in chests at the station etc. This would mean that once an outpost gets low on outputting ores a train is sent only occasionally and finally once it runs dry trains are never sent; basically supplying trains depending on demand.
I am finding this rather difficult to do however due to the way stations are identified by signal value. Currently the signal value is taken from the order that the station appears in the schedule list and unfortunately this becomes problematic when (for example) a station is removed from the schedule (ie. outpost is removed) as it bumps each station up a value and thus throws the system out of order.
Would it be possible to instead be able to set the signal value for a smart station and have that value remain regardless of the order in the schedule? This would mean that if the player dropped a station and set it as "Iron 1" (signal value = 3) then that station would always be signal value 3 regardless of what was happening in the schedule.
This would also benefit stations that are part of multiple lines, as a particular station will always have the same signal value.
Furthermore if it was possible to output that value from the smart station (or the cargo box thing) it would make identifying outposts through the circuit network much easier.
Hope this all makes sense, just an idea that I thought I'd throw your way and see if it were possible!
Cheers!
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Yeah, documentation is a "bit" lacking..JMiles wrote:Thanks, the only problem that I continue to have that I don't understand how of it works, there is very little documentation. What does a checkbox like "active", "marked" , "refuel","depart" do?
Sorry if this was explained before, but it wasn't in your first post and nobody likes to dig through the other 230 posts in this thread.
1. You are right in every point. Trains with refuel set only add the refueling Station to their schedule when they have to. The reason for this option is more or less for self-set rules/"realism", have dedicated stations for refueling and don't bother supplying each and every station in your base with fuel. It might actually be more usefull for long long trainlines, where a train could run out of fuel before coming back to the base (since i assume most players don't refuel at outposts), though i have yet to see an outpost that is that far awayJMiles wrote: 1. If "refuel" is checked, does that mean that the train will automatically refuel at the refuel station that is assigned? If so....why do we have such an option to be begin with, since every train needs to be refueled eventually.
2. What does "depart" do? I check it but nothing happens. When a trains stop at a station, I thought that checking "depart" might manually force a train to depart, after which the checkbox should go empty, but that's not the case.
3. "active"... what does that do? I'm assuming that it allows me to select the details of a train line in the top window, but why does it show 0 for "#trains" in the first train line and 1 in the other with the "active" checkbox of the 2nd train line selected, but switches to 1 for "#trains in the first train line and 0 in the second, once I check "active" of the first train line? There is 1 train on each train line, so I expected to see 1 for "#trains" in both train lines or do you ONLY show the #trains for the line that has "Active" checkbox checked?
4. "marked", what is that used for"? Only to mark a train line for deletion?
5. How do I use "signal value" in "rules"? I can check it, but then the checked box quickly returns to an empty box.
6. How do I find a station number that I can set in rules?
7. How do I set the signal for having both "FULL (AND)" with "signal" checked?
2. That's actually explained in the first post
Basically a "leave when no change in cargo for 2 seconds" rule. Added way before the full/empty/signal stuffTrains leave stations when there is no change in their loaded cargo for a certain time (2s interval as default, cargo difference is checked per item)
maximum time still is the time set in the schedule
minimum waiting time (4s as default, change it in the global settings window)
3. Active is to assign the currently opened train to that specific line (or to unassign it). That's also why you see #trains changing.
4. You can mark multiple lines to delete them, or mark one to rename it. The positioning is probably not that good, maybe it should be right of the "Rules" buttons or all the way to the left?
5. "signal value" is only available when you check "signal" first. Having both checked makes trains go the the station in their schedule that is on the position indicated by the signal you set at the light of the SmartTrain stop. E.g.
Imagine the red wire coming from some combinator contraption which decides where your train should go. If it outputs green signal = 1 the lamp would turn on and your train would go to the first station in the schedule, to the third for 3 and so on. If the signal is higher than the stations in the schedule it goes to the next one after the current one.
6. See 5. Goto station # is similar to "signal value" only that it is a fixed number.
Both options have in common that the train goes to the next station if the waiting time is passed (unless wait forever is set) or the number is invalid
7. Simply check both The (AND) is supposed to be an indicator that both rules have to be true. Also a reminder for me to replace it with a toggle button for AND/OR
If you have any more questions just post them, maybe i then can simply mash my answers together for an actual documentation
You're nutsXeteth wrote:I've started on my next combinator build and I've decided to make a rather large system that dynamically controls my outpost trains. Trains will be sent to the various outposts depending on the amount being mined at a given time, amount of ore in chests at the station etc. This would mean that once an outpost gets low on outputting ores a train is sent only occasionally and finally once it runs dry trains are never sent; basically supplying trains depending on demand.
You basically want a fixed mapping of Station name to a number? I'm a bit worried about backwards compatibility, unless i add yet another checkbox (YAC ) to use the lookup table (better naming suggestions welcome).Xeteth wrote: I am finding this rather difficult to do however due to the way stations are identified by signal value. Currently the signal value is taken from the order that the station appears in the schedule list and unfortunately this becomes problematic when (for example) a station is removed from the schedule (ie. outpost is removed) as it bumps each station up a value and thus throws the system out of order.
Would it be possible to instead be able to set the signal value for a smart station and have that value remain regardless of the order in the schedule? This would mean that if the player dropped a station and set it as "Iron 1" (signal value = 3) then that station would always be signal value 3 regardless of what was happening in the schedule.
Furthermore if it was possible to output that value from the smart station (or the cargo box thing) it would make identifying outposts through the circuit network much easier.
How should this behave for cases where you have the same station in the schedule multiple times? Probably go to the first one it finds after the current one?
Outputting the station# isn't a problem, a few lines of code and creating an icon. Though the "cargo box thing" starts to have so many virtual signals that it's nearly worth considering adding an extra one just for the special signals.
I think once my rewrite of FatController is done i'll get to it, really want to see your setup
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Choumiko wrote:You're nuts
Thankyou!
Yep, custom mapping for the station signal values so that they can remain constant when stations are added/removed would be awesomeChoumiko wrote: You basically want a fixed mapping of Station name to a number? I'm a bit worried about backwards compatibility, unless i add yet another checkbox (YAC ) to use the lookup table (better naming suggestions welcome).
How should this behave for cases where you have the same station in the schedule multiple times? Probably go to the first one it finds after the current one?
Outputting the station# isn't a problem, a few lines of code and creating an icon. Though the "cargo box thing" starts to have so many virtual signals that it's nearly worth considering adding an extra one just for the special signals.
I think once my rewrite of FatController is done i'll get to it, really want to see your setup
Just an idea - could it be set at the station itself via entering it in to a constant combinator type thing? That would remove the need for changing the GUI (I hear the GUI can be hard to change/mod sometimes) and could double up as the way that the player can output that station signal number to the circuit network. I have no idea if this is possible or something that would work though.
I don't see it being too much of a problem when you have the same station multiple times because you'd just send the train to that station each time with the custom mapped signal value unless I'm missing something?
Being able to output that station value would be awesome! Would make identifying stations much, much easier for later use within the train-sending combinator build
No worries take your time, looking forward to seeing the FatController re-write as well. Honestly don't know how I ever played Factorio without ST, FC and FARL haha.
Re: [MOD 0.12.27+] SmartTrains 0.3.80
Thanks Choumiko, you've been a great help!
Btw, no wonder why I didn't understand some of the issues that I had, because believe it or not, I didn't see that your mod added a smart train stop, I was still using Factorio's own train stop!
One last question; where did you find the documentation (about the game) that is needed to write these mods? I was a professional programmer before I became a systems administrator, so I have the programming skills (also in LUA) and I'm also skilled in 2d and 3D graphic design, and I was thinking about writing a mod for Factorio, but without any proper documentation about the internals of the game, there is not a lot I can develop.
So where did you get that info?
Btw, no wonder why I didn't understand some of the issues that I had, because believe it or not, I didn't see that your mod added a smart train stop, I was still using Factorio's own train stop!
One last question; where did you find the documentation (about the game) that is needed to write these mods? I was a professional programmer before I became a systems administrator, so I have the programming skills (also in LUA) and I'm also skilled in 2d and 3D graphic design, and I was thinking about writing a mod for Factorio, but without any proper documentation about the internals of the game, there is not a lot I can develop.
So where did you get that info?
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Can you make trun run on signal only ( or wait just for signal)? I want the train to run only whan cetain resource in storage drop under certain level.
For now it either ignores signal, waits for timer and runs, or waits till full AND signal. well actually it mostly ignores the settings anyway. Only one that works is wait forever. MAkes the train not move at all:P
For now it either ignores signal, waits for timer and runs, or waits till full AND signal. well actually it mostly ignores the settings anyway. Only one that works is wait forever. MAkes the train not move at all:P
Re: [MOD 0.12.27+] SmartTrains 0.3.81
lamhirh wrote:Can you make trun run on signal only ( or wait just for signal)? I want the train to run only whan cetain resource in storage drop under certain level.
For now it either ignores signal, waits for timer and runs, or waits till full AND signal. well actually it mostly ignores the settings anyway. Only one that works is wait forever. MAkes the train not move at all:P
Setting the rules like above should do what you want (that is, if you connect the lamp of the smart trainstop to the circuit network and set the condition the way you need it "resource x" < Z i guess) If it doesn't work i'd like a screenshot of the rules window and the combinator setup at your smart trainstop.
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Hmm i might overthink it. i made a combinator to send blue if metal < 400k and light to blue=1.
Was going away after 3o seconds.
Now made new train. Set to leave on full. Saved. Runs on default timer again
http://images.akamai.steamusercontent.c ... 40E750270/
Was going away after 3o seconds.
Now made new train. Set to leave on full. Saved. Runs on default timer again
http://images.akamai.steamusercontent.c ... 40E750270/
Re: [MOD 0.12.27+] SmartTrains 0.3.81
I don't understand what you're trying to do. The trainline and rules as setup in the screenshot will make the train leave the R1 -stone station when the trains cargo wagons are full OR when the time has passed.
Where are you getting the metal signal from? If you check the "signal" checkbox in the rule window, the train will leave when it is full AND the signal is valid (metal < 4000k in your case).
Where are you getting the metal signal from? If you check the "signal" checkbox in the rule window, the train will leave when it is full AND the signal is valid (metal < 4000k in your case).
Re: [MOD 0.12.27+] SmartTrains 0.3.80
What? No answer? Too afraid to get competition?JMiles wrote:One last question; where did you find the documentation (about the game) that is needed to write these mods? I was a professional programmer before I became a systems administrator, so I have the programming skills (also in LUA) and I'm also skilled in 2d and 3D graphic design, and I was thinking about writing a mod for Factorio, but without any proper documentation about the internals of the game, there is not a lot I can develop. So where did you get that info?
Re: [MOD 0.12.27+] SmartTrains 0.3.80
No, of course not.JMiles wrote:What? No answer? Too afraid to get competition?
Check out these links:
http://lua-api.factorio.com/
https://wiki.factorio.com/index.php?title=Modding
https://wiki.factorio.com/index.php?title=Lua/Game (at the bottom are links to different Lua objects)
The wiki is slightly outdated at times, but i still find it rather helpful, especially since my browser history shows me all i need when typing Lua/
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Thanks Choumiko, you've been a great help.
- MalcolmCooks
- Filter Inserter
- Posts: 253
- Joined: Mon Apr 06, 2015 8:32 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Is there a way to have a train, after being dispatched to a certain station by a signal value, to then return straight back to the first station again instead of visiting all the remaining stations on the schedule?
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Like thisMalcolmCooks wrote:Is there a way to have a train, after being dispatched to a certain station by a signal value, to then return straight back to the first station again instead of visiting all the remaining stations on the schedule?
Code: Select all
Station A <- sends train to station C via signal value
Station B
Station C <-- sends train to A, when it came from there, to D otherwise?
Station D
- MalcolmCooks
- Filter Inserter
- Posts: 253
- Joined: Mon Apr 06, 2015 8:32 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.81
Sorry, I worked it out with some experimenting.
I have a coal supply train, with one loading station, and multiple unloading stations. It waits at the loading station, until one of the unloading station sends a signal that it needs coal.
Station one is loading, conditions are leave when full AND signal, go to signal #
The other stations are unloading, conditions are leave when empty
A problem with this is that if more than one station sends a request, the go to signal will send the train to the wrong station. So I have a failsafe that makes an invalid go to signal if that happens, default behaviour is then to visit each station in schedule order.
In both cases after being unloaded the train goes to each station after that in the schedule before going back to the loading station.
I need the unloading stations to be leave when signal, go to 1, and have the signal condition set appropriately so it will be true if:
1) the stations request has been fulfilled (same as train is empty) OR
2) the station did not send a request signal
Then, if one station sends a request it works like this: Train goes to that station, is unloaded, returns to the loading station.
If more than one station sends a request: Train visits each station. If the station doesn't need coal, it goes to the next one. If the station does need coal, it is unloaded and returns straightaway to the the loading station.
I have a coal supply train, with one loading station, and multiple unloading stations. It waits at the loading station, until one of the unloading station sends a signal that it needs coal.
Station one is loading, conditions are leave when full AND signal, go to signal #
The other stations are unloading, conditions are leave when empty
A problem with this is that if more than one station sends a request, the go to signal will send the train to the wrong station. So I have a failsafe that makes an invalid go to signal if that happens, default behaviour is then to visit each station in schedule order.
In both cases after being unloaded the train goes to each station after that in the schedule before going back to the loading station.
I need the unloading stations to be leave when signal, go to 1, and have the signal condition set appropriately so it will be true if:
1) the stations request has been fulfilled (same as train is empty) OR
2) the station did not send a request signal
Then, if one station sends a request it works like this: Train goes to that station, is unloaded, returns to the loading station.
If more than one station sends a request: Train visits each station. If the station doesn't need coal, it goes to the next one. If the station does need coal, it is unloaded and returns straightaway to the the loading station.
- MalcolmCooks
- Filter Inserter
- Posts: 253
- Joined: Mon Apr 06, 2015 8:32 pm
- Contact:
Re: [MOD 0.12.27+] SmartTrains 0.3.81
I found a better way to do it. Schedule goesMalcolmCooks wrote:Sorry, I worked it out with some experimenting.
1. unloading A [leave when empty]
2. loading [leave when full AND signal, wait forever, go to station # signal value]
3. unloading B [leave when empty]
4. loading [leave when full AND signal, wait forever, go to station # signal value]
ect.
Arithmetic combinators will negate the signals in order of priority, so if more than one signal is coming through, only the highest priority signal will make it through.
Re: [MOD 0.12.12+] SmartTrains 0.3.73
Same error here, but in line 250...NearlyDutch wrote:So I was making my train network a little bit smarter with the introduction of smart train stops, but I get the following error, whenever a train uses a smart train stop:
This only happens with smart train stops, normal ones have no problem. I wanted to make my trains go to ore outpost after ore outpost until they are full and then goto the unloading station. That's why I was reworking my train network with smart train stops, but whenever I place one, a train arrives at one or departs from one, this error is printed.Code: Select all
Error in SmartTrains: __SmartTrains__/Train.lua:240:conversion of data to type "j" failed
P.S.: Already tried hard resetting with the remote interface.
Tried to load yout demosave, even there. Latest version factorio, latest version mod.