Author Topic: AIPlayer commands not setting  (Read 1510 times)

I posted a datablock containing:
Code: [Select]
cmdCatagory = "AIPlayer";Now, I had problems with my bots using Player commands on the PlayerStandardArmor datablock. I took out the cmdCatagory and it seems to be working, but now commands set on my bot's datablock don't set anymore. I tried changing all the commands from AIPlayer based to BotPlayer (bot datablock) based, but it didn't work. Yes, the create-bot command uses:
Code: [Select]
new AIPlayer() {
datablock = BotPlayer;
};

If completely necessary, I will post part or all of the file

Edit: Here is the datablocks, 1 is just for the bot for regular walking, the other is if the person's velocity is over 10. 10 is the max a normal player can go by foot, so the bot will increase speed by changing to SpeedPlayer datablock when the player does such. The problem is if I add cmdCatagory = "AIPlayer"; then it won't have PlayerStandardArmor commands such as damage, but if it does have that, it can't have AIPlayer commands.

Code: [Select]
datablock PlayerData(BotPlayer : PlayerStandardArmor)
{
   minJetEnergy = 0;
   jetEnergyDrain = 0;
   canJet = 0;
};
datablock PlayerData(SpeedPlayer : BotPlayer)
{
   cmdCatagory = "BotPlayer";
   groundImpactMinSpeed = "3";
   horizMaxSpeed = "120";
   horizResistSpeed = "15";
   maxBackwardCrouchSpeed = "15";
   maxBackwardSpeed = "20";
   maxForwardCrouchSpeed = "15";
   maxForwardSpeed = "20";
   maxSideCrouchSpeed = "15";
   maxSideSpeed = "20";
   maxUnderwaterBackwardSpeed = "15";
   maxUnderwaterForwardSpeed = "20";
   maxUnderwaterSideSpeed = "15";
   minImpactSpeed = "5";
   upMaxSpeed = "125";
   upResistSpeed = "15";
   maxSideProneSpeed = "15";
   maxSideWalkSpeed = "20";
   maxForwardProneSpeed = "15";
   maxForwardWalkSpeed = "20";
   maxBackwardProneSpeed = "15";
   maxBackwardWalkSpeed = "20";
};
« Last Edit: May 18, 2007, 05:32:43 PM by -=>RR<=-MasterCE »

Code: [Select]
new AIPlayer() {
datablock = BotPlayer;
}
That would create a syntax error, you need a semicolon at the end.

I didn't exact copy the code, it has one.

Edit:
Code: [Select]
function AIPlayer::create(%this) {
%obj = new AIPlayer() {
dataBlock = BotPlayer;
};
return %obj;
}
« Last Edit: May 18, 2007, 02:31:06 PM by -=>RR<=-MasterCE »

Try a package and use Armor::[function] then at the top add
Code: [Select]
if(%obj.getClassname $= "AIPlayer")
 {
   //Special Code
 }
 Parent::[function]([functionargs]);

Here, I modifiede this to take out extra crap and added cmdCatagory = AIPlayer; to the new AIPlayer as a test, which isn't tested yet :P This is the whole file except for the stuff already said, don't go claiming it's yours