Game Development Community

Reload Script

by Jay Verba · in Torsion · 08/30/2007 (9:57 am) · 3 replies

Hello all,

I may be making what someone would call a "trivial" mistake but my searches here didn't turn up any helpful results. I have been attempting to use the reload scripts function similiar to the debugging from vc++. After you right click the file you see TGE return DBGERR invalid command!

After debugging the executable from within visual studio I see that torsion is sending this command via the telnet debugger.

RELOAD

After inspecting the telnetdebugger.cpp it's clearly not implemented in either TGEA or TGE. Is there something I am missing? I fished around to attempt to find an updated cpp file but I didn't come across something. Tim mentioned in a previous plan update that he hadn't released the code for the reload feature but that was well over a year ago.

#1
08/31/2007 (2:40 pm)
Reloading Scripts does not currently work. Getting this working will be a "super cool awesome" feature but unfortunately it is not ready.
#2
08/31/2007 (3:04 pm)
I went ahead and just implemented this myself in plain old script.
ie,
just make an "initScriptsReloadable.cs" file which loads the scripts you want to be reloadable,
and then a script function like

function reloadScripts()
{
   exec("<whatever path>/initScriptsReloadable.cs");
}


speeds up dev time immensely.

of course,
you don't want to reload all scripts,
and the script you do reload should be designed with that in mind.

eg, don't reload datablocks !
#3
09/01/2007 (3:34 pm)
Exactly what Orion says... a simple re-exec() isn't a general solution.

I have some code for this that i was working on before the Torsion 1.0 release, but it was still quite buggy... after a reload or two things would crash out. Also it didn't work instantly... meaning it wouldn't really reload the current function you were stopped at until it was called again.

Still it worked properly with datablocks and objects (at least it did with a local server), removed deleted functions, and replaced or added new ones, even supported the "move instruction pointer" VS feature. It is really sweet... except for the crashes.

If i get some time i'll revive that code and see if i can get a partial version out there.