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...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.
2.0.1 alpha / 2.5 beta discussion
Moderator: TTDPatch Moderators
- Attachments
-
- cap.png (6.03 KiB) Viewed 3351 times
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 ...
This one is a simply example, normally I have more cargos to refit, so I cannot just ignore CB 15.
- 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 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.
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.
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.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.
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?
Thanks anyway for all the help.PikkaBird wrote:No problem, just glad you got it worked out.
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.
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 ?
... 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.
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
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:Where does the default xx xx need to point to?
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:or is action 3 when executed always in callback mode?
Nope. Should there be?OzTransLtd wrote:... is there more info available on this subject, that is other than found in the callbacks section in the Wiki?
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Many thanks, that answers my question.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)
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
Code: Select all
82 B default selection
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.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 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.What about this one - at what stage does the following contain meaningful information
Code: Select all
82 B default selection
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.
Re: Crash in alpha 66
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?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
However, I don't have ttd-rusw.grf. What is that file?
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
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.
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
^^^^^^^^
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.
b) when it's printed on the screenOzTransLtd 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
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.Suggestion, there is so much interference from other .grf's, would it be possible, for vehicle action-00 properties to be initialised to defaults
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.
Who is online
Users browsing this forum: No registered users and 13 guests