Skip to content

Commit 1f1b372

Browse files
Truck file format update (#238)
* [Truck File Format] πŸ“š MIRROR_NOFLIP (2) vidcam role * [Truck File Format] πŸ“š flexbody 'forvert' * [Truck File Format] πŸ“š `dashboard` + `signalstalk` anim sources * [Truck File Format] πŸ“š shifterAnimTime guisetting * [Truck File Format] πŸ“š `flaregroups_no_import` * πŸ“š Reordered modding homepage list Reorders the "Modding Rigs of Rods" homepage list, prioritizing file format pages. * [Truck File Format] πŸ“š `default_skin` * [Truck File Format] πŸ“š New gear anim sources * [Truck File Format] πŸ“š scripts section
1 parent 7fc01db commit 1f1b372

3 files changed

Lines changed: 91 additions & 14 deletions

File tree

β€Ždictionary/en-custom.txtβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ flamewar
190190
flaperon
191191
flarematerialname
192192
Flarewing
193+
Flaregroups
193194
flexbodies
194195
Flexbodies
195196
flexbody
@@ -201,6 +202,7 @@ flexmeshes
201202
FN
202203
footbrake
203204
forset
205+
forvert
204206
forwardcommands
205207
Forwardcommands
206208
fov
@@ -850,3 +852,5 @@ Pointlight
850852
DirX
851853
DirY
852854
DirZ
855+
dashboardsource
856+
shifterAnimTime

β€Žsource/README.mdβ€Ž

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ hide:
4141

4242
Want to start modding Rigs of Rods? Start at 0 and work your way to pro with detailed guides on modding.
4343

44-
- [Installing Addons Guide](tools-tutorials/addons.md)
45-
- [Blender Mesh Editing Guide](tools-tutorials/blender-mesh-editing.md)
46-
- [Editing Terrain Objects](terrain-creation/editing-terrain-objects.md)
44+
- [Truck File Format](vehicle-creation/fileformat-truck.md)
45+
- [Soundscript File Format](vehicle-creation/fileformat-soundscript.md)
4746
- [Addonpart File Format](vehicle-creation/fileformat-addonpart.md)
48-
- [Alternate Skins (skinzips) Guide](vehicle-creation/alternate-skins.md)
49-
- [Truckfile Format](vehicle-creation/fileformat-truck.md)
5047
- [Terrn2 File Format](terrain-creation/terrn2-subsystem.md)
5148
- [Object File Format](terrain-creation/object-format.md)
52-
- [Soundscript File Format](vehicle-creation/fileformat-soundscript.md)
49+
- [Alternate Skins (skinzip) Guide](vehicle-creation/alternate-skins.md)
50+
- [Installing Addons Guide](tools-tutorials/addons.md)
51+
- [Blender Mesh Editing Guide](tools-tutorials/blender-mesh-editing.md)
52+
- [Editing Terrain Objects](terrain-creation/editing-terrain-objects.md)
53+
54+
5355

5456
- :material-gavel:{ .lg .middle } __Community Rules__
5557

β€Žsource/vehicle-creation/fileformat-truck.mdβ€Ž

Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ These sections are not required, but will make it easier to locate your file or
354354

355355
You should use the guid feature to allow RoR to recognize your truck uniquely.
356356

357-
This section is required for [skins](alternate-skins.md).
357+
This section is **required** for [skins](alternate-skins.md).
358358

359359
```
360360
;guid <GUID>
@@ -363,6 +363,18 @@ guid 6daaee29-e462-4d99-96d2-4577294f7b10
363363

364364
You can generate some GUIDs [here](https://www.guidgenerator.com).
365365

366+
### Default_skin
367+
368+
Overrides the pre-selected skin of the truck.
369+
The specified skin will be displayed at the top of the skin selector instead of the dummy "Default skin" entry.
370+
371+
If no other skins are available, the skin will be applied automatically.
372+
373+
```
374+
;default_skin <skin_name_with_underscores_for_spaces>
375+
default_skin My_Awesome_Skin
376+
```
377+
366378
### Fileformatversion
367379

368380
This tells RoR what version of RoR your truck is built for. Most trucks built today should use `fileformatversion 3`
@@ -2186,7 +2198,7 @@ wheeldetachers
21862198

21872199
### Collisionboxes
21882200

2189-
In RoR 0.4.0.5 and above you can define collisionboxes. In earlier versions of RoR, there was only one bounding box for truck activation per object, which was defined by the outermost nodes. With collisionboxes, you get the ability to define the nodes that should be used for the activation bounding box calculation. It is also possible to define multiple bounding boxes, for example to exclude some areas from activation.
2201+
In <span style="background-color:#854200">\[ Version 0.4.0.5+ \]</span> you can define collisionboxes. In earlier versions of RoR, there was only one bounding box for truck activation per object, which was defined by the outermost nodes. With collisionboxes, you get the ability to define the nodes that should be used for the activation bounding box calculation. It is also possible to define multiple bounding boxes, for example to exclude some areas from activation.
21902202

21912203
Syntax:
21922204

@@ -2211,6 +2223,17 @@ rescuer
22112223

22122224
This single keyword placed in the truck file will make the truck a rescuer, like the Scania Wrecker. These vehicles can be entered by pressing `R`.
22132225

2226+
### Scripts
2227+
2228+
Loads an [AngelScript (*.as)](../terrain-creation/scripting.md) file. Functions like other custom scripts except it provides an extra global variable `thisActor` pointing to the associated truck.
2229+
2230+
```
2231+
scripts
2232+
MyTruckScript.as
2233+
```
2234+
2235+
This feature is early in development, scripting documentation will be updated soon.
2236+
22142237
## Look & Feel
22152238

22162239
### Managedmaterials
@@ -2422,6 +2445,25 @@ This section should be after the flares section and before the props and flexbod
24222445

24232446
COMPATIBILITY NOTE: Parameters \#1 and \#2 can also be separated by just space, the parser will silently accept it.
24242447

2448+
### Flaregroups_no_import
2449+
2450+
Prevents a truck from importing flare states when locked or tied to another truck.
2451+
2452+
For example, this can be used to stop a truck-mounted forklift's lights from activating with the truck lights.
2453+
2454+
- **Type**: <span style="color:#BD0058">Character</span>; Type of flare, e.g. low beams (`f`).
2455+
- **Control number**: <span style="color:#BD0058">Integer</span>; <span style="color:#0B8A00">default = -1</span>
2456+
For user-controlled (`u`) flares, enter value 1-10 that corresponds to the flare.
2457+
2458+
Example to prevent importing low beams and CTRL+1 user-controlled lights:
2459+
2460+
```
2461+
flaregroups_no_import
2462+
f
2463+
u 1
2464+
```
2465+
2466+
24252467
### Props
24262468

24272469
This allows you to "stick" any 3D mesh to a triangle of points of a truck. You can use it to stick air intakes, horns, seats, dashboard, bumpers, whatever to the truck. Note that there will be no collision detection with these objects. Like flares, they use a vector coordinate system instead of normal right-angle coordinates. Props are positioned relative to 3 nodes of the chassis: One node is the reference node, and the two others define a base (x,y). Props are positioned relative to the reference node by adding proportions of the vectors ref-&gt;X, ref-&gt;Y, with the normal being used as well.
@@ -2675,7 +2717,8 @@ Parameters:
26752717
- **(Attributes)**: <span style="color:#BD0058">{ Key: options } pairs</span>; Parameter consisting of name, colon, and \| - delimited list of options.
26762718
- `source:` <span style="color:#BD0058">Source type(s) joined with \|</span>; A list of sources to use, it is recommended to use only 1 per add\_animation line, though multiple sources are possible too.
26772719
- `mode:` <span style="color:#BD0058">Mode type(s) joined with \|</span>; A list of modes to use, multiple modes are valid
2678-
- `event:` <span style="color:#BD0058">Key event string</span>; An optional input, only needed for **source: event**. It determines the keypress event to catch for the animation
2720+
- `event:` <span style="color:#BD0058">Key event string</span>; An optional input, only needed for **source: event**. It determines the [keypress event](../gameplay/controls-config.md#keypress-events) to catch for the animation
2721+
- `link:` <span style="color:#BD0058">Dashboard source type</span>; An optional input, only needed for **source: dashboard**. It determines the [dashboard source](making-custom-hud.md#input-sources) to catch for the animation
26792722
- `autoanimate` <span style="color:#666">(optional)</span>: <span style="color:#BD0058">"autoanimate" keyword</span>; rotation or offset is applied as long as source is not 0. Useful for driveshafts, fans, etc.
26802723
- **"noflip"** <span style="color:#666">(optional)</span>: <span style="color:#BD0058">"noflip" keyword</span>; a prop will flip to the opposite limit when a limit is reached, with this mode it just stops at - **"bounce"** <span style="color:#666">(optional)</span>: <span style="color:#BD0058">"bounce" keyword</span>; a prop will flip to the opposite limit when a limit is reached, with this mode it just rebound at the set limit. Only useful with **mode: noflip**
26812724
- **"eventlock"** <span style="color:#666">(optional)</span>: <span style="color:#BD0058">"eventlock" keyword</span>; will lock a toggled event in its current status, useful for switches and status levers. Only works with **mode:event** and a correct defined **event:**
@@ -2704,11 +2747,16 @@ Parameters:
27042747
- `tacho` - This prop animates with the vehicle's RPM. It scales with guisetting tachometer. (It is best use it even if there is no custom overlay dashboard; simplifies the adjustment a lot.)
27052748
- `turbo` - This prop animates with the vehicle's turbocharger PSI.
27062749
- `parking` - This prop animates with the vehicle's parking brake status.
2750+
- `gear#` - This prop animates with the specified gear. Where `#` is the gear number (1/2/3 etc).
2751+
- `gearneutral` - This prop animates with the vehicle's neutral gear.
2752+
- `gearreverse` - This prop animates with the vehicle's reverse gear.
27072753
- `shifterman1` - H-shift left/right ( Reverse \| 1-2 \| 3-4 \| 5-6...11-12 as positions, scales with engine settings (maxGear)
27082754
- `shifterman2` - H-shift forth/back animator Reverse-2-6-8-10-12 \| 1-3-5-7-9-11 as positions
2709-
- `sequential` - sequential shift ( i.e for tiptronic or wheel shift pedals), can be used for commands too (no settable limits then)
2710-
- `shifterlin` - for auto transmission animations or gearselect indicators (special limits rules apply for this one, see below!)
2711-
- `torque` - current engine torque
2755+
- `sequential` - Sequential shift ( i.e for tiptronic or wheel shift pedals), can be used for commands too (no settable limits then)
2756+
- `shifterlin` - For auto transmission animations or gearselect indicators (special limits rules apply for this one, see below!)
2757+
- `autoshifterlin` - Same as `shifterlin` except it allows for D/N/R positions as forward gears are clamped to 1.
2758+
- `signalstalk` - For turn signal stalk animations.
2759+
- `torque` - Current engine torque.
27122760
- `heading` - This prop animates with the current heading of the truck.
27132761
- `difflock` - This prop animates with the difflock status of the truck (It only works when differentials are present in the truck.)
27142762
- `rudderboat` - This prop animates with the steering hydro on boats.
@@ -2717,6 +2765,7 @@ Parameters:
27172765
- `aileron` - This prop animates with the aileron status for airplanes.
27182766
- `elevator` - This prop animates with the elevator status for airplanes.
27192767
- `rudderair` - This prop animates with the rudder status for airplanes.
2768+
- `dashboard` - This prop animates with the status of a GUI element (engine ignition, parking brake etc). Requires `link:` data link argument, see below.
27202769
- `permanent` - This is a permanent source, which is always active when you are in the truck.
27212770
- `event` - A source triggered by a keypress, needs exactly one defined event.
27222771

@@ -2735,6 +2784,10 @@ Specials: Limits do not apply for **mode:sequential**. In this case the options
27352784

27362785
- **rorkeypressevent** - All RoR keypress events. ([A list of valid RoR events](../gameplay/controls-config.md#keypress-events).)
27372786

2787+
*link:*
2788+
2789+
- **dashboardsource** - Any input source from the [dashboard system](making-custom-hud.md#input-sources).
2790+
27382791
**How to use:**
27392792

27402793
It's best to test is a prop that has no rotations or offsets set on a node triangle like this:
@@ -2855,6 +2908,23 @@ As next, a line beginning with the word *forset* follows. Behind the word *forse
28552908

28562909
- **node\_list**: <span style="color:#BD0058">List of node{number/name/range}</span>; List of nodes to use for deforming the flexbody. These nodes should be outer nodes of the vehicle, those that are close to the mesh.
28572910

2911+
### (sub-directive) forvert
2912+
2913+
An additional line added after `forset` enabling manual override of node bindings for specified vertices. The specified nodes do not need to be in `forset` node list.
2914+
Processing works the same as `forset`: the game calculates the offset between the nodes and the vertex and maintains it.
2915+
2916+
- **reference\_node**: <span style="color:#BD0058">Node number/name</span>; The base node, used to define the coordinate system
2917+
- **x\_direction\_node**: <span style="color:#BD0058">Node number/name</span>; The node that defines the X direction (this can be visualized as a line pointing from the **reference node** to this node)
2918+
- **y\_direction\_node**: <span style="color:#BD0058">Node number/name</span>; The node that defines the Y direction (this can be visualized as a line pointing from the **reference node** to this node)
2919+
- **vertex\_list**: <span style="color:#BD0058">List of vertices</span>; List of mesh vertices to use for deforming the flexbody, ranges are supported. Vertex numbers can be viewed in-game using the "Flexbody debug" tool from Top Menubar -> Tools.
2920+
2921+
!!! note
2922+
The `verts:` intermediate line before the vertex list is required!
2923+
2924+
```
2925+
forvert 25, 0, 2, verts: 70-71, 28
2926+
```
2927+
28582928
Notes about backwards compatibility:
28592929

28602930
- If you use a node range \[A-B\], RoR will tolerate if node B doesn't exist (warning will be emitted).
@@ -3027,6 +3097,7 @@ Format: keyword <space> value
30273097
- **dashboard**: <span style="background-color:#854200">\[ Version 0.38.66+ \]</span> [Custom HUD layout](making-custom-hud.md) that should be used for this truck. You can use multiple lines.
30283098
- **texturedashboard**: <span style="background-color:#854200">\[ Version 0.38.66+ \]</span> [Custom HUD layout](making-custom-hud.md) that should be used for the RTT for this truck. You can use multiple lines. RTT means Real Time-generated Texture, you can use it as material for your custom dashboard mesh.
30293099
- **interactiveOverviewMap**: <span style="background-color:#854200">\[ Version 0.36+ \]</span>; <span style="color:#BD0058">off / simple / zoom</span> - Enables/disables the activation of the interactive map for the truck.
3100+
- **shifterAnimTime**: Sets how much a shifter prop animation should be smoothed. Default `0.4`, use `0.0` to disable.
30303101

30313102
Legacy parameters (not affecting the v0.4 custom HUD system). Will be restored or removed soon.
30323103

@@ -3099,7 +3170,7 @@ Parameters:
30993170
- **texture\_height**: <span style="color:#BD0058">Positive decimal, must be power of 2</span>; Y-resolution of the texture generated. Valid: any value^2 (POW) (see below for explanation), recommended maximum `256`, watch your FPS.
31003171
- **min\_clip\_distance**: <span style="color:#BD0058">Real number</span>; Minimum distance in meters of objects to be rendered Valid: `0.1` - value&lt;maxclipdistance. Useful to blend out things that should not be displayed. Good to tune FPS.
31013172
- **max\_clip\_distance**: <span style="color:#BD0058">Real number</span> Maximum distance in meters of objects to be rendered Valid: value&gt;minclipdistance - `32000`. Useful to blend out things that should not be displayed. Watch your FPS.
3102-
- **camera\_role**: <span style="color:#BD0058">Decimal number</span>; Role aka function of the camera: `-1` == camera, `0` == tracker camera (requires an alternative camera orientation node), `1` == mirrors.
3173+
- **camera\_role**: <span style="color:#BD0058">Decimal number</span>; Role aka function of the camera: <br> `-1` == Camera <br> `0` == Tracker camera (requires an alternative camera orientation node) <br> `1` == Mirrors <br> `2` == Same as mirrors (`1`) but without flipping the texture horizontally (expects texcoords to be already flipped in the mesh).
31033174
- **camera\_mode**: <span style="color:#BD0058">Decimal number, use -2</span>; Camera switchoff state. Not supported yet, put a `-2` in here.
31043175
- **material**: <span style="color:#BD0058">String</span>; The material the generated textured should be displayed on. Requires a prop (mesh) using this material to get any visual results.
31053176
- **name**: <span style="background-color:#854200">\[ Version 0.38.63+ \]</span> <span style="color:#BD0058">String</span>; Specify a name for this videocamera that might be used for the title of the renderwindow.
@@ -3137,7 +3208,7 @@ videocamera
31373208
43, 42, 1, 185, -1, 0.00, 0.00, 0.00, 0, 0, 0, 70, 256, 256, 0.10, 2500, 1, -2, video-camera1
31383209
```
31393210

3140-
**Example mirror setup from the [1988 Audi UR-Quattro](https://forum.rigsofrods.org/resources/1988-audi-ur-quattro.85/): (They are currently disabled)**
3211+
**Example mirror setup from the [1988 Audi UR-Quattro](https://forum.rigsofrods.org/resources/1988-audi-ur-quattro.85/):**
31413212

31423213
```
31433214
videocamera

0 commit comments

Comments
Β (0)