// -------------------------------------------------------------------------------------------------------------------------
#define spawn_blood_particle skill96 // 1 = spawn particles ( like below ) / ents whatever...
#define id skill95 // 4ex: my.id = id_cat; ... my.id = id_healthpack; ... my.id = id_explosion;
#define id_explosion 1001 // identification - markers. "#define id_2ndmarker 1002" ... and so on
// -------------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------
action AnyExplodingEnt_WED(){ // entity that performs the c_scan, the explosion, the gas - barrel 4ex ^^
my.id = id_explosion; // identification of this entity, in this case, its marked as explosion
while (my){ // main - while of "explosion - creating entity"
.
..
...
// ---=[ !!! CAREFULL, BAD IDEA: PERFORMING C_SCAN EVERY FRAME : SLOW = S*** ^^ !!! ]=--------------------------------
if (c_scan (...)){ // c_scan's result > 0 means: we've found something
draw_point3d (target.x, vector (50, 50, 255), 100, 3); // draw red dot ( one frame only )
if (you){ // scan detected valid entity? then you = detected ent!
you.health = 0; // 4ex: kill the scanned entity, whatever u want 2 do
//effect (blood_effect, 10, you.x, nullvector); // <- normally, good place 2 spawn particles here, btw
}
}
...
..
.
wait (1);
}
wait (1);
ptr_remove (me);
}
// -------------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------
void blood_effect (PARTICLE *p) { ... } // your particle effect startup function
// -------------------------------------------------------------------------------------------------------------------------
void _myevent_scan(){ // example event that spawns particles when triggered
if (event_type == EVENT_SCAN) if (you) if (you.id == id_explosion) // only react 2 scans from explosion-ents (+id-check)
my.spawn_blood_particle = 1; // as u can see, we spawn parts outside the event :O
}
// -------------------------------------------------------------------------------------------------------------------------
action Way2CreateParts_WED(){ // dont exceed ( +- [not sure atm] ) 19 chars! yes, this sucks ... confirmed.
set (my, POLYGON); // use polygonal hull ( why not? )
my.emask |= ENABLE_SCAN; // react on c_scan - requests
my.event = _myevent_scan; // force this event / void 2 run, triggered by any performed c_scan in range
while (my){ // the main - while of the "cow, monster, hero ... whatever" - example
.
..
...
if (my.spawn_blood_particle){ // set to 1 in the event, thats the magic trick
my.spawn_blood_particle = 0; // without this our entity wouldnt stop 2 blood ^^
VECTOR _temp; // local temp vector holding effect's direction
vec_set (_temp, vector (normal.x, 0, 0)); // part's direction correction, optional of course
effect (blood_effect, 10 + random (10), my.x, _temp); // finally, let blood spray / spawn the particles
}
...
..
.
wait (1);
}
wait (1);
ptr_remove (me);
}
// -------------------------------------------------------------------------------------------------------------------------