Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Blood Splatter effect

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Blood Splatter effect

    This thread was deleted in the last maintenance I dunno why? if someone knows plz tell me Did I post it in the wrong place ? well... anyway

    Do anyone knows how can I make the actors do a blood splatter effect when hit ? and that it stains the walls
    Someone answered me but I couldn't take note of what he posted

    Thank you for your time everyone

    #2
    U want blood splatter on the wall or Blood comming out whenU shoot the actor?

    Comment


      #3
      Both, when I hit the dude, I want to see blood comming and that it can get stained in a "wall"

      Comment


        #4
        you need a decal then. create your decal material in the editor and then in unrealscript spawn a decal, apply your decal material. search and you'll find answer to how to do both
        you might also want to spawn a particle system too. create a particle system in the editor and then in unrealscript spawn a particlesystem, apply your particle system template.

        Comment


          #5
          thank you Im searching how to do that, Im not really familiar with unreal script so thats where I have to hit it hard; but how do I attach it to the actors so that it is activated when they are hit

          Comment


            #6
            I am kind of curious about this too... Like in DragonAge where the actors are completely covered with spattered blood?...

            Just guessing... but I think they probably just add or blend an additional character texture/material over the existing one with an "alpha" blood splatter material.

            If its not possible to blend over existing character texture... they probably just swap it out with a blood splattered version. (maybe 1 of 3 random versions)

            Comment


              #7
              u MEAN SOMETHING LIke this: http://youtu.be/Hweb1UEJoIY?t=6m ?

              PM me and I'll showU how I did mine

              Comment


                #8
                Yeah more or less like that, I believe what I'm asking here is a fundamental for any game or at least the majority, please everyone share what u know

                All for the sake for a better gaming world XD

                Comment


                  #9
                  k, Nemesis...

                  Basically, UTPawn does this by referencing the family info file... with this line under the "Play Takehit Effects" function:

                  " HitEffect = Spawn(GetFamilyInfo().default.BloodEmitterClass, self,, LastTakeHitInfo.HitLocation, rotator(BloodMomentum)); "

                  First thing I did was to create a damagetype for my weapon I wanted to spawn the blood effects:

                  Code:
                  /**
                   *
                   * Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
                   */
                  
                  
                  class SYTDmgType_Bullet extends UTDmgType_ShockPrimary
                  	abstract;
                  
                  static function SpawnHitEffect(Pawn P, float Damage, vector Momentum, name BoneName, vector HitLocation)
                  {
                  	local SYTEnemyPawn SEP;
                  	local name HeadBone;
                  	local UTEmit_HitEffect HitEffect;
                  
                  	SEP = SYTEnemyPawn(P);
                  	if (SEP != None && SEP.Mesh != None)
                  	{
                  		HeadBone = SEP.HeadBone;
                  	}
                  	HitEffect = P.Spawn(SEP.default.BloodEmitterClass,,, HitLocation, rotator(-Momentum));
                  	if (HitEffect != None)
                  	{
                  		HitEffect.AttachTo(P, HeadBone);
                  	}
                  
                  }
                  
                  
                  
                  
                  defaultproperties
                  {
                     bBulletHit=True
                     DamageWeaponClass=Class'SYTWeap_GRifle'
                     DamageWeaponFireMode=0   
                  
                     DeathAnim="Death_Bullet"
                     DeathAnimRate=0.900000
                     StopAnimAfterDamageInterval=0.500000
                     NodeDamageScaling=0.800000
                     KillStatsName="KILLS_STINGER"
                     DeathStatsName="DEATHS_STINGER"
                     SuicideStatsName="SUICIDES_STINGER"
                     RewardCount=15
                     RewardAnnouncementSwitch=9
                     RewardEvent="REWARD_BLUESTREAK"
                     CustomTauntIndex=8
                     DeathString="`Thats one hell of a bullet kill!."
                     FemaleSuicide="`Suicide? Geez!."
                     MaleSuicide="`Suicide? Geez!."
                     bNeverGibs=True
                    bCausesBloodSplatterDecals=True 
                     bCausesBlood=True
                     KDamageImpulse=200.000000
                     VehicleDamageScaling=0.600000
                     VehicleMomentumScaling=0.750000
                     Name="Default__SYTDmgType_Bullet"
                    }
                  I don't think the spawn hiteffects function worked, but if you noticed, in the default properties, I have "bCausesBloodSplatterDecals=True". This is responsible for the blood on the wall.
                  And you want to make sure you have this as the damage type in your weapon class.

                  Secondly, U want a blood emitter class for the actual blood spray (you're gonna need a blood PS for this):

                  Code:
                  /**
                   * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved.
                   */
                  
                  class SYTEmit_BloodSpray extends UTEmit_BloodSpray;
                  
                  defaultproperties
                  {
                  	
                       Template=ParticleSystem'SpryteEffects01.Effects.BloodSplat_PS'
                     Name="Default__SYTEmit_BloodSpray"
                  }

                  Now onto the Pawn class...(this is the pawn that's emitting the blood)

                  You want to add these the the default properties:

                  Code:
                  defaultproperties
                  {
                  
                  BloodSplatterDecalMaterial=MaterialInstanceTimeVarying'CH_Gibs.Decals.BloodSplatter'This is the material instance constant for blood decals on walls
                  
                  BloodEmitterClass=class'SYT.SYTEmit_BloodSpray' //this is the blood emmitter class we created earlier
                  
                  	BloodEffects[0]=(Template=ParticleSystem'SpryteEffects01.Effects.BloodSplat_PS',MinDistance=750.0)
                  	BloodEffects[1]=(Template=ParticleSystem'SpryteEffects01.Effects.BloodSplat_PS',MinDistance=350.0)
                  	BloodEffects[2]=(Template=ParticleSystem'SpryteEffects01.Effects.BloodSplat_PS',MinDistance=0.0) // I used the same PS for these...they're supposed to be based on the distance to the player
                  
                  }
                  After this you want to add a play take hit effects function to your pawn:

                  Code:
                  simulated function PlayTakeHitEffects()
                  {
                  	local class<SYTDmgType_Bullet> SYTDamage;
                  	local vector BloodMomentum;
                  	local UTEmit_HitEffect HitEffect;
                  	local ParticleSystem BloodTemplate;
                  
                  	if (EffectIsRelevant(Location, false))
                  	{
                  		SYTDamage = class<SYTDmgType_Bullet>(LastTakeHitInfo.DamageType);
                  		if ( SYTDamage != None )
                  		{
                  			if (SYTDamage.default.bCausesBloodSplatterDecals && !IsZero(LastTakeHitInfo.Momentum) && !class'UTGame'.Static.UseLowGore(WorldInfo))
                  			{
                  				LeaveABloodSplatterDecal(LastTakeHitInfo.HitLocation, LastTakeHitInfo.Momentum);
                  			}
                  
                  			
                  		         if ( SYTDamage.default.bCausesBlood && !class'UTGame'.Static.UseLowGore(WorldInfo) )
                  				{
                  					BloodTemplate = class'UTEmitter'.static.GetTemplateForDistance(default.BloodEffects, LastTakeHitInfo.HitLocation, WorldInfo);This is referencing the blood effects in the default properties
                  					if (BloodTemplate != None)
                  					{
                  						BloodMomentum = Normal(-1.0 * LastTakeHitInfo.Momentum) + (0.5 * VRand());
                  						HitEffect = Spawn(default.BloodEmitterClass, self,, LastTakeHitInfo.HitLocation, rotator(BloodMomentum));
                  						HitEffect.SetTemplate(BloodTemplate, true);
                  						HitEffect.AttachTo(self, LastTakeHitInfo.HitBone);
                  					}
                  				}
                  
                  				if ( !Mesh.bNotUpdatingKinematicDueToDistance )
                  				{
                  					// physics based takehit animations
                  					if (SYTDamage != None)
                  					{
                  						//@todo: apply impulse when in full ragdoll too (that also needs to happen on the server)
                  						if ( !class'Engine'.static.IsSplitScreen() && Health > 0 && DrivenVehicle == None && Physics != PHYS_RigidBody &&
                  							VSize(LastTakeHitInfo.Momentum) > SYTDamage.default.PhysicsTakeHitMomentumThreshold )
                  						{
                  							if (Mesh.PhysicsAssetInstance != None)
                  							{
                  								// just add an impulse to the asset that's already there
                  								Mesh.AddImpulse(LastTakeHitInfo.Momentum, LastTakeHitInfo.HitLocation);
                  								// if we were already playing a take hit effect, restart it
                  								if (bBlendOutTakeHitPhysics)
                  								{
                  									Mesh.PhysicsWeight = 0.5;
                  								}
                  							}
                  							else if (Mesh.PhysicsAsset != None)
                  							{
                  								Mesh.PhysicsWeight = 0.5;
                  								Mesh.PhysicsAssetInstance.SetNamedBodiesFixed(true, TakeHitPhysicsFixedBones, Mesh, true);
                  								Mesh.AddImpulse(LastTakeHitInfo.Momentum, LastTakeHitInfo.HitLocation);
                  								bBlendOutTakeHitPhysics = true;
                  							}
                  						}
                  						SYTDamage.static.SpawnHitEffect(self, LastTakeHitInfo.Damage, LastTakeHitInfo.Momentum, LastTakeHitInfo.HitBone, LastTakeHitInfo.HitLocation);
                  				}
                  			}
                  		}
                  	}
                  }

                  Comment


                    #10
                    I'll check it out

                    Wasn't there a way to do it using kismet ? I remember seeing a way somewhere

                    Comment


                      #11
                      Level-specific texture changing is pretty simple, provided the actor is a KActor or a subclass thereof. 'New Action' -> 'Actor' -> 'Set Material'

                      Comment


                        #12
                        But that changes the whole material isnt it instead of adding a new one?

                        We are getting off the rails here, what we want to do in this post is a blood splatter animation like the ones in killzone

                        Comment


                          #13
                          if the enemy was melee attacking would this still work??

                          Comment


                            #14
                            I am having trouble with this, in the custom damage class I am getting errors trying to spawn the bloodemitterclass. I think it is because of what I have it declared as in my pawn class.

                            What is the correct decleration of the BloodEmitterClass in the enemy pawn?

                            Comment


                              #15
                              i have these two errors ....
                              please help me ....
                              C:\UDK\UDK-2012-02-UC\Development\Src\MyGame\Classes\MyPawn.uc(477) : Error, Unknown Property 'BloodEffects' in 'Function MyGame.MyPawn:PlayTakeHitEffects'
                              C:\UDK\UDK-2012-02-UC\Development\Src\MyGame\Classes\SYTDmgType_Bulle t.uc(21) : Error, Unknown Property 'BloodEmitterClass' in 'Class MyGame.MyPawn'

                              Comment

                              Working...
                              X