In-tgb Script Ide
by Clint Herron · in Torque Game Builder · 01/19/2007 (7:39 pm) · 20 replies
I was thinking of getting a start on a resource like this, but then I did some searching and found that back in '03 (before I got very into Torque), there was a huge buzz that swept through the GG site called the TGE In-Game Script Editor. Is there any chance we could see this resource resurrected for Torque Game Builder? In getting friends into TGB, one of the big things they get hung up on is the interaction of TGB and their script editor. I know personally that I think I've saved a file or forgotten to reload my project and wondered why a feature I added wasn't working.
Also, we may want to see about getting Alex Scarborough's MLTextEdit fixes integrated into head in order to help the IDE as well (if it hasn't happened already).
I saw Ben Garney used to be pretty interested in this project, but he's not on the TGB project directly (even though his work impacts TGB). Has this resource caught the attention of any other GG employees?
But I guess I also wonder if something like this already in the works. Should people start hacking on this, or should we wait and see what good things the TGB tooth fairy brings next version?
Thanks again for providing the best rapid-game-develpoment toolset in my arsenal! :)
Sincerely a fan,
clint
Also, we may want to see about getting Alex Scarborough's MLTextEdit fixes integrated into head in order to help the IDE as well (if it hasn't happened already).
I saw Ben Garney used to be pretty interested in this project, but he's not on the TGB project directly (even though his work impacts TGB). Has this resource caught the attention of any other GG employees?
But I guess I also wonder if something like this already in the works. Should people start hacking on this, or should we wait and see what good things the TGB tooth fairy brings next version?
Thanks again for providing the best rapid-game-develpoment toolset in my arsenal! :)
Sincerely a fan,
clint
About the author
#2
Now the Torsion alpha is over, you can't even reload your old project in :(
I don't want to pay again for so specialize script editor around torquescript (as TorqueX C# is around).
For those who don't know there is the wonderful Codeweaver/TorqueDev (www.torquedev.com/download.php).
You still have "NOTEPAD++" (notepad-plus.sourceforge.net/fr/site.htm very nice) or "notepad 2" (www.flos-freeware.ch/ pretty old now...) for quick editing all kind of sources code.
02/08/2007 (7:39 am)
I would love a true script editor inside TGB too.Now the Torsion alpha is over, you can't even reload your old project in :(
I don't want to pay again for so specialize script editor around torquescript (as TorqueX C# is around).
For those who don't know there is the wonderful Codeweaver/TorqueDev (www.torquedev.com/download.php).
You still have "NOTEPAD++" (notepad-plus.sourceforge.net/fr/site.htm very nice) or "notepad 2" (www.flos-freeware.ch/ pretty old now...) for quick editing all kind of sources code.
#3
Granted, this would be nice, for a number of reasons, it would allow you to quickly whip together prototypes without having to switch between editors, etc -- do I think this will happen? Doubtful ... am I going to cry over it? Definately not ... I bought Torsion the first day it was released ... :)
I do, however, think that features like the ones I mentioned above, would bring more people to TGB ...
02/08/2007 (8:21 am)
I would like the ability to write small snippets of code directly in the TGB editor -- it would also be nice to be able to drop objects in the level builder, and then bind to that objects events with 'auto-script' creation -- for example, like in Visual Studio ... if you were to drop a t2dSceneObject and then goto it's "script" tab, have it auto-generate an onMouseDown or onLevelLoaded script-stub that you could then quickly edit ... without messing with other code (just edits the onLevelLoaded function) then perhaps writes that out to a 't2dSceneObject.cs" file (named after the object itself, or something?)Granted, this would be nice, for a number of reasons, it would allow you to quickly whip together prototypes without having to switch between editors, etc -- do I think this will happen? Doubtful ... am I going to cry over it? Definately not ... I bought Torsion the first day it was released ... :)
I do, however, think that features like the ones I mentioned above, would bring more people to TGB ...
#4
As far as an in-game editor. GG originally approached me to make Torsion part of TGB, i refused as i thought it was a bad idea. Torque has alot of merits... but as a framework for general application development it's a bit weak. At the time... two years ago... it was very weak. The TGB team has since made many improvements to strengthen the framework for non-game tools.
Still in-process editing and debugging is not the greatest of ideas for the same reasons in-process execution of your game within the level editor isn't the greatest of ideas. It's too easy to unknowingly influence your game with changes in the editor/debugger.
If your ultimate goal is real-time editing of executing game code, then your better off with extensions to the TelnetDebugger. As soon as i get some time i'll post my "Edit and Continue" fixes for the TelenetDebugger and you'll have that wish from Torsion.
02/08/2007 (10:02 am)
@Rivage -Quote:Now the Torsion alpha is over, you can't even reload your old project in :(That is not the case. Every Torsion release has worked with previous Torsion projects. If you want to continue to use Torsion, just grab the demo.
As far as an in-game editor. GG originally approached me to make Torsion part of TGB, i refused as i thought it was a bad idea. Torque has alot of merits... but as a framework for general application development it's a bit weak. At the time... two years ago... it was very weak. The TGB team has since made many improvements to strengthen the framework for non-game tools.
Still in-process editing and debugging is not the greatest of ideas for the same reasons in-process execution of your game within the level editor isn't the greatest of ideas. It's too easy to unknowingly influence your game with changes in the editor/debugger.
If your ultimate goal is real-time editing of executing game code, then your better off with extensions to the TelnetDebugger. As soon as i get some time i'll post my "Edit and Continue" fixes for the TelenetDebugger and you'll have that wish from Torsion.
#5
02/08/2007 (5:05 pm)
@Tom, edit and continue patches? *slobbers* ... ;)
#6
02/12/2007 (4:05 am)
I have to say I much prefer Codeweaver to Torsion, and Codeweaver is free. I would love an integrated script editor, but I would also love a "Reload all" button or something like that to skip closing and opening TGB all the time :)
#7
I make changes to code in Torsion, while my game is running ... then 'esc' and 'f5' and the changes take effect ...
02/12/2007 (6:24 am)
@Aaron, the only script thats not recompiled when you play-test the game from the level builder are the main.cs scripts -- all others are recompiled each time you play-test the game ... but only if there differentI make changes to code in Torsion, while my game is running ... then 'esc' and 'f5' and the changes take effect ...
#8
02/12/2007 (6:41 am)
Tell that the datablocks ... they actually do deeply disagree on that point unless I am doing something really really stupid.
#9
While true, I found that, during the alpha/beta at least, that projects built created with previous versions didn't quite work properly.
02/12/2007 (6:45 am)
@TomQuote:That is not the case. Every Torsion release has worked with previous Torsion projects.
While true, I found that, during the alpha/beta at least, that projects built created with previous versions didn't quite work properly.
#10
@Scott - Sounds improbable to me... there have been thousands of Torsion users over the last two years and not one has reported this to me. I'm pretty sure that's one issue i would have heard about, but i'd be happy to be proven wrong. If you give me a specific bug report on that i'll look into it.
02/12/2007 (10:05 am)
@Marc - Even datablocks are reloaded in TGB if you re-exec() the file they're in. If your project in TGB is setup normally then you don't have to shut TGB down to change scripts.@Scott - Sounds improbable to me... there have been thousands of Torsion users over the last two years and not one has reported this to me. I'm pretty sure that's one issue i would have heard about, but i'd be happy to be proven wrong. If you give me a specific bug report on that i'll look into it.
#11
While I don't have a bug report for it, I don't have any of the projects created from the alpha/beta build anymore, I think the problem itself may have stemmed from installing a newer build over top an old one. After uninstalling and reinstalling I ended up having to create a new project, which wasn't that big of a deal since it takes about 15 seconds to do. It may have just become habit after that. If I can dig up an old project file I'll see if I can reproduce anything.
02/12/2007 (10:29 am)
@TomWhile I don't have a bug report for it, I don't have any of the projects created from the alpha/beta build anymore, I think the problem itself may have stemmed from installing a newer build over top an old one. After uninstalling and reinstalling I ended up having to create a new project, which wasn't that big of a deal since it takes about 15 seconds to do. It may have just become habit after that. If I can dig up an old project file I'll see if I can reproduce anything.
#12
02/12/2007 (11:02 am)
@Scott - Strange... every install i've done has been over the top of the last. Torsion is very simple... no registry settings or controls to register. In fact you can copy Torsion to a flash drive and run it from there just fine. Let me know if you come across a reproducible case.
#13
So not exactly the result I am looking for.
Updating datablocks seems like it does not simply work through reexecuting the cs file. (but perhaps I'm doing something wrong, I just execute it in game.cs, startGame(%level) )
For scripts the reexec works without any problems.
02/12/2007 (11:08 am)
Tom: Yes they get re-exec-ed, but then they are twice /multiple times in the editor instead of beeing overwritten / updated and the values on actual instances using the datablock are not updated as well.So not exactly the result I am looking for.
Updating datablocks seems like it does not simply work through reexecuting the cs file. (but perhaps I'm doing something wrong, I just execute it in game.cs, startGame(%level) )
For scripts the reexec works without any problems.
#14
Rule #1 with unexplained errors: DELETE ALL DSOs AND REBUILD!
02/12/2007 (12:26 pm)
Well a couple of times I have wanted to blame Torsion for issues but it turned out to the old bogey man of not deleting DSOs. Sometimes they will not be recompiled after changing and I would get weird inconsistencies.Rule #1 with unexplained errors: DELETE ALL DSOs AND REBUILD!
#15
02/12/2007 (1:36 pm)
Yupp but does not explain why the datablocks would be multiple time in the datablock dropdown in the edit tab ... Either Editor or TGB badly bug there, so I got used to just restart TGB or not editing the datablocks on regular base at all I should say.
#16
If you create global objects in the script then they will exist until you delete them. If you re-exec the script then they will get created again. Any function / method bodies and global variables will be "replaced" however.
The console has no way of knowing that you are trying to reload a script. It does not track all the objects you create from a particular script, and there is no reasonable solution to make it do that.
The only "bug" here is that you are trying to make Torque do something it can't do. However, if you really want to be able to reload datablocks, you can just stick all your datablocks in a SimGroup and delete that group before re-loading the datablocks script. However, that is not foolproof and may cause you other issues.
T.
02/12/2007 (10:32 pm)
Quote:Tom: Yes they get re-exec-ed, but then they are twice /multiple times in the editor instead of beeing overwritten / updated and the values on actual instances using the datablock are not updated as well.
So not exactly the result I am looking for.
If you create global objects in the script then they will exist until you delete them. If you re-exec the script then they will get created again. Any function / method bodies and global variables will be "replaced" however.
The console has no way of knowing that you are trying to reload a script. It does not track all the objects you create from a particular script, and there is no reasonable solution to make it do that.
The only "bug" here is that you are trying to make Torque do something it can't do. However, if you really want to be able to reload datablocks, you can just stick all your datablocks in a SimGroup and delete that group before re-loading the datablocks script. However, that is not foolproof and may cause you other issues.
T.
#17
But as I will need some loading / unloading mechanism anyway I will surely find a way around it.
I will look using SimGroups for object management. Can this be used for Datablocks as well? Are packages a possible solution to this problem with cloned datablocks?
02/12/2007 (10:41 pm)
Hmm, I thought SimObject names were unique so twice the same datablock should not be able to exist. But might be that I missunderstood the concept behind it or did not fully understand it so far or it just not applies to datablocks.But as I will need some loading / unloading mechanism anyway I will surely find a way around it.
I will look using SimGroups for object management. Can this be used for Datablocks as well? Are packages a possible solution to this problem with cloned datablocks?
#18
Datablocks are just ordinary objects. In TGB there is pretty much no difference between a datablock and an object as far as the console is concerned. Packages won't help.
T.
Edit: Typos
02/12/2007 (11:11 pm)
SimObject names are not technically unique. You can have multiple objects with the same name, but Sim::findObject() will only return the first one it finds. Thus, the additional objects will only be accessible by their ID. Names are hashed so relying on the order they were added to deal with name clash is likely not reliable.Datablocks are just ordinary objects. In TGB there is pretty much no difference between a datablock and an object as far as the console is concerned. Packages won't help.
T.
Edit: Typos
#19
02/13/2007 (3:28 am)
I always use a datablock manager that I've created to specifically manage all the different objects I create in script. One for global/project data, one for level data, etc. I added a script function to restart either the level/project, etc and it all works pretty easily from there.
#20
Does not mather, solved my problems more or less :) (moved some to level manager and some are project wide needed and thus moved to main.cs)
02/13/2007 (4:24 am)
I had manager for regular stuff but somehow assumed that datablocks are handled differently. One might not ask me why ...Does not mather, solved my problems more or less :) (moved some to level manager and some are project wide needed and thus moved to main.cs)
Torque Owner Neo Binedell
It simply kicks ass and because of the awesome integration with TGB (and other torque engines) feels like a plugin to it. You can debug, set breakpoints, view variables, add watches, etc, etc, and for editing is basically Visual Studio for scripting.
It would be rather a waste of resources to try and duplicate that (and add code bloat) in engine.