Page 1 of 1

What are sprite_layout blocks?

Posted: 12 Jul 2019 10:48
by Erato
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!

Re: What are sprite_layout blocks?

Posted: 12 Jul 2019 13:54
by Andrew350
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 :)

Re: What are sprite_layout blocks?

Posted: 12 Jul 2019 14:42
by Erato
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!