Spectator mode
by Ronald J Nelson · in Torque Game Engine · 01/01/2007 (2:49 am) · 5 replies
I have a couple of questions regarding this.
1. Is there already some way to allow the spectator to view through another player's camera while in specatator mode?
2. Is there already a way to disable chat between players? For instance in a deathmatch, you don't want the dead talking to the living.
1. Is there already some way to allow the spectator to view through another player's camera while in specatator mode?
2. Is there already a way to disable chat between players? For instance in a deathmatch, you don't want the dead talking to the living.
#2
[Edit: fixed syntax problem]
01/01/2007 (4:56 am)
Item #2, sounds like you could just disable the chat hud stuff until the player respawns. something.visible=false;
[Edit: fixed syntax problem]
#3
01/01/2007 (5:02 am)
For disabeling chat i would go with letting the server filter messages to dead and living players. There is already a method to exclude a client from a message (used in gameConnection::onConnect).
#4
As you've asked to disable chat in a specific gametype, it makes things a little more complicated. You'll need to hook the gametype scripting (if you use gametype scripting) into the message scripting to give it the go-ahead to push the message to the clients. If you dont use gametype scripting, you can simply do the checks in the functions below.
If you've not changed much from the default scripting, the two functions you want to use are chatMessageTeam() and chatMessageAll() found at the bottom of the script above. They are the functions used to send team and global messages by default.
The check you will probably want to do is:
01/01/2007 (5:34 am)
The message functions are in common/message.csAs you've asked to disable chat in a specific gametype, it makes things a little more complicated. You'll need to hook the gametype scripting (if you use gametype scripting) into the message scripting to give it the go-ahead to push the message to the clients. If you dont use gametype scripting, you can simply do the checks in the functions below.
If you've not changed much from the default scripting, the two functions you want to use are chatMessageTeam() and chatMessageAll() found at the bottom of the script above. They are the functions used to send team and global messages by default.
The check you will probably want to do is:
if(isObject(%sender.player) && %sender.player.getState() $= "Dead")
continue;That code would go in the for cycle, and will skip any dead players.
#5
01/01/2007 (4:44 pm)
Wow excellent responses. Thank you to all.
Torque Owner Paul /*ilys*/ Symeou
Default Studio Name