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
Lua testing environment?
Moderator: Moderators
Re: Lua testing environment?
use lots of Spring.Echo and or (depends on what you are testing)
Code: Select all
.luaui reload
Code: Select all
.luarules reload
Re: Lua testing environment?
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?
The DoLine widget and gadget are useful for lua dev'ing.
Re: Lua testing environment?
@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.
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?
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.Aztek wrote:@lurker: What does SDD mean here? To me that means Software Design Document, but I doubt that's what you meant.
Re: Lua testing environment?
for testing widgets outside of a mod, you won't need to worry about .sdd or padding