​CommonAPI2 quickstart guide

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


Sie betrachten gerade eine ältere Version des Eintrags. Klicken Sie hier, um zur aktuellen Version zu gelangen.

  • CommonAPI2 Quick guide

    <h2>

    CommonAPI2

    </h2>

    <p>CommonAPI2 is build in two parts::</p>

    <ul>

    <li>A normal script - mod</li>

    <li>Binary “native” part (dll for windows, so library for linux)/li>

    </ul>

    <p>With binary “native” part it’s possible to modify the game memory and change the game at low level to add new stuff to the game. </p>

    <p><br></p>

    <p> == Is CommonAP2 loaded? ==%/lb/% </p>

    <p>The binary native part will be loaded as soon as the mod is installed.</p>

    <p>At the top left corner there will be a CommonAPI2 menu as soon as the main menu is shown.</p>

    <p><br></p>

    <p>Additional api functionality for other mods and in-game addons are only fully active, if commonapi2 is active in the savegame via the mod list.</p>

    <p>

    It’s only possible to install one version of CommonAPI, if you don’t subscribe to the steam version, you have to install CommonAPI2 into the mods folder of the game. The folder has to be named eis_os_commonapi2_1, otherwise commonapi2 will not work correctly. The zip provides always has the right folder name!</p>

    <p>Subscribing to the steam version and local installation won’t work!

    </p>

    <p><br></p>

    <p>

    </p>

    <p>For testing if you think the native part (dll or so) creates a crash, it’s possible to temporary disable commonapi2 native part via commonapi2 setttings.</p>

    <p>Disabling the native part can create several problems and loading times may increase. If you think you can’t use the native part, it is strongly recommend to uninstall or unsubscribe!</p>

    <p>If you you have problems, please leave a bug report, otherwise errors can’t be fixed.

    </p>

    <p><br></p>

    <p>

    1 Requirements

    </p>

    <p>The mod download and upgrade function needs curl. (curl will be provided by Windows 10 1803 or later)</p>

    <p>Additional on windows 7-zip is required for mod extracting and upgrade: <a href="https://www.7-zip.org/">https://www.7-zip.org/</a></p>

    <p>On linux commonapi2 requires curl and p7zip-full)</p>

    <p><br></p>

    <p>

    2 Functions

    </p>

    <ul>

    <li>Train destination display</li>

    <li>API for mod authors</li>

    <li>Lua console on all LUA states</li>

    <li>Changing mod settings (settings.lua)</li>

    <li>Mod list export and importt</li>

    <li>Check for new mod versions on transportfever.net </li>

    <li>Upgrade mods from transportfever.net</li>

    </ul>

    <p><br></p>

    <p> === Line Destination display ===%/lb/% </p>

    <p><br></p>

    <p>Currently there is only a German description for LINE_DESTINATION:</p>

    <p><a href="https://www.transportfever.net/lexicon/index.php?entry/344-commonapi2-endhaltestellen-anzeige-line-destionation/">CommonAPI2 Endhaltestellen Anzeige (LINE_DESTINATION)</a></p>

    <p><br> === CommonAPI menu ===%/lb/% </p>

    <p>The commonapi menu can be toggled via right Alt + C ein.<br>Several functions can be reached here:</p>

    <p><br></p>

    <p>

    2.1 Folders

    </p>

    <p>Directly open the installation and local user folder of the game .</p>

    <p><br></p>

    <p> ==== Lua Console ====%/lb/% <br>Die Lua Console zeigt euch direkt die letzten Meldungen der stdout.txt an.</p>

    <p>Directly send lua statements to all lua states of the game (commonapi2 has to be in the game mod list)</p>

    <p>Drop down list to switch between lua states / threads of the game</p>

    <p><br></p>

    <p> ==== Mod settings ====%/lb/% </p>

    <p><img class="woltlabAttachment" src="https://www.transportfever.net/wsc/index.php?attachment/149518-commonapi2-modeinstellungenupgrade-jpg/&amp;thumbnail=1" data-attachment-id="149518"><br></p>

    <p>Viele Mods beinhalten die Möglichkeiten Einstellungen per settings.lua im jeweiligen mod Verzeichnis zu ändern.<br>Sobald Ihr im Lademenü eines Spiel seid, könnt Ihr über CommonAPI Mods -&gt; Mod Einstellungen, alle aktiven Mods sehen bzw. auch einstellen.</p>

    <p><br></p>

    <p>Im "Mod Einstellungen" Fenster:<br>Sobald eine Mod settings.lua unterstützt, gibt es rechts neben der Modifikation einen Button "Einstellungen"</p>

    <p><br></p>

    <p>Sobald Ihr einen Eintrag auswählt, zeigt CommonAPI2 weitere Informationen an (untere Tabs), außerdem werden Mods hervorgehoben sobald es ein Update gibt.</p>

    <p>Dafür müsst Ihr die neusten Daten von TransportFever.net herunterladen, das geht über den obere Knopf "Update Informationen herunterladen")</p>

    <p><br></p>

    <p>

    <br>Veränderungen während des Spiels sind meist erst nach dem (Neu-)Laden eines Spielstands aktiv. (Ggf. Spielstand sichern und laden)</p>

    <p><br></p>

    <p>Ein Upgrade eines Mods ist während eines Spiel nicht möglich.

    </p>

    <p><br></p>

    <p>Hat die Mod Abhängigkeiten definiert, so könnt Ihr diese unter "Dep" nachschauen.<br>CommonAPI2 zeigt euch Links an, damit Ihr diese per Steam oder Forum Download installieren könnt.</p>

    <p><br></p>

    <p>Darüber hinaus überprüft CommonAPI2 auch Mod Abhängigkeiten, sofern diese vom Mod bereitgestellt werden und warnt euch wenn ein Mod inaktiv oder nicht installiert ist.</p>

    <p><br></p>

    <p> === Modlisten Export &amp; Import ===%/lb/% <br>Im Lademenü von Spielständen und den erweiterten Einstellungen für ein neues Spiel könnt Ihr die aktive Modliste exportieren und importieren.</p>

    <p><br></p>

    <p>Dafür im CommonAPI2 Mods Menü -&gt; Modliste exportieren bzw. importieren klicken</p>

    <p><br></p>

    <p>Beispiel: Alter Spielstand im Spiel Laden Menü auswählen, das Spiel nicht starten, im CommonAPI2 Mods Menü -&gt; Modliste exportieren klicken und Abspeichern.</p>

    <p><br></p>

    <p>Im Hauptmenü -&gt; Freies Spiel -&gt; Erweitert ... (Nun sieht Ihr eine Modliste). Dann CommonAPI2 Mods Menü -&gt; Modliste importieren klicken.</p>

    <p><br></p>

    <p><br></p>

    <p> == Verschiedene Versionen ==%/lb/% <br>Meisten ist die Steam Version eine alte aber recht stabile Version, dieses gilt auch für die Webdisk.<br>Im CommonAPI Forum Thema gibt es regelmäßig -dev Versionen zum testen der neusten Funktionen.</p>

    <p><br></p>

    <p><br></p>

    <p>

    3 buildoverwrite

    </p>

    <p> === TPF2 Build not supported, error message on the main menu, using build overwrite ===%/lb/% </p>

    <p><br></p>

    <p>Sometimes Transport Fever 2 get new updates (builds)</p>

    <p>In the forum I will post information about compatibly to the new TPF2 build and how to enable commonap2 to work with a certain game build via build overwrite. (Steam, GOG, Windows and Linux)</p>

    <p>Please follow this link and look at the last message <a href="https://www.transportfever.net/index.php?thread/13025-commonapi2-neue-versionen-und-wichtige-informationen/">CommonAPI2 - Neue Versionen und wichtige Informationen</a></p>

    <p><br></p>

    <p><br></p>

    <p> === buildoverwrite step by step guide ===%/lb/% </p>

    <p><img class="woltlabAttachment" src="https://www.transportfever.net/wsc/index.php?attachment/187204-commonapi2-buildoverwrite-failbackui-jpg/" data-attachment-id="187204"></p>

    <ol>

    <li>Click on the red error message in main menu</li>

    <li>The commonap2 emergency settings window appears. </li>

    <li>Scroll down until you can change Build overwrite</li>

    <li>Insert the right build overwrite string as mentioned on the forum (to get a cursor, simple click in the small text window)<br>I will provide the necessary string for tested versions</li>

    <li>Click on save, close the window then close the game.* On Linux the emergency windows build with the TPF2 toolkit may hang the game, please kill the TransportFever2 task, the reason there is no steam release currently!</li>

    <li>After a game restart you should see the commonapi2 menu again. If you get an error about the native part is disabled, please check your settings, you have enabled/checked disable native lib!</li>

    </ol>

    <p><br></p>

    <p> == Additional informationen ==%/lb/% </p>

    <p><a href="https://www.transportfever.net/index.php?thread/13025-commonapi2/">CommonAPI2</a></p>

    <p><br></p>

    <p>

    4 Downloads

    </p>

    <p><a href="https://www.transportfever.net/filebase/index.php?entry/4806-commonapi2/">CommonAPI2</a></p>

    <p><a href="https://www.transportfever.net/filebase/index.php?entry/4807-commonapi2-modulare-bahnhofsadapter/">CommonAPI2 - Modulare Bahnhofsadapter</a></p>

    <p><a href="https://www.transportfever.net/filebase/index.php?entry/4980-commonapi2-train-depot-adapter/">CommonAPI2 - Train Depot Adapter</a></p>

Teilen

Kommentare

  • It says the page is forbidden when going to the download for all 3 links

  • Is it just me but my download says that all the files are password protected.

    • Please read the download site, the current zip password is mentioned there.

  • Please add a version for Mac!😭

    • A MacOS version won't be possible, supporting 2 platforms is already enough...

      Daumen hoch 1
  • Thank you for this wonderful mod. I have used it to export the modlist from my projects so that I can check which mods I use against a masterlist of everything I subscribe to. So easy to use.

  • Zitat

    Changes while in game a usually not possible

    ;)