Selectable Load/Unload and auto-refit suggestions

Got an idea for a new feature in TTDPatch? Post it here.

Moderator: TTDPatch Moderators

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Selectable Load/Unload and auto-refit suggestions

Post 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 7537 times
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Auto-refit PBS bug?

Post 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
Attachments
AutoRefit_PBS_Bug.zip
That missing file
(221.37 KiB) Downloaded 182 times
Last edited by wallyweb on 24 Jan 2008 15:40, edited 1 time in total.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Auto-refit PBS bug?

Post 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?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Auto-refit PBS bug?

Post 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.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Selectable Load/Unload and auto-refit suggestions

Post 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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Selectable Load/Unload and auto-refit suggestions

Post 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.
Last edited by wallyweb on 26 Jan 2008 10:56, edited 1 time in total.
User avatar
The Irish
Tycoon
Tycoon
Posts: 2092
Joined: 14 Apr 2004 16:06
Location: Bonn, Germany
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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?
*** Ce French Train Set ***
*** Visit my transport related pictures on Flickr ***
ImageImageImageImageImage
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch
"A committee is a group of men who individually can do nothing but as a group decide that nothing can be done" (Fred Allen 1894-1956 US radio comic).
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Selectable Load/Unload and auto-refit suggestions

Post 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
Ex TTDPatch Coder
Patch Pack, Github
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Selectable Load/Unload and auto-refit suggestions

Post 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?
User avatar
The Irish
Tycoon
Tycoon
Posts: 2092
Joined: 14 Apr 2004 16:06
Location: Bonn, Germany
Contact:

Re: Selectable Load/Unload and auto-refit suggestions

Post 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
*** Ce French Train Set ***
*** Visit my transport related pictures on Flickr ***
ImageImageImageImageImage
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch
"A committee is a group of men who individually can do nothing but as a group decide that nothing can be done" (Fred Allen 1894-1956 US radio comic).
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Selectable Load/Unload and auto-refit suggestions

Post 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
Attachments
half-noloadunloadadvorder.patch
(10.06 KiB) Downloaded 173 times
Ex TTDPatch Coder
Patch Pack, Github
Post Reply

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 22 guests