a bayonet weapon?

Talk about any Deus Ex game modification here, e.g. maps, package or a total conversion.

Moderator: Forum Guards

a bayonet weapon?

Postby Josh_Stargunner » Thu May 03, 07 3:57 pm

hey i was wondering if anybody knows if it is possible to add a melee weapon to an assault rifle, like the grenade launcher that is already on it? because i think it would be cool to have an all pruposes assault rifle which fires bullets, grenades and can stab people with it! if it is possible could you tell me how with a bit of code since i would not know where to start!
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby Cozmo » Thu May 03, 07 5:11 pm

Reminds me of something I was trying to do ages ago, but with the Lancer Chainsaw bayonet. :shock: But it never compiled.

If there was an anim for swinging the gun in first person, it wouldn't be too hard. :)
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby synthetic » Thu May 03, 07 5:15 pm

Perhaps force the weapon to some reloading animation bit and deliver similar sort of hit as crowbar would if enemy is in certain range? Perhaps make separate "ammo" to trigger such attack, I dont know but perhaps its easier than to create a separate mode/button for it.
[TSS][¥]{¥+EoD}{RF}{MoH}[G][NEM][UE][N]{U}[REN][BM][FGS][THC][:¤:]
User avatar
synthetic
Forum Hero
 
Posts: 2918
Joined: Thu Apr 21, 05 4:04 pm
Location: land of green elephants

Postby Cozmo » Thu May 03, 07 5:19 pm

Well, what I (tried) did was make it check for any nearby players on the other team and if they were in range, then they take lots of damage. :D

If anyone wants to look through it:

Code: Select all
function ScopeToggle()
{
   local DeusExPlayer ChainSawed;

   foreach RadiusActors (class 'DeusExPlayer', ChainSawed, 20)
   {
      if(ChainSawed.PlayerReplicationInfo.Team != DeusExPlayer(Owner).PlayerReplicationInfo.Team)
      {
         if(ChainSawed != None)
         {
            ChainSawed.TakeDamage(1000, Pawn(Owner));
         }
      }
   }   
   DeusExPlayer(Owner).PlayAnim('Attack',, 0.4);
}


Was a cheap way of doing it, but oh well.
Last edited by Cozmo on Thu May 03, 07 5:20 pm, edited 1 time in total.
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby Josh_Stargunner » Thu May 03, 07 5:19 pm

i think it could be done with ammo too, i also recall i can modify the damages of each ammo, so i must be able to set the range too. perhaps just give ammo(3) melee ammo and the same range and damage as a combat knife, and sod an animation?
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby synthetic » Thu May 03, 07 5:30 pm

how hard would it be to steal animation frames from existing animation? Or to force the weapon into reloading animation repeatedly and cutting off to early when pressing fire.
[TSS][¥]{¥+EoD}{RF}{MoH}[G][NEM][UE][N]{U}[REN][BM][FGS][THC][:¤:]
User avatar
synthetic
Forum Hero
 
Posts: 2918
Joined: Thu Apr 21, 05 4:04 pm
Location: land of green elephants

Postby Josh_Stargunner » Thu May 03, 07 5:33 pm

true, the reload animation would make sense. i think it is in default properties of a weapon too.
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby Allan » Thu May 03, 07 9:21 pm

ReloadEnd would be your best bet. None of the other animations look like a stabbing motion.

(BTW: I like the idea of a Tommy Gun in DXMP :P)
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Josh_Stargunner » Thu May 03, 07 9:33 pm

hehe thanks allan! there would be a tommygun by now if i knew how to model :P i can import, but not model.
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby clyzm » Thu May 03, 07 9:44 pm

There can be such modes as 'Shoot2' and stuff. :P
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby MrBlackDX » Thu May 03, 07 9:47 pm

~c[A]t~ wrote:There can be such modes as 'Shoot2' and stuff. :P


yeah like altfire

You could make a command like "shootblank" and give it the correct melee coding

of course unless you coded it into your ini, you would have to shoot a lot of blanks by typing it on the server
MrBlackDX
Nobel Peace Prize
 
Posts: 3943
Joined: Sun Dec 19, 04 8:40 pm

Postby Allan » Thu May 03, 07 9:54 pm

I thought we were limited to the anims in AssaultGun, due to this quote:

hey i was wondering if anybody knows if it is possible to add a melee weapon to an assault rifle, like the grenade launcher that is already on it? because i think it would be cool to have an all pruposes assault rifle which fires bullets, grenades and can stab people with it! if it is possible could you tell me how with a bit of code since i would not know where to start!
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Josh_Stargunner » Thu May 03, 07 10:00 pm

sorry, i did not mean to make it sound like that. any animation is good, but the animation is the least of my concerns. i am justwondering right now if it is simple as i have stated already, and i just make a new ammo type, range and damage under (3)
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby Allan » Thu May 03, 07 10:21 pm

Well, so far as I know, the only coding it would need is:

Code: Select all
simulated function PlaySelectiveFiring()
{
   local Pawn aPawn;
   local float rnd;
   local Name anim;

   anim = 'Shoot';

   if (bHandToHand)
   {
      anim = 'ReloadEnd';
   }

   if (( Level.NetMode == NM_Standalone ) || ( DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn())) )
   {
      if (bAutomatic)
         LoopAnim(anim,, 0.1);
      else
         PlayAnim(anim,,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 );
         }
      }
   }
}

function CycleAmmo()
{
   if(AmmoType==class'AmmoNone')
   {
      if (Role == ROLE_Authority)
      {
         Pawn(Owner).Clientmessage(ItemName$" is now in Bayonet mode");
         bHandToHand=True;
         Damage=4;
         MaxRange=80;
         bAutomatic=False;
      }
      bHandToHand=True;
      Damage=4;
      MaxRange=80;
      bAutomatic=False;
   }
   else
   {
      if (Role == ROLE_Authority)
      {
         Pawn(Owner).Clientmessage(ItemName$" is now in Bayonet mode");
         bHandToHand=True;
         Damage=Default.Damage;
         MaxRange=Default.MaxRange;
         bAutomatic=Default.bAutomatic;
      }
      bHandToHand=False;
      Damage=Default.Damage;
      MaxRange=Default.MaxRange;
      bAutomatic=Default.bAutomatic;
      Super.CycleAmmo();
   }
}


Then just change AmmoNames[2] from None to class'DeusEx.AmmoNone'

That should be it, provided it is posted in an AssaultGun based/equivilant code.

Post any problems :D
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Josh_Stargunner » Thu May 03, 07 10:29 pm

would i just stick this at the bottom of the code for the assaultgun?
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby Allan » Thu May 03, 07 11:15 pm

Make a new class under WeaponAssaultGun, call it what you like, and then add that to the bottom of the code window that pops up.

Also, open the Default Properties window for that class, and go to DeusExWeapon>AmmoNames>AmmoNames[2] and change it from None to class'DeusEx.AmmoNone'

Then press F7 to compile, save your file and you're done! :D

(Or if you don't use UnrealEd to compile scripts, add AmmoNames[2]=class'DeusEx.AmmoNone' to the defaultproperties, and compile as normal. Make sure this class extends from WeaponAssaultGun)
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Josh_Stargunner » Fri May 04, 07 10:39 am

okay, i do not usually do it thru UnrealEd but recently when i do uccmake it has a heart attack. when i pushed f7 in unrealed it came up with a lot of instances where it complained about a line saying Damage, which i changed to HitDamage in cases such as

HitDamage=Default.HitDamage;

HitDamage=4;

Now when i changed all of these it compiled successfully but i cannot find the .u file in my system folder anywhere, and when i try to summon it in game it says it does not exist.
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm

Postby Allan » Fri May 04, 07 1:34 pm

Oops... I was thinking Projectiles.. :P

You -did- save the file, right? :P
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Josh_Stargunner » Sat May 05, 07 12:45 am

hehe i will check this and then get back to you, thanks alot!
Don't pick swimming because it's fairly useless!
Josh_Stargunner
Wannabe
 
Posts: 88
Joined: Tue Dec 19, 06 6:24 pm


Return to Modifications

Who is online

Users browsing this forum: No registered users and 5 guests