question about variational action 2

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

question about variational action 2

Post by hovering teacup »

is there someone who'd kindly explain to me how to define the cargo ID with it? the place that normally defines it is in this case occupied by the '81'.

thanks in advance
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

No, it's not. The 81 is where the <num-loadtypes> would be. The cargo ID is the byte before that.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

umm the Wiki omitted it...what a confusion in vain.
thanks again
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Whoops, sorry about that. I've added it now.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

i recycle this thread for a next question.

is there any way to override wagon's graphic according to that of the engine, not to the engine's ID ? thanks
broodje
Director
Director
Posts: 615
Joined: 13 Jul 2003 12:47
Location: Alphen aan den Rijn
Contact:

Post by broodje »

how do you mean that? when you change the engine graphics by date you want to have the cariage sprites with it? If you want that you should set the same livery change date for the cariages.
But I probebly totaly missunderstand what you want. But graphics are always linked to ID's not to sprite sets.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

i wanna introduce choice of livery for certain locomotives, using refit mechanism. for passenger locomos it's perfectly safe to have a nominal cargo capacity to activate the refitting if alternatives are limited to only two, attributed to the passenger and the mail respectively.
graphics are always linked to ID's not to sprite sets.

8o
broodje
Director
Director
Posts: 615
Joined: 13 Jul 2003 12:47
Location: Alphen aan den Rijn
Contact:

Post by broodje »

sory I wasnt clear :P, the wagon overide is linked to a certain ID, not to a sprite set id (hmm all those damn IDs :P)
You can change the sprites for engines when you to refit them It should work in the same way cars can be refited (as demonstrated in the dbxlset).
is there any way to override wagon's graphic according to that of the engine, not to the engine's ID ? thanks
hmm you mean if the engine caries mail and looks diferend you want the cars behind it look the same?something like:
If engine uses spritesetID X -> cars use spritesetID A
If engine uses spritesetID Y -> cars use spritesetID B
If so I don't think thats posible. Like I said the wagonoveride is done by wagonID not by spritesetID
example

Code: Select all

23 * 7	 03 00 01 0E 00 00 00
24 * 7   03 00 81 1B 00 01 00
here you can see it, the engine is ID 0E, the pasenger car is 1B, as you can see it is directed by the wagonID.
(sory I'm having dificulties trying to tell what I want :/)

Hope you understand what I said :P
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

no no, that smiley wanted to say "aaah my..". your words were perfectly clear. :)
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

You can make the wagon override be a variational action 2 that depends on the engine refit. As long as you use the same conditions for the engine and the wagon, you can change wagon graphics along with the engine.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

oh great!! could you give me "variables for vehicles" to use in this case? Wiki is silent here.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

hovering teacup wrote:Wiki is silent here.
Now it isn't.

You'll need to use an engine-variational action 2, i.e. type 82 not 81. If your .grf runs in more than one climate you also need to make climate checks because that cargo type is climate-dependent.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

thanks very much as always.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

when the game trys to show a sprite defined thus, it crashes. what's wrong with this? the cargo IDs 13 and 14 works without problem.

273 * 14 02 00 17 82 b9 00 ff 01 13 00 00 00 14 00
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Hmm, that looks right... maybe a bug in the code. May I see the crashlog?
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

here goes
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

OK, your action 2 was right but there was a stupid bug in the patch. This works except in the purchase screen, where it crashes instead...
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

alright i'll keep that part of the nfo.
User avatar
hovering teacup
Route Supervisor
Route Supervisor
Posts: 429
Joined: 03 Feb 2004 12:40

Post by hovering teacup »

ok a third question.

I want to have an engine that gives all the livery-overridden wagons an additional weight, a different loading speed, and a visual effect (sparks), but no power. is there a simpler way than to use the callback ? and if i am obliged to use callback, how to do it for the loading speed and additional weight ? wiki's explanation is far from clear.

thanks
broodje
Director
Director
Posts: 615
Joined: 13 Jul 2003 12:47
Location: Alphen aan den Rijn
Contact:

Post by broodje »

hmm yes okey, I'm answering from a place where I can't answer you (I should post this, but I have to entertain myself for 15 more minutes :P).
I Think you do have to use calbacks for that, at least for the loadingspeed, and especialy for the sparks. Maybe you can set poperty (and now I'm going wrong on the property numbers I cant acces the wiki, nor the newgrf.txt here) 1b and set 00 there (thus powered wagons, but the zero power) and then ad the weight in property 26. Both options should be set in the action 00 for the engine.
the calbacks are a bit more dificult, I can't tell you now, becouse I want acces to my own nfo files for that. So I might (if I got time ) answer it when I get home.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 18 guests