Game Development Community

Method / Resource to rerun script without closing/reopening TGB?

by Leroy Frederick · in Torque Game Builder · 09/14/2006 (3:43 am) · 2 replies

Hi all,

I'd like to know if theres another way of reloading scripts changes other then re-opening the same project or restarting TGB.

I thought i remembered someone saying they had a method/resource that allows you to re-run script at every test/game play run, but i can't find it (this would be the case if im imaging it or it's just wishful thinking!)

I tried creating a variable that reloads specific script in game.cs, but it just creates doubles and messes everything up (probably need to find an script unload method).

I also tried exec() within the console, it compiled, but it didn't seem to take script changes into account :(

So is there a method/resource for this, or is this just wishful thinking!

Thanks in advance :0)

#1
09/14/2006 (3:48 am)
The game.cs file in your gameScripts folder gets compiled and executed when you open the project and again every time you hit play. You can toss your exec calls in the startGame function in game.cs to get them to recompile and execute every time you run your level (or just right at the top of game.cs for them to also execute when the project is opened in TGB, like you would want in the case of datablocks and stuff like that).
#2
09/14/2006 (4:49 am)
Fantastic Thomas, thank you so0000000oome much for that (my computer says thanks too, although fast, it is thankful for the lesser workload and additional ram ;) )

I knew that the game.cs was kinda the mainloop script per test/run etc, but i think i had game.cs running twice or something, hence the doubles of everything and the errors on my first attempt at the system :(

Now I've got a nice script updater system setup, organised in the nice sections and ready to go! This will increase development speed and progress by loads and makes me a even bigger fan of TGB, why didn't i ask sooner...? Thanks again :0)