I'm basically going to rip this code from mapgen,
http://qexpo.quakedev.com/uploaded/32/mapgen.zip
If you need a placeholder sprite and sound to use with this code, that's where to look. Drop all of this into the bottom of misc.qc.
//PREACH start func_steam code
void() steamp2 = [1 , steamp3]{};
void() steamp3 = [2 , SUB_Remove]{self.nextthink = time + 0.7;};
void() func_steam_think =
{
local entity steamp;
local vector r;
steamp = spawn();
setmodel (steamp, "progs/steam.spr");
setorigin (steamp, self.origin);
r = '0 6 0' * (random() - 0.5);
makevectors(self.mangle + r);
steamp.movetype = MOVETYPE_NOCLIP;
steamp.velocity = v_forward * self.speed;
steamp.nextthink = time + 0.1;
steamp.think = steamp2;
steamp.avelocity = '20 20 0';
self.nextthink = time + self.wait;
}
void() func_steam
{
precache_sound ("ambience/steam.wav");
precache_model( "progs/steam.spr");
if(self.targetname)
self.use = func_steam_think;
else
{
self.think = func_steam_think;
self.nextthink = time + 1;//no need to start straight off
}
if(!self.speed)
self.speed = 90;
if(!self.wait)
self.wait = 0.15;
ambientsound (self.origin, "ambience/steam.wav", 0.8, ATTN_STATIC);
};
//PREACH end func_steam code
Then create a point entity func_steam. The fields to set are
mangle: sets the direction the steam fires
targetname: if set, must be triggered
wait: sets frequency of steampuffs, the default setting of 0.15 works well
speed: changes how fast the particles move. The default makes for a nice continuous stream of particles and a medium length.
Lines you might want to change:
void() steamp3 = [2 , SUB_Remove]{self.nextthink = time + 0.7;};
Change the 0.7 to change the lifetime of the sprite and so the length of the steam spray.
r = '0 6 0' * (random() - 0.5);
Controls how random the spray is, change the 6 to alter it.
The original mapgen code had a chunk of
.alpha stuff which made the steam fade out, but I've omitted that as it's not the kind of thing mappers usually go for. If you want it, just ask and I'll write that back in.