Beiträge von melectro

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 testing my mods in a game and now I have seen that yearFrom and yearTo doesn't work as I think they should. The mod is already enabled in year 1880.

    I can't see that my code differs from the example in the WIKI.

    Code: snippet from My mod
                local tempA = api.type.ConstructionTemplate.new()
                    tempA.availability = api.type.MetadataMap.Availability.new()
                        tempA.availability.yearFrom = 1890
                        tempA.availability.yearTo = 1929
                        tempA.desc.name = streetConA.description.name
                        tempA.desc.description = streetConA.description.description
                local streetDynA = api.type.DynamicConstructionTemplate.new()

    link to the example in WIKI: Reference (transportfever2.com)

    So make sure, you are using unique keys.

    I have changed each key name in both mod and .script files, but the game is using the wrong script file.

    Please keep in mind, that both mods works when loading them separately.


    Here is my description on how I can repeat the problem:

    • I start the game with an empty stdout.txt
    • After the savegame has loaded I click on only the eraA construction, --> I get a construction error
    • Reading the stdout.txt on row 73-76, 99-106 there it says the wrong file and wrong mod folder.

    The first mod is now named with a big A at the end, the second mod has names with C at the end of each key name.

    What I can see is that the game should open the file creek_bridge_streetA.script but it opens creek_bridge_streetC.script in the other loaded mod folder.


    Is this a bug in the game and how can I do a work around?



    Here are the two mods in the file explorer:


    here is a snippet from the mod.lua in the eraA mod:

    a snippet from the mod.lua in the eraC directory

    Dateien

    • stdout.txt

      (3,85 kB, 364 Mal heruntergeladen, zuletzt: )

    there is a bug regarding modparams

    That I didn't know, Thank you it makes sense to what I have seen.


    About Static/Dynamic, actually I'm trying to find why the setting menu isn't showing up on the right side when I select "configure" on the dynamic construction after it has been built. I wish to make a change, but the menu does not appear as it is doing for a standard mod like my Autobahnkreuz.


    I have for the moment created two mods with DynamicConstruction and when enabling both, one of them doesn't work as the ParamsfromLua will only be read from the last activated mod. Though it works fine if I just enable it as stand alone.


    1)

    Is there a limit that the game can only handle one mod with dynamicConstruction?


    2)

    Regarding my question above. I have found inside the TpF2.exe file these modules, but I cant find any documentation about StaticConstruction. Experimenting isn't making any progress.


    After i have studied the example in WIKI https://transportfever2.com/wi…uction_postRunFn.lua.html, I found that there is probably an undocumented function called api.type.StaticConstructionTemplate. The example uses Dynamic, but how to configure it as Static? Is there anyone of you that know something to explain how to set it up for Static?


    I can tell that when I only change the name into Static I get an error as the api.type.StaticConstructionTemplate.new() returns a NIL value

    Reading the WIKI Tunnel config doesn't say anything about dimension, it says the lua file "specifies a set of parameters to define the properties, dimension, features, ...."


    It's just a copy paste from WIKI TpF1


    Where can I find the names for tunnel height, tunnel width ...?

    I get a little upset that the shadows on this material are getting too dark. I have tried to get them bright by testing the model editor, but do not succeed with this. Is there anything I can do?


    The Material created for this object is

    I have read the description three times and still I don't understand or get it working.

    If you have no module you will have `return {}` and the parameter have no impact.


    from the .script file

    I have placed the return {} in the xxxFn functions in the .script file, but still I get the message "An error just occured"


    here are the lines after the normal startup info in stdout.txt

    Code
    adding archive res/models/models.zip
    ModelRep: 6316.05 ms
    No resources are missing!
    texture load error: file not found: res/textures/.tga
    MinidumpCallback: dumpPath "I:/Steam/userdata/70790454/1066780/local/crash_dump/", minidumpId "ab5993b4-e9b5-477d-a110-9da05005243f", succeeded 1
    local time is Tue Sep 29 17:31:13 2020
    
    An error just occurred.

    There has to be more info in the stdout

    No there is no more information than the normal lines at loading the game. Here is the full stdout.txt if you don't believe me.


    EISFEUER

    Thanks' for enlighten me.

    What not makes sence to me is. In the lines above they create an asset object.

    in my case it was the opposite, the second part didn't make any sense to me as I changed the definition in the first part to STREET_STATION and deleted my "mod".con in the construction folder.

    The first part is creating a complete con file in the repository. What I'm guessing is, if you want to omit the first part and instead have your own .con file in the construction folder, you could use the second paragraph. Unfortunately, it is not clear in the example and that is the comment I was looking for. I have tested to use only the second part (by reintroducing my .con file in the construction folder), but it also creates errors.

    I like to use the first part where the con is dynamically created, but I'm trying to find how to interpret following two lines:

    Code
    con.fileName = "myCon"

    Should the file name "myCon" include ".con" or not?

    Code
            con.updateScript.fileName = "construction/cons.updateFn"

    I have seen in other examples that "cons" is normally the name of myCon without ".con". Here it is only confusing me in following points.

    1. the "s" in "cons.updateFn". For me the s means plural of con (=constructions)
    2. Why not use the same name as the construction in the example?
    3. It would have been nice if the example pointed to the use of a script file. Even better if the script file is also presented.

    Dateien

    • stdout.txt

      (1,62 kB, 347 Mal heruntergeladen, zuletzt: )

    Actually I'm not in the need of createTemplateFn in the script file for my mod to work, but if the game needs it, I don't know. I have tested to remove the lines including the functions in the mod.lua, and then I get following error.


    At the end of mod.lua I have placed a debugprint "hasBridge...." and this line isn't executed as the error above happens at the missing format.


    Letting the comments away and activate the functions in the scriptfile doesn't help. A new error, very informativeX/...:


    here is what I have written in the script file:

    stdout.txt

    Code
    adding archive res/models/models.zip
    ModelRep: 6387.35 ms
    hasBridge =    true    creek_bridge_street
    No resources are missing!
    texture load error: file not found: res/textures/.tga
    MinidumpCallback: dumpPath "I:/Steam/userdata/70790454/1066780/local/crash_dump/", minidumpId "4c92bced-9c21-422a-9f9f-c74c92b464c2", succeeded 1
    local time is Sun Sep 27 17:32:03 2020
    
    An error just occurred.

    I'm interested to understand the last part of the example in the WIKI https://transportfever2.com/wi…ction_postRunFn.lua.html#

    Here is the part:

    I have so far found that this is overwriting the first params created above this section. Why make an example so complicated for "newbies" and no comments in the code?

    Anyway, I have in my tests run without this part and got it to start, but I get an error when trying to build the construction. "No mod"


    in the construction directory there is only the .script file, but no con file (the name of the con is same as the script file) as it is built dynamically in the mod.lua:

    The settings are updated and that can be seen when selecting the construction in the game. I get the feeling that the script file isn't started and I can't find my fault.

    (The script file worked earlier before I rewrote the mod.lua to make the dynamic construction.)



    transportfever.net/wsc/attachment/159633/


    stdout.txt


    snippet from the mod.lua

    I'm testing to make a new type of narrow bridge. The track is narrower than standard and I have with success got it to snap when building the second track along the first as long as it is built on the ground.


    The issue is to get the second bridge to snap to the first. Pillars and railing are not snapping. They are build as two separate bridges though the second track is snapping to the first. I have spent a lot of hours to find a solution, but this will not work for me. Is there a common trick that I have to have in my mind when trying?


    Some will probably send me a comment on the strange height and curve setting for the track. I can understand that, so instead of getting focused on that I write, I know it is a bit strange...


    the t.shapeWidth + t.shapeStep = 1.25m and that is the distance I have between centers of the tracks. I have built the pillar and railing to the same width, but it doesn't matter what width I build as it will not snap.

    In the WIKI there are documented some parameters that I have also played with, but no success (pillarWidth, railingWidth). WIKI also contains information about t.trackDistance that warns of having distances other than 5m, but it doesn't say that there is a risk of problems when building bridges. The ballast and catenary gantry are working in my mod.



    Zitat von WIKI Tracks /Street

    Track configuration

    It is possible to drag parallel with this distance from an existing track.

    Code
        trackDistance = 5.0   -- [m] distance between track centers

    Be aware that a trackDistance other than 5 meters might result in problems with the ballast track bed and catenary pole gantry generation.





    track.lua snippet



    bridge.lua snippet

    Code
        carriers = {"ROAD","RAIL"},
        speedLimit = 360.0 / 3.6,
        
        pillarLen = 1, 
        pillarMinDist = 6.0,
        pillarMaxDist = 100.0,
        pillarTargetDist = 10.0, 
    
        cost = 360.0,

    (themes is my param transfered from mod.lua to con)

    I have downloaded the motras project to have a framed package of an example to follow as I have some difficulties to understand and find the stylelist:get or themes elsewhere. I'm not successful in this way as the motras project doesn't look like the example above. I have also tried to follow the thread in the UG example of track module, but that is even harder. I have the wish to see a complete example from mod-lua, .script and .con file


    My question: is the snap of an example above something from the motras project?