I want to spawn monsters at random points on a circle on the x/y plane around an entity. They can't spawn too close to the origin of the entity, otherwise they'll telefrag it. So I was thinking something like:
Code: Select all
newent.origin_x = ent.origin_x + (sin(angle) * minDistFromEnt);
newent.origin_y = ent.origin_y + (cos(angle) * minDistFromEnt);
I guess it doesn't even really need to be a circle, just far enough outside the entity's hitbox that the new entity doesn't cause problems.