Locking and unlocking vehicles at runtime

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


  • Hi everyone


    For a mod I would like to change the way new vehicles are unlocked while playing. So instead of the unlocks being based on the current in-game year you could unlock specific vehicles through the UI. Unfortunately I don't really now how to get started, since I didn't find anything regarding this topic in the modding documentation or in existing mods, so I'm not sure if this is possible at all.


    If there is no simple API command to lock/unlock vehicles another approach would be to change the availability.yearFrom & availability.yearTo in the metadata of the vehicles at runtime. But also with this apporach I don't really see a way to do it, since these values are stored within the model metadata and I have not yet found a way to change these at runtime.


    Since the mod would contain logic that's dependent on the game state it should all be handled within the update function in a game_script.


    If anyone here has any experience with this or any ideas of how to approach this, I would be extremely grateful.


    Cheers

    2 Mal editiert, zuletzt von Phil42 ()

  • change the availability.yearFrom & availability.yearTo in the metadata of the vehicles at runtime.

    As far as I know, this is not possible. The mdl is only loaded once, while loading the savegame. So this is not a solution.


    There are also various approaches to hide vehicles, but as far as I know you always need to reload the savegame to change the condition.

  • As far as I know, this is not possible. The mdl is only loaded once, while loading the savegame. So this is not a solution.


    There are also various approaches to hide vehicles, but as far as I know you always need to reload the savegame to change the condition.

    Thanks a lot for the answer - this is what I was afraid of. I guess this is something that's just not possible with the current modding API.

BlueBrixx