Bravetree Tank Pack - AI?
by John Carroll · in Torque Game Engine · 10/12/2006 (2:48 pm) · 4 replies
Is there an easy way to give these tanks some AI? I was ok doing this with the HMV but can't see how to do this with the tank pack.
--John
--John
About the author
Working on using Torque as an Image Generator for Tactical Simulations under laser and live fire conditions, for Law Enforcement/Military applications.
#2
%tank = new AIWheeledVehicle() {
position = "21.1043 519.053 72.5689";
rotation = "0 0 1 180";
scale = "1 1 1";
dataBlock = "AbramsTank";
invTankPrimaryWeapon = "1";
invTankSecondaryWeaponAmmo = "1000";
invTankPrimaryWeaponAmmo = "10";
mountable = "1";
invTankSecondaryWeapon = "1";
};
%tank.setMoveDestination("-191.377 465.26 124.274");
%tank.setMoveSpeed(1.0);
Thanks,
--John
10/12/2006 (3:15 pm)
I tried this, and it didn't work. I may have done it wrong, but when I did it, I had no visible tank at all. Here are the lines of code I used:%tank = new AIWheeledVehicle() {
position = "21.1043 519.053 72.5689";
rotation = "0 0 1 180";
scale = "1 1 1";
dataBlock = "AbramsTank";
invTankPrimaryWeapon = "1";
invTankSecondaryWeaponAmmo = "1000";
invTankPrimaryWeaponAmmo = "10";
mountable = "1";
invTankSecondaryWeapon = "1";
};
%tank.setMoveDestination("-191.377 465.26 124.274");
%tank.setMoveSpeed(1.0);
Thanks,
--John
#3
I copied AIWheeledVechicle.{h,cpp} to AITankShape.{h,cpp} and modified the AITankShape code to use the methods in TankShape. The TankShape code also had to be slightly modifed to give the AI control of tank/turret movement. All of this was done by looking through WheeledVechicle and AIWheeledVechicle and noting the similarities to TankShape.
I'll request GG to create a Tank Pack owners only section in the forums or TDN. There I'll post all of my modfied tank pack code (emitters, tread marks, and AI.)
10/12/2006 (3:58 pm)
Ok, you got me, it's not that easy ;)I copied AIWheeledVechicle.{h,cpp} to AITankShape.{h,cpp} and modified the AITankShape code to use the methods in TankShape. The TankShape code also had to be slightly modifed to give the AI control of tank/turret movement. All of this was done by looking through WheeledVechicle and AIWheeledVechicle and noting the similarities to TankShape.
I'll request GG to create a Tank Pack owners only section in the forums or TDN. There I'll post all of my modfied tank pack code (emitters, tread marks, and AI.)
Torque Owner Jerry Shaw
Roaming Gamer LLC