[Script] Cost modification script

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 all, just a small alternative to the cost mod, a lua script one can excecute in the res folder. It is not meant as a competition to the cost mod which is surely better written, it just is different and sacrifices user-friendliness for flexibility.


    What it does is rename all the relevant *.mdl and *.lua tu *-bkp.mdl and *-bkp.lua and copies them line for line back into the original, except for the relevent lines which are modified. It is not bug-proof at all and you might have to redownload the originals using steam, so beware.


    It defines first a category matrix, which can be freely defined for any files in the same folder:


    Code
    Cat[i] = {<Category name>, <path>, <extension>, <list of instances in the category>}


    A change matrix is then define:


    Code
    Changes[i] = {<Category Name>, <Varname 1> , <multiplied by>, <divided by>, <Varname 2> , <multiplied by>, <divided by>, ...}


    So for each category it changes any line which has:


    Code
    <Varname> = X<punctuation>   ----> <Varname> = X*mult/div<punctuation>


    The advantage of this is that you can add any mod in the list in the Cat matrix.


    Feel free to reuse this if you need to, I just did this for myself and am sharing this for anyone who is interested.


    Usual disclaimers apply, even more so since the source code is visible.


    easiest way to execute it is to find lua52.dll and lua52.exe on the web, save them in the res folder with the script, edit the script with your own values and drag the script over lua52.exe


    Have fun!


    PS: the script as is does nothing because all modifier values are set to 1
    PS_II: .lua uploading is not allowed so I uploaded a .lua.txt


    PS_III: There it is the right version now


    Edit: Fixed the double instances by creating a res/backups/


    This works now for me, apologies if anybody messed up their game files because of earlier version.

  • Hello, can I place wildcard into string instead of "list of instances in the category" (for check all files in this dir)?
    Cat[i] = {<Category name>, <path>, <extension>, <list of instances in the category>}
    So I want to achieve select all files in a directory.
    it I can to do?

BlueBrixx