Game Development Community

How do I know where to put scripts?

by Shane Lunsford · in Torque 3D Professional · 01/25/2012 (5:57 pm) · 3 replies

I'm Still working on the top down camera and have been reading the scripting doc's and unless is states where to put a script I am completly lost. i was working on this but didn't know where to add this to change camera to overhead.

// Overhead modecommandToServer('SetCameraMode', "Overhead");






Is there a document that can help me to better understand where to put the scripts or line codes like what folder Sever, Client, Art, Core..ect? Thank you

#1
01/25/2012 (6:41 pm)
@Shane - Eric is currently teaching a class about this information, so maybe I can get him to explain this a little better. The base concept is this:

Code that does not need to be secure can be placed in scripts/client. This typically applies to input bindings, GUI updates, local audio, etc

Code that needs to be secured should be placed in scripts/server. This is code that dramatically affects the system or game play, such as spawning objects, game connection messages, etc. You do not want a client to be able to mess with this during a multiplayer session.

Any scripts related to assets should be placed in art. These refer to materials, datablocks for characters, and so on.

Core is the trickiest. Core consists of base functions and objects that are overwritten by the scripts in the client and server directories. If you plan on creating extensions you will be using in multiple games, you might consider adding to core scripts, then overriding in server/client.

Hope that helps. I welcome anyone else to jump in here and point out any mistakes I made or things I left out =)
#2
01/25/2012 (7:03 pm)
I am still learning but your break down has helped and I trully appriciate the time and answers. I have been toying with the ideal of game making for a few years in my spare time but since coming over to Torque I have learned so much more and the help from the GG team and the comunity is very impressive. Great job, Thank you.
#3
01/25/2012 (7:21 pm)
In the Documentation look under Scripting > Advanced. You'll see Camera Modes, the RTS Prototype and the Adventure Prototype - they all describe how to do various interesting things with the camera.

Probably want to read them in the order presented, though - and to complete the Adventure Prototype I stated an assumption that you had already worked through the RTS Prototype (since most of the camera functions are already created there).

And it looks like some automatic class tags got stuck in the images in the Adventure Prototype article - you can probably still download and view the images separately.