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: 3023
Joined: 05 Aug 2009, 20:42

Re: Lua IDE

Post by gajop » 09 Feb 2012, 18:08

pfft, but can your komodo edit look this cool?
Image
Attachments
2012-02-09-180430_1920x1080_scrot.jpg
(537.56 KiB) Downloaded 2 times
0 x

User avatar
MidKnight
Posts: 2650
Joined: 10 Sep 2008, 03:11

Re: Lua IDE

Post by MidKnight » 10 Feb 2012, 05:41

Sure.
Image(image is a link)
0 x

User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lua IDE

Post by Cheesecan » 10 Feb 2012, 10:35

Ah that looks nice MidKnight. How long will it last without a license? Website doesn't say..
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7017
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg » 10 Feb 2012, 19:23

Forever!
http://www.sublimetext.com/download wrote:There is no enforced time limit for the evaluation.
0 x

User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lua IDE

Post by Cheesecan » 10 Feb 2012, 21:55

Wow I must be getting old..
0 x

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

Re: Lua IDE

Post by PicassoCT » 21 Mar 2012, 11:39

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.
0 x

User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Re: Lua IDE

Post by quantum » 11 Apr 2012, 19:25

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.
0 x

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

Re: Lua IDE

Post by PicassoCT » 21 Apr 2012, 06:50

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

http://springfiles.com/spring/tools/satans-bugfixer
0 x

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

Re: Lua IDE

Post by gajop » 03 Jun 2012, 15:26

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?
0 x

luckywaldo7
Posts: 1397
Joined: 17 Sep 2008, 04:36

Re: Lua IDE

Post by luckywaldo7 » 03 Jun 2012, 16:32

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.
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7017
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg » 03 Jun 2012, 16:44

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.
0 x

User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Lua IDE

Post by aegis » 03 Jun 2012, 21:41

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
0 x

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

Re: Lua IDE

Post by PicassoCT » 03 Jun 2012, 22:09

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 ..
0 x

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

Re: Lua IDE

Post by gajop » 04 Jun 2012, 02:06

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?
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua IDE

Post by knorke » 04 Jun 2012, 06:49

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?
0 x

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

Re: Lua IDE

Post by PicassoCT » 04 Jun 2012, 21:56

i can tell some funny stories about notepad++ suggesting typos that i made in coments..
0 x

User avatar
Prominence
Posts: 97
Joined: 24 Jun 2008, 07:21

Re: Lua IDE

Post by Prominence » 27 Jun 2012, 08:56

notepad++ sure is popular, but it's only for windows :(
0 x

Post Reply

Return to “Lua Scripts”