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       

Making a fifth weapon jam
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers 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
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 8:56 ago.

Topics: 70
Posts: 3693

blank.gif

PostPosted: Fri Dec 29, 2017 6:28 am
   Subject: Making a fifth weapon jam
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

http://www.wolfenstein3d.co.uk/coding-jamming.htm

This tutorial makes your chaingun jam at random times, losing it in the process. But say that I wanted to add this jamming feature to a different, new fifth weapon. Where would I add this? Since the fifth weapon doesn't have a case like the chaingun.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 3:47 ago.

Topics: 161
Posts: 8033
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri Dec 29, 2017 11:28 am
   Subject: Re: Making a fifth weapon jam
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The "4" that you see appear in the updated code first shows up in WL_AGENT.CPP ... almost at the very top. You should see an array of numbers for the weapons, and it looks something like this:
::: CODE :::
} 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} },
    { {6,0,1},{6,1,2},{6,5,3},{6,-1,4} },
};

Note how each set of numbers is grouped together into three numbers. The "4" in question is the middle number. Whenever that number is called up, that's when the "jamming" code is called up.
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 8:56 ago.

Topics: 70
Posts: 3693

blank.gif

PostPosted: Fri Dec 29, 2017 1:26 pm
   Subject: Re: Making a fifth weapon jam
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Thanks, Tricob! For those interested, in T_Attack add a case like this (if your new weapon isn't chaingun-like):

::: CODE :::
            case 5:
                if (!gamestate.ammo)
                    break;
                if (US_RndT()<63)    // Approximately 1 in 4 chance of it jamming
                {
                    if (US_RndT()<65)
                    {
                        SD_PlaySound(TAKEDAMAGESND);// choose a sound
                        buttonstate[bt_attack] = false;
// IN_ClearKeysDown ();
                        gamestate.attackframe = gamestate.weaponframe = 0;
                        gamestate.bestweapon = gamestate.chosenweapon = gamestate.weapon = wp_chaingun;     // Switch to chaingun
                        DrawWeapon ();
                        break;
                    }
                }
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers 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 Sticky: [Tutorial] Compiling Wolf4SDL with Code::Blocks
Author: dcbasic
90 18092 Wed May 24, 2017 7:53 pm
Falcon*93 View latest post
No new posts [HELP] Different ammo types.
Author: Raziel
15 1707 Thu Jan 01, 2009 4:45 am
Raziel View latest post
No new posts [help] making videos of SDL mods
Author: lilmanjs
15 1715 Mon Sep 22, 2008 2:21 pm
Zombie_Plan View latest post
No new posts [help] Weapon shooting rockets
Author: RichterBelmont12
13 1467 Wed Aug 06, 2008 3:22 am
Zombie_Plan View latest post
No new posts [Help] Adding a weapon problem
Author: Zombie_Plan
10 1537 Thu Jul 24, 2008 4:26 pm
RichterBelmont12 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