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/08/01 12:12]
yoshi [UpdateFn Return Properties]
modding:constructiontypes [2022/01/09 13:43]
yoshi [Terminal Groups]
Line 69: Line 69:
   },   },
   ...   ...
-},+}
 </code>   </code>  
      
Line 170: Line 170:
   * ''industrialCapacity'' might be a capacity for jobs of residents.   * ''industrialCapacity'' might be a capacity for jobs of residents.
  
-It is recommended to support these additional parameters to allow mission or game scripts to adjust the production and consumption of industries. The ''industryutil.lua'' in ''res/scripts/'' contains a possible implementation in the ''addIndutryData'' function.+It is recommended to support these additional parameters to allow mission or game scripts to adjust the production and consumption of industries. The ''industryutil.lua'' in ''res/scripts/'' contains a possible implementation in the ''addIndustryData'' function.
  
 ==== UpdateFn Return Properties ==== ==== UpdateFn Return Properties ====
Line 239: Line 239:
   autoRemovable = false,   autoRemovable = false,
   categories = { "misc" },   categories = { "misc" },
 +  snapping = { 
 +    rail = true, 
 +    road = true, 
 +    water = false 
 +  },
   ...   ...
 </code> </code>
Line 250: Line 255:
 To provide additional filter possibilities, it is possible to assign an asset construction to one or more categories. The string keys are added to the ''categories'' list.  To provide additional filter possibilities, it is possible to assign an asset construction to one or more categories. The string keys are added to the ''categories'' list. 
  
 +To allow snapping along tracks, streets or the water surface, the appropriate flags can be set to true in the ''snapping'' property.
 ==== UpdateFn Parameters ==== ==== UpdateFn Parameters ====
 The available parameters for assets are: The available parameters for assets are:
Line 312: Line 317:
 The ''personCapacity'' block defines the number of residents that can be covered by this building in the specific type of building: The ''personCapacity'' block defines the number of residents that can be covered by this building in the specific type of building:
 <code lua> <code lua>
-  personCapacity = { +result.personCapacity = { 
-    capacity = 2, +  capacity = 2, 
-    type = "INDUSTRIAL" +  type = "INDUSTRIAL" 
-  },+},
 </code> </code>
 It contains two properties: It contains two properties:
Line 324: Line 329:
 Buildings may request cargo items. Therefore they have ''stocks'' and ''rule'' blocks too: Buildings may request cargo items. Therefore they have ''stocks'' and ''rule'' blocks too:
 <code lua> <code lua>
-stocks = {+result.stocks = {
   {         {      
     cargoType = "MACHINES",           cargoType = "MACHINES",      
Line 333: Line 338:
 ... ...
 }, },
-rule = {    +result.rule = {    
   capacity = 1,       capacity = 1,    
   consumptionFactor = 1.2,       consumptionFactor = 1.2,    
Line 346: Line 351:
 The scaffolding is shown while the building is constructed. To define its outline, there is a ''scaffold'' property: The scaffolding is shown while the building is constructed. To define its outline, there is a ''scaffold'' property:
 <code lua> <code lua>
-scaffold = {    +result.scaffold = {    
   buildingFace = { { { 7.68415, 4.89475, 0 }, { 7.67744, 15.68718, 0 }, { 0.80814, 15.69474, 0 }, ... } },   buildingFace = { { { 7.68415, 4.89475, 0 }, { 7.67744, 15.68718, 0 }, { 0.80814, 15.69474, 0 }, ... } },
   height = -1   height = -1
Line 353: Line 358:
  
 The ''buildingFace'' is the bottom polygon around the house. The scaffolding is placed along the edges of this polygon with a slight offset so that it does not collide with the walls. The x and y coordinates are relative to the construction origin, z coordinates are ignored and automatically calculated depending on the terrain. The ''height'' value is used to offset the top height of the scaffolding below the roof. The ''buildingFace'' is the bottom polygon around the house. The scaffolding is placed along the edges of this polygon with a slight offset so that it does not collide with the walls. The x and y coordinates are relative to the construction origin, z coordinates are ignored and automatically calculated depending on the terrain. The ''height'' value is used to offset the top height of the scaffolding below the roof.
-===== Street Constructions =====+===== Street Constructions / Track Constructions =====
 Street constructions can be used to provide street templates like larger intersections or roundabouts. To provide additional filter possibilities, it is possible to assign an asset construction to one or more categories. The string keys are added to the ''categories'' list property.  Street constructions can be used to provide street templates like larger intersections or roundabouts. To provide additional filter possibilities, it is possible to assign an asset construction to one or more categories. The string keys are added to the ''categories'' list property. 
  
Line 364: Line 369:
  
 The constructions may either use models or not. See below for information about pure street and track construction templates. The constructions may either use models or not. See below for information about pure street and track construction templates.
 +
 +Track constructions work similar but for railway. They appear in the track construction tab in the rail menu. Without mods, this tab is not visible.
 +
 +<div download 100%>
 +A track construction example is available for {{:modding:templates:urban_games_demo_track_construction_1.zip|download}}. 
 +</div>
 +
  
 ==== Build free streets and tracks ==== ==== Build free streets and tracks ====
modding/constructiontypes.txt · Last modified: 2023/02/04 14:32 by yoshi