Data structures returned by game.interface

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


  • 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


Teilen