Unsolved Is there a way to add a secondary engine?

Discussion in 'Mod Support' started by IvanGF14, Sep 24, 2018.

  1. IvanGF14

    IvanGF14
    Expand Collapse

    Joined:
    Sep 15, 2013
    Messages:
    176
    Hi all, im trying some kind of experiment to make a proper hybrid car. I want an electric engine moving the front wheels while the combustion engine moves the rear wheels. So my question is regarding this part of the powertrain:
    So, here we have the property "mainEngine" that defines the main power system. I wonder if there is a way to add a let's say "secondEngine" property to the electric engine in this case, having the "mainEngine" property for the IC engine.

    Also, i put the electric engine as a part of the IC engine, with his own battery, i dont know if that will work that way
    Sinttulo.png
    Or maybe there's a better way to do this, if that's the case how i should make it?
    Thanks in advance for the help :)
     
  2. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,784
    Just write secondaryEngine that will do half of the trick.

    Tricky part is to get gearbox to work for that secondary engine, you need custom input bindings for that and perhaps custom vehicle controller too as default one is looking only for gearbox. Then again I have not tested secondaryGearbox maybe you have luck and that works?

    You could of course have hybrid that is always driven by electricity and only charges mainBattery by combustion engine, that is how I made proper diesel electric propulsion, however I needed to use LUA code from hybrid bus mod and author of that mod has not replied if he would allow usage of code in other mods, so don't know what to do to help you with that other than to say it takes only few very small changes to hybrid bus code to get battery charging and regen braking to work.

    You could of course go easy route and omit gearbox completely for electric side, have torque converter with very low lockup rpm, then have range box, with 1 and -1 ratios, that way you can switch to reverse from on screen UI, much easier than getting gear change key bind to work for secondary gearbox, if secondaryGearbox is not working I guess?

    Anyway that is how you get started with at least.
     
    • Informative Informative x 2
  3. IvanGF14

    IvanGF14
    Expand Collapse

    Joined:
    Sep 15, 2013
    Messages:
    176
    Well, i managed to add the electric engine to the car. But i have a few problems:
    1. If i only add the electric engine, it appears there but says it's not driven (i guess i reached the game's limit, so looks like we need a new controller here). I can drive the car normally but it uses the vehicle controler of the electric engine
    20180925072959_1.jpg
    2. If i remove the electric engine, i can again use the default gearbox vehicle controler
    20180925073147_1.jpg
    3. If i add the gearbox and the differential, the electric engine starts to move the car but using the rear wheels (the electric engine is supposed to move the front ones)
    20180925073054_1.jpg
    The ICE appears as dissabled now. It uses the electric gearbox (1 gear) and then the rear differential and wheels, but using the torque curve from the ICE engine and the sounds from this one too

    The electric engine is defined as
    , the gearbox for the electric engine is set this way
    So, it shouldnt be using the rear wheels, maybe im missing something, i dont know

    The energy is defined to be taken from the battery
    and the battery is well defined (im using some parts of the 200xe mod for the experiment)
     
    #3 IvanGF14, Sep 25, 2018
    Last edited: Sep 25, 2018
  4. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,784
    You can have only one engine per powertrain tree also only one input. That means if you have device called gearbox, you can have only electric motor or ICE driving it.

    So you would need gearboxe and torqueconvertere or something like that for the electric motor, however to control gearbox you would need some LUA work that I have not figured out yet, so better use rangeBox.

    Also see:
    https://beamng.com/threads/need-help-with-vehicle-controller.38614/#post-581204
    --- Post updated ---
    Oh yes, also you have to put power to front wheels somehow, need to have path from electric engine to front wheels, without using AWD transfercase.

    That would be easiest eMotor, TC, rangeBox, frontDiff, frontWheels

    Proper would be eMotor, TC, gearBoxE, frontDiff, frontWheels. That would need some custom LUA which I have not yet figured out, to make 2nd gearbox to change gears etc.

    ICE would use RWD layout only.
     
  5. IvanGF14

    IvanGF14
    Expand Collapse

    Joined:
    Sep 15, 2013
    Messages:
    176
    That's what i actually tried to do, but anyway thanks to the link i managed to get it working using ShusiPro mod as guide. But i have the same problem as him now. Anyway i can mark this as solved, thanks for your help and we will see how the custom controller thing turns out :)
     
  6. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,784
    I think also Toafa posted recently question related to that, his challenge is custom manually controlled CVT box, but that is related as custom controller is needed.

    I don't know anyone actually being able to solve that yet, I know how to add 2nd range box and how to control that via gamepad, but would that work with gearbox as shifting logic is probably needed to rewritten to manipulate 2nd gearbox, which means you need your own custom vehicle controller.
     
    • Agree Agree x 1
  7. IvanGF14

    IvanGF14
    Expand Collapse

    Joined:
    Sep 15, 2013
    Messages:
    176
    At least we get something, and for reversing i can just disconect the electric engine from the front wheels
    20180925192325_1.jpg
     
    • Informative Informative x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice