How did they manage to use this custom weaponpack

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
Kelkos
UNATCO
Posts: 214
Joined: Fri Oct 28, 2016 12:54 pm

How did they manage to use this custom weaponpack

Post 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;
	}
}
Being a soldier isn't just following orders, it's following those orders in the service of a higher cause. When that cause is betrayed, we're not soldiers anymore, just pieces on a chess board dying for the wrong reason.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How did they manage to use this custom weaponpack

Post 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()
User avatar
Kelkos
UNATCO
Posts: 214
Joined: Fri Oct 28, 2016 12:54 pm

Re: How did they manage to use this custom weaponpack

Post 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 ?
Being a soldier isn't just following orders, it's following those orders in the service of a higher cause. When that cause is betrayed, we're not soldiers anymore, just pieces on a chess board dying for the wrong reason.
jameseso113
NSF
Posts: 67
Joined: Mon Dec 04, 2023 10:35 am

Re: How did they manage to use this custom weaponpack

Post by jameseso113 »

That i taken aback when using the exploration everyone intended to get this to selected present astounding. Terrific process! απαιτήσεις evisa της Ινδίας από το Ισραήλ
oggy12
UNATCO
Posts: 195
Joined: Mon Dec 18, 2023 10:48 am

Re: How did they manage to use this custom weaponpack

Post 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
jameseso113
NSF
Posts: 67
Joined: Mon Dec 04, 2023 10:35 am

Re: How did they manage to use this custom weaponpack

Post 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
oggy12
UNATCO
Posts: 195
Joined: Mon Dec 18, 2023 10:48 am

Re: How did they manage to use this custom weaponpack

Post 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. 土耳其 大使馆在荷兰
jameseso113
NSF
Posts: 67
Joined: Mon Dec 04, 2023 10:35 am

Re: How did they manage to use this custom weaponpack

Post 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
zirdukukko
UNATCO
Posts: 216
Joined: Wed Dec 06, 2023 7:42 am

Re: How did they manage to use this custom weaponpack

Post 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
zirdukukko
UNATCO
Posts: 216
Joined: Wed Dec 06, 2023 7:42 am

Re: How did they manage to use this custom weaponpack

Post 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
Post Reply