I want to display the name of the line that connects to the terminal in the labelText of the station module

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wĂĽnschen euch viel SpaĂź und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


  • I would like to create a station mod that, when you select a station, select đź”§Settings, and select a station module from the module list, will retrieve the name of the line that connects to the terminal on the station sign and display it in the labelText.


    So first, when the station setting screen was closed with guiHandleEvent() in game_script, I obtained the station group ID and sent it to handleEvent() using sendScriptEvent(), which then used api.engine to obtain the line name and terminal.

    First, I tried to send the obtained line name to updateFn in ****.module, but I'm stuck here.


    I've read the official wiki over and over again, and have tried using global variables while asking chatGpt, and sending it with sendScriptEvent(), but it's not received by updateFn.

    If anyone knows how to do this, please let me know.

    Or is it just not possible to do that? Thank you in advance.

  • I don't think you can do that.


    However, download the MOTRAS German Station mod. It comes with a Station Platform Status Board and it has an extensive custom text feature where it will display any Line name that you desire it to. The only downside is that you will have to go into the Mod Files, edit the file that has the string information for the status board and manually type in all of the names of the lines in your world. If you change any line names in your world, you will have to mentally remind yourself to update this string list so that it is reflected in the world.

    When you load your save, place the board on the platform, choose your platform number and then your line name that you desire from the drop down box. Voila, you have line names on your platforms!

    There is a time feature for the board, but it is quite useless as it is not dynamic and does not reflect actual train traffic in your world. You would need the Dynamic Arrival Boards or the SNCF Dynamic Screens mods on Steam Workshop to show that.


    Hope this helps you!