Time Limited Function

Alikiwi

Apprentice Creator
This might be a curly one, and I know of only one working example that is so complicated and long winded I've always avoided it. In a session, what I'd like is an option to penalise a player for departing too soon. I've only seen this in some Healesville sessions, presumably made by Zec? Surely there is a simpler way, but I have not found it yet. There should be a rule that gives you the option to cause a penalty to apply or anything else, IF the train moves before the assigned period - 30 seconds, ten minutes or anything, where-as if it doesn't move until after the period set, then those penalties don't apply. Should be simple really, but clearly not.

Any bright spark out there have an idea that isn't so long winded that would work?
(The show will now resume normal transmission...)
 
Guess as suspected that's a no then.


I think the concept might be pretty straightforward. A rule to identify a train, then listen for messages from a trackmark just ahead of the train with a sniff. Then check the system time vs the criteria time in the rule. However, I shirk from writing user interfaces for rules with all the arcane nomenclature.
 
You'd think it wouldn't be too hard to make, and very useful. IE train stops at station and should be stationary for say 30 seconds. If it moves before then, then another set of rules kicks in. But with the existing system not having anything specific for that, only a very long winded complicated system can achieve it. Never mind...
 
It's really not that involved. If you've got my Avery-Drexel 1956 Hiawatha session you can see it there (the penalty is rarely seen because one seldom has a chance to get away from Avery OT.) The basic idea is straightforward:

Suppose the sched is for Train to depart Avery at 20:52,

Timecheck 20:52
...Set variable dpavery= 1

Wait on Train Stop at Avery
...Wait on Train Start from Avery
......Variable Check dpavery < 1
.........You have failed!
......Success, session continues

Of course this only works for human drivers.

:B~)
 
I'm sorry but that just isn't going to work. Sure, at the start you can be certain of the time, or even schedule it. But on a long route you can't know the exact time a train will arrive, so you can't program in a penalty for departing in less than (say) 30seconds. If the driver arrives early, I don't think he'll want to wait five minutes to ensure he departs at the right time, unless you are seeking a specific timetable. That may be true sometimes, but not always.
 
I'm sorry but that just isn't going to work. Sure, at the start you can be certain of the time, or even schedule it. But on a long route you can't know the exact time a train will arrive, so you can't program in a penalty for departing in less than (say) 30seconds. If the driver arrives early, I don't think he'll want to wait five minutes to ensure he departs at the right time, unless you are seeking a specific timetable. That may be true sometimes, but not always.

Real railroads can never be sure of OT arrivals and the rules specifically cover that so as to prevent collisions. If all you're doing is playing with trains, that's one thing. If you're trying to run a railroad you've got to follow the rule book. "You may arrive early, you may arrive late, you may arrive on time. You may leave on time, you may leave late, but you may NOT leave early!" according to my grandfather the conductor. (Extra trains, of course, come and go at the dispatcher's discretion.)

To provide a short station stop, just use the "Wait" command in your driver schedule. Or use the Wait rule, particularly if you expect the train to be late.

That can get a little more complex to program:

Say you have a mandatory 5-minute crew or loco change in Avery, with a departure time of 20:52:

Timecheck 20:47
...Variable Modify aravery = 1
Timecheck 20:52
...Variable Modify dpavery = 1

Wait on Train stop
at Avery
...Variable Check aravery > 0
......Wait 5 minutes
.........Say "All Aboard"
...Wait on train start.....as in the previous example.

Again, f you know in advance the train will be late you only need to provide the wait.

Now if you're trying to apply all this to an AI driver, that gets interesting. You'd use the Driver Schedule rule or the Copy Driver Schedule rule, most likely. You'd still need to establish whether the train arrived late using Timecheck.

:B~)
 
Not sure if that'll do it, but I've copied it down to investigate. (It is for the player, not AI) The wait command only allows for blowing the whistle 30 seconds (or whatever time period you like) after stopping, plus add a flag and anything else you want. It in itself can not tell that the player started before 30 seconds had expired, so yes, it gets complicated. I have another idea, but haven't had a chance to try it yet.
 
Back
Top