Oops, sorry forgot about GRFMaker. I can't help, but it looks like Andersl has a solution?Cudar wrote:I code my trucks with GRFMaker.
cheers,
Andy
Moderator: Graphics Moderators
Oops, sorry forgot about GRFMaker. I can't help, but it looks like Andersl has a solution?Cudar wrote:I code my trucks with GRFMaker.
OK, that's more than I know - I've only done articulated engines completely without cargo capacity. It might be a question of callbacks, something I have studied very little so far. I have also only tested my code in TTDPatch, so there might be some difference in OTTD.Cudar wrote:The problem is that there is capacity in the trailer, that must be visible (wood and steel), and can't be coded in the first part of the truck, like at the box van.
It is a question of varaction 2 to setup the vehicle menu sprite (although you don't need a callback for it). I use this code (from DJ Nekkid). Can grfmaker apply varaction 2?AndersI wrote:[It might be a question of callbacks, something I have studied very little so far. I have also only tested my code in TTDPatch, so there might be some difference in OTTD.
Code: Select all
-1 * 14 02 01 B2 // provide correct refit/capacity information in buy menu (credits to DJ Nekkid for solution)
82 40 10 FF // check vehicle length
01 // check one range
F1 00 00 00 // if length is 0 use purchase menu sprite
A1 00 //
I assume you already know about callback 16 (articulated parts). Likely your current action3 of the front part distinguishes between cargo 0xFF (purchase list) and the default case.Cudar wrote:I don't know, I tried to copy your R steamer, but it still not works. The trailer doesn't need an assign block? Because it works only if my make that assign block, but still with that error massage.The problem is that there is capacity in the trailer, that must be visible (wood and steel), and can't be coded in the first part of the truck, like at the box van. If I make any type of vehicle list sprite block (classic or normal sprite block made as vehicle list block) this massage appeares at these trucks.
(assuming you've seen DJ Nekkid's solution - code above)...in that case is DJ's code for checking vehicle length actually necessary? Or can I just run cargo FF through the same action 2 chain as the other cargos?frosch wrote:In the easiest case [1] you only need to check the callback id in the purchase-list chain and then link to the same action2 chain which also handles cb 16 for the non-puchase-list case.
Yes and no. CB 16 does get called in the purchase list, but you didn't supply a handler for it, so Open falls back to the Action 0 settings.Cudar wrote:It's true, the problem is that in the buy list the callback 16 doesn't work.
Now, my question is about this, that how I can use this code (if it would help for me). Can I include this code in GRFMaker, in a manual NFO block? I copied the code, but it says, that incorrect hexadecimal code is given. If you tell me, which code means what, I would try to do something with it. Or it's too complicated?andythenorth wrote:It is a question of varaction 2 to setup the vehicle menu sprite (although you don't need a callback for it). I use this code (from DJ Nekkid). Can grfmaker apply varaction 2?AndersI wrote:[It might be a question of callbacks, something I have studied very little so far. I have also only tested my code in TTDPatch, so there might be some difference in OTTD.
Code: Select all
-1 * 14 02 01 B2 // provide correct refit/capacity information in buy menu (credits to DJ Nekkid for solution) 82 40 10 FF // check vehicle length 01 // check one range F1 00 00 00 // if length is 0 use purchase menu sprite A1 00 //
Interesting. This code was given to me by DJ Nekkid. It prevents OpenTTD showing the error message "vehicle's capacity differs from refitted capacity" for articulated road vehicles. I've been using it in HEQS and it does appear to work when used as a varaction 2 for for the default cargo on the lead vehicle. However cargotype 0xFF *must be removed* from the action 3 for the vehicle or the code will fail. (I imagine that if cargotype 0xFF used the varaction 2 above it would actually work fine, but I haven't tested).frosch wrote:But the code you posted looks wrong.
I tried some hideous code for this last year and it was incredibly painful and didn't work. For HEQS I have an alternative solution, which is use simply define more trailer vehicles each with own action 0 / action 3. Each trailer has a different capacities, but shares the same action 2 chain and real sprites.However, generally try to not make capacity of articulated parts depend on the front vehicle if possible.
Yes, but this is the far future yet. Now I concentrate on the Road Vehicles in Romania.I just can`t wait to see how you will draw holes in the asphalt and make vehicles avoid them
Users browsing this forum: Bing [Bot] and 73 guests