changing predefined string messages

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
sky81
Engineer
Engineer
Posts: 38
Joined: 29 Oct 2019 05:49

changing predefined string messages

Post by sky81 »

I was wondering if there is a way to change the predefined string messages from openttd.
For example: "First bus arrived at....
Is this message appear hard coded automatically when first bus arrive to a station, or I can changed it somehow for one vehicle with other message like: First "train" arrived at....?
So ,if I create a vehicle then automatically I will have message: First bus arrived at....?

Thanks
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7234
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: changing predefined string messages

Post by Redirect Left »

I believe these are in the translations, rather than coded into the game itself, so you can edit them, but you need to essentially edit the translation for whichever language you are using.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
sky81
Engineer
Engineer
Posts: 38
Joined: 29 Oct 2019 05:49

Re: changing predefined string messages

Post by sky81 »

Yes I know. But I want to add some text like First trolley.... and keep also the old one like First bus....
But my trolley bus is basically a bus and keep giving message like: fist buss arrive.... and this is what I want to change
And keep all the buses to give message like: first bus arrived...
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7234
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: changing predefined string messages

Post by Redirect Left »

You'd need to add code i suspect so the game can differentiate between each one, if it isn't done already. then refer to a different translation string on that event. It's probably possible, but may be convoluted depending on if its all done on OTTDs side, or if it relies on the GRF telling it information that needs to be accurate & standardised between all of them.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: changing predefined string messages

Post by Eddi »

the main thing you have to do is to come up with a system that can tell a bus and a trolley apart. then you can add a newgrf extension so you can provide a string in your newgrf that replaces bus/train/plane/whatever.
sky81
Engineer
Engineer
Posts: 38
Joined: 29 Oct 2019 05:49

Re: changing predefined string messages

Post by sky81 »

But now is it possible to somehow showthis message: first train arrive at..... to a bus?
Or the code knows by default that this is a bus and automatically show message: first bus arrive at....?
User avatar
jfs
Tycoon
Tycoon
Posts: 1743
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: changing predefined string messages

Post by jfs »

The code goes something like:

Code: Select all

If the vehicle is a train, and no trains have arrived at station before:
        Show news about first train arriving
else, if the vehicle is a road vehicle and carries only passengers, and no bus has arrived at the station before:
        Show news about first bus arriving
else, if the vehicle is a road vehicle and does not carry passengers, and no truck has arrived at the station before:
        Show news about first truck arriving
else, if the vehicle is a tram, and no tram has arrived at the station before:        
        Show news about first tram arriving
else, if the vehicle is a ship, and no ship has arrived at the station before:        
        Show news about first ship arriving
else, if the vehicle is an aircraft, and no aircraft has arrived at the station before:        
        Show news about first aircraft arriving
done.
There is nothing asking the vehicle what it wants to be identified as, the vehicle has its intrinsic transport type and that's it.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest