I managed to write some bigger GRF using NML, but yesterday something had gone wrong:
What's wrong?
Moderator: Graphics Moderators
They're set this way:YukonRob wrote:I am making a train engine grf and have a few questions:
How do we set base costs? They don't seem to match the ones on the wiki (http://wiki.ttdpatch.net/tiki-index.php?page=BaseCosts)
Code: Select all
basecost {
PR_RUNNING_TRAIN_STEAM: 43;
PR_RUNNING_TRAIN_DIESEL: param[3];
PR_RUNNING_TRAIN_ELECTRIC: electric_run_cost_param;
PR_BUILD_VEHICLE_TRAIN: 200;
PR_BUILD_VEHICLE_WAGON: 200;
}
There is generally not for newgrfs. Only the speed with which the reliability (randomly chosen upon map creation) decays. See http://wiki.ttdpatch.net/tiki-index.php ... Model_life for an explanation.Also is there any way to set max reliability?
Mind you didn't set a cost base in your example. And what's wrong with your results? The units are... somewhat arbitrary units. One step up doubles the base cost, One step down halfs them.YukonRob wrote:Thanks for the links - I hadn't found the base cost section (also what units are those in?).
But if I use the following I get different results (OTTD R21811):
cost_factor: 1;
running_cost_base: RUNNING_COST_DIESEL;
running_cost_factor: 1;
Results:
Cost - $2342
Running Cost - $30/yr
If you don't define an engine ID explicitly, you're NOT replacing a vehicle. You CAN define an engineID and thus you can also replace a vehicle. By default, that is without engineID or an engineID where no default vehicle exists, all vehicle properties and graphics are undefined and need to be defined in order to make the vehicle valid. E.g. in the following example the 20 is the engineID of the default turbotrain and you could just change what you need to change:YukonRob wrote:In NML if I don't define an engine ID, what does it default to? (ie. I assume that default values for hp etc. would usually be predefined by the vehicle you are replacing unless you explicitly change them).
Code: Select all
item(FEAT_TRAINS, turbotrain, 20) {
...
}
This section of the docs contains some information about the units and general use:YukonRob wrote:Thanks for the links - I hadn't found the base cost section (also what units are those in?).
Code: Select all
if (climate == CLIMATE_TEMPERATE) {
// The 0x01 comes from http://wiki.ttdpatch.net/tiki-index.php?page=CargoTypes column "Type B"
item(FEAT_CARGOS, cargo_coal, 0x01) {
property {
weight: 1.0 / 16; // Set weight of coal to 1/16 ton, the smallest amount possible.
}
}
}
Actually in nml the quantization is in ton. Writing "weight: 2;" will result in a weight of 2 ton.planetmaker wrote:What is unclear about the property "weight"? The only info missing is that the actual quantization is in 1/16 of a ton.
Yes, it's a float value in NML. I meant to stress that a value of 0.1 would get rounded, I guess to 1/8 (nearest multiple of 1/16)Yexo wrote:Actually in nml the quantization is in ton. Writing "weight: 2;" will result in a weight of 2 ton.planetmaker wrote:What is unclear about the property "weight"? The only info missing is that the actual quantization is in 1/16 of a ton.
planetmaker wrote:What is unclear about the property "weight"? The only info missing is that the actual quantization is in 1/16 of a ton.
I'm interested in improving the documentation, but I'm not sure which part thereof you refer to. Could you possibly be more precise or provide a link to what part you looked at?BillSargent wrote:I was confused about the 0x01 part.
planetmaker wrote:I'm interested in improving the documentation, but I'm not sure which part thereof you refer to. Could you possibly be more precise or provide a link to what part you looked at?BillSargent wrote:I was confused about the 0x01 part.
A list of available cargoes depends on the used newgrfs. The ones used in commonly by default or by NewGRFs are not yet listed in the NML documentation but found on http://wiki.ttdpatch.net/tiki-index.php ... rgo_Labels
Users browsing this forum: Amazon [Bot] and 2 guests