Page 1 of 1

make monster attack a entity

Posted: Sun Nov 21, 2010 7:52 am
by Jukki
Hey i have one entity in my map. Its kinda like monster without moving etc. It is solid bsp (cause i wana shoot trought it). and make it so monsters can hurt it. Problem is. They zombies do walk to them. But not attack. (they do attack if i set it solid_bbox) but then i cant shoot trought open parts of model.

any fix?

Posted: Tue Feb 22, 2011 7:39 pm
by demnuh235
How about having 4 entitys instead of 1? They would make you a hole, plus your barricade could be partially destroyed?

Posted: Tue Feb 22, 2011 7:42 pm
by demnuh235
Or u could make a little invisible entity and put it inside the barricade. Zombies' brains would touch the solid object, decreasing its health

Posted: Fri Feb 25, 2011 11:50 pm
by lth
What is your zombie AI code like? Vanilla Quake? Or have you modified it? Because monsters won't naturally attack anything apart from clients (unless the other thing attacked them first).

Posted: Sat Feb 26, 2011 5:45 am
by Jukki
Naah. Thx for help. But we allready did tis like 3 months ago XD

I finaly decided i create a second enity to back of the entity. when monster touches this trigger entity, they play a attack anim and entity takes damage. So they realy dont attack it.

Posted: Sun Feb 27, 2011 6:53 am
by necros
mmm, this was bumped but i'll go anyway:

the reason monsters can't attack a solid_bsp is because of the way the engine and qc work.

monsters use the target's .origin to determine if they can 'see' it, and also if they have a clear shot to hit it.

the problems happens because solid_bsp entities always start with an origin of '0 0 0', ie, the center of the map.

you would have to modify the zombie targetting code so that, if it detects self.enemy is a solid_bsp, to, instead of using .origin, use the middle point between .absmin and .absmax, by doing centerPoint = (self.enemy.absmin + self.enemy.absmax) * 0.5;