Page 1 of 1

How did they manage to use this custom weaponpack

Posted: Tue Dec 20, 2016 6:33 am
by Kelkos
Hi! I imported a clysms weapon pack into deus ex. Seems a LOT buggy when weapon refiring and shooting animations. How did THEY make use of this, I have a weapon, WeaponAutoRifle. Is there some king of code I should insert in deusexweapon.u to make sure that it fires correctly, and doesn't have some kind of delay,

I want the weapon to fire without delay after every single shot. Like the code I'm posting, the gun fires after quite some delay , but is there a code I can insert in DeusExWeapon.u to make it fire after every single shot. Also, when a pawn fires it, the muzzle flash disappears. Whereas when the player fires it, it appears. I made a custom muzzle flash sprite and implemented it.

Code: Select all

//=============================================================================
// WeaponAutoRifle. 
//=============================================================================
class WeaponAutoRifle extends GESWeapon;

var float	mpRecoilStrength;

simulated state ClientFiring
{
Begin:
	if ((ClipCount >= ReloadCount) && (ReloadCount != 0))
	{
		if (!bAutomatic)
		{
			bFiring = False;
			FinishAnim();
		}
		if (Owner != None)
		{
			if (Owner.IsA('DeusExPlayer'))
			{
				bFiring = False;
				if (DeusExPlayer(Owner).bAutoReload)
				{
					bClientReadyToFire = False;
					bInProcess = False;
					if ((AmmoType.AmmoAmount == 0) && (AmmoName != AmmoNames[0]))
						CycleAmmo();
					ReloadAmmo();
					GotoState('SimQuickFinish');
				}
				else
				{
					if (bHasMuzzleFlash)
						EraseMuzzleFlashTexture();
					IdleFunction();
					GotoState('SimQuickFinish');
				}
			}
			else if (Owner.IsA('ScriptedPawn'))
			{
				bFiring = False;
			}
		}
		else
		{
			if (bHasMuzzleFlash)
				EraseMuzzleFlashTexture();
			IdleFunction();
			GotoState('SimQuickFinish');
		}
	}
	Sleep(GetSimShotTime());
	if (bAutomatic)
	{
		SimGenerateBullet();
		Goto('Begin');
	}
	bFiring = False;
	if(Pawn(Owner)!=None)
    {
       if(Pawn(Owner).bFire==0)
       {
          FinishAnim();
       }
    }
	bInProcess = False;
Done:
	bInProcess = False;
	bFiring = False;
	SimFinish();
}



simulated function PlaySelectiveFiring()
{
   local Pawn aPawn;
   local float rnd;
   local Name anim;

   anim = 'Shoot';

   if (DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn()))
   {
      PlayAnim('Shoot',,0.00);
   }
}

state NormalFire
{
   function float GetShotTime()
   {
      local float mult, sTime;

      if (ScriptedPawn(Owner) != None)
         return ShotTime * (ScriptedPawn(Owner).BaseAccuracy*2+1);
      else
      {
         // AugCombat decreases shot time
         mult = 1.0;
         if (bHandToHand && DeusExPlayer(Owner) != None)
         {
            mult = 1.0 / DeusExPlayer(Owner).AugmentationSystem.GetAugLevelValue(class'AugCombat');
            if (mult == -1.0)
               mult = 1.0;
         }
         sTime = ShotTime * mult;
         return (sTime);
      }
   }

Begin:
   if ((ClipCount >= ReloadCount) && (ReloadCount != 0))
   {
      if (Owner != None)
      {
         if (Owner.IsA('DeusExPlayer'))
         {
            bFiring = False;

            // should we autoreload?
            if (DeusExPlayer(Owner).bAutoReload)
            {
               // auto switch ammo if we're out of ammo and
               // we're not using the primary ammo
               FinishAnim();
               if ((AmmoType.AmmoAmount == 0) && (AmmoName != AmmoNames[0]))
                  CycleAmmo();
               ReloadAmmo();
            }
            else
            {
               if (bHasMuzzleFlash)
                  EraseMuzzleFlashTexture();
               GotoState('Idle');
            }
         }
         else if (Owner.IsA('ScriptedPawn'))
         {
            bFiring = False;
            ReloadAmmo();
         }
      }
      else
      {
         if (bHasMuzzleFlash)
            EraseMuzzleFlashTexture();
         GotoState('Idle');
      }
   }

   Sleep(GetShotTime());
   bFiring = False;
   if(Pawn(Owner)!=None)
   {
      if(Pawn(Owner).bFire==0)
      {
         FinishAnim();
      }
   }
   ReadyToFire();
Done:
   bFiring = False;
   Finish();
} 

#exec AUDIO IMPORT FILE="Sounds\ak47-1.wav" NAME="AK47Fire" Group="Weapons"
#exec AUDIO IMPORT FILE="Sounds\safety.wav" NAME="SafetyOff" Group="Weapons"
#exec AUDIO IMPORT FILE="Sounds\ak47_boltpull.wav" NAME="AK47BoltPull" Group="Weapons"
#exec AUDIO IMPORT FILE="Sounds\ak47_magin.wav" NAME="AK47MagIn" Group="Weapons"
#exec AUDIO IMPORT FILE="Sounds\ak47_magout.wav" NAME="AK47MagOut" Group="Weapons"
#exec AUDIO IMPORT FILE="Sounds\ak47_magtap.wav" NAME="AK47MagTap" Group="Weapons"

simulated function AK74MagOut()
{
      Owner.PlaySound(Sound'MP5S.AK47MagOut', SLOT_None,,, 1024); 
}

simulated function AK74MagIn()
{
      Owner.PlaySound(Sound'MP5S.AK47MagIn', SLOT_None,,, 1024); 
}

simulated function AK74MagTap()
{
      Owner.PlaySound(Sound'MP5S.AK47MagTap', SLOT_None,,, 1024); 
}

simulated function AK74BoltPull()
{
      Owner.PlaySound(Sound'MP5S.AK47BoltPull', SLOT_None,,, 1024); 
}

simulated function AK74BoltBack()
{
      Owner.PlaySound(Sound'MP5S.DesertEagleUnlock', 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;
	}
}

Re: How did they manage to use this custom weaponpack

Posted: Tue Dec 20, 2016 9:29 am
by Cybernetic pig
Assuming by import you mean you took the weapon package and added it to your system directory:

If all you want is rate of fire increase then in DeusExWeapon.uc edit and add this to PostBeginPlay():

Code: Select all

   if (default.itemName == 'InsertItemNameHere')
   {
       shotTime = YourFloat;
       default.shotTime = YourFloat;
    }
That's providing it isn't the animation that is causing it to shoot slowly. If that's the case then you'll need to modify PlaySelectiveFiring()

Re: How did they manage to use this custom weaponpack

Posted: Tue Dec 20, 2016 11:07 am
by Kelkos
I mean that if I fire in bursts, there is a delay between each burst, e.g, firing the first burst, e.g 4 rounds, then I want to quickly engage another enemy, that's where the delay starts. I you want, you can test the weapon if you know what I mean. Also, If a scriptedpawn fires it, It fires in single shot instead of automatic, and the muzzle flash disappears, does an easy fix exist ?

Re: How did they manage to use this custom weaponpack

Posted: Sat Feb 17, 2024 1:17 pm
by jameseso113
That i taken aback when using the exploration everyone intended to get this to selected present astounding. Terrific process! απαιτήσεις evisa της Ινδίας από το Ισραήλ

Re: How did they manage to use this custom weaponpack

Posted: Mon Feb 19, 2024 12:37 pm
by oggy12
I've got not long ago started off some sort of blog site, the internet people produce here possesses served everyone enormously. Appreciate it intended for all of your current time period & do the job. Diverse bra options

Re: How did they manage to use this custom weaponpack

Posted: Tue Feb 27, 2024 11:26 am
by jameseso113
Thanks a lot pertaining to putting up a real wonderful content! I ran across your web site ideal for our requires. Its content has amazing along with valuable blogposts. Carry on the excellent operate! Security Guard Services NYC

Re: How did they manage to use this custom weaponpack

Posted: Tue Feb 27, 2024 1:04 pm
by oggy12
Concerning a short while ago going your site, the information you actually give on this site includes made it simpler for people considerably. With thanks to get your complete time frame & deliver the results. 土耳其 大使馆在荷兰

Re: How did they manage to use this custom weaponpack

Posted: Sat Mar 02, 2024 12:22 pm
by jameseso113
I went over this website and I believe you have a lot of wonderful information, saved to my bookmarks Mobile & Fast Car locksmiths in Reno

Re: How did they manage to use this custom weaponpack

Posted: Sun Mar 03, 2024 8:16 am
by zirdukukko
You completed a few fine points there. I did a search on the subject and found nearly all persons will go along with with your blog. Drapes And Curtains

Re: How did they manage to use this custom weaponpack

Posted: Mon Mar 04, 2024 7:56 am
by zirdukukko
Wow! This could be one of the most useful blogs we have ever come across on thesubject. Actually excellent info! I’m also an expert in this topic so I can understand your effort. Dryer Vent Cleaning NYC