PDA

View Full Version : Changing models


Jayz0r
07-21-2002, 04:18 AM
Just wondering if there is a clean way to change the model of an ent during the game?

When my item spawns, I use:

void SP_team_item(gentity_t *ent)
{
....
ent->s.modelindex = G_ModelIndex("/models/items/a_shield_converter.md3");
....
}

This works fine, the model precaches and shows up fine. However, when the item is destroyed, I try to change it -

void team_item_die(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod)
{
....
self->s.modelindex = G_ModelIndex( "/models/items/psd_big.md3" );
....
}

and it does nowt - ingame, it shows three lines (x y and z I guess) red green and blue. My guess is that its something to do with precaching, but maybe I'm just doing entirely the wrong thing.

Impress me :)

Cheers,
Jay