2.0.1 alpha / 2.5 beta discussion

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

OzTransLtd wrote:Minor flaw with refitting capacity callback (15), been around for quite some time. I can live with it, but it may be worth investigating it.

When refitting from one cargo type to another, where the amount of cargo is the same but the weight of one unit of cargo is different, refitting fails to set amount/weight correctly.
Without using callback 15, it is certainly the case that goods, mail, valuables and passengers will have different quantities when refitting, as it has always been. But I have no problems using the callback to set the same cargo amount for every cargo, so I don't understand what the problem is...
Attachments
cap.png
cap.png (6.03 KiB) Viewed 2704 times
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

callback returns :

- 30 (t of food)
- 30 (crates of goods)
- 31 (t of food)

it just seems to ignore the request if the from-amount and the to-amount are the same, but it refits to the other cargo alright. This is only a problem with different weightings, such as 1 crate of goods = 0.5 t and 1 t of food being 1 t.

See below, I return 25 each for goods and food when refitting; but check what I get as result going from 25 t of food to 25 crates of goods; I get the weight equivalent of food and not the item equivalent. But, if were to request, say 30 crates of goods, all would be fine.

That's the code to go with it ...

Code: Select all

 4760 * 9      02 00 1F 01 01 00 00 00 00
 4761 * 14     02 00 DF 81 0C 00 FF 01 19 FF 15 15 57 00
 4762 * 14     02 00 EF 81 0C 00 FF 01 B1 FF 23 23 1F 00
 4763 * 10     03 00 01 64 01 FF EF 00 DF 00
This one is a simply example, normally I have more cargos to refit, so I cannot just ignore CB 15.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Which set is this? The canset 0.1g doesn't use the refit callback for the reefer, and the usset returns 45 goods/30 food, both of which work fine.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

This is the new CanSet v0.2a - not out yet ! No, in v0.1g, I did not use CB 15 when all amounts were the same - my thinking was why change to the same amount - but when I got only 12 t of food refitting from 25 crates of goods I started to use CB 15, but there is still a problem.

If you want to see it, use CanSet v0.1g and newcargow.grf in temperate climate and use the narrow gauge reefer and you'll see what I mean. Refit the goods 25 crates to food and you will get 12 t, the weight equivalent of goods; but I do want to get 25 t of food.

EDIT: the US set uses different amounts 45 vs 30, and that works alright.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Well, email me the grf file to test this if you don't want to attach it here, but I think it's more likely that the callback doesn't return what you think it returns. But to check out what happens exactly I need to see it in action :)
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Silly question, but I assume you have bit 3 set in action 0 property 1E for the reefer? Otherwise the callback won't work.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

PikkaBird wrote:Silly question, but I assume you have bit 3 set in action 0 property 1E for the reefer? Otherwise the callback won't work.
Not a silly question at all. That was my blunder. In my system, that bit gets set automatically, if any capacity amount and/or any weight of the cargos in question is different; but the latter check was not carried out properly. Therefore, CB 15 did not get called in that particular case. I'm sorry about all that. Of course, it works. Thanks anyway, although it was all my fault.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

No problem, just glad you got it worked out. :)
Flamelord
Chief Executive
Chief Executive
Posts: 731
Joined: 24 Mar 2005 22:29
Location: Oregon

Post by Flamelord »

If you use the right-click-on-the-eye-icon locomotive following feature, and then left-click on the eye icon of another locomotive to look at it, when you right-click on the map, it will jump back to the locomotive you were following. I'm not sure if this has been mentioned already, but I thought I'd post it here. Do you need my config to reproduce this?
Additional Livery Set
Official TT-Jewel Staite FanClub
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

PikkaBird wrote:No problem, just glad you got it worked out. :)
Thanks anyway for all the help.

But here, I do have a real little bug or two ...

... with a66 and the 2 extra lines in the vehicle information detail window. The window is longer by 2 lines, but when the text should flow on to the 2 extra lines, it gets trimmed to the original space available.

And another thing; there was once talk about games not being saved. There is no problem with that; up to 100 games are saved into the one directory. After that you get the 'Game Save Failed' message, so far so good. But when it comes to reloading them; only about the 63 oldest saved games are shown in the 'Load Game' window. That could of course give the impression, they were not saved initially; but after deleting some old ones, they will show up.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

OzTransLtd wrote:The window is longer by 2 lines, but when the text should flow on to the 2 extra lines, it gets trimmed to the original space available.
Use character 0D to line-break in the appropriate places?
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

PikkaBird wrote:Use character 0D to line-break in the appropriate places?
I do use that, although not with the ones I do have problems with - could give it a try. Normally, if a line is too long, it breaks automatically.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Question about Callback 18 (AI management)

Where does the default xx xx need to point to; or is action 3 when executed always in callback mode ? What about other generic callbacks, the ones I don't bother about ?

Code: Select all

02 00 AF 81 0C 00 FF 01 AE 00 18 18 xx xx
03 00 00 00 AF 00
... is there more info available on this subject, that is other than found in the callbacks section in the Wiki? ... and no a search revealed nothing.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

OzTransLtd wrote:Where does the default xx xx need to point to?
A cargo ID that points to graphics. (Or a -1*4 01 xx 01 00 / -1*9 02 xx ID 01 01 00 00 00 00 pair)
OzTransLtd wrote:or is action 3 when executed always in callback mode?
Yes, but you need to return graphics to fail any generic callbacks for which you don't provide results, including any new callbacks that may be introduced after you write your GRF file.
OzTransLtd wrote:... is there more info available on this subject, that is other than found in the callbacks section in the Wiki?
Nope. Should there be?
In the absence ofspecial information, I just assume that a generic callback is just like any other callback, and should be treated just like any other callback.
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
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

DaleStan wrote:A cargo ID that points to graphics. (Or a -1*4 01 xx 01 00 / -1*9 02 xx ID 01 01 00 00 00 00 pair)
Many thanks, that answers my question.

About more information -

The following from the Wiki could mean anything from what wagon number to how many wagons the AI intends or has already bought. How long the train is going to be would be nice to know, so that we could give a hint what engine would be appropriate.

Code: Select all

87 B Construction number; for wagons: number of wagon; for stations 0=source station, 1=destination station 
What about this one - at what stage does the following contain meaningful information

Code: Select all

82 B default selection 
I would like to know a bit more what is going on behind the scene when callback 18 is called. Further, knowing how the various variables relate to the various construction events would be helpful.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

OzTransLtd wrote:The following from the Wiki could mean anything from what wagon number to how many wagons the AI intends or has already bought. How long the train is going to be would be nice to know, so that we could give a hint what engine would be appropriate.

Code: Select all

87 B Construction number; for wagons: number of wagon; for stations 0=source station, 1=destination station 
It's the number of the wagon being bought. How long the train will be is non-trivial to calculate, especially with Lakie's fixes for shorter wagons, but the station length (in var 88) can be a useful proxy.
What about this one - at what stage does the following contain meaningful information

Code: Select all

82 B default selection 
It always contains the number of the "thing" the AI will buy/build if the callback fails, or if it didn't exist. So returning what's in there is the same as failling the callback. For the "Check" type of callback events it's not so useful, but for the "Get" types it contains for example the vehicle ID of the wagon the AI would buy by default.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Thanks, that makes things a bit easier to understand. But I must say the AI is a quick learner, when I give him a few hints. Although I still have a lot of problems with cargos (new cargo feature turned off), which do not exist in all climates, like iron ore, paper, food etc. E.g. AI builds narrow gauge track, but then refuses to buy narrow gauge ore wagon, if told to do so; buys several vehid 00h (happens to be a standard gauge steam engine) instead, then buys NG loco (if it still has enough funds) and leaves the depot without any wagons to go loading the train. Result : goes bankrupt very quickly. Otherwise, there are no problems with any other cargo types. Anyway, once I have sorted out all other things, I'll be back on that subject.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Re: Crash in alpha 66

Post by Patchman »

George wrote:Trying to build a new vehicle crashes the game.
If all the ECS files except town vector are removed from newgrf.cfg, the game is crashed while landscape generation
Hmm, I'm afraid I can't reproduce it, even with the exact .grf files and .cfg files. I can buy all kinds of vehicles without a problem. Is the problem with a specific one maybe?

However, I don't have ttd-rusw.grf. What is that file?
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Question - when are sub text strings (\81 tt tt imbedded in text strings) resolved :

a) when main text string is loaded, at activation
b) when main textstring is called upon

Code: Select all

... 20 63 72 61 74 65 73 29 [81 01 D3] 00
                             ^^^^^^^^ 
Suggestion, there is so much interference from other .grf's, would it be possible, for vehicle action-00 properties to be initialised to defaults, just as house/industry properties can be, so that undefined properties do not take on values from other .grf's. i.e action-00 prop-xx set to 01=engine. or prop-xx = 02=wagon.

e.g. I define a new wagon, but I do not define engine properties, they could potentially become an engine; or

if I do not define the 'early retirement' feature, it would flow through from another .grf, if in that .grf that feature has been defined, for same ID, of course.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

OzTransLtd wrote:Question - when are sub text strings (\81 tt tt imbedded in text strings) resolved :

a) when main text string is loaded, at activation
b) when main textstring is called upon
b) when it's printed on the screen
Suggestion, there is so much interference from other .grf's, would it be possible, for vehicle action-00 properties to be initialised to defaults
Possible, but non-trivial. I wanted to implement this as a regular action 0 with nprops=0 to reset the given vehicle(s), but haven't had the time to work on it yet. The problem is that many of the properties have non-trivial initialization values.

For now, the safest thing to do is just always initialize all properties, I guess, even if you're just setting them to the default value.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 21 guests