Game Development Community

Fiddling around with the demo..

by . · in Torque Game Engine · 10/19/2005 (1:20 am) · 6 replies

Hi all,

I've been playing around with the demo as some of you suggested, and have created empty "missions", placed stuff in them, altered and repainted terrain etc (water still confuses me though).

But now what? Is there a good link / tutorial that shows you what you can do with the scripts, or can't you do any scripting (just to test stuff) with the demo? Like import stuff, and actually make something happen. Running around in a static world gets quite boring real fast. ;)

The GUI editor is confusing aswell, but maybe I should just spend more time with it..

Thanks in advance!

#1
10/19/2005 (6:36 am)
I would say now the next logical step is to go from adding static objects using the in-game editor to creating new dynamic shapebase-derived objects(aiplayers, vehicles) defined by datablocks with animations and movement controlled by script. you should also start practicing creating and exporting dif structures into the game environment. it's at this point that you can get a handle on how fun importing objects into torque can be. =)

and dont forget about sound either. test and practice using the sound facilities torque features.

all the while, you should also be learning about other miscellaneous torque entities like triggers, physical zones, shapereplicators, lights, and particle emitters.

then you need to learn about guis; loading guis, in-game guis, menu screens, message vectors etc. if youre more of the programmer type you could avoid using the gui editor altogether and just code all your interfaces in script.

once youve done all this then maybe youll be in a position to start making a real game.

"Is there a good link / tutorial that shows you what you can do with the scripts, or can't you do any scripting (just to test stuff) with the demo? Like import stuff, and actually make something happen. "

you can edit the scripts in the demo using any kind of text editor including notepad. find a nice free text editor for programmers.(I use crimson myself) you arent restricted from scripting in any way.

to answer your question, theres ALOT you can do using scripts. you can create your entire game using script only if it suits your needs. if you have the source code you can also extend the scripting functionality in any way you want.
#2
10/19/2005 (6:41 am)
I understand that there is a lot you can do with scripts :P But I took a look at the scripts that come with the demo and don't even know where to start.. I can't really find the scripts belonging to e.g. the fps-demo.
#3
10/19/2005 (6:47 am)
Theyre spread all throughout. understanding the scripts will be a major hurdle in understanding and getting a feel for the engine. when it comes to direction, everything starts at main.cs which resides in the same directory as the executable for the demo. start from there and march forth into the great unknown...

if you have anymore questions, im always willing to waste time here. =)
#4
10/19/2005 (7:08 am)
It's too confusing... Going through the main.cs leads to the exec of the client's main.cs and that file loads a ton of gui-related scripts, but I can't find any references to e.g. the loading of a mission / world, or players / models.. Where are those?
#5
10/19/2005 (8:10 am)
Yea it does get confusing but all those scripts have a purpose and if you skip any youll eventually find yourself going back to take a look at them. keep in mind that although those gui files mainly define interfaces, they may also contain important code and function definitions. in fact, the mission loading sequence starts from a gui file. thats why I suggest simply going through all the scripts sequentially, even if their purpose isnt immediately apparent to you.

im using the version of the demo which came with the book, so the script directory setup may be different from the current setup of scripts in the latest version. however, from my recollection, mission loading starts in the mainmenu gui file. this file uses file reading functions to read all the .mis files available. this file also calls "createserver()" from the server.cs file which is in server/scripts. so if you want to get a handle on mission/world loading, start by looking at the mainmenu gui file and server.cs.

after the server is created, datablock definitions are loaded. these datablocks are the templates the engine uses to create objects and characters. datablocks are loaded in "onServerCreated()" which is called from "createserver()". the "onservercreated()" simply execs a number of files which contain datablock definitions. the "onservercreated()" function is defined in another important file: game.cs which can also be found in server/scripts. after the mission is loaded the function "onClientEnterGame()" is called. this function resides in game.csas well and basically creates all the non-environment objects like players, vehicles, items. etc. so getting a handle on loading players and objects involves two steps; loading the datablock for the object (onservercreated), and then introducing the object into the mission(onclienentergame).

to sum up, you should take a look at the main menu gui, server/scripts/server.cs, and server/scripts/game.cs in that order. that should keep you busy till next week. =)
#6
10/19/2005 (9:30 am)
Thanks for the info. Really appreciated. And indeed, should keep me busy for a while ;) lol