Dafür hat TPF2 eine Subroutine (Animal Movement System), die sich um die Tiere kümmert. Ich kann mich nicht an eine extra Modding Schnittstelle dafür erinnern.
Beiträge von eis_os
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
-
-
Die beiden Zip Dateien mal entfernen:
adding archive C:/Program Files (x86)/Steam/userdata/1539006311/1066780/local/mods/kaleut_br_1440_1/strings.lua.zip
adding archive wiede_autostrada_it_1.zip
Grundsätzlich gilt, keine Zip Dateien in irgendwelche Ordner von TPF2 legen... (oder sie sind Bestandteil des Spiels)
-
In der UG Wiki ist es richtig, wenn Ihr ein Übersetzungstool nutzt, braucht Ihr euch nicht wundern...
-
Neue Version 1.8.20240607
Erweiterte Funktionen für die Tram Track Types, Ihr könnt diese nun via Modding Schnittstelle auch in Konstruktionen nutzen.
Damit wird es nun möglich im Tram Track Paket die Depotstraße zu ändern um diese auswählen. (Die Gleise auf dem Hof sind im Modell)Weitere neue Funktion flexstreetscurve
Damit kann man das Rendern von Tramgleisen beeinflussen, damit werden eure Sims weniger durchgeschüttelt in KurvenWas gibt es noch?
CommonAPI2 kann nun das virtuelle Dateisystem von TPF2 ansprechen.
Es gibt einen neuen Tab "Goto" im Inspektor, damit kann man auf Map Koordinaten springen.
Hier ist es nun auch möglich einen Dateinamen aus dem Virtuellen Dateisystem abzufragen,
als Ergebnis bekommt man dann den echten Dateinamen auf eurer Festplatte, ggf. auch den Zip Dateinamen.
New version 1.8.20240607
New functions for Tram Track Types, it's now possible to use tram track types in constructions.
With this change, it's possible to change the street of tram depots and the tram track. (Note: the tram track in the depot model is fixed)
New feature flexstreetscurveThis feature changes the tram track rendering, so your sims won't get good shaking on curves.
Additional, the inspector window can now resolve filenames in the virtual filesystem, including if the file is in a zip.
This feature can be found in the goto tab, there you can jump to map coordinates too.
Schaut bitte im Handbuch nach wie Ihr die erweiterten Modding Funktionen nutzen könnt: https://commonapi2.bytetransfer.de/
Please look in the handbook how to use the new modding features.
Downloads:
-
Wäre erst mal schön wenn die api cmd Funktion überhaupt mal alle Funktionalitäten unterstützen würde.
Ich bin mir zum Beispiel ziemlich sicher, das meine Codeseite halt die LoadConfig und autoLoadConfig von Wagons beibehält,
es bringt nur nix, wenn dann UG beim Ausführen von cmd.make.replaceVehicle das nicht beachtet oder wegen irgendwelchen anderen Problemen nicht nutzt...
-
Be sure to have newevents, newlineevents and LINE_DESTINATION active.
At a selected line stop, use the More Settings... Button.
You can use copy & paste with clipboard to use your favourite texteditor,
TPF2 doesn't have a multi line Texteditor. If you don't want to use a texteditor, [x] and [+] will remove and add lines.
When the "Syntax is OK" you can enable the script with the checkbox.
You have actual two events: One when the vehicle arrives at the station, the second when it departs.
You will see an indicator on the line stop, if there is a vehicle script running (red > arrow)
As there is currently a downtime on my server, you can use the help button in the window to get a description of all functions in game.
The full information about vehiclescripts can be seen under https://commonapi2.bytetransfer.de
-

LUA Con files do get a reload call according my debug code for disabling the reload functionality.
So a simple con updateScript should work, I did test a asset con file and can see a reload happen if fastdebug mode is off. (Simple changing a print statement and it worked).
If you use *.script files accessed by new modules/constructions via postRunFn, these won't get any reload.
Neither my debug code got a call, nor changing something has an effect on reload behavior. Even if you remove game.res.script[<entryname>], TPF2 won't reload but will create an assert.
Technical there is a thing I would call Script Repository . (Different to Game Script Repository) These will load all *.script files, then this will get passed to ConstructionRep and has their own lua State.
Actually there a two copies for the script repo. The other one is used for soundsets...
-
CommonAPI2 can disable reloading in debug mode via fastdebugmode set to true, so you should check that
-
Ziemlich genau vor einem Jahr, 1.8.20230601, mit alten Versionen von TPF2 wirst du wenig weiter kommen, das war dann für Build 35330, 35313 and 35320,
-
Sorry, kann dir nicht folgen. Lese mal den Link durch. Du kannst das bei jedem Halt in die UI der CommonAPI2 reinschreiben...
-
Diese werden gekauft und verkauft. Es benutzt intern api.cmd.make.replaceVehicle damit das Spiel zufrieden ist.
Der Hauptpart der CommonAPI2 ausmacht, das du sowohl beim Halten des Zugs als beim Losfahren ein Event ausgelöst wird, ohne das irgend ein Script alle Fahrzeuge überwachen müsste.
Sprich von der Perfomance her viel besser, die Events werden direkt durch C++ Code erzeugt, wenn TPF2 den Status der Fahrzeugs ändert...
Und ja, es ist flexibel, du kannst mit LUA alles anstellen was UG via api zulässt. Du kannst auch deine eigene LUA Dateien aufrufen...
-
Technisch sollte die Datei ggf. einmal nicht im FileCache sein, dann geladen worden sein und fertig...
:: fügt TPF2 selbst bei der Ausgabe hinzu. Frag mich nicht wieso ...
-
ecs::RoadVehicleMoveSystem::Update2 mal bei Straßenfahrzeugen in Haltestellenumgebung suchen... Irgendwie sollte da ein Fahrzeug anhalten bzw. stehen, aber laut MovePath ist es sich noch am bewegen...
-
Ein Script via CommonAPI2 Line Events schreiben sollte wohl gehen
http://commonapi2.bytetransfer…eEvents?id=vehicle-events
Ungetestet, aber so in in etwa, hinten dranhängen:
und dann wieder abhängen:
Die mdl Dateinamen dann anpassen...
-
Du kannst das Gebäude/Konstruktion/Magnet komplett abreißen, die Sims werden gelöscht, dann kannst du Konstruktion neu bauen.
Das ändern einer Konstruktion wird wohl keine Neuerstellung der SimPerson(s) triggern.
Also der Code schaut sich alle Modelle mit availability Eintrag an.
https://www.transportfever2.co…rcetypes:mdl#availability
Bitte beachte, das die Autos ggf später erst gesetzt werden, wenn TPF2 dann im ecs::Component::SimPerson -> moveModes[zielId] eine 1 vorfindet. Der Code den ich euch oben da gepostet habe, hat 3 Ziele. Ich frage mich ob man TPF2 auch mehr Ziele beibringen könnte pro Person. Auch könnte man theoretisch mit der Aufenthaltsdauer experimentieren. Sprich immer wenn TPF2 da ein waitingTime herausknobelt. Damit hätte man weniger Wohnungen & Gebäude aber grundsätzlich mehr Verkehr. (Natürlich damit auch mehr CPU Last)
-
Irgendwann wird ne Konstruktion oder SimBuilding dieses hier aufrufen:
Man beachte "GetPersonModelsForYear" , man beachte auch, das die Aufenthaltszeit via Ramdom Number Generator erzeugt wird. (waiting Time)
Auch wenn ein Sim nach Hause teleportiert wird, wird auch wieder der Zufallszahlengenerator heran genommen.
Darüber hinaus, TPF2 repariert ziemlich am Ende eines Ladevorgangs die Personen (ggf. auch noch Savegame Versionsabhängig)
Sprich sobald eine Konstruktion irgendwie repariert oder gebaut wird, werden Einwohner erstellt. Diese sind von der GameTime abhängig, den ganzen Wust zu year zu gelangen, hab ich euch erspart.Wie man sieht residentsToAdd ist abhängig SimPersonSystem, mein Meinung dazu, TPF2 wird bei Umbauten keine Personen neu erstellen, sondern nur die fehlenden Personen erstellen,
wozu eine SimPerson gehört, weiß dann das SimPersonSystem
C++: UG Exe PseudoCode
Alles anzeigenparcel_util::AddSimPersons: capacity = get(ecs::component::PersonCapacity, entity) capacity->type != 0 -> mache nix -> return residentsToAdd = capacity->capacity - ecs::SimPersonSystem::Something(simPersonSystem, entity) personModels = anonymousnamespace::GetPersonModelsForYear(modelRep, year); foreach(residentsToAdd) { randomInList = RandomGenInt(&randomgen, 0, personModels.size()); modelId = ModelRep::GetOrLoadModel(modelRep, &personModels._VectorFirst[randomInList]); model = modelRep->GetModel(modelId); colorConfig = GetColorConfig(v20, modelId); comp_entity_person.targetOrAtEntity = entity.id; comp_entity_person.lastNonResType = 2 - RandomGenInt(&randomgen, 0, 2) != 0); comp_entity_person.speed = RandomGenFloat(&randomgen, 6.0, 8.0) / 3.5999999; comp_entity_person.modelIdPerson = modelId; if ( colorConfig <= 0 ) comp_entity_person.colorConfigPerson = -1; else comp_entity_person.colorConfigPerson = RandomGenInt(&randomgen, 0, colorConfig); comp_entity_person.modelIdCar = -1i64; comp_entity_person.cargoType = cargoTypeRep->m_passengersIndex; comp_entity_at_building.waitingTime = RandomGenFloat(&randomgen, 1.0, 300.0); comp_name = NameRep::CreatePersonName( person_metadata->gender ) ecs::Engine::AddEntity(engine, &entity_person); ecs::Engine::Add_SimPerson(engine, &entity_person, &comp_entity_person); ecs::Engine::Add_SimEntityAtBuilding(engine, &entity_person, &comp_entity_at_building); ecs::Engine::Add_Name(engine, &entity_person, &comp_name); -
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.
For ModManager functionality I asked them about ModRep and Filesystem functionality long time ago, they refused that.
You may get more support from them, simply send them more feedback requests.
Fun fact, currently I add new apis to commonapi because of lack of better functionality of the game.
So I have now commonapi._native.utils.resolvePath("res/shaders2/fs/std.fs")
Code: Console
Alles anzeigen>> a, b, c = commonapi._native.utils.resolvePath("res/construction/depot/tram_depot_era_a.con") >> "res/construction/construction.zip/depot/tram_depot_era_a.con" >> a, b, c = commonapi._native.utils.resolvePath("res/capi_config/tramtrack/eis_os_nocat.lua") >> a "mods/eis_os_tramtracks_1/res/capi_config/tramtrack/eis_os_nocat.lua" >> b "eis_os_tramtracks" >> c 1Here we see, the first file is actual in the zip file, the second is in my mods folder. These functionality is in game, but UG refuses to give us the apis.
As we don't want to unzip files myself I build a new lua loadfile interface and a wrapper commonapi.utils.getFileDataViaFS, that calls the data function.
And if you really want to load say a binary file, I even have now raw function:
Code>> a, b,c = commonapi._native.utils.getFileRaw("res/shaders2/fs/std.fs") >> a "#version 150\ /// BEGIN AUTOGENERATED HEADER\ #define CONC(a,b) a##b\ \ #define IF(c, t, e) CONC(IF_, c)(t, e)\There is a simple reason I won't add CommonAPI2 to steam, people refuse to understand CommonAPI2 is game version and platform dependent... it was a nightmare of user feedback.
If UG releases the "Last Version" of TPF2 I may upload it again. Still this won't help mac users...
-
That is why CommonAPI1 and 2 has commonapi.mods.getLoaded() (you have to check for commonapi presence, won't work without native dll)
You get a list of entries like this:
Code
Alles anzeigen{{ data = { info = { authors = { { name = "Urban Games", role = "CREATOR" } }, cosmetic = true, description = "MOD_LEGACY_VEHICLE_PACK_DESCRIPTION", minorVersion = 0, name = "MOD_LEGACY_VEHICLE_PACK_NAME", severityAdd = "NONE", severityRemove = "CRITICAL", tags = {}, visible = true }, runFn = <function 1> }, id = "urbangames_legacy_vehicle_pack_1", name = "MOD_LEGACY_VEHICLE_PACK_NAME", path = "mods/urbangames_legacy_vehicle_pack_1/", version = { 1, 0 } }, { data = { }, id = "eis_os_com_modularstationadapter_1", name = "CommonAPI2 - Modularer Bahnhof Adapter", path = "mods/eis_os_com_modularstationadapter_1/", version = { 1, 10 } }, [...] } -
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. -
CommonAPI2 kann nicht richtig geladen werden,
Meldungen sind grundsätzlich nicht einfach Wegzuklicken!
Wenn du wirklich mit der neusten Spielversion und CommonAPI2 spielst, könnte ein Virenscanner ggf. die Ausführung beeinträchtigen. Technisch gibt es keinen Grund wieso gerade die c++ RTTI Daten nicht gefunden werden können.