This shows you the differences between two versions of the page.
modding:developerinfo:streets [2018/02/08 11:17] 127.0.0.1 external edit |
modding:developerinfo:streets [2019/03/19 10:18] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Streets ===== | ||
- | ==== Overview ==== | ||
- | |||
- | A street configuration files specifies a set of parameters to define the properties, dimension, features and visuals of streets. They are stored in ''.lua'' files in the folder ''res\config\street\''. | ||
- | |||
- | The file has the following format: | ||
- | |||
- | <code lua> | ||
- | function data() | ||
- | return { | ||
- | -- property and dimension definitions | ||
- | -- ... | ||
- | |||
- | materials = { | ||
- | -- material definitions | ||
- | }, | ||
- | assets = { | ||
- | -- asset definitions | ||
- | }, | ||
- | bridges = { | ||
- | -- bridge definitions | ||
- | }, | ||
- | } | ||
- | end | ||
- | </code> | ||
- | |||
- | === Properties and dimensions === | ||
- | |||
- | Example: | ||
- | |||
- | <code lua> | ||
- | function data() | ||
- | return { | ||
- | numLanes = 4, -- number of lanes | ||
- | streetWidth = 16.0, -- [m] width of the street (without sidewalk) | ||
- | sidewalkWidth = 4.0, -- [m] width of the sidewalk | ||
- | sidewalkHeight = .3, -- [m] height of the sidewalk | ||
- | yearFrom = 0, -- available from [year] | ||
- | yearTo = 1925, -- available until [year] | ||
- | upgrade = false, -- only used in the upgrade tool [bool] | ||
- | country = false, -- disallow town buildings [bool] | ||
- | speed = 60.0, -- [km/h] maximum allowed drive speed | ||
- | cost = 88.0, -- building costs per meter | ||
- | |||
- | -- material, assets, and bridge definitions... | ||
- | } | ||
- | </code> | ||
- | |||
- | === Materials === | ||
- | |||
- | The list of materials defines the materials used for various parts of the street. Every definition contains a link to a ''.mtl'' file and its size. | ||
- | |||
- | <code lua> | ||
- | materials = { | ||
- | streetPaving = { | ||
- | name = "street/country_new_medium_paving.mtl", -- base path: /res/models/material/ | ||
- | size = { 8.0, 8.0 } -- ??? | ||
- | }, | ||
- | |||
- | -- more material definitions... | ||
- | }, | ||
- | </code> | ||
- | |||
- | Available material definitions: (which are ALL optional) | ||
- | |||
- | * ''streetPaving'' | ||
- | * ''streetBorder'' | ||
- | * ''streetLane'' | ||
- | * ''streetStripe'' | ||
- | * ''streetStripeMedian'' | ||
- | * ''streetTram'' | ||
- | * ''streetBus'' | ||
- | * ''crossingLane'' | ||
- | * ''crossingBus'' | ||
- | * ''crossingTram'' | ||
- | * ''crossingCrosswalk'' | ||
- | * ''sidewalkPaving'' | ||
- | * ''sidewalkLane'' | ||
- | * ''sidewalkBorderInnersize'' | ||
- | * ''sidewalkBorderOuter'' | ||
- | * ''sidewalkCurb'' | ||
- | * ''sidewalkWall'' | ||
- | |||
- | === Assets === | ||
- | |||
- | Contains a list of asset models, which will be placed along the street. | ||
- | |||
- | <code lua> | ||
- | assets = { | ||
- | { | ||
- | name = "asset/lamp_old.mdl", | ||
- | offset = 5.0, -- [m] offset along the street | ||
- | distance = 17.0, -- [m] distance between assets | ||
- | prob = 1.0, -- [0.0 - 1.0] placement probability | ||
- | offsetOrth = 3.4, -- [m] offset perpendicular to street direction | ||
- | randRot = false, -- random rotation [bool] | ||
- | oneSideOnly = false, -- place only on one side of the road [bool] | ||
- | alignToElevation = false, -- align to elevation [bool] | ||
- | avoidFaceEdges = false, -- asset not placed at street segment border (avoid... | ||
- | -- ...overlaps with bigger assets, i.e. tree beds) | ||
- | placeOnBridge = true, -- place on bridges [bool] | ||
- | }, | ||
- | |||
- | -- more asset definitions... | ||
- | }, | ||
- | </code> | ||
- | |||
- | === Bridges === | ||
- | |||
- | Contains a list of ''.lua'' files with available bridges. | ||
- | |||
- | <code lua> | ||
- | bridges = { | ||
- | "stone_old_medium.lua", | ||
- | |||
- | -- more bridges... | ||
- | }, | ||
- | </code> |