Code problems
by Larry Dolyniuk · in Torque 3D Professional · 07/05/2010 (11:36 am) · 2 replies
Hello, I have created a function to spawn 50 AI to 50 spawnpoints in my "battlefield", unfortunately my noobish way of doing things has led to increased memory consumption (my client gets extremely laggy) and lack of my AI players :p, each spawnpoint is named either GS1 - GS50 or BS1 - BS50 giving two sides to a battlefield.
as you can see I even tried setting each indexed string to null after I finished using them, but that did nothing haha, any help would be wonderful, sorry if this is too noobish of a problem, thanks :).
function spawn()
{
for(%i = 1; %i <= 50; %i++)
{
%Gq = "G" @ %i;
%Bq = "B" @ %i;
%GSpawn = "GS" @ %i;
%BSpawn = "BS" @ %i;
AIPlayer::spawn(%Gq, %GSpawn);
AIPlayer::spawn(%Bq, %BSpawn);
%Gq = null;
%Bq = null;
}
}as you can see I even tried setting each indexed string to null after I finished using them, but that did nothing haha, any help would be wonderful, sorry if this is too noobish of a problem, thanks :).
About the author
#2
eg: echo("Name " @ %Gq @ " Spawnpoint " @ %GSpawn);
AIPlayer::spawn gives %name as the shapename rather than the object name ...
[edit] lol ... slowest typing ever ... glad you sorted it out
07/05/2010 (12:30 pm)
Try throwing in echoes and see what they say in console.eg: echo("Name " @ %Gq @ " Spawnpoint " @ %GSpawn);
AIPlayer::spawn gives %name as the shapename rather than the object name ...
[edit] lol ... slowest typing ever ... glad you sorted it out
Torque 3D Owner Larry Dolyniuk
http://www.garagegames.com/community/blogs/view/15961