TrainsCaller deprecated

by Hermios

Allows trainstations to call trains when conditions are fulfilled

Content
5 years ago
0.14 - 0.18
15
Trains

i Playthrough question

6 years ago
(updated 6 years ago)

My setup goes like this :
All train stop that have the same functionality use a same name with no suffix.
Example: instead of Outpost Iron1, Outpost Iron2 etc, it will only use "Outpost Iron".
Same goes for unloader and supply/depot station (more on this later)

By default, all train stop will be disabled, the one that get enabled is the one that give order.
That way, the train that get order to depart will arrive at the correct station.
Even if during journey, another order is being given by to additional train, it will resolved itself due vanilla pathing (it will choose different station that were newly available)

The chain goes like this :
A (Supply)-B (Unload)-C (Outpost)

B & C is where i put order, a.k.a through red frame.
In the train itself will only have Train Stop A manually placed by me, since the other two schedule will be given by TrainCaller mod.
No wait condition is set in Train Stop A (at the moment, due testing).

But before i get into much deeper, i wanna ask basic question:
How do you prevent endless looping from station A (Supply) to C (Outpost)?

As sample, Three train were given SignalSender "N", as a way to tell this is a Nuclear Fuel Train.
Then TrainStop C with nuclear fuel will give an order to Train with signal N.

Problem is, after the train filled / full, after it goes back to Train Stop A, but since there's no demand from Train Stop B (Unload), it will depart again to Train Stop C because it's being called again, although the train is already full.
The other "N" signal train at A that were empty were never received the order.
It's always the same train, loop-de loop endlessly.

Now, although i can prevent the train to departing under certain condition (if full, signal goes red in front of that particular train in TrainStop A),
Problem is, there's no way for me to tell which train will get the order from mod, even if i knew, no way for me to switch the added schedule to the correct empty train.

If only there's a specialized signal to tell, only called an empty train.
So train C Red Frame can be provided with two signal, one being that "N" signal, the other is the specialized "Empty Cargo" signal.
Same goes for the unload, there are special signal, if provided will only call a full train.

Ok, maybe i'm using this mod wrongly, but i can't get it solved.

That's one problem, there are other problem that i will ask after you answer this.

6 years ago

hi
So, the basic question is not basic, I had the exact same issue, and created therefore (ok, not only for that!) the train automated controller TAC. This mod lets you control the behavior of a train based on signals. In my case, my train leaves train stop B only if train stop receives a specific signal. Then the TAC will work on it: As soon as a train has 2 stations in its schedule, the TAC sends the signal to say "You can leave this station".
For the second point, why don't you define for your trains that they have to be empty (or full) to leave a train station? Then, your outpost will only receive a train which is empty (or full)....

6 years ago
(updated 6 years ago)

Hmm,..not sure about this (need to use another mod to make the setup work).
No offense, but i just trying to keep it as simple as possible.
Besides, reporting a mod error is easier where the culprit really is if i'm only using one mod.

But based on that small screen cap in TAC, it seems that's the only thing i need ? Since it can read content (or the lack of content? No need for me to use SignalSender?

Regarding "define trains that they have to be empty (or full) to leave a train station"
Well, i can't do that, nor the need to do that does it?
The A (Supply) is staging station, it can contain either a full train or empty train, or even a partially filled (due the very last load from depleted outpost).
Then Train Caller is the one who handling whether it will load/unload based on inactivity.

Because it's a staging station that contain two types of train, i can't define either they must wait till full or wait till empty, since there's nothing to wait for.
It's just an empty station, a fixed waypoint whether they can go to B (unload) or C (outpost).

So, based on your suggestion, if i put schedule train in station A, it will be both "Leave when Empty OR Leave when Full", does that make it counter logic?
The condition will always true, so the train will still get called by C, even if they were full.
That's my reason why there's no need to use schedule at all in A.

I will test TAC, to see how it's working, although based on description, is kinda discouraging me, with regex and all.
I know it can be powerful tools, but i'm casual player.
Just like i said, trying to keep it as simple as i can.

To ask another question:
Let's assume i can solve the loop-de loop from A to C.
But I can foresee there will be problem down the line.
My outpost were disabled by default, only those that have reach certain threshold will get enabled.
When it reach that threshold, TrainCaller will call an empty train.

Problem is (or will be) when a train start to load the ore, the condition will become false due the item is below threshold.
Thus the TrainCaller will delete the schedule.
As result, the train will get departed with only a handful of Ore, probably just 2 seconds worth of ore.

So, i have to solve that issue, the TrainCaller must retain it's order/schedule even if the buffer chest were drop below threshold, wait till full, or detect inactivity somehow, then delete the schedule ?

I have so much headache thinking about this.😭

Perhaps in the end i will combine the functionality from your TrainCaller (to handle unload), but use another mod to handle outpost.

6 years ago

Hum
1. No way that I take offense, I kind of enjoy this discussion
2. I misunderstood your model. Then, yes, my suggestion was useless. Still, I don't understand the purpose of station A
3. For Tac, it is simpler as you think. Regex is only for modders who wish to work with it or the libraries. As an end user, you don't have to worrie about that. However, I have to admit that Tac is not simple as other mods, it requires configuration.
4. For your last problem, you need to build an hysteresis threshold. I do it by having two boxes and 2 unloaders, and one item in a box. Each unloader reacts on a threshold, to pass the item in the next box. For the train stop, it reacts on the item being in a box

6 years ago
(updated 6 years ago)

Station A purpose is just a waiting area, but it's a must have in my case.
Other wise it will be bottleneck the whole system.

Imagine this :
Let's say the oil production require crude oil 2000 /s, because i dislike putting pump every Nth pipe length (to keep the max fluid pressure to 1200/s), i just divide the unloader to 3-4 separate unloading,
That way i only need to keep the pressure at 600/s, no need to place pump for hundreds of pipes.

My total tally of all oil outpost is 3000/s
In theory, it should be enough.
However, every oil post is only generating 300-400/s oil, and it will goes down as time goes by.
On completely dry outpost, it's only generate just a fraction of that.

Which mean, when the train finished unloading, those outpost haven't ready yet to provide the fluid.
Train need to wait in someplace, waiting the outpost to be ready.
That is the purpose of train Stop A.

But having this mod in mind, i'm thinking the A functionality can be even set greater.
As i say earlier, there's no schedule in every train except to head for A, no waiting condition in the schedule, just a blank schedule.

Which mean, on extremity, it's doesn't necessarily need to even rename / specialized A to be :
"Supply Ore Iron", "Supply Crude Oil", or even as Supply "whatever intermediate product"
TrainCaller mod will just handling which train go to which station.

With that approach, this probably the greatest most dynamic system ever, or at the very least the most easiest one to setup.

But the problem that giving me headache is that TranCaller cannot recognize an empty train.
I don't get it how the mod logic work.
Mod can tell if a train have certain item, yet cannot tell if it has nothing ?

The setup will be much easier if it can tell if a train is empty or not.

Let's say the mod internally know if the train is empty, BUT also installed a set of "specialized" signal.
My horrible signal mockup :
https://imgur.com/WARvlNh
F= Full
E= Empty
P=Partial (less than full) -> i will use this one, since due inactivity, a train have a chance to loop back to A without fully emptying their content.

Then if user also giving the red frame a special signal, it will act based on those signal as well.
By default, if no special signal were given to red frame, the rules will still unchanged like current version.
So no need for migration if user updated the mod ( i think...or i hope so...i'm no coder)

Now, let's say i put Special P and "N", then the train who have virtual signal "N" AND partial empty will only be called.
Of course with this approach there's a possibility of user logic error.
Let's say a user put an order of a Special F (full), and calling it to an outpost.
Well, the full train still get called, but there will be nothing happening at an outpost, due they cannot unloaded anything.
Train will depart due inactivity.
So basically still vanilla behavior, this mod doesn't deal with that kind of user logic error.

What if the user only provide Special Signal and nothing else ?
Well i suggest nothing happening ? To make coding easier, i think, also i don't see a purpose of using just a special signal.

Anyway, that's my last bit of suggestion/question.

Ooh, before i forgot, because this mod cannot do queuing 😭, i kinda think a way to abuse it, hehehe....😂
So basically it goes like this :
I put the Requester/unloader train stop (B) in a row, right next after each other.

in ====B1=B2=B3==== out

All have the same name, and B2 and B3 is permanently disabled no matter what.
However it's also get the signal to red frame when B1 giving an order.
That way, 3 order were issued, 3 train departed, but they were tricked to unload in B1 instead?
Haven't test it, just an idea..😂

6 years ago

Hi
To understand the logic of the mod, focus on the concept of call : imagine you are at a desk, with customers waiting. You call a number and the person with this number will come to you. You don't look at anyone to check who they are, why they are here etc, only the one with the specific number.
I personally use special signals for my "trash train" :when an outpost needs to empty its trash, it will call this train using a specific signal.
For your train stop A, it may seem a little simplistic, but I would use a rail chain signal : the train won't depart if its target is not free

6 years ago
(updated 6 years ago)

Can't the mod tell when calling that person (i assume person= any train with equipment caller on it)..
But they answer, hey we've got nothing.
That "nothing" is an empty train ?
So we say, if you've got nothing, here's a treat (special signal) ,come to us.

Or i see other mod do it differently to tell the train content, or the lack of content .
The only caveat, the condition can only be "read" internally when the train is arrive at station. User don't need to connect manually "read train content" at all.

Although, that approach would be completely different than the way this mod work, since this mod didn't need for a train in train stop at all, even with zero schedule..

Currently i'm trying to setup so that A to B is handled by TrainCaller, while A to C is handled by Concurrent Train Restriction + Train Skip fulfilled station (same author).

I just wish it doesn't crash
(because if you remember my initial crash bug report is how this mod is not compatible with Train Skipped Fulfilled mod. )

5 years ago

Hi
Never too late to answer (hopefully!)
For this concept, I would definitely use the TAC combined with signal sender and TrainsCaller: TAC can provide a signal for your train, if this train is empty (or any other kind of condition). Then, TrainCaller can call this signal, and therefore this train... (3 months to just explain that... sorry!!!!)

New response