make monster attack a entity

Discuss programming in the QuakeC language.
Post Reply
Jukki
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

make monster attack a entity

Post 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?
demnuh235
Posts: 17
Joined: Mon May 03, 2010 6:54 pm
Location: Russia

Post by demnuh235 »

How about having 4 entitys instead of 1? They would make you a hole, plus your barricade could be partially destroyed?
demnuh235
Posts: 17
Joined: Mon May 03, 2010 6:54 pm
Location: Russia

Post 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
lth
Posts: 144
Joined: Thu Nov 11, 2004 1:15 pm

Post 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).
Jukki
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Post 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.
necros
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Post 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;
Post Reply