The only things left to do now are writing additional documentation and fixing a few issues here and there. Almost there!

Created 17 years ago2007-12-16 00:58:58 UTC by
doodle
.prt
files due to the way VHLT generates them. Seedee's tools basically fix that AFAIK. (so do my tools, but I won't mention those any time soon void func_breakable_pain( gentity_t* self, gentity_t* attacker, int damage )
{
if ( self->health - damage <= 0 )
{
// Gib me
GibEntity( self, 0 );
// Remove entity from world
G_FreeEntity( self );
}
}
void func_breakable_use( gentity_t* self, gentity_t* other, gentity_t* activator )
{
// Damage itself when triggered
func_breakable_pain( self, activator, self->health );
}
void SP_func_breakable( gentity_t* self )
{
G_SpawnInt( "health", "50", &self->health );
G_SpawnString( "model", 0, &self->model );
trap_SetBrushModel( self, self->model );
// Link entity into world
trap_LinkEntity( self );
self->takedamage = 1;
self->pain = func_breakable_pain;
self->use = func_breakable_use;
}
I'm not satisfied with that though. To get what satisfies me, it'd take much more work to modify the existing system, than to make a new one from scratch. So the latter is exactly what I'm doing.class FuncBreakable : public BaseQuakeEntity
{
public:
void Spawn() override
{
health = spawnArgs->GetInt( "health", 50 );
takeDamage = DamageTypes::All;
}
void Use( IEntity* activator, IEntity* caller, UseType useType, float value ) override
{
Pain( activator, health );
}
void Pain( IEntity* attacker, int damage ) override
{
if ( health - damage <= 0 )
{
SpawnGibs( GetOrigin(), 20, "models/somegibs.md3" );
MarkForRemoval(); // next tick, this entity is gone
}
}
const int GetEntityFlags() override
{
return EntityFlags::SolidBrushEntity | EntityFlags::Static; // will automatically set up a brush model, movement type and solidity
}
private:
int health{ 0 };
}
This is just there to get you the basic idea. There's a ton of other stuff I've had in mind for this project.Admer456 said:WILL I GET YOU INTO A PLAYABLE STATE THIS YEAR?!
ets_mostar
BTW. The ets prefix doesn't stand for a gamemode (Electro-Technical School), but someone ought to make another ets map in the future lol