Lua Editor

Topics related to tools created by the Core Team or 3rd-party community members.

Moderator: Team Members

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Lua Editor

Post by John Adams » Thu Aug 08, 2013 10:02 am

Cannot launch the script editors.
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in ScintillaNET.dll
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in ScintillaNET.dll
Additional information: Cannot load the 'SciLexer.dll' module into memory.
The ScintillaNET.dll exists, but the other one does not.

Copied SciLexer.dll to the bin/debug or release folder, and now it's okay.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Wed Aug 28, 2013 11:00 pm

Added the following lua functions to Lua.xml
GetEquippedItemBySlot
GetEquippedItemByID
GetItemByID
Stealth
IsInvis
IsStealthed
PlayAnimation
SetTarget
IsPet
GetOwner
SetInCombat
CompareSpawns
Runback
GetRunbackDistance
IsCasting
IsMezzed
IsStunned
IsMezzedOrStunned
ClearEncounter
ClearHate
GetMostHated
GetEncounterSize
HasRecovered
ProcessMelee
ProcessSpell
GetEncounter
GetHateList
HasGroup
AddWard
AddToWard
RemoveWard
SetQuestComplete
Updated file on tools svn.

Also added the SciLexer dll's to the bin/debug and bin/release folders

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Thu Aug 29, 2013 12:24 am

Another update for this tool tonight

Found a better way to prevent the icons in solution explorer from changing when you select a node so it should no longer flicker like it was doing. Also filled in some missing text for the tool bar buttons so the tool tips should now be helpful

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Thu Aug 29, 2013 3:43 pm

Removed a bunch of files visual studio creates from svn

Fixed: Solution explorer should no longer collapse and scroll to the top when you save a file.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Wed Sep 11, 2013 3:25 pm

Emu keywords will now show in auto complete if there is no match in lua keywords

Auto complete is no longer case sensitive so if you type "add" and select "AddHate" the "add" will be replaced instead of it ending up "addAddHate"

New exe's on tools svn

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Wed Sep 11, 2013 4:48 pm

Been playing around with the idea of tool tips, however I can't get them based off the auto complete window (issues with the 3rd party library and not having a pointer to the auto complete window) so I got it working with hovering the mouse over the emu keyword
LUAEditor.jpg
This was just a test and will probably require another xml file to be maintained with all the info, for those of you that use this what are your thoughts? Is this worth the effort?
You do not have the required permissions to view the files attached to this post.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Lua Editor

Post by thefoof » Wed Sep 11, 2013 5:16 pm

That would be a pretty cool feature, but I'd say if it's going to take a ton of work don't worry about it until we get some more people actually scripting. I'm probably the only active scripter right now (content wise) and I can remember all the syntaxes pretty well personally, but for new scripters that would be awesome.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Wed Sep 11, 2013 5:28 pm

On the code side it shouldn't be to hard to set it up, content side would be time consuming adding all params, param types, return type and description for all lua functions to a new xml file. The xml file is something that could be built over time.

Also my plan was for tool tips to contain at most what is in the screen shot, as I have F1 to go to the wiki for more detailed info.

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Lua Editor

Post by alfa » Thu Sep 12, 2013 4:21 am

Jabantiz wrote:Been playing around with the idea of tool tips, however I can't get them based off the auto complete window (issues with the 3rd party library and not having a pointer to the auto complete window) so I got it working with hovering the mouse over the emu keyword
LUAEditor.jpg
This was just a test and will probably require another xml file to be maintained with all the info, for those of you that use this what are your thoughts? Is this worth the effort?
I Like it ! ;)
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Thu Sep 12, 2013 9:25 pm

Added code to support the tool tips, loads from an xml file, also moved the emu keywords out of lua.xml, the new xml will handle all of the emu related keywords. Did this so we don't have to maintain the keywords in 2 different files.

I haven't committed yet as I would like opinions on the xml, this is what I came up with

Code: Select all

  <Function Name="GetDistance">
    <ReturnType>float</ReturnType>
    <Param Type="Spawn">Spawn1</Param>
    <Param Type="Spawn">Spawn2</Param>
    <Param Type="int8" Optional="True">include_radius</Param>
    <Description>Gets the distance between two spawns, if third parameter is included it will take collison radius into account</Description>
  </Function>

  <Function Name="AddControlEffect">
    <ReturnType>void</ReturnType>
    <Param Type="Spawn">Target</Param>
    <Param Type="int8">Type</Param>
    <Description>Adds the control effect given by type to the target spawn</Description>
  </Function>
Thoughts?

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Thu Sep 12, 2013 10:49 pm

Went ahead and committed it, the new xml file has all the emu keywords in it so auto complete and highlighting will still work, only about 5 have detailed info for the mouse hover tool tips though. It should mostly be copy and paste work from the wiki to fill out the xml but it will still be time consuming so it will probably be done over a long period of time.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Tue Oct 15, 2013 2:52 pm

Added: "Find" and "Find & Replace" to the menu under edit (normal key bindings will work ctrl + f and ctrl + h)
Fixed: Auto format should work again, I deleted a bunch of code for this on accident in one of my commits...

Updated exe's on the tools svn as usual

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Lua Editor

Post by Jabantiz » Mon Oct 21, 2013 4:24 pm

Was looking into a "compile" option for the editor to check for errors and discovered luac.exe that comes with lua, using that program I can get syntax errors.
LuaError.jpg
The only problem is it will only return 1 error per file so you would have to fix the error and run it again to see if there are more. Would this be useful to anyone? or should I look for a better solution then luac.exe?
You do not have the required permissions to view the files attached to this post.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Lua Editor

Post by John Adams » Mon Oct 21, 2013 5:15 pm

That might be okay. I think even Visual Studio has trouble identifying ALL syntax errors at once. I find when I fix one thing, something right below it will then go squiggly... at least it's something, until you stumble upon something better.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Lua Editor

Post by thefoof » Mon Oct 21, 2013 8:06 pm

One error at a time wouldn't be a problem, sounds cool.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests