1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice

Lua

Discussion in 'General Discussion' started by Kamil_, Mar 17, 2013.

  1. Kamil_

    Kamil_
    Expand Collapse

    Joined:
    Mar 17, 2013
    Messages:
    691
    So you said there will be Lua in the game, which I great because I know it, but I wanted to find out what we could do with it.

    Will there be lua on vehicles or just maps?
    Can we make lua dashboards?
    Will we be able to control beams/nodes, for example the command beam length, or adjusting beam strengths, radius on the go?
    Finally, how will we make these lua scripts, will it be included in the .truck(or whatever) file for vehicles and in the map files, or what will it be?


    EDIT: Excuse me if this should be in Q&A, I thought that's where I was.
     
    #1 Kamil_, Mar 17, 2013
    Last edited: Mar 17, 2013
  2. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,482
    NOT OFFICIAL; just guesses

    Yes on Vehicles, probably on maps too because you can have a lua code work as a trigger (seen that in games before..)

    LUA dashes..ask Gabe, (I don't think he codes but I could be wrong) that would be very cool though

    I think the beam editing things will be covered in an in-game editor

    Lua scripts are created via the LUA editor (DL here to play http://www.lua.org/download.html )

    Cheers :D
     
  3. Kamil_

    Kamil_
    Expand Collapse

    Joined:
    Mar 17, 2013
    Messages:
    691
    i thought the same.
    I know how to make lua scripts, but I wanted to know how they would be ran.
     
  4. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,482
    C++ coding allows scripts in a designated location to be run/used if it's compatible with the program
     
  5. gabester

    gabester
    Expand Collapse
    Vehicle Director
    BeamNG Team

    Joined:
    Jun 6, 2012
    Messages:
    2,653
    You can do almost anything with Lua so far. There's Lua that runs on spawn, Lua that runs whenever a beam breaks, Lua that runs every graphics frame, and Lua that runs every physics frame, and you have access to almost anything you can think of. You can break beams, change beam properties, change node properties, apply forces to a node, play a sound, create a particle, etc.

    All of the drivetrain code and all of the wheel/tire models are entirely in Lua.
     
    #5 gabester, Mar 18, 2013
    Last edited: Mar 18, 2013
  6. VeyronEB

    VeyronEB
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,537
    I can only imagine the possibilities can't wait to see what will be possible.
     
  7. Kamil_

    Kamil_
    Expand Collapse

    Joined:
    Mar 17, 2013
    Messages:
    691
    AWESOME

    It's going to be event driven right?

    I can't wait to get my hands on Lua :D
     
  8. logoster

    logoster
    Expand Collapse

    Joined:
    Sep 5, 2012
    Messages:
    2,082
    so basicly we could make an 100% working convertible WITH hydraulics?!?!?!?!?!?!?! AWESOME!!!!!!
     
  9. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,482
    Technically, yes
     
  10. Mythbuster

    Mythbuster
    Expand Collapse

    Joined:
    Aug 11, 2012
    Messages:
    782
    You don't really need LUA to make make a convertible with hydraulics, at least as long as command-beams are gonna come with BeamNG it shouldn't be hard at all. Hydraulics were possible in RoR(many people are doing it) and I already had a soft-top roof working in RoR too, since my Cadillac in BeamNG is gonna have one too I wanted to experiment with it, and it was really easy to do it. Just need 2 command beams(well, beams that extend/retract at the push of a button), and a lot of normal beams and about 40-ish nodes to make up all the hinges on the frame of the convertible top(as long as you build it like a real convertible roof it will work exactly like one). Shouldn't need any LUA for that. Hard-top is even easier obviously, as you just have 2 surfaces with a hinge between them, basically. If you want, Here are some pics of that experimental roof...


    Looking forward to experimenting with LUA though, even though I'm not that good at coding.
     
  11. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,482
    I think we'll all learn as we tinker lol
     
  12. Kamil_

    Kamil_
    Expand Collapse

    Joined:
    Mar 17, 2013
    Messages:
    691
    Well I think with Lua you can make something like a "macro" that opens and closes the roof with a single touch of a button so that you dont have to operate the 2 hydraulics
     
  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