Language file not found. NML compiling problems.

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
Erato
Chief Executive
Chief Executive
Posts: 740
Joined: 25 May 2015 09:09
Location: The Netherlands

Language file not found. NML compiling problems.

Post by Erato »

Every time I try to make a grf file, the following is returned:

Code: Select all

***\nml>nmlc -c --grf grf.grf ENRVS\ENRVS.nml
←[K←[33m nmlc warning: Default language file "lang\english.lng" doesn't exist←[0
m
←[Knmlc ERROR: "ENRVS\ENRVS.nml", line 4: Unknown string "STR_GRF_NAME"
This is my nml:

Code: Select all

//General settings
grf {
	grfid:	"EN\01\01";
	name:	string(STR_GRF_NAME);
	desc:	string(STR_GRF_DESC);
	version:	0;
	min_compatible_version: 0;
}
//Define cargo
cargotable {
	PASS
}

//Graphics settings
spriteset (SPRITESET_CITEA, "grf\Citea") {
	[1, 1, 6, 22, -3, -8]
	[8, 1, 20, 17, -10, -8]
	[29, 1, 30, 12, -15, -8]
	[60, 1, 20, 17, -10, -8]
	[81, 1, 6, 22, -3, -8]
	[88, 1, 20, 17, -10, -8]
	[109, 1, 30, 12, -15, -8]
	[140, 1, 20, 17, -10, -8]
}

spritegroup SPRITEGROUP_CITEA {
	loading: SPRITESET_CITEA;
	loaded:  SPRITESET_CITEA;
}

//Citea
item(FEAT_ROADVEHS, ITEM_CITEA) {
	property {
		/*Citea settings
		Basic settings beyond this point*/
		name:	string(STR_NAME_CITEA);
		climates_available:	bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL);
		introduction_date:	date(2024,01,01);
		model_life:	20;
		retire_early: 5;
		reliability_decay:	20;
		refittable_cargo_classes: bitmask(CC_PASSENGERS);
		loading_speed: 5;
		cost_factor: 100;
		running_cost_factor: 100;
		//Cargo_age_period left default
		
		//Specific settings for busses
		//No sprite_id => no replacing graphics.
		speed: 140 km/h;
		misc_flags: ROADVEH_FLAG_2CC;
		//No refitting => No cost.
		running_cost_base: RUNNING_COST_ROADVEH;
		// No power / weight required for RoadVeh
		tractive_effort_coefficient: 0.3;
		air_drag_coefficient: 17.5;
		default_cargo_type: DEFAULT_CARGO_FIRST_REFITTABLE;
		sound_effect: SOUND_BUS_START_PULL_AWAY;
		visual_effect: VISUAL_EFFECT_DISABLE;
		effect_spawn_model: EFFECT_SPAWN_MODEL_NONE;
		length: 7;
		cargo_capacity: 80;
		
	}
	graphics {
		default: SPRITEGROUP_CITEA; // Use this group
	}
}
My lng:

Code: Select all

##grflangid 0x01
# 0x01 -> English

# General GRF strings
STR_GRF_NAME	:Erato Nysiad's Road Vehicle Set
STR_GRF_DESC	:This pack contains a few vehicles, like the VLD Citea. {}{COPYRIGHT}2015 Erato Nysiad{}License:CC BY-NC 4.0

# Vehicle strings
STR_NAME_CITEA	:VLD Citea
My lng is located in lang, a folder next to my nml:

ENRVS\ENRVS.nml
ENRVS\lang\english.lng

What's causing the problem?
No pics no clicks. Seriously.
ImageImageImageImageImageImage
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Language file not found. NML compiling problems.

Post by Alberth »

The problem is that "lang\english.lng" does not exist, as your file is in "ENRVS\lang\english.lng", ie quite literally what nmlc reports.
(nmlc looks relative to where you run nmlc, rather than relative to the .nml file.)

Either run nmlc inside the ENRVS directory, or provide a "--lang-dir=ENRVS\lang" option to nmlc, so it knows where to look for language files.
Being a retired OpenTTD developer does not mean I know what I am doing.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 78 guests