Page 1 of 1

Lua testing environment?

Posted: 10 Jun 2008, 06:01
by Aztek
Hey,

I'm just getting started with Lua and Spring and I'm wondering what people use for testing Lua widgets. I've just been running a windowed Test Spring session and loading/testing my widgets. If something goes wrong Spring automatically unloads the widget and displays the error in the chat area. I fix it, save the file, unload/load and repeat.

Is this an efficient setup? Is there any way to step through and debug Lua stuff (I don't imagine there is but I figured it's worth asking)?

Thanks,
Aztek

Re: Lua testing environment?

Posted: 10 Jun 2008, 06:28
by aegis
use lots of Spring.Echo and

Code: Select all

.luaui reload
or

Code: Select all

.luarules reload
(depends on what you are testing)

Re: Lua testing environment?

Posted: 10 Jun 2008, 06:43
by lurker
Don't forget that if you want to make a file in an sdd longer midgame, you need to have the end padded with a long comment so it's safe to get cut off at the previous file size. Fixed in svn, I don't know if it applies to the local luaui folder or not.

Re: Lua testing environment?

Posted: 10 Jun 2008, 12:03
by trepan
The DoLine widget and gadget are useful for lua dev'ing.

Re: Lua testing environment?

Posted: 11 Jun 2008, 20:41
by Aztek
@aigis: Using Spring.Echo would definitely be useful for debugging, thanks.

What do .luaui reload and .luarules reload accomplish that unloading/reloading a widget doesn't?

@lurker: What does SDD mean here? To me that means Software Design Document, but I doubt that's what you meant.

It appears by what you said that the filesize of your widget is locked by spring so it can't be beyond the original length and you have to restart spring to fix this or pad with a comment to give yourself some breathing room? :?

@trepan: I'll check those out, thanks.

Thanks for the replies.

Re: Lua testing environment?

Posted: 11 Jun 2008, 23:30
by Peet
Aztek wrote:@lurker: What does SDD mean here? To me that means Software Design Document, but I doubt that's what you meant.
Spring Data Directory (Is the backronym I've determined, though it could be something else)...it's essentially a content package that is contained in a folder rather than a zip/7zip archive. It uses the same file/folder structure inside a main folder which must end in .sdd.

Re: Lua testing environment?

Posted: 11 Jun 2008, 23:35
by aegis
for testing widgets outside of a mod, you won't need to worry about .sdd or padding