Beiträge von RadiKyle

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


    Well, if you have a text file of the whole tree (including ids and name) it is much easier to development. Or selecting an element in the ui and finding a element with id around it.


    There is a reason why I have build such tools for myself and offer them...

    I know. This is what I thought the api.gui provided, similar to results pulled from api.res tables. But nope.


    Unfortunately can't require custom APIs when supporting mods across the entire playerbase and all platforms. These features really need to be in the vanilla API. I'm hoping there is improvement in TpF3 (but I'm also not holding my breath).

    Hi, ty for reply. (Sorry I did not have notifications turned on so did not see it earlier 🤦‍♂️)


    I do not have CommonAPI2, only the base game API.


    After days (wasted) of experimenting, I learned that the "structure" that I want to see is not accessible in the API. There is no single "table" that shows the structure and elements of GUI windows. Instead we have to probe it level by level, bit by bit, checking each element. 😵‍💫


    If I had any knowledge about OOP I probably would have known this already, that the game API does not give "free" access to the GUI layout data all at once, and instead we can only probe small pieces of it using the class functions. It was very difficult to learn because I have no OOP knowledge/experience. (Edit: And also because the API ref site is very confusing and often not very informative, especially if someone is not a software developer.)


    So I learned that the "screenful of functions" I mentioned above are actually the only way to examine each GUI element. And those functions give very little clues so we have to guess a lot and have some fore-knowledge about the window layout. It's a very tedious process... 🥴 The functions :getName() and :getNumItems() are probably the two most useful ones.


    Eventually I made progress and finished that mod. Now starting a different one. A hard experience but now I feel at least 12% knowledgeable haha 🫠

    Hi, how can I view the structure and contents of a GUI layout such as a window?


    I can access a window layout using api.gui.util.getById(id), and I can add elements to it using :getContent() :getItem() :getLayout() :getTab() etc, but how to do view the structure and contents already in the layout?


    When I try :getContent() etc, I get a screenful of "generic" results that appear to be a list of the class member functions, but I see no specific info for the actual object entity (or subclass) that I am examining. For example for this Line window, it doesn't show how many items are in the layout, what is in those items, how many tabs, what components, etc. How do I view that structure?


    Hi, great mod! Could you please add the cargo platform from the liquid train station as a user-placeable station module so that we can add them to existing stations please? Currently the only station module available is the pipe connector. If we want to add liquid platforms to an existing station we have the destroy the entire station and build a new one.

    Thanks!


    Hi all, I'm looking for a script command to put in my mod that will automatically update any existing constructions (modular rail stations) on the map of a savegame when it is loaded. So far I have not found a solution from the API reference and studying other mods (also I'm still new to TpF scripting!).


    Context: I have an existing mod that used the postRunFn to change the updateFn of rail tracks to a custom script fileName. I did not use a wrapper function in that case, therefore the mod overrides any existing updateFn (badddd I know!). I have since learned a much better way to do things so that custom script file is no longer needed.


    The problem is that existing savegames already have rail stations on the map built with that early version of the mod. As you know, a station does not update to the latest mod code until it is manually "tickled" by the user with Configure and add/remove a module. Before the user does that, the updateFn of the modules in the station still point to the old custom script file. So if the user tries to toggle a construction param setting available in the updated mod while that custom script file is no longer on disc, there is an instant crash to desktop. The error is base_config.lua ConstructWithModules "tab" value is empty -- because it's looking for the old custom script file that was assigned to the module when the station was built, but which is no longer on disc.


    If instead the user manually adjusts the station first, all the modules update so they no longer point to the old custom script file for updateFn. Now the user can toggle the new param option in the mod and nothing crashes.


    So one option seems to be to simply leave the old custom script file in the mod package as a "legacy reference" to prevent crashes. It will never be run again by the mod, it's just an unused file. It exists only to prevent a CTD with any existing stations before the user manually Configures them.


    But is there a "cleaner" way to do this? A method that automatically forces an update of existing constructions on the map when the savegame is loaded, so that the modules use the current updateFn definition and not the previous custom script? And that will let me remove that custom script file from the mod package?


    I am currently looking at something called "game.interface.upgradeConstruction" and not finding any documentation how to use it.


    Many thanks!


    PS in base_config.lua if I add a print(params) command for debugging, all of the modules in the station show "" for the updateFnScript fileName. So it's like part of base_config.lua has the updated mod definition, but somewhere it is still trying to find the old script file.

    Hi, the zip seems to be missing files, and it's really difficult to say what's happening without the complete set of mod files in their correct folders.


    Based on that .con and .lua file, the require statements and references for "fences" appear to be inconsistent/incorrect in several places, and as a result the reference on line 22 of the .con file (fences.fences.kl_ledning_H[1].offset) doesn't actually link to the table that appears to be defined in the .lua file at line 18.

    Hi, maybe take a look at the "Real Industrial Chains" mod for some ideas (it's on Steam, don't know if it's here too). That mod changes the industries that are working, and their production recipes, depending on the year. For example chemical plants are on the map in 1800s, but they sit there dormant and don't accept/produce anything (and don't spawn/despawn either). At different years the mod activates those industries, and also changes the production recipes of other industries to start requiring their products.


    There are other industry mods that do similar.

    Ah! I should have thought to check the lua library! 🤦‍♂️ For some reason I assumed this was native game code, not a general lua debug library. Thanks for that!


    I should have clarified that my follow-up question wasn't related to the original topic, sorry... It's for a different project where I'd like to check if certain .tga files are present, but it sounds like that's not possible with the default game api 😫 And there seems to be no api.res table for individual resource files (like .tga) so I can't check if one has been loaded.


    Ok thanks anyway. Cheers!

    LUA filesystem won't work,

    you would need to resolve the filesystem path. Only res/scripts/ is added to the lua search path for packages. Then you could use debug to get the filepath of a loaded file.

    Hi, a follow-up question on this point... Is there a script command to check for the presence of a file in the res/textures folders? So far I don't see any commands in the API wiki to check for files. It sounds like you're saying this is not possible.


    You also mention using debug... I have seen some mods with debug.xxx commands in them. Is there a reference somewhere of the available debug commands? I don't see any in the API wiki.


    Thanks!

    Yeah it makes sense. And if Common API 2 was a simple Steam mod I could require it as a dependency to use to it check for the other mod, basically use it as a function library. But it's obviously not reasonable to expect every Steam user to do that (or even GoG, etc).


    I suppose I could try to check the filesystem for the presence of the mod files, I think there are commands for that, but that doesn't mean the mod is actually enabled, so it's still not a solution.


    I've asked UG about this too, so maybe someday they will add a mod detection function to the API. I mean the active mods are the very first thing the stdout shows when loading a savegame, so it should be possible to make that list available in a table in the API. I think this is important when there are mods with well over 100K subscribers causing some issues and other mod authors need to be able to detect them to make compatibility fixes. It might even improve load times too because mods wouldn't need to do a bunch of awkward recursive if/then string searches of res .mdl names etc as a workaround. It could also enable dependency checking, which doesn't exist right now.


    Anyhow I guess all that's probably "old news" for everyone here, I imagine everybody already knows about gaps in the API.


    For now all I can do is remake all the .mtl / .dds files from scratch to produce a material that renders somewhat as intended with or without the other mod loaded. It's just frustrating because this was my first mod, and in my first version I made my own textures. Then I learned I could use opmaps to re-use existing textures (vanilla) in many different ways, much more efficient(!), so I change my materials to opmaps and I deleted my original textures. Then I encountered the issue that the other very popular mod doesn't render opmaps correctly, so now I need to go back to my original concept that I already deleted 🤦‍♂️ Newb learning problems haha 🙈 (Maybe file recovery utility will find something, assuming I didn't use SHIFT-DEL.)


    Anyhow thanks for your help and info here, it's very much appreciated 😌

    Technical no direct way, you can check for loaded mdls or anything other that can be accessed by api.res.*
    You can test load a unique lua file in the mod res/scripts/ folder with pcall + require.

    Well that's bad news 🙁 The mod has nothing but .fs shader scripts so there is nothing I can work with.


    The only way I know is to have the "other" mod define a global variable and check for it.

    The mod.lua does set a variable, but it seems it's a legacy variable that is no longer available in the code (game.config.shaderMod).

    Hey all, I need a postRunFn lua command to check if a specific mod is active in a game. My searches are coming up empty. How can I do this?


    The mod in question doesn't create any resources so I can't use the usual workaround of scanning resource tables.


    I see the console / stdout echo a list of active mods when a savegame is loaded. Is there a command to access that list?


    Thanks!

    I can only confirm that the Autobahn mod is using the vanilla azalea bush in the center stripe, but there is no model overwritten by my mod as the Autobahn mod doesn't have that resource, only a call to the game asset... I'm confused


    About my question from where it was downloaded.... A while ago there was a person that stole my mod and uploaded it to Steam. I hope there is no copy on Steam.

    Hi, no I haven't seen any of these mods on Steam, only here on TpFnet.


    All 3 of those mods have this issue (autobahn, kreuz, and baustelle), not just the main autobahn mod.


    It's true that they don't overwrite any of the vanilla game resource files, but the models they create somehow get used by the game when it generates new town buildings. I don't understand how it's happening either 🤷‍♂️ Maybe the game chooses from a "category" ("class"?) of resource assets when it creates new town buildings, and if a mod adds new assets to that category/class, they get used too?


    And the next question is how to "un-do" it so that the mods can be removed safely.


    I think it's not only the azelea bush this happens with. There are several other mtls and mdls in the error messages. When the mods are disabled, some appear to get substitutes (with the original vanilla resources?), and others get the white placeholder cubes, like the azalea bushes.


    If it helps, attached is a section from the stdout.txt file when I disable these 3 mods. Again, I did not build anything on the map with these mods yet (the year is still too early).


    Thanks

    Dateien

    • stdout.txt

      (11,74 kB, 248 Mal heruntergeladen, zuletzt: )

    Thanks for informing me, but I'm confused to read about discussions in Steam, Please send me a link on where I can find the thread.


    From where did you download the mod? Is it from Steam workshop?

    Hi! It's not important, it's a thread I started on Steam asking for ideas how to remove a mod that unexpectedly changed the vanilla resources for town buildings:

    https://steamcommunity.com/app…ns/0/3821908745311512175/

    We couldn't find a solution so I came here to ask.


    The mods (3) were all downloaded from here.


    Thanks!

    Hi, when I try to remove the 3 autobahn mods from a save game (autobahn, baustelle, and kreuz), there are warning messages about missing materials and models. Hundreds of placeholder cubes appear on the vanilla town buildings. Screenshot:

    https://imgur.com/a/txRVlIx

    It seems that these mods somehow replaced the vanilla azalea bush resources that are used by the town buildings. Note I did not actually build anything in these save games with these mods, I only enabled them, and now I want to disable them.

    There is a large discussion thread about this on Steam but so far we are unable to find a way to remove the mods and restore the town buildings to the vanilla resources. Could you please help fix this issue so we can safely remove these mods from save games? Many thanks!!

    Ah that's it!! Thanks!!! :) Yes the building at the link you posted is definitely the same one. I think the only difference is the angled conveyor connected to it. In the first screenshot (from reddit with the green loco), the conveyor would be inside the large silo building next to it. But in the second screenshot (from here on TFnet with the 2 buildings), the conveyor appears to be removed. They would be on the side of the building facing away from the camera (toward the 2 large white HaGe silos), and it looks like they are not there. So it appears that somebody has made a different version of this asset building that has the angled conveyor removed. But they are definitely related models using the same "base"! Thanks!!

    Hi everyone! I'm looking for the mod that has this old concrete grain (or coal?) filling station shown in these 2 screenshots I found:

    https://www.reddit.com/r/Trans…f1_at_the_grain_elevator/

    https://www.transportfever.net/gallery/index.php?image/36684-bnsf-leaving-grain-elevator/


    I circled them here:

    [Blockierte Grafik: https://i.imgur.com/GE1rQeM.jpeg]


    [Blockierte Grafik: https://i.imgur.com/fKOXKN1.jpeg]


    I posted about this on Steam, but after a week it is still a mystery where to find this building asset:

    https://steamcommunity.com/wor…8521110255/?appid=1066780


    The first screenshot is apparently from TF1 and the second one appears to be from TF2. I can't find this building in any of the TF1 or TF2 mods here or on Steam. I see another user asked about this here last year but it looks like there was no answer.


    Thanks!! :)