How to make weapon 'Shoot' animation faster

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

Gee, thanks, really worked. Hey, can I ask you something ? Where did you learn this weapon coding ?
https://www.codecademy.com/

I started here and took the Javascript course to completion, then transitioned to UnrealScript. Also had minor programming experience before the fact. All in all it's taken five years to get on my level, to be able to do things like this: https://www.youtube.com/watch?v=rKHPtfammNY
It's a big investment so don't bother unless you're truly dedicated.

Unrealscript is a dead language. It was wise to learn a language that is not dead, but is quite like it. Some would say C++ is closer than Javascript, but there you have to fuck around with the libraries and memory management. There's none of that with Unrealscript thankfully.
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

Excellent ! I've always ranked GMDX as my number one mod. Next to 2027. The flesh fragments, the bullet puffs. How to you make this. I've tried making bullet puffs, but cant seem to but it. I've made a class under effects. But how shall I implement in into the game. And I've made my different classes for flesh fragments. How can I also put them In. GMDX, however is a nice mod. I've always loved those serene streets of Paris.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

There is no simple how to guide. Just lots of learning and trial & error.

Why not upload the package as an add-on to GMDX? That way you get those 2027 weapons with GMDX's hundreds of weaponry improvements, rather than the shitty vanilla behavior.
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

Good Idea ! I managed to try some of the weapons. Very unsuccessful. Firing fates , muzzle flashes and various other errors such as effects and animations have clogged up the weapon's realism. You must've worked hard implementing these effects, but sadly it's incompatible with GMDX. My deepest apologies. The file is 200 megabytes. You must've had 2027, I'm sure of it. So go into system and locate a file called MP5S.u. Put in into Unreal Editor and you're good to go. It's just that GMDX is rather sophisticated for it's engine and unfortunately it's incompatible. I know you have 2027. So follow the instructions above and you can have your fully customized weapon pack. Just credit a person named 'Milennia' of course.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

SkrillaX wrote:Good Idea ! I managed to try some of the weapons. Very unsuccessful. Firing fates , muzzle flashes and various other errors such as effects and animations have clogged up the weapon's realism. You must've worked hard implementing these effects, but sadly it's incompatible with GMDX. My deepest apologies. The file is 200 megabytes. You must've had 2027, I'm sure of it. So go into system and locate a file called MP5S.u. Put in into Unreal Editor and you're good to go. It's just that GMDX is rather sophisticated for it's engine and unfortunately it's incompatible. I know you have 2027. So follow the instructions above and you can have your fully customized weapon pack. Just credit a person named 'Milennia' of course.
Incompatible how? Technically? No. Artistically, yes, but that's why it would be a community-made add-on and not officially supported.
I can guide you to fix each technical issue, as they're undoubtedly minor.

Up to you of course.
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

I'm just saying that GMDX is really advanced and sophisticated for this pack that some of these weapons are incompatible
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

It wasn't ready for GMDX's coding and thus failed. It works with vanilla deus ex just fine
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

Alright, well...happy MJ12 slaying.
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

How can I spawn those sweet bullet smoke puffs in gmdx. I've make a hitpuff class under effects, but How can I implement it. Is there a way to edit deusexweapon.u
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

Is there some kind of code that needs to spawn with the hitmuzzle ?
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

Make TraceHitSpawner.uc spawn your class. Or if you're not modifying DeusEx.u, hook it in with spawnNotify as hanfling showed you with flesh fragments.
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

//=============================================================================
// TraceHitSpawner class so we can reduce nettraffic for hitspangs
//=============================================================================
class TraceHitSpawner extends Actor;

var float HitDamage;
var bool bPenetrating; // shot that hit was a penetrating shot
var bool bHandToHand; // shot that hit was hand to hand
var bool bInstantHit;
var Name damageType;

simulated function PostBeginPlay()
{
Super.PostBeginPlay();

if (Owner == None)
SetOwner(Level);
SpawnEffects(Owner,HitDamage);
}

simulated function Timer()
{
Destroy();
}

//
// we have to use an actor to play the hit sound at the correct location
//
simulated function PlayHitSound(actor destActor, Actor hitActor)
{
local float rnd;
local sound snd;

// don't ricochet unless it's hit by a bullet
if ((damageType != 'Shot') && (damageType != 'Sabot'))
return;

rnd = FRand();

if (rnd < 0.25)
snd = sound'Ricochet1';
else if (rnd < 0.5)
snd = sound'Ricochet2';
else if (rnd < 0.75)
snd = sound'Ricochet3';
else
snd = sound'Ricochet4';

// play a different ricochet sound if the object isn't damaged by normal bullets
if (hitActor != None)
{
if (hitActor.IsA('DeusExDecoration') && (DeusExDecoration(hitActor).minDamageThreshold > 10))
snd = sound'ArmorRicochet';
else if (hitActor.IsA('Robot'))
snd = sound'ArmorRicochet';
}
if (destActor != None)
destActor.PlaySound(snd, SLOT_None,,, 1024, 1.1 - 0.2*FRand());
}

simulated function SpawnEffects(Actor Other, float Damage)
{
local SmokeTrail puff;
local int i;
local BulletHole hole;
local RockChip chip;
local Rotator rot;
local DeusExMover mov;
local Spark spark;

SetTimer(0.1,False);
if (Level.NetMode == NM_DedicatedServer)
return;

if (bPenetrating && !bHandToHand && !Other.IsA('DeusExDecoration'))
{
// Every hit gets a puff in multiplayer
if ( Level.NetMode != NM_Standalone )
{
puff = spawn(class'Hitpuff1',,,Location+(Vector(Rotation)*1.5), Rotation);
if ( puff != None )
{
puff.DrawScale = 1.0;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = 1.0;
puff.OrigLifeSpan = puff.LifeSpan;
puff.RemoteRole = ROLE_None;
}
}
else
{
if (FRand() < 0.5)
{
puff = spawn(class'Hitpuff2',,,Location+Vector(Rotation), Rotation);
if (puff != None)
{
puff.DrawScale *= 1.0;
puff.OrigScale = puff.DrawScale;
puff.LifeSpan = 1.0;
puff.OrigLifeSpan = puff.LifeSpan;
puff.RemoteRole = ROLE_None;
}
}
}
if (!Other.IsA('DeusExMover'))
for (i=0; i<2; i++)
if (FRand() < 0.8)
{
chip = spawn(class'Rockchip',,,Location+Vector(Rotation));
if (chip != None)
chip.RemoteRole = ROLE_None;
}
}

if ((!bHandToHand) && bInstantHit && bPenetrating)
{
hole = spawn(class'BulletHole', Other,, Location+Vector(Rotation), Rotation);
if (hole != None)
hole.RemoteRole = ROLE_None;

if ( !Other.IsA('DeusExPlayer') ) // Sparks on people look bad
{
spark = spawn(class'Spark',,,Location+Vector(Rotation), Rotation);
if (spark != None)
{
spark.RemoteRole = ROLE_None;
if ( Level.NetMode != NM_Standalone )
spark.DrawScale = 0.25;
else
spark.DrawScale = 0.05;
PlayHitSound(spark, Other);
}
}
}

// draw the correct damage art for what we hit
if (bPenetrating || bHandToHand)
{
if (Other.IsA('DeusExMover'))
{
mov = DeusExMover(Other);
if ((mov != None) && (hole == None))
{
hole = spawn(class'BulletHole', Other,, Location+Vector(Rotation), Rotation);
if (hole != None)
hole.remoteRole = ROLE_None;
}

if (hole != None)
{
if (mov.bBreakable && (mov.minDamageThreshold <= Damage))
{
// don't draw damage art on destroyed movers
if (mov.bDestroyed)
hole.Destroy();
else if (mov.FragmentClass == class'GlassFragment')
{
// glass hole
if (FRand() < 0.5)
hole.Texture = Texture'FlatFXTex29';
else
hole.Texture = Texture'FlatFXTex30';

hole.DrawScale = 0.1;
hole.ReattachDecal();
}
else
{
// non-glass crack
if (FRand() < 0.5)
hole.Texture = Texture'FlatFXTex7';
else
hole.Texture = Texture'FlatFXTex8';

hole.DrawScale = 0.4;
hole.ReattachDecal();
}
}
else
{
if (!bPenetrating || bHandToHand)
hole.Destroy();
}
}
}
}
}

defaultproperties
{
HitDamage=-1.000000
bPenetrating=True
bInstantHit=True
RemoteRole=ROLE_None
DrawType=DT_None
bGameRelevant=True
CollisionRadius=0.000000
CollisionHeight=0.000000
}







Notice the HitPuff1 and HitPuff2 if there are any mistakes please let me know
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

Post it again and this time put it in code tags so that the formatting is not destroyed.
SkrillaX
NSF
Posts: 86
Joined: Sun Oct 02, 2016 4:43 am

Re: How to make weapon 'Shoot' animation faster

Post by SkrillaX »

Code: Select all

//=============================================================================
// TraceHitSpawner class so we can reduce nettraffic for hitspangs
//=============================================================================
class TraceHitSpawner extends Actor;

var float HitDamage;
var bool bPenetrating; // shot that hit was a penetrating shot
var bool bHandToHand;  // shot that hit was hand to hand
var bool bInstantHit;
var Name damageType;

simulated function PostBeginPlay()
{
   Super.PostBeginPlay();
   
   if (Owner == None)
      SetOwner(Level);
   SpawnEffects(Owner,HitDamage);
}

simulated function Timer()
{
   Destroy();
}

//
// we have to use an actor to play the hit sound at the correct location
//
simulated function PlayHitSound(actor destActor, Actor hitActor)
{
	local float rnd;
	local sound snd;

	// don't ricochet unless it's hit by a bullet
	if ((damageType != 'Shot') && (damageType != 'Sabot'))
		return;

	rnd = FRand();

	if (rnd < 0.25)
		snd = sound'Ricochet1';
	else if (rnd < 0.5)
		snd = sound'Ricochet2';
	else if (rnd < 0.75)
		snd = sound'Ricochet3';
	else
		snd = sound'Ricochet4';

	// play a different ricochet sound if the object isn't damaged by normal bullets
	if (hitActor != None) 
	{
		if (hitActor.IsA('DeusExDecoration') && (DeusExDecoration(hitActor).minDamageThreshold > 10))
			snd = sound'ArmorRicochet';
		else if (hitActor.IsA('Robot'))
			snd = sound'ArmorRicochet';
	}
	if (destActor != None)
		destActor.PlaySound(snd, SLOT_None,,, 1024, 1.1 - 0.2*FRand());
}

simulated function SpawnEffects(Actor Other, float Damage)
{
   local SmokeTrail puff;
   local int i;
   local BulletHole hole;
   local RockChip chip;
   local Rotator rot;
   local DeusExMover mov;
	local Spark		spark;

   SetTimer(0.1,False);
   if (Level.NetMode == NM_DedicatedServer)
      return;

	if (bPenetrating && !bHandToHand && !Other.IsA('DeusExDecoration'))
	{
		// Every hit gets a puff in multiplayer
		if ( Level.NetMode != NM_Standalone )
		{
			puff = spawn(class'Hitpuff1',,,Location+(Vector(Rotation)*1.5), Rotation);
			if ( puff != None )
			{
				puff.DrawScale = 1.0;
				puff.OrigScale = puff.DrawScale;
				puff.LifeSpan = 1.0;
				puff.OrigLifeSpan = puff.LifeSpan;
            puff.RemoteRole = ROLE_None;
			}
		}
		else
		{
			if (FRand() < 0.5)
			{
				puff = spawn(class'Hitpuff2',,,Location+Vector(Rotation), Rotation);
				if (puff != None)
				{
					puff.DrawScale *= 1.0;
					puff.OrigScale = puff.DrawScale;
					puff.LifeSpan = 1.0;
					puff.OrigLifeSpan = puff.LifeSpan;
               puff.RemoteRole = ROLE_None;
				}
			}
		}
     if (!Other.IsA('DeusExMover'))
         for (i=0; i<2; i++)
            if (FRand() < 0.8)
            {
               chip = spawn(class'Rockchip',,,Location+Vector(Rotation));
               if (chip != None)
                  chip.RemoteRole = ROLE_None;
            }
	}

   if ((!bHandToHand) && bInstantHit && bPenetrating)
	{
      hole = spawn(class'BulletHole', Other,, Location+Vector(Rotation), Rotation);
      if (hole != None)      
         hole.RemoteRole = ROLE_None;

		if ( !Other.IsA('DeusExPlayer') )		// Sparks on people look bad
		{
			spark = spawn(class'Spark',,,Location+Vector(Rotation), Rotation);
			if (spark != None)
			{
				spark.RemoteRole = ROLE_None;
				if ( Level.NetMode != NM_Standalone )
					spark.DrawScale = 0.25;
				else
					spark.DrawScale = 0.05;
				PlayHitSound(spark, Other);
			}
		}
	}

	// draw the correct damage art for what we hit
	if (bPenetrating || bHandToHand)
	{
		if (Other.IsA('DeusExMover'))
		{
			mov = DeusExMover(Other);
			if ((mov != None) && (hole == None))
         {
            hole = spawn(class'BulletHole', Other,, Location+Vector(Rotation), Rotation);
            if (hole != None)
               hole.remoteRole = ROLE_None;
         }

			if (hole != None)
			{
				if (mov.bBreakable && (mov.minDamageThreshold <= Damage))
				{
					// don't draw damage art on destroyed movers
					if (mov.bDestroyed)
						hole.Destroy();
					else if (mov.FragmentClass == class'GlassFragment')
					{
						// glass hole
						if (FRand() < 0.5)
							hole.Texture = Texture'FlatFXTex29';
						else
							hole.Texture = Texture'FlatFXTex30';

						hole.DrawScale = 0.1;
						hole.ReattachDecal();
					}
					else
					{
						// non-glass crack
						if (FRand() < 0.5)
							hole.Texture = Texture'FlatFXTex7';
						else
							hole.Texture = Texture'FlatFXTex8';

						hole.DrawScale = 0.4;
						hole.ReattachDecal();
					}
				}
				else
				{
					if (!bPenetrating || bHandToHand)
						hole.Destroy();
				}
			}
		}
	}
}

defaultproperties
{
     HitDamage=-1.000000
     bPenetrating=True
     bInstantHit=True
     RemoteRole=ROLE_None
     DrawType=DT_None
     bGameRelevant=True
     CollisionRadius=0.000000
     CollisionHeight=0.000000
}
[code]
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: How to make weapon 'Shoot' animation faster

Post by Cybernetic pig »

You missed the forward slash in the closing code tag
Post Reply