We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2021
    Posts
    25

    LUA IDE and development of LUA for LOTRO

    I'm an old school programmer (visual studio, eclipse, jetbrains) IDEs, and I'm used to having an IDE and ability to start a debugger and test my program.

    How does one do this with LUA?
    I'm wondering can I develop LOTRO LUA plugis outside of LOTRO using an IDE? which one, would you recommend?

  2. #2
    Join Date
    Mar 2007
    Posts
    1,590
    Quote Originally Posted by mythror View Post
    I'm an old school programmer (visual studio, eclipse, jetbrains) IDEs, and I'm used to having an IDE and ability to start a debugger and test my program.

    How does one do this with LUA?
    I'm wondering can I develop LOTRO LUA plugis outside of LOTRO using an IDE? which one, would you recommend?
    Personally, I just use notepad to edit my Lua files, notepad++ for those files that have to have UTF-8 encoding (string translate tables in particular). Be careful with UTF-8 encoding, many editors default to BOM (Byte Order Mark) but the LotRO client interpreter can only read UTF-8 without BOM (notepad only encodes UTF-8 with BOM thus the use of notepad++). An editor with IntelliSense would be handy for catching typos and quickly filling in method and property names but a full blown IDE seems to be a bit of overkill. However, there are authors that use IDEs. I know of a couple that use Eclipse and at least one that uses Visual Studio.

    The biggest issue is the inability to run plugins without the sandbox provided by the game client. Without the client, there is no way to run and test your plugins, so any debugging has to be done in the client. Using just Turbine.Shell.WriteLine() and Turbine.Engine.ScriptLog() to write debugging messages is very limiting. I developed a debugging window that can be added to plugins (debugWindow.lua, MoorMap has the latest version) and which allows interactively executing Lua commands in the client while your plugin is loaded as well as watching values and exploring the environment. It isn't very robust but is still a handy tool and while not a true debugger (you can't step through code line by line), it can help track down problems and is even a great platform for testing how objects work and interact. There are other utilities provided by other authors to do similar things. For instance, Equindel published a plugin, Here Be Dragons, for inspecting the environment similar to the third panel of my debug window. Some are in the LotRO Tools & Utilities for Developers section on lotrointerface.com.

  3. #3
    Join Date
    Jun 2011
    Posts
    391
    Quote Originally Posted by mythror View Post
    I'm an old school programmer (visual studio, eclipse, jetbrains) IDEs, and I'm used to having an IDE and ability to start a debugger and test my program.

    How does one do this with LUA?
    I'm wondering can I develop LOTRO LUA plugis outside of LOTRO using an IDE? which one, would you recommend?
    I use the free Visual Studio Code with the "lua-language-server" plugin. This gives you code completion, finding references, syntax checking etc. VSC is a modern free IDE, lightweight, and based on the Atom editor. IntelliJ

    As for debugging, as Garan says, there is no debugger or standalone runtime environment so you need to run the game client. Tools like what he describes are extremely useful because if you work just with plugin code directly, you need to unload the plugin, have the client refresh the read of the plugin source, and load the plugin again. And unloading plugins can randomly crash the client.

    You should visit lotrointerface.com as that is where most plugins are hosted and it also has a forum dedicated to plugin development.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload