Mogli12 / GearboxAddon

Farming Simulator 2017: Gearbox addon
GNU General Public License v3.0
53 stars 28 forks source link

Differentials #337

Closed KITT3000 closed 6 years ago

KITT3000 commented 6 years ago

Is it possible to add the "onlyRWD" profile?? I have a tractor that does not have all-wheel drive. Earlier, using DriveControl, I had to have 3 lines from the differentials in the XML file:

Unfortunately, after the AWD was switched on, the front wheels were driven (although they should not be because the entire transmission to the rear is set). I would like to completely disable the AWD and the differential lock of the front wheels so that only the rear differential can be blocked. Is it possible or must be how it is??

Mogli12 commented 6 years ago

I think a tractor with RWD should have only one differential. But I am not sure.

KITT3000 commented 6 years ago

I tried it, but then you can not block the differential.

Mogli12 commented 6 years ago

Ok, this is something I can add.

KITT3000 commented 6 years ago

I have edited the differentials in the tractor XML file and look like this:

<differentials>
        <!-- <differential torqueRatio="0.0" maxSpeedRatio="0.0" wheelIndex1="0" wheelIndex2="1" /> <!-- front left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.3" wheelIndex1="2" wheelIndex2="3" /> <!-- back left-right -->
        <!-- <differential torqueRatio="1.0" maxSpeedRatio="1.0" differentialIndex1="0" differentialIndex2="1" /> <!-- front-back -->
</differentials>

Unfortunately, the gearbox in this tractor is not working and there is such an error:

E:/Gry/CDP Games/modyFS17/MP_UserB4D/FS17_UrsusC360/UrsusC360.i3d (153.78) ms
Error 3 loading gearboxMogliLoader: E:/Gry/CDP Games/modyFS17/MP_UserB4D/FS17_GearboxAddon/gearboxMogli.lua:2617: attempt to index a nil value

PS. GB v3.0.2.0

Mogli12 commented 6 years ago

Oh, sorry. I forgot that I already started with the differentials but then worked on #338.

KITT3000 commented 6 years ago

Ok, I'm waiting for an update.

Mogli12 commented 6 years ago

Please check v3.1 b21.

KITT3000 commented 6 years ago

I checked the latest version and such errors appeared:

Error 3: E:/Gry/CDP Games/modyFS17/MP_UserB4D/FS17_GearboxAddon/gearboxMogli.lua:3153: attempt to index a nil value
Error 3: E:/Gry/CDP Games/modyFS17/MP_UserB4D/FS17_GearboxAddon/gearboxMogli.lua:3110: attempt to index local 'diff' (a nil value)
Mogli12 commented 6 years ago

Sorry, but I did not have time to prepare a test. Is v3.1 b22 better?

KITT3000 commented 6 years ago

Ok, no errors and it works correctly. But it would be possible to block AWD and front differential lock (I mean displaying icons and text on HUD). And add a profile to the configuration (or explain how to add it to the configuration in 'gearboxAddonConfig.xml'), so that RWD tractors are really RWD (most have 3 differentials, just like basic tractors in FS).

Anonymous-any commented 6 years ago

https://github.com/Mogli12/GearboxAddon/issues/340

Fixed for me too with Lelyjuno150 many many, many thank.

Mogli12 commented 6 years ago

Hi,

Please set up 3 differentials in your vehicle with torque and speed ratio corresponding to RWD; example:

<differentials>    
  <differential torqueRatio="0.5" maxSpeedRatio="1000" wheelIndex1="0" wheelIndex2="1"/>
  <!-- front left-right -->
  <differential torqueRatio="0.5" maxSpeedRatio="1.8" wheelIndex1="2" wheelIndex2="3"/>
  <!-- back left-right -->
  <differential torqueRatio="0.0" maxSpeedRatio="1000" differentialIndex1="0" differentialIndex2="1"/>
  <!-- front-back -->
</differentials>

Now add the following below tag <gearboxMogli...> or <transmission...> in gearboxAddonConfig.xml:

<differentials>
  <front torqueRatio="-1"/>
  <middle torqueRatio="-1"/>
  <back torqueRatio="0.5"/>
</differentials>

Does this work?

KITT3000 commented 6 years ago

Works, but not completely correctly. Switching AWD - RWD does not work (as it should be), blocking the front differential also does not work (as it should be), but I do not know why the front right wheel is driven all the time.

Edit: Now I have applied your differential values in the tractor's XML file and there is something strange. Only the front wheels are driven instead of the rear ones (AWD and blocking differentials does not work).

My XML files: tractor: https://gist.github.com/KITT3000/5d27166cedd38dbfb856464047cce73c config: https://gist.github.com/KITT3000/1f18111569415cdb8cd81753c8a61eaa

UserB4D commented 6 years ago

Hello, Mogli did you fix it ? Regards.

Mogli12 commented 6 years ago

Please check v3.1 build 77.

KITT3000 commented 6 years ago

@Mogli12 Works fine (although it would be good to block icons and entry in HUD from 4WD and front differential lock).

I still have a question if the mod has only 1 line with a differential in XML, and I would like to add to it the ability to lock the back differential (it requires 3 lines with differentials), what attributes must I have in the lines in config?

Mogli12 commented 6 years ago

Gearbox supports 4wd (3 lines in differentials) and 2wd (1 line in differentials). You can have different differential configurations, which you can attach to the wheel configuration.

KITT3000 commented 6 years ago

@Mogli12 i have

 <differentials>
        <!-- <differential torqueRatio="0.5" maxSpeedRatio="1000" wheelIndex1="0" wheelIndex2="1"/> --> <!-- front left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.8" wheelIndex1="2" wheelIndex2="3"/> <!-- back left-right -->
        <!-- <differential torqueRatio="0.0" maxSpeedRatio="1000" differentialIndex1="0" differentialIndex2="1"/> --> <!-- front-back --> 
    </differentials>

and

<differentials>
                <front torqueRatio="-1"/>
                <middle torqueRatio="-1"/>
                <back torqueRatio="0.5"/>
            </differentials>

or

<differentials>
                <!-- <front torqueRatio="-1"/> -->
                <!-- <middle torqueRatio="-1"/> -->
                <back torqueRatio="0.5"/>
            </differentials>

and unfortunately it is not possible to switch the rear differential lock

Mogli12 commented 6 years ago

Ah, the default handling is not yet there for 2wd. Please add manual4wd="true" as attribute to tag <gearboxMogli ... or <transmission .... I will change the default with the next version.

KITT3000 commented 6 years ago

I added this attribute to <gearboxMogli but it did not change anything in relation to 1 liner in the vehicle XML and both options in the config.

Mogli12 commented 6 years ago

Please add a screen shot. Which version are you using?

KITT3000 commented 6 years ago

Unfortunately, today I can not do it anymore because I am already at work, tomorrow I will be ss. I am using the b77 version.

Mogli12 commented 6 years ago

It works for the IHC 644 mr

KITT3000 commented 6 years ago

It work if you have 3 lines differentials in XML if is only 1 is not work. eg. http://farming-simulator.com/mod.php?lang=pl&country=pl&mod_id=103316&title=fs2017

Mogli12 commented 6 years ago

It is fixed with v3.1 build 79.

KITT3000 commented 6 years ago

It work perfect :)