User Tools

Site Tools

Urban Games

modding:constructiontypes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
modding:constructiontypes [2020/06/15 15:53]
yoshi [Stations]
modding:constructiontypes [2020/07/14 10:43]
yoshi [Industry Properties]
Line 28: Line 28:
 ===== Stations ===== ===== Stations =====
 Stations are the constructions where people and cargo items can board and leave vehicles. Like the [[modding:resourcetypes:mdl#transport_network_provider|transport network provider]] in single meshes, constructions can have streets and tracks too. Therefore there are three blocks in the result: Stations are the constructions where people and cargo items can board and leave vehicles. Like the [[modding:resourcetypes:mdl#transport_network_provider|transport network provider]] in single meshes, constructions can have streets and tracks too. Therefore there are three blocks in the result:
-  * ''result.edgeLists'' as described in the [[modding:constructions#edge_lists|construction basics]].+  * ''result.edgeLists'' as described in the [[modding:constructionbasics#edge_lists|construction basics]].
   * ''result.runways'' that are similar to the ones in the transport network provider but on edges from the ''edgeLists'' instead of the model lanes.   * ''result.runways'' that are similar to the ones in the transport network provider but on edges from the ''edgeLists'' instead of the model lanes.
   * ''result.terminalGroups'' that combines terminals from one or more models with the vehicle edges from the ''edgeLists''.   * ''result.terminalGroups'' that combines terminals from one or more models with the vehicle edges from the ''edgeLists''.
Line 77: Line 77:
  
 Please note, that it is currently not possible to select the lane of streets that are defined by edges in the construction for the vehicle node. By default, the vehicleNode will be placed on the first lane that is most likely a sidewalk. Please note, that it is currently not possible to select the lane of streets that are defined by edges in the construction for the vehicle node. By default, the vehicleNode will be placed on the first lane that is most likely a sidewalk.
 +
 +Once a ''result.terminalGroups'' block is defined, non grouped terminals are ignored.
 +
 +==== Assignment of Terminals to Stations ====
 +
 +To distinguish between the passenger and cargo part of a station, the ''result.stations'' list is used. 
 +It contains a list of sub stations each with their own properties:
 +  * ''terminals'' is a list of terminalGroup ids that are fetched in the order of the groups in ''result.terminalGroups''.
 +  * ''tag'' is an integer that is used to match a station to the station with the same tag before the update of the construction. If some orders change, this would lead to broken lines otherwise.
 +
 +<code lua>
 +result.stations = {
 +  { 
 +    terminals = { 0,1 }, 
 +    tag = 0
 +  },
 +  { 
 +    terminals = { 2,3 }, 
 +    tag = 1
 +  },
 +  ...
 +}
 +</code>
 +The same is done for terminals of different carrier types.
 ===== Depots ===== ===== Depots =====
 Depots are the places where the vehicles can be bought by the player. The construction files for depots lay in ''res/construction/depot/''. There are no additional property blocks for depots. Instead, a used model has a ''vehicleDepot'' block. The ''updateFn'' does not contain any special params except the custom parameters of the construction. Depots are the places where the vehicles can be bought by the player. The construction files for depots lay in ''res/construction/depot/''. There are no additional property blocks for depots. Instead, a used model has a ''vehicleDepot'' block. The ''updateFn'' does not contain any special params except the custom parameters of the construction.
Line 125: Line 149:
 The other block, ''placementParams'' is used for the automated distribution of industries over the map. The properties are used to contrain the distribution on dependance of previously built industries. There are: The other block, ''placementParams'' is used for the automated distribution of industries over the map. The properties are used to contrain the distribution on dependance of previously built industries. There are:
   * ''buildOrder'' is the order in which the industries are generated. Usually industries without inputs have low values and are built first.   * ''buildOrder'' is the order in which the industries are generated. Usually industries without inputs have low values and are built first.
-  * ''initWeight'' is the start weight of the industry distribution. With larger values, the industry is not very sensible to the other distance weights below.+  * ''initWeight'' is used to define the quantity ratio relative to the other industries.
   * ''tags'' is a list of string keys that are assigned to this industry.   * ''tags'' is a list of string keys that are assigned to this industry.
   * ''distanceWeights'' is a list of tag keys with assigned weights. If another industry has a tag with negative assigned weight, it is unlikely that the current industry is placed near it. With positive weights, it's more likely that they pull the new industry near them.   * ''distanceWeights'' is a list of tag keys with assigned weights. If another industry has a tag with negative assigned weight, it is unlikely that the current industry is placed near it. With positive weights, it's more likely that they pull the new industry near them.
Line 131: Line 155:
 ==== UpdateFn Parameters ==== ==== UpdateFn Parameters ====
 The available parameters for industries are: The available parameters for industries are:
-  * ''paramX'' and ''paramY'' are from the keyboard controls. See the [[modding:constructions#models|basics]] to find out more about them.+  * ''paramX'' and ''paramY'' are from the keyboard controls. See the [[modding:constructionbasics#models|basics]] to find out more about them.
   * ''seed'' is a number that can be used for randomization purposes. It increases whenever a construction is set.   * ''seed'' is a number that can be used for randomization purposes. It increases whenever a construction is set.
   * ''state'' is a data struct containing several cached informations about assets and tracks.   * ''state'' is a data struct containing several cached informations about assets and tracks.
Line 229: Line 253:
 ==== UpdateFn Parameters ==== ==== UpdateFn Parameters ====
 The available parameters for assets are: The available parameters for assets are:
-  * ''paramX'' and ''paramY'' are from the keyboard controls. See the [[modding:constructions#models|basics]] to find out more about them.+  * ''paramX'' and ''paramY'' are from the keyboard controls. See the [[modding:constructionbasics#models|basics]] to find out more about them.
   * ''seed'' is a number that can be used for randomization purposes. It increases whenever a construction is set.   * ''seed'' is a number that can be used for randomization purposes. It increases whenever a construction is set.
   * ''state'' is a data struct containing several cached informations about assets and tracks.   * ''state'' is a data struct containing several cached informations about assets and tracks.
Line 276: Line 300:
  
 ==== UpdateFn Return Properties ==== ==== UpdateFn Return Properties ====
-The returned data struct of town buildings should have the following properties that are described in the [[:modding:constructions|construction basics]]:+The returned data struct of town buildings should have the following properties that are described in the [[modding:constructionbasics|construction basics]]:
   * ''bulldozeCost''   * ''bulldozeCost''
   * ''cost''   * ''cost''
Line 333: Line 357:
  
 Their ''upgradeFn'' has only a small set of parameters: Their ''upgradeFn'' has only a small set of parameters:
-  * ''paramX'' and ''paramY'' are from the keyboard controls. See the [[modding:constructions#models|basics]] to find out more about them.+  * ''paramX'' and ''paramY'' are from the keyboard controls. See the [[modding:constructionbasics#models|basics]] to find out more about them.
   * ''seed'' is a number that can be used for randomization purposes. It increases whenever a construction is set.   * ''seed'' is a number that can be used for randomization purposes. It increases whenever a construction is set.
   * ''state'' is a data struct containing several cached informations about assets and tracks.   * ''state'' is a data struct containing several cached informations about assets and tracks.
Line 385: Line 409:
 \\ \\
  
-<div page_prev>[[:modding:constructions|Construction Basics]]</div>+<div page_prev>[[modding:constructionbasics|Construction Basics]]</div>
 <div page_next>[[modding:modularconstructions|Modular Constructions]]</div> <div page_next>[[modding:modularconstructions|Modular Constructions]]</div>
modding/constructiontypes.txt · Last modified: 2023/02/04 14:32 by yoshi