Basically I would like to include these effects from this article about Alien Teleport Effect (HL1) in the code of
monstermaker.cpp
.That is, I plan to include the following entities in one:
2 env_sprite's
2 ambient_generic's
1 light
1 env_beam
I'll show you what I've done so far. I have successfully included two sprites!
//=========================================================
// MakeMonster - this is the code that drops the monster
//=========================================================
void CMonsterMaker::MakeMonster( void )
{
// (...) original code
if (FBitSet(pev->spawnflags, SF_MONSTERMAKER_NEW_EFFECTS)) // NEW
{
// first sprite
CSprite *pSprite1 = CSprite::SpriteCreate( "sprites/fexplo1.spr", pev->origin, TRUE );
pSprite1->SetTransparency( kRenderTransAdd, 77, 210, 130, 255, kRenderFxNoDissipation ); // rendermode, rendercolor (r, g, b), renderamt, renderfx
pSprite1->SetScale( 1.0 );
pSprite1->pev->framerate = 10.0;
pSprite1->TurnOn(); // idk
pSprite1->AnimateAndDie( 10 );
// second sprite
CSprite *pSprite2 = CSprite::SpriteCreate( "sprites/xflare1.spr", pev->origin, TRUE );
pSprite2->SetTransparency( kRenderTransAdd, 184, 250, 214, 255, kRenderFxNoDissipation ); // rendermode, rendercolor (r, g, b), renderamt, renderfx
pSprite2->SetScale( 1.0 );
pSprite2->pev->framerate = 10.0;
pSprite2->TurnOn(); // idk
pSprite2->AnimateAndDie( 10 );
}
}
So far, what I did was set a condition: If the SF_MONSTERMAKER_NEW_EFFECTS flag is on, every time a monster spawns it will produce the effect I want to create.By the way, here is the flag's identification number:
// Monstermaker spawnflags
#define SF_MONSTERMAKER_START_ON 1 // start active ( if has targetname )
#define SF_MONSTERMAKER_CYCLIC 4 // drop one monster every time fired.
#define SF_MONSTERMAKER_MONSTERCLIP 8 // Children are blocked by monsterclip
#define SF_MONSTERMAKER_NEW_EFFECTS 16 // NEW
And the precached sprites:
void CMonsterMaker :: Precache( void )
{
CBaseMonster::Precache();
UTIL_PrecacheOther( STRING( m_iszMonsterClassname ) );
PRECACHE_MODEL("sprites/fexplo1.spr"); // NEW
PRECACHE_MODEL("sprites/xflare1.spr"); // NEW
}
But I don't know how to include an env_beam that has the following:Brightness: 150
Beam color: 197 243 169
Life: .5
Width: 1.8
Noise: 35
Sprite model: "sprites/lgtning.spr"
Strike again time: -.5
Random strike
End sparks
Please, can you help me?