Help building a mod.lua file that will mass update vanilla vehicle properties

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'm trying to build a mod.lua file that will do a mass update of the road-traffic car models. I'd like to give them more realistic properties as well as new soundsets (which I have built separately).


    I'm trying to build some scalable code that can be used for multiple models, and flexible code that can find .mdl files in different folder structures. Once I've got it working with a sample vehicle I'll expand and add in other vehicles.


    To start with, I've tried to write a mod that will update any model using "beetle_1948_v2.mdl", in order to assign new properties and a new soundset.


    I'm new to this and need some help. Could anyone look through my attached draft mod.lua file and comment?


    mod.lua


    Ich versuche, eine mod.lua-Datei zu erstellen, die ein Massenupdate der Fahrzeuge im Straßenverkehr durchführt. Ich möchte ihnen realistischere Eigenschaften sowie neue Soundsets (die ich separat erstellt habe) geben.


    Ich versuche, skalierbaren Code zu erstellen, der für mehrere Modelle verwendet werden kann, und flexiblen Code, der .mdl-Dateien in verschiedenen Ordnerstrukturen finden kann. Sobald es mit einem Beispielfahrzeug funktioniert, werde ich es erweitern und andere Fahrzeuge hinzufügen.


    Zuerst habe ich einen Mod geschrieben, der jedes Modell mit „beetle_1948_v2.mdl“ aktualisiert, um neue Eigenschaften und ein neues Soundset zuzuweisen.


    Ich bin neu hier und brauche Hilfe. Könnte jemand meinen angehängten Entwurf der mod.lua-Datei durchsehen und einen Kommentar abgeben?

  • Here is an attempt at Your mod.lua based on the one used in my DDRifikator mod. I transplanted a few lines from Your previous variant into it; the Beetle is attacked, the other vanilla vehicles still only have the DDRifikator alterations bestowed upon them.


    Additionally, it writes a line into the console whenever it has found and altered a vehicle, this is merely for debugging reasons.

  • Thank you for your help and sorry for the late reply.


    After many, many attempts: I have a mod that works, sometimes.


    The runFn part of my mod.lua file does not work if the file is in my mods folder. If I replace the mod.lua file of an active Steam mod with my file it works perfectly, but from the mods folder... nothing. My res folder works fine from either the mods folder or the Steam folder. Only the mod.lua file must be in the Steam folder.


    I do not know why this is happening. Help?


    Your DDR mod works fine from my mods folder.


    mod.lua file and Google link to the whole mod below:


    mod.lua


    https://drive.google.com/drive…jQVKB4fD05?usp=drive_link

    2 Mal editiert, zuletzt von Jay Bee ()