User Tools

Site Tools

Urban Games

modding:vehicletypes

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
modding:vehicletypes [2020/08/02 19:59]
yoshi
modding:vehicletypes [2024/04/10 15:31] (current)
yoshi [Events]
Line 1: Line 1:
 ====== Vehicle Types ====== ====== Vehicle Types ======
 Vehicle models in Transport Fever 2 are bound to one of the means of transportation road, rail, water or air. The distinction between the types of vehicles is achieved by specialized metadata entries in the ''.mdl''-files for each type. Vehicle models in Transport Fever 2 are bound to one of the means of transportation road, rail, water or air. The distinction between the types of vehicles is achieved by specialized metadata entries in the ''.mdl''-files for each type.
 +
 +
 +<div tip 70%>
 +In the sections below, there are some identifiers that are used frequently:
 +  * **mesh id** is a number that is equivalent to the index of the mesh in the model node tree. Use the <span btn>MODEL</span> button in the [[modding:modeleditor#model_tree|Model Editor]] to find out the correct number in the **ID** column.
 +  * **.msh reference** is a path to a mesh file relative to ''res/models/mesh/'' including the ''.msh'' file ending. The correct reference is listed on the right side of the model node tree in the Model Editor too. 
 +</div>
  
 ===== Road Vehicles ===== ===== Road Vehicles =====
Line 29: Line 36:
     -- soundSet configuration     -- soundSet configuration
   },   },
-  topSpeed = 13.8,  -- [m/s] maximum speed the vehicle can reach +  topSpeed = 13.8,      -- [m/s] maximum speed the vehicle can reach 
-  weight = 1.6,   -- [t (metric)] empty weight of the vehicle+  weight = 1.6,         -- [t (metric)] empty weight of the vehicle 
 +  blinkInterval = 500,  -- [ms] interval for blinker lights, optional
 }, },
 </code> </code>
Line 68: Line 76:
 The ''soundSet'' block contains the sound related properties: The ''soundSet'' block contains the sound related properties:
   * ''name'' is a reference to a [[modding:soundsets#sound_sets|soundset]] file. The path is relative to ''res/config/sound_set/''.   * ''name'' is a reference to a [[modding:soundsets#sound_sets|soundset]] file. The path is relative to ''res/config/sound_set/''.
 +  * ''horn'' is a reference to a custom horn sound. If this is set, it overrides the ''horn'' event reference in the soundset above. The path is relative to ''res/audio/effects/''.
   * ''openDoors'' is a reference to a custom door opening sound. If this is set, it overrides the ''openDoors'' event reference in the soundset above. The path is relative to ''res/audio/effects/''.   * ''openDoors'' is a reference to a custom door opening sound. If this is set, it overrides the ''openDoors'' event reference in the soundset above. The path is relative to ''res/audio/effects/''.
   * ''closeDoors'' is a reference to a custom door closing sound. If this is set, it overrides the ''closeDoors'' event reference in the soundset above. The path is relative to ''res/audio/effects/''.   * ''closeDoors'' is a reference to a custom door closing sound. If this is set, it overrides the ''closeDoors'' event reference in the soundset above. The path is relative to ''res/audio/effects/''.
  
-The other two properties are not contained in a block:+The other three properties are not contained in a block:
   * ''topSpeed'' is the maximum speed the vehicle can reach in meter per second.   * ''topSpeed'' is the maximum speed the vehicle can reach in meter per second.
   * ''weight'' is the empty weight of the vehicle in metric tons.   * ''weight'' is the empty weight of the vehicle in metric tons.
 +  * ''blinkInterval'' is an optional parameter to adjust the frequency of the blink lights by specifying the interval in milliseconds. If unset, the default value of 500 ms is used.
  
 ==== Events ==== ==== Events ====
Line 91: Line 101:
   * ''open_doors_left'' is triggered after a vehicle stops at a station or bus/tram stop. It is only triggered for stops on the left side.   * ''open_doors_left'' is triggered after a vehicle stops at a station or bus/tram stop. It is only triggered for stops on the left side.
   * ''close_doors_left'' is triggered before the vehicle leaves a station or bus/tram stop. It is only triggered for stops on the left side.   * ''close_doors_left'' is triggered before the vehicle leaves a station or bus/tram stop. It is only triggered for stops on the left side.
 +  * ''empty_load'' animation is used to empty the payload of tipper trucks. This animation is currently not used in game.
  
 ===== Rail Vehicles ===== ===== Rail Vehicles =====
Line 121: Line 132:
   topSpeed = 27.4,         -- [m/s] maximum speed the vehicle can reach   topSpeed = 27.4,         -- [m/s] maximum speed the vehicle can reach
   weight = 107,            -- [t (metric)] empty weight of the vehicle   weight = 107,            -- [t (metric)] empty weight of the vehicle
 +  blinkInterval = 500,     -- [ms] interval of blinking lights, optional, only for trams
 }, },
 </code> </code>
Line 141: Line 153:
 </div>  </div> 
  
-Be aware that a mesh can't be used for multiple lighting purposes. Each mesh id may at most appear in one of the config lists. It is possible to use these configurations for other purposes like end of train devices, switching pantographs depending on the location in train and interconnecting gangways between coaches +Be aware that a mesh can't be used for multiple lighting purposes. Each mesh id may at most appear in one of the config lists. It is possible to use these configurations for other purposes like end of train devices, switching pantographs depending on the location in train and interconnecting gangways between coaches
 + 
 +For trams, there are additional metadata properties for the blinking lights. 
 +  * ''blinkingLights0'' / ''blinkingLights1'' are used for meshes that should blink when a tram leaves a station. 
 +  * ''blinkLightsLeft0'' / ''blinkLightsLeft1'' are used for meshes that should blink when a tram turns left at an intersection. 
 +  * ''blinkLightsRight0'' / ''blinkLightsRight1'' are used for meshes that should blink when a tram turns right at an intersection. 
 + 
 +The meshes with 0 and 1 suffix alternate when blinking. Keep in mind that a mesh can't be used for multiple lighting purposes. Each mesh id may at most appear in one of the config lists. 
  
 Beside the lights, there are further config properties that are used for axles and the correct rotation of vehicle parts: Beside the lights, there are further config properties that are used for axles and the correct rotation of vehicle parts:
Line 167: Line 186:
   * ''topSpeed'' is the maximum speed the vehicle can reach in meter per second.   * ''topSpeed'' is the maximum speed the vehicle can reach in meter per second.
   * ''weight'' is the empty weight of the vehicle in metric tons.   * ''weight'' is the empty weight of the vehicle in metric tons.
 +  * ''blinkInterval'' is an optional parameter to adjust the frequency for the blink lights of trams by specifying the interval in milliseconds. If unset, the default value of 500 ms is used.
 +
  
 ==== Events ==== ==== Events ====
Line 179: Line 200:
   * ''drive'' animation is used for vehicle parts that move according to the current speed of the vehicle.   * ''drive'' animation is used for vehicle parts that move according to the current speed of the vehicle.
   * ''wheels'' animation is used for vehicle parts that move according to the current speed of the vehicle. The animation length is mapped to the wheel rotation by the game engine.   * ''wheels'' animation is used for vehicle parts that move according to the current speed of the vehicle. The animation length is mapped to the wheel rotation by the game engine.
-  * ''open_all_doors'' is triggered after a vehicle stops at a station. It is triggered for platforms on both sides of the vehicle+  * ''open_all_doors'' is currently unused
-  * ''close_all_doors'' is triggered before the vehicle leaves a station. It is triggered for platforms on both sides of the vehicle.+  * ''close_all_doors'' is currently unused.
   * ''open_doors_right'' is triggered after a vehicle stops at a station. It is only triggered for platforms on the right side.   * ''open_doors_right'' is triggered after a vehicle stops at a station. It is only triggered for platforms on the right side.
   * ''close_doors_right'' is triggered before the vehicle leaves a station. It is only triggered for platforms on the right side.   * ''close_doors_right'' is triggered before the vehicle leaves a station. It is only triggered for platforms on the right side.
   * ''open_doors_left'' is triggered after a vehicle stops at a station. It is only triggered for platforms on the left side.   * ''open_doors_left'' is triggered after a vehicle stops at a station. It is only triggered for platforms on the left side.
   * ''close_doors_left'' is triggered before the vehicle leaves a station. It is only triggered for platforms on the left side.   * ''close_doors_left'' is triggered before the vehicle leaves a station. It is only triggered for platforms on the left side.
- 
-See [[modding:vehicleadvancedtopics#animations|advanced vehicle animations]] for more details on animating wheels and doors. 
  
 ==== Multiple Units ==== ==== Multiple Units ====
Line 391: Line 410:
 <span label>10</span> ''strobeLights'' is a list of mesh ids which are double flashing lights. <span label>10</span> ''strobeLights'' is a list of mesh ids which are double flashing lights.
 </div> </div>
-    * ''ids'' is a list of mesh ids that rotate around the x axis of the mesh during rolling maneuvers. 
-    * ''maxAngle'' is an angle in degree that limits the maximum deviation of the aileron meshes. 
  
 <div right rightalign 300px> <div right rightalign 300px>
Line 425: Line 442:
   effects = { },   effects = { },
   soundSet = {   soundSet = {
-    horn = "",+    land = "",
     name = "aircraft_prop_modern",     name = "aircraft_prop_modern",
   },   },
Line 454: Line 471:
   * ''open_doors_left'' is triggered after a vehicle stops at a gateway. It is only triggered for gateways on the left side.   * ''open_doors_left'' is triggered after a vehicle stops at a gateway. It is only triggered for gateways on the left side.
   * ''close_doors_left'' is triggered before the vehicle leaves a gateway. It is only triggered for gateways on the left side.   * ''close_doors_left'' is triggered before the vehicle leaves a gateway. It is only triggered for gateways on the left side.
 +  * ''open_doors_cargo'' animation is used to open cargo payload doors.
 +  * ''close_doors_cargo'' animation is used to close cargo payload doors.
   * ''open_wheels'' is triggered before the landing approach to extend the landing gear.   * ''open_wheels'' is triggered before the landing approach to extend the landing gear.
   * ''close_wheels'' is triggered after take off to retract the landing gear.   * ''close_wheels'' is triggered after take off to retract the landing gear.
modding/vehicletypes.1596391141.txt.gz · Last modified: 2020/08/02 19:59 by yoshi