Questins about LUA Coding

Discussion in 'Programming' started by ThreeDTech21, Jun 7, 2016.

  1. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    I'm trying to see what is possible with LUA Coding.

    For example I want to make it possible to have slow motion on a beam break or beam deform, when the beam breaks/deforms the speed will slow to 8x and after 4 seconds it will go back to real time.

    I imagine the jbeam code would looks similar to this (just a rough example)

    Code:
    ["f1","f30",{"beamDeform":"gamephyics:8x","timeDelay":"4 secounds","control":"beamDeform"}],
    How would I go about creating that? what LUA code would need to be looked at or added for such a thing?

    Also another Idea I have is that when a car reaches a certain jump height, the game goes to 100x, the camera does a spin around the vehicle, when the camera reaches 180 degress, a sound is played, when it reaches 360 degress the game goes back to real time



    Another Idea I call "Slow Motion Crash Feature"



    So what are the limits of LUA coding for this game? for example is LUA coding similar to C++ coding where basically anything is possible?

    If I can master LUA coding I want to get a rough idea of the types of things that are possible in game.
     
    #1 ThreeDTech21, Jun 7, 2016
    Last edited: Jun 8, 2016
  2. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    Lua is a full-fledged programming languages: the only limits are those of the game itself and the ways you can interact with it. I'm pretty sure that what you want to achieve is possible.

    That said: you're in way over your head. Your post makes it plain you have little to no programming experience: I suggest you start by learning Lua itself, and only when you can comfortable find your way in that, start to learn how to write scripts/mod for this game. With the complete lack of documentation on offer and the constantly changing landscape, that is an entire learning experience on its own.
     
    • Like Like x 1
  3. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Great idea OP. A selectable and adjustable 'auto slow mo' would be epic for many reasons.
     
  4. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616

    It looks like the only limit is the games own feature set, but it sounds like the LUA programing language is always changing or being added/updated if I'm understanding you correctly? I'll start with learning LUA coding first before trying to apply it to BeamNG, starting here ---> https://www.lua.org/about.html

    but is BeamNG implementing its own type of LUA code or is the LUA code universal in any programming setting? For example, take someone whos an expert in LUA coding for another program, would they instantly recognize and be able to modify BeamNG LUA with ease or would they have to learn how the LUA is being used in BeamNG first?

    Indeed! I got these Ideas from both GTA 4 with its cinematic hidden jumps



    and Burnout take down, I loved the crash camera, epic work by the developers! sadly never to be seen again, I hope to change that with BeamNG no matter how many hours I have to study LUA! :cool:



    Also I got the beamBreak slow motion to work! That's a start
     
    #4 ThreeDTech21, Jun 9, 2016
    Last edited: Jun 9, 2016
  5. StinchinStein

    StinchinStein
    Expand Collapse

    Joined:
    Jul 16, 2014
    Messages:
    754
    They would recognize the programming language, but the API/Libraries that any game uses is completely different from the other games. So you'd have to learn BeamNG's API.

    Which sadly, is not documented very well.
     
  6. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    Ok thanks, Ill have to start learning all of these things, sounds like the API's are what BeamNG compiles/creates and then LUA coding handles them. I'm in learning mode now :cool:

    If its not documented well that will present a stiff road block, still I can learn LUA coding itself so when BeamNG has proper docs I'll have a headstart.
     
  7. StinchinStein

    StinchinStein
    Expand Collapse

    Joined:
    Jul 16, 2014
    Messages:
    754
    I have learned quite a bit about the BeamNG Lua, but it has taken me about 6 months to totally understand what I'm doing... lol. I learned Lua only by BeamNG's Source Code but I knew Java/JavaScript before, which helped me with learning Lua. If you have any questions I can try and help you. Good luck and hope to see awesome Lua mods from you! (if you continue learning it)

    Note: This might help with learning BeamNG's API, but like I said above, it is poorly documented and you don't know lua very well (I assume) so it might not help you as of right now.

    http://wiki.beamng.com/Lua:Reference
     
    #7 StinchinStein, Jun 9, 2016
    Last edited: Dec 2, 2019
  8. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    Gah, lua isn't an acronym, its not capitalised except at the start of the sentence. Lua or lua not LUA
     
    • Like Like x 1
  9. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    Ok thanks for the link!, ive jumped right in, checking out some youtube videos on the basics, i'll post back if I run into problems
     
    • Like Like x 1
  10. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    Wrong. It's always "Lua" (never "lua"): it's a name.
     
  11. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    it's in their style guide that they believe lower case lua to be acceptable
     
  12. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    Their about page says not, and I can't find any official style guide.
     
  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