NML livery_override and extra_power_per_wagon ?

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
peignenappe
Engineer
Engineer
Posts: 9
Joined: 15 Jul 2022 19:59
Location: France

NML livery_override and extra_power_per_wagon ?

Post by peignenappe »

Hi ! I'm currently working with nml in order to create my own train set.Thats really nice and all, until it comes to MUs :mrgreen:

So i made a dual headed engine and a custom passenger car, and now I'm struggling with a powered wagon for that obviously should add extra power to the train but i can't figure out how extra_weight_per_wagon property works .. i tried to put the livery override in the engine item, in the carriage item, adding visual_effects_and_powered to wagon maybe lol, i don't know i spent like 2 hours trying various things, none of them worked.

I refer generally this page of the tt-wiki to fix most of my issues but i really wasn't able to find anything about that livery_override (except for graphics purposes).
I've also read the entire topic about 2cc trains which contains one of these powered wagon, it didn't help. I tried to look at the sources but as the devzone.openttdcoop repository isn't available anymore, it didn't help either.

Please, anyone can tell me more about this ? :bow:
Image
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: NML livery_override and extra_power_per_wagon ?

Post by PikkaBird »

All of the extra weight and power properties belong to the locomotive, and it adds weight and power based on how many wagons in the consist have override graphics. So first step is to make sure the override is working, and then add the properties to the locomotive.

This is an old and, IMO, not very intuitive mechanic. Using callbacks to change the properties is more flexible.
User avatar
peignenappe
Engineer
Engineer
Posts: 9
Joined: 15 Jul 2022 19:59
Location: France

Re: NML livery_override and extra_power_per_wagon ?

Post by peignenappe »

Dayummm ! Thanks a lot , the 2 following lines added to my engine item made it work :

Code: Select all

// THE GOOD WAY
livery_override(ee300_car) {
	default: ee300_car_spritegroup;
}
i thought it was meant to use maybe like :

Code: Select all

// THE WRONG WAY
livery_override(ee300_car) {
	power: 1000 kW;
}
Noice, I can now have a powered and a non-powered version of the wagon. Thanks again :D

What i wanted to do in a first place was a wagon that automatically "turns powered" when a certain number of wagons are added.
In the same way that my graphics are changing on the fourth wagon only if there is more than 6 wagons in the train :
ezgif-1-cd30f3670e.gif
ezgif-1-cd30f3670e.gif (2.3 MiB) Viewed 982 times
I understand that its not possible to add power to the wagon, so my next question is : Is there a way to access the number of wagons of a certain type in the callbacks of the train ?
Last edited by peignenappe on 18 Jul 2022 02:33, edited 2 times in total.
Image
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: NML livery_override and extra_power_per_wagon ?

Post by Eddi »

this is just a personal preference, but i would avoid all this and make MUs with articulated vehicles instead of powered wagons

neither approach is perfect.
User avatar
peignenappe
Engineer
Engineer
Posts: 9
Joined: 15 Jul 2022 19:59
Location: France

Re: NML livery_override and extra_power_per_wagon ?

Post by peignenappe »

Eddi wrote: 18 Jul 2022 02:36 this is just a personal preference, but i would avoid all this and make MUs with articulated vehicles instead of powered wagons

neither approach is perfect.
Thanks for your answer dude !

That's the first thing i've tried as i started learning nml with the articulated train tutorial on tt-wiki :mrgreen: But i wanted to go with dual headed engine feature as it provides more flexibility in trains length and i dont really like the idea of refitting a vehicle to change its length :?

Why would you avoid these ? If i go with articulated trains, should i better make them a fixed length (multiple version of different length if needed) or use that length refit mechanic ?
Image
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: NML livery_override and extra_power_per_wagon ?

Post by Eddi »

a drawback of the powered wagon approach is that it may be difficult to explain to the player which exact wagon type needs to be put in there. also, the purchase costs are usually way off.

a drawback of the length refit is that you can't really add vehicles during refit, so you got all this crazy logic to hide the extra vehicles somewhere inbetween, by shortening them and making them invisible.

a drawback of the individual lengths is that you get a very lengthy purchase list.


like i said, neither approach is perfect.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: NML livery_override and extra_power_per_wagon ?

Post by PikkaBird »

peignenappe wrote: 18 Jul 2022 00:44 I understand that its not possible to add power to the wagon, so my next question is : Is there a way to access the number of wagons of a certain type in the callbacks of the train ?
Yes, there is a count_veh_id variable.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests