Re: [MOD 0.12.30+] SmartTrains 0.3.82
Posted: Sun Jun 19, 2016 9:21 am
What does the depart checkbox actually do, in the train lines summary?
If you have it checked, it will make the trains leave a station if their cargo has not changed for a few seconds (or if it only changes very slowly). So you can have the trains leave the outposts as soon as they have emptied the buffer at the outpost.wahming wrote:What does the depart checkbox actually do, in the train lines summary?
Oh joy. That's just what I neededsiggboy wrote:If you have it checked, it will make the trains leave a station if their cargo has not changed for a few seconds (or if it only changes very slowly). So you can have the trains leave the outposts as soon as they have emptied the buffer at the outpost.wahming wrote:What does the depart checkbox actually do, in the train lines summary?
Code: Select all
if p.results then
for i = 1, #p.results do
if p.results[i].name == name then
p.results[i].name = newName
end
if p.results[i][1] == name then
p.results[i][1] = newName
end
end
end
Code: Select all
if p.results then
for i = 1, #p.results do
if p.results[i].name == name then
p.results[i].name = newName
end
if p.results[i][1] == name then
p.results[i][1] = newName
end
end
if type == "recipe" then
p.icon = data.raw["item"][newName].icon
p.subgroup = data.raw["item"][newName].subgroup
p.order = data.raw["item"][newName].order
end
end
Code: Select all
data:extend({smart_train_stop,recipe, st_proxy, st_proxy_i,})
Code: Select all
data:extend({item})
I take it that 0.3.95 doesn't work in 0.13.x?Choumiko wrote:Updated to SmartTrains 0.3.95
(Same as the latest prerelease)
For changes take a look at the release notes in the link.
This will probably be the last version for 0.12.x. 0.13 brings so many changes to the trainsystem i want for SmartTrains.
Just for curiosity, make a pull request. I will not accept it though, since i'm close to finishing the updatexmnovotny wrote:I have reworked the code of this mod for version 0.13, (just for myself - I couldn't wait for the author's update). It basically works, but it's not ideal.
If someone wants my version before Choumiko releases the new version, I can post a download link here.
And I can also make a pull request with my changes, if Choumiko is interested.
What about the other mods (FARL, FatController)? Is there a 0.13 roadmap for these as well? Will you update SmallFixes?Choumiko wrote:Just for curiosity, make a pull request. I will not accept it though, since i'm close to finishing the update
All mods except SmartTrains are updatedsiggboy wrote:What about the other mods (FARL, FatController)? Is there a 0.13 roadmap for these as well? Will you update SmallFixes?
I'll test the heck out of SmartTrains in 0.13 as soon as we get a working TestMode (or ToyBox), because without those it's too unfun to develop in sandboxes.
Just amazing how fast you are. I've also realized that some of my most loved mods (module inserter, auto trash) are also made by you, didn't even know that. Already updated of course.Choumiko wrote:All mods except SmartTrains are updated
That's very useful, thanks. I've also seen a post somewhere where somebody showed a LUA fragment that would make all your logistic requests complete automatically (like cheat mode, but even more convenient).for testmode like behaviour: /c game.player.cheat_mode = true; game.player.force.research_all_technologies()
Let's you craft without ingredients.
Checking full/empty from a circuit is super easy if you know what cargo you're dealing with (if it's only Oil in the Rail Tanker, then it's straightforward). If you don't know the cargo, then you might have to first subtract all the other signals that might appear in the combinator (like train-at-station, fuel-level etc.) and filter only positive values before you get a signal that only contains the cargo.Right now i'm struggling a bit with making updating trainlines work correctly. Everything else should be working, except Railtankers, if you want full/empty rules with these you have to resort to using a circuit condition and check full/empty yourself. But i think it's really worth it, since on_tick is only needed to update the cargo combinator and do the autorefuel checks for trains that are currently refueling.
I sort of made up my mind about Railtanker: The latest update keeps the fake items in the tanker. That way the vanilla conditions work with railtanker toosiggboy wrote:Checking full/empty from a circuit is super easy if you know what cargo you're dealing with (if it's only Oil in the Rail Tanker, then it's straightforward). If you don't know the cargo, then you might have to first subtract all the other signals that might appear in the combinator (like train-at-station, fuel-level etc.) and filter only positive values before you get a signal that only contains the cargo.
So it can be awkward if you need to make a cargo check yourself (what about that "train-full" signal from the combinator?)
I just had to go to the Railtanker thread to see what you mean by that. It's indeed a bit ugly, but probably no good way to avoid having it. On the other hand we'll probably get the official tanker wagon in 0.13 anyway, then the mod will be entirely obsolete. I'm currently not using it because barrels are a bit more interesting to play with and slightly faster when you need to move large amounts of oil quickly. Is it still possible to reliably connect 4 pumpts to a wagon? Because that's kind of necessary to get acceptable loading/unloading times out of the tanker (20 seconds instead of 40 for a full wagon).Choumiko wrote:I sort of made up my mind about Railtanker: The latest update keeps the fake items in the tanker. That way the vanilla conditions work with railtanker tooOnly downside is that inserters are able to take the items out..
I guess that's fine, since it really seems to make things simpler and faster (probably a lot faster). In my current game (with my scheduler) I check the cargo manually everywhere, so I have control over how much the train will load before it leaves from the circuit side (and I need that because the circuit tells the receiving station how much cargo is incoming). To that end it's completely sufficient how things work right now, with the combinator updating the cargo every few ticks. It's just that you need 2 combinators to filter the SmartTrains signals first, so you get a "clean" wire with only the cargo signal on it (otherwise you can't use "wildcard" conditions on the cargo, which you kind of need if you make a generic circuit that works independent of the cargo type)."train full" signal and the other rules are probably not going to happen in 0.13, reason is: SmartTrains no longer checks the rules, it's all done by Factorio itself. Factorio only stores the expected departure time once a train arrives at a station. Then if the train leaves before that, it assumes that a condition became true and looks up the circuit value to make jumpTo rules work. So all it knows is that _some_ condition became true, could be full/empty/inactivity/signal etc.. So that's the only thing i could output, whether the train left due to time or any condition.
Yeah, I'm watching it, too (I'm German myselfPrerelease probably in the next 3-5 hours, depending on how long Germany needs to beat Italy
Currently reading the cargo is still done by SmartTrains every few ticks, but yeah it's planned for 0.13/14siggboy wrote:I guess that's fine, since it really seems to make things simpler and faster (probably a lot faster). In my current game (with my scheduler) I check the cargo manually everywhere, so I have control over how much the train will load before it leaves from the circuit side (and I need that because the circuit tells the receiving station how much cargo is incoming). To that end it's completely sufficient how things work right now, with the combinator updating the cargo every few ticks. It's just that you need 2 combinators to filter the SmartTrains signals first, so you get a "clean" wire with only the cargo signal on it (otherwise you can't use "wildcard" conditions on the cargo, which you kind of need if you make a generic circuit that works independent of the cargo type).
Probably in 0.13 it would be easier to read the cargo directly from the station, that would solve that problem anyway (I'm not sure right now if that's already possible or only planned for a future patch).
I'd still very much like to be able to read the station number from the station directly (as discussed before in the "combinator magick" thread). And what about the "pulse" signal when the train leaves (maybe with the number of the next destination as a value)? Is that going to be possible?
I've thought about that but I don't think you should do it. First of all, it's ugly, and second of all it makes wiring up the station harder because you always have to be careful about connecting to the correct combinator (color coding the two combinators would be mandatory anyway).Choumiko wrote:I might simply add a second combinator to the trainstop, one for the virtual signals, the other for the cargo.
The other signals should still be available during the tick when the "train-leaves" pulse is appearing. This is important if you want to pulse something out when the train leaves. If the signals are already cleared in that tick that would not be possible anymore.Station number and pulsing is simple (i think). Station number would be constantly output. "Train leaves" signal would be set to the destination number in the tick where the other signals get cleared and unset 1 tick later?
I've been thinking about removing the lamp. As it is right now i could simply say: The first conditon rule in the schedule is the signal SmartTrains will check when getting the value for jumpTo, that would make space for a second combinator. Not sure yet.siggboy wrote:Adding a second combinator just for the cargo info seems quite heavyhanded to be honest; especially since we can expect to get this information very soon from the train station proper, when the devs add that to the Vanilla game.
Alright, then the current implementation isn't ideal. So the next should better be: "leaving tick" : set "train destination" signal and update cargo (so that it's exact), "leaving tick +1": unset all signals?siggboy wrote:The other signals should still be available during the tick when the "train-leaves" pulse is appearing. This is important if you want to pulse something out when the train leaves. If the signals are already cleared in that tick that would not be possible anymore.
Basically, "train-at-station" and "train-leaves" should both become zero in the same tick (and "train-leaves" becomes positive for exactly 1 tick before that; possibly carrying the station number as information where the train is headed, that would be perfect).
Yeah.. this isn't going to happen, besides the OPness, if there is more than one station named B i have no way of knowing where the train will go.siggboy wrote: Thinking about it, it could even be possible to also output a signal when a train is inbound to a station. So, for example, if the train leaves station A on it's way to station B, a "leave" signal would be generated at "A" with the destination, but also an "inbound" signal would be generated at "B" with the source. That's probably not possible if the train leaves on its own (timeout), but should at least be possible when SmartTrains itself triggers the departure.
Of course, this amounts to a kind of "wireless" communication between the stations, that could be considered OP or against the lore/spirit of the game. On the other hand, it could make some things possible without requiring to run wire between all stations, I don't know.
Most of this can be somehow simulated with circuits, but having it in the mod makes the implementations easier.
I have been playing too much Hearts of Iron IV.... because that is the first thing that came to my mind when I read that.Choumiko wrote: Prerelease probably in the next 3-5 hours, depending on how long Germany needs to beat Italy