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       

How do you code additional weapons that use the same routine
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
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sat Nov 17, 2018 2:33 pm
   Subject: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I am trying to code three new weapons into Wolfenstein 3D SDL and I want them to use the same functions and video game damage as the previous three weapons. These new weapons would use 5, 6, and 7 for the key bindings. What is an easy solution to solve this problem? I am open to all suggestions.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sat Nov 17, 2018 2:49 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I am referring to the video game gun weapons. Not the video game knife weapon.
Aryan_Wolf3D
DieHard Guard
DieHard Guard


Joined: 21 Jul 2011
Last Visit: 13 Dec 2018

Topics: 6
Posts: 202

blank.gif

PostPosted: Sat Nov 17, 2018 3:26 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

So is "video game" an adjective now?

_________________
"Way too many #ifdefs in the code!" - John Carmack
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sat Nov 17, 2018 3:40 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I just use it.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11 Dec 2018

Topics: 165
Posts: 8277
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Nov 17, 2018 6:03 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, each of the three gun weapons are coded different weapons. On the other hand, coding your three new weapons won't be difficult - just tedious.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sat Nov 17, 2018 6:10 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Can the original chaingun routine be used for the new chaingun sprite and the original chaingun still be used?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11 Dec 2018

Topics: 165
Posts: 8277
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Nov 17, 2018 8:34 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I suppose, but there's still of lot of code replicating you'd have to do to get both working.
fraggeur
DieHard Guard
DieHard Guard


Joined: 31 Dec 2012
Last Visit: 18 Nov 2018

Topics: 11
Posts: 273

blank.gif

PostPosted: Sun Nov 18, 2018 3:10 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It is not a major challenge, but it is still tricky to do it.

I suggest you start by adding one with this tutorial

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

And try to understand what it involves to have 1 more, once you are more familiar, you can add the 2 others in one shot.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 02 Dec 2018

Topics: 55
Posts: 2152
Location: Canada
blank.gif

PostPosted: Sun Nov 18, 2018 10:21 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You might be able to something similar to WSJ's sprite offset idea:
http://diehardwolfers.areyep.com/viewtopic.php?t=1909

But instead of putting it below "place active objects" you could put it here:
https://github.com/AlumiuN/Wolf4SDL/blob/master/WL_DRAW.CPP#L1112

You would probably just need a variable that tells the game that you're using weapon 5, 6, or 7 to set the pic offset accordingly.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11 Dec 2018

Topics: 165
Posts: 8277
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Nov 18, 2018 11:23 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, there's also the pickup sprite and item, and that requires several code changes, too ... even if it's not called up in WL_GAME.CPP.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sun Nov 18, 2018 4:20 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What does this video game source code mean and refer to:

struct atkinf
{
int8_t tics,attack,frame; // attack is 1 for gun, 2 for knife
} 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} },
};
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sun Nov 18, 2018 5:59 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I know the code in the previous post refers to the four video game weapons. Do the next weapons in sequence have to be done like this in regards to the new video game weapons code:

struct atkinf
{
int8_t tics,attack,frame; // attack is 1 for gun, 2 for knife
} 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,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} },
};
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11 Dec 2018

Topics: 165
Posts: 8277
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Nov 19, 2018 11:37 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

http://diehardwolfers.areyep.com/viewtopic.php?t=2656&highlight=weapons
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Tue Nov 20, 2018 9:08 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I understand the video game struct C++ code better now after reading it multiple times. When you posted the link Tricob, I had read it two times already. Still did not get it. Now I do after reading it this time. The code that I posted above should be correct.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Tue Nov 20, 2018 9:14 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The video game C++ code attackinfo should be changed to 9 instead of using 4.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Tue Nov 20, 2018 9:15 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Actually, that probably should be left the way it is.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Tue Nov 20, 2018 9:20 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Actually, the video game code should be changed to an 8.
Wolf3DGuy
Bring 'em On
Bring 'em On


Joined: 01 Aug 2017
Last Visit: 3:02 ago.

Topics: 5
Posts: 106
Location: Burger King Palace, sitting on the cheeseburger throne.
hungary.gif

PostPosted: Tue Nov 20, 2018 9:36 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Why you weren't able to tell all these in one post?

_________________
Wolf3DGuy is so Wolf3DGuy.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Tue Nov 20, 2018 9:51 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I do not edit my posts on here anymore.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Fri Nov 30, 2018 7:55 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

In a video game SDL mod, can one new weapon just use three sprites for the gun animations or does 6 sprites have to be used?
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Fri Nov 30, 2018 9:06 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This link contains the video game weapon that I am trying to add into the game. It has three frames.

http://mmimageworld.dugtrio17.com/cgi-bin/index.cgi?download=triadpistol
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 02 Dec 2018

Topics: 55
Posts: 2152
Location: Canada
blank.gif

PostPosted: Sat Dec 01, 2018 6:55 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Joshua wrote:
I just use it.

I'm not sure if putting "video game" before every word or idea is creative or strange or funny. It certainly isn't conventional, or needed, unless I'm missing something. Laughing
Wolf3DGuy
Bring 'em On
Bring 'em On


Joined: 01 Aug 2017
Last Visit: 3:02 ago.

Topics: 5
Posts: 106
Location: Burger King Palace, sitting on the cheeseburger throne.
hungary.gif

PostPosted: Sat Dec 01, 2018 7:14 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You know I see this more often outside of the forum and it start to get annoying more than funny or strange or creative. I've seen he used video game mod, video game code, video game weapons, video game pistol so far.

_________________
Wolf3DGuy is so Wolf3DGuy.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11 Dec 2018

Topics: 165
Posts: 8277
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Dec 01, 2018 8:29 am
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I can't object to wording something one way or another unless it causes problems. But here, it is getting confusing. Don't be afraid to think before you speak. You're not on a game show, and there's no timer ticking away as you sit at your computer making a reply.

And it seems to me, Joshua - it seems as though you're concentrating *less* these days rather than more.

And why do you not edit your posts any more? I'd say you've stopped because someone told you to stop. But if you look over people's responses to this, you'll find it was bad advice. You won't be able to cover everything you need to say every single time you post. But for Heaven's sake, it won't hurt you to try. Don't be in such a rush to do everything. It's causing problems for you, it's causing problems with your projects, and it's causing problems with the places you visit. No one's going to shoot you in the head if you just slow down.
Joshua
DieHard SS
DieHard SS


Joined: 15 Mar 2012
Last Visit: 0:48 ago.

Topics: 192
Posts: 460

usa.gif

PostPosted: Sat Dec 01, 2018 1:35 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This is why I do not edit my posts anymore: http://diehardwolfers.areyep.com/viewtopic.php?t=8045
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11 Dec 2018

Topics: 165
Posts: 8277
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Dec 01, 2018 9:23 pm
   Subject: Re: How do you code additional weapons that use the same routine
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

The more you post about this issue, the more it leaves me scratching my head. It still isn't clear to me at all why you don't edit your posts anymore.
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 28847 Wed May 24, 2017 7:53 pm
Falcon*93 View latest post
No new posts Problem with new Wolf4SDL Demo Releases
Author: BrotherTank
4 2014 Sun Jul 20, 2008 3:57 am
Ripper View latest post
No new posts [HELP WOLF4SDL] High-Res Weapons.
Author: Raziel
9 2322 Sun Jul 13, 2008 5:04 pm
Ripper View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3472 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 4926 Sun Apr 27, 2008 2:30 am
AlumiuN 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