User Tools

Site Tools


modding:developerinfo:streets

This is an old revision of the document!


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:

function data()
return {
	-- property and dimension definitions
        -- ...
 
	materials = {
                -- material definitions
	},
	assets = {	
                -- asset definitions
	},
	bridges = {
                -- bridge definitions
	},
}
end

Properties and dimensions

Example:

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...
}

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.

materials = {
	streetPaving = {
		name = "street/country_new_medium_paving.mtl",     -- base path: /res/models/material/
		size = { 8.0, 8.0 }                                -- ???
	},
 
	-- more material definitions...
},

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.

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...
},

Bridges

Contains a list of .lua files with available bridges.

bridges = {
	"stone_old_medium.lua",
 
	-- more bridges...
},
modding/developerinfo/streets.1518085052.txt.gz · Last modified: 2019/03/19 10:19 (external edit)