Added realism for vehicles

User avatar
900hasse
Posts: 88
Joined: Wed Nov 13, 2019 8:07 pm
Location: Mariestad, Sweden

Re: Added realism for vehicles

Post by 900hasse »

adinhoa wrote: Thu Jul 16, 2020 1:03 am @900hasse Hello mate. I would love to know how to disable auto mass adjustment? It's sometimes really ridiculous when for example Zaslaw trailer is changed from 3000 kg to 13000 kg in 1 of 3 components. It just killing my tractors. :(
Hello!
The weight of the component is not changed by the script, only height and lengthwise of the center of gravity. The weights in the console is only to see the weight with and without fillunits.
I guess that the component with that great change in mass is the one with the fillunits.
//900hasse
REA22 mod
https://github.com/900hasse
//Hans Nordberg
adinhoa
Posts: 10
Joined: Mon Jan 13, 2020 10:22 pm

Re: Added realism for vehicles

Post by adinhoa »

@900hasse Sorry I'm new in this, what do you mean by fillunits? Because after purchase of trailer tractor anything, and after 1 cm move forward, backward, script applies new values. Of course new center of mass and another is for ex. "mass default:3000 kg, current: 13000kg". What this mean and what it depends to?

Question 2: Do you know maybe the solution that krpejda told about? Exclude particular mod from REA? For example Fendt 800 by Smety?
krpajda
Posts: 11
Joined: Fri Jul 03, 2020 7:42 pm

Re: Added realism for vehicles

Post by krpajda »

adinhoa wrote: Tue Jul 14, 2020 10:36 pm @krpajda to exclude a mod do I have to type it like this?

if vehicle.typeName == "FS19_Fendt_900_TMS_Vario_G3" then
return
end;

by using zip file?
Heyo, I'm not excluding the entire mod. Only a particular vehicle. To do this, I'm using the vehicle's typeName value. The easiest way to find what this value is would be for your mod is to simply use print(vehicle.typeName) in the function you are trying to exclude it from, and then do something in game that triggers the function while having the console open so you can write it down. Then you just substitute the name of the claas cutter from my snippet with your id. It should also be somewhere in the mod files (inside the zip, in one of the xmls) but i couldn't tell you where to look, as i only tried to mess with base game content thus far and i could not be bothered to mess with the files there.

If i had to guess it will be something like [mod name].[name of the vehicle's xml inside the mod's zip]. If that is the case, you could also just do if string.find(vehicle.typeName, [name of the mod]) which would hit every vehicle the mod adds.
That is all entirely just guesswork though, I don't have access to the game right now so i can't test it out, but i would encourage you to just try a bunch of stuff. Worst case scenario, if you break everything, you can just update the mod from the in-game modhub and all your changes will be reset. Or just keep a bunch of backups. I'm sure you will be successful sooner rather than later.
juf.de
Posts: 3816
Joined: Fri Mar 30, 2012 8:04 pm

Re: Added realism for vehicles

Post by juf.de »

I found two problems between the new rearranging of the center of mass and the lely hibiscus (largest vanilla swather). When lowering the implement the rear swathers will only partly touch the ground and therefor do not work well, you have to drive really slow forward (~1 km/h) for them to get straight.
The rear swathers will also be lifted a bit in the air of you drive around corners, to still get the centered swath you have to drive really slow again (~1 km/h).
My guess is that these components do not have enough mass to counter the small wheels.
Tutorials: log.txt, Giants Bilderhoster, erweiterter Texteditor, Konsole (PC)    /    Direktlink Giants Imagehoster
[PC] [Mac] [XB1] [PS4] in the thread title keeps the Forum clean / im Threadtitel hält das Forum übersichtlich
Playing on PC
GamingAT
Posts: 3
Joined: Sat Nov 01, 2014 10:27 am

Re: Added realism for vehicles

Post by GamingAT »

krpajda wrote: Fri Jul 17, 2020 12:40 am
adinhoa wrote: Tue Jul 14, 2020 10:36 pm @krpajda to exclude a mod do I have to type it like this?

if vehicle.typeName == "FS19_Fendt_900_TMS_Vario_G3" then
return
end;

by using zip file?
Heyo, I'm not excluding the entire mod. Only a particular vehicle. To do this, I'm using the vehicle's typeName value. The easiest way to find what this value is would be for your mod is to simply use print(vehicle.typeName) in the function you are trying to exclude it from, and then do something in game that triggers the function while having the console open so you can write it down. Then you just substitute the name of the claas cutter from my snippet with your id. It should also be somewhere in the mod files (inside the zip, in one of the xmls) but i couldn't tell you where to look, as i only tried to mess with base game content thus far and i could not be bothered to mess with the files there.

If i had to guess it will be something like [mod name].[name of the vehicle's xml inside the mod's zip]. If that is the case, you could also just do if string.find(vehicle.typeName, [name of the mod]) which would hit every vehicle the mod adds.
That is all entirely just guesswork though, I don't have access to the game right now so i can't test it out, but i would encourage you to just try a bunch of stuff. Worst case scenario, if you break everything, you can just update the mod from the in-game modhub and all your changes will be reset. Or just keep a bunch of backups. I'm sure you will be successful sooner rather than later.

Can anyone help me, or explane me, how i get the name from my modtruck? ... i´am sorry, but this is too high for me. Where can i find those details?
krpajda
Posts: 11
Joined: Fri Jul 03, 2020 7:42 pm

Re: Added realism for vehicles

Post by krpajda »

Okay, well, a bit more detailed guide on how to find out. I did not want to do this because i think it's off topic but i figured its better than DMing someone and having more people ask.

Start by copying REA from the fs19 mods folder, and unpack it somewhere convenient. Go into modDesc.xml and change the title so the game will recognize both mods.
Get into rea.lua. Scroll down to whatever function you want to edit. I will use REA:CalculateNewCenterOfMass as an example.
At the very start of the function, write

Code: Select all

print(vehicle.typeName)
Save the file, zip the entire REA folder into something with a different name than the original mod. Copy it into the mods folder.
Open the game, make sure you have the developer console enabled. Load your save except with your edited REA instead of the original. Keep the console open.

Now you need your function to run with the console open so you can see the vehicle type name to be written into the console. The Calculate center of mass function runs on vehicle update, so you need to make that happen. Usually you can do that by either getting into the vehicle, coupling to it, or getting close enough to it in another vehicle. Make sure to have the console open.
REA writes out a nice formatted block about how the center of mass was changed. Your vehicle type name will be right above that.

Now all you need to do is make the function do nothing for your vehicle. You can just put the

Code: Select all

if vehicle.typeName == "[your vehicle name]" then return end;
If you have multiple vehicles, you should be able to chain them with if vehicle.typeName == vehicle1 or vehicle.typeName == vehicle2. If you have a load of them that all share the same part of the name, like everything from a certain mod or something, you can also do if string.find(vehicle.typeName, "[common part of the names]") and so on.

Unfortunately every time you update the mod you need to completely close the game because it wont let you replace your edited mod zip once it was loaded. So it takes a while but you will be able to do it easily if you are patient. Just don't be afraid of digging around in a thousand line lua file.

To keep the discussion on topic, please message me if you have questions, instead of clogging the thread with how to disable parts of the mod.
User avatar
Phantoms
Posts: 408
Joined: Thu Sep 17, 2015 6:37 pm
Location: Georgia, USA

Re: Added realism for vehicles

Post by Phantoms »

Is this incorrect center of gravity happening because the implement has wheels on it and REA moves the COG to match the subsoiler's wheels?



This tractor is easily capable of handling this implement. I really like the mod and some of it's effects but these kinds of problems keep me uninstalling REA.
Playing on PC
User avatar
900hasse
Posts: 88
Joined: Wed Nov 13, 2019 8:07 pm
Location: Mariestad, Sweden

Re: Added realism for vehicles

Post by 900hasse »

Phantoms wrote: Sun Jul 26, 2020 11:02 pm Is this incorrect center of gravity happening because the implement has wheels on it and REA moves the COG to match the subsoiler's wheels?

This tractor is easily capable of handling this implement. I really like the mod and some of it's effects but these kinds of problems keep me uninstalling REA.
Hello!
What is the weight of the implement according to the XML?
How much does it weight in real life?
//900hasse
REA22 mod
https://github.com/900hasse
//Hans Nordberg
User avatar
Phantoms
Posts: 408
Joined: Thu Sep 17, 2015 6:37 pm
Location: Georgia, USA

Re: Added realism for vehicles

Post by Phantoms »

From the xml

Code: Select all

    <base>
        <typeDesc>$l10n_typeDesc_cultivator</typeDesc>
        <filename>bi_poutre_repliable.i3d</filename>
        <size width="3.5" length="3" lengthOffset="0"/>
        <speedLimit value="12"/>
        <components>
            <component centerOfMass="0.00 0.80 0.12" solverIterationCount="10" mass="3042" />
        </components>
        <schemaOverlay attacherJointPosition="0 0">
            <default name="DEFAULT_IMPLEMENT"/>
            <selected name="DEFAULT_IMPLEMENT_SELECTED"/>
        </schemaOverlay>
    </base>
and from the implement manufacturer

3100 for the 5m and 4500 for the 6m (this is the 6m).

So the mod is actually set lighter than real life. I don't like linking outside mod host but if you google for "Duro France Subsoiler Foldable v1.0" you can get the mod.

With REA enabled and the implement folded, you can barely turn without tractor rolling over. This is why I asked if the COG on the implement is set to it's wheels as when folded that would put the COG at the very top and make everything extremely top heavy.

The tractor is rated for 5440 kg rear lift capacity. As for Horsepower, in game it's listed as 255HP (not 215). I don't know why, but Giants and Modders use max HP instead of Gross HP on the John Deer tractors.

Edit: Also tried it with the non-mod ingame JD 6230R (rated at 280HP in game) with the 1800 weight on front and same results.
Playing on PC
User avatar
Dezza69
Posts: 375
Joined: Sun Aug 05, 2018 11:36 pm

Re: Added realism for vehicles

Post by Dezza69 »

Hello!

I'm finding the floating tractor thing when using this mod, highlighted by Phantoms, is very easy to replicate - no implement needed!!! :lol: :lol:

In multiplayer lease a John Deere 6M and it seems to flips/floats very easily if direction is changed under full throttle. Well, it has for me anyway!! Also tried a 7 series, did the same thing.

The log shows the wheel height as negative - is this correct?

I thought it may have been the wide wheels with weights - this is log for 6M's with and without "wide wheels with weights".


Thanks!!!! :biggrin2:


020-08-01 21:48 ----------------------
2020-08-01 21:48 Center of mass changed by REA
2020-08-01 21:48 Name: John Deere 6250 R, component: 1 of 2
2020-08-01 21:48 X(sideway) original: 0m
2020-08-01 21:48 Y(height) original: 0.89999997615814m, new: 1.3172004699707m
2020-08-01 21:48 Z(length) original: -0.44999998807907m, new: -1.0104064941406m
2020-08-01 21:48 Wheel height: 1.0172004699707m
2020-08-01 21:48 Mass default: 5400kg, current: 5794.7875308835kg
2020-08-01 21:48 ----------------------
2020-08-01 21:48 ----------------------
2020-08-01 21:48 Center of mass changed by REA
2020-08-01 21:48 Name: John Deere 6250 R, component: 2 of 2
2020-08-01 21:48 X(sideway) original: 0m
2020-08-01 21:48 Y(height) original: 0m, new: 0.24139862060547m
2020-08-01 21:48 Z(length) original: 0m, new: 0m
2020-08-01 21:48 Wheel height: -0.058601379394531m
2020-08-01 21:48 Mass default: 2680kg, current: 2680kg
2020-08-01 21:48 ----------------------
2020-08-01 21:49 ----------------------
2020-08-01 21:49 Center of mass changed by REA
2020-08-01 21:49 Name: John Deere 6250 R, component: 1 of 2
2020-08-01 21:49 X(sideway) original: 0m
2020-08-01 21:49 Y(height) original: 0.89999997615814m, new: 1.3185890197754m
2020-08-01 21:49 Z(length) original: -0.44999998807907m, new: -1.0103912353516m
2020-08-01 21:49 Wheel height: 1.0185890197754m
2020-08-01 21:49 Mass default: 5400kg, current: 5794.7867648338kg
2020-08-01 21:49 ----------------------
2020-08-01 21:49 ----------------------
2020-08-01 21:49 Center of mass changed by REA
2020-08-01 21:49 Name: John Deere 6250 R, component: 2 of 2
2020-08-01 21:49 X(sideway) original: 0m
2020-08-01 21:49 Y(height) original: 0m, new: 0.22269515991211m
2020-08-01 21:49 Z(length) original: 0m, new: 0m
2020-08-01 21:49 Wheel height: -0.077304840087891m
2020-08-01 21:49 Mass default: 2680kg, current: 2680kg
2020-08-01 21:49 ----------------------
buddy
Posts: 116
Joined: Sun May 04, 2008 3:38 am

Re: Added realism for vehicles

Post by buddy »

Dezza69 wrote: Sat Aug 01, 2020 2:00 pm Hello!

I'm finding the floating tractor thing when using this mod, highlighted by Phantoms, is very easy to replicate - no implement needed!!! :lol: :lol:

In multiplayer lease a John Deere 6M and it seems to flips/floats very easily if direction is changed under full throttle. Well, it has for me anyway!! Also tried a 7 series, did the same thing.

The log shows the wheel height as negative - is this correct?

I thought it may have been the wide wheels with weights - this is log for 6M's with and without "wide wheels with weights".


Thanks!!!! :biggrin2:


020-08-01 21:48 ----------------------
2020-08-01 21:48 Center of mass changed by REA
2020-08-01 21:48 Name: John Deere 6250 R, component: 1 of 2
2020-08-01 21:48 X(sideway) original: 0m
2020-08-01 21:48 Y(height) original: 0.89999997615814m, new: 1.3172004699707m
2020-08-01 21:48 Z(length) original: -0.44999998807907m, new: -1.0104064941406m
2020-08-01 21:48 Wheel height: 1.0172004699707m
2020-08-01 21:48 Mass default: 5400kg, current: 5794.7875308835kg
2020-08-01 21:48 ----------------------
2020-08-01 21:48 ----------------------
2020-08-01 21:48 Center of mass changed by REA
2020-08-01 21:48 Name: John Deere 6250 R, component: 2 of 2
2020-08-01 21:48 X(sideway) original: 0m
2020-08-01 21:48 Y(height) original: 0m, new: 0.24139862060547m
2020-08-01 21:48 Z(length) original: 0m, new: 0m
2020-08-01 21:48 Wheel height: -0.058601379394531m
2020-08-01 21:48 Mass default: 2680kg, current: 2680kg
2020-08-01 21:48 ----------------------
2020-08-01 21:49 ----------------------
2020-08-01 21:49 Center of mass changed by REA
2020-08-01 21:49 Name: John Deere 6250 R, component: 1 of 2
2020-08-01 21:49 X(sideway) original: 0m
2020-08-01 21:49 Y(height) original: 0.89999997615814m, new: 1.3185890197754m
2020-08-01 21:49 Z(length) original: -0.44999998807907m, new: -1.0103912353516m
2020-08-01 21:49 Wheel height: 1.0185890197754m
2020-08-01 21:49 Mass default: 5400kg, current: 5794.7867648338kg
2020-08-01 21:49 ----------------------
2020-08-01 21:49 ----------------------
2020-08-01 21:49 Center of mass changed by REA
2020-08-01 21:49 Name: John Deere 6250 R, component: 2 of 2
2020-08-01 21:49 X(sideway) original: 0m
2020-08-01 21:49 Y(height) original: 0m, new: 0.22269515991211m
2020-08-01 21:49 Z(length) original: 0m, new: 0m
2020-08-01 21:49 Wheel height: -0.077304840087891m
2020-08-01 21:49 Mass default: 2680kg, current: 2680kg
2020-08-01 21:49 ----------------------
Same problem with Fendt 900TMS by Smety. Also without weights.
User avatar
Phantoms
Posts: 408
Joined: Thu Sep 17, 2015 6:37 pm
Location: Georgia, USA

Re: Added realism for vehicles

Post by Phantoms »

After having the same problem as shown above with the ingame stock John Deere 7R series (7270 R) I made the following edit to REA to limit the height of the Center of Gravity.

Code: Select all

				-- New center of mass Y value
				local MinCenterY = 0.05 + WheelHeight;
				local MaxCenterY = 0.3 + WheelHeight;
				local NewCenterY = cy;
				if NumberOfWheel > 0 then
					NewCenterY = math.max((Highest - WheelHeight) + WheelHeight,MinCenterY);
					NewCenterY = math.min(NewCenterY,MaxCenterY);
					--Added by James ********************************************************************************************************
					if NewCenterY > 1.8 then
						NewCenterY = 1.8
					end;
					--End of edit by James ************************************************************************************************
					-- Update Y value
					if NewCenterY > cy then
						component.UpdateYValue = true;
					end;
				end;
Before this REA listed the height as over 3 meters when the duro-france cultivator was folded (as suspected the COG was following the wheels of the cultivator which when folded, where at the top).

With this edit I've limited all center of height adjustments to a max of 1.8 meters (almost 6 ft.) It's not the perfect solution but a patch until one is found.
Playing on PC
Jayne Dabran
Posts: 1
Joined: Tue Aug 11, 2020 2:01 pm

Re: Added realism for vehicles

Post by Jayne Dabran »

Hello,

I have the same Problem with floating tracktors and the very instabile behavior of the vehicles. I also have the Mass Adjustment active and many other mods.

But the Thing is: When I deactivate the Class DLC, everything is fine an the mod function properly (or better: the floating/instabile behavier is a lot smaller)...does anyone know why that? I have testet it with the same small traktor and different tire configurations.

Regards
Jayne
krpajda
Posts: 11
Joined: Fri Jul 03, 2020 7:42 pm

Re: Added realism for vehicles

Post by krpajda »

Jayne Dabran wrote: Tue Aug 11, 2020 2:07 pm But the Thing is: When I deactivate the Class DLC, everything is fine an the mod function properly (or better: the floating/instabile behavier is a lot smaller)...does anyone know why that? I have testet it with the same small traktor and different tire configurations.
There was an update after the claas dlc came out that modified how vehicle bounciness works, as a number of vehicles in the dlc kept bouncing and sliding all over the place. I suspect this mod doesn't really work with those changes too well.
User avatar
Phantoms
Posts: 408
Joined: Thu Sep 17, 2015 6:37 pm
Location: Georgia, USA

Re: Added realism for vehicles

Post by Phantoms »

Phantoms wrote: Tue Jul 28, 2020 1:39 am I don't like linking outside mod host but if you google for "Duro France Subsoiler Foldable v1.0" you can get the mod.
I don't' know why I was thinking this was a offsite mod, but it's actually found right here.

https://farming-simulator.com/mod.php?l ... tle=fs2019
Playing on PC
Post Reply