Undo 'exec()' command
by Aditya Kulkarni · in Torque Game Builder · 12/07/2009 (5:14 am) · 4 replies
i need to execute a set of level specific code...so in games.cs in the gamescripts folder, i exec the .cs file for each level...
e.g:
problem is, these variables and functions are still accessible when i load another level...how do i tell the engine not to execute code from that file?
e.g:
if(%level == 1) {
sceneWindow2D.resetSceneGraph();
exec("./levels/level1.cs");
sceneWindow2d.schedule( 0, LoadLevel, "level1.t2d");
}problem is, these variables and functions are still accessible when i load another level...how do i tell the engine not to execute code from that file?
#2
12/07/2009 (5:43 am)
ok, don't have any idea about those...do you have a documentation link for packages?
#3
i referred http://tdn.garagegames.com/wiki/T2D/TGBTutorials/ConsoleHelloWorld
12/07/2009 (6:04 am)
hey i got it... thank for the help Marc!i referred http://tdn.garagegames.com/wiki/T2D/TGBTutorials/ConsoleHelloWorld
#4
http://tdn.garagegames.com/wiki/TorqueScript_Quick_Reference_2#package
12/07/2009 (6:15 am)
if anyone else need it, the official documentation for 'package' is here: http://tdn.garagegames.com/wiki/TorqueScript_Quick_Reference_2#package
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
There is no other way to tell the engine to "forget" something you forced it to learn.