What are sprite_layout blocks?

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

Moderator: Graphics Moderators

Post Reply
User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 424
Joined: 25 May 2015 09:09
Location: The Netherlands

What are sprite_layout blocks?

Post by Erato » 12 Jul 2019 10:48

Hey!

I'm trying to make a small industry set, and I'm looking at the source code of other industry sets made in NML, and I repeatedly see a sprite_layout block like so:

Code: Select all

SPRITE_LAYOUT(LAYOUT_IND_ELEC_1, SPRITESET_IND_ELEC_1, 60)
I can't find a reference to this in the NML documentation, and have no idea what the number means or how you should set it.
Could anyone explain to me what it does?

Thanks in advance!
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

User avatar
Andrew350
Route Supervisor
Route Supervisor
Posts: 491
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: What are sprite_layout blocks?

Post by Andrew350 » 12 Jul 2019 13:54

This page should explain things: https://newgrf-specs.tt-wiki.net/wiki/NML:Spritelayout

Basically it defines the actual layout of the industry and its how industries tell which sprites go where. The code you have there looks like its from a set using some pre-defined stuff that is probably useless for your project (unless you copy all of it).

That code block is also likely what's causing the error in your other thread, since it isn't formatted the way nmlc expects (no {} brackets)

Hope this helps :)

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 424
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: What are sprite_layout blocks?

Post by Erato » 12 Jul 2019 14:42

Andrew350 wrote:
12 Jul 2019 13:54
This page should explain things: https://newgrf-specs.tt-wiki.net/wiki/NML:Spritelayout

Basically it defines the actual layout of the industry and its how industries tell which sprites go where. The code you have there looks like its from a set using some pre-defined stuff that is probably useless for your project (unless you copy all of it).

That code block is also likely what's causing the error in your other thread, since it isn't formatted the way nmlc expects (no {} brackets)

Hope this helps :)
Thanks! This fixed it!
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest