Nickel_Plate NML Questions
Moderator: Graphics Moderators
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Nickel_Plate NML Questions
After sorting about the lang files have done my first grf in NML.
This grf writing my multiplier so i can get a comparison.
The grf listed below was OK until i added the parameter in the grf block.
1. I now am getting a load of question marks appearing see screenshot.
2. In lang file what does 0x represent, 01 must mean english.
*****************************************************************
grf {
grfid: "NP\01\01";
name: string(STR_GRF_NAME);
desc: string(STR_GRF_DESCRIPTION);
version: 1;
min_compatible_version: 1;
/*****************************
Set parameter for multiplier
*****************************/
param(0) {
multiply_freight {
type: int;
name: string(STR_FREIGHT_MULTIPLY);
desc: string(STR_FREIGHT_MULTIPLY_DESC);
min_value: 1;
max_value: 3;
def_value: 1;
}
}
}
/******************************/
item (FEAT_TRAINS, Lev1, 84) {
property {
sprite_id: SPRITE_ID_NEW_TRAIN;
introduction_date: date(1920,01,01);
vehicle_life: 6;
model_life: 12;
speed: 97 km/h;
power: 1000;
weight: 160;
cost_factor: 20;
}
}
*********************************************************************
##grflangid 0x01
STR_GRF_NAME: Maglev1920
STR_GRF_DESCRIPTION: Allows Maglevs to start in 1920
STR_FREIGHT_MULTIPLY: Freight Multiplier
STR_FREIGHT_MULTIPLY_DESC: Multiply Freight Wagons but not Mail & Passengers
This grf writing my multiplier so i can get a comparison.
The grf listed below was OK until i added the parameter in the grf block.
1. I now am getting a load of question marks appearing see screenshot.
2. In lang file what does 0x represent, 01 must mean english.
*****************************************************************
grf {
grfid: "NP\01\01";
name: string(STR_GRF_NAME);
desc: string(STR_GRF_DESCRIPTION);
version: 1;
min_compatible_version: 1;
/*****************************
Set parameter for multiplier
*****************************/
param(0) {
multiply_freight {
type: int;
name: string(STR_FREIGHT_MULTIPLY);
desc: string(STR_FREIGHT_MULTIPLY_DESC);
min_value: 1;
max_value: 3;
def_value: 1;
}
}
}
/******************************/
item (FEAT_TRAINS, Lev1, 84) {
property {
sprite_id: SPRITE_ID_NEW_TRAIN;
introduction_date: date(1920,01,01);
vehicle_life: 6;
model_life: 12;
speed: 97 km/h;
power: 1000;
weight: 160;
cost_factor: 20;
}
}
*********************************************************************
##grflangid 0x01
STR_GRF_NAME: Maglev1920
STR_GRF_DESCRIPTION: Allows Maglevs to start in 1920
STR_FREIGHT_MULTIPLY: Freight Multiplier
STR_FREIGHT_MULTIPLY_DESC: Multiply Freight Wagons but not Mail & Passengers
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Nickel_Plate NML Questions
ad 1) The lang file needs to be utf-8 encoded. Are you sure that that is the case. Also: You want the strings to start _immediately_ after the colon. Or do you intend them to start with a white space?Nickel_Plate wrote: 1. I now am getting a load of question marks appearing see screenshot.
2. In lang file what does 0x represent, 01 must mean english.
ad 2) the langID is in hexadecimal representation. Hexadecimal numbers are distinguished from decimal by a leading 0x
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
It was not white space but tabs can see the tabs were converted into question marks,
just checked swedish rails lang to see how that was written.
Thanks for your quick response.
just checked swedish rails lang to see how that was written.
Thanks for your quick response.
Re: Nickel_Plate NML Questions
The 01 is indeed for English, see a full list of supported languages here.
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
Try to refit Goods Wagon for paper, using paper.grf in temp climate.
This is the code below. Keep getting Unrecognized identifier 'PAPR' when
trying to compile.
item (FEAT_TRAINS, Goods, 94) {
property {
sprite_id: SPRITE_ID_NEW_TRAIN;
introduction_date: date(1920,01,01);
vehicle_life: 15;
model_life: 30;
cargo_capacity: 30;
weight: 18;
cost_factor: 190; //Purchase Price =$2226
refit_cost: 00;
refittable_cargo_classes: bitmask(CC_PIECE_GOODS);
refittable_cargo_types: bitmask(PAPR);
}
}
This is the code below. Keep getting Unrecognized identifier 'PAPR' when
trying to compile.
item (FEAT_TRAINS, Goods, 94) {
property {
sprite_id: SPRITE_ID_NEW_TRAIN;
introduction_date: date(1920,01,01);
vehicle_life: 15;
model_life: 30;
cargo_capacity: 30;
weight: 18;
cost_factor: 190; //Purchase Price =$2226
refit_cost: 00;
refittable_cargo_classes: bitmask(CC_PIECE_GOODS);
refittable_cargo_types: bitmask(PAPR);
}
}
Re: Nickel_Plate NML Questions
You have to include a cargotable in your nml file. You could copy lines 7..23 from this file in OpenGFX+ Trains.
Next time you post some code, could you please surround it by [ code ] and [ / code ] (without the spaces). Thanks.
Next time you post some code, could you please surround it by [ code ] and [ / code ] (without the spaces). Thanks.
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
Thanks for reply will remember about
Code: Select all
next time.
Having put cargotable in nml file when i try to compile am getting error
[b]'Parameters of bitmask cannot be greater then 31'[/b]
Does this mean i need to remove some of the cargos from table.
Last edited by Nickel_Plate on 25 Mar 2011 14:27, edited 1 time in total.
Re: Nickel_Plate NML Questions
only the first 32 entries of a cargo translation table may appear in the refit mask.
PS: it should be "greater than". either you quoted it wrong, or it's a bug in nml.
PS: it should be "greater than". either you quoted it wrong, or it's a bug in nml.
Re: Nickel_Plate NML Questions
Nickel_Plate: it just means you'll have to shift the items around a little bit. PAPR should be one of the first 32 items in the list.
In nml r1305 there is no such typo
Edit: only now I'm reading the your code properly. Paper is in the cargo class "piece goods". As such you don't need to set refittable_cargo_types at all. In fact any cargo you set in refittable_cargo_types will switch cargos already set by refittable_cargo_classes. So because paper is enable by refittable_cargo_classes, it'll be disabled again by setting it also in refittable_cargo_types. See also http://hg.openttdcoop.org/nml/raw-file/ ... s-property
In nml r1305 there is no such typo

Edit: only now I'm reading the your code properly. Paper is in the cargo class "piece goods". As such you don't need to set refittable_cargo_types at all. In fact any cargo you set in refittable_cargo_types will switch cargos already set by refittable_cargo_classes. So because paper is enable by refittable_cargo_classes, it'll be disabled again by setting it also in refittable_cargo_types. See also http://hg.openttdcoop.org/nml/raw-file/ ... s-property
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
Have put PAPR at #27, but cannot get Paper to show up for Goods wagon.
This worked using normal nfo coding.
It says paper is piece goods in tables.
Steel, Livestock and Wood don't show up unless i remove one from bitmask.
This worked using normal nfo coding.
It says paper is piece goods in tables.
Steel, Livestock and Wood don't show up unless i remove one from bitmask.
Code: Select all
refit_cost:00;
refittable_cargo_classes:bitmask(CC_EXPRESS, CC_PIECE_GOODS);
refittable_cargo_types:bitmask(STEL, LVST, WOOD);
Re: Nickel_Plate NML Questions
Just checking to be sure: you do have another grf in your game that enables paper in temperate? It won't show up unless it's a valid cargo, which by default it is not in the temperate climate.Nickel_Plate wrote:Have put PAPR at #27, but cannot get Paper to show up for Goods wagon.
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
Yes, been using it for a while, playing chill's patchpack with it installed.
Learning nml coding using my grf files have made as a check.
Downloaded from this forum somewhere.
Learning nml coding using my grf files have made as a check.
Downloaded from this forum somewhere.
Re: Nickel_Plate NML Questions
You must be doing something else wrong as the snippet you've shown before works fine and makes the goods van refittable to paper. Mind that you're changing only the maglev goods van when you edit id 94.
If you still can't get it to work start by posting a complete list of NewGRFs you use in your game. A savegame loadable with trunk would be preferred. Also post the complete nml file as attachment.
If you still can't get it to work start by posting a complete list of NewGRFs you use in your game. A savegame loadable with trunk would be preferred. Also post the complete nml file as attachment.
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
Copy of NML file
- Attachments
-
- Maglev1920.nml
- (4.62 KiB) Downloaded 106 times
Re: Nickel_Plate NML Questions
You write this a lot of times but never provide new graphics, just leave it out:Yexo wrote:start by posting a complete list of NewGRFs you use in your game
Code: Select all
sprite_id: SPRITE_ID_NEW_TRAIN;
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
List of all NewGrf being used
- [preset-Canyon2]
landscape.grf =
grassyknoll.grf =
newterrainw_fixed_v2.grf =
infra_landscapew.grf =
sacsobjects1w.grf =
TTD_landscapew.grf =
infrstructure.grf =
Infrastructure.grf =
BKTunw.grf =
combined_american_signal_set.1.1\ussigzw.grf =
total_bridge_renewal_set.1.12\total_bridges.grf =
total_town_replacement_set-3.11\ttrs3w.grf = 0 0 0 1
newindustries.grf =
steelm.grf =
paperw.grf =
stations.grf =
platformsw.GRF =
jstatsw.grf =
ae_ruraw.GRF =
ae_subuw.GRF =
modernsuburbanw.GRF =
newstatsw.grf =
canstnw.grf =
japanese_stations-2.0a\jpstationsw.grf =
brickfreightw.GRF =
indstatrw_08.grf =
mlss027.grf =
dwestationtiles__fences-v1.2\fences.grf =
dwestationtiles_industrial_ter-v0.6\dwe_stat_r.grf =
vehicles.grf =
grvts.grf =
heqs-0.7.1\heqs.grf =
manual_industries-2r5\manindu.grf = 0 1 1 0 0 0 1 1 15
Maglav1920T.grf = 3
Maglav1928T.grf =
Maglav1940T.grf =
Maglav1950T.grf =
Maglav1960T.grf =
basemod-3.2\basecosts.grf = 1 10 8 9 44 6 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10
Re: Nickel_Plate NML Questions
Which of those would introduce the paper cargo? I'd really help if you could provide a link to the download location of that newgrf.
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
The grf is one Patchman made, can find plenty of talk about it but cannot find link.
Can send copy.
Can send copy.
Re: Nickel_Plate NML Questions
Sure, that's fine.
-
- Traffic Manager
- Posts: 146
- Joined: 27 Dec 2004 19:37
- Location: Home of the Big Cat
Re: Nickel_Plate NML Questions
Paper Grf
Checked using OpenTTD 1.0.3.
Working using grf made with nfo. ( GrfCodec )
Not Working using grf made with nml.
Checked using OpenTTD 1.0.3.
Working using grf made with nfo. ( GrfCodec )
Not Working using grf made with nml.
Who is online
Users browsing this forum: No registered users and 12 guests