Released Lua-mod installer

Discussion in 'Utilities and programming' started by Incognito, Sep 8, 2013.

  1. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    This program allows you to install lua-mods in a few clicks. To install the mod should be an installation file. This file should be made by mod developer with the help of software to create installation files (BeamNG Lua-mod Install Creator).

    The program can perform the following actions:
    • copy files;
    • add the specified text after the specified string in the specified file;
    • add the specified text after the specified lua-function in the specified file;
    • replace the string;
    • change the function signature.
    The kit includes an installer and a program for creating installation files :)
    For more information - press "Help" button.

    Version: 1.0.0 (20.09.2013)
    creator.png
    installer.png
    https://www.virustotal.com/ru/file/...431810dacfc011c599beffff/analysis/1379702345/
    Microsoft .NET Framework 4 here.
     

    Attached Files:

    #1 Incognito, Sep 8, 2013
    Last edited: Sep 20, 2013
  2. youdidwhat!!

    youdidwhat!!
    Expand Collapse

    Joined:
    Feb 8, 2013
    Messages:
    723
    um its in russian:p
     
  3. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Also present english localization.
     
  4. WCClover

    WCClover
    Expand Collapse

    Joined:
    Sep 8, 2013
    Messages:
    1
    I go to the option to put it in English and it closes out and starts back up in Russian again
     
  5. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    UAC enabled? Perhaps it prohibits create a configuration file. Try to run with admin privileges.
    P.S. Updated, now english by default.
     
  6. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    Nice work! Hopefully this will encourage some fun lua mods in the future
     
  7. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    A way to search within strings and functions, and being able to edit those strings or replace those strings would be really handy.

    example:
    I'm trying to add an option to the showAIGUI function in main.lua, can't do.
    Now that I have a new option I will need to make it do stuff within simpleAI.lua, which will require I add to the agentSeek function.

    I'm not the best at lua, so if you can come up with a work-around for me that would be ok too :eek:
     
  8. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Pinecones, ie you want the possibility of replacing the specified string (search for the string "str" and replace it on "str2")?
     
  9. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    replace or just add after. for instance:

    normal main.lua
    Code:
    function showAIGUI()
        local g = [[beamngguiconfig 1
    callback system AIGUICallback
    title system configuration
    
    container
      type = verticalStack
      name = root
    
    control
      type = chooser
      name = aimode
      description = AI Mode
      level = 1
      selection = ]] .. aiMode .. [[
    
      option = off Off
      option = player Chasing Player
      option = car0 Flee from player
    
    control
      type = doneButton
      icon = tools/gui/images/iconAccept.png
      description = Done
      level = 2
    
    ]]    
        --print(g)
        gameEngine:showGUI(g)
    end
    
    edited main.lua added option = straight Drive Straight
    Code:
    function showAIGUI()
        local g = [[beamngguiconfig 1
    callback system AIGUICallback
    title system configuration
    
    container
      type = verticalStack
      name = root
    
    control
      type = chooser
      name = aimode
      description = AI Mode
      level = 1
      selection = ]] .. aiMode .. [[
    
      option = off Off
      option = player Chasing Player
      option = car0 Flee from player
      option = straight Drive Straight
    
    control
      type = doneButton
      icon = tools/gui/images/iconAccept.png
      description = Done
      level = 2
    
    ]]    
        --print(g)
        gameEngine:showGUI(g)
    end
    
    I'd then need to find this in simpleAI.lua
    Code:
    local function agentSeek(id, agent, targetPos, flee)
    and add ", straight" to the end, to look like:
    Code:
    local function agentSeek(id, agent, targetPos, flee, straight)
     
  10. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Ok. In the nearest future will add the possibility of replacing strings :)
    P.S. Ability to add after the string is already there.
     
  11. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    The edit of main as shown above doesn't work for me :confused:
    Try it yourself
     
  12. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Can you show me your installation file?
     
  13. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    Sure, here's the test file I did, all it has is the first change mentioned above
     

    Attached Files:

  14. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Need to specify the full string, ie with all the indents (TAB), etc.
    In your case, you need to specify:
    Code:
      option = car0 Flee from player
    instead of:
    Code:
    option = car0 Flee from player
     
  15. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
  16. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Do not know about the existence of such a program for Windows.
    But my wheel a little better (GUI, perform all actions with one click etc) :)

    Update:
    • Added the association of an installer with the .bls-files;
    • Added "replace the string" action.
     
  17. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    Thanks for the clarification, I'll give that a try when I can next.

    How should I go about adding to a function? For instance:

    Original:
    function example(one, two, three)
    ...
    end


    Changed (in red):
    function example(one, two, three, four)
    ...
    end


    I was thinking, is replace string a good idea after all? Say someone adds two different people's edits, both of these edits take place in around the same area, one could possible overwrite the other completely through replace, couldn't it?

    Also, say someone else was trying to add to the same function above. And they too were looking to add after three.
    The problem now would be, it would be looking for three but now there will be three, do to the original edit of , four


    On side note, the wheel has gone through many improvements since it's inception!! Keep up the good work.
     
    #17 Pinecones, Sep 16, 2013
    Last edited: Sep 16, 2013
  18. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    Then it is necessary to add action which will change a function signature (will add new parameter in the end) :)
    But for now use the "replace the string".
     
  19. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    Thanks for the help. Here's my first lua release!

    DRIVE STRAIGHT AI

    A new AI mode that makes the cars drive in a straight line, whichever way you point them.
    This will be great for setting up precise crashes and jumps for use in videos etc.

    I'll probably make a new thread as well.

    Edit, made a new thread:
    http://www.beamng.com/threads/4240-Drive-Straight-AI
     

    Attached Files:

    #19 Pinecones, Sep 18, 2013
    Last edited: Sep 20, 2013
  20. Pinecones

    Pinecones
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    67
    Your application requires .net 4, might want to link to it in your OP :rolleyes:
    I really hope more people start using this, it will make things so much easier during Drive updates
     
  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