Community Forum

How can use hubs the baseColor of truck?

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created23.04.2020 23:47


Gabor Pasti (pastig) 23.04.2020 23:47
Hello modder mates,
I have a simple question for you:
How can hubs use the baseColor of truck, if the hub is defined in the XML file of wheels, and not in the XML file of the truck?
I know if the hub is defined in the main XML file, I can use this line: <color0 useBaseColor="true" /> ... But in this case for me the hub is defined in the wheel XML file.
Thanks in advance for your answers!

Unknown 24.04.2020 10:58
You can do that in the baseXML! here is an example of one of my mods where I set color0 (you can also set color1 etc), aswell as scale and offset for the hubs

<hubs>
<color0>0.02 0.02 0.02 0</color0>
<hub linkNode="wheelFrontLeft" filename="$data/shared/wheels/hubs/hub_n5_1.xml" isLeft="true" scale="0.1 0.1 0.1" offset="0.029"/>
<hub linkNode="wheelFrontRight" filename="$data/shared/wheels/hubs/hub_n5_1.xml" isLeft="false" scale="0.1 0.1 0.1" offset="0.029"/>
<hub linkNode="wheelRearLeft" filename="$data/shared/wheels/hubs/hub_n5_1.xml" isLeft="true" scale="0.1 0.1 0.1" offset="0.029"/>
<hub linkNode="wheelRearRight" filename="$data/shared/wheels/hubs/hub_n5_1.xml" isLeft="false" scale="0.1 0.1 0.1" offset="0.029"/>
</hubs>

This gives you a lot of options to use shared parts

Gabor Pasti (pastig) 24.04.2020 20:48
Thank you ar1g3, but I know this solvation, but I didn't think that. For example at me the wheel includs the hub
In the main XML:

<wheelConfiguration name="$l10n_configuration_valueDefault" price="0" brand="LIZARD">
<wheels autoRotateBackSpeed="2.2">
<wheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="man" isLeft="true" hasTireTracks="true" hasParticles="true">
<physics rotSpeed="1" restLoad="2.4" repr="axisFrontLeft" driveNode="wheelFrontLeft" forcePointRatio="0.5" initialCompression="35" suspTravel="0.23" spring="28" damper="40" frictionScale="2"/>
</wheel>
<wheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="man" isLeft="false" hasTireTracks="true" hasParticles="true">
<physics rotSpeed="1" restLoad="2.4" repr="axisFrontRight" driveNode="wheelFrontRight" forcePointRatio="0.5" initialCompression="35" suspTravel="0.23" spring="28" damper="40" frictionScale="2"/>
</wheel>
<wheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dual" isLeft="true" hasTireTracks="true" hasParticles="true">
<physics rotSpeed="0" restLoad="1.6" repr="wheelBackLeft" forcePointRatio="0.5" initialCompression="15" suspTravel="0.19" spring="49" damper="40" frictionScale="1.9"/>
<additionalWheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dualConnector" isLeft="true" offset="0.08"/>
</wheel>
<wheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dual" isLeft="false" hasTireTracks="true" hasParticles="true">
<physics rotSpeed="0" restLoad="1.6" repr="wheelBackRight" forcePointRatio="0.5" initialCompression="15" suspTravel="0.19" spring="49" damper="40" frictionScale="1.9"/>
<additionalWheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dualConnector" isLeft="false" offset="0.08"/>
</wheel>
<wheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dual" isLeft="true" hasTireTracks="true" hasParticles="true">
<physics rotSpeed="0" restLoad="1.6" repr="wheelBackLeft2" forcePointRatio="0.5" initialCompression="15" suspTravel="0.19" spring="49" damper="40" frictionScale="1.9"/>
<additionalWheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dualConnector" isLeft="true" offset="0.08"/>
</wheel>
<wheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dual" isLeft="false" hasTireTracks="true" hasParticles="true">
<physics rotSpeed="0" restLoad="1.6" repr="wheelBackRight2" forcePointRatio="0.5" initialCompression="15" suspTravel="0.19" spring="49" damper="40" frictionScale="1.9"/>
<additionalWheel filename="$data/shared/wheels/lizard/implement/315_80R22_5.xml" configId="dualConnector" isLeft="false" offset="0.08"/>
</wheel>
</wheels>
<objectChange node="wheelBackLeft" translationActive="0.735 0.525 -2.04"/>
<objectChange node="wheelBackRight" translationActive="-0.735 0.525 -2.04"/>
<objectChange node="wheelBackLeft2" translationActive="0.735 0.525 -3.357"/>
<objectChange node="wheelBackRight2" translationActive="-0.735 0.525 -3.357"/>
</wheelConfiguration>

And in the XML of the wheel:

<wheel>
<default>
<physics radius="0.57" width="0.315" mass="0.089" tireType="street" frictionScale="1.60" maxLongStiffness="8" maxLatStiffness="100" maxLatStiffnessLoad="2" />
<tire filename="$data/shared/wheels/lizard/implement/R22_5_DS.i3d" nodeLeft="0|0" nodeRight="0|0" maxDeformation="0.028" isCareWheel="false" tireTrackAtlasIndex="4" />
<outerRim filename="$data/shared/wheels/rims/rim001.i3d" node="0|0" widthAndDiam="10.7 22.3" />
<innerRim filename="$data/shared/wheels/hubs/hubTrucks.i3d" nodeLeft="0|0" nodeRight="0|1" offset="0.07" widthAndDiam="10.7 22.3" />
</default>
<configurations>
<configuration id="trailer" >
<innerRim filename="$data/shared/wheels/rims/rim001.i3d" nodeLeft="2|0" nodeRight="2|1" offset="0" />
</configuration>
<configuration id="truckFront" >
<innerRim nodeLeft="1|0" nodeRight="1|1" offset="0.15" />
</configuration>
<configuration id="truckBack" >
<innerRim nodeLeft="2|0" nodeRight="2|1" offset="-0.05" />
</configuration>
<configuration id="truckBack2" >
<innerRim nodeLeft="2|0" nodeRight="2|1" offset="-0.05" />
<additional filename="$data/shared/wheels/hubs/hubTrucks.i3d" nodeLeft="3|1" nodeRight="3|0" offset="-0.065" />
</configuration>
<configuration id="truckBack3" >
<innerRim nodeLeft="7|0" nodeRight="7|1" offset="-0.18" widthAndDiam="21.1 24.1" />
</configuration>
<configuration id="truck1" >
<innerRim nodeLeft="6|0" nodeRight="6|1" offset="0.15" />
</configuration>
<configuration id="truck2" >
<innerRim nodeLeft="5|0" nodeRight="5|1" />
</configuration>
<configuration id="man" >
<innerRim nodeLeft="4|0" nodeRight="4|1" offset="0.1" widthAndDiam="16 22" />
</configuration>
<configuration id="dual" >
<innerRim filename="-" nodeLeft="-" nodeRight="-" offset="-" widthAndDiam="-" />
</configuration>
<configuration id="dualConnector" >
<innerRim nodeLeft="5|0" nodeRight="5|1" offset="-0.18" widthAndDiam="21.1 21.1" />
</configuration>
</configurations>
</wheel>

...

So where can I set the hub, and how can I set it to the color of the hub will be baseColor (optional)?

Unknown 25.04.2020 23:33
Sorry, misunderstood you!

Well, I haven't tested it but try adding
<hubs>
<color0>0.02 0.02 0.02 0</color0> (with whatever RGB values you want)
</hubs>

or
<hubs>
<color0>useBaseColor="true"</color0>
</hubs>

to the main XML. Maybe it works, maybe it doesn't, but it's easy to try!

Otherwise I guess you could just set it in the baseMaterials? Something like this:
<material name="hubTruck004_mat" baseNode="INSERT NODE OF WHEEL">
<shaderParameter name="colorMat0" value="INSERT MATERIAL NAME OR RGB VALUES"/>
</material>

I don't know if either will work, just some suggestions I would try if I was having this problem. Hope it works!

Gabor Pasti (pastig) 26.04.2020 18:59
Thank you ar1g3! But to where shall I write these lines?
<hubs>
<color0>useBaseColor="true"</color0>
</hubs>

This is the wheel XML. Where can I write the upper lines?

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<wheel>
<default>
<physics radius="0.596" width="0.5" mass="0.13" tireType="mud" frictionScale="1.60" maxLongStiffness="9" maxLatStiffness="110" maxLatStiffnessLoad="2" />
<tire filename="$data/shared/wheels/trelleborg/TwinRadial/R22_5_TwinRadial.i3d" nodeLeft="0|0" nodeRight="0|1" maxDeformation="0.062" isCareWheel="false" tireTrackAtlasIndex="2" />
<outerRim filename="$data/shared/wheels/rims/rim001.i3d" node="1|0" widthAndDiam="16 22.5" />
<innerRim filename="$data/shared/wheels/rims/rim001.i3d" nodeLeft="3|0" nodeRight="3|1" widthAndDiam="16 22.5" />
</default>
<configurations>
<configuration id="truckFront" >
<outerRim node="0|0" />
<innerRim filename="$data/shared/wheels/hubs/hubTrucks.i3d" nodeLeft="4|0" nodeRight="4|1" offset="0.1" widthAndDiam="16 21" />
</configuration>
</configurations>
</wheel>


Unknown 27.04.2020 11:03
Put them in the main XML. Whatever you do DO NOT edit the wheel XML you are using as it will affect other vehicles in the game and break multiplayer. Everything you do needs to be in the main XML of your mod. If you can't achieve the effect you want with adding things to the main XML then you should copy and paste the wheel xml to your mod and link to that copy, then you can edit the wheel XML without a problem.


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