ADV. 3D Game Programming AIO Chapter 7
by Jacob Boura · in Torque Game Engine · 01/29/2010 (12:59 pm) · 0 replies
I know that there are ocassionaly issues with the code in this book, and I managed to get the first half of the chapter working fine, but the chasing isnt working.
I created the sim group in "MissionGroups/AIDropPoints/Chaser" and gave it the 4 dynamic fields, but then the book says to add
if(%theRole !$= "Guard")
{
%obj.setMoveSpeed($MAX_CHASER_SPEED);
%obj.setMoveDestination(%tgtPlayer.getPosition());
%obj.nextBlockCheck = %this.schedule($MAX_SCAN_GAP*2, "unBlock", %obj);
}
after each "setAimObject" in the checkForThreat function... but there isnt a single setAimObject in that function. There are, however, 3 in the DoScan function, and I put the code snippet in there and it still wont work. I couldnt even get the chasers to spawn till i wrote out a createChasers() function that mirrored the createbots(), though changing the code acordingly to make them "chasers" instead of "guards"...
Im sure im making this out to be much harder then it should be but i cant figure it out... anyone have a clue how to make this work fast?
I'm using starter.fps in 1.5.2
I created the sim group in "MissionGroups/AIDropPoints/Chaser" and gave it the 4 dynamic fields, but then the book says to add
if(%theRole !$= "Guard")
{
%obj.setMoveSpeed($MAX_CHASER_SPEED);
%obj.setMoveDestination(%tgtPlayer.getPosition());
%obj.nextBlockCheck = %this.schedule($MAX_SCAN_GAP*2, "unBlock", %obj);
}
after each "setAimObject" in the checkForThreat function... but there isnt a single setAimObject in that function. There are, however, 3 in the DoScan function, and I put the code snippet in there and it still wont work. I couldnt even get the chasers to spawn till i wrote out a createChasers() function that mirrored the createbots(), though changing the code acordingly to make them "chasers" instead of "guards"...
Im sure im making this out to be much harder then it should be but i cant figure it out... anyone have a clue how to make this work fast?
I'm using starter.fps in 1.5.2