Hi Rob,
So I understand how the restart entire application works, but how does the
reload current tab work? Does it send mobdebug an effective "dofile(f)"
command?
Hi,
So, as far as I understand:
"There is an interpreter parameter that controls live coding:
"scratchextloop" (you may check the existing interpreters for its use):
It's set to "nil" by default, which means that the interpreter doesn't
support scratchpad and all related functionality will be disabled in the
IDE.
You can set it to "true" and this will make scratchpad to work by reloading
the current editor tab without
restarting the entire application (this is what you'd expect with most of
gaming frameworks, which have some "draw" function, like love2d, corona,
gideros, and others),
You can set it to "false" and this will make scratchpad to restart the
entire application (this is how it's done for the default Lua interpreter)."
So I understand how the restart entire application works, but how does the
reload current tab work? Does it send mobdebug an effective "dofile(f)"
command?
I'm considering whether I can get the state in such a manner that, for
instance, on a game a single entity would carry on with changes ... much
like Notch does with Minecraft here with the skeleton:
https://www.youtube.com/watch?v=BES9EKK4Aw4 ;(from 0:25 onwards). Reloading
the skeleton in the world with default parameters would be reasonable as
well. (I think this applies for a lot more than just games).
Regards,
Rob
P.S. I also know:
"Mobdebug can only reload the application when it can "suspend" the script
from debug hook, which can only be done from Lua code."
"To avoid checking if there is a new "suspend" request too frequently (which
negatively affects performance) it's only done every 200th hook call, which
may be too large for your example (if the check is only done once a second).
You may adjust this by setting
"require('ZeroBraneStudio.mobdebug').checkcount = 1" before starting
debugging."