Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Code] Easy Weapon Display

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  

Is this a good tutorial?
Yes
100%
 100%  [ 4 ]
No
0%
 0%  [ 0 ]
Total Votes : 4

Author Message
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Sun Feb 13, 2005 4:29 am    Post subject: [Code] Easy Weapon Display Reply with quote

This name doesn't fit well, but what the tutorial does is easily let you have weapons with diffrent status bar images without nasy "if" statements.



Lets begin. Open Up WL_Agent and go to the Draw Weapon Function. Replace the whole this with this:

Update! Kyo found a bug in the following code! If you used it before 02/16/2005, go over it again!

Code:

==================
=
= DrawWeapon
= Conner94's
= Version
=
= Based off of
= BrotherTanks's Ammo
= In the Same Place
= Tutorail
=
==================
*/

void DrawWeapon (void)
{
   switch (gamestate.chosenweapon)
     {
        case wp_newweaponwithnewimage: //change this to your new weapon
          StatusDrawPic (32,8,yourimage); //change to your image
         break; //Make sure you have this!
     
        default:
          StatusDrawPic (32,8,KNIFEPIC+gamestate.weapon);
        break; //Make sure you have this!
      }
}


/*


There you go. Based off of BrotherTank's ammo in same place. Add as many cases as you need.
_________________
My Wolfenstein Website:
http://www.wolf94.cjb.net

Status: Falling apart over a product I ordered that is taking forever to arrive.


Last edited by Conner94 on Wed Feb 16, 2005 4:45 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
Mega Luigi
Site Admin


Joined: 12 Jan 2005
Posts: 127
Location: Brazil

PostPosted: Sun Feb 13, 2005 2:49 pm    Post subject: Reply with quote

Yes, I think is a good idea. I don't like to add that images, but now I will not lost too much time. Thanks Conner94 by this tutorial. Smile
_________________
Mega Luigi
Site Admin
Forums Admin
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Sun Feb 13, 2005 6:05 pm    Post subject: Reply with quote

Update!

If you see the key image when using a higher weapon, you must change it a bit. See first post for details.
_________________
My Wolfenstein Website:
http://www.wolf94.cjb.net

Status: Falling apart over a product I ordered that is taking forever to arrive.
Back to top
View user's profile Send private message Visit poster's website
Kyo Kusanagi
Corporal


Joined: 18 Jan 2005
Posts: 95
Location: New Jersey\USA

PostPosted: Tue Feb 15, 2005 10:21 pm    Post subject: Reply with quote

You forgot to put the Break; in here is my Ex:
Code:
void DrawWeapon (void)
{
   switch (gamestate.chosenweapon)
     {     
        case wp_knife:
          StatusDrawPic (32,8,KNIFEPIC);
     break;

        case wp_pistol:
          StatusDrawPic (32,8,GUNPIC);
     break;

        case wp_machinegun:
          StatusDrawPic (32,8,MACHINEGUNPIC);
     break;

        case wp_chaingun:
          StatusDrawPic (32,8,GATLINGGUNPIC);
          break;

   case wp_shotgun:
          StatusDrawPic (32,8,NEWPIC);
          break;

   case wp_sten:
          StatusDrawPic (32,8,NEWPIC1);
          break;

   case wp_rifle:
          StatusDrawPic (32,8,NEWPIC2);
          break;

   case wp_colt:
     StatusDrawPic (32,8,COLTPIC);
          break;

   case wp_dshotgun:
     StatusDrawPic (32,8,DSHOTGUNPIC);
          break;
      }
}


100% it works
_________________
I'm The DDR King!!!!!!!!!!!!!!!!!! Laughing Laughing


Last edited by Kyo Kusanagi on Wed Feb 16, 2005 12:44 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Kyo Kusanagi
Corporal


Joined: 18 Jan 2005
Posts: 95
Location: New Jersey\USA

PostPosted: Tue Feb 15, 2005 10:44 pm    Post subject: Reply with quote

I'm soo smart Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy
_________________
I'm The DDR King!!!!!!!!!!!!!!!!!! Laughing Laughing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Sat Feb 19, 2005 9:33 am    Post subject: Reply with quote

I had also done this with Extreme. It's good isn't it. There's probably an even easier way as well I bet.

Good for sharing it Conner
_________________
Myspace
VampireFreaks
Music4Life
Wolfing Time
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

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


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.