Skip to content

Commit

Permalink
Feature Implements Cameras (#25)
Browse files Browse the repository at this point in the history
* Changed compatibility with specialization, status animation improved

* Renamed file

* Improved and cleaned camera render

* Added option to add cameras to mod/internalMod/dlc vehicles

* Version description updated, improved vehicle integration description

* Changed name translation key

* Version updated, description updated

* Version updated

* Added adding multiple specializations

* Added implement support, removed unnecessary files and code

* Fixed tables visual

* Fixed text

* Improved game screenshots

* visibilityNodeName attribute

* Added new vehicles support list

* Added more default vehicles and implements

* Renamed l10n keys

* Changed l10n keys

* Fixed not always updating action events

* Changed l10n keys

* Added visibilityNodeName attribute

* Added check for visibility of target nodeName
  • Loading branch information
4c65736975 authored Sep 1, 2023
1 parent 7735577 commit ddd8f5d
Show file tree
Hide file tree
Showing 24 changed files with 1,881 additions and 970 deletions.
116 changes: 70 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@
<img src="screenshots/screenShot (1).png" alt="screenshot">

This modification gives the possibility of adding cameras, e.g. a discharge pipe camera or a rear view camera. You can easily switch between added cameras which are displayed as HUD.
As standard, some of the originally available vehicles were equipped with camera configurations.
As standard, some of the originally available vehicles and implements were equipped with camera configurations.
<br/>
<br/>
Change camera system mode (off/always on/only when reversing) - "z" key (default)
Change camera system mode (off/on) - "z" key (default)
<br/>
Next/previous camera - "left shift + k/m" keys (default)

ATTENTION!
- to activate the camera system, the vehicle must have their configuration added,
- some cameras can cause fps drops, unfortunately this is due to the game engine so I can't do anything about it,
- the image quality of the cameras is the highest I could set, so please bear with me. (The quality of the camera also depends on your graphics settings, it is also possible to manually improve it, details are below)

<p align="right">&#x2191 <a href="#top">back to top</a></p>
Expand Down Expand Up @@ -101,7 +102,7 @@ or
You can improve camera quality (dust, effects) by <font color="#f54040">changing</font> the code as shown below. <font color="#f54040">Note that with this change you will get a lua error from time to time, but the game will run fine.</font>

```lua
src/gui/hud/elements/CameraRenderElement.lua
src/vehicles/VehicleRenderCamera.lua

local development = false -- change to true
```
Expand All @@ -114,62 +115,85 @@ You can just copy code below and fill it with appropriate data type. (<a href="h
<cameraSystem>
<cameraConfigurations>
<cameraConfiguration name="string" price="integer">
<camera node="node" name="string" fov="float" rotation="x y z" translation="x y z"/>
<camera node="node" name="string" fov="float" nearClip="float" farClip="float" activeFunc="string" rotation="x y z" translation="x y z"/>
</cameraConfiguration>
</cameraConfigurations>
</cameraSystem>

<!--
cameraConfiguration -> name -> translation key for configuration name e.g. $l10n_configuration_valueOne
cameraConfiguration -> price -> price of configuration e.g. "500"
camera -> node -> node where camera will be linked, node index e.g. "0>1" or i3dMapping e.g. "vehicle_vis" - REQUIRED
camera -> name -> translation key for camera name e.g $l10n_camera_front_left_wheel - default camera name when not defined is "Untitled"
camera -> fov -> camera field of view - default is "60"
camera -> rotation -> camera rotation based on camera node e.g. "0 90 0"
camera -> translation -> camera translation based on camera node e.g. "0 5 0"
Default available camera names is: (name - translation key)
"Rear" -> $l10n_cameraSystem_rear_camera_name
"Pipe" -> $l10n_cameraSystem_pipe_camera_name
"Work area" -> $l10n_cameraSystem_work_camera_name
-->
```

You can also add an objectChange (you decide whether the defined object should be hidden in this configuration or shown, it can also be visible all the time)
| Tag | Attribute | Description | Default | isRequired |
| --- | --- | --- | :---: | :---: |
| cameraConfiguration | name | translation key for configuration name or configuration name | - | - |
| cameraConfiguration | price | price of configuration | - | - |
| camera | node | node where camera will be linked, node index or i3dMapping | - | **true** |
| camera | name | translation key for camera name or camera name | Untitled | false |
| camera | fov | camera field of view | 60 | false |
| camera | nearClip | camera near clip | 0.01 | false |
| camera | farClip | camera far clip | 10000 | false |
| camera | activeFunc | function which return boolean whether camera is active or not | - | false |
| camera | rotation | camera rotation | - | false |
| camera | translation | camera translation | - | false |

By default, the available camera names are:

| Key | Text |
| --- | --- |
| $l10n_ui_cameraSystem_nameRear | Rear |
| $l10n_ui_cameraSystem_namePipe | Pipe |
| $l10n_ui_cameraSystem_nameWork | Work area |

The available activation functions are:

| Name | Description | Required Specialization |
| --- | --- | ---: |
| getCameraSystemIsReverse | if the vehicle is going backwards, it returns true | Drivable |
| getCameraSystemIsLowered | if the vehicle is lowered, it returns true | Attachable |
| getCameraSystemIsUnfolded | if the vehicle is unfolded, it returns true | Foldable |
| getCameraSystemIsPipeUnfolded | if the vehicle pipe is unfolded, it returns true | Pipe |

You can also add an objectChange to configuration

```xml
<cameraConfiguration name="$l10n_configuration_valueYes" price="100">
<camera node="0>1"/>
<objectChange node="node" visibilityActive="boolean" visibilityInactive="boolean"/>
</cameraConfiguration>

<!--
objectChange -> node -> object node which visibility will be affect, node index e.g. "0>4>5" or i3dMapping e.g. "camera_node_top"
objectChange -> visibilityActive -> whether or not object from object node is visible in this configuration
objectChange -> visibilityInactive -> whether or not object from object node is visible all time
-->
<objectChange node="node" visibilityActive="boolean" visibilityInactive="boolean"/>
```

You can add as many configurations and cameras as the game allows you.
| Tag | Attribute | Description | Default | isRequired |
| --- | --- | --- | :---: | :---: |
| objectChange | node | object node which visibility will be affect, node index or i3dMapping | - | **true** |
| objectChange | visibilityActive | whether or not object is visible in this configuration | - | - |
| objectChange | visibilityInactive | whether or not object is visible all time | - | - |

You can add configurations to **mods/internalMods/dlcs/inGame** to default integration file ***CameraSystemDefaultVehicleData.xml*** as shown below

```xml
<cameraSystem>
<cameraConfigurations>
<cameraConfiguration name="$l10n_configuration_valueNo" price="0"/>
<cameraSystemDefaultVehicleData>
<vehicles>
<vehicle xmlFilename="string" price="integer">
<cameras>
<camera nodeName="string" visibilityNodeName="string" name="string" fov="float" nearClip="float" farClip="float" activeFunc="string" rotation="x y z" translation="x y z"/>
</cameras>
</vehicle>
</vehicles>
</cameraSystemDefaultVehicleData>
```

<cameraConfiguration name="$l10n_configuration_valueOne" price="200">
<camera node="magnum7240pro_main_component1"/>
</cameraConfiguration>
**Rest of camera attributes are the same as shown above**

<cameraConfiguration name="$l10n_configuration_valueAll" price="500">
<camera node="magnum7240pro_main_component1" fov="75" translation="0 3.2 0" rotation="-25 180 0"/>
<camera node="0>1" name="$l10n_cameraSystem_rear_camera_name" rotation="0 180 0"/>
| Tag | Attribute | Description | Default | isRequired |
| --- | --- | --- | :---: | :---: |
| vehicle | xmlFilename | path to vehicle xml file | - | **true** |
| vehicle | price | price of configuration | 500 | - |
| camera | nodeName | name of i3dMapping where camera will be linked | - | **true** |
| camera | visibilityNodeName | name of i3dMapping node that visibility is needed | - | - |

<objectChange node="0>0|17" visibilityActive="true" visibilityInactive="false"/>
</cameraConfiguration>
</cameraConfigurations>
</cameraSystem>
```
Prefixes for specific paths:

| Path | Prefix | Example | isRequired |
| --- | --- | --- | :---: |
| mods | mod | *mod/FS22_caseIHMagnum7240Pro/magnum7240Pro.xml* | **true** |
| dlcs | dlc | *dlc/claasSaddleTracPack/vehicles/claas/xerion4000.xml* | **true** |
| internalMods | internal | *internal/arena/caseIH/axialFlow250/axialFlow250.xml* | **true** |
| inGame | data | *data/vehicles/claas/arion600/arion600.xml* | **true** |

<p align="right">&#x2191 <a href="#top">back to top</a></p>

Expand All @@ -195,4 +219,4 @@ Distributed under the GPL-3.0 license. See [LICENSE](https://github.com/4c657369
* [Best README Template](https://github.com/othneildrew/Best-README-Template)
* [Security camera icons created by Prosymbols Premium - Flaticon](https://www.flaticon.com/free-icons/security-camera)

<p align="right">&#x2191 <a href="#top">back to top</a></p>
<p align="right">&#x2191 <a href="#top">back to top</a></p>
142 changes: 125 additions & 17 deletions VEHICLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,161 @@ List of default in-game vehicles integrated with the camera system.

## Small Tractors

- CLAAS ARION 660-610
- Case IH Maxxum Series
- Massey Ferguson MF 6S
- John Deere 6M Series
- New Holland T6 Series
- Rigitrac SKE 50 ELECTRIC
- Landini REX 4 GT
- Zetor MAJOR CL
- Massey Ferguson MF 3700 AL
- Zetor PROXIMA HS
- Fendt 200 V Vario
- Massey Ferguson MF 4700 M
- Iseki TJV 985
- Valtra A Series
- Massey Ferguson MF 5S
- Valtra G Series
- Fendt 300 Vario
- Fendt 500 Favorit
- Zetor FORTERRA HSX
- New Holland T6 Series
- John Deere 6M Series
- Steyr 8150
- Massey Ferguson MF 6S
- Lindner Lintrac 130
- Case IH Maxxum Series
- CLAAS ARION 660-610
- Valtra N Series

## Medium Tractors

- DEUTZ-FAHR Series 8 TTV
- John Deere 6R Series
- New Holland T7 HD Series
- Massey Ferguson MF 6700 S
- Fendt 700 Vario
- Massey Ferguson MF 7S
- Massey Ferguson MF 3670
- Zetor CRYSTAL HD
- John Deere 7810
- Massey Ferguson MF 7710 S
- John Deere 4755
- Valtra Valmet 8750
- Landini Serie 7 Robo-Six
- McCormick X7 VT-Drive
- Valtra T Series
- CLAAS AXION 870-800
- Massey Ferguson MF 8S
- Massey Ferguson MF 7720 S
- Valtra Q Series
- JCB Fastrac 4220
- DEUTZ-FAHR Series 7 TTV HD
- McCormick X8 VT-Drive
- New Holland T7 HD Series
- John Deere 6R Series
- DEUTZ-FAHR Series 8 TTV

## Large Tractors

- Fendt 1000 Vario
- CLAAS AXION 960-930 TERRA TRAC
- Fendt 900 Vario
- John Deere 7R Series
- CLAAS Axion 900-290
- John Deere 8R Series
- JCB Fastrac 8330
- New Holland T8 GENESIS Series
- CLAAS Axion 960-930 TERRA TRAC
- John Deere 8RT Series
- John Deere 8RX Series
- Case IH Magnum AFS Connect Series
- Rostselmash RSM 2375
- Challenger MT700 Series
- Fendt 900 Vario MT
- Fendt 1000 Vario
- John Deere 9R Series
- Case IH Steiger Quadtrac AFS Connect Series
- Case IH Steiger Rowtrac AFS Connect Series
- New Holland T9 Series
- CLAAS XERION 5000-4500
- Fendt 1100 Vario MT
- John Deere 9RT Series
- New Holland T9 Tracks Series
- John Deere 9RX Series
- Case IH Steiger Wheeled AFS Connect Series
- Versatile 4WD

## Harvesters

- CLAAS LEXION 8900
- New Holland CR 10.90 Revelation
- Fendt IDEAL
- John Deere X9 1100
- John Deere T560
- Rostselmash NOVA 330
- DEUTZ-FAHR Topliner 4090 HTS
- New Holland CH7.70
- John Deere T560
- Case IH Axial-Flow 7150
- CLAAS TRION 750-720
- Massey Ferguson MF IDEAL ParaLevel
- Fendt IDEAL ParaLevel
- Case IH Axial-Flow 9250
- John Deere X9 1100
- Massey Ferguson MF IDEAL
- Fendt IDEAL
- New Holland CR 10.90 Revelation
- CLAAS LEXION 8900

## Headers

- Rostselmash Power Stream 500
- DEUTZ-FAHR Topliner 4090 Header
- Case IH 3020 TerraFlex 25FT
- New Holland SuperFlex 25FT
- John Deere 625X
- New Holland Varifeed 28FT
- Case IH 3050 TerraFlex 28FT
- Fendt PowerFlow 30FT
- Massey Ferguson MF PowerFlow 30FT
- CLAAS CONVIO FLEX 1080
- Fendt PowerFlow 40FT
- Massey Ferguson MF PowerFlow 40FT
- Fendt DynaFlex 9255 40FT
- Massey Ferguson MF DynaFlex 9255 40FT
- New Holland Varifeed 41FT
- Case IH 3050 TerraFlex 41FT
- Case IH 3162 TerraFlex Draper 45FT
- New Holland 3162 Superflex Draper 45FT
- John Deere HD45X
- CLAAS CONVIO FLEX 1380
- John Deere HD50F

## Forage Harvesters

- KRONE BiG X 1180
- CLAAS JAGUAR 960 TERRA TRAC
- Fendt Katana 650
- John Deere 9000 Series
- New Holland FR 780
- KRONE BiG X 1180

## Potato Technology

- Grimme Ventor 4150
- Grimme Evo 290
- Ropa Keiler 2

## Beet Technology

- Ropa Panther 2
- Grimme Rexor 6300 Platinum
- Ropa Tiger 6S
- Ropa Maus 5
- Grimme ROOTSTER 604

## Grape Technology

- New Holland Braud 9070L

## Olive Technology

- New Holland Braud 9090X Olive
- New Holland Braud 9090X Olive

## Animals

- Strautmann VM 1702 Double SF
- SILOKING SelfLine 4.0 Premium 2215-22
- KUHN SPW INTENSE 25.2 CL
- FARESIN Leader PF 2.26 Plus Ecomode

## Crop Protection

- Berthoud Bruin 4200
- Hardi RUBICON 9000
Loading

0 comments on commit ddd8f5d

Please sign in to comment.