Hello guys, I need some help with NML code for large houses that occupy more than one tile, them - has someone experience with that?
Ofc I have studied documentation (https://newgrf-specs.tt-wiki.net/wiki/N ... #House_IDs), but I am no programmer so it is trial and error for me and I am seriously stuck.
Thanks for any advice!
Large houses in NML
Moderator: Graphics Moderators
Re: Large houses in NML
Well a good starting point would be showing us what you've tried and what exactly you're stuck on. Without that we're just guessing.
Try looking at this file, it shows a good example of an NML multi-tile house: https://dev.openttdcoop.org/projects/po ... type1.pnml
Basically you need to set the right parameter in the item definition (HOUSE_SIZE_XXX) and then use callbacks to define the graphics for the different pieces. But we need to know what you're trying in order to figure out where you're going wrong
Try looking at this file, it shows a good example of an NML multi-tile house: https://dev.openttdcoop.org/projects/po ... type1.pnml
Basically you need to set the right parameter in the item definition (HOUSE_SIZE_XXX) and then use callbacks to define the graphics for the different pieces. But we need to know what you're trying in order to figure out where you're going wrong
Re: Large houses in NML
Hey! I've had this problem before. It's not really obvious, but for substitute you need to refer to a house of the same size: https://newgrf-specs.tt-wiki.net/wiki/N ... properties
Source code:
Hope this helps.
Source code:
Code: Select all
item(FEAT_HOUSES, SMALLSTADIUM, ITEM_SMALLSTADIUM, HOUSE_SIZE_2X2) {//HOUSE_SIZE_2X2 tells the game that this is 2x2. 1x2 and 2x1 should also work just fine.
property {
substitute: 20;//This has to refer to a house with the same size, so also 2x2. See documentation.
name: string(STR_SMALLSTADIUM);
availability_mask: [bitmask(TOWNZONE_EDGE, TOWNZONE_OUTSKIRT), ALL_CLIMATES];
accepted_cargos: [[PASS, 8], [MAIL, 8], [WOOD, 2]];
population: 15;
probability: 15;
building_flags: bitmask(HOUSE_FLAG_STADIUM); //Flag means: build only one
years_available: [0,50000];
}
graphics { //use graphics_DIRECTION instead of default
graphics_north: SPRITELAYOUT_SMALLSTADIUM1;
graphics_east: SPRITELAYOUT_SMALLSTADIUM2;
graphics_west: SPRITELAYOUT_SMALLSTADIUM3;
graphics_south: SPRITELAYOUT_SMALLSTADIUM4;
construction_check: sw_test_small; //Only build in small towns
}
}
- Zley_Muffle
- Engineer
- Posts: 43
- Joined: 10 Sep 2018 17:49
Re: Large houses in NML
I got stuck in the phase when you have to define NSWE graphics - I thought that you must define ALL 4 tiles separately as 4 different IDs, but if I see it correctly, you just defined one and the game made the othe three, right?
Re: Large houses in NML
I just have 4 different layouts for the four different tiles. That's it.Zley_Muffle wrote: ↑12 Jan 2020 12:04 I got stuck in the phase when you have to define NSWE graphics - I thought that you must define ALL 4 tiles separately as 4 different IDs, but if I see it correctly, you just defined one and the game made the othe three, right?
- Zley_Muffle
- Engineer
- Posts: 43
- Joined: 10 Sep 2018 17:49
Re: Large houses in NML
Would you kindly share part of your NML code? I believe I can figure it out from there on my own. Many thanks!I just have 4 different layouts for the four different tiles. That's it.
Who is online
Users browsing this forum: Bing [Bot] and 3 guests