Lua IDE

Lua IDE

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

Moderator: Moderators

coreygoestoholl
Posts: 3
Joined: 30 Jan 2012, 18:51

Lua IDE

Post by coreygoestoholl » 06 Feb 2012, 16:01

So, I'm trying to get into the whole "Lua scripting" thing, and I was wondering about IDE's. I've tried a few text editors (vim, gedit), as well as some actual IDE's (LuaEdit, Eclipse plug-in). They're all ok, I was just wondering if there was something that worked really well with Spring. More generally, I guess, what does a good scripting workflow look like for Spring? Any suggestions or advice would be appreciated (even if it's just that I should suck it up and use notepad). Thanks!
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth » 06 Feb 2012, 16:14

I use notepad++
0 x

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

Re: Lua IDE

Post by zwzsg » 06 Feb 2012, 16:44

A whole IDE seems overkill. There's no compile, the debug is merely reading infolog.txt, and the documentation is short.

I use Notepad++ too.
0 x

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

Re: Lua IDE

Post by gajop » 06 Feb 2012, 16:44

personally, i don't use IDEs for dynamic typed languages - they tend to just suck (the IDEs, not the languages)
on linux i use vim, tmux (terminal multiplexer similar to screen), grep, and tail if needed
on windows (and that's just really something i avoid, it's really much more suited for C++ and C#), it's just notepad++ and mtail

seeing as you're on linux, if you're familiar with vim it's all about finding a couple of proper plugins (buffer list one is pretty good), and hope you have sane defaults for it like arch linux does
0 x

coreygoestoholl
Posts: 3
Joined: 30 Jan 2012, 18:51

Re: Lua IDE

Post by coreygoestoholl » 06 Feb 2012, 16:53

These are helpful, thanks- I'll give notepad++ a shot asap. Debugging isn't really a concern, it's more just that I'd like something that makes dumb syntax errors (forgetting a comma or dropping a quote) obvious. I've spent tons of time searching for code only to find an error like that- not the best feeling in the world.

gajop- My time is actually split pretty evenly between linux and windows (what's available depends on where I am), but I'll look around for some vim plugins. I'll check out the buffer list one especially.
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth » 06 Feb 2012, 16:58

pfft notepad++ doesn't do that, it just highlights syntax.

As zwzsg said, we run our code in spring.

if you are working on a widget..
start spring
alt-tab
alter code
restore spring
enter key
/luaui reload

for gadget, do the same but
/luarules reload.
0 x

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

Re: Lua IDE

Post by Cheesecan » 06 Feb 2012, 17:01

Since lua scripts tend to be pretty simple, spring usually encounters any errors you have sooner or later.. If you crave code completion, try (haven't tried it myself so I can't say if it's good or bad): http://dustward.com/?p=66
0 x

coreygoestoholl
Posts: 3
Joined: 30 Jan 2012, 18:51

Re: Lua IDE

Post by coreygoestoholl » 06 Feb 2012, 17:07

smoth- Is there also a way to reload unitdefs without restarting Spring? That would be really helpful, too.

Cheesecan- Code completion has always seemed kinda gimmicky to me, but I'll take a look. Who knows, maybe it'll be really useful.
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth » 06 Feb 2012, 17:11

not that I am aware of but zwzsg has some kind of in game stat altering code, he may be able to help you with that.
0 x

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

Re: Lua IDE

Post by knorke » 06 Feb 2012, 17:11

I use notepad++
It has has synthax highlighting for Lua and you can have multiple files open in tabs. Which is really all you need for spring lua.
It also does this thing where it shows nested stuff so you can notice missing ends etc.
If you feel clever you can put infolog.txt in an extra tab/window and use sfhift+F5 to reload it = console, kind of.
More generally, I guess, what does a good scripting workflow look like for Spring?
pro workflow is pro.
http://answers.springlobby.info/questio ... est-my-mod

Also tons of plugins:
http://sourceforge.net/apps/mediawiki/n ... in_Central
Tbh I never tested any of those but at least autocomplete & function/class browser seem usefull. (but for epenis++ I use codeblocks so never really tried)
0 x

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

Re: Lua IDE

Post by Cheesecan » 06 Feb 2012, 17:12

Gimmicky? c'mon..if you ever worked with a real language *cough* then you would love it. But with these dynamically typed languages .. meh almost no point to have it since everything is just a lump of chaos.
0 x

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

Re: Lua IDE

Post by PicassoCT » 06 Feb 2012, 17:52

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

User avatar
Beherith
Moderator
Posts: 4933
Joined: 26 Oct 2007, 16:21

Re: Lua IDE

Post by Beherith » 06 Feb 2012, 17:55

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

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

Re: Lua IDE

Post by zwzsg » 06 Feb 2012, 18:29

coreygoestoholl wrote:smoth- Is there also a way to reload unitdefs without restarting Spring? That would be really helpful, too.
There is the /editdefs cheatcode, but I don't really know how it works as I never used it.
smoth wrote:not that I am aware of but zwzsg has some kind of in game stat altering code, he may be able to help you with that.
My code is to edit any stats via a modoption, without modifying the mod, which is an entirely different purpose.
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth » 06 Feb 2012, 18:47

that can be set to save the changes to a file though...
0 x

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

Re: Lua IDE

Post by zwzsg » 06 Feb 2012, 19:04

Yes, but since the defs are edited when loading the gamedata, it won't change them ingame.
0 x

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

Re: Lua IDE

Post by PicassoCT » 06 Feb 2012, 19:33

paralllel gamestart in background with new settings, then on-the-fly switch without stitch?
0 x

User avatar
Anarchid
Posts: 1379
Joined: 30 Nov 2008, 04:31

Re: Lua IDE

Post by Anarchid » 07 Feb 2012, 05:10

Me, i use geany. Long story short, it's essentially gedit, but with autocompletion and stuff.
0 x

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

Re: Lua IDE

Post by PicassoCT » 07 Feb 2012, 15:16

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!
Actually Satan promised me a AutoIt tool, that would pares the errorline and using the jump of AutoIt would "step" to the same line, and then the next, and next..

Comfort here we come.
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Lua IDE

Post by CarRepairer » 09 Feb 2012, 17:59

I used notepad++ for years then switched to Komodo Edit. It is more powerful, cleaner and works properly on linux as well as windows.
0 x

Post Reply

Return to “Lua Scripts”