AI players with Teams Tutorial
by Chris Garrett (CG) · in Torque Game Engine · 03/08/2003 (2:41 pm) · 4 replies
I recently downloaded HEAD and did this tutorial:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2312
When I enter:
AIPlayer::spawnPlayer();
into the console I get this error message:
Missing team spawn points group MissionGroup/TeamDropPoints
I have gone thru the tutorial over and over and can't see where I should be adding the code to add a bot to team. I can join both teams with my player but not with a bot. Does anyone have some suggestions?
TIA,
CG
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2312
When I enter:
AIPlayer::spawnPlayer();
into the console I get this error message:
Missing team spawn points group MissionGroup/TeamDropPoints
I have gone thru the tutorial over and over and can't see where I should be adding the code to add a bot to team. I can join both teams with my player but not with a bot. Does anyone have some suggestions?
TIA,
CG
#2
03/08/2003 (2:50 pm)
Quickest method is to just rename /playerdroppoint to /teamdroppoint in your .mis file.
#3
03/08/2003 (2:55 pm)
Erik I thought the same thing but I didn't see before that his player can switch teams and spawn correctly, he just can't spawn the bot to the spawn point.
#4
EDIT:
Ok, I did a ton of trial by error, and I finally figured out a way to bypass the error and allow the AI to spawn where I want. I modified the pickSpawnPoint function like so...
I realized that the groupname is really a series of strings. So in the above modification, the AI will spawn in the LightTeamDropPoints spawn sphere.
Now all I have to do, is figure out a way to toggle between "Light" and "Dark" depending on the player that spawns the AI (rts game).
Thanks,
-Jeff
03/16/2003 (5:21 pm)
Chris did you find a solution to this problem? I am having the same trouble.EDIT:
Ok, I did a ton of trial by error, and I finally figured out a way to bypass the error and allow the AI to spawn where I want. I modified the pickSpawnPoint function like so...
function pickSpawnPoint(%client)
{
if (%client)
%groupName = "MissionGroup/" @ %client.team.name @ "TeamDropPoints";
else
%groupName = "MissionGroup/" @ "Light" @ "TeamDropPoints";
...I realized that the groupname is really a series of strings. So in the above modification, the AI will spawn in the LightTeamDropPoints spawn sphere.
Now all I have to do, is figure out a way to toggle between "Light" and "Dark" depending on the player that spawns the AI (rts game).
Thanks,
-Jeff
Torque 3D Owner Michael Cozzolino
Big Monk Games
I'm guessing in the function to spawn the bot you can assign the bot to a team. You could do it randomly or you could get the count of the team and add the bot to the lowest player count team.