Check out my games
Wednesday, 7 March 2012
Saturday, 11 February 2012
attachment class- custom weapon
class AttachmentClass_ak extends UTWeaponAttachment;
var ParticleSystem BeamTemplate;
var int CurrentPath;
simulated function SetMuzzleFlashParams(ParticleSystemComponent PSC)
{
local float PathValues[3];
local int NewPath;
Super.SetMuzzleFlashparams(PSC);
if (Instigator.FiringMode == 0)
{
NewPath = Rand(3);
if (NewPath == CurrentPath)
{
NewPath++;
}
CurrentPath = NewPath % 3;
PathValues[CurrentPath % 3] = 1.0;
PSC.SetFloatParameter('Path1',PathValues[0]);
PSC.SetFloatParameter('Path2',PathValues[1]);
PSC.SetFloatParameter('Path3',PathValues[2]);
// CurrentPath++;
}
else if (Instigator.FiringMode == 3)
{
PSC.SetFloatParameter('Path1',1.0);
PSC.SetFloatParameter('Path2',1.0);
PSC.SetFloatParameter('Path3',1.0);
}
else
{
PSC.SetFloatParameter('Path1',0.0);
PSC.SetFloatParameter('Path2',0.0);
PSC.SetFloatParameter('Path3',0.0);
}
}
defaultproperties
{
// Weapon SkeletalMesh
Begin Object Name=SkeletalMeshComponent0
SkeletalMesh=SkeletalMesh'my_weapons.ak.AK_Tuorial'
End Object
DefaultImpactEffect=(ParticleTemplate=ParticleSystem'Weapon_1_Mesh.P_WP_SniperRifle_Surface_Impact',Sound=SoundCue'Weapon_1_Mesh.AR_Impact')
BulletWhip=SoundCue'A_Weapon_ShockRifle.Cue.A_Weapon_SR_WhipCue'
MuzzleFlashSocket=MuzzleFlashSocket
MuzzleFlashPSCTemplate=VH_Scorpion.Effects.PS_Scorpion_Gun_MuzzleFlash_Red
MuzzleFlashAltPSCTemplate=VH_Scorpion.Effects.PS_Scorpion_Gun_MuzzleFlash_Red
MuzzleFlashColor=(R=200,G=0,B=0,A=255)
MuzzleFlashDuration=0.33;
MuzzleFlashLightClass=class'M16.M16_MuzzleFlash'
WeaponClass=class'ak'
}
ammo- custom weapon
class Ammo_ak extends UTAmmoPickupFactory;
defaultproperties
{
AmmoAmount=340
TargetWeapon=class'ak'
PickupSound=SoundCue'Weapon_1_Mesh.arm_gun'
MaxDesireability=0.28
bRotatingPickup=true
YawRotationRate=32000
Begin Object Name=AmmoMeshComp
StaticMesh=StaticMesh'Weapon_1_Mesh.M16_ammo'
Translation=(X=0.0,Y=0.0,Z=-15.0)
End Object
Begin Object Name=CollisionCylinder
CollisionHeight=14.4
End Object
}
damage type- custom weapon
class akDmgType extends UTDamageType
abstract;
defaultproperties
{
KillStatsName=KILLS_M4Carbine
DeathStatsName=DEATHS_M4Carbine
SuicideStatsName=SUICIDES_M4Carbine
DamageWeaponClass=class'ak_Base'
DamageWeaponFireMode=1
DamageBodyMatColor=(R=40,B=50)
DamageOverlayTime=0.3
DeathOverlayTime=0.6
VehicleDamageScaling=0.8
VehicleMomentumScaling=2.75
KDamageImpulse=1500.0
}
muzzle flash - custom weapon
class ak_MuzzleFlash extends UDKExplosionLight;
defaultproperties
{
HighDetailFrameTime=+0.02
Brightness=8
Radius=128
LightColor=(R=150,G=0,B=0,A=255)
TimeShift=((StartTime=0.0,Radius=128,Brightness=8,LightColor=(R=150,G=0,B=0,A=255)),(StartTime=0.2,Radius=64,Brightness=8,LightColor=(R=150,G=0,B=0,A=255)),(StartTime=0.25,Radius=64,Brightness=0,LightColor=(R=150,G=0,B=0,A=255)))
}
base class- custom weapon
class ak_Base extends UTWeapon
abstract;
defaultproperties
{
InventoryGroup=8
}
Scripts for adding custom udk weapons
ak:-
class ak extends UTWeapon;
simulated function PlayFireEffects( byte FireModeNum, optional vector HitLocation )
{
if (FireModeNum>1)
{
Super.PlayFireEffects(0,HitLocation);
}
else
{
Super.PlayFireEffects(FireModeNum, HitLocation);
}
}
simulated function AttachWeaponTo(SkeletalMeshComponent MeshCpnt, optional name SocketName)
{
Super(UTWeapon).AttachWeaponTo(MeshCpnt, SocketName);
}
defaultproperties
{
// Weapon SkeletalMesh
Begin Object class=AnimNodeSequence Name=MeshSequenceA
End Object
// Weapon SkeletalMesh
Begin Object Name=FirstPersonMesh
SkeletalMesh=SkeletalMesh'my_weapons.ak.AK_Tuorial'
AnimSets(0)=AnimSet''
Animations=MeshSequenceA
Rotation=(Yaw=-16384)
FOV=40.0
End Object
AttachmentClass=class'AttachmentClass_ak'
Begin Object Name=PickupMesh
SkeletalMesh=SkeletalMesh'my_weapons.ak.AK_Tuorial'
End Object
InstantHitMomentum(0)=+60000.0
WeaponFireTypes(0)=EWFT_InstantHit
InstantHitDamage(0)=100
FireInterval(0)=+0.3
InstantHitDamageTypes(0)=class'akDmgType'
WeaponFireSnd[0]=SoundCue'Weapon_1_Mesh.AK47_Cue'
PickupSound=SoundCue'Weapon_1_Mesh.arm_gun'
MaxDesireability=0.65
AIRating=0.99
CurrentRating=0.65
bInstantHit=true
bSplashJump=false
bRecommendSplashDamage=false
bSniping=true
ShouldFireOnRelease(0)=0
ShotCost(0)=1
FireOffset=(X=20,Y=5)
PlayerViewOffset=(X=17,Y=10.0,Z=-8.0)
AmmoCount=340
LockerAmmoCount=600
MaxAmmoCount=600
MuzzleFlashSocket=MF
MuzzleFlashPSCTemplate=ParticleSystem'Weapon_1_Mesh.P_SniperRifle_MuzzleFlash'
MuzzleFlashColor=(R=200,G=0,B=0,A=255)
MuzzleFlashDuration=0.25
MuzzleFlashLightClass=class'MyMod.akMuzzleFlash'
CrossHairCoordinates=(U=256,V=0,UL=64,VL=64)
LockerRotation=(Pitch=32768,Roll=16384)
IconCoordinates=(U=728,V=382,UL=162,VL=45)
InventoryGroup=6
GroupWeight=0.5
IconX=400
IconY=129
IconWidth=22
IconHeight=48
Begin Object Class=ForceFeedbackWaveform Name=ForceFeedbackWaveformShooting1
Samples(0)=(LeftAmplitude=90,RightAmplitude=40,LeftFunction=WF_Constant,RightFunction=WF_LinearDecreasing,Duration=0.1200)
End Object
WeaponFireWaveForm=ForceFeedbackWaveformShooting1
}
class ak extends UTWeapon;
simulated function PlayFireEffects( byte FireModeNum, optional vector HitLocation )
{
if (FireModeNum>1)
{
Super.PlayFireEffects(0,HitLocation);
}
else
{
Super.PlayFireEffects(FireModeNum, HitLocation);
}
}
simulated function AttachWeaponTo(SkeletalMeshComponent MeshCpnt, optional name SocketName)
{
Super(UTWeapon).AttachWeaponTo(MeshCpnt, SocketName);
}
defaultproperties
{
// Weapon SkeletalMesh
Begin Object class=AnimNodeSequence Name=MeshSequenceA
End Object
// Weapon SkeletalMesh
Begin Object Name=FirstPersonMesh
SkeletalMesh=SkeletalMesh'my_weapons.ak.AK_Tuorial'
AnimSets(0)=AnimSet''
Animations=MeshSequenceA
Rotation=(Yaw=-16384)
FOV=40.0
End Object
AttachmentClass=class'AttachmentClass_ak'
Begin Object Name=PickupMesh
SkeletalMesh=SkeletalMesh'my_weapons.ak.AK_Tuorial'
End Object
InstantHitMomentum(0)=+60000.0
WeaponFireTypes(0)=EWFT_InstantHit
InstantHitDamage(0)=100
FireInterval(0)=+0.3
InstantHitDamageTypes(0)=class'akDmgType'
WeaponFireSnd[0]=SoundCue'Weapon_1_Mesh.AK47_Cue'
PickupSound=SoundCue'Weapon_1_Mesh.arm_gun'
MaxDesireability=0.65
AIRating=0.99
CurrentRating=0.65
bInstantHit=true
bSplashJump=false
bRecommendSplashDamage=false
bSniping=true
ShouldFireOnRelease(0)=0
ShotCost(0)=1
FireOffset=(X=20,Y=5)
PlayerViewOffset=(X=17,Y=10.0,Z=-8.0)
AmmoCount=340
LockerAmmoCount=600
MaxAmmoCount=600
MuzzleFlashSocket=MF
MuzzleFlashPSCTemplate=ParticleSystem'Weapon_1_Mesh.P_SniperRifle_MuzzleFlash'
MuzzleFlashColor=(R=200,G=0,B=0,A=255)
MuzzleFlashDuration=0.25
MuzzleFlashLightClass=class'MyMod.akMuzzleFlash'
CrossHairCoordinates=(U=256,V=0,UL=64,VL=64)
LockerRotation=(Pitch=32768,Roll=16384)
IconCoordinates=(U=728,V=382,UL=162,VL=45)
InventoryGroup=6
GroupWeight=0.5
IconX=400
IconY=129
IconWidth=22
IconHeight=48
Begin Object Class=ForceFeedbackWaveform Name=ForceFeedbackWaveformShooting1
Samples(0)=(LeftAmplitude=90,RightAmplitude=40,LeftFunction=WF_Constant,RightFunction=WF_LinearDecreasing,Duration=0.1200)
End Object
WeaponFireWaveForm=ForceFeedbackWaveformShooting1
}
Subscribe to:
Posts (Atom)