Game Development Community

Trq bot pathfinding

by dArchitect · in Technical Issues · 11/08/2007 (8:34 am) · 6 replies

Has anyone run into this problem. I am using TGE 1.5.2. I am using the CodeSampler.com tutorials to learn TGE. I got the the trq_bot_pathfinding file and after setting everything up TGE would crash. I found the problem in the bot.cs file to be here:

datablock PlayerData( MyBot : PlayerShape )
{
// TO DO: Add extra stuff here to manage new A.I. functionality...
patrol = true;
attack = false;
};

I commented out, and deleted, everything between the brackets so that it looked like this:

datablock PlayerData( MyBot : PlayerShape )
{
};

Problem still occured. Based on other (datablock) code I examined this should not be happening.

#1
11/08/2007 (9:24 am)
I think it's an error to have an empty datablock like that.
#2
11/08/2007 (9:59 am)
I found out what the problem is so far.

datablock PlayerData( MyBot : PlayerShape )
{
// TO DO: Add extra stuff here to manage new A.I. functionality...
patrol = true;
attack = false;
};

should read:

datablock PlayerData( MyBot : PlayerBody )
{
// TO DO: Add extra stuff here to manage new A.I. functionality...
patrol = true;
attack = false;
};

according to what I found in the aiPlayer.cs file:

datablock PlayerData(DemoPlayer : PlayerBody)
{
shootingDelay = 2000;
};

When I changed it to PlayerBody Torque quit crashing. Now to finish the rest of those tutorials. I hope.
#3
12/23/2007 (2:17 am)
I changed the same thing as u did but my torque engine still crashes. Do you know why?
#4
12/28/2007 (2:52 am)
ShapeFile ="~/data/shapes/player/player.dts";
#5
12/28/2007 (6:26 am)
@Viren: you shouldn't need a shapefile field. When you use the (DemoPlayer : PlayerBody) syntax, basically you're telling Torque, "Make a new datablock called DemoPlayer, and use all the fields from PlayerBody that I don't define in the brackets below:". If the PlayerBody datablock already has a shapefile field, you shouldn't need to add that.

@rushh: Make sure there is a datablock called PlayerBody in server/scripts/player.cs. If that doesnt help, just post your ai player scripts here and I'll have a look.
#6
12/28/2007 (7:56 am)
Hi BrYcE...thanks i got it working..i started on a fresh file and it works....got no idea with the previous file...anyway got it working....