PDA

View Full Version : weapon impact effects



colin2010
12-21-2011, 07:30 AM
need some help getting a few things working properly any help be great
1st thing is when i aim down weapon the fireoffset is way over to the left
2nd thing is weapon impact effects here all my weapon code


class WEAP_FORCE_ACR extends WEAP_FORCE_ACR_BASE;

var bool holdingPistol;
var bool bIsReloading;


simulated function FireAmmunition()
{
if (inclip >= 1)
{
super.FireAmmunition();
}
else if(inclip <= 0)
{
keyReload();
}
}

simulated function InstantFire()
{
local UTPlayerController PC;
local float Scale;

PC = UTPlayerController(Instigator.Controller);

if (pc != none)
{
PC.ClientPlayCameraAnim(default.fireshake, Scale);
}

if (inclip <= 0)
{
keyReload();
}
else if (inclip >= 1)
{

if (ammoAvalible > 0)
{
ammoAvalible = AmmoCount - clipsize;
firedAmmocount = ++firedAmmocount;
inclip -= 1;
ammoAvalible += firedAmmocount;
}
else if (ammoAvalible <= 0)
{
ammoAvalible = 0;
firedAmmocount = ++firedAmmocount;
inclip -= 1;
}
super.InstantFire();
if(firedAmmocount == clipsize)
{
if (AmmoCount > 1)
{
keyReload();
}
firedAmmocount = clipsize;
}
}

}

simulated function keyReload()
{
if (holdingPistol == true)
{
if (ammoAvalible >= 1)

midReload = true;
LogInternal("keyReload Pistol");
SetTimer(0.2, False, 'Pistolreloading');
SetTimer(0.03, False, 'Pistolwait');

}
super.keyReload();

}


simulated function Pistolwait()
{
GotoState('Pistolreload');
}

simulated function Pistolreloading()
{
local UTBot B;

B = UTBot(Instigator.Controller);

if (B != none)
{
inclip = 12;
firedAmmocount = 0;

LogInternal("bot reload Pistol");
}
ClearTimer('Pistolreloading');
ClearTimer('Pistolwait');
LeaveZoom();
PlayWeaponAnimation('WeaponReload',3.4);
}

state Pistolreload
{
Begin:
sleep(3.4);
midReload = false;

if (AmmoCount >= clipsize)
{
inclip = clipsize;
ammoAvalible -= firedAmmocount;
firedAmmocount = 0;
}
else if (AmmoCount < clipsize)
{
inclip = AmmoCount;
ammoAvalible -= firedAmmocount;
firedAmmocount = 0;
}

if (ammoAvalible <= 0)
{
ammoAvalible = 0;
}
GotoState('Active');
}

function byte BestMode()
{
return 0;
}

simulated function PutDownWeapon()
{
LeaveZoom();
super.PutDownWeapon();
}

simulated function PlayWeaponEquip()
{
local UTPlayerController PC;
PC = UTPlayerController(Instigator.Controller);

if (PC != none)
pc.bNoCrosshair = false;
holdingPistol = true;
super.PlayWeaponEquip();
}

simulated function PlayWeaponPutDown()
{
local UTPlayerController PC;
PC = UTPlayerController(Instigator.Controller);
if (PC != none)
pc.bNoCrosshair = false;
holdingPistol = false;
midReload = false;
super.PlayWeaponPutDown();

}

exec function Reload()
{
keyReload();
}


defaultproperties
{
bEjectBrassOnFire=True
BrassClass=Class'BRASS_WEAP_FORCE_ACR'
BrassStartOffset=(X=0,Y=2,Z=0)
BrassVelocity=(X=80,Y=130,Z=100)
Begin Object class=AnimNodeSequence Name=MeshSequenceA
End Object

Begin Object Name=FirstPersonMesh
SkeletalMesh=SkeletalMesh'WP_FORCE_ACR.Mesh.SK_WP_ FORCE_ACR_1P'
AnimSets(0)=AnimSet'WP_FORCE_ACR.Anims.K_WP_FORCE_ ACR'
Animations=MeshSequenceA
Rotation=(Yaw=-16384)
FOV=55.0
Scale=0.9
End Object

AttachmentClass=class'ATTACHMENT_WEAP_FORCE_ACR'

Begin Object Name=PickupMesh
SkeletalMesh=SkeletalMesh'WP_FORCE_ACR.Mesh.SK_WP_ FORCE_ACR_PICKUP'
Scale=1.1
End Object

FireOffset=(X=1,Y=12,Z=-5)
SpreadScoped=0.001
SpreadNoScoped=0.003

WeaponFireSnd(0)=SoundCue'WP_FORCE_ACR.Sound.hk53a 3_fire_1p_NEW_Cue'
WeaponPutDownSnd=SoundCue'ForceWeapon_Impact.Sound s.WP_PutdownCue'
WeaponEquipSnd=SoundCue'ForceWeapon_Impact.Sounds. WP_PutdownLightCue'
PickupSound=SoundCue'ForceWeapon_Impact.Sounds.WP_ AmmoPickupCue'

FireInterval(0)=+0.20
AmmoCount=80
LockerAmmoCount=120
MaxAmmoCount=240
//bZoomedFireMode(1)=1

InstantHitDamage(0)=100
InstantHitDamageTypes(0)=class'DmgType_WEAP_FORCE_ ACR'

WeaponFireTypes(0)=EWFT_InstantHit
//WeaponFireTypes(1)=EWFT_Projectile
//WeaponProjectiles(1)=class'Weap_MK18Bullet'

bDisplaycrosshair = True;
CrosshairImage=Texture2D'UI_HUD.HUD.UTCrossHairs'
CrossHairCoordinates=(U=448,V=0,UL=64,VL=64)
CrosshairScaling=0.5

MuzzleFlashSocket=MF
MuzzleFlashPSCTemplate=ParticleSystem'WP_FORCE_ACR .Effects.MuzzleFlash'
MuzzleFlashColor=(R=255,G=120,B=255,A=255)
MuzzleFlashDuration=0.33;
MuzzleFlashLightClass=class'MP_MF_Light'

WeaponFireAnim(0)="WeaponFire"
WeaponPutDownAnim="WeaponPutDown"
WeaponEquipAnim="WeaponEquip"
WeaponIdleAnims(0)="WeaponIdle"
WeaponFireAnimZoom(0)="Weapon_ADS_Fire"
WeaponIdleAnimsZoom(0)="Weapon_ADS_Idle"

EquipTime=+1.0
PutDownTime=+0.5

bIsReloading = false;

Clips=4
inclip=40
clipsize=40

}

colin2010
12-21-2011, 07:32 AM
class WEAP_FORCE_ACR_BASE extends UTWeapon

dependson(UTPlayerController)
config(UTWeapon)
abstract;


var CameraAnim fireshake;

var() class<Brass> BrassClass;
var() name EjectorSocket;
var() Vector BrassStartOffset;
var() Vector BrassVelocity;
var() bool bEjectBrassOnFire;
var() float BrassForegroundTime;
var() bool bEjectBrass;

var float LastPlayFireTime;

//Weapon animations for use while zoomed
var(Animations) array<name> WeaponFireAnimZoom;
var(Animations) array<name> WeaponIdleAnimsZoom;
//var CanvasIcon WeaponBGIcon;
//Arm animations for use while zoomed
var(Animations) array<name> ArmFireAnimZoom;
var(Animations) array<name> ArmIdleAnimsZoom;


var bool AmIZoomed;
var bool IsitFiring;
var float BaseGroundSpeed;
var float BaseAirSpeed;
var float BaseWaterSpeed;
var float BaseJumpZ;
var float ZoomGroundSpeed;
var float ZoomAirSpeed;
var float ZoomWaterSpeed;
var float ZoomJumpZ;
var float SpreadScoped;
var float SpreadNoScoped;
var bool bDisplayCrosshair;
var float ZoomedFOVSub;
var bool bAbortZoom;
var int ZoomCount;

var bool midReload;
var bool reloadEnd;
var int firedAmmocount;
var int ammoAvalible;
var int inclip;
var int clipsize;
var int Clips;


simulated function bool CanThrow()
{
if (!IsInState('WeaponEquipping'))
return bCanThrow;
}

replication
{
if ( Role == ROLE_Authority )
AmIZoomed;
}

server reliable function CheckMyZoom()
{
Local Pawn P;
P = Pawn(Owner);
if (AmIZoomed == true)
{
P.GroundSpeed = Default.ZoomGroundSpeed;
P.AirSpeed = Default.ZoomAirSpeed;
P.WaterSpeed = Default.ZoomWaterSpeed;
P.JumpZ = Default.ZoomJumpZ;
Spread[CurrentFireMode] = Default.SpreadScoped;
FireInterval[CurrentFireMode] = Default.FireInterval[CurrentFireMode];

}
else
{
P.GroundSpeed = Default.BaseGroundSpeed;
P.AirSpeed = Default.BaseAirSpeed;
P.WaterSpeed = Default.BaseWaterSpeed;
P.JumpZ = Default.BaseJumpZ;
Spread[CurrentFireMode] = Default.SpreadNoScoped;
FireInterval[CurrentFireMode] = Default.FireInterval[CurrentFireMode];
}
}

simulated function Activate()
{
CheckMyZoom();
GetSetFOV();
super.Activate();
}

simulated function DrawWeaponCrosshair( Hud HUD )
{
local UTPlayerController PC;

if( bDisplayCrosshair )
{
PC = UTPlayerController(Instigator.Controller);
if ( (PC == None) || PC.bNoCrosshair )
{
return;
}
super.DrawWeaponCrosshair(HUD);
}
}

simulated function GetSetFOV()
{
local UTPlayerController PC;
PC = UTPlayerController(Instigator.Controller);
ZoomedTargetFOV = PC.FOVAngle - ZoomedFOVSub;
}

simulated function StartZoom(UTPlayerController PC)
{
ZoomCount++;
if (ZoomCount == 1 && !IsTimerActive('Gotozoom') && Instigator.IsFirstPerson())
{
bAbortZoom = false;
bDisplayCrosshair = false;
PlayWeaponAnimation('Weapon_ADS_Idle',0.2);
PlayArmAnimation('Weapon_ADS_Idle',0.2);
SetTimer(0.2, false, 'Gotozoom');
SetTimer(0.2,false,'PlayMyZoomIdle');
if( Role < Role_Authority )
{
// if we're a client, synchronize server
SetTimer(0.2, false, 'ServerGotozoom');
}
}
}

simulated function Gotozoom()
{
local UTPlayerController PC;

PC = UTPlayerController(Instigator.Controller);
if (GetZoomedState() == ZST_NotZoomed)
{
if (bAbortZoom) // stop the zoom after 1 tick
{
SetTimer(0.0001, false, 'StopZoom');
}
PC.FOVAngle = ZoomedTargetFOV;
PC.StartZoom(ZoomedTargetFOV, ZoomedRate);
}
AmIZoomed = true;
CheckMyZoom();
}

reliable server function ServerGotoZoom()
{
AmIZoomed = true;
CheckMyZoom();
}

simulated function EndZoom(UTPlayerController PC)
{
bAbortZoom = false;
if (IsTimerActive('Gotozoom'))
{
ClearTimer('Gotozoom');
}
SetTimer(0.001,false,'LeaveZoom');
if( Role < Role_Authority )
{
// if we're a client, synchronize server
SetTimer(0.001,false,'ServerLeaveZoom');
}
}

simulated function LeaveZoom()
{

local UTPlayerController PC;
PC = UTPlayerController(Instigator.Controller);
if (PC != none)
{
PC.EndZoom();
}
ZoomCount = 0;
PlayWeaponAnimation('WeaponIdle',0.3);
PlayArmAnimation('WeaponIdle',0.3);
SetTimer(0.3,false,'RestartCrosshair');
AmIZoomed = false;
bAbortZoom = false;
CheckMyZoom();
}

reliable server function ServerLeaveZoom()
{
AmIZoomed = false;
CheckMyZoom();

}

simulated function StopZoom()
{
local UTPlayerController PC;

if (WorldInfo.NetMode != NM_DedicatedServer)
{
PC = UTPlayerController(Instigator.Controller);
if (PC != None && LocalPlayer(PC.Player) != none)
{
PC.StopZoom();
}
}
}

simulated function RestartCrosshair()
{
bDisplayCrosshair = true;
}

simulated function PutDownWeapon()
{
LeaveZoom();
Super.PutDownWeapon();
}

simulated function bool DenyClientWeaponSet()
{
// don't autoswitch while zoomed
return (GetZoomedState() != ZST_NotZoomed);
}

simulated function HolderEnteredVehicle()
{
local UTPawn UTP;

PlayWeaponAnimation('WeaponIdle', 0.3);

if (WorldInfo.NetMode != NM_DedicatedServer)
{
UTP = UTPawn(Instigator);
if (UTP != None)
{
// Check we have access to mesh and animations
if (UTP.ArmsMesh[0] != None && ArmsAnimSet != None && GetArmAnimNodeSeq() != None)
{
UTP.ArmsMesh[0].PlayAnim('WeaponIdle', 0.3, false);
}
}
}
}

simulated function PlayWeaponPutDown()
{
ClearTimer('GotoZoom');
ClearTimer('StopZoom');
if(UTPlayerController(Instigator.Controller) != none)
{
UTPlayerController(Instigator.Controller).EndZoom( );
}
super.PlayWeaponPutDown();
}

simulated state Active
{
simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
{
local int IdleIndex;

if ( WorldInfo.NetMode != NM_DedicatedServer && WeaponIdleAnims.Length > 0 )
{
if (AmIZoomed == true)
{
IdleIndex = Rand(WeaponIdleAnimsZoom.Length);
PlayWeaponAnimation(WeaponIdleAnimsZoom[IdleIndex], 0.0, true);
if(ArmIdleAnims.Length > IdleIndex && ArmsAnimSet != none)
{
PlayArmAnimation(ArmIdleAnimsZoom[IdleIndex], 0.0,, true);
}
}
else
{
IdleIndex = Rand(WeaponIdleAnims.Length);
PlayWeaponAnimation(WeaponIdleAnims[IdleIndex], 0.0, true);
if(ArmIdleAnims.Length > IdleIndex && ArmsAnimSet != none)
{
PlayArmAnimation(ArmIdleAnims[IdleIndex], 0.0,, true);
}
}
}
}





}

simulated function float GetFireInterval( byte FireModeNum )
{
return FireInterval[FireModeNum] * ((UTPawn(Owner)!= None) ? UTPawn(Owner).FireRateMultiplier : 1.0);
}

simulated function PlayArmAnimation( Name Sequence, float fDesiredDuration, optional bool OffHand, optional bool bLoop, optional SkeletalMeshComponent SkelMesh)
{
local UTPawn UTP;
local SkeletalMeshComponent ArmMeshComp;
local AnimNodeSequence WeapNode;

// do not play on a dedicated server or if they aren't being seen
if( WorldInfo.NetMode == NM_DedicatedServer || Instigator == None || !Instigator.IsFirstPerson())
{
return;
}
UTP = UTPawn(Instigator);
if(UTP == none)
{
return;
}
if(UTP.bArmsAttached)
{
// Choose the right arm
if(!OffHand)
{
ArmMeshComp = UTP.ArmsMesh[0];
}
else
{
ArmMeshComp = UTP.ArmsMesh[1];
}

// Check we have access to mesh and animations
if( ArmMeshComp == None || ArmsAnimSet == none || GetArmAnimNodeSeq() == None )
{
return;
}

// If we are not specifying a duration, use the default play rate.
if(fDesiredDuration > 0.0)
{
// @todo - this should call GetWeaponAnimNodeSeq, move 'duration' code into AnimNodeSequence and use that.
ArmMeshComp.PlayAnim(Sequence, fDesiredDuration, bLoop);
}
else
{
WeapNode = AnimNodeSequence(ArmMeshComp.Animations);
WeapNode.SetAnim(Sequence);
WeapNode.PlayAnim(bLoop, DefaultAnimSpeed);
}
}
}

simulated function PlayWeaponAnimation(name Sequence, float fDesiredDuration, optional bool bLoop, optional SkeletalMeshComponent SkelMesh)
{
if (Mesh != None && Mesh.bAttached)
{
Super.PlayWeaponAnimation(Sequence, fDesiredDuration, bLoop, SkelMesh);
}
}


simulated function PlayFireEffects( byte FireModeNum, optional vector HitLocation )
{
if (AmIZoomed == true)
{
if ( FireModeNum < WeaponFireAnim.Length && WeaponFireAnim[FireModeNum] != '' )
PlayWeaponAnimation( WeaponFireAnimZoom[FireModeNum], GetFireInterval(FireModeNum) );

if ( FireModeNum < ArmFireAnim.Length && ArmFireAnim[FireModeNum] != '' && ArmsAnimSet != none)
PlayArmAnimation( ArmFireAnimZoom[FireModeNum], GetFireInterval(FireModeNum) );
}
else
{
if ( FireModeNum < WeaponFireAnim.Length && WeaponFireAnim[FireModeNum] != '' )
PlayWeaponAnimation( WeaponFireAnim[FireModeNum], GetFireInterval(FireModeNum) );

if ( FireModeNum < ArmFireAnim.Length && ArmFireAnim[FireModeNum] != '' && ArmsAnimSet != none)
PlayArmAnimation( ArmFireAnim[FireModeNum], GetFireInterval(FireModeNum) );
}
// Start muzzle flash effect
CauseMuzzleFlash();

ShakeView();

if (bEjectBrassOnFire)
EjectBrass();
}

simulated function TimeWeaponFiring( byte FireModeNum )
{
// if weapon is not firing, then start timer. Firing state is responsible to stopping the timer.
if( !IsTimerActive('RefireCheckTimer') )
{
SetTimer( GetFireInterval(FireModeNum), true, nameof(RefireCheckTimer) );
}
}

simulated function RefireCheckTimer();

simulated function EjectBrass()
{
local Brass Shell;
local vector X, Y, Z, StartLoc;
local Rotator StartRot;

if (!bEjectBrass || !Instigator.IsFirstPerson())
return;
if (Worldinfo.TimeSeconds - LastRenderTime > 0.15 || WorldInfo.GetDetailMode() == DM_Low)
return;


if (BrassClass != None)
{
SkeletalMeshComponent(Mesh).GetSocketWorldLocation AndRotation(EjectorSocket, StartLoc, StartRot);

GetAxes(StartRot, X, Y, Z);
Shell = Spawn(BrassClass,,, StartLoc + X * BrassStartOffset.X + Y * BrassStartOffset.Y + Z * BrassStartOffset.Z, StartRot);
if (Shell != None)
{
Shell.Velocity = Instigator.Velocity + X * BrassVelocity.X + Y * BrassVelocity.Y + Z * BrassVelocity.Z;
Shell.AngularVelocity = VRand() * 25;
Shell.StartBrass(BrassForegroundTime);
}
}

}

simulated function PlayMyZoomIdle()
{
local int IdleIndex;
IdleIndex = Rand(WeaponIdleAnims.Length);
PlayWeaponAnimation(WeaponIdleAnimsZoom[IdleIndex], 0.0, true);
if(ArmIdleAnims.Length > IdleIndex && ArmsAnimSet != none)
{
PlayArmAnimation(ArmIdleAnimsZoom[IdleIndex], 0.0,, true);
}
}

simulated function StartFire(byte FireModeNum)
{

local PlayerController PC;
PC = PlayerController(Instigator.Controller);

if(AmIZoomed == true)
{
PlayWeaponAnimation( WeaponFireAnimZoom[FireModeNum], GetFireInterval(FireModeNum));
}
else
{
PlayWeaponAnimation(WeaponFireAnim[FireModeNum], GetFireInterval(FireModeNum));
}

IsitFiring = true;

super.StartFire(FireModeNum);
}

simulated function keyReload()
{
}

defaultproperties
{
bEjectBrass=True
EjectorSocket="EjectorSocket"

CrosshairImage=Texture2D'UI_HUD.HUD.UTCrossHairs'
CrossHairCoordinates=(U=128,V=0,UL=64,VL=64)
CrosshairScaling=0.5
PivotTranslation=(Y=-25.0)

WeaponFireAnimZoom(0)=Weapon_ADS_Fire
WeaponIdleAnimsZoom(0)=Weapon_ADS_Idle
ArmFireAnimZoom(0)=Weapon_ADS_Fire
ArmIdleAnimsZoom(0)=Weapon_ADS_Idle

bZoomedFireMode(0)=0
bZoomedFireMode(1)=1

AmIZoomed=false

bSniping=true

bDisplaycrosshair = true;
JumpDamping=0.1
MaxPitchLag=40
MaxYawLag=50
BaseGroundSpeed=440.0
BaseAirSpeed=440.0
BaseWaterSpeed=220.0
BaseJumpZ=322.0
//AmIZoomed=false
ZoomedRate=300000.0
ZoomedFOVSub=60.0
SpreadScoped=0.0025
SpreadNoScoped=0.045
ZoomGroundSpeed=210.0
ZoomAirSpeed=340.0
ZoomWaterSpeed=110.0
ZoomJumpZ=256.0

BobDamping=0.750000
}


class ATTACHMENT_WEAP_FORCE_ACR extends UTWeaponAttachment;

var class<UDKExplosionLight> ImpactLightClass;

/**
* Spawn any effects that occur at the impact point. It's called from the pawn.
*/
simulated function PlayImpactEffects(vector HitLocation)
{
local vector NewHitLoc, HitNormal, FireDir, WaterHitNormal;
local Actor HitActor;
local TraceHitInfo HitInfo;
local MaterialImpactEffect ImpactEffect;
local MaterialInterface MI;
local MaterialInstanceTimeVarying MITV_Decal;
local int DecalMaterialsLength;
local Vehicle V;
local UTPawn P;

P = UTPawn(Owner);
HitNormal = Normal(Owner.Location - HitLocation);
FireDir = -1 * HitNormal;
if ( (P != None) && EffectIsRelevant(HitLocation, false, MaxImpactEffectDistance) )
{
if ( bMakeSplash && !WorldInfo.bDropDetail && P.IsPlayerPawn() && P.IsLocallyControlled() )
{
HitActor = Trace(NewHitLoc, WaterHitNormal, HitLocation, P.Location+P.eyeheight*vect(0,0,1), true,, HitInfo, TRACEFLAG_PhysicsVolumes | TRACEFLAG_Bullet);
if ( U****erVolume(HitActor) != None )
{
WorldInfo.MyEmitterPool.SpawnEmitter(ParticleSyste m'Envy_Effects.Particles.P_WP_Water_Splash_Small', NewHitLoc, rotator(vect(0,0,1)));
}
}
HitActor = Trace(NewHitLoc, HitNormal, (HitLocation - (HitNormal * 32)), HitLocation + (HitNormal * 32), true,, HitInfo, TRACEFLAG_Bullet);
if(Pawn(HitActor) != none)
{
CheckHitInfo(HitInfo, Pawn(HitActor).Mesh, -HitNormal, NewHitLoc);
}
SetImpactedActor(HitActor, HitLocation, HitNormal, HitInfo);
// figure out the impact sound to use
ImpactEffect = GetImpactEffect(HitInfo.PhysMaterial);
V = Vehicle(HitActor);
if (ImpactEffect.Sound != None && !bSuppressSounds)
{
// if hit a vehicle controlled by the local player, always play it full volume
if (V != None && V.IsLocallyControlled() && V.IsHumanControlled())
{
PlayerController(V.Controller).ClientPlaySound(Imp actEffect.Sound);
}
else
{
if ( BulletWhip != None )
{
CheckBulletWhip(FireDir, HitLocation);
}
PlaySound(ImpactEffect.Sound, true,,, HitLocation);
}
}
if ( UTVehicle(V) != none && Role < ROLE_Authority && !WorldInfo.GRI.OnSameTeam(Owner,V) )
{
UTVehicle(V).ApplyMorphDamage(HitLocation, WeaponClass.Default.InstantHitDamage[UTPawn(Owner).FiringMode], WeaponClass.Default.InstantHitMomentum[UTPawn(Owner).FiringMode]*FireDir);
}

// Pawns handle their own hit effects
if ( HitActor != None &&
(Pawn(HitActor) == None || Vehicle(HitActor) != None) &&
AllowImpactEffects(HitActor, HitLocation, HitNormal) )
{
// this code is mostly duplicated in: UTGib, UTProjectile, UTVehicle, UTWeaponAttachment be aware when updating
if ( !WorldInfo.bDropDetail
&& (Pawn(HitActor) == None)
&& (VSizeSQ(Owner.Location - HitLocation) < MaxDecalRangeSq)
&& (((WorldInfo.GetDetailMode() != DM_Low) && !class'Engine'.static.IsSplitScreen()) || (P.IsLocallyControlled() && P.IsHumanControlled())) )
{
// if we have a decal to spawn on impact
DecalMaterialsLength = ImpactEffect.DecalMaterials.length;
if( DecalMaterialsLength > 0 )
{
MI = ImpactEffect.DecalMaterials[Rand(DecalMaterialsLength)];
if( MI != None )
{
if( MaterialInstanceTimeVarying(MI) != none )
{
// hack, since they don't show up on terrain anyway
if ( Terrain(HitActor) == None )
{
MITV_Decal = new(self) class'MaterialInstanceTimeVarying';
MITV_Decal.SetParent( MI );

WorldInfo.MyDecalManager.SpawnDecal( MITV_Decal, HitLocation, rotator(-HitNormal), ImpactEffect.DecalWidth,
ImpactEffect.DecalHeight, 10.0, false,, HitInfo.HitComponent, true, false, HitInfo.BoneName, HitInfo.Item, HitInfo.LevelIndex );
//here we need to see if we are an MITV and then set the burn out times to occur
MITV_Decal.SetScalarStartTime( ImpactEffect.DecalDissolveParamName, ImpactEffect.DurationOfDecal );
}
}
else
{
WorldInfo.MyDecalManager.SpawnDecal( MI, HitLocation, rotator(-HitNormal), ImpactEffect.DecalWidth,
ImpactEffect.DecalHeight, 10.0, false,, HitInfo.HitComponent, true, false, HitInfo.BoneName, HitInfo.Item, HitInfo.LevelIndex );
}
}
}
}

if (ImpactEffect.ParticleTemplate != None)
{
if (!bAlignToSurfaceNormal)
{
HitNormal = normal(FireDir - ( 2 * HitNormal * (FireDir dot HitNormal) ) ) ;
}
WorldInfo.MyEmitterPool.SpawnEmitter(ImpactEffect. ParticleTemplate, HitLocation, rotator(HitNormal), HitActor);
}
}
}
else if ( BulletWhip != None )
{
CheckBulletWhip(FireDir, HitLocation);
}
}

simulated function CheckBulletWhip(vector FireDir, vector HitLocation)
{
local UTPlayerController PC;

ForEach LocalPlayerControllers(class'UTPlayerController', PC)
{
if ( !WorldInfo.GRI.OnSameTeam(Owner,PC) )
PC.CheckBulletWhip(BulletWhip, Owner.Location, FireDir, HitLocation);
}
}

/** When an attachment is attached to a pawn, it enters the CurrentlyAttached state. */
state CurrentlyAttached
{
}




defaultproperties
{
Begin Object Name=SkeletalMeshComponent0
SkeletalMesh=SkeletalMesh'WP_FORCE_ACR.Mesh.SK_WP_ FORCE_ACR_3P'
Scale=0.15
End Object

WeapAnimType=EWAT_Pistol

// EWAT_Default -
// EWAT_DualPistols -
// EWAT_ShoulderRocket -
// EWAT_Stinger -

WeaponClass=class'WEAP_FORCE_ACR'

DefaultImpactEffect(0)=(DecalMaterials=(MaterialIn stanceConstant'ForceWeapon_Impact.Bullet.MIl_Bulle t_Concrete'),DurationOfDecal=4.000000,DecalDissolv eParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')

ImpactEffects(0)=(MaterialType="Dirt",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(1)=(MaterialType="Gravel",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(2)=(MaterialType="Sand",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(3)=(MaterialType="Dirt_Wet",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(4)=(MaterialType="Energy",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(5)=(MaterialType="WorldBoundary",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(6)=(MaterialType="Flesh",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(7)=(MaterialType="Flesh_Human",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(8)=(MaterialType="Lava",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(9)=(MaterialType="NecrisVehicle",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(11)=(MaterialType="Foliage",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(12)=(MaterialType="Glass",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MI_Bullet_Wood'),DurationOfDecal =4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Woo d')
ImpactEffects(13)=(MaterialType="Liquid",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(14)=(MaterialType="Water",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'Envy_Effects.Particles.P_W P_Water_Splash_Small',Sound=SoundCue'ForceWeapon_I mpact.Sounds_Bullet.WP_BulletImpact_Concrete')
ImpactEffects(15)=(MaterialType="ShallowWater",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'Envy_Effects.Particles.P_W P_Water_Splash_Small',Sound=SoundCue'ForceWeapon_I mpact.Sounds_Bullet.WP_BulletImpact_Concrete')
ImpactEffects(17)=(MaterialType="Slime",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(18)=(MaterialType="Metal",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MI_Bullet_Metal'),DurationOfDeca l=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Met al')
ImpactEffects(19)=(MaterialType="Snow",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MIl_Bullet_Concrete'),DurationOf Decal=4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Con crete')
ImpactEffects(20)=(MaterialType="Wood",DecalMaterials=(MaterialInstanceConstant'ForceWea pon_Impact.Bullet.MI_Bullet_Wood'),DurationOfDecal =4.000000,DecalDissolveParamName="DissolveAmount",DecalWidth=8.000000,DecalHeight=8.000000,Particle Template=ParticleSystem'ForceWeapon_Impact.Effects .P_WP_Pistol_MuzzleFlash_Impact',Sound=SoundCue'Fo rceWeapon_Impact.Sounds_Bullet.WP_BulletImpact_Woo d')

//ProjExplosionTemplate=ParticleSystem'ForceWeapon.E ffects.Bloodhit'

}

colin2010
12-21-2011, 11:20 AM
some help plz

colin2010
12-22-2011, 07:15 AM
nobody no how to fix it :confused:

colin2010
12-23-2011, 05:58 PM
just need the impact effects working now help plz