BLOOD?

Topics relating to Modeling with Reality Factory.
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

BLOOD?

Post by metal_head »

Hello I don't know if this is the right place to ask the question,but couldn't think of better place.
Anyway my question is how can I make when I hit an enemy blood starts comming out of him like in this video of a game made with FPS creator http://www.youtube.com/watch?v=DYSgemeW ... re=related
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: BLOOD?

Post by darksmaster923 »

thats easy, ive done it before. first you need to create blood pictures, then add then as effects in effect.ini. then create an explosion in explosion.ini with the blood pics and in the enemy script add an explosion with it
Herp derp.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

thanks but......the problem is that I don't really know how to do it :oops: sorry about this,but can you help me a little with the effect.ini
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: BLOOD?

Post by darksmaster923 »

its in the manual, predefined effects.
Predefined Effects



Since many effects are used by explosions or attached to projectiles, it is useful to predefine them outside the level and save having to add many entities to each new level. To achieve this we have an effect.ini file that contains the definition of any effects you wish to use. The format of this file is as follows:

Each effect definition is headed by the name of the effect, enclosed in square brackets, such as [YellowLight] or [RedSpray]. This name will be used by other entities to reference this effect. Following the name, up to the next effect name or end of the file, is the information needed to define the effect. The important line here is the one starting with type = . This defines what type of effect we are working with. The different types of effects we can define are:

light - dynamic light

spray - particle spray similar to a Spout

actorspray - actor spray similar to an ActorSpout

sound - 3d sound

sprite - animated sprite similar to a FlipBook

corona

bolt - electric bolt similar to the ElectricBolt

It is important to use the exact spelling and case of each effect type. Each different effect requires different information to be defined and we will look at these individually.
Light

This is defined by type = light. This effect has 6 variables that must have data assigned to them. They are:

totallife - the number of seconds this effect will be active

intensity - the brightness of the light, with a range greater than 0 and less than or equal to 1

colormax - the maximum color the light can take

colormin - the minimum color the light can take

radiusmax - the maximum radius of the light coverage

radiusmin - the minimum radius of the light coverage

The colormax and colormin entries are RGB colors and have 3 values, separated by spaces. The color of the light will be randomly chosen each frame from a value between these colors. The closer these colors are to each other, the less variation in color will occur. The radius of the light coverage will be chosen randomly each frame from a value between radiusmax and radiusmin. The closer these values are to each other, the less flicker will be shown.
Spray

This is defined by type = spray. This effect is very similar to the Spout entity and requires most of the same information to be defined. The variables that require data are:

bitmapname - the name of the bitmap file used to texture each particle

alphamapname - the name of the alphamap file used to assign transparency to each particle

angles - the angle, in degrees for X, Y and Z, that the particles will travel away from their starting point

colormax - the maximum color the particles can take

colormaxalpha - the transparency amount for the maximum color. Range of 0 to 255 (solid).

colormin - the minimum color the particles can take

colorminalpha - the transparency amount for the minimum color. Range of 0 to 255 (solid).

sourcevariance - the maximum distance that the particle start point can vary

destvariance - the maximum amount the particle destination point can vary

gravity - the direction, in degrees for X, Y and Z, that gravity will be applied to each particle

maxscale - the maximum amount to scale each particle from the bitmap size

minscale - the minimum amount to scale each particle from the bitmap size

maxspeed - the maximum speed that each particle can travel

minspeed - the minimum speed that each particle can travel

maxunitlife - the maximum number of seconds that a particle will survive

minunitlife - the minimum number of seconds that a particle will survive

particlecreationrate - the number of seconds between creation of each particle

totallife - the number of seconds this effect will be active

bounce - if true the particles will bounce off objects. If false they will die upon collision

The colormax and colormin entries are RGB colors and have 3 values, separated by spaces. The color of each particle will be randomly chosen from a value between these two entries. The angles and gravity entries also have 3 values, separated by spaces, that define directions for the X, Y and Z axis. Note that if the spray is attached to an actor via a Predefined Explosion, angles is the number of degrees in each direction from the direction the actor is facing.
Actor Spray

This is defined by type = actorspray. It is similar to the spray effect except that it uses actors rather than textured polys as its particles. The section definition would look like this:

basename - base name of sequence of actors to use as particles

numberactors - number of actors in sequence

style - style of using actors

alpha - initial alpha value of actors

alpharate - amount per second to decrease actor alpha

baserotation - initial rotation of actors

minrotationspeed - minimum rotation speed of actors

maxrotationspeed - maximum rotation speed of actors

fillcolor - fill color of actor lighting

ambientcolor - ambient color of actor lighting

gravity - true or false to signify if actors are subject to gravity

angles - the rest of these are the same as the spray effect

sourcevariance -

destvariance -

maxscale -

minscale -

maxspeed -

minspeed -

maxunitlife -

minunitlife -

particlecreationrate -

totallife -

bounce -

solid - if true then particles are solid and can be interacted with

The sequence of actors used is similar to the bitmaps in the FlipBook. If you have 3 actors in the sequence then they must be named name0.act, name1.act and name2.act. The basename used would be name. The style can be 0, 1 or 2. A style of 0 uses the actors in increasing order (starting at 0 and going up) and wraps around to 0 at the end. A style of 1 starts in increasing order and switches to decreasing at the end, then increasing again at the beginning. A style of 2 uses them in random order. The baserotation is the initial rotation assigned to all the actors when they are created in the spray. It is in degrees. If minrotationspeed and maxrotationspeed are not zero in all axis then a speed will be randomly chosen for each axis in this range. The actor will rotate at that speed during its life. The speed is in degrees per second. An example of an actorspray effect is as follows. It has 8 actors named con0.act to con7.act. Note that if the actor spray is attached to an actor via a Predefined Explosion, angles is the number of degrees in each direction from the direction the actor is facing.

[ConSpray]

type = actorspray

basename = con

numberactors = 8

style = 2

alpha = 255

alpharate = 32

baserotation = 0 0 0

minrotationspeed = 90 90 0

maxrotationspeed = 180 180 0

angles = 0 0 0

fillcolor = 255 255 255

ambientcolor = 255 255 255

sourcevariance = 25

destvariance = 150

gravity = true

maxscale = 0.5

minscale = 0.3

maxspeed = 150

minspeed = 100

maxunitlife = 8

minunitlife = 6

particlecreationrate = 0.02

totallife = 0.5

bounce = true
Sound

This is defined by type = sound. The only variable required by this effect is:

name - the name of the WAV file to be played

The sound file is played once for its entire length.
Sprite

This is defined by type = sprite. This effect is very similar to the FlipBook entity and requires most of the same information. The variables that must be defined are:

basebitmapname - the base name of the animated bitmap files

basealphamapname - base name of the alphamap files used to assign transparency to the bitmaps

bitmapcount - the number of bitmaps in the animation

texturerate - the number of frames per second to animate at

color - the color of the bitmaps

alpha - the initial transparency level of the bitmaps, range 0 to 255 (solid)

alpharate - the amount per second to decrease the alpha value

scale - the amount to initially scale each bitmap

scalerate - the amount each second to decrease the scale of each bitmap

rotation - the initial amount, in degrees, to rotate each bitmap

rotationrate - the number of degrees per second to rotate each bitmap

lifetime - lifetime = 10 and the sprite will terminate after a max of 10 seconds.

style - The styles of the sprite are defined as:

style = none - show first frame only

style = reset - start from beginning again

style = reverse - reverse order of frames

style = random - randomly pick next bitmap

If no style is supplied then the sprite will cycle through the bitmap list from start to finish only once.

The basebitmapname and basealphamapname entries are the base name of a sequence of bitmaps. The first bitmap in the sequence must be <name>0.bmp, the second <name>1.bmp and so on, where <name> is either basebitmapname or basealphamapname. The color entry is a RGB color and has 3 values, separated by spaces. The animation is played through only once before being terminated.
Corona

This is defined by type = corona. This is the same as the Corona entity and requires the same information to be defined. The variables that must have data assigned are:

fadetime - number of seconds required when corona fades

minradius - minimum radius of corona

maxradius - maximum radius of corona

maxvisibledistance - maximum distance that corona is visible at

maxradiusdistance - distance after which corona is capped at maxradius

minradiusdistance - distance under which corona is capped at minradius

color - color of corona

totallife - the number of seconds this effect will be active

The color entry is a RGB color and has 3 values, separated by spaces.
Bolt

This is defined by type = bolt. This is similar to the ElectricBolt entity except that the terminus is an offset distance from the start position rather than a separate entity. The variables that require data are:

bitmapname - name of bitmap used to texture the bolt

alphamapname - name of the alphamap used to assign transparency to the bitmap

endoffset - the distance in the X, Y and Z directions to add to the start position to get the end position

width - the width of the bolt

numberpoints - the number of polys in the bolt, must be a power of 2 (16, 32, 64, 128)

wildness - how much the bolt varies from straight, range from 0 to 1(maximum variation)

intermittent - if true then bolt stops and starts, if false then runs continuously

maxfrequency - maximum number of seconds before intermittent bolt fires again

minfrequency - minimum number of seconds before intermittent bolt fires again

dominantcolor - dominant color of bolt, 0 = red, 1 = green and 2 = blue

color - base color of bolt. The nondominant colors should have the same value

totallife - the number of seconds this effect will be active

The color entry is a RGB color and has 3 values, separated by spaces. Note that if the bolt is attached to an actor via a Predefined Explosion, endoffset is the distance in each direction from the direction the actor is facing. If the bolt is attached to an actor the value of numberpoints must be 64 or less.

The effect.ini file already contains some predefined effects and you can look at these to see what each different effect requires. Lines starting with a semicolon (;) are comment lines and are ignored by the program.
Herp derp.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

I see but I still cant seem to make it.I'm sorry,but can you post what I have to put in the effect.ini
Or I really need a step by step tutorial for that I'm a newbie and I'm not very good at this :oops:
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: BLOOD?

Post by darksmaster923 »

ok ok

Code: Select all

[blood]
type = sprite
basebitmapname = blood\gore
basealphamapname = blood\a_gore
bitmapcount = 40
texturerate = 10
color = 255 255 255
alpha = 255
scale = 5
scalerate = 0
rotation = 0
rotationrate = 15
alpharate = 10
style = reset
lifetime = 4
you cant copy it directly, it wont work. you need to set up the paths to correctly have blood. i assume you have blood pictures already. in explosion.ini

Code: Select all

[bloodexplode]
effect0 = blood
delay0 = 0
offset0 = 0 0 0
EDIT
even better
http://www.realityfactory.info/forum/vi ... ilit=blood
Herp derp.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

Thanks a lot man I'll try it and tell you if it works !
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

Just one more thing :
and in the enemy script add an explosion with it
How do I add that explosion to the enemy script I know nothing about scripting soooo....I'm a total zero,but if you tell me where in the script and what to put I think I'll manage

Thanks again!
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: BLOOD?

Post by darksmaster923 »

use this in the death order
AddExplosion(char *Explosion, char *BoneName, float OffsetX, float OffsetY, float OffsetZ);
Herp derp.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

Man I suck at this so hard couldn't manage to do that either
This is how I added it to the death order:

Code: Select all

Death[()
	{
		DelTimerOrder(1);					
		AddPainOrder("PainToAlert", 0);				
		FindTargetOrder(0, "FoundTarget", DAMAGEATTRIBUTE);	
		DelTriggerOrder("IdleToAlert");				
                [b]AddExplosion("bloodexplode", Bip01 Head, float OffsetX, float OffsetY, float OffsetZ);[/b]
		SetNoCollision();					
		AnimateStop(DIE, DIEHOLD, "");		
		FadeOut(DIEFADE, 0); 					
		Remove(true);	
Now the enemies don't even die...Can you help me once again.Sorry I'm so annoying,but I need this :oops:
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: BLOOD?

Post by darksmaster923 »

AddExplosion("bloodexplode", Bip01 Head, float OffsetX, float OffsetY, float OffsetZ);
ok take off the bold tags (the and tags)
and you need quotes around the Bip01 Head and you need to add an offset. so itll be
AddExplosion("bloodexplode", "Bip01 Head", 0, 0, 0);
Herp derp.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

Code: Select all

Death[()
	{
		DelTimerOrder(1);							AddPainOrder("PainToAlert", 0);						FindTargetOrder(0, "FoundTarget", DAMAGEATTRIBUTE);	
		DelTriggerOrder("IdleToAlert");				
                AddExplosion("bloodexplode", "Bip01 Head", 0, 0, 0);
            
		SetNoCollision();					
		AnimateStop(DIE, DIEHOLD, "");		
		FadeOut(DIEFADE, 0); 			
		Remove(true);		
Now when I kill somebody the game gives an error and throws me out...
:shock: maybe I haven't placed it in the right place or I don't know I don't even understand it
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Re: BLOOD?

Post by darksmaster923 »

what does it say in the realityfactory.log file?
Herp derp.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: BLOOD?

Post by metal_head »

It's OK I fixed it!
Post Reply