djcev.com

//

Git Repos / fte_dogmode / qc / misc / particle_embers.qc

Last update to this file was on 2025-03-30 at 19:29.

Show particle_embers.qc

//==============================================================================
// particle_embers -- selections from MachineGames misc_fx.qc -- CEV
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
// particle_embers
void() particle_embers_think;
void(entity e) particle_embers_init;
void() particle_embers;
#endif

#ifdef SSQC
// particle_embers_tall
void(entity e) particle_embers_tall_init;
void() particle_embers_tall;
#endif

//------------------------------------------------------------------------------

#ifdef SSQC
//----------------------------------------------------------------------
// class particle_embers: base_mapentity
// {
//--------------------------------------------------------------
void() particle_embers_think =
{
local vector pos;
local vector speed;
speed = '0 0 2' * random() + '0 0 2';
speed_x = crandom() * self.velocity_x;
speed_y = crandom() * self.velocity_y;
speed_z = speed_z * self.velocity_z;
pos = self.origin;
pos_x = pos_x + self.size_x * crandom();
pos_y = pos_y + self.size_y * crandom();
// pos = crandom() * self.size + self.origin;
particle (pos, speed, 234, 2);
self.nextthink = time + self.wait + self.delay * random();
};

//--------------------------------------------------------------
void(entity e) particle_embers_init =
{
e.classname = "particle_embers";
e.classtype = CT_MISC_PARTICLE_EMBERS;
base_mapentity_init (e);

// size determines the box the particles can spawn within
if (!e.size)
e.size = '128 128 0';
// delay is random time added per loop
if (!e.delay)
e.delay = 0.1;
// wait is time always added per loop
if (!e.wait)
e.wait = 0.05;
// velocity is used as a scalar on speed
if (!e.velocity)
e.velocity = '1 1 1';

e.think = particle_embers_think;
e.nextthink = time + e.wait + e.delay * random();
};

//--------------------------------------------------------------
void() particle_embers =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

particle_embers_init (self);
};
// };
#endif

#ifdef SSQC
//----------------------------------------------------------------------
// class particle_embers_tall: base_mapentity
// {
//--------------------------------------------------------------
void(entity e) particle_embers_tall_init =
{
e.classname = "particle_embers_tall";
e.classtype = CT_MISC_PARTICLE_EMBERS_TALL;
base_mapentity_init (e);

if (!e.size)
e.size = '40 40 0';
if (!e.delay)
e.delay = 0.1;
if (!e.wait)
e.wait = 0.05;
if (!e.velocity)
// scalar for speed
e.velocity = '1 1 2';
e.think = particle_embers_think;
e.nextthink = time + e.wait + e.delay * random();
};

//--------------------------------------------------------------
void() particle_embers_tall =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

particle_embers_tall_init (self);
};
// };
#endif

Return to the top of this page or return to the overview of this repo.

Log particle_embers.qc

Date Commit Message Author + -
2025-03-30 Big commit. Entity networking, etc. cev +115  

Return to the top of this page or return to the overview of this repo.