Hi,
I've tried:
STR_PURCHASE_HINT_SPEED_CHANGE_ON_LOAD :Max speed changes to {VELOCITY} when loaded
string(STR_PURCHASE_HINT_SPEED_CHANGE_ON_LOAD, 70 km/h));
I get nmlc ERROR: "xussr.nml", line 20942: Syntax error, unexpected token "km/h"
How should I specify the data to the {VELOCITY}?
I've tried
string(STR_PURCHASE_HINT_SPEED_CHANGE_ON_LOAD, 70));
I get nmlc ERROR: "lang\english.lng", line 992: Provided a static argument for string command 'VELOCITY' which is invalid
What to do?
How to display speed in proper units in additional text CB?
Moderator: Graphics Moderators
Re: How to display speed in proper units in additional text
you cannot use units in the "string()" itself, you must push the value to the stack in a callback.
- George
- Tycoon
- Posts: 4362
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
Re: How to display speed in proper units in additional text
How can I do in additional_text CB in NML? Could you provide some small example (switch)?Eddi wrote:you cannot use units in the "string()" itself, you must push the value to the stack in a callback.
Re: How to display speed in proper units in additional text
it's probably not "small", but this is the code i use:
with these strings:
Code: Select all
switch(FEAT_TRAINS, SELF, VEH_ID(text_switch_default), [STORE_TEMP(string(STR_AUTO_0) | string(STR_USAGE_PASSENGER) << 16, 0x100), STORE_TEMP(string(STR_TRACK_TYPES_DEFAULT) | string(STR_TRACK_TYPE_E) << 16, 0x101), 0]) {
return string(STR_ENG_DESCRIPTION);
}
Code: Select all
STR_AUTO_0 :Bo'Bo'
STR_USAGE_PASSENGER :Main line passenger
STR_TRACK_TYPES_DEFAULT :{STRING}
STR_TRACK_TYPE_E :{YELLOW}electrified{ORANGE}
STR_ENG_DESCRIPTION :{BLACK}Axle Scheme: {GOLD}{STRING}{BLACK} Use: {GOLD}{STRING}{BLACK}{}Track Class: {GOLD}{STRING}{BLACK}
Who is online
Users browsing this forum: No registered users and 21 guests