Anyways, do you have a lil script you could share for the large amount of zombies?
Sure, here you go.
Code: [Select]
float TotalZombies = 10;
Vector3[] ZombieLoc(TotalZombies);
Quaternion[] OldRot(TotalZombies);
void Main()
{
if (iInitializing())
{
Vector3 q;
for (int i=0; i<TotalZombies; i++)
{
iObjectScan(OBJ_0,Vector3(iFloatRand(-20,20),20,iFloatRand(-20,20)),Vector3(0,-20,0),0.00001,ZombieLoc[i],q);
}
OUT_44 = iFloatRand(0,2);
OUT_66 = iFloatRand(0,2);
OUT_88 = iFloatRand(0,2);
OUT_110 = iFloatRand(0,2);
OUT_132 = iFloatRand(0,2);
OUT_154 = iFloatRand(0,2);
OUT_176 = iFloatRand(0,2);
OUT_198 = iFloatRand(0,2);
OUT_220 = iFloatRand(0,2);
OUT_242 = iFloatRand(0,2);
}
Vector3 PlayerLoc;
iObjectLocation(OBJ_22,PlayerLoc);
PlayerLoc.y -= 1.8;
float[] Distance(TotalZombies), Speed(TotalZombies);
Quaternion[] LookRot(TotalZombies);
Vector3[] MoveLoc(TotalZombies), NewZombieLoc(TotalZombies);
Vector3[] GroundLevelLoc(TotalZombies);
Vector3 q;
for (int i=0; i<TotalZombies; i++)
{
///Get Distance & Speed
Distance[i] = iVectorLength(PlayerLoc-ZombieLoc[i]);
Speed[i] = -1/(80*(Distance[i]-2.0))+0.05;
if (Speed[i] < 0 || Speed[i] > 0.05) Speed[i] = 0;
///Get Rotation & Movement
iQuaternionLookAt(LookRot[i],(Vector3(PlayerLoc.x,0,PlayerLoc.z)-Vector3(ZombieLoc[i].x,0,ZombieLoc[i].z)),Vector3(0,1,0));
iVectorRotate(MoveLoc[i],Vector3(0,0,Speed[i]),LookRot[i]);
NewZombieLoc[i] = ZombieLoc[i]+MoveLoc[i];
OldRot[i] = LookRot[i];
///Get Ground Level
iObjectScan(OBJ_0,Vector3(NewZombieLoc[i].x,20,NewZombieLoc[i].z),Vector3(0,-20,0),0.00001,GroundLevelLoc[i],q);
ZombieLoc[i] = GroundLevelLoc[i];
}
///Set Location
iObjectLocationSet(OBJ_44,GroundLevelLoc[0]);
iObjectLocationSet(OBJ_66,GroundLevelLoc[1]);
iObjectLocationSet(OBJ_88,GroundLevelLoc[2]);
iObjectLocationSet(OBJ_110,GroundLevelLoc[3]);
iObjectLocationSet(OBJ_132,GroundLevelLoc[4]);
iObjectLocationSet(OBJ_154,GroundLevelLoc[5]);
iObjectLocationSet(OBJ_176,GroundLevelLoc[6]);
iObjectLocationSet(OBJ_198,GroundLevelLoc[7]);
iObjectLocationSet(OBJ_220,GroundLevelLoc[8]);
iObjectLocationSet(OBJ_242,GroundLevelLoc[9]);
///Set Rotation
iObjectOrientationSet(OBJ_44,LookRot[0]);
iObjectOrientationSet(OBJ_66,LookRot[1]);
iObjectOrientationSet(OBJ_88,LookRot[2]);
iObjectOrientationSet(OBJ_110,LookRot[3]);
iObjectOrientationSet(OBJ_132,LookRot[4]);
iObjectOrientationSet(OBJ_154,LookRot[5]);
iObjectOrientationSet(OBJ_176,LookRot[6]);
iObjectOrientationSet(OBJ_198,LookRot[7]);
iObjectOrientationSet(OBJ_220,LookRot[8]);
iObjectOrientationSet(OBJ_242,LookRot[9]);
OUT_264 = iFrameRate(true);
///OBJ_0 = Terrain
///OBJ_22 = Player
///OBJ_44 - 242 = Zombie SkinMeshes
///OBJ_264 = Valueprint
}