Problem with houses in NML

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Problem with houses in NML

Post by dandan »

I am trying to code some houses in NML. But the graphics will not show up properly, even in a minimal test case (files attached).

Here is the NML code:

Code: Select all

grf {
    grfid: "DP\20\13";
    name: string(str_grf_name);
    desc: string(str_grf_desc);
    version: 0;
    min_compatible_version: 0;
}

template template_house(x,y){
    //xpos, ypos, width, height, xoffset, yoffset
    [x,y,68,71,-33,-40]
}

item(FEAT_HOUSES, item_testhouse){
    property {
        substitute: 06;
        name: string(str_testhouse);
        override: 06;
        probability: 15;
        years_available: [0,2000];
        availability_mask: [ALL_TOWNZONES, ALL_CLIMATES];
    }
}

spriteset(spriteset_testhouse, "gfx/buildings.png") {
    template_house(0, 0)
}

spritelayout spritelayout_testhouse {
    ground { sprite: GROUNDSPRITE_NORMAL;}
    building { sprite: spriteset_testhouse;
    recolour_mode: RECOLOUR_NONE;
 }
}

item(FEAT_HOUSES, item_testhouse){
    graphics {
        default: spritelayout_testhouse;
    }
}
The relevant part of the resulting nfo code then looks like this

Code: Select all

    4 * 6	 01 07 01 FF 01 00
    5 sprites/nmlhouse.png  8bpp   98    8   68   71  -33  -40 normal chunked
    6 * 18	 02 07 FF 01 8D 0F 00 00
     00 00 00 80 00 00 00 10 10 10
    7 * 27	 02 07 FF 89
        1A 20 00 00 00 00 \2sto
        1A 20 FF 00 00 00 \2rst
        0C 00 FF FF 00 00
     00 FF 00
    8 * 7	 03 07 01 00 00 FF 00
What is the purpose of line 7? It result in the house graphics getting replaced with random garbage. (If I delete that line, the grf is fine.) I am using NML version 2071. Any ideas what is going on?
Attachments
nmlhouse.zip
(14.26 KiB) Downloaded 108 times
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Problem with houses in NML

Post by Eddi »

there is an unresolved bug in NML, try this workaround: http://www.tt-forums.net/viewtopic.php? ... 1#p1070491
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: Problem with houses in NML

Post by dandan »

Thanks! I even glanced over that thread but somehow failed to realize that it describes (among other things) the exact same problem. :oops: I'll have to somehow work around it for now.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 25 guests