Game Development Community

Torque In-game Script Editor (very early development)

by Matthew Langley · in Torque Game Builder · 03/18/2005 (2:45 pm) · 6 replies

Ok, well last night I finished my massive tutorial on creating the Physics demo (weighing in at about 80 - 95 estimated print pages in its html format)... so today I figured I'd give this a shot...

An In-engine script editor... well right now I use notepad and wordpad whole lot lol, so I'm not use to fancy syntax highlighting, I might try and integrate that as well (so if you like syntax highlighting pick up JEdit or something similar)... heres some pics... Its basically a large guiMLTextEditCtrl...

I have an exec, open, and save button...

they will bring up a file list (just like the one in the gui editor) and allow you to click and then save/open... and even have a simple exec one (so you can write a script file, exec it, and then test it instantly (note: some things don't work well exec'd in game...

Nothing fancy, just a few hours of working on file handling code, gui code, snatching some of the GUI editor file list code, etc...

figured I'd throw some pics up for now


here is just the editor opened
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor1.JPG
this is after clicking the open button
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor2.JPG
opened the "client.cs" file
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor3.JPG
creating a script file from scratch to test
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor4.JPG
saving it as test.cs
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor5.JPG
after saving i hit the "exec" button so now I can execute it while in engine
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor6.JPG
here are all the echo console satements (note the top text.... the
echo("test .....
etc etc... those are just debug echo's after I write the file... as you can see the echos work at the bottom
www.razedskyz.com/games/torque/tutorials/T2D/editor/editor7.JPG


the parsing won't be too hard with the syntax highlighting (function seperating) - recently created a torquescript database so used to parsing, though the real-time updating is the tricky part, making sure the scroll remains and nothing freaks out as it updates, etc.... but no garantees, I'll try to post the gui files (the scripting is in there too) later tonight if anyone wants it (though again no fancy syntax highlighting :))

About the author

Was a GG Associate and then joined GG in 2005. Lead tool dev for T2D and T3D. In 2011 joined mobile company ngmoco/DeNA and spent about 4 years working game and server tech. 2014 joined startup Merigo Games developing server technology.


#1
03/18/2005 (3:25 pm)
Cool
I just found time to get started on my image datablock program.
My gui is so ugly! :)
but so far you can open a dir and it picks out all the pngs( soon more) and then puts them into a script file. So far all it does is the full image type (not color-keyed or celled yet).
Ill get it out sometime tonight, and after that gui tut time. :) Know of any good ones matt?
#2
03/18/2005 (3:29 pm)
Ooh very cool, look forward to that (love tools made inside Torque :) )....

last night i finished a Huge tutorial... about 70-80% of it is about GUI's... mainly buttons, sliders, and data storing... I tried to detail everything, I submited it last night so it should be up today (hopefully)... keep an eye on the code snippets to the right side of the screen for "T2D Tutorial ..."

will enjoy running through your program when you get it out :)
#3
03/18/2005 (4:00 pm)
Awsome, looking forward to it.
#4
03/18/2005 (9:08 pm)
Matthew, it would be well worth your time to look at Scintilla:
www.scintilla.org/

This will take care of Syntax highlighting and a LOT of other things for you, it is free-source, so you can do whatever with it.
#5
03/19/2005 (1:02 am)
Hey Matt,

Man you keep doing more cool stuff. :) Definitely look into Scintilla, and I'll be in touch w/ ya about this project in addition to the other stuff we've been talking about!
#6
03/19/2005 (2:04 am)
Thx a lot Pat... will definately check that out (lol was cringing at trying to work around syntax highlighting, etc)... Thx Josh, just trying to keep busy, plus I finally asked myself why was I using wordpad lol *shrug* took me a while to finally ask that question (the ideas of Torque being used for other types of apps, like script editors, csg modellers, etc, is very exciting... thoughts have been bouncing around my head of making some sort of Director/Flash type program using T2D)

btw impressive booth at GDC... got to shake hands with Josh, Jeff, and Tim... wanted to shake your hand Pat, though each time I stopped by you and Ben were busy lol (will look forward to IGC! lol King BoB is going to make the rounds)