Getting Started with TGEA...
by Shayne Uhr · in Torque Game Engine Advanced · 05/13/2007 (5:15 pm) · 5 replies
Hello. I am a long time FPS modder and would like to ask for some help in locating some entry points in to Torque. I can read script and code fine but there is a lot of it and it would help immensely to be pointed in the right general direction.
To start tinkering, I was wondering if someone could point me to the right scripting areas of starter.fps (or the codebase) to do the following things:
== Add a client side console command
== Add an integer value to the player on the server that is synch'd to the client (so I can use the client side console command to verify it)
I'm pretty sure this ISN'T supposed to go in the player datablock right? Because that data is supposed to be static?
== Add a network message that originates on the client that requests a service from the server
Hopefully that isn't too complex for a forum answer. The TDN entries on scripting are not very helpful to newbies :(
To start tinkering, I was wondering if someone could point me to the right scripting areas of starter.fps (or the codebase) to do the following things:
== Add a client side console command
== Add an integer value to the player on the server that is synch'd to the client (so I can use the client side console command to verify it)
I'm pretty sure this ISN'T supposed to go in the player datablock right? Because that data is supposed to be static?
== Add a network message that originates on the client that requests a service from the server
Hopefully that isn't too complex for a forum answer. The TDN entries on scripting are not very helpful to newbies :(
About the author
#2
-default bind lists several functions called with keypresses. _any_ function defined is callable via the console when it's in the client/server mode, whle the client only mode only uses the client directory, iirc.
== Add an integer value to the player on the server that is synch'd to the client (so I can use the client side console command to verify it)
-server/game.cs anything tied to a gameconnection entry is ghosted, fars I can tell so far
== Add a network message that originates on the client that requests a service from the server
-server/game.cs look for commandtoserver and commandtoclient funcs
05/13/2007 (6:07 pm)
== Add a client side console command-default bind lists several functions called with keypresses. _any_ function defined is callable via the console when it's in the client/server mode, whle the client only mode only uses the client directory, iirc.
== Add an integer value to the player on the server that is synch'd to the client (so I can use the client side console command to verify it)
-server/game.cs anything tied to a gameconnection entry is ghosted, fars I can tell so far
== Add a network message that originates on the client that requests a service from the server
-server/game.cs look for commandtoserver and commandtoclient funcs
#3
I see examples like:
commandToServer('SADSetPassword', %password);
But I cannot find anywhere (code or script) where SADSetPassword is handled... is it just not implemented? If not, can you shed some light on where commandToServer and commandToClient are caught and dealt with?
05/14/2007 (10:17 am)
Thanks Kirk, got the client side console commands going... I see examples like:
commandToServer('SADSetPassword', %password);
But I cannot find anywhere (code or script) where SADSetPassword is handled... is it just not implemented? If not, can you shed some light on where commandToServer and commandToClient are caught and dealt with?
#4
05/14/2007 (10:32 am)
- server/scripts/commands.cs has some server functions. I'm not sure if they have to be in this file, but thats where I put all mine. I dont know where that function is but it should look something like:function serverCmdSADSetPassword(%password)
{
...
}
#5
Another question for the knowledgable ones:
== Where is the player movement system (ie physics) I'd like to change the way players move. Rather than "press the forward button to run" I'd like to have a throttle system. To start, I'd like to be able to set a percentage of max speed (preferably in script but code if necessary) and have the player move forward at that speed until changed without having to continue pressing the forward button. If it is possible to do in script, my test console commands are fine. If this is a code level change, I could use a pointer on how to get stuff exposed to script.
It seems like I need to go to code because player movement speeds appear to be set in the player datablock (which is static right?)
05/19/2007 (10:27 am)
Worked great... thanks! Another question for the knowledgable ones:
== Where is the player movement system (ie physics) I'd like to change the way players move. Rather than "press the forward button to run" I'd like to have a throttle system. To start, I'd like to be able to set a percentage of max speed (preferably in script but code if necessary) and have the player move forward at that speed until changed without having to continue pressing the forward button. If it is possible to do in script, my test console commands are fine. If this is a code level change, I could use a pointer on how to get stuff exposed to script.
It seems like I need to go to code because player movement speeds appear to be set in the player datablock (which is static right?)
Torque Owner Shayne Uhr