NMLC doesnt accept spritelayout definitions

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

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

NMLC doesnt accept spritelayout definitions

Post by PNDA »

Hello,

im encountering this issue when i try to perform the -o action in NMLC (Converting NML to GRF)

Im a newbie and just creating single Vehicles for me and my friends :D Couldnt find anything in the internet about this

My .nml line 64

Code: Select all

name:                         string(STR_BTSW_NAME);
Error in CMD:

Code: Select all

nmlc ERROR: "BTSW\BTSW.nml", line 64: Syntax error, unexpected token "_NAME"
Last edited by PNDA on 14 Mar 2018 15:53, edited 2 times in total.
Image
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: NMLC doesnt accept spritelayout definitions

Post by Gwyd »

If you could show the surrounding block/few lines of code, that may help us solve your problem here.
PNDA
Engineer
Engineer
Posts: 12
Joined: 14 Mar 2018 15:05
Location: Germany

Re: NMLC doesnt accept spritelayout definitions

Post by PNDA »

Here are my properties for the vehicle:
(Note: I have fixed my actual problem by putting NAME before the Vehicle NAME.)

Code: Select all

item (FEAT_ROADVEHS, item_tram_BTSW) {
   property {
        name:						string(STR_NAME_BTSW);
		climates_available:			ALL_CLIMATES;
        introduction_date:			date(2003,1,1);
        model_life:					VEHICLE_NEVER_EXPIRES;
        retire_early:				0;
        vehicle_life:				25;
		reliability_decay:			20;
        loading_speed:				25;
        cost_factor:				224;
        running_cost_factor:		112;
		refittable_cargo_classes:	bitmask(CC_PASSENGERS);
		sprite_id:					SPRITE_ID_NEW_ROADVEH;
        speed:						81 km/h;
		refit_cost:					0;
        power:						420 kW;
		running_cost_base:			RUNNING_COST_ROADVEH;
        weight:						40.5 ton;
        cargo_capacity:				185;
		engine_class:				ENGINE_CLASS_ELECTRIC;
        //sound_effect:				no sound;
        //visual_effect:			use default (none);
        //callback_flags:			no need to set this;
        reliability_decay:			20;
		refit_cost:					0;
		misc_flags:					bitmask(ROADVEH_FLAG_TRAM);
	}
}

   graphics {
	  articulated_part:        switch_articulated_BTSW;
	  length:                  switch_length_BTSW;
	  cargo_capacity:          switch_capacity_BTSW;
	  default:                 switch_spriteset_BTSW;
   }

(Note: I have fixed my actual problem by putting NAME before the Vehicle NAME.)

Also NMLC has a new problem:
nmlc ERROR: "D:\grfs\BTSW\BTSW.nml", line 3: Unknown string "STR_GRF_NAME"
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: NMLC doesnt accept spritelayout definitions

Post by Alberth »

PandaCode wrote:Also NMLC has a new problem:
nmlc ERROR: "D:\grfs\BTSW\BTSW.nml", line 3: Unknown string "STR_GRF_NAME"
You should have a translation for all strings that you use.

The normal approach is to make a lang/english.lng file with

Code: Select all

##grflangid 0x01
STR_GRF_NAME :My awesome grf
See also https://newgrf-specs.tt-wiki.net/wiki/N ... uage_files
Being a retired OpenTTD developer does not mean I know what I am doing.
PNDA
Engineer
Engineer
Posts: 12
Joined: 14 Mar 2018 15:05
Location: Germany

Re: NMLC doesnt accept spritelayout definitions

Post by PNDA »

I do have this .lng file! and i also used --land-dir= in nmlc

Code: Select all

##grflangid 0x01

STR_GRF_NAME			:Bombardier Transportation Type-S Tram
STR_GRF_DESCRIPTION		:{CYAN}The German Bombardier Transportation Type-S Tram{} 
STR_NAME_BTSW     		:Type S Tram
STR_DESC_BTSW		    :Bombardier Transportation Type-S Tram used by VGF in Frankfurt, Germany
(Also Alberth you make good content!)
Image
PNDA
Engineer
Engineer
Posts: 12
Joined: 14 Mar 2018 15:05
Location: Germany

Re: NMLC doesnt accept spritelayout definitions

Post by PNDA »

Ok..This might be the most stupid mistake ever, but I found the mistake.
I used \englisch.lng instead of \english.lng
It didnt give an error but it didnt detect the file :/
Thanks for the help anyway :D
Image
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: NMLC doesnt accept spritelayout definitions

Post by KeldorKatarn »

If that doesn't produce a helpful error message then I'd still consider that a bug.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest