well the problem was when i ran a cycle trough the towers
this cycle is for to check if the tower is locked on a target then shooting at it. that was fine
but when the tower had 0 lock (which mean no lock) it searches the creeps for a new lock on target and sometimes it locked on a dead creep which means aiming the bullets at an ID that is not alive
and i think that that caused GDK to crush..
cause you first GetDistance from two id (tower,creep)
second you aim the bullet dbPointObject(bulletId,creepX,creepY,creepZ)
if the creep is dead you just point and get distance from invalid ID..
i ran it a couple of times with mass towers and it worked flawlessly
also i noticed using automatic Id assigment that it passes the 65535 limit which is not good with SparkyCollision so i reEdit the bullet it assigments to GetFreeObject function i created using a simple
int GetFreeObject(void)
{
int t = 1;
while (dbIsObject(t) == 1)
{
t++;
}
return t;
}
the game sometimes run on 35 fps cause of alot of towers shooting alot of bullets but atleast it is stable.
i also reedited the tower lock so it will lock on closest creep rather then the first creep in tower's range.
so for now it is stable , i will run it even once more see if i can upgrade the FPS ...
ty all for participating.