Community Forum

Create a camera to an implement

Forum Overview >> Scripting

CategoryScripting
Created24.12.2021 09:31


SogWick 24.12.2021 09:31
Does anyone know how to script so i can add a camera to an implement (for example; Wheel loader fork) and when attached to a wheel loader, having the option to switch to that camera?

Bilbo Beutlin (BBeutlin) 26.12.2021 16:23
Example:

<attachable>
...
<toolCameras>
<toolCamera node="toolCamera" rotatable="false" useWorldXZRotation="false" useMirror="false" isInside="false" positionSmoothingParameter="0" />
</toolCameras>
</attachable>


Kari Halonen (Jurkkis) 30.12.2021 23:30
Tried to follow this and add a craneCamera to FS22 default Kesla as it and the Heizomat trailed chipper are missing it? Used the Ponsse Bison as example and exported the crane camera nodes from it, did id3 mappings and added xml movinpart too. The mod loads, can be bought ingame, but craneCamera does not work and get this error in log:

2021-12-31 00:05 Error (C:/Users/khalo/OneDrive/Tiedostot/My Games/FarmingSimulator2022/mods/FS22_Kesla144NDCC/nd122.xml): Failed to validate xml path 'vehicle.attachable.toolCameras.toolCamera(0)#node' for 'vehicle'. Path not registered.
2021-12-31 00:05 LUA call stack:
dataS/scripts/xml/XMLFile.lua (345) : printCallstack
dataS/scripts/xml/XMLFile.lua (222) : getValueType
dataS/scripts/vehicles/VehicleCamera.lua (70) : getValue
dataS/scripts/vehicles/specializations/Attachable.lua (431) : loadFromXML
dataS/scripts/xml/XMLFile.lua (263) : closure
dataS/scripts/vehicles/specializations/Attachable.lua (429) : iterate
dataS/scripts/specialization/SpecializationUtil.lua (19)
dataS/scripts/vehicles/Vehicle.lua (962) : raiseEvent
dataS/scripts/i3d/I3DManager.lua (134) : asyncCallbackFunction
2021-12-31 00:05 Warning (C:/Users/khalo/OneDrive/Tiedostot/My Games/FarmingSimulator2022/mods/FS22_Kesla144NDCC/nd122.xml): Invalid camera node for camera 'vehicle.attachable.toolCameras.toolCamera(0)'. Must be a camera type!

Bilbo Beutlin (BBeutlin) 31.12.2021 08:00
Of course you must have an existing camera in the i3d.

Kari Halonen (Jurkkis) 31.12.2021 13:03
Yes I exported the group of 3 nodes from the Bison containing the camera and imported them under the main component of Kesla.

<TransformGroup name="craneCameraRotRefFrame" translation="2.8873e-07 3.61396 3.02235" rotation="0 180 0" nodeId="783">
<TransformGroup name="craneCameraRot" translation="-2.22045e-18 -5.68434e-16 2.84217e-16" nodeId="784">
<Camera name="craneCamera" translation="2.22045e-18 0 0" rotation="0 180 0" nodeId="785" fov="55" nearClip="0.1" farClip="5000" orthographicHeight="1"/>
</TransformGroup>
</TransformGroup>

Bilbo Beutlin (BBeutlin) 31.12.2021 14:17
Did you read the log carefully? Obviously not, since the error message "Must be a camera type!" indicates invalid type resp. wrong camera node.

Kari Halonen (Jurkkis) 31.12.2021 19:42
I've tried to check the nodes best to my knowledge. "craneCamera" i3d mapping does match to my craneCamera node index in GE. Maybe I try to create the camera manually, rather than importing.

https://media.discordapp.net/attachments/515178618096189456/926537197191041125/Nayttokuva_2021-12-31_200743.jpg
https://cdn.discordapp.com/attachments/515178618096189456/926537608690020352/Nayttokuva_2021-12-31_200929.jpg
https://cdn.discordapp.com/attachments/515178618096189456/926537608916520990/Nayttokuva_2021-12-31_200905.jpg

Kari Halonen (Jurkkis) 10.01.2022 08:51
Anyone know a mod that has succeeded in adding the tool camera I could use as an example? I could not find one, and none of the ingame default implements have one. Enterable only, as the Andersson trailer.

Edit: I got information elsewhere that toolCamera won't work atm. Support will be added in future.

Tommy Nilsson (Skuggan191) 14.01.2022 23:42
Thanks Kari for the update, guess i have to make the logging trailers enterable for now then.


Note: Log in to post. Create a new account here.