Page 2 of 4

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 14 Jan 2008 16:04
by DaleStan
It wasn't until I started playing with aircraft that I realized FindNearestTrainDepot probably wasn't going to work properly. I spent about a minute trying to fix it, I think. Then I realized that I couldn't figure out how it was useful, and stopped trying.

I did tag them as "FIXME", but I dunno if it's worth fixing.

I didn't really mind this bughunting session. New features are worth a little bughunting. And I was up to my elbows in most of that code anyway, trying to get refit orders to work.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 16 Jan 2008 21:46
by wallyweb
DaleStan wrote:
wallyweb wrote:Stay tuned for screamies or screenies. :mrgreen:
I'm seeing neither. Is this a good thing or a bad thing? :p
Downgraded to bad thing.
We have a screamie Houston!

The Climate is Arctic with default industries (no sets, no mods) and with native support for paper.
The train is Canadian Set v0.2i with default parameter 0 - no special industry support.
ttdpatch is r1812.

Proverbial "thousand words" attached below:
No paper here
No paper here
No_Paper.png (90.59 KiB) Viewed 7779 times

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 17 Jan 2008 04:04
by DaleStan
But... But... It works in temperate. </whine>

The nightlies will be fixed in an hour. They're not any better as I type this, though.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 17 Jan 2008 11:04
by wallyweb
DaleStan wrote:The nightlies will be fixed in an hour. They're not any better as I type this, though.
Fixed in r1815 - Status - Upgrade to good :D
Back to building a cute little screenie suitable for demo purposes and whatever ails you.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 18 Jan 2008 08:47
by michael blunck
Very nice, Dale. Just one minor suggestion: would it be possible to have the loading state operators "<" and ">" in addition (or instead of "is not")? ATM, I see the only real use for "is not" being "is not 100%". "<" and ">" would be more flexible, IMO.

Nevertheless, it´s very nice as it is.

regards
Michael

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 18 Jan 2008 17:18
by DaleStan
michael blunck wrote:would it be possible to have the loading state operators "<" and ">" in addition (or instead of "is not")?
Quite possible. In fact, JGR added them when he added the rest of that order. In r1799.

Auto-refit PBS bug?

Posted: 24 Jan 2008 13:24
by wallyweb
Downgraded to bad thing.
We have another screamie Houston!

With AutoReplace on, a train that is due for replacement goes to the next scheduled depot and the engine gets replaced with an upgrade.
If there is a concurrent AutoRefit order, the train gets the upgrade, exits the depot, goes somewhere to turn around, returns to the depot and gets the refit. A bit convoluted but manageable.
If that depot opens into a PBS signal or a block ending with a PBS signal, the train becomes very shy after the upgrade and refuses to come out of the depot after the upgrade.

The attached zip contains:
- newgrf.cfg
- ttdpatch.cfg (r1818)
- TRP02.SV1 - Save game with Pre-signals
- TRP02.SV1 - Save game with PBS signals

Re: Auto-refit PBS bug?

Posted: 24 Jan 2008 15:21
by DaleStan
wallyweb wrote:The attached zip contains:
No, it doesn't. Or maybe the verb I want there is "isn't". In any case, I don't see it/them.

Also, autoreplace or autorenew?

Re: Auto-refit PBS bug?

Posted: 24 Jan 2008 15:44
by wallyweb
DaleStan wrote:No, it doesn't. Or maybe the verb I want there is "isn't". In any case, I don't see it/them.
Do you mean the one that's up there now? :oops:
/me makes a mental note... PHPBB3 does not support astral projection.
Also, autoreplace or autorenew?
Both.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 24 Jan 2008 22:40
by DaleStan
That seems to be a bug in autoreplace/autorenew/gotodepot.

The train enters the depot, and gets replaced, then the new train leaves, with the exact same state. Without updating, checking, or processing the orders.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 24 Jan 2008 23:17
by wallyweb
DaleStan wrote:That seems to be a bug in autoreplace/autorenew/gotodepot.

The train enters the depot, and gets replaced, then the new train leaves, with the exact same state. Without updating, checking, or processing the orders.
By updating, I assume you mean the refit order. What I find strange is that (without PBS) the train is able to leave the depot without the process jumping to the next order, which in this case would be the refit, yet, without a refit order, the train's order list does jump to the next destination after the autoreplace/autorenew

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 24 Jan 2008 23:29
by DaleStan
No, by updating, I mean the goto depot order. The train fails to realize that it went to a depot. If you remove the refit order, the train will still wander off in some random direction and come back to the depot.

With PBS, the train can't find a route back to the depot, so it won't enter the junction at all. Without PBS, the train still can't find a route, but it doesn't care, and makes a blind stab and ends up wandering off somewhere.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 24 Jan 2008 23:45
by wallyweb
DaleStan wrote:If you remove the refit order, the train will still wander off in some random direction and come back to the depot.
Wait a minute. If I make up an order list to include a service at depot order, and it comes up when the train is getting old, the train does get replaced/renewed and then it continues on to its next order. The problem only arises if there is a refit order after the service at depot order.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 25 Jan 2008 00:20
by DaleStan
wallyweb wrote:
DaleStan wrote:If you remove the refit order, the train will still wander off in some random direction and come back to the depot.
Wait a minute. If I make up an order list to include a service at depot order, and it comes up when the train is getting old, the train does get replaced/renewed and then it continues on to its next order. The problem only arises if there is a refit order after the service at depot order.
Not so. I removed the refit orders from train 2, in the non-PBS version, and watched it go to the depot, get replaced, and proceed to wander until it managed to return to the depot.
Service at depot works, as far as I can tell, but Goto depot does not, with or without a trailing refit order.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 25 Jan 2008 00:45
by wallyweb
DaleStan wrote:Service at depot works, as far as I can tell, but Goto depot does not, with or without a trailing refit order.
How long have we had Goto depot without anybody noticing this? I must plead somewhat guilty as I always use Service at Depot. Wait! Goto depot gets a "Stopped" doesn't it? So when the player's work is done, clearing the "Stopped" brings up the next order.
*EDIT* My bad! :oops: A Goto depot order does not get a "stopped". This only happens if the depot icon in the train window is used.

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 26 Jan 2008 08:59
by The Irish
Hey there.

As we have these wonderful options of advanced orders, would it be possible to implement two additional things:

"no load" option: basically an option to tell a train to go to a station, cash in whatever cargo he can deliver, but then, not loading an cargo at this station, even, if the cargo he transports would be available.

and

"no unload" option: With this, you could tell a train to stop at a station, but not to unload any of his cargo, only to load additional ones. This would be particular handy on suburban trains that you want to feed into a central station.

Watcha think?

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 26 Jan 2008 09:25
by JGR
I daresay that I could implement both of those, however as I am going to be away in the UK from this afternoon until Tuesday, I would only attempt/examine the possibility of that next week or probably more likely next weekend.
It shouldn't be too difficult to implement though.

JGR

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 26 Jan 2008 09:46
by wallyweb
The Irish wrote:Hey there. ... "no load" option ... "no unload" option ...
Both excellent ideas. I would like to suggest a variation on these.
unload n% of [cargo]
load n% of [cargo]

Re my problem posts above, seeing as DaleStan believes the problem to be with the "Goto depot" order, should I continue that discussion here or give it a life of its own in another topic?

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 26 Jan 2008 18:12
by The Irish
JGR wrote:I daresay that I could implement both of those, however as I am going to be away in the UK from this afternoon until Tuesday, I would only attempt/examine the possibility of that next week or probably more likely next weekend.
It shouldn't be too difficult to implement though.

JGR
These are wonderful news. Thanks A LOT. :D

Re: Selectable Load/Unload and auto-refit suggestions

Posted: 03 Feb 2008 20:58
by JGR
I am having some problems getting this to work.

Loading the order in to veh.currorder fails in gotodepot.asm:newordertarget, as the code somehow later calls the function again with the second word thus overwriting the go to station order with junk, and causing it to balk and load the next order.
I've been spending too long with the debugger and I need to get some actual work done before tomorrow and in the subsequent days :)

I will post the patch as it stands, as I may have to drop this for a while, and fresher eyes may spot my error(s).
Note I haven't tested the actual load/unload prevention code yet, due to the above bug, and I know that this won't work at all on aircraft.

JGR