Debugging attached Lua scripts the easier way
Excuse me if I'm going to say something well known or stupid
I was annoyed that I need to reload CC every time I want to change Lua script attached to device, so I wrote a little workaround:
INI file:
Code:
ScriptPath = UnmappedLands.rte/Scenes/Objects/Teleport/TeleportDebug.lua
TeleportDebug.lua, a stub used only while you're debugging. CF_PutTeleport() is a function which actually does something useful
Code:
function Create(self)
print ("TeleportDebug")
dofile("UnmappedLands.rte/Scenes/Objects/Teleport/Teleport.lua")
CF_PutTeleport(self);
end
Teleport.lua, actual script in which you write you code, replace your debug stub with it in INI once everything's fine.
Code:
function Create(self)
CF_PutTeleport(self);
end
function CF_PutTeleport(self)
print ("Change Places!");
end
This way your code is reinterpreted EVERY TIME your script runs, not a single time when it loads when CC starts