This shows you the differences between two versions of the page.
| Previous revision | |||
| — | modding:developerinfo:models [2025/03/04 09:22] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Models ===== | ||
| + | |||
| + | Models are stored in the '' | ||
| + | ==== Overview ==== | ||
| + | |||
| + | The format consists of geometric information for different levels of detail (LODs) and meta-data. For each LOD, there are a separate hierarchy of meshes (optionally organized in groups), animations, events, and a material configuration. | ||
| + | |||
| + | The meta-data holds all relevant information, | ||
| + | |||
| + | <code lua> | ||
| + | function data() | ||
| + | return { | ||
| + | |||
| + | -- optional: ' | ||
| + | |||
| + | lods = { | ||
| + | |||
| + | }, | ||
| + | metadata = { | ||
| + | |||
| + | }, | ||
| + | } | ||
| + | end | ||
| + | </ | ||
| + | |||
| + | ==== Reference ==== | ||
| + | |||
| + | === LODs === | ||
| + | |||
| + | A LOD consists of following table entries: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | |||
| + | === Metadata === | ||
| + | |||
| + | There is large set of meta-data keys to describe all the different types of models in the game. Below you can find an overview. For more details it's best to look at the '' | ||
| + | |||
| + | **General** | ||
| + | |||
| + | General meta-data can be applied to any type of model. Depending on the resource type, they might be mandatory, but can often be left empty to default to zero. | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | == description == | ||
| + | |||
| + | Explain translation | ||
| + | |||
| + | <code lua> | ||
| + | description = { | ||
| + | name = _(" | ||
| + | description = _(" | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | == availability == | ||
| + | |||
| + | yearFrom and/or yearTo can be left out or set to zero to define an indefinite start respectively end year. | ||
| + | |||
| + | <code lua> | ||
| + | availability = { | ||
| + | yearFrom = 1925, | ||
| + | yearTo = 1985 | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | == cost == | ||
| + | |||
| + | To activate automatic price calculation, | ||
| + | |||
| + | <code lua> | ||
| + | cost = { | ||
| + | price = 10000 | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | == maintenance == | ||
| + | |||
| + | To activate automatic maintenance calculation, | ||
| + | |||
| + | <code lua> | ||
| + | maintenance = { | ||
| + | runningCosts = -1, | ||
| + | lifespan = 40 -- [years] | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | == particleSystem == | ||
| + | |||
| + | == soundConfig == | ||
| + | |||
| + | The '' | ||
| + | |||
| + | <code lua> | ||
| + | soundConfig = { | ||
| + | soundSet = { name = " | ||
| + | effects = { | ||
| + | select = { | ||
| + | -- list of wav file to be played when the player clicks on the construction | ||
| + | } | ||
| + | } | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | Read more about soundSets [[: | ||
| + | |||
| + | == cameraConfig == | ||
| + | |||
| + | The '' | ||
| + | |||
| + | <code lua> | ||
| + | cameraConfig = { | ||
| + | positions = { | ||
| + | { | ||
| + | group = 0, | ||
| + | transf = transf.rotYCntTransl(math.rad(25), | ||
| + | fov = 90 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Vehicles === | ||
| + | |||
| + | Any vehicle in the game is a '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | Reversible rail vehicles need additional configuration. Please refer to [[modding: | ||
| + | |||
| + | == transportVehicle == | ||
| + | |||
| + | This part of the meta-data is used to set the carrier and all cargo/ | ||
| + | |||
| + | <code lua> | ||
| + | transportVehicle = { | ||
| + | | ||
| + | | ||
| + | -- capcities and positions of cargo | ||
| + | }, | ||
| + | | ||
| + | seats = { | ||
| + | -- optional position of driver and passenger seats | ||
| + | }, | ||
| + | | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | Depending on the carrier, a vehicle is either a '' | ||
| + | |||
| + | == railVehicle, | ||
| + | |||
| + | <code lua> | ||
| + | railVehicle= { | ||
| + | configs = { | ||
| + | -- axles configuration | ||
| + | -- fakeBogies configuration | ||
| + | -- lights configuration | ||
| + | }, | ||
| + | soundSet = { | ||
| + | -- soundSet configuration | ||
| + | }, | ||
| + | engines = { | ||
| + | -- engines configuration | ||
| + | }, | ||
| + | topSpeed = 100, -- [km/h] maximum speed the vehicle can reach | ||
| + | weight = 107, -- [t (metric)] empty weight of the vehicle | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | <code lua> | ||
| + | roadVehicle = { | ||
| + | configs = { | ||
| + | -- axles configuration | ||
| + | -- fakeBogies configuration | ||
| + | -- wheels configuration | ||
| + | }, | ||
| + | soundSet = { | ||
| + | -- soundSet configuration | ||
| + | }, | ||
| + | power = 60, -- [kw] maximum power the engine can produce | ||
| + | tractiveEffort = 10, -- [kN] maximum tractive force the vehicle can develop | ||
| + | topSpeed = 50, -- [km/h] maximum speed the vehicle can reach | ||
| + | weight = 1.6, -- [t (metric)] empty weight of the vehicle | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | <code lua> | ||
| + | airVehicle = { | ||
| + | configs = { | ||
| + | -- axles configuration | ||
| + | -- wheels configuration | ||
| + | -- elevator configuration | ||
| + | -- aileronLeft configuration | ||
| + | -- aileronRight configuration | ||
| + | -- flaps configuration | ||
| + | -- rudder configuration | ||
| + | }, | ||
| + | soundSet = { | ||
| + | -- soundSet configuration | ||
| + | }, | ||
| + | topSpeed = 230.0, | ||
| + | maxPayload = 0, -- [kg] (currently not in use) | ||
| + | maxTakeOffWeight = 78000.0, | ||
| + | maxThrust = 236000.0, | ||
| + | idleThrust = 11800.0, | ||
| + | timeToFullThrust = 3, -- [s] time the engines need from idle state to generate full thrust | ||
| + | wingArea = 122.6, | ||
| + | weight = 44000.0, | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | <code lua> | ||
| + | waterVehicle = { | ||
| + | configs = { | ||
| + | -- paddles configuration | ||
| + | -- rudder configuration | ||
| + | -- flags configuration | ||
| + | -- pendulumParts configuration | ||
| + | }, | ||
| + | soundSet = { | ||
| + | -- soundSet configuration | ||
| + | }, | ||
| + | weight = 135000.0, | ||
| + | availPower = 294000.0, | ||
| + | maxRpm = 55, -- [rpm] used to animate movable parts of the engines | ||
| + | area = 5, -- [m^2] cross sectional area, which linearly correlates with the drag force | ||
| + | topSpeed = 7.5, -- [km/h] top speed (movement speed is clamped to this value) | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | == car == | ||
| + | |||
| + | NPC controlled cars a defined by adding the (empty) '' | ||
| + | |||
| + | <code lua> | ||
| + | car = { } | ||
| + | </ | ||
| + | |||
| + | === Buildings === | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | **Misc.** | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||