Modular Locomotive Sheds Depot Set (MLSD)
Moderator: Graphics Moderators
Modular Locomotive Sheds Depot Set (MLSD)
Hello all,
So I have been wanting to release a set of depots to match my sheds (http://www.tt-forums.net/viewtopic.php?f=67&t=48681) for a while now. To be able to provide a variety of depots, I need to use rail types, so I had considered a rail NewGRF. While I would still like to release a rail set, it seems it would be easier to just release a a set of depots to override common rail types for now, using NML.
I created these 6 variations on my three shed types to use for now, and will gradually create more. So far, I have tried to assign a depot graphic to most of the commonly used railtype labels in major track sets, and I aim to broaden the compatibility with time.
I have written some NML with planetmaker's help that I think will do what I want, but I cannot figure out how to use python and NML. If someone could help me out be looking at my code and/or compiling this to test it out, I would really appreciate it.
Also attached are the .png files for the grf.
Best,
So I have been wanting to release a set of depots to match my sheds (http://www.tt-forums.net/viewtopic.php?f=67&t=48681) for a while now. To be able to provide a variety of depots, I need to use rail types, so I had considered a rail NewGRF. While I would still like to release a rail set, it seems it would be easier to just release a a set of depots to override common rail types for now, using NML.
I created these 6 variations on my three shed types to use for now, and will gradually create more. So far, I have tried to assign a depot graphic to most of the commonly used railtype labels in major track sets, and I aim to broaden the compatibility with time.
I have written some NML with planetmaker's help that I think will do what I want, but I cannot figure out how to use python and NML. If someone could help me out be looking at my code and/or compiling this to test it out, I would really appreciate it.
Also attached are the .png files for the grf.
Best,
- Attachments
-
- MLSD_PNG.rar
- (42.35 KiB) Downloaded 165 times
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Modular Locomotive Sheds Depot Set (MLSD)
Hi,
mostly it's syntactically correct; the only thing you need to mind is that you don't include strings directly in the NML file but in the language file as I supplied in the example (railtype labels or grfIDs in this context don't count as strings, they're labels and IDs).
and:
Mind that you have a few white pixels in the grf which is - given the exact multiples of 64 - most probably a wrong offset somewhere in the alignment. Again, no ingame testing by me during working hours 
So all you need for nml to work is basically install python and its modules PIL, PLY so that it is available in your path and the NML module as well:
http://hg.openttdcoop.org/nml/raw-file/ ... stallation
cheers,
pm
mostly it's syntactically correct; the only thing you need to mind is that you don't include strings directly in the NML file but in the language file as I supplied in the example (railtype labels or grfIDs in this context don't count as strings, they're labels and IDs).
Code: Select all
grf {
grfid : "MLSD";
name : string(STR_GRF_NAME);
desc : string(STR_GRF_DESCRIPTION);
version : 1; // must be numeric
min_compatible_version : 1;
}
Code: Select all
~/ottd/grfdev/example-depot> ls -1
depot_1A.png
depot_1B.png
depot_2A.png
depot_2B.png
depot_2C.png
depot_3A.png
lang
mlsd.grf
mlsd.nml
~/ottd/grfdev/example-depot> cat lang/english.lng
##grflangid 0x01
STR_GRF_NAME :Example Depot GRF
STR_GRF_DESCRIPTION :Example Depot description; coded by a super mob
~/ottd/grfdev/example-depot> nmlc mlsd.nml
"depot_1B.png" at [x: 118, y: 8]: 64 of 3648 pixels (1%) are pure white
"depot_1B.png" at [x: 118, y: 68]: 512 of 3648 pixels (14%) are pure white

So all you need for nml to work is basically install python and its modules PIL, PLY so that it is available in your path and the NML module as well:
http://hg.openttdcoop.org/nml/raw-file/ ... stallation
cheers,
pm
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Modular Locomotive Sheds Depot Set (MLSD)
I know it probably seems straightforward to most people, but this is where I am stuck. I have Python installed now, and I think I got PIL installed, but I cannot figure out how to get PLY or NML installed.So all you need for nml to work is basically install python and its modules PIL, PLY so that it is available in your path and the NML module as well:
I am now at work myself, so it will be awhile be fore I can take another shot at it.
Thanks!
Re: Modular Locomotive Sheds Depot Set (MLSD)
Maybe you want to try the windows exe bundle: http://www.tt-forums.net/viewtopic.php?p=930849#p930849
Town Names:


Still work in progress: OpenGFX or/and OpenSFX - Please help!
Re: Modular Locomotive Sheds Depot Set (MLSD)
So tonight I managed to create a NewGRF that seems to compile fine in NML, and does not seem to cause any errors when loaded in a game of OTTD. However, it also does not produce any effect either. I wrote this version to act just on the four default rail types, but as far as I can tell, they still use their standard depot graphics. I will post all of the files I used to create it here, along with the grf, if anyone wants to test. I have found that the NML documentation lists the appropriate features for switches, but I cannot find any list of valid <expression>s to use. Planetmaker was very kind to provide me with a snow aware depot example, which uses the expression "terrain_type" and the range "tiletype_snow", but I cannot find anything in the documentation that suggests that these are the terms to use to get this effect. It would seem to me, that someone wanting to write such a switch from scratch would have to guess those terms.
I also cannot figure out how to make my Grf ID string show up as is in game, instead of the 4 letter id I wrote, it shows up as a 8 digit number.
Best,
I also cannot figure out how to make my Grf ID string show up as is in game, instead of the 4 letter id I wrote, it shows up as a 8 digit number.
Best,
- Attachments
-
- MLSD Basic.rar
- (50.02 KiB) Downloaded 143 times
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Modular Locomotive Sheds Depot Set (MLSD)
That's usual and intended; it's the hex interpretation of your string.supermop wrote:I also cannot figure out how to make my Grf ID string show up as is in game, instead of the 4 letter id I wrote, it shows up as a 8 digit number.
It's the first thing described under 'railtype variables'supermop wrote:I have found that the NML documentation lists the appropriate features for switches, but I cannot find any list of valid <expression>s to use. Planetmaker was very kind to provide me with a snow aware depot example, which uses the expression "terrain_type" and the range "tiletype_snow", but I cannot find anything in the documentation that suggests that these are the terms to use to get this effect. It would seem to me, that someone wanting to write such a switch from scratch would have to guess those terms.

EDIT: good and bad news:
The good: you NewGRF works fine
The bad: With the current way OpenTTD works, you or another railtype newgrf need to supply the ground tile graphics (tracks) as well. Your depots can only replace the existing depots currently when some railtypes newgrf (yours or another) re-defines the ground tiles for the railtype labels you want to provide the depots for.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Modular Locomotive Sheds Depot Set (MLSD)
Well, as of last night, i tried to just make a version that would work with NuTracks rail types. I am including it here if anyone is curious, but it doesn't work for me, not sure why.
Best,
Best,
Re: Modular Locomotive Sheds Depot Set (MLSD)
Unless you want different depots for the different tracktypes, all you need is to 'Action A' the default depot(s):
All 'normal' rails use the default 'normal' depot
The metros use the monorail depot
Maglev use maglev
All 'normal' rails use the default 'normal' depot
The metros use the monorail depot
Maglev use maglev
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Modular Locomotive Sheds Depot Set (MLSD)
Given the source, that's the purpose of this newgrf, though.DJ Nekkid wrote:Unless you want different depots for the different tracktypes
It works for me somewhat but not consistently and not for all railtypes. It'll need investigation when and how and why.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Modular Locomotive Sheds Depot Set (MLSD)
possible typos in the railtype labels?
check this file, line 215 and onward:
http://dev.openttdcoop.org/projects/nut ... eader.pnfo
check this file, line 215 and onward:
http://dev.openttdcoop.org/projects/nut ... eader.pnfo
Re: Modular Locomotive Sheds Depot Set (MLSD)
Looking over the NML file and your code Nekkid, I don't see any mistakes other than my inclusion of a "CMED" type, which you do not seem to have, so I don't think that typos are the problem.
I am curious as to why this grf seems to do absolutely nothing for me, but does do something, if limited for Planetmaker. Did you use my .grf, or did you compile it from the .nml yourself?
I don't see any change whether I use stable trunk, or a recent patchpack, so not sure what could be the variable factor here.
Best,
I am curious as to why this grf seems to do absolutely nothing for me, but does do something, if limited for Planetmaker. Did you use my .grf, or did you compile it from the .nml yourself?
I don't see any change whether I use stable trunk, or a recent patchpack, so not sure what could be the variable factor here.
Best,
Re: Modular Locomotive Sheds Depot Set (MLSD)
I would if I could! I was never able to figure out how to replace depots in nfo, so I tried to learn how to do in it NML instead. Clearly I have yet to learn that as well.
Edit:
This might do something (maybe), I will not be able to test until after work.
Edit:
This might do something (maybe), I will not be able to test until after work.
Re: Modular Locomotive Sheds Depot Set (MLSD)
Well, if I think .nfo I think that you might need an action0 to 'set the slot' of the particular railtype, but i bet that you could have 0 properties. Then you need to use the same slot in the Action3.
If so do you need to check what parameter20 (iirc) is in nutracks, so that you dont add more railtypes that what is already in (as i see you had defined 3rdr and 3rdc)
Did that help?
@Openttd-devs: Or is the slot in the railtype translation table (RTT) good enough?
if so, do you need to add a RTT to your grf
If so do you need to check what parameter20 (iirc) is in nutracks, so that you dont add more railtypes that what is already in (as i see you had defined 3rdr and 3rdc)
Did that help?
@Openttd-devs: Or is the slot in the railtype translation table (RTT) good enough?
if so, do you need to add a RTT to your grf

Re: Modular Locomotive Sheds Depot Set (MLSD)
You don't need a RTT at all. Also the action0/action3 is implicitly set by nml (you can chose them manually, but you don't have to). The problem was that supermop used "depot_1B.png" several times, instead of one time "depot_1B.png", one time "depot_1C.png", one time "depot_2A.png" etc.
Re: Modular Locomotive Sheds Depot Set (MLSD)
then he stills needs to check for what value Parameter20 has set in NuTracks, so that it dont 'flood' the game with railtypes that isnt used 

Re: Modular Locomotive Sheds Depot Set (MLSD)
Thanks Yexo for catching that error but I am wondering if the action 0 error I get (and others do not) when loading these two grfs at the same time is perhaps unrelated. I will not be able to find out for myself until later tonight.
Thanks,
Thanks,
Re: Modular Locomotive Sheds Depot Set (MLSD)
supermop: try to 'override' the first parameter to '3rd rail' and see what happens *guessing*
Re: Modular Locomotive Sheds Depot Set (MLSD)
Is that something I do in my code, or when I configure nutracks in game?
Re: Modular Locomotive Sheds Depot Set (MLSD)
something you do with your grf.
point is:
Nutracks define about 25 (rough estimate) different tracktypes, but only use a handfull (between 10ish and 16), but the game can only use 16 at once, and if nutracks with metrotrackset is loaded, and you add, say, 3rdr to your set, then you have 17 ones, and the game complains.
point is:
Nutracks define about 25 (rough estimate) different tracktypes, but only use a handfull (between 10ish and 16), but the game can only use 16 at once, and if nutracks with metrotrackset is loaded, and you add, say, 3rdr to your set, then you have 17 ones, and the game complains.
Who is online
Users browsing this forum: No registered users and 5 guests