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       

[Help] Adding a weapon problem
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
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Jul 20, 2008 12:39 am
   Subject: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Im not sure whether this is an SDL problem or not, but seeing as I'm basically retarded with the source code nowadays, I can't tell.

basically, I added another weapon between the pistol and machinegun. buttons 1 to 4 work, but there's no way to hit a button to bring up the chaingun.

what have i missed?

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Sun Jul 20, 2008 12:54 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If you have allready added the button default to buttonscan array in wl_play.cpp, then delete config.wl6 and try again. Old config can't be used when buttonscan array changes in size.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Jul 20, 2008 2:18 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

ahh, see. i left out a bt_ definition in wl_def.

im an idiot.

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Jul 20, 2008 2:48 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

ok

so now Im adding BrotherTank's bestweapon code (don't pick up a lower weapon when picking up a higher one)

everywhere i call (1<<

im getting the error "invalid conversion from 'int' to 'weapontype'

HALP

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Sun Jul 20, 2008 4:37 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Please post the whole line. You are probably missing a "(weapontype)" directly after the "=".
C++ is a bit stricter than C, which causes this problem.

_________________
Life is an awful game, but the graphics resolution rocks ;D
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Jul 20, 2008 4:46 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

apparently the lines in question are:

gamestate.weapon = gamestate.chosenweapon = i; - in CheckWeaponChange

gamestate.bestweapon |= (1<<weapon); - In GiveWeapon

gamestate.weapon = gamestate.chosenweapon = weapon; - In GiveWeapon

gamestate.weapon = i; - In T_Attack

error: invalid conversion from 'int' to 'weapontype'

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Sun Jul 20, 2008 7:37 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Here are the corrected versions:
::: CODE :::
gamestate.weapon = gamestate.chosenweapon = (weapontype) i;

gamestate.bestweapon |= (weapontype) (1<<weapon);

gamestate.weapon = gamestate.chosenweapon = (weapontype) weapon;

gamestate.weapon = (weapontype) i;

_________________
Life is an awful game, but the graphics resolution rocks ;D
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Mon Jul 21, 2008 2:37 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

thanks ripper, that got rid of the majority of the errors, however

::: CODE :::
gamestate.bestweapon |= (weapontype) (1<<weapon);
still returns the same int to weapontype error.

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Mon Jul 21, 2008 10:42 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Try this:
::: CODE :::
gamestate.bestweapon = (weapontype) (gamestate.bestweapon | (1<<weapon));

_________________
Life is an awful game, but the graphics resolution rocks ;D
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Tue Jul 22, 2008 2:21 am
   Subject: Re: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

excellent ripppppper Very Happy

compiled Very Happy

i had to make the same sort of corrections to wl_main.cpp and wl_game.cpp and it works now ;D

Thanks for putting up with me lol.

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 20 Jul 2018

Topics: 97
Posts: 1508
Location: New Jersey
usa.gif

PostPosted: Thu Jul 24, 2008 4:26 pm
   Subject: [Help] Adding a weapon problem
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

ok i've added 7 weapons in my mod when i press 7 it draws the weapon but also brings me to the main menu.........does anyone know how to fix this?

Edit: nvm got it to work.

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
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 [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 10038 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 2842 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3034 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 3076 Tue May 06, 2008 1:15 pm
Ripper View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 4248 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