DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[Code] Controlling Weapons Rate of Fire
Page 1 of 1
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 22 Jun 2019

Topics: 56
Posts: 2230
Location: Canada
blank.gif

PostPosted: Sat Nov 29, 2003 1:36 am
   Subject: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Woah, you already figured out how to change the sequence of animation and the damage caused? You're pretty smart man! Here's an easy way to limit the rate of fire for the machine gun. In WL_AGENT.C, change this line (under the "change frame and fire" comment) of T_Attack():

::: CODE :::
gamestate.attackcount -= tics;

To this:

::: CODE :::
if (gamestate.weapon != 2 || gamestate.TimeCount%4 != 0)
   gamestate.attackcount -= tics;

Replacing the "4" in TimeCount to something lower makes it go slower... or to something higher makes it go closer to it's original settings (range is 2 to infinity). To make it go even slower than 2 (half the speed), change the part of the function that says "!= 0" to "==0"; which will make %3 really be 1/3 the speed, %4 become 1/4 the speed (instead %3 being 2/3 the speed, %4 being 3/4; as originally with "!=0").

If you want to also adjust how slow the gun reloads after each ammo clip is shot, just replace this section near the bottom of the T_Attack() function:

::: CODE :::
case 3:
   if (gamestate.ammo && buttonstate[bt_attack])
      gamestate.attackframe -= 2;
   break;

With something like this (the higher the number "5" is, the slower it reloads):

::: CODE :::
case 3:
   if (gamestate.ammo && buttonstate[bt_attack])
   {
      gamestate.attackcount += 5;
      gamestate.attackframe -= 2;
   }
   break;

I know, it's pretty simple - but it works! You can play around with both areas (the initial speed, and the reloading speed) to see which Rate of Fire works best for you. Have fun! Smile
Guest




Last Visit:





PostPosted: Tue Jul 06, 2004 3:12 pm
   Subject: Re: [Help] Weapons - Changing Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You can change any weapon's fire speed like this...


::: CODE :::
1) Open up WL_AGENT.C.

2) Search for attackinfo.

3) You'll see this:

attackinfo[4][14] =

{
{ {6,0,1},{6,2,2},{6,0,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,0,3},{6,-1,4} },    
{ {6,0,1},{6,1,2},{6,3,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,4,3},{6,-1,4} },
};

4) change the line I've marked in blue to look like this:

{ {6,0,1},{6,1,2},{6,3,3},{6,-1,4} },

The pistol will be as fast as the machinegun.

You see, each one of these lines controls the behavior of a weapon. The first one is the knife, the second one is the pistol, and so on.

Another thing you can do to make a weapon faster is to change the "6" in something like "{6,0,1}" to a smaller number like "3." The first number in {#,#,#} controls the time it takes to change the firing frame.


You want to make the Pistrol faster, right? Try this:

Change { {6,0,1},{6,1,2},{6,0,3},{6,-1,4} }, to

{{6,0,1},{6,1,2},{6,3,3},{6,-1,4} },

That should make the chaingun shoot twice as fast. The reason why changing the "4" to a "5" won't work is because that only refers to a case function in the code. The first "3" in {6,3,3} tells the machinegun to keep shooting one bullet as long as CTRL is held, and the "4" in {6,4,3} tells the chaingun to keep shooting 2 bullets as long as CTRL is held. The "6" is the amount of time for each firing frame, so changing that to "3" makes it shoot faster.


That's all you need is chamge the speed of fire. look easy as simple....

I learned them from WSJ after I received it from either his email or PM (don't remember}
which I used it for my project.
TheManOfTheSilverPistol
Can I Play Daddy
Can I Play Daddy


Joined: 30 Mar 2019
Last Visit: 18 Jun 2019

Topics: 14
Posts: 36
Location: Spain/Espaņa
spain.gif

PostPosted: Sun Jun 02, 2019 3:48 am
   Subject: Re: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Is it possible to make a weapon that will shoot faster than the chaingun?
Wolf3DGuy
I am Death Incarnate
I am Death Incarnate


Joined: 01 Aug 2017
Last Visit: 11:11 ago.

Topics: 5
Posts: 176

blank.gif

PostPosted: Sun Jun 02, 2019 4:20 am
   Subject: Re: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow, a 15 years old thread.

Yes it is possible, in wl_agent arount the top of the file you will see 4 rows of brackets, each brackets contains 3 values, one of them is the frame change speed, that will make your weapon to shoot faster. I had to open up a wl_agent file, wasn't sure which value need to be changed, but reading it, its the first value, note if you want your weapon to shoot faster you need to give a lower value, if you give a higher value your weapon will be slower. Hope this will help.
TheManOfTheSilverPistol
Can I Play Daddy
Can I Play Daddy


Joined: 30 Mar 2019
Last Visit: 18 Jun 2019

Topics: 14
Posts: 36
Location: Spain/Espaņa
spain.gif

PostPosted: Sun Jun 02, 2019 5:08 am
   Subject: Re: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You mean the attack info?
Wolf3DGuy
I am Death Incarnate
I am Death Incarnate


Joined: 01 Aug 2017
Last Visit: 11:11 ago.

Topics: 5
Posts: 176

blank.gif

PostPosted: Sun Jun 02, 2019 5:24 am
   Subject: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes, that little thing.

Basically these lines:

::: CODE :::

{ {6,0,1},{6,2,2},{6,0,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,0,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,3,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,4,3},{6,-1,4} },


EDIT 1: I wonder why the code stuff don't want to work properly... Confused
EDIT 2: Got it to work.
TheManOfTheSilverPistol
Can I Play Daddy
Can I Play Daddy


Joined: 30 Mar 2019
Last Visit: 18 Jun 2019

Topics: 14
Posts: 36
Location: Spain/Espaņa
spain.gif

PostPosted: Sun Jun 02, 2019 5:43 am
   Subject: Re: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Okay, that nice to known, so if i want to make a weapon that shoots more faster than the machine gun, but less faster than the chaingun, the code should be this? --> {6,0,1},{6,1,2},{6,3,4},{6,-1,4}
Wolf3DGuy
I am Death Incarnate
I am Death Incarnate


Joined: 01 Aug 2017
Last Visit: 11:11 ago.

Topics: 5
Posts: 176

blank.gif

PostPosted: Sun Jun 02, 2019 5:50 am
   Subject: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No, the first value is the speed of the frames, if you want your new weapon to shoot faster that the machinegun but slower than the chaingun I'd say try something like this:

::: CODE :::

{ {6,0,1},{6,1,2},{6,3,3},{6,-1,4} }, // machinegun
{ {5,0,1},{5,1,2},{5,3(or 4),3},{5,-1,4} }, // new gun
{ {4,0,1},{4,1,2},{4,4,3},{4,-1,4} }, // chaingun
TheManOfTheSilverPistol
Can I Play Daddy
Can I Play Daddy


Joined: 30 Mar 2019
Last Visit: 18 Jun 2019

Topics: 14
Posts: 36
Location: Spain/Espaņa
spain.gif

PostPosted: Sun Jun 02, 2019 5:53 am
   Subject: Re: [Code] Controlling Weapons Rate of Fire
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Okey, Thanks you, I Will try this today.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Blood Splatz Tutorial - Blood Splatters
Author: Dugtrio17
45 16622 Tue Mar 11, 2008 12:02 am
AlumiuN View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 3278 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 2411 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 2713 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 3624 Sun Oct 26, 2003 1:21 am
Guest View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group