Page 1 of 1

blood

Posted: Sat Jun 16, 2012 5:15 am
by dailoc
anyone know how to make blood effect like this one. if you do, help me!

Re: blood

Posted: Sat Jul 21, 2012 2:40 am
by dailoc
anyone? i want to have the blood spill on the wall when the pawn is shot. Is it possible?

Re: blood

Posted: Sat Jul 21, 2012 3:07 am
by megatop
yes it has to be a motion attatcvhed to the actor and some basic coding.

Re: blood

Posted: Tue Jul 24, 2012 5:02 am
by dailoc
Can you be more specific? I meant what kind of coding do I need to do?

Re: blood

Posted: Tue Jul 24, 2012 2:06 pm
by megatop
well you have to get the pawn actor and a blood effect into it useing milkshape or equity or any other program that allows you too. Then you have to make a new script for the actor useing the motions such as walk or die. after you do that make the blood code heres such as. the motion you have to have is should be called blood after you have that insert a code like this. it might not work though cause I didnt work hard on it.

blood[()
{
AnimateBlood("die",0,""); //Blood Animation
FadeOut(5,0); //Fade out actor
Remove(true); //remove pawn after death
}]

Re: blood

Posted: Tue Jul 24, 2012 4:20 pm
by QuestOfDreams
Seriously, how would you do this with an actor animation? To me this seems impracticable.

What you can do is to use a spray effect to simulate blood spouting out of the body.
For this you need a spray effect definition in the effect.ini file, an explosion definition in the explosion.ini file (using that effect) and the AddExplosion script method in the appropriate scipt order of your pawn.

in effect.ini add something like

Code: Select all

[BloodSpray]
type = spray
bitmapname = blood.bmp
alphamapname = a_blood.bmp
angles = 0 0 0
colormax = 0 255 0
colormaxalpha = 255
colormin = 0 255 0
colorminalpha = 255
sourcevariance = 8
destvariance = 32
gravity = 0 0 0
maxscale = 0.25
minscale = 0.15
maxspeed = 100
minspeed = 50
maxunitlife = 0.5
minunitlife = 0.25
particlecreationrate = 0.01
totallife = 0.5
bounce = false
in explosion.ini add

Code: Select all

[BloodSpray]
effect0 = BloodSpray
delay0 = 0
offset0 = 0 0 0
in the pawn script add to your Hit or Die order

Code: Select all

GB=GetLastBoneHit();
AddExplosion("BloodSpray", GB, 0, 0, 0); 

To get the blood stick on the wall is bit more tricky. The only way to get a bitmap onto a wall is by using decals and those on the other hand require a projectile to hit the wall.
Hence, what we have to do is add a DecalDefine entity to the level, a projectile definition to the weapon.ini file and the FireProjectile script method to the pawn's script.

DecalDefine like:

Code: Select all

Alpha         255
AlphaName     a_blooddecal.bmp
BmpName       blooddecal.bmp
Color         255 0 0
Height        32
Width         32
LifeTime      30
Type          0
a projectile definition like

Code: Select all

[blooddrop]
type = projectile
actor = proj.act
rotation = 0 0 0
scale = 1
gravity = false
bounce = false
speed = 300
lifetime = 1
boundingbox = 0.1
attachactor = false
bonelevel = false
damage = 0
altdamage = 0
explosionradius = 0
explosiondamage = 0
decal = 0
in the pawn script add to your Hit or Die order

Code: Select all

SetTargetPoint(2*self.current_X - self.player_X, 2*self.current_Y - self.player_Y, 2*self.current_Z - self.player_Z, false);
FireProjectile("blooddrop", GB, 0, 0, 0, "none", 0);
(You may have to play around with the arguments of SetTargetPoint)

Re: blood

Posted: Wed Jul 25, 2012 10:28 am
by dailoc

Code: Select all

        AddExplosion("Bullet_ActorExplosion", "Bip01", OFFSETX, OFFSETY, OFFSETZ, DAMAGEATTRIBUTE);
		SetHoldAtEnd(false);	
		SetTarget(self.current_X, self.current_Y, self.current_Z);
		FireProjectile(PROJECTILE1, "Bip01", 0, 0, 0, "none", 0);
		self.ThinkTime = 0.05;
		self.think = "monster_run_pain";
The blood projectile is fired upward! I want to see the blood decal appears underneath the pawn (on the floor) when it get wounded.

Re: blood

Posted: Wed Jul 25, 2012 10:51 am
by QuestOfDreams
When it comes to scripting, you have to be exact.

The AddExplosion method only takes 5 parameters.

You have to use the SetTargetPoint method not SetTarget.

SetTargetPoint(0, -200, 0);

or

SetTargetPoint(self.current_X, self.current_Y - 200, self.current_Z, false);

Re: blood

Posted: Thu Jul 26, 2012 2:21 am
by dailoc
thanks QoD, it works