City Car Driving Guide

User guide for car adaptation to small cargo transportation for City Car Driving

User guide for car adaptation to small cargo transportation

Overview

User guide for car adaptation to small cargo transportation.

Preface

A trailer hitch must be added to the car model and configuration files set up to provide for an opportunity of selecting a trailer and transporting cargo.

1. Model refinement

Open carLod0 and add a new object — trailer hitch:

Place it in the right position:

Assign a name to the object (the name will be indicated in the configuration) and position the trailer hitch pivot at the origin of the coordinates:

2. Configuration file refinement

2.1. CarProperty.ini

A new section (indicated in square brackets) and several parameters are added in CarProperty.ini located in the folder datagamedatacars<My_car_name>, where <My_car_name> is the name of your car. They indicate the trailer hitch component and the necessity of its generation when a car with a trailer is selected:

[hitchDetail] hitchName = “tow_hitch” hitchShowAlways = false hitchShowIfTrailerAttached = true hitchShowIfTrailerExist = true
  • “tow_hitch” — object name on the vehicle scene
  • hitchShowAlways — always display a tow hitch
  • hitchShowIfTrailerAttached — display a tow hitch if it’s attached to a trailer
  • hitchShowIfTrailerExist — display a tow hitch if a trailer is not attached but loaded at the location

The cargo capacity of our car in kilograms is indicated in the section [Common]. The average value for a passenger car is 400 kg.

[Common] MaxCargo = 450

2.2. p_player_setup.ini

To mark the trailer attachment point, edit the file p_player_setup.ini located in the folder
dataphysicscars<My_car_name>.

Write the parameter in the section [Misc] (if there is no such section, create it):

[Misc] TractorTrailerConnectionPoint_ForTrailer = 0; -0.31; 2.377
  • TractorTrailerConnectionPoint_ForTrailer — mounting point of a trailer to a tow hitch, where the first value is –X from the editor, the second is Z and the third is Y

To determine the coordinates of the attachment point, create a sphere on the car model scene and position it inside the trailer hitch ball:

In the same section, indicate the common center of mass for carloads (approximately located on the rear axle in passenger cars). Use a sphere again:

[Misc] CargoEnabled = true CargoPosition = 0.0; -0.25; 0.9
  • CargoEnabled — trailer loading availability
  • CargoPosition — common center of mass of the vehicle’s cargo, where the first value is –X from the editor, the second is Z and the third is Y

Now set up the maximum trailer turning angles relative to the car. To do so, add parameters in the section [Common]:

[Common] TrailerRotateAngle = 180 TrailerUpAngle = 30 TrailerTwistAngle = 30
  • TrailerRotateAngle — maximum left/right rotation angle of the trailer relative to the vehicle
  • TrailerUpAngle — maximum up/down rotation angle of the trailer relative to the vehicle
  • TrailerTwistAngle — maximum around the axis rotation angle of the trailer relative to the vehicle

Now indicate the car trunk volume. Create a new section [Cargo] and indicate the volume in liters:

[Cargo] CargoVolume = 185

2.3. <My_car_name>.xml

The car’s compatibility with a trailer is determined by the parameters trailerType (trailer type) and trailerConnectionPointHeight (the height of the trailer connection point above the ground): the choice of the trailer will be available if the car and the trailer have the same values of the parameters trailerType and the value of the parameters trailerConnectionPointHeight differs by no more than 0.15.

For our trailer, these parameters have the following values: trailerType=”turnBuckle“, trailerConnectionPointHeight=”0.47“; adhere to them.

To determine the height of the trailer connection point in the car model, measure the distance between the trailer hitch ball center and the ground (in this case the lowest point of the wheel) using the tool HelpersTape:

Indicate these parameters in the file with the mode name located in the folder
dataconfiguser_cars in the tag <Car>. The connection point height is given in meters:

<Car trailerType=”turnBuckle” trailerConnectionPointHeight=”0.42″ >

It is not possible to have a car with a trailer on some start points as there is not enough free space. Consequently, start points available for trailer selection must be indicated for mode cars. They are indicated in the tag <StartpointList>:

<VehicleCompatibilityList> <VehicleCompatibility> <Vehicle trailerType=”turnBuckle” trailerConnectionPointHeight=”0.42″ /> <StartpointList> <StartPoint Id=”97398dac-bf8a-470d-b1e5-b1e209600959″ /> <StartPoint Id=”a301fc52-004f-4b02-b5d1-610e75eda826″ /> <StartPoint Id=”901570c5-830b-47b1-9d16-db29b2d57ec9″ /> <StartPoint Id=”105bc3d6-b81e-4255-9071-588f7c57dcfa” /> <StartPoint Id=”780ae325-1006-4b33-888d-108e8910d19a” /> <StartPoint Id=”9b3e6b0d-bfdf-406b-9d71-76227229dfe3″ /> <StartPoint Id=”ac511178-d8c8-4895-96e4-1513883a498e” /> <StartPoint Id=”bb1a157e-dbb8-48f3-835f-3c61a036d43a” /> <StartPoint Id=”dfa70f30-87ce-4f54-91a1-296b1566a3e3″ /> <StartPoint Id=”1c4ee854-8a1c-4d42-85c9-0bd2756ec112″ /> <StartPoint Id=”c4821aab-7e81-4f87-b718-7d1d07009c64″ /> <StartPoint Id=”306d703c-6edf-4f59-a6d8-3085d7769bbf” /> <StartPoint Id=”b39cc284-f2a8-4602-b2f0-c34422c8efac” /> <StartPoint Id=”0ea1e1ec-1b8a-442f-8ae7-03f43d48e975″ /> <StartPoint Id=”615d248e-9335-4f03-b8c7-2bf007168643″ /> <StartPoint Id=”d9fc061c-4df3-40db-b9e2-78c688c595e0″ /> <StartPoint Id=”338ad371-63bb-4212-8a4b-511d72151f1a” /> <StartPoint Id=”e11a6437-01db-4322-9177-ef812015655f” /> <StartPoint Id=”9c618920-db91-4b3c-99d4-a525958e2ace” /> <StartPoint Id=”c738a540-ef5f-479e-acf2-72131c90444b” /> <StartPoint Id=”0eef9097-7698-4c10-acee-d2ed8cdac61b” /> <StartPoint Id=”0c764fd5-a503-4fb0-8178-d6f1a49490e5″ /> <StartPoint Id=”3526f4b3-d5be-4472-8b87-ed181f7f60ce” /> <StartPoint Id=”eea3b7ee-6cec-4429-9e77-6cbf4f3b67fb” /> <StartPoint Id=”4c94fbe1-89a7-4bd8-9271-1566889bb441″ /> <StartPoint Id=”b2c7502f-8e85-4bfe-8d87-c6c3d108484e” /> </StartpointList> </VehicleCompatibility> </VehicleCompatibilityList>

Parameters of <Vehicle> tag should be copied from <Car>.

Now your car is ready to transport cargo!

SteamSolo.com