Game Development Community

Setting the control object

by Martin Banks · in Torque 3D Professional · 08/18/2009 (3:50 pm) · 6 replies

Where in the full demo project directories can I find the setControlObject calls?

#1
08/18/2009 (4:11 pm)
My friend 'Find in Files' told me that there where 20 occurrences of "setControlObject" in the Full Template scripts, 23 occurrences in the FPS Kit, and 32 occurrences in the source. Quite frankly, I'm too lazy to list their locations, but any adequate text editor should find them for you in only a few seconds.
#2
08/18/2009 (4:13 pm)
The most obvious places to look would be the code sections where a player is spawned, given control of a camera, and mounting/dismounting of vehicles.
#3
08/18/2009 (4:35 pm)
Thanks Michael,

I also was able to utilize a find in files, but being unfamiliar with the calling sequence of these scripts, I was left a little overwhelmed. I was hoping to find direction as to the most appropriate place to call setControlObject possibly from those more aquainted with this particular project structure, or more familiar with the convention for calling this function, if one exists.
#4
08/18/2009 (4:41 pm)
It is set in spawn.cs on the serverside scripts.
#5
08/18/2009 (4:57 pm)
The initial setControlObject will be called from "core/scripts/server/spawn.cs" in function GameConnection::spawnPlayer().

Anything after that is simply transferring the control from a dead player to orbit-cam "corpse mode (GameConnection::onDeath()) to a newly spawned player, transferring to a camera mode, or giving the player control of a vehicle (PlayerData::onMount() and PlayerData::onUnmount() to give control back to the player).
#6
08/18/2009 (6:55 pm)
I'm looking to set this is the world editor in order to test out animations etc, as I edit my character.

Is there a way to reassign this designation on the fly in the object editor? Possibly calling in the console?