CommonAPI2 Entwicklungsdiskussion, Fragen & Antworten

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


  • Moin. Wenn es hilft, das Spiel scheint nun über 2 mods Ordner zu verfügen. Einer, wie gewohnt im Spielverzeichnis (Steam > steamapps > common > Transport Fever 2 > mods, der andere unter Steam > userdata > eure Profilnummer > 1086780 > local > mods.
    Die Common API gehört in den letzteren der beiden Modordner. (Da muss man erstmal drauf kommen xD)

    Mit freundlichen Gruß


    BlackWolve

  • What do you mean. Where to install the CommonAPI2?


    The CommonAPI2 testing version should be placed/installed in:

    (Note: the zip has already a folder called eis_os_commonapi2_1, so don't duplicate the folder structure like .../mods/eis_os_commonapi2_1/eis_os_commonapi2_1, that won't work)


    c:/Programme (x86)/Steam/steamapps/common/Transport Fever 2/mods/eis_os_commonapi2_1/


    Then in savegame dialog, disable the unsubscribed and with red marked CommonAPI2 version, and enable the locally installed version.

    (You can change the mod loader via "enable option" on the right and clicking on the number)

  • Hallo eis_os, Ich lerne immer noch Deutsche, damit enschuldigung Ich werde meine Frage auf Englisch stellen...


    I still think UrbanGames' features in this update (like the F11 console) are not at feature parity with your dear_imgui interface, for example the in-game console has no way to clear text which kills FPS the more you use it. The value of CommonAPI is apparent, although I wish we had more control over the game engine but it looks like this update is going to give us some exciting stuff - I see a game.cmd and a game.engine, but the function signatures don't make sense yet so I'm waiting on the TpF2 wiki.


    My question is this: it looks like you've figured out how to inject/modify labels from a native/portable dll, I think you call yours "CommonAPI native." Is it much trouble to add a truly "CUSTOM" label type, such that we can call and dynamically update a label's text from Lua? I have tried to do this myself with my own crafted C++ dll, but clearly I am not as good at reverse-engineering this as you are and keep hooking the wrong things. std::boost<impl::> signatures haunt my dreams...


    Thanks!

  • Calling a lua function as in TPF1 was the initial plan. Much like my TPF1 Vehicle Animation feature. A reason I invested a lot time in the Lua Object mutex, so I won't run lua runtimes from different threads at the same time. I ended up rebuilding std::lock_guard to test if a lua runtime memory pointer is still valid.


    However in the end the label text function is performance critical, Means the code is run a lot. a short test filled the log with around 11000 logged calls in paused mode. As I can't store flags into an Line Object. (I have no idea of the internal memory structure except where the station entity id is stored) Neither I can register a notify for line object changes. Add stop/remove stop. Every time LINE_DESTINATION is called, it has to do a lot stuff.


    For every call, search a following end stop, then in reverse count how many times the stop is in the line. This way I have to store only, stopid + count/idx of this stop. As plus point, changes in the line, adding new (nonend) stops won't invalid the result.


    Yes, boost types are a pain.


    For stuff like label text I am not sure if the new modding interfaces will be helpfull. Stuff like notify if an entity event changes I haven't found yet.


    The next version of commonapi.dmp will allow dumping more userdata content.


    For me, neither the current UI features are helpfull.


    If I can use the new repository functions, I will see. game.ressources is empty at mod.lua runFn time. So I would need to break the promise, commonapi2 will give you everywere a list of ressources, even in modifers.

    Currently I am not willing to do that. Maybe it will be a hybrid approach someday, but for TPF2 I guess we will be stuck with the preloader.


    PS: The commonapi console is capped, after ~250 Lines (depending on build), otherwise my code would be to slow as well. Recent commomapi builds however are much slower as well. TPF2 calls std::cout from different threads wihout syncing. This made odd crashes in my console redirector. So I had do add a heavy mutex there too.

  • Neue Dev Version.


    Etwas für zukünftigen TPF2 Testing Versionen gearbeitet.

    Auch funktioniert der Modlisten Import nun mit Mods im Benutzerverzeichnis.


    Diese Version funktioniert mit den Steam - Versionen und stabilen GOG Version.


    Changelog:

    1.3.20200517-dev

    - Fix: Modlist import can't select local/mods, by extending commonapi.mods with a internal _realmodid

    - New: userdata dumping to commonapi.dmp / inspect.lua

    - New: Error message when more then one native dll is loaded

    - Start of support for TPF Windows Builds with new Linker options

    - Fix a lot Linux fragments for testing version. Line Destination / Entity system still not fixed


    - !!! This is a development version, heavy usage of DEBUG messages if loglevel is debug. Windows only release !!!



    Download gibt es hier:

    CommonAPI2 - Neue Versionen und wichtige Informationen



    Ich habe die CommonAPI2 unter dem Nutzerdatenverzeichnis getestet, ich habe bei einem kurzen Test keine Problee gesehen, ich bitte daher um mehr Infos diesbezüglich

  • Moin


    habe da folgende Fehlermeldung:



    Die angeblich fehlenden Mods sind aber vorhanden und sogar zuvor geladen.


    Grundsätzliche Frage: Was soll geschehen, wenn man auf den Workshop -button drückt?

    Wie funktioniert eigentlich das Update?


    Mir fehlt eigentlich eine Anleitung für den Mod, auch für den Bahnhofsadapter, vielleicht hab' Ichs nur nicht gefunden.

    Wäre für einen Link danbar.


    Merci

    Klaus

  • Apologies for the response in English. You can safely ignore the error message. As you can see here, I had the same message, and the Metronom works just fine:

    CommonAPI2 Entwicklungsdiskussion, Fragen & Antworten

    I'm sure eis_os will sort it out when he has the chance.

  • Workshop bringt dich auf die Steam Webseite, damit du das Objekt abonnieren kannst.

    doug Thanks for reporting, should be fixed with the newest version.



    Neue Version für Build 28962 und das Problem mit der SteamId Auflösung für Abhängigkeiten sollte behoben sein.



    1.3.20200520-dev

    - Support TPF2 Windows Build 28962 testing

    - New: Big fat error message if the Build isn't testet

    - Add different code paths for testing build 28962, modDescs in UI::ModDataProvider has different size

    - Fix: required mods by steamid not found, even when they are subscribed

    - Big Warning: Linux version not tested yet

    - Steam release


    Da es auf Steam eine Release gab, nun auch hier in der Webdisk

    CommonAPI2 Webdisk Download

  • Die Common API hat ein Problem mit gemoddeten Bahnhöfen.

    Ich habe das Modular Station Tool mit dabei. Wenn ich einen Oppies Bahnhof baue, geben die Module mit Oberleitung nach dem Bau keine Oberleitung.

    Bei Vanilla ist macht sie das.

    das gleiche hatte auch, da ich den Mod aus dem Workshop hatte, wenn du den von hier runterlädst müste es gehen

    16 GB Speicher AMD Ryzen 5 5600X 6-Core Nvidia GeForce RTX 3070

BlueBrixx