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);