Author Topic: Ai_Soldier (need help adding the armyhat)  (Read 1409 times)

How would i add the armyhats to my ai soldier?
heres the script so far.

datablock PlayerData(SoldierZombie : PlayerStandardArmor)
{
   //category = "Vehicles";
   minJetEnergy = 0;
   jetEnergyDrain = 0;
   canJet = 0;
   maxItems   = 0;   //total number of bricks you can carry
   maxWeapons = 1;      //this will be controlled by mini-game code
   maxTools = 0;
   runforce = 100 * 90;
   maxForwardSpeed = 8;
   maxBackwardSpeed = 8;
   maxSideSpeed = 8;
   attackpower = 6;
   //jumpsound = "ZombieJumpSound";
   cameradefaultFOV = 90;
   cameraMaxFov = 120;
   cameraMinFov = 10;
   //minlookangle = -1;
   //maxlookangle = -1;
   minlookangle = -1.5708;
   maxlookangle = 1.5708;
   BrickDestroyMaxVolume = 250;
   BrickMaxJumpHeight = 20;
   uiName = "Soldier";
   rideable = true;
   canRide = true;
   BrickKillRadius = 2;
   skinColor = "1 0.79 0.57 1";
   FollowAnim = "ArmReadyright";
   randomwalk = 1;
   aimatplayer = 1;
   SpecialAttack = 1;
   NoBloodyHands = 1;
   DoNotZombify = 1;
   chance = 90;
};
function SoldierZombie::SpecialAttack(%this,%onshot)
{
   %ran = getrandom(-1,1);
   %this.setmovex(%ran);
   schedule(0,0,ArcherShootMode,%this);
   schedule(500,0,ArcherShootMode,%this);
   schedule(1000,0,ArcherShootMode,%this);
   schedule(1500,0,ArcherShootMode,%this);
   %this.schedule(2000,clearmovex);
}
function SoldierShootMode(%this)
{
   if(%this.getstate() !$= "Dead")
   {
      %this.setimagetrigger(0,1);
      %this.setimagetrigger(0,0);
   }
}
function SoldierZombie::ondisabled(%this,%obj)
{
   parent::ondisabled(%this,%obj);
   ZombieDefault::ondisabled(%this,%obj);
}
function SoldierZombie::onCollision(%this, %obj, %col, %fade, %pos, %norm)
{
   parent::oncollision(%this, %obj, %col, %fade, %pos, %norm);
   ZombieDefault::onCollision(%this, %obj, %col, %fade, %pos, %norm);
}
function SoldierZombie::onMount(%a,%player,%vehicle,%d,%e,%f)
{
   ZombieDefault::onMount(%a,%player,%vehicle,%d,%e,%f);
   parent::onMount(%a,%player,%vehicle,%d,%e,%f);
}
function SoldierZombie::onUnMount(%a,%player,%vehicle,%d,%e,%f)
{
   ZombieDefault::onUnMount(%a,%player,%vehicle,%d,%e,%f);
   parent::onUnMount(%a,%player,%vehicle,%d,%e,%f);
}
function SoldierZombie::onAdd(%this,%obj)
{
   parent::onAdd(%this,%obj);
   ZombieDefault::onAdd(%this,%obj);
   //schedule(10,0,Archerfy,%obj);
   schedule(15,0,Archerfy,%obj);
   //schedule(20,0,ghostifybot,%obj);
   //%obj.playthread(2,armreadyright);
   //%obj.setarmthread(crouch);
   %obj.mountimage(m4image,0);
}

function Archerfy(%obj)
{datablock ShapeBaseImageData(AHGImage)
{
   shapeFile = "./AH.dts";
   emap = true;
   mountPoint = $HeadSlot;
   offset = "0 0 0.1";
   eyeOffset = "0 0 0.4";
   rotation = eulerToMatrix("0 0 0");
   scale = "1 1 1";
   doColorShift = true;
   colorShiftColor = "0.000 0.500 0.250 1.000";
};
   %obj.name = "Soldier";
   %obj.chestcolor = "0.0  0.100 0.0 1";
   %obj.rarmcolor = "0.0  0.100 0.0 1";
   %obj.larmcolor = "0.0  0.100 0.0 1";
   %obj.hipcolor = "0.2 1.5 0.0 1";
   %obj.llegcolor = "0.2 1.5 0.0 1";
   %obj.rlegcolor = "0.2 1.5 0.0 1";

   %obj.chest = "0";
   %obj.lhand = "0";
   %obj.rhand = "0";
   %obj.larm = "0";
   %obj.rarm = "0";
   %obj.hat = "Hat";
   %obj.accent = "0";
   %obj.pack = "0";
   %obj.secondpack = "0";
   %obj.lleg = "0";
   %obj.rleg = "0";
   %obj.hip = "0";

   GameConnection::ApplyBodyParts(%obj);
   GameConnection::ApplyBodyColors(%obj);
   %obj.setfacename(smileyblonde);
   %obj.setdecalname("Medieval-Tunic");
   %color = %obj.getdatablock().skincolor;
   %obj.setNodecolor($rhand[0], %color);
   %obj.setNodecolor($lhand[0], %color);
   %obj.setNodecolor("headskin", %color);
   //servercmdupdatebodyparts(%obj,6);
}
package ArcherAttackPackage
{
function ProjectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   if(isobject(%obj.sourceobject) && %obj.sourceobject.getdatablock().getname() $= "SoldierZombie")
   {
      //schedule(0,0,PropaneTankDamageF,%this,%obj,%col);
      %source = %obj.sourceobject;

      //echo(%source.getclassname());
      //echo(IsInMiniGame(%source));
      //echo(IsInSameMinigame(%col,%source));
      if(isobject(%obj.sourceobject) && %obj.sourceobject.getclassname() $= "AiPlayer" && IsInMinigame(%obj.sourceobject) && IsInSameMinigame(%col,%source))
      {
         if(%col.client != 0)
         {
            %source.cols = %col.client;
         }
         %col.damage(%obj,0,%obj.getdatablock().directDamage/2,$DamageType::zombiebite);
      }
   }
   parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
activatepackage(ArcherAttackPackage);

« Last Edit: September 12, 2009, 07:55:19 PM by Ninjaboy »

Code: [Select]
%obj.mountimage(AHGimage,5);I think
Code: [Select]
{datablock ShapeBaseImageData(AHGImage)Fail. Remove the { at the begining.

Also,
Code: [Select]
package ArcherAttackPackageDon't release it unless you make sure you fix it all first.

Code: [Select]
%obj.mountimage(AHGimage,5);I think
Code: [Select]
{datablock ShapeBaseImageData(AHGImage)Fail. Remove the { at the begining.

Also,
Code: [Select]
package ArcherAttackPackageDon't release it unless you make sure you fix it all first.

So could you show me what part of the army hat to add and where so it will show up on my ai in the game? besides flaming me for doing something wrong?

//Hat_ArmyHatW

datablock ShapeBaseImageData(AHWImage)
{
   shapeFile = "./AH.dts";
   emap = true;
   mountPoint = $HeadSlot;
   offset = "0 0 0.1";
   eyeOffset = "0 0 0.4";
   rotation = eulerToMatrix("0 0 0");
   scale = "1 1 1";
   doColorShift = true;
   colorShiftColor = "1.000 1.000 1.000 1.000";
};

function serverCmdAHW(%client)
{
   %player = %client.player;

   if(isObject(%player))
   {
      if(%player.getMountedImage(2) $= nametoID(AHWImage))
      {
         %player.unmountImage(2);
         %client.applyBodyParts();
         %client.applyBodyColors();
      }
      else
      {
         %player.unmountImage(2);
         %player.mountImage(AHWImage,2);

         for(%i = 0;$hat[%i] !$= "";%i++)
         {
            %player.hideNode($hat[%i]);
            %player.hideNode($accent[%i]);
         }
      }
   }
}
 
« Last Edit: September 12, 2009, 08:06:30 PM by Ninjaboy »

what weapon(s) will it use?

what weapon(s) will it use?

This section is for help on add ons. I need help not questions.

Code: [Select]
%obj.mountimage(AHGimage,5);

Where do i add the code? %obj.hat = "Here?";
« Last Edit: September 12, 2009, 08:13:32 PM by Ninjaboy »


hello?
Mabey I made my own Ai crap but I dnt use and mounting crap :/

Dang I'm making something like this!  Only with no special hat. :\ 

Bushido has already made this :C

Bushido has already made this :C

Yes but he won't release it dummy.

hello?
This isn't MSN, this isn't a chat system, its a forum. You must wait at least 24 hours before bumping/asking for help again seeing as people aren't on 24 hours ready to answer all of your questions.

This isn't MSN, this isn't a chat system, its a forum. You must wait at least 24 hours before bumping/asking for help again seeing as people aren't on 24 hours ready to answer all of your questions.

But there are so many people on that most likely someone new will anwser a question.

Yes but he won't release it dummy.

that's not entirely true



also, teaser image!

What is the pistol they're holding?