Data structures returned by game.interface

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.

 

Registration and use is of course free for you.

 

We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • A comprehensive overview over the data structures returned by game.interface.getEntity for different entity types

    [h1]Entities[/h1]


    Everything in the game of Transport Fever is an entity. This includes assets, industries, stations, vehicles, and even lines. To fetch information about them from the game interface, you can use the following methods:


    • game.interface.getEntities({pos, radius}, {type, includeData})
    • game.interface.getTowns()
    • game.interface.getLines({stationGroup})
    • game.interface.getVehicles({line, depot, carrier})
    • game.interface.getStations({town, townRadius, carrier})
    • game.interface.getDepots()



    All of these functions return an id, which is an integer. You can get the data behind an ID with the function game.interface.getEntity(id). Depending on which type of entity is returned, the data structures are different. game.interface.getEntities allows you to instantly fetch the data together with the ID. Also, this function allows you to specify an entity type filter.



    ASSET_GROUP


    Note: Assets with valid groundFaces are by definition a construction and will appear in the list CONSTRUCTION instead of ASSET_GROUP.



    CONSTRUCTION




    LINE


    Note: lines can't be fetched with the game.interface.getEntities-method. Use game.interface.getLines instead.



    SIM_BUILDING



    STATION_GROUP



    STATION



    TOWN



    VEHICLE_DEPOT



    VEHICLE


Share