|
3 registered members (AndrewAMD, kzhao, qin),
21,501
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: how attach a blood particles to the AI
[Re: Kaizen_31]
#252427
02/18/09 08:04
02/18/09 08:04
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
You have three different techniques to realise for this:
1. blood particles when hit (particles) 2. bloody texture at hitpoints (decals) 3. bloodstain when died (sprite or decal)
what you want to start with?
|
|
|
Re: how attach a blood particles to the AI
[Re: Kaizen_31]
#252435
02/18/09 09:05
02/18/09 09:05
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
Here is an example:
// eff_blood.c
BMAP* eff_bloodBmap = "blood.tga";
function eff_blood_spec_fun(PARTICLE* p) {
p.alpha -= 6 *time_step;
if(p.alpha < 0) { p.alpha = 0; p.lifespan = 0; }
}
function eff_bloodspezial(PARTICLE* p){
p.blue = 70;
p.green = 70;
p.red = 90;
p.bmap = eff_bloodBmap; //the effect bitmap
p.vel_x = random(2) - 1;
p.vel_y = random(2) - 1;
p.vel_z = random(4);
p.size = 3+random(2);
p.alpha = 30;
p.gravity=1+random(.5);
set(p, BRIGHT | MOVE | TRANSLUCENT);
p.event = eff_blood_spec_fun;
}
function eff_blood(var* p_pos, var p_cnt){
effect(eff_bloodspezial, p_cnt, p_pos[0], nullvector);
}
[edit]If you shoot at the enemy and he got hit you can use the target-vector to locate the position: eff_blood(target.x, 10);
Last edited by mercuryus; 02/18/09 09:07.
|
|
|
Re: how attach a blood particles to the AI
[Re: Kaizen_31]
#252437
02/18/09 09:30
02/18/09 09:30
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
2. use deacls (see handbook) and if you got lost - ask again. 3. place a blood sprite on the floor where the enemy falls to ground. Scale it smooth from 0.1 to 1 (or what you need). This way you fake the bleeding effect
|
|
|
Re: how attach a blood particles to the AI
[Re: Kaizen_31]
#252445
02/18/09 10:28
02/18/09 10:28
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
Press F1 within SED to open the handbook/help Then search for decal
You can place a sprite like this:
ent_create("blood.bmp", player.x, act_blood); but of cause you have to adjust the position (x,y,z) and/or the angle (pan,tilt,roll). Furtheron you have to script the scaling: scale_x, scale_y
Maybe you should start with the tutorials to get an idea of entites and their possibilities...
|
|
|
|