Jump to content

Please provide optional LUA syntax checking in DO SCRIPT and DO SCRIPT FILE


Recommended Posts

When scripting with Lua, you either paste some lLua code or specify lua code file. This greatly extends mission capabilities as we have seen with great libraries like MIST and others being available.

 

One thing that I believe would greatly enhance QoL of ME Lua scripters would be to offer to run a syntax check (and just syntax) on the script (be it pasted or linked to) by providing a checkbox to optionally verify that the code is formally correct (no semantic checking)

image.png

Note: alternatively a pushbutton "Verify Syntax" instead of checkbox would make even more sense 

 

Reason: This would greatly help to reduce the turnaround time since it avoids a save-start-load-error round trip for simple errors like mis-spellings or missing and "end". I do NOT expect any more involved checks, just run the Lua scanner/parser over the source (pasted / linked) and simply provide the line number/error for the first error encountered. Just providing this simple verification would save a tremendous amount of time until (here's hoping) we have an integrated development system for Lua scripting. 🙂

 

 

 

Link to post
Share on other sites
Posted (edited)

A little tip for those unfortunate anonymous souls who are confused by some posts here: leave a comment what confuses you, lest you stay confused. I don't want that terrible fate to befall you, so speak up.

 


Edited by cfrag
Link to post
Share on other sites

Until this is implemented,

if you want to quickly test out code in a fast way without wasting time check out this tutorial

 

^ Use this to test out your scripts, then when it is all working just move the code into a doscript trigger

  • Thanks 1

Click here for tutorials for using Virpil Hardware and Software

 

Click here for Virpil Flight equipment dimensions and pictures.

.

Link to post
Share on other sites

Huh. That's an interesting approach that I'm sure to try. Thank you so much. 

 

I' still hope that ED will get around to offering a syntax checker over whatever you have in the text field (my 'raindance' involves: copy from notepad+-paste into do script - save - run misson - edit syntax error in notepad -- and it is quite tedious to do this for a simple mis-spelled class name. 

 

Since (from my limited knowledge of what goes on behind the scenes in ME) validating the syntax of the code inside the text box can be as simple as invoking 

 

Lua.LoadString(text)

 

over the contents, this may actually be quite feasible (with the first error displayed in a dialog just like it is today) 

 

 

 

 

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...