Game Development Community

Torque DB

by Matthew Langley · in Torque Game Engine · 04/10/2005 (9:29 pm) · 7 replies

(been a while since I've posted in here... lol been stuck in the T2D forums... its just too addicting!)

Torque DB

Ok finally got a chance to release the resource (still waiting for approval)...

the source changes to guiMessageVectorCtrl simply add two callbacks... one for when you click and another when you move, so it passes the line number back

I highly suggest you back up your Torque files before doing that if you choose to implement those changes

Note the .cs files can be put anywhere... i'd suggest a subfolder under the client folder though

for the Torquescript database you don't have to do any changes since its in Torquescript :) The beauty of Tscript... simply drop in the folder i referenced and the execs I reference and you can access it... hopefully I can get some tutorial up on making things with it... but I just wanted to organize it better (seperated the files vs one 62KB file)... I have a lot of not so organized documentation on the resource... also I put a lot of comments in the resource.. as well as a lot of debug messages...

note the debug messages are toggled off by default... to turn them on simple type

$debugMsg::journalDebug = true;

in the console

altogether this is over 40 pages of scripting, though I could've made even more functions... I am lacking a sort function presently... and there is only one duplicate function... look through the .cs files under "database" folder for examples on every function :)

Hope this helps someone, its a bit massive right now, plan to add more documentation though just wanted to start the approval process right now (have 4 resources waiting to be approved right now lol... all three parts of my mouse selection tutorial as well as this)

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
04/11/2005 (12:58 am)
Here is the journal system in action
www.razedskyz.com/games/torque/plan/journalpic1.JPGwww.razedskyz.com/games/torque/plan/journalpic2.JPG
here is the layout
www.razedskyz.com/games/torque/plan/journalDiagram1(small).JPGwww.razedskyz.com/games/torque/plan/journalDiagram2(small).JPG
#2
04/11/2005 (1:02 am)
Uh... I've never used a journal in any game, although I think it would be interesting to have one in games like Zelda (Windmaker) where there are many side quests. What is it exactly for? Do you insert your own text? Does it fill by itself?
#3
04/11/2005 (7:56 am)
Lordy this is nice for a journaling system, I'm going to try and implement it into my RPG just for the KEWL factor.
#4
04/11/2005 (8:27 am)
@Luis: This is basically a database in torquescript (minus the sort functions)... you can add a table (I call "class" in the script files)... a column ("property") and entries ("instances") for the normal functionality of a simple database. Plus I have a full working journal example (great for an RPG)... it is click navigateable and it also has hover over highlighting (with a couple simple mods to guiMessageVectorCtrl)... you simply run a command to add a new entry to the "entry" class and it will populate it into the journal... also if you reference a property named "image" and set a file path to an image it updates it on the right side of the journal when that entry is accessed...

also I have included a dump function that dumps to a plain text file (XML similar syntax) as well as a simple encrypted syntax... on top of this I also have a file loading function (one for plain text and encrypted - technically you could dump to plain text and m odify it as a text file and reload to set up or add info)... the loading function fully parses the information back into the db

@Dreamer: hope you enjoy :)
#5
04/11/2005 (12:48 pm)
OK! I see :D I was using SQLite, but this one looks good for simpler things :)
#6
04/13/2005 (1:52 am)
Yeah this looks cool. I'm trying to figure out ways of implementing this. Its so extensible, it can be for really anything
#7
04/13/2005 (6:47 am)
Just added a dump to HTML function that way you can easily dump your DB Tables (also called "classes in my script) into a easy to view deisgn/review format