Skip to content

Myiamoto86/cameraSystem

 
 

Repository files navigation


Logo

Camera System

Farming Simulator 22 Modification

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Acknowledgments

About the project

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.

Change camera system mode (off/always on/only when reversing) - "z" key (default)
Next/previous camera - "left shift + k/m" keys (default)

ATTENTION!

  • to activate the camera system, the vehicle must have their configuration added,
  • 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)

back to top

Getting started

If you want to install latest official version, you can download it like other mods.

Prerequisites

Installation

  1. Clone the repo
git clone https://github.com/4c65736975/cameraSystem
  1. Open cloned folder.
  2. Run modInstaller.exe.
  3. That"s it, if everything went as it should, you can delete cloned folder.
  4. Run the game and have a nice time.

or

  1. Click code, download zip.
  2. Extract downloaded file.
  3. Run modInstaller.exe.
  4. That"s it, if everything went as it should, you can delete downloaded folder and zip file.
  5. Run the game and have a nice time.

Improvements

You can improve camera quality (dust, effects) by changing the code as shown below. Note that with this change you will get a lua error from time to time, but the game will run fine.

src/gui/hud/elements/CameraRenderElement.lua

local development = false -- change to true

Vehicle Integration

You can just copy code below and fill it with appropriate data type. (Here you will find a list of vehicles integrated by default)

<cameraSystem>
  <cameraConfigurations>
    <cameraConfiguration name="string" price="integer">
      <camera node="node" name="string" fov="float" 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)

<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
-->

You can add as many configurations and cameras as the game allows you.

<cameraSystem>
  <cameraConfigurations>
    <cameraConfiguration name="$l10n_configuration_valueNo" price="0"/>

    <cameraConfiguration name="$l10n_configuration_valueOne" price="200">
      <camera node="magnum7240pro_main_component1"/>
    </cameraConfiguration>

    <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"/>

      <objectChange node="0>0|17" visibilityActive="true" visibilityInactive="false"/>
    </cameraConfiguration>
  </cameraConfigurations>
</cameraSystem>

back to top

Usage

screenshot

screenshot

screenshot

screenshot

screenshot

back to top

License

Distributed under the GPL-3.0 license. See LICENSE for more information.

back to top

Acknowledgments

back to top

Packages

No packages published

Languages

  • Lua 100.0%