Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri Sep 21, 2018 2:49 pm

All times are UTC




Post new topic  Reply to topic  [ 36 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Fri Mar 16, 2018 6:39 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4667
Location: home
Please post your nml code, s people can point out your errors instead of having to dig in nmlc compiler sources

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Wed Jun 06, 2018 5:43 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
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.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Wed Jun 06, 2018 6:31 pm 
Offline
Director
Director
User avatar

Joined: Mon Apr 17, 2017 4:52 pm
Posts: 608
Location: Western Ile-de-France Region
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)


Top
   
PostPosted: Wed Jun 06, 2018 7:19 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
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)


How do i insert it as NML code ?

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Wed Jun 13, 2018 8:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
Livery override is solved, now i just need to know about this error :
Code:
nmlc 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

I attached everything if anyone wants to point out my errors.


Attachments:
randstadrail.rar [3.87 MiB]
Downloaded 11 times

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots
Top
   
PostPosted: Fri Jun 15, 2018 4:45 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
acs121 wrote:
Livery override is solved, now i just need to know about this error :
Code:
nmlc 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

I attached everything if anyone wants to point out my errors.


So no one wants to look into my code ?

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Sat Jun 16, 2018 6:10 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4667
Location: home
I fixed nmlc, and now it says
Code:
nmlc ERROR: "lang/english.lng", line 1: Invalid grflangid '0x01 :'


Not sure why you add a colon to a number

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Sat Jun 16, 2018 9:18 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
Alberth wrote:
I fixed nmlc, and now it says
Code:
nmlc ERROR: "lang/english.lng", line 1: Invalid grflangid '0x01 :'


Not sure why you add a colon to a number


Okay, thanks. Now it works with this part. Now it's telling me :
Code:
[Knmlc ERROR: "randstadrail.nml", line 84: Syntax error, unexpected token ":"

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Sun Jun 17, 2018 5:10 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4667
Location: home
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!

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Sun Jun 17, 2018 2:16 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
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!


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 :


Attachments:
htm_4001.png
htm_4001.png [ 8.71 KiB | Viewed 334 times ]

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots
Top
   
PostPosted: Sun Jun 17, 2018 6:28 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Mon Dec 19, 2011 7:54 am
Posts: 426
Location: Washington State, USA
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 :)

_________________
WSF Ferry Set [WIP] || American Road Replacement Set || NightGFX Base Graphics Set || Wasteland [WIP] || RattRoads (NRT Only) || American Bridge Replacement Set [WIP]


Top
   
PostPosted: Mon Jun 18, 2018 2:21 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
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 :)


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.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Mon Jun 18, 2018 3:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1598
Location: The Netherlands
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).

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Mon Jun 18, 2018 4:04 pm 
Online
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2379
Location: Virgo Supercluster
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 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).


That aside ... it's not like the tutorial which acs linked doesn't explain how to do it :roll:
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)


Top
   
PostPosted: Mon Jun 18, 2018 4:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1598
Location: The Netherlands
Quote:
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).

Ahh, good point. I use Photoshop, so never had any problems with that ;-) But good to know.

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Mon Jun 18, 2018 5:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1536
Location: Courbevoie, near Paris, France
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's with Photoshop, i'm talking about GIMP since i use GIMP. :D
Oh well, i solved my issue now. Thanks Pyoro too.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 36 posts ]  Go to page Previous 1 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.