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 »

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!
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth »

I use notepad++
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg »

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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Lua IDE

Post by gajop »

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
coreygoestoholl
Posts: 3
Joined: 30 Jan 2012, 18:51

Re: Lua IDE

Post by coreygoestoholl »

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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth »

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.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lua IDE

Post by Cheesecan »

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
coreygoestoholl
Posts: 3
Joined: 30 Jan 2012, 18:51

Re: Lua IDE

Post by coreygoestoholl »

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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth »

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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua IDE

Post by knorke »

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)
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lua IDE

Post by Cheesecan »

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.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua IDE

Post by PicassoCT »

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..
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Lua IDE

Post by Beherith »

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!
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg »

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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lua IDE

Post by smoth »

that can be set to save the changes to a file though...
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Lua IDE

Post by zwzsg »

Yes, but since the defs are edited when loading the gamedata, it won't change them ingame.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua IDE

Post by PicassoCT »

paralllel gamestart in background with new settings, then on-the-fly switch without stitch?
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Lua IDE

Post by Anarchid »

Me, i use geany. Long story short, it's essentially gedit, but with autocompletion and stuff.
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!
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.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Lua IDE

Post by CarRepairer »

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

Return to “Lua Scripts”