Released [0.21+] Antonov AN-12B (Fixed Lua Error!)

Discussion in 'Air' started by Dummiesman, Mar 25, 2018.

  1. Ivan Shewmake77

    Ivan Shewmake77
    Expand Collapse

    Joined:
    Jan 6, 2021
    Messages:
    27
    Does anyone know if he will ever update it?
     
  2. roverp6

    roverp6
    Expand Collapse

    Joined:
    Oct 1, 2020
    Messages:
    55
    i miss this mod
     
    • Agree Agree x 2
  3. avrage gamer

    avrage gamer
    Expand Collapse

    Joined:
    Feb 22, 2020
    Messages:
    1
    dosent work how fly it??????????
     
  4. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    3,319
     
  5. korbitr

    korbitr
    Expand Collapse

    Joined:
    Aug 6, 2013
    Messages:
    328
    Hey, there's another way to have fun with a broken plane mod: drop it from a high altitude and let it fly itself. Since aerodynamics are part of this game's physics engine, the wings still generate lift even if all the control surfaces are broken.

    I think the minimum height I got it to where it could just scrape the ground at the vertex of its fall was around 4800 feet. Then, I put a car in the cargo hold and managed to drive out of the plane as it crashed after completing it's parabolic arc and stalling. Somehow, the car sustained minimal damage for being in a literal plane crash. See, who says you can't have fun with broken mods?
     
    #425 korbitr, Jan 14, 2021
    Last edited: Jan 14, 2021
    • Agree Agree x 1
  6. rumpled_fatty

    rumpled_fatty
    Expand Collapse

    Joined:
    Jun 10, 2020
    Messages:
    45
     
  7. IMPALUVR

    IMPALUVR
    Expand Collapse

    Joined:
    Jan 20, 2021
    Messages:
    12
    I wish it still worked
     
    • Agree Agree x 1
  8. alexanderzitzer22

    alexanderzitzer22
    Expand Collapse

    Joined:
    Jan 22, 2021
    Messages:
    1
    Please update your Mod!!! I have reeinstalled Beamng. Its says "This is often caused by broken Mods". I cant fly the plane!
     

    Attached Files:

    • BeamNGdrive-0213011175-RELEASE-x642201202119_58_12.png
  9. DiRF

    DiRF
    Expand Collapse

    Joined:
    Mar 21, 2017
    Messages:
    182
     
    • Agree Agree x 3
    • Like Like x 1
  10. thesuperbob49

    thesuperbob49
    Expand Collapse

    Joined:
    Jan 23, 2021
    Messages:
    3
    Hello Everyone! I got the mod working on BeamNG.drive v0.21. I will first state off that I'm in no way a coder or programmer, but I do know where to look in the logs when things go wrong.

    In the current state, the Log spits this out when the mod loads:

    65.74385|E|libbeamng.Lua.Exception|=============== Stack Traceback >> START >>
    65.74391|E|libbeamng.Lua.Exception|(1) metamethod C function '__mul'
    65.74395|E|libbeamng.Lua.Exception|(2) Lua function 'update' at file '/vehicles/an12//lua/controller/groundeffect.lua:191' (best guess)
    65.74401|E|libbeamng.Lua.Exception| Local variables:
    65.74408|E|libbeamng.Lua.Exception| upDir = userdata: 0x01e916389c60
    65.74415|E|libbeamng.Lua.Exception| speed = number: 0.439696
    65.74422|E|libbeamng.Lua.Exception| (for generator) = C function: next
    65.74428|E|libbeamng.Lua.Exception| (for state) = table: 0x01e91647bdf8 {wing_l:table: 0x01e91647b7d0, wing_r:table: 0x01e91647ae38}
    65.74436|E|libbeamng.Lua.Exception| (for control) = userdata: 0xfffb81ff00000001
    65.74442|E|libbeamng.Lua.Exception| _ = string: "wing_l"
    65.74447|E|libbeamng.Lua.Exception| group = table: 0x01e91647b7d0 {effectiveRange:10, lastRaycastDistance:4.4757232666016, nodes:table: 0x01e91647b818 (more...)}
    65.74453|E|libbeamng.Lua.Exception| verticalAdjustment = number: 0.999999
    65.74457|E|libbeamng.Lua.Exception| raycastFac = number: 0.552428
    65.74462|E|libbeamng.Lua.Exception| force = number: 30.3698
    65.74470|E|libbeamng.Lua.Exception| (for generator) = C function: next
    65.74476|E|libbeamng.Lua.Exception| (for state) = table: 0x01e91647b818 {1:table: 0x01e9163e4df0, 2:table: 0x01e9163e5bc8, 3:table: 0x01e9163e49f0 (more...)}
    65.74482|E|libbeamng.Lua.Exception| (for control) = userdata: 0xfffb81ff00000002
    65.74488|E|libbeamng.Lua.Exception| _ = number: 1
    65.74492|E|libbeamng.Lua.Exception| node = table: 0x01e9163e4df0 {chemEnergy:500, globalSkin:BNG, slotType:main, containerBeam:false, firstGroup:48 (more...)}
    65.74495|E|libbeamng.Lua.Exception| (*temporary) = userdata: 0x01e9163894d8
    65.74498|E|libbeamng.Lua.Exception| (*temporary) = number: 1.03787e-311
    65.74501|E|libbeamng.Lua.Exception| (*temporary) = table: 0x01e90edd6068 {__newindex:function: 0x01e90edd6250, ___type:static_class<float3>, ___getters:table: 0x01e90edd6288 (more...)}
    65.74505|E|libbeamng.Lua.Exception| (*temporary) = number: 30.3698
    65.74508|E|libbeamng.Lua.Exception| (*temporary) = number: 30.3698
    65.74511|E|libbeamng.Lua.Exception| (*temporary) = number: 30.3698
    65.74515|E|libbeamng.Lua.Exception| (*temporary) = string: "attempt to perform arithmetic on local 'upDir' (a userdata value)"
    65.74521|E|libbeamng.Lua.Exception|(3) Lua field 'update' at file 'lua/vehicle/controller.lua:71'
    65.74527|E|libbeamng.Lua.Exception| Local variables:
    65.74531|E|libbeamng.Lua.Exception| dt = number: 0.0005
    65.74536|E|libbeamng.Lua.Exception| (for index) = number: 3
    65.74543|E|libbeamng.Lua.Exception| (for limit) = number: 4
    65.74548|E|libbeamng.Lua.Exception| (for step) = number: 1
    65.74553|E|libbeamng.Lua.Exception| i = number: 3
    65.74560|E|libbeamng.Lua.Exception|(4) Lua function 'onPhysicsStep' at file 'lua/vehicle/main.lua:69' (best guess)
    65.74566|E|libbeamng.Lua.Exception| Local variables:
    65.74571|E|libbeamng.Lua.Exception| dtSim = number: 0.0005
    65.74575|E|libbeamng.Lua.Exception|--------------- << END <<
    65.74581|E|libbeamng.Lua.Exception|******************************************
    65.74585|E|libbeamng.Lua.Exception|*** DISABLING VEHICLE DUE TO EXCEPTION ***
    65.74589|E|libbeamng.Lua.Exception|******************************************
    65.74592|E|libbeamng.Lua.Exception|*** vehicle/object error


    Now knowing where to first look (line 191 in the groundeffect.lua) I went into the an12.zip folder and from there went to /vehicles/an12/lua/controller/ and double clicked on the groundeffect.lua script.

    I modified the code so instead of it saying this:

    for _,group in pairs(groups) do
    if group.lastRaycastResult then
    local verticalAdjustment = getVA(upDir)
    local raycastFac = ((group.effectiveRange - group.lastRaycastDistance) / group.effectiveRange)
    local force = group.force * raycastFac * speed * verticalAdjustment

    --if pFrameCount == 1000 then
    --print("Adding force to group " .. group.name .. " : " .. tostring(force) .. " with vA " .. tostring(verticalAdjustment) .. " with rF " .. tostring(raycastFac))
    --print("rD " .. tostring(group.lastRaycastDistance))
    --end

    for _,node in pairs(group.nodes) do
    local fVec = (upDir * float3(force, force, force))
    obj:applyForceVector(node.cid, fVec)
    end
    end
    end


    it said this (just practically commenting out line 190-192)

    for _,group in pairs(groups) do
    if group.lastRaycastResult then
    local verticalAdjustment = getVA(upDir)
    local raycastFac = ((group.effectiveRange - group.lastRaycastDistance) / group.effectiveRange)
    local force = group.force * raycastFac * speed * verticalAdjustment

    --if pFrameCount == 1000 then
    --print("Adding force to group " .. group.name .. " : " .. tostring(force) .. " with vA " .. tostring(verticalAdjustment) .. " with rF " .. tostring(raycastFac))
    --print("rD " .. tostring(group.lastRaycastDistance))
    --end

    --for _,node in pairs(group.nodes) do
    --local fVec = (upDir * float3(force, force, force))
    --obj:applyForceVector(node.cid, fVec)
    end
    end
    end


    I then saved the file, closed BeamNG, rezipped, relaunched BeamNG, and huzzah, mod now works, at least as far as I can tell. I can turn on/off engines, load cargo, and of course, fly!

    In case you don't want to do this, or you don't want to screw something else up, you can just use this file with the modification already made. If there are any lua people out there, that's where the problem is.
     

    Attached Files:

    • Like Like x 14
  11. masonstout2629

    masonstout2629
    Expand Collapse

    Joined:
    Sep 1, 2018
    Messages:
    26
    HOW DO YOU FLY THIS
     
  12. ThatCarGuyDownTheStreet

    ThatCarGuyDownTheStreet
    Expand Collapse

    Joined:
    Mar 30, 2017
    Messages:
    3,253
    with your mind
     
    • Agree Agree x 7
  13. HZ5

    HZ5
    Expand Collapse

    Joined:
    Nov 8, 2020
    Messages:
    68
    Throttle up, reach a certain speed and pull the yoke.
     
  14. Dr. Death

    Dr. Death
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    1,963
    There's this weird thing called "Human Interface". But im not sure i know much about it.
     
    • Agree Agree x 1
  15. SXstatic

    SXstatic
    Expand Collapse

    Joined:
    Jan 20, 2021
    Messages:
    2
    cant wait for the update
     
    #435 SXstatic, Jan 25, 2021
    Last edited: Jan 25, 2021
  16. ThatCarGuyDownTheStreet

    ThatCarGuyDownTheStreet
    Expand Collapse

    Joined:
    Mar 30, 2017
    Messages:
    3,253
    bro just scroll up
     
    • Like Like x 1
  17. AaronDynamics13

    AaronDynamics13
    Expand Collapse

    Joined:
    Dec 17, 2020
    Messages:
    2
    Thank you so much for this, I loved this mod so much and it is great that you got it working again
     
    • Agree Agree x 2
    • Like Like x 1
  18. DiRF

    DiRF
    Expand Collapse

    Joined:
    Mar 21, 2017
    Messages:
    182


    THANK YOU! IT WORKS!
     
    • Agree Agree x 5
    • Like Like x 1
  19. obamanium

    obamanium
    Expand Collapse

    Joined:
    Dec 22, 2020
    Messages:
    277
    Your are the best Thanks for reworking this
     
    • Agree Agree x 1
  20. SXstatic

    SXstatic
    Expand Collapse

    Joined:
    Jan 20, 2021
    Messages:
    2
    Dude I was so confused why it wasn't working but my beamng was just not updated
    Thank you so much, this mod was the reason why I enjoyed this game so much and this made the game better again
     
    • Like Like 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