Vehicle Sprites dont show up in game

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
PNDA
Engineer
Engineer
Posts: 12
Joined: 14 Mar 2018 15:05
Location: Germany

Vehicle Sprites dont show up in game

Post by PNDA »

Hello,

I have just started coding with nml and i dont know everything.

I have added sprites and in game the vehicle looks like a SH '8P' Locomotive (which is a Standard Vehicle)

In the Purchasemenu it is correct.

Spriteset Code:

Code: Select all

spriteset(set_BR423_COACHES_purchase, "gfx\BR423_coaches_purchase.png") {
    [ 1,      1,       32,    16,      -3,       -10 ]
}

spriteset(set_BR423_COACHES, "\gfx\BR423_coaches.png") {
    [ 1,      1,        8,    24,      -1,       -1 ]
    [ 10,     1,       22,    20,      -1,       -7 ]
    [ 32,     1,       32,    16,      -1,       -6 ]
    [ 66,     1,       22,    20,      -1,       -7 ]
}
Graphics Code:

Code: Select all

graphics {
        cargo_capacity: 				return 72;
        additional_text: 				return string(STR_BR423_COACHES_ADDITIONAL_TEXT);
        purchase: 						set_BR423_COACHES_purchase;
    }
My .png's:
Coaches: https://imgur.com/oy0Zdq0
Purchase: https://imgur.com/khR9TIv

Thanks
Image
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Vehicle Sprites dont show up in game

Post by acs121 »

You must set in the callbacks this :

Code: Select all

default : -yourspritesetname-
Tony Pixel
Route Supervisor
Route Supervisor
Posts: 459
Joined: 14 Oct 2017 11:06
Location: Ukraine

Re: Vehicle Sprites dont show up in game

Post by Tony Pixel »

Hello and welcome!
There are one fail: You didn't use your train sprites because in the graphics section must be property "default: set_BR423_COACHES;"
[+] Spoiler

Code: Select all

spriteset(set_BR423_COACHES_purchase, "gfx\BR423_coaches_purchase.png") {        //all right!
    [ 1,      1,       32,    16,      -3,       -10 ]
}

spriteset(set_BR423_COACHES, "gfx\BR423_coaches.png") {       //ok, there all good
    [ 1,      1,        8,    24,      -1,       -1 ]
    [ 10,     1,       22,    20,      -1,       -7 ]
    [ 32,     1,       32,    16,      -1,       -6 ]
    [ 66,     1,       22,    20,      -1,       -7 ]
}

. . .  //To make a wagon you need to set "power" property at 0;
    power:                        0;
. . .    
    
    graphics {
 . . . 
        default:   set_BR423_COACHES;                                                       
    }                                                                                                             
}
Image Image
Sprite artist and NewGRF developer, coding in NML. My projects:
NewGRFs: Not Enough Subways Set | North American Passenger Railroads | Elevated Subway Bridge | Tony Pixel's Subway Equipment Set (frozen)
Screenshots: New York City Subway Episodes
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Vehicle Sprites dont show up in game

Post by acs121 »

Tony Pixel wrote:Hello and welcome!
There are one fail: You didn't use your train sprites because in the graphics section must be property "default: set_BR423_COACHES;"
[+] Spoiler

Code: Select all

spriteset(set_BR423_COACHES_purchase, "gfx\BR423_coaches_purchase.png") {        //all right!
    [ 1,      1,       32,    16,      -3,       -10 ]
}

spriteset(set_BR423_COACHES, "gfx\BR423_coaches.png") {       //ok, there all good
    [ 1,      1,        8,    24,      -1,       -1 ]
    [ 10,     1,       22,    20,      -1,       -7 ]
    [ 32,     1,       32,    16,      -1,       -6 ]
    [ 66,     1,       22,    20,      -1,       -7 ]
}

. . .  //To make a wagon you need to set "power" property at 0;
    power:                        0;
. . .    
    
    graphics {
 . . . 
        default:   set_BR423_COACHES;                                                       
    }                                                                                                             
}
I already said that :) but good to explain.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 39 guests