Community Forum

Make hoses dynamic

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created05.08.2020 20:43

Unknown 05.08.2020 20:43

I want to implement dynamic hoses, like on an excavator or front loader where a hose is connected to two parts that move relative to each other (eg. the boom of an excavator).

Right now I have it like this:
- one part is the main frame of my vehicle (bicycle)
- the other part is the front fork + handlebars and this rotates relative to the frame

The rotation of the front fork is done by using the <steeringWheel> function

I have then added in the i3d the hoses, as a child of the front fork, like this:
- First as the parent a transform group which locates the hose in the correct place, with the Z axis pointing towards the point where the hose attaches to the frame
- As a child of this transform group, another one which is a translation 0 0 0 and rotation 0 0 0. I will call this the 'origin' as it's pivot is located at the start of the hose.
- As a child of this transform group, I have the visible shape.

The parent transform group does nothing, other than allowing the pivot of the 'origin' to be located at the start of the hose, with the Z axis pointing towards the end. The 'origin' transform group is the one that is used in the XML and that should rotate and scale to make the hose dynamic.

I then under cylindered set a moving tool for the front fork like this:
<movingTool node="frontFork_vis">
<dependentPart node="brakeCableRear1_origin"/>
<dependentPart node="brakeCableRear2_origin"/>
<dependentPart node="brakeCableFront_origin"/>

Then under moving parts I added those nodes with a scalable Z-axis and a referencePoint that is located on the main frame where the hose would attach. (these where also added in the i3d)
<movingPart node="brakeCableRear1_origin" referencePoint="brakeCableRear1_ref" referenceFrame="brakeCableRear1_ref" scaleZ="true" invertZ="false" />

I know this should work as I have seen it being done like this on other mods, but for me the cable stays static and turns with the front fork. What should happen is that if the front fork turns the cable turns aswell but opposite so the Z-axis is always pointing towards the referencePoint.

So I am wondering. Should the dependentPart node be a shape and not a transform group for this to work? Or is it not working because of how I made the movingTool tag, and should I make the front fork move with the movingTool tag and not with the steeringWheel tag?
Or did I just make a stupid mistake?

Any help is much appreciated!

Kevin Meyhoff-nissen (KevinMn) 06.08.2020 12:32
I think it would be a lot easier to rig the hoses in Maya, it's actually not too bad, and there's no scripting involved afterwards, you simply place the joints as a child of te different moving parts, and voila.

Unknown 09.08.2020 13:15
Thanks for the reply!

That is how Giants does it, am I correct?
So you rig the hoses in Maya and then export the whole thing as one shape? Or do you have to work with mergegroups?

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