Lua IDE - Page 2

Lua IDE

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Lua IDE

Post by gajop »

pfft, but can your komodo edit look this cool?
Image
Attachments
2012-02-09-180430_1920x1080_scrot.jpg
(537.56 KiB) Downloaded 2 times
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: Lua IDE

Post by MidKnight »

Sure.
Image(image is a link)
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lua IDE

Post by Cheesecan »

Ah that looks nice MidKnight. How long will it last without a license? Website doesn't say..
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg »

Forever!
http://www.sublimetext.com/download wrote:There is no enforced time limit for the evaluation.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lua IDE

Post by Cheesecan »

Wow I must be getting old..
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua IDE

Post by PicassoCT »

Beherith wrote:
PicassoCT wrote:Wasnt there this tool that autoreloads, parses errorlines in the autolog and jumps to that in notepad++? That with notepad always on top and spring windowed actually is the ide(al) dev enviroment.
WANT!

Have been testin this for the past week! Is sweet as honey for the workflow! Might see a Release this weekend.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Re: Lua IDE

Post by quantum »

PicassoCT wrote:Wasnt there this tool that autoreloads, parses errorlines in the autolog and jumps to that in notepad++? That with notepad always on top and spring windowed actually is the ide(al) dev enviroment.

Just swayin..
You can use the NppExec plugin to parse errors from Spring or from "luac5.1 -p", the Lua compiler in syntax check mode. It can jump to errors lines too. You'll need to fiddle a bit with the options though.

luac5.1 can be found here.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua IDE

Post by PicassoCT »

Or use this, to parse the infolog in notepad++

http://springfiles.com/spring/tools/satans-bugfixer
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Lua IDE

Post by gajop »

A question to the more experienced devs - how do you refactor lua code?
At least how do you deal with basic things such as renaming functions/methods/fields that span multiple files?

It's probably no surprise, but when you start writing lua for spring, especially if you haven't written much lua in your life, there are many things that you will do wrong.

I have a couple of global utility functions, such as "GetIndex(array, value)", "GetValuesWithName(array, name)", and even stuff more specific to my project, such as "MakeVariablePanel(parent, varType)", and later I've discovered you can prefix function names so you don't pollute the global namespace, by creating stuff like "SCEN_EDIT.MakeVariablePanel(parent, varType)" and so I need to rename those occurrences in many files, which is a bit annoying to do.
Same thing applies to when I decided to move things into the global namespace with my "SCEN_EDIT." prefix instead of having it as a field in many objects.

Also how do you do the try/catch mechanics in lua? I've tried pcall but it seems weird, do you use that?
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: Lua IDE

Post by luckywaldo7 »

I find a nice way to replace certain text in lots of files to be a nice simple sed (stream editor unix utility) 1-liner.

Code: Select all

sed -i 's/OldText/NewText/g' *.lua
'-i' means it will overwrite the old file (instead of making a new one)
's' means substitute
'OldText' is the text you will find to replace
'NewText' is the new text you replace it with
'g' means global, so it will swap the text for all occurances, not just the first

*.lua is the target (so any files with the lua extension in the current directory)

If you check the manual or google you can expand or change the functionality as needed, like to make it run recursively and such.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg »

In Notepad++ there is a search'n'place in files, either all opened files, or all files with given extension in a given folder and subfolders. It can also be set to accept some regex.

Yes, I use pcall to do try catch.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Lua IDE

Post by aegis »

I just added Lua support to sublimelint for those of you using Sublime Text 2.

This means inline syntax highlighting, saving you a pesky Spring reload for syntax typos and such.

http://github.com/lunixbochs/sublimelint/

Image
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua IDE

Post by PicassoCT »

Would it be possible to write ingame debugger?

I mean.. if you would echo out every value, every second line.. you could reconstruct the programs flow- and watch the values dance, and then ..
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Lua IDE

Post by gajop »

aegis wrote: This means inline syntax highlighting, saving you a pesky Spring reload for syntax typos and such.
Would it be possible to have some sort of semantic parsing as well? F.e writing "Sping.Echo" is not syntactically incorrect, that happens to be a bigger problem for me and is quite a nuisance.

PicassoCT wrote:Would it be possible to write ingame debugger?

I mean.. if you would echo out every value, every second line.. you could reconstruct the programs flow- and watch the values dance, and then ..
Maybe there's a better way to do that?
http://stackoverflow.com/questions/7804 ... bedded-lua suggests you can use some sort of remote debugging of sorts,
http://www.keplerproject.org/remdebug/index.html seems to require a small set of tools already mostly existing in Spring?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua IDE

Post by knorke »

gajop wrote:Would it be possible to have some sort of semantic parsing as well? F.e writing "Sping.Echo" is not syntactically incorrect, that happens to be a bigger problem for me and is quite a nuisance
with notepad++ you can edit the .xml files in plugins\APIs\ and make your own autocomplete lists...
In a similiar way it should be possible to define some new words that get highlighted?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua IDE

Post by PicassoCT »

i can tell some funny stories about notepad++ suggesting typos that i made in coments..
User avatar
Prominence
Posts: 97
Joined: 24 Jun 2008, 07:21

Re: Lua IDE

Post by Prominence »

notepad++ sure is popular, but it's only for windows :(
Post Reply

Return to “Lua Scripts”