[Lua mod] Engine stalling

Discussion in 'Utilities and programming' started by Kisko_, Aug 10, 2013.

  1. Kisko_

    Kisko_
    Expand Collapse

    Joined:
    Nov 4, 2012
    Messages:
    9
    While I was browsing the lua files of the game, I noticed some unfinished pieces of code for engine stalling. I decided to remove the "--" commenting to see what would happen, and it seemed pretty good!
    I made some modifications and this is the result.

    (Remember, most of the code was there already, just commented out!)

    Also, if you want to use this, do not use the automatic transmission. It has no idea how to use the clutch.

    How to install:
    -Unzip the contents of the zip file to your BeamNG Drive install location
    -Note: If you don't want your input maps to be rewritten by the defaults, you should manually add this to your inputmap (and when your computer asks if you want to overwrite the inputmap file, press no.):
    Code:
    moveMap.bindVLuaCmd(keyboard, s, "drivetrain.startEngine();", "");
    -Start the game!

    Known problems:
    -Does not work properly with Gavril Grand Marshal and Ibishu Covet. (They don't seem to have the "engStallAV" values required and are hard to stall.)

    How to use:
    -If your engine stalls, press "S" to restart it.
    -If it does not start, press your clutch key and/or make sure you are on the "N" gear.
    -If it still does not start you are probably out of fuel or your car is broken.
     

    Attached Files:

  2. ast5515

    ast5515
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    220
    This should be in the game by default.
    EDIT: I bit of a problem: AI can't use clutch.
     
    #2 ast5515, Aug 16, 2013
    Last edited: Aug 16, 2013
  3. Eggtooth

    Eggtooth
    Expand Collapse

    Joined:
    Aug 6, 2013
    Messages:
    58
    what is exactly engine stalling?
     
  4. Stubenhocker

    Stubenhocker
    Expand Collapse

    Joined:
    Jan 18, 2013
    Messages:
    14
    It's the engine cutting out. It often happens when you change into a too high gear and the engine gets underpowered.
    That's the best explanation I can give, I'm still to young to drive in real live. ^^

    You can also google it and see what you find. :p
     
  5. dudes45

    dudes45
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    41
    Stalling is basically when the RPM or Revolutions Per Minute drop below a certain number (Normally somewhere under the 1000 RPM mark) and the engine cannot keep itself running at such a low RPM. This means the engine cuts out, all this means is you will need to start the car again.

    This only happens on Manual or stick shift cars where the driver does not apply enough gas/throttle (this raises the RPM) when moving from a standstill. This can also happen when there is an impact or if you use a to high gear at low speeds. More modern cars will also cut themselves out when there is any impact recorded to minimise engine damage.

    I hope that helps?

    Good job with the mod I'll have a go with this!
     
  6. JDMClark

    JDMClark
    Expand Collapse

    Joined:
    Aug 10, 2013
    Messages:
    1,347
    Heck yes I'll be trying this out when I get home. Need to get the cover stalling though. Been saying some more realistic clutch physics would be awesome i love driving in manual. I usually always drive in manual.
     
  7. Twin_Screwed

    Twin_Screwed
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    13
    Pressing S won't restart the engine for me. I'm in manual clutch mode and am holding the clutch down when I press S.
     
  8. Freakling

    Freakling
    Expand Collapse

    Joined:
    Aug 26, 2013
    Messages:
    12
    Are you sure you've bound the S key to the enginestart() method?

    You got the long answer, but the short is when the RPM drops (due to shifting to high gear) below a threshold where the torque is not enough to maintain or increase the momentum of the car and the engine 'dies'.

    Check this video, around 30-35 seconds they encounter an engine stall.
    https://www.youtube.com/watch?v=OPlCK_SjBb8
     
  9. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    Don't stall a vehicle with a flat battery is what I learnt, especially in the high street of your town at rush hour. Couldn't get it jump started again which was even worse, had to be towed and actually bump started it in moving traffic from the tow rope (so car pulling me instead of a bunch of guys pushing the car on foot). Oh bump starting, I do hate you so much. Was in the school car park once, bunch of other students had a car with a flat battery, no jump leads and weren't able to bump start it. I went over to lend a hand, morons didnt have a clue what they were doing. They had the car first gear, electrics all fully on, just assumed pushing the car along as it is would work. Electrics being fully on isn't ignition sparking, first gear combined with humans pushing may not necessarily achieve the revolutions required to build up enough power from the alternator to start the engine either. So, do I go and get my jump cables (after the high street incident I go nowhere without jump cables, a tow rope and a petrol can) or do I let them bump start it, the latter, but told them how to do it properly... Sure enough once I had spoken to them, took them one attempt to bump the car with about a 10 metre runup, beats what they were doing before travelling the entire length of the car park and having to brake at the end. I also treat bump starting as one of the many reasons automatic cars are inferior to manual.

    its about 500rpm to stall my current car, idle is a mere 750. Quick way to stall it, stick car in *any* gear (although 5th would be most reliable) while the clutch is down (duh) and engine is idling. Simply lift your foot up quickly. If the car doesn't stall I would be very highly surprised. In theory in first gear or reverse a very torquey engine could cope with it perhaps if you didnt have the brakes on, but even supercars would probably stall in first if you lifted the clutch very quickly. If you put a car in first or reverse and carefully lift the clutch you can make a vehicle roll with no throttle without stalling though, more powerful the car the easier this is, newer cars also tend to be easier.

    I live in britain. Almost all cars are manuals. Manual transmissions weigh less and can be driven more economically than auto's if you know how (plus lower weight can also help in that regard but your last meal might then negate that difference), they can also accelerate faster than auto's if you know the torque bands for your engine and can shift gears quickly (and again, some cars a human can shift just as quickly as an auto). Can't bump start an auto. The only advantage I give to the auto over the manual is difficulty, and they aren't hard. There are of course those who may have a genuine problem with operating gears in a vehicle, but I do actually wonder about their suitability to drive sometimes (my logic being that if you can't shift gears effectively, can you keep a good grip on the wheel, if the problem is clutch related, can you operate the brake and accelerator? For the latter option there are of course cars modified for those who are entirely paralysed from the waist down).





    one thing that would be cool for those with racing wheels, clutch biting points being added to the game (along with stalling of course).
     
    • Like Like x 1
  10. La Rocque96

    La Rocque96
    Expand Collapse

    Joined:
    Sep 28, 2013
    Messages:
    5
    i drive in real life and this explanation is accurate.
    however there is other things that can cause stalling such as ceasing, not enough air/too much fuel flow, low altitude driving without proper tune and the list goes on

    - - - Updated - - -

    also automatic vehicles can stall too... everyone of them can for the same reason
     
  11. Godzilla!

    Godzilla!
    Expand Collapse

    Joined:
    Mar 17, 2013
    Messages:
    2,245
    *Sorry for bump*
    Tried this mod and I like it. Plus ever since the "Check Engine" light was added, it lights up when the engine is off.
    screenshot_00280.png
     
  12. Sparks4

    Sparks4
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    327
    Thats probably because the game doesnt support it or it isnt detecting that the car is off but its detecting its broken idk
     
  13. Hatorade

    Hatorade
    Expand Collapse

    Joined:
    Jul 30, 2014
    Messages:
    17
    First and foremost, DON'T BUMP THREADS THAT ARE 5 MONTHS OLD. Secondly, any newer car will show a check engine light when it's off but the key is in the on position.
     
  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