How to make a NewGRF properly ?
Moderator: Graphics Moderators
Re: How to make a NewGRF properly ?
Please post your nml code, s people can point out your errors instead of having to dig in nmlc compiler sources
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: How to make a NewGRF properly ?
Hey,
How do i make cars change liveries if they are attached to a certains locomotive in NML ?
To explain, i want to do the same thing as the Generic MU cars go in 2cc TrainsInNML.
How do i make cars change liveries if they are attached to a certains locomotive in NML ?
To explain, i want to do the same thing as the Generic MU cars go in 2cc TrainsInNML.
Re: How to make a NewGRF properly ?
Livery override. It works in a similar way to the graphics block, but you need to define the carriage that is accepted and changed when coupled (by number or vehicle ID)
Re: How to make a NewGRF properly ?
How do i insert it as NML code ?Gwyd wrote:Livery override. It works in a similar way to the graphics block, but you need to define the carriage that is accepted and changed when coupled (by number or vehicle ID)
Re: How to make a NewGRF properly ?
Livery override is solved, now i just need to know about this error :
I attached everything if anyone wants to point out my errors.
Code: Select all
[Knmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: v6379:afad0c76c40b from 2017-06-19
Error: (ValueError) "Unknown format code 'r' for object of type 'str'".
Command: ['nmlc', '-c', '--grf', 'randstadrail.grf', 'randstadrail.nml']
Location: File "nml\grfstrings.py", line 971, in handle_grflangid
- Attachments
-
- randstadrail.rar
- (3.87 MiB) Downloaded 64 times
Re: How to make a NewGRF properly ?
So no one wants to look into my code ?acs121 wrote:Livery override is solved, now i just need to know about this error :I attached everything if anyone wants to point out my errors.Code: Select all
[Knmlc ERROR: nmlc: An internal error has occurred: nmlc-version: v6379:afad0c76c40b from 2017-06-19 Error: (ValueError) "Unknown format code 'r' for object of type 'str'". Command: ['nmlc', '-c', '--grf', 'randstadrail.grf', 'randstadrail.nml'] Location: File "nml\grfstrings.py", line 971, in handle_grflangid
Re: How to make a NewGRF properly ?
I fixed nmlc, and now it says
Not sure why you add a colon to a number
Code: Select all
nmlc ERROR: "lang/english.lng", line 1: Invalid grflangid '0x01 :'
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: How to make a NewGRF properly ?
Okay, thanks. Now it works with this part. Now it's telling me :Alberth wrote:I fixed nmlc, and now it saysNot sure why you add a colon to a numberCode: Select all
nmlc ERROR: "lang/english.lng", line 1: Invalid grflangid '0x01 :'
Code: Select all
[Knmlc ERROR: "randstadrail.nml", line 84: Syntax error, unexpected token ":"
Re: How to make a NewGRF properly ?
It means "I found a ':' and I have run out of ideas what you're trying to tell me."
In other words, the computer needs better directions from you. Computers are very fast but also very stupid. You cannot make typos, or add or omit random symbols, they immediately get stuck.
The ':' is the point where it gave up all hope of understanding you, often the real cause is a bit before that point.
Carefully check the line, and the line above! Verify that what you are trying to do is allowed at this point. Verify that you closed enough parentheses and square or curly brackets on the construct above.
Oh, and by "carefully", I mean very very very very carefully, not just glance over it, scrutinize each letter, digit, and symbol. Computers are fast but very stupid!
In other words, the computer needs better directions from you. Computers are very fast but also very stupid. You cannot make typos, or add or omit random symbols, they immediately get stuck.
The ':' is the point where it gave up all hope of understanding you, often the real cause is a bit before that point.
Carefully check the line, and the line above! Verify that what you are trying to do is allowed at this point. Verify that you closed enough parentheses and square or curly brackets on the construct above.
Oh, and by "carefully", I mean very very very very carefully, not just glance over it, scrutinize each letter, digit, and symbol. Computers are fast but very stupid!
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: How to make a NewGRF properly ?
Okay i found the error and now it finally is working. Now it's telling me the sprites i've attached below don't have a palette :Alberth wrote:It means "I found a ':' and I have run out of ideas what you're trying to tell me."
In other words, the computer needs better directions from you. Computers are very fast but also very stupid. You cannot make typos, or add or omit random symbols, they immediately get stuck.
The ':' is the point where it gave up all hope of understanding you, often the real cause is a bit before that point.
Carefully check the line, and the line above! Verify that what you are trying to do is allowed at this point. Verify that you closed enough parentheses and square or curly brackets on the construct above.
Oh, and by "carefully", I mean very very very very carefully, not just glance over it, scrutinize each letter, digit, and symbol. Computers are fast but very stupid!
- Attachments
-
- htm_4001.png (8.71 KiB) Viewed 3199 times
Re: How to make a NewGRF properly ?
See this page: https://www.tt-wiki.net/wiki/NMLTutorial/Graphic_files
It is the second page of the NML Tutorial, which I would highly suggest you read (and practice!) from start to finish to give you a solid understanding of some of the basics of NewGRF making. Mind you, it isn't something to be completed in 5 minutes; I spent close to a week going through it and it was still just enough to get going, but it's a good foundation to start from, and provides some good links to other resources as well
It is the second page of the NML Tutorial, which I would highly suggest you read (and practice!) from start to finish to give you a solid understanding of some of the basics of NewGRF making. Mind you, it isn't something to be completed in 5 minutes; I spent close to a week going through it and it was still just enough to get going, but it's a good foundation to start from, and provides some good links to other resources as well
Re: How to make a NewGRF properly ?
Okay so...where must i put this palette file ? It's in th "gfx" folder, i tried with the four palettes and it didn't work.Andrew350 wrote:See this page: https://www.tt-wiki.net/wiki/NMLTutorial/Graphic_files
It is the second page of the NML Tutorial, which I would highly suggest you read (and practice!) from start to finish to give you a solid understanding of some of the basics of NewGRF making. Mind you, it isn't something to be completed in 5 minutes; I spent close to a week going through it and it was still just enough to get going, but it's a good foundation to start from, and provides some good links to other resources as well
Re: How to make a NewGRF properly ?
The palette has to be incorporated in your graphics file.
The easiest way to get a paletted graphicsfile is to decompile a GRF and just resize the graphicsfile that was in there to suit your graphics and then copy your graphics into that (and ofcourse then save it with the name you want to give it).
The easiest way to get a paletted graphicsfile is to decompile a GRF and just resize the graphicsfile that was in there to suit your graphics and then copy your graphics into that (and ofcourse then save it with the name you want to give it).
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: How to make a NewGRF properly ?
That strikes me as an odd solution. And if you do it (if I understand what you describe right) using something like paint.net, the files will actually lose their palette the moment you save anything (same for everything else that doesn't support palettes).Quast65 wrote:The palette has to be incorporated in your graphics file.
The easiest way to get a paletted graphicsfile is to decompile a GRF and just resize the graphicsfile that was in there to suit your graphics and then copy your graphics into that (and ofcourse then save it with the name you want to give it).
That aside ... it's not like the tutorial which acs linked doesn't explain how to do it
https://www.tt-wiki.net/wiki/Save_paletted_image_files
(GIMP is free and useful to have in any case; but there's obviously plenty alternatives)
Re: How to make a NewGRF properly ?
Ahh, good point. I use Photoshop, so never had any problems with that But good to know.And if you do it (if I understand what you describe right) using something like paint.net, the files will actually lose their palette the moment you save anything (same for everything else that doesn't support palettes).
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: How to make a NewGRF properly ?
That's with Photoshop, i'm talking about GIMP since i use GIMP.Quast65 wrote:The palette has to be incorporated in your graphics file.
The easiest way to get a paletted graphicsfile is to decompile a GRF and just resize the graphicsfile that was in there to suit your graphics and then copy your graphics into that (and ofcourse then save it with the name you want to give it).
Oh well, i solved my issue now. Thanks Pyoro too.
Who is online
Users browsing this forum: No registered users and 69 guests