Making a super-basic newGRF with one engine causes depot grid to disappear

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

Moderator: Graphics Moderators

Post Reply
Droideka30
Engineer
Engineer
Posts: 9
Joined: 04 Aug 2021 03:06

Making a super-basic newGRF with one engine causes depot grid to disappear

Post by Droideka30 »

In an attempt to solve the "disappearing depot grid lines" problem I noticed in HEQS and OpenGFX+ Trains, I decided to learn to code my own newGRF, hopefully ultimately making an add-on to HEQS that would not destroy the grid lines. But as soon as I followed through the tutorial to make a single locomotive, it seems that the vertical grid lines in train depots, which help indicate how many station tiles long a train is, are gone.

They're still there in a climate where the new loco is not available:
Image

But are missing in any climate where the new loco is available:
Image

Why do the vertical grid lines disappear, and how do I make them come back?
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Making a super-basic newGRF with one engine causes depot grid to disappear

Post by JGR »

Droideka30 wrote: 18 Aug 2021 18:09 In an attempt to solve the "disappearing depot grid lines" problem I noticed in HEQS and OpenGFX+ Trains, I decided to learn to code my own newGRF, hopefully ultimately making an add-on to HEQS that would not destroy the grid lines. But as soon as I followed through the tutorial to make a single locomotive, it seems that the vertical grid lines in train depots, which help indicate how many station tiles long a train is, are gone.

They're still there in a climate where the new loco is not available:
Image

But are missing in any climate where the new loco is available:
Image

Why do the vertical grid lines disappear, and how do I make them come back?
The grid lines are only shown if all available trains are full-length (i.e. 32px), as defined in bit 3 or NewGRF global variable 1E/9E.
See here: https://newgrf-specs.tt-wiki.net/wiki/GlobalVariables
Ex TTDPatch Coder
Patch Pack, Github
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Making a super-basic newGRF with one engine causes depot grid to disappear

Post by Eddi »

in case you're using NML, you should check if this line is in your NewGRF:

Code: Select all

train_width_32_px = 1;
if this is the case, then you need to replace all trains, as the default vehicle set does not have this bit set. (but almost all NewGRF vehicle sets do)

the grid lines are there if either all or none of the vehicles have this bit set, there can't be a mix.
Droideka30
Engineer
Engineer
Posts: 9
Joined: 04 Aug 2021 03:06

Re: Making a super-basic newGRF with one engine causes depot grid to disappear

Post by Droideka30 »

Thanks, that worked!
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 6 guests