Hi ho, I am having problems getting a func_breakable ceated in game to collide. I
want to break it of course :} The model is visible, just can't figure out why it
is not colliding.
Every thing with // Test has been added as a test and has been enable or diabled
in every combination I could thnk of.
LINK_ENTITY_TO_CLASS(func_bomb_target, CSwarmCSDE);
// CSDE_MODEL "models/csdebomb.mdl"
// #define CSDE_MODEL "models/crystal.mdl"
#define CSDE_MODEL "models/player/agrunt/agrunt.mdl" // This should work as it
works for a player
extern Vector VecBModelOrigin( entvars_t* pevBModel );
void CSwarmCSDE::Spawn()
{
Precache();
SET_MODEL( ENT(pev), STRING(pev->model) ); // Need to do this to use
VecBModelOrigin
// Create a func_breakable to blow up.
CBreakable *breakable = GetClassPtr((CBreakable *)NULL);
breakable->pev->model = MAKE_STRING(CSDE_MODEL); // Used in SET_MODEL in
CBreakable::Spawn
breakable->pev->health = 500;
breakable->pev->target = MAKE_STRING("csdemission");
breakable->pev->spawnflags = 0; // Test
breakable->pev->effects = 0; // Test
breakable->scenarioID = 0;
// UTIL_SetSize(breakable->pev,Vector(-20,-20,-20),Vector(20,20,20));
UTIL_SetSize(breakable->pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX); // Test
Vector origint = VecBModelOrigin(pev); // Get origin of model
UTIL_SetOrigin(breakable->pev, origint);
breakable->Spawn();
// breakable->pev->solid = SOLID_BBOX; // Test
// breakable->pev->movetype = MOVETYPE_NONE; // Test
// UTIL_SetOrigin(breakable->pev, origint); // Test
DROP_TO_FLOOR(ENT(breakable->pev)); // Drop to ground.
// Create a swarm mission entity to award points etc
... <snip>
UTIL_Remove(this);
}
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders