Page 1 of 1

how to debug gadgets?

Posted: 08 Oct 2007, 08:49
by BigHead
Solution:
This will allow you to place your gadgets into "Spring/LuaRules/Gadgets" folder*:
.cheat
.devlua

After that you're able to use this command:
.luarules reload

*You need to have gadgets.lua and some other files copied in Spring/LuaRules folder. You can find them at almost any mod (e.g.: BA).

Original post:
I'm writing my first gadget and I need help debuging it. Widgets can be reloaded with simple /luaui reload command. On the other hand Gadget needs to be packed into a file with it's mod. This takes too much time. I'm sure there is an easier way. I tried to put my gadget into this folder: Spring/BA58/LuaRules/Gadgets but it didn't help.
I also briefly read some modding tutorials but didn't find anything on this topic. If this has been documented somewhere then please point me to the documentation and lock this thread.
Otherwise I think someone responsible should update the wiki.

Posted: 08 Oct 2007, 08:58
by Gnomre
1) Extract the mod to <whatever>.sdd in the mods dir, so for example you might have: Spring\mods\BA58.sdd, and inside BA58.sdd you'd have modinfo.tdf, the units folder, etc
2) Move the original archive out of the mods folder or edit the new SDD's modinfo.tdf file's name tag so you're sure you're loading the right copy
3) Put the gadgets in their proper folders within the sdd. Edit normally.

Unfortunately, as far as I know the luarules reload command in-game doesn't work, meaning you must reload the entire game for each change you wish to make.

Posted: 08 Oct 2007, 10:08
by BigHead
Thanks for your quick reply. I think this should be pasted into the wiki.

Posted: 08 Oct 2007, 16:52
by trepan
Use the .devlua command, it will cause the LuaCob/Gaia/Rules scripts
to be loaded from the raw filesystem. A recent SVN addition is that it will also
allow you to load LuaUI from the raw filesystem, even if LockLuaUI.txt is being
used by the mod. Note that .devlua requires that .cheat be active.

Posted: 08 Oct 2007, 17:47
by BigHead
In short:
This will allow you to place your gadgets into "Spring/LuaRules/Gadgets" folder:
.cheat
.devlua

After that you're able to use this command:
.luarules reload

Posted: 09 Oct 2007, 22:45
by TechnoTone
When I try ".luarules reload" it says:

error = 2, LuaRules/Main.lua, Include() could not load "LuaRules/gadgets.lua"
LuaRules reload failed


I've looked around for gadgets.lua but can't find it.

Posted: 09 Oct 2007, 22:53
by tombom
Check any mod with LuaRules stuff eg CA, Tired Annihilation, FunTA, it's the gadget handler.