How to make weapon 'Shoot' animation faster
How to make weapon 'Shoot' animation faster
Greetings. I have a custom weapon pack. 2027's weapon models. So, I'm decreasing the shot time, but nothing works. So, my theory lies with the 'Shoot' animation. The shorter the animation, the faster the weapon will fire. Can there be any way that I can decrease the Shot Time of these models. Also the weapons. Many thanks for help.http://www.offtopicproductions.com/foru ... =post&f=36#
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
Check PlaySelectiveFire() in DeusExWeapon.uc. In there you'll find a PlayAnim() call. Its second parameter is the anim rate.
Re: How to make weapon 'Shoot' animation faster
What am i supposed to edit
If I do slomo 2, I got my desired fast firing weapon.But I want them at normal game speed.
Pls can you tell me how and what to edit
Thank u for the reply though =)
If I do slomo 2, I got my desired fast firing weapon.But I want them at normal game speed.
Pls can you tell me how and what to edit
Thank u for the reply though =)
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
Oh, you're not modifying DeusEx.u.
In the weapon classes of your package, override PlaySelectiveFire().
Export DeusEx.u so that you can fetch PlaySelectiveFire() to copy/paste to your weapon classes.
In the weapon classes of your package, override PlaySelectiveFire().
Export DeusEx.u so that you can fetch PlaySelectiveFire() to copy/paste to your weapon classes.
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
The fuck is that god awful music and why is it relevant?
Try this: https://www.youtube.com/watch?v=4QsJ9pA-SQA
Try this: https://www.youtube.com/watch?v=4QsJ9pA-SQA
Re: How to make weapon 'Shoot' animation faster
How exactly am i supposed to override it. How shall I make the weapon fire faster ?
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
1. Open UnrealEd
2. Click ExportAll in the actor browser (on the right).
This will export DeusEx.u classes to your Deus Ex Directory.
3. Open DeusExWeapon.uc found among those exported classes.
4. ctrl+f "function playselectivefire"
5. copy that function and its contents, and paste it into your 2027 package weapon classes.
Once you've done that, report back for further instructions.
2. Click ExportAll in the actor browser (on the right).
This will export DeusEx.u classes to your Deus Ex Directory.
3. Open DeusExWeapon.uc found among those exported classes.
4. ctrl+f "function playselectivefire"
5. copy that function and its contents, and paste it into your 2027 package weapon classes.
Once you've done that, report back for further instructions.
Re: How to make weapon 'Shoot' animation faster
There is only playselectivefiring. Not any playselectivefire. There are many strings of codes. Do you want me to copy them all
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
OK.Done. I've copied it till function weapon.uc. now what sould i do ?
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
Hmm, are you sure?
To clarify:
If you're still confused, paste one of your weapon classes that you intend to modify here.
To clarify:
Code: Select all
//Copy this function from DeusExWeapon.uc
Simulated Function PlaySelectiveFiring()
{
//approximately 60 lines of code
//makes up this function
//everything between the first opening bracket
//and it's matching closing bracket
//along with the function declaration itself
}
//Copy end
//The next function and everything after it should NOT be copied.
function PlayFiringSound()
{
}
Re: How to make weapon 'Shoot' animation faster
//=============================================================================
// WeaponFiveSeven.
//=============================================================================
class WeaponFiveSeven extends DeusExWeapon;
simulated function FiveSevenSelectSound()
{
Owner.PlaySound(Sound'MP5S.FiveSevenSelect', SLOT_None,,, 1024);
}
simulated function FiveSevenClipOut()
{
Owner.PlaySound(Sound'MP5S.FiveSevenReloadBegin', SLOT_None,,, 1024);
}
simulated function FiveSevenClipIn()
{
Owner.PlaySound(Sound'MP5S.FiveSevenReloadEnd', SLOT_None,,, 1024);
}
simulated function FiveSevenRelease()
{
Owner.PlaySound(Sound'MP5S.FiveSevenRelease', SLOT_None,,, 1024);
}
simulated function PreBeginPlay()
{
Super.PreBeginPlay();
// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
// Tuned for advanced -> master skill system (Monte & Ricardo's number) client-side
recoilStrength = 0.75;
}
}
defaultproperties
{
LowAmmoWaterMark=6
GoverningSkill=Class'DeusEx.SkillWeaponPistol'
EnviroEffective=ENVEFF_Air
Concealability=CONC_All
ShotTime=0.100000
reloadTime=0.500000
HitDamage=14
maxRange=4800
AccurateRange=2400
BaseAccuracy=0.700000
bHasLaser=True
recoilStrength=0.300000
MinWeaponAcc=0.200000
mpReloadTime=1.000000
mpHitDamage=12
mpBaseAccuracy=0.950000
mpAccurateRange=2000
mpMaxRange=3200
mpReloadCount=12
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.Ammo10mm'
ReloadCount=12
PickupAmmoCount=12
bInstantHit=True
FireOffset=(X=-16.000000,Y=5.000000,Z=11.500000)
shakemag=200.000000
FireSound=Sound'MP5S.Weapons.FiveSevenFire'
Misc1Sound=Sound'MP5S.Weapons.GenericDryfire'
InventoryGroup=196
ItemName="Five-seveN Tactical"
PlayerViewOffset=(X=16.000000,Y=-5.000000,Z=-11.500000)
PlayerViewMesh=LodMesh'MP5S.fiveseven1st'
PickupViewMesh=LodMesh'MP5S.FiveSevenPickup'
ThirdPersonMesh=LodMesh'MP5S.FiveSeven3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconPistol'
largeIcon=Texture'DeusExUI.Icons.LargeIconPistol'
largeIconWidth=46
largeIconHeight=28
Description="A tactical pistol with a laser sight attachment."
beltDescription="Five-seveN"
Mesh=LodMesh'MP5S.FiveSevenPickup'
CollisionRadius=7.000000
CollisionHeight=1.000000
}
// WeaponFiveSeven.
//=============================================================================
class WeaponFiveSeven extends DeusExWeapon;
simulated function FiveSevenSelectSound()
{
Owner.PlaySound(Sound'MP5S.FiveSevenSelect', SLOT_None,,, 1024);
}
simulated function FiveSevenClipOut()
{
Owner.PlaySound(Sound'MP5S.FiveSevenReloadBegin', SLOT_None,,, 1024);
}
simulated function FiveSevenClipIn()
{
Owner.PlaySound(Sound'MP5S.FiveSevenReloadEnd', SLOT_None,,, 1024);
}
simulated function FiveSevenRelease()
{
Owner.PlaySound(Sound'MP5S.FiveSevenRelease', SLOT_None,,, 1024);
}
simulated function PreBeginPlay()
{
Super.PreBeginPlay();
// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
// Tuned for advanced -> master skill system (Monte & Ricardo's number) client-side
recoilStrength = 0.75;
}
}
defaultproperties
{
LowAmmoWaterMark=6
GoverningSkill=Class'DeusEx.SkillWeaponPistol'
EnviroEffective=ENVEFF_Air
Concealability=CONC_All
ShotTime=0.100000
reloadTime=0.500000
HitDamage=14
maxRange=4800
AccurateRange=2400
BaseAccuracy=0.700000
bHasLaser=True
recoilStrength=0.300000
MinWeaponAcc=0.200000
mpReloadTime=1.000000
mpHitDamage=12
mpBaseAccuracy=0.950000
mpAccurateRange=2000
mpMaxRange=3200
mpReloadCount=12
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.Ammo10mm'
ReloadCount=12
PickupAmmoCount=12
bInstantHit=True
FireOffset=(X=-16.000000,Y=5.000000,Z=11.500000)
shakemag=200.000000
FireSound=Sound'MP5S.Weapons.FiveSevenFire'
Misc1Sound=Sound'MP5S.Weapons.GenericDryfire'
InventoryGroup=196
ItemName="Five-seveN Tactical"
PlayerViewOffset=(X=16.000000,Y=-5.000000,Z=-11.500000)
PlayerViewMesh=LodMesh'MP5S.fiveseven1st'
PickupViewMesh=LodMesh'MP5S.FiveSevenPickup'
ThirdPersonMesh=LodMesh'MP5S.FiveSeven3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconPistol'
largeIcon=Texture'DeusExUI.Icons.LargeIconPistol'
largeIconWidth=46
largeIconHeight=28
Description="A tactical pistol with a laser sight attachment."
beltDescription="Five-seveN"
Mesh=LodMesh'MP5S.FiveSevenPickup'
CollisionRadius=7.000000
CollisionHeight=1.000000
}
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: How to make weapon 'Shoot' animation faster
Unfortunately you didn't post that in code tags (or even quotation tags) and so the formatting is destroyed, but never mind. It's only relevant to readability.
Just copy paste this over your whole FiveSeven class, overwriting the existing code. Back up the WeaponFiveSeven.uc file beforehand just in case.
----
Now to actually increase the speed of the animation you just need to modify this bit:
As the Five Seven is not a fully automatic weapon, you need to modify the PlayAnim call (play animation once), not LoopAnim (loop animation indefinitely).
This is twice as fast firing animation speed:
Note the only thing different is the change in one single number, increased by one.
As a general guideline, 1=default animation speed. 2= Twice as fast animation speed 0.5 = half as fast. You'll probably not want to go higher than 1.5 (+50% speed) to save the animation from looking bad.
This will only apply to your five seven. You'll need to take the PlaySelectiveFiring() function and paste it to all your weapon classes, and modify the anim rates individually for each weapon. Which is good, as some you may want to fire faster or slower than others.
An alternative method is to no longer have firing speed tied to the animation, but that is more involved.
Just copy paste this over your whole FiveSeven class, overwriting the existing code. Back up the WeaponFiveSeven.uc file beforehand just in case.
Code: Select all
//=============================================================================
// WeaponFiveSeven.
//=============================================================================
class WeaponFiveSeven extends DeusExWeapon;
simulated function PlaySelectiveFiring()
{
local Pawn aPawn;
local float rnd;
local Name anim;
anim = 'Shoot';
if (bHandToHand)
{
rnd = FRand();
if (IsA('WeaponHideAGun'))
anim = 'Shoot';
else if (rnd < 0.33)
anim = 'Attack';
else if (rnd < 0.66)
anim = 'Attack2';
else
anim = 'Attack3';
}
if (anim == '')
return;
if (( Level.NetMode == NM_Standalone ))
{
if (bAutomatic)
LoopAnim(anim,1, 0.1);
else
PlayAnim(anim,1, 0.1);
}
else if ( Role == ROLE_Authority )
{
for ( aPawn = Level.PawnList; aPawn != None; aPawn = aPawn.nextPawn )
{
if ( aPawn.IsA('DeusExPlayer') && ( DeusExPlayer(Owner) != DeusExPlayer(aPawn) ) )
{
// If they can't see the weapon, don't bother
if ( DeusExPlayer(aPawn).FastTrace( DeusExPlayer(aPawn).Location, Location ))
DeusExPlayer(aPawn).ClientPlayAnimation( Self, anim, 0.1, bAutomatic );
}
}
}
}
simulated function FiveSevenSelectSound()
{
Owner.PlaySound(Sound'MP5S.FiveSevenSelect', SLOT_None,,, 1024);
}
simulated function FiveSevenClipOut()
{
Owner.PlaySound(Sound'MP5S.FiveSevenReloadBegin', SLOT_None,,, 1024);
}
simulated function FiveSevenClipIn()
{
Owner.PlaySound(Sound'MP5S.FiveSevenReloadEnd', SLOT_None,,, 1024);
}
simulated function FiveSevenRelease()
{
Owner.PlaySound(Sound'MP5S.FiveSevenRelease', SLOT_None,,, 1024);
}
simulated function PreBeginPlay()
{
Super.PreBeginPlay();
// If this is a netgame, then override defaults
if ( Level.NetMode != NM_StandAlone )
{
HitDamage = mpHitDamage;
BaseAccuracy = mpBaseAccuracy;
ReloadTime = mpReloadTime;
AccurateRange = mpAccurateRange;
MaxRange = mpMaxRange;
ReloadCount = mpReloadCount;
// Tuned for advanced -> master skill system (Monte & Ricardo's number) client-side
recoilStrength = 0.75;
}
}
defaultproperties
{
LowAmmoWaterMark=6
GoverningSkill=Class'DeusEx.SkillWeaponPistol'
EnviroEffective=ENVEFF_Air
Concealability=CONC_All
ShotTime=0.100000
reloadTime=0.500000
HitDamage=14
maxRange=4800
AccurateRange=2400
BaseAccuracy=0.700000
bHasLaser=True
recoilStrength=0.300000
MinWeaponAcc=0.200000
mpReloadTime=1.000000
mpHitDamage=12
mpBaseAccuracy=0.950000
mpAccurateRange=2000
mpMaxRange=3200
mpReloadCount=12
bCanHaveModBaseAccuracy=True
bCanHaveModReloadCount=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
bCanHaveModRecoilStrength=True
AmmoName=Class'DeusEx.Ammo10mm'
ReloadCount=12
PickupAmmoCount=12
bInstantHit=True
FireOffset=(X=-16.000000,Y=5.000000,Z=11.500000)
shakemag=200.000000
FireSound=Sound'MP5S.Weapons.FiveSevenFire'
Misc1Sound=Sound'MP5S.Weapons.GenericDryfire'
InventoryGroup=196
ItemName="Five-seveN Tactical"
PlayerViewOffset=(X=16.000000,Y=-5.000000,Z=-11.500000)
PlayerViewMesh=LodMesh'MP5S.fiveseven1st'
PickupViewMesh=LodMesh'MP5S.FiveSevenPickup'
ThirdPersonMesh=LodMesh'MP5S.FiveSeven3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconPistol'
largeIcon=Texture'DeusExUI.Icons.LargeIconPistol'
largeIconWidth=46
largeIconHeight=28
Description="A tactical pistol with a laser sight attachment."
beltDescription="Five-seveN"
Mesh=LodMesh'MP5S.FiveSevenPickup'
CollisionRadius=7.000000
CollisionHeight=1.000000
}
Now to actually increase the speed of the animation you just need to modify this bit:
Code: Select all
if (( Level.NetMode == NM_Standalone ))
{
if (bAutomatic)
LoopAnim(anim,1, 0.1);
else
PlayAnim(anim,1, 0.1);
}
This is twice as fast firing animation speed:
Code: Select all
if (( Level.NetMode == NM_Standalone ))
{
if (bAutomatic)
LoopAnim(anim,1, 0.1);
else
PlayAnim(anim,2, 0.1);
}
As a general guideline, 1=default animation speed. 2= Twice as fast animation speed 0.5 = half as fast. You'll probably not want to go higher than 1.5 (+50% speed) to save the animation from looking bad.
This will only apply to your five seven. You'll need to take the PlaySelectiveFiring() function and paste it to all your weapon classes, and modify the anim rates individually for each weapon. Which is good, as some you may want to fire faster or slower than others.
An alternative method is to no longer have firing speed tied to the animation, but that is more involved.
Re: How to make weapon 'Shoot' animation faster
Gee, thanks, really worked. Hey, can I ask you something ? Where did you learn this weapon coding ?