Game Development Community

Bots & Teams: How?

by Ryan Scott · in Torque Game Engine · 10/31/2003 (9:40 am) · 8 replies

I'm using a resource provided by Xavier Amado to implement teams, found here.

The resource implements teams in the game.cs file using functions such as GameConnection, etc.

I thought I would be able to query the player's team by using a %this.teamid, however when using an echo to test it, all I see is a blank line where I would have expected to see the team number.

In addition, what would be the best way to allow bots to choose a team? What about other objects, such as vehicles? Could I use this team implementation method to "join" and object to a team (so that only the team members could mount that object.)

If anyone is familiar with this resource enough to provide me some ideas...

Thanks bunches.

R

#1
10/31/2003 (10:32 am)
Where are you putting your echo statement? You may be trying to get teamid of something that has no teamid instead of player.
#2
10/31/2003 (11:12 am)
I put it in a few different spots... one of which was in function Armor::damage and function Armor::onDamage() -- I've tried a few places...
#3
10/31/2003 (11:16 am)
And now that I looked through it... maybe a Player:: function would be the better place...
#4
10/31/2003 (11:18 am)
Well, I just tried it in function Player::playDeathAnimation(%this) and still didn't get what I expected.
#5
10/31/2003 (1:06 pm)
I will look into this I have't dealt with this code in a while. I'll get back.
#6
10/31/2003 (1:21 pm)
Try this. You need to get the specific client.

echo("Team : " @ %this.client.team.teamId);
#7
10/31/2003 (8:19 pm)
Many thanks, that worked great Michael.
#8
12/04/2003 (4:50 am)
Just need to thank you for this post
I know I am late in reading this but I only got TG now.