CTD Station on screen, TransportFever 2 Update

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


  • Continuing from Post #18


    In the stdout.txt that I have posted in #18 there is some rows that I can't understand, especially row 2204 and 2209


    The row 2197 is also interesting. This is nothing that my script is printing. Could that mean that here is something wrong with the mod?


    for example:

    I think game.interface.bulldoze() has been removed from the game entirely.

    game.interface.bulldoze can remove a station I just build a few seconds ago...


    When I try to bulldoze my test station (console command seen in image below) I get repeated errors like the snap from stdout.txt above. Could it be that doug is right that bulldoze no longer exists?


    eis_os Please tell me what I have to do.


  • Yeah, the problem is you need to bulldoze the construction and not the station or station group.
    However it seems there is no direct pointer from station to construction entity.


    So you have to traverse all construction you get by getEntites filtering with construction. Then look in the station key

  • You can see that it works:


    Start a new game

    Build a station


    Use UGs Debug Mode Window, click on the construction to get the entity id (the entity component list shows construction) to get the right id.


    Open CommonAPI2 Console, select Script thread, then use this id.


    game.interface.bulldoze(<the construction id>)


    Note: if you click on the station sign, you get the id of the stationsign (doesn't have ecs construction in the list) If you try to bulldose this id, you get an exception.


    Again, please do a test run yourself to see that you really use the right entity id of a construction and not the attached station sign or station group.

  • Thank you!

    I finally found one part that has the ecs::component::Construction in the list. It was in the test game 22571.

    Bulldoze that number and the station is gone.


    Now I have the tricky thing left. To get the script finding this number. I will return with a report later.


    My script gets the same iD number as I manually have found in the test game!:)

    but when using the same script in the game with trouble, I get the Assertion error again:(

    Einmal editiert, zuletzt von melectro ()

  • eis_os

    Hat den Titel des Themas von „TransportFever 2 Update“ zu „CTD Station on screen, TransportFever 2 Update“ geändert.
  • Yeah, the problem is you need to bulldoze the construction and not the station or station group.
    However it seems there is no direct pointer from station to construction entity.


    So you have to traverse all construction you get by getEntites filtering with construction. Then look in the station key

    call this in the vanilla console he will get the construction id


    Code
    api.engine.system.streetConnectorSystem.getStation2ConstructionMap()[game.interface.getEntity(station_group_id_seen_from_ui).stations[1]]


    then if game.interface.bulldoze is callable, he can try to remove it


    the game api give the proposal constructor to remove a construction, but they forgot to give the command builder for that..

    This guy is too lazy to create a signature. 8o

  • call this in the vanilla consol


    EDIT: I don't understand "station_group_id_seen_from_ui" inside the call.

    If I try to use the id found for the actual damaged construction, I get this:


    api.engine.system.streetConnectorSystem.getStation2ConstructionMap()[game.interface.getEntity(249965).stations[1]]

    I have rechecked with my script the id for the station once again and it confuses me when this call writes the same number as entered inside the call.


    Anyway, I have after the call above tried to bulldoze the Id (in script thread)

    game.interface.bulldoze(249965)

    and the same error as before was returned.


    Scrolling the map into the area where the station is located is still creating a CTD.

    9 Mal editiert, zuletzt von melectro ()

  • I've tried it seems only ug is able to help you fix the map


    Even with vanilla api it doesn't work


    >> p = api.type.SimpleProposal.new()

    >> p.constructionsToRemove = {66248}

    >> c = api.cmd.make.buildProposal(p, nil, true)


    c:\build\tpf2_steam\src\lib\ecs\engine.h:275: int __cdecl ecs::Engine::GetComponentDataIndex(const class ecs::Entity &,int) const: Assertion `it != components.end()' failed.


    >

    This guy is too lazy to create a signature. 8o

BlueBrixx