Available parameters for each configuration in the xml files

Your forum for all discussions around Modding.
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Available parameters for each configuration in the xml files

Post by SimDala »

Is there somewhere a description of each possible parameter to be used in the xml files for a vehicle?

I'm also looking for something similar for the lua language specific for the game engine.

/SimDala
User avatar
Dogface
Posts: 1062
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Available parameters for each configuration in the xml files

Post by Dogface »

TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Available parameters for each configuration in the xml files

Post by TheSuBBie »

Try looking in the Farming Simulator 2022 Game Folder specifically the sdk folder which contains the debugger folder there you will find a gamesource.zip unzipped contains most of the LUA files in the game and a scriptBinding.xml which gives you the various xml function parameters
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Re: Available parameters for each configuration in the xml files

Post by SimDala »

Dogface wrote: Wed Jan 26, 2022 5:04 pm GDN has some of the 19 LUA info
https://gdn.giants-software.com/documen ... g_fs19.php
Yes, but I haven't found it for FS22 yet. That's also just Lua. The best thing would be if the documentation could be implemented as intellisense for Notepad++.

I haven't looked into how to do that though...
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Re: Available parameters for each configuration in the xml files

Post by SimDala »

TheSuBBie wrote: Wed Jan 26, 2022 5:24 pm Try looking in the Farming Simulator 2022 Game Folder specifically the sdk folder which contains the debugger folder there you will find a gamesource.zip unzipped contains most of the LUA files in the game and a scriptBinding.xml which gives you the various xml function parameters
I'll have a look there. Tnx!

/SimDala
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Re: Available parameters for each configuration in the xml files

Post by SimDala »

The scriptBinding.xml seems to contain all API lua commands with parameter description.

But does someone know if there exist a similar description of all possible XML elements and their parameters?
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Available parameters for each configuration in the xml files

Post by TheSuBBie »

It would help if you could give some examples of what xml elements/parameters you are looking for as
"a similar description of all possible XML elements and their parameters"
is rather a broad request given that xml's contain a lot of different elements, some of which are self explanatory.
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Re: Available parameters for each configuration in the xml files

Post by SimDala »

TheSuBBie wrote: Thu Jan 27, 2022 3:15 pm It would help if you could give some examples of what xml elements/parameters you are looking for as
"a similar description of all possible XML elements and their parameters"
is rather a broad request given that xml's contain a lot of different elements, some of which are self explanatory.
Sure. I want to see all possible parameters for:

movingTool
differential
joint
camera

To start with.

It would be great if that description specified data type and min/max value too.

Also other constraints, such as you can't have a rotating camera if suspensionNodeIndex is used.

Hope that explains more about what I'm looking for.
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Available parameters for each configuration in the xml files

Post by TheSuBBie »

You would need to look in the relevant lua script file for the data type and min/max values and as I said before most of the variables in the xml's (and data type true/false, numeric etc) are self explanatory by their name, some xml's also contain further info about a variable in quotes alongside the variable
e.g. <consumer fillUnitIndex="1" usage="97" fillType="diesel" /> <!-- usage is per hour at max load and max rpm -->

The following, although not updated for a while, has some descriptions and further information on xml files

Farming Simulator Modding For Dummies | Chapter 11: Tweaking Vehicle XML modding eBook PDF available at https://gdn.giants-software.com/downloads.php (log in required)

On that site are also some modding video's, albeit for FS17 but still worth watching which explain the various parts of the vehicle xml's

Also other constraints, such as you can't have a rotating camera if suspensionNodeIndex is used.
Slightly confused by this so I just tried with a base game John Deere 8R which has the suspensionNodeIndex activated and have had no trouble rotating both internal and external camera's in all directions with the seat suspension activated and deactivated,
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Re: Available parameters for each configuration in the xml files

Post by SimDala »

Is it possible to tag people in this forum or i any other way reply to a person without quotes?

I've looked in the modding for dummies but that doesn't go in deep with things. Like what are all parameters for tension belts used for?
A base object and start/end points for the belts would be enough...

To need to look up the corresponding Lua file and go through the code to find it seems like a lot of time, so if there's collected info somewhere to find, that would be great.

The context in which rotate camera doesn't work is if the camera is placed in a transform that follows an object and the camera itself is rotatable. Then the camera becomes non rotatable if suspension index is set.
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Available parameters for each configuration in the xml files

Post by TheSuBBie »

Unfortunately as far as I'm aware there is no easy way so you will have to look at the various LUA's to get your information, for the tension belts it would be the TensionBelts.lua and TensionBeltObject.lua and in the relevant trailer xml for the relevant parameters to check and compare, both lua's can be found in the gameSource zip, FS22-main\data$_script\vehicles\spec

Regarding the camera problem, you may be aware of this but I will try to explain how I think the suspensionNodeIndex is used.
If you look in the VehicleCamera lua you will see that the suspensionIndexNode is used to create its own separate transform group at the end of the i3d. The index number refers to the next free component transform group ie. taking the John Deere 8R as an example, in the i3d you have two components -- series8r _vis component 0 and skinnedMeshs component 1 so the suspensionNodeIndex in this case is 2 for component 2 the next free component transform group, you have probably not taken this into acoount when setting up your camera's and have more than 2 components in your i3d.
SimDala
Posts: 45
Joined: Tue Jun 15, 2021 5:52 pm
Location: Skellefteå, Sweden

Re: Available parameters for each configuration in the xml files

Post by SimDala »

Thanks a lot for the answers TheSuBBie.

Okay, so the only way to go is to look at the lua-files to get more deep information about how the different parts of the xml elements are used.
Good to know that it's not some summary written somwhere to look in.

Yes, I newly start looking in the default lua scripts. I've only looked at mod lua-scripts before.

Great information about the suspensionNodeIndex. But is the separate transform group added in the same depth as the camera object or a separate component at the end of the entire i3d structure?
It may be so simple as when I've added this functionality with targeting camera, I've embedded the camera in a new transform group and therefore that tree node contains less components than the level
above where the camera was positioned before.
So just change the suspensionNodeIndex to lets say 2 or 1 insted could solve the problem.

I've previously just noticed that the camera cant orbit with the mouse unless I remove the suspensionNodeIndex parameter from the configuration.

It feels like you really into how things works and that's great.

I have some other things I'm struggling with:

Differential settings
I can't really configure two wheel that shall move exaclty the same, fixed connected on the same axis.
Even if I set the maxSpeedRatio to 1, they still can have different speeds.
I thought that torqueRatio="0.5" maxSpeedRatio="1.0" would do fine but something is wrong.

movingTools
Is there a way to configure a moving tool to have a certain max force like you can set in joints?

Joints
Is there a way to configure joints to be fixed in all aspects except the specified? For instance if i just set rotLimit="15 0 0"
I want the joint to be able to move only 15 degrees on x-axis and no translation movements at all.
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Available parameters for each configuration in the xml files

Post by TheSuBBie »

Camera
from previous post
The index number refers to the next free component transform group ie. taking the John Deere 8R as an example, in the i3d you have two components -- series8r _vis component 0 and skinnedMeshs component 1 so the suspensionNodeIndex in this case is 2 for component 2 the next free component transform group
To clarify,
The suspensionNodeIndex is only used when the seat suspension option in the game menu is selected.
If selected then a new camera component is created at the specified suspensionNodeIndex in the i3d
This new camera is linked to the seat node and replaces the original indoorCamera, see the VehicleCamera lua.

Differential settings
I can't really configure two wheel that shall move exaclty the same, fixed connected on the same axis.
Even if I set the maxSpeedRatio to 1, they still can have different speeds.
I thought that torqueRatio="0.5" maxSpeedRatio="1.0" would do fine but something is wrong.
In theory that should be the case, as set out in the post from 2014 below, that may also help you understand the operation and various settings, but there may be other factors regarding the wheel rotation speed,

viewtopic.php?t=72709#p574966

further research can be made by downloading the FS_22VehicleControlAddon and seeing how the diff locks/wheel speeds are scripted and applied.

movingTools
Is there a way to configure a moving tool to have a certain max force like you can set in joints?
A good rule of thumb is that if the option does not appear in the xml then it is not readily available, but you can always check the relevant LUA to see if the settings are called from the xml (if available as some information is withheld for proprietary reasons).

Joints
Is there a way to configure joints to be fixed in all aspects except the specified? For instance if i just set rotLimit="15 0 0"
I want the joint to be able to move only 15 degrees on x-axis and no translation movements at all.
Obviously you set the parameters to how you want the joint to perform, if you want it just to rotate then that is parameter you set, if you want it to just translate then that is parameter you set, to do both then set both parameters.

Furthermore might I suggest you also post your queries on https://gdn.giants-software.com/ (which is still very active despite comments to the opposite) where answers sometimes come from the developers and also lots of information and tutorial video's on all aspects of the game are readily available, including the scripts from FS17/19, which although some are now out of date, provide a good insight into how things are implemented and work ingame.

Looking at your other posts you seem to be "running before you can walk" so to speak, Google searches on various subjects, like Blender tutorials and any questions you may have etc also dissecting the base game equipment to see how things are implemented both usung the Lua's and xml's will save you a lot of time and trouble.

Finally, quotes are used to highlight the questions you asked in your post.
Post Reply