blood

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
dailoc
Posts: 58
Joined: Sun May 06, 2012 4:42 pm
Contact:

blood

Post by dailoc » Sat Jun 16, 2012 5:15 am

anyone know how to make blood effect like this one. if you do, help me!
Attachments
images.jpeg
images.jpeg (7.42 KiB) Viewed 3011 times

dailoc
Posts: 58
Joined: Sun May 06, 2012 4:42 pm
Contact:

Re: blood

Post by dailoc » Sat Jul 21, 2012 2:40 am

anyone? i want to have the blood spill on the wall when the pawn is shot. Is it possible?

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: blood

Post by megatop » Sat Jul 21, 2012 3:07 am

yes it has to be a motion attatcvhed to the actor and some basic coding.

dailoc
Posts: 58
Joined: Sun May 06, 2012 4:42 pm
Contact:

Re: blood

Post by dailoc » Tue Jul 24, 2012 5:02 am

Can you be more specific? I meant what kind of coding do I need to do?

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: blood

Post by megatop » Tue Jul 24, 2012 2:06 pm

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
}]

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: blood

Post by QuestOfDreams » Tue Jul 24, 2012 4:20 pm

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)

dailoc
Posts: 58
Joined: Sun May 06, 2012 4:42 pm
Contact:

Re: blood

Post by dailoc » Wed Jul 25, 2012 10:28 am

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.

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: blood

Post by QuestOfDreams » Wed Jul 25, 2012 10:51 am

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);

dailoc
Posts: 58
Joined: Sun May 06, 2012 4:42 pm
Contact:

Re: blood

Post by dailoc » Thu Jul 26, 2012 2:21 am

thanks QoD, it works

Post Reply