Community Forum

Pivot Steering / WheelShape

Forum Overview >> Scripting

CategoryScripting
Created24.06.2009 13:30


Ruprecht Malchartzeck (Unknown) 24.06.2009 13:59
Hi there!

The engine assumes the steering pivot is the same as the wheels contact point, which is a problem if you want to create a tractor with pivot steering. So setting the wheel.repr pivot to (0 xxx 0) gives funny results.
I canceled that attempt and used four "standard" wheels instead.
Next i wrote a script and it works quite OK, i think, BUT it only does the translation for the geometry and not the WheelShape itself.
I noticed these 2 functions:
getWheelShapePosition , getWheelShapeContactPoint
but there seem to be no "set" versions of those, right?
Is it possible at all to move the WheelShape?

thanks for the help

Stefan Geiger - GIANTS Software 25.06.2009 08:59
This is just a Farming Simulator script limitation, that the position of the wheel is exactly the position of the repr node. There is the attribute deltaY, which you can use to move the wheel up and down (in case you have a moved pivot on the y axis).

But you sure can add some extra code, and create your own wheel shapes whereever you want. However moving the physical representation of the wheels relative to the owner dynamic shape is not possible at runtime.
But as long as the graphical representation only moves a little, it shouldnt be a big issue.
getWheelShapePosition is only a getter. It returns the current position of the wheel, which changes, whenever the springs get compressed.


Ruprecht Malchartzeck (Unknown) 27.06.2009 18:02
Thanks Stefan,

sorry for blaming the engine. And my problem is moving the physical representaion of the wheel, i mixed it up, thanks for the hint its not possible. As you said it is only a minor problem as there is only a little translation difference.
That brings me to the next problem: the wheelcollisions
These seem to be quite resistant to translation/rotation. I mean, i can put them (in i3d) in the wheel repr group which is rotated while steering, but as long as the collisions have the "compound child" attribute it does not bother them at all. I guess they only move when the main col moves, that would make sense for me.
Disabling "compound child" also removes the collsion ability, so it seems to be no good idea.
So i think there must be exactly one collsion (and childs if you want) for each compound, as trailers often consist of more then one compound.
As all my trys failed, is it supported to create a tractor with more than one compound?

Stefan Geiger - GIANTS Software 28.06.2009 14:54
Yes, you may create a vehicle with several independent compounds, these are the so called "components" in the vehicle xml.

Each component is an individual compound which can move independently of the other compounds. If you want to connect them by joints, you can use the ComponentJoint in xml file.
Each component must be at the root level in the i3d file, and must not be a child of any other object.
Wheels can be a child of any of these components.

Check the bale trailers in the game (baleTrailer01 and baleTrailer02). They use 3 components, one for the main part, one for the dolly, and one for the drawbar.
Both the main part and the dolly have wheels attached to it.

As a bonus, all positions of these components are saved in the savegame.

Ruprecht Malchartzeck (Unknown) 30.06.2009 00:02
Thanks, i will try that.


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