| View previous topic :: View next topic |
| Is this a good tutorial? |
| Yes |
|
100% |
[ 4 ] |
| No |
|
0% |
[ 0 ] |
|
| Total Votes : 4 |
|
| Author |
Message |
Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Sun Feb 13, 2005 4:29 am Post subject: [Code] Easy Weapon Display |
|
|
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 |
|
 |
Mega Luigi Site Admin

Joined: 12 Jan 2005 Posts: 127 Location: Brazil
|
Posted: Sun Feb 13, 2005 2:49 pm Post subject: |
|
|
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.  _________________ Mega Luigi
Site Admin
Forums Admin |
|
| Back to top |
|
 |
Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Sun Feb 13, 2005 6:05 pm Post subject: |
|
|
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 |
|
 |
Kyo Kusanagi Corporal

Joined: 18 Jan 2005 Posts: 95 Location: New Jersey\USA
|
Posted: Tue Feb 15, 2005 10:21 pm Post subject: |
|
|
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!!!!!!!!!!!!!!!!!! 
Last edited by Kyo Kusanagi on Wed Feb 16, 2005 12:44 am; edited 1 time in total |
|
| Back to top |
|
 |
Kyo Kusanagi Corporal

Joined: 18 Jan 2005 Posts: 95 Location: New Jersey\USA
|
Posted: Tue Feb 15, 2005 10:44 pm Post subject: |
|
|
I'm soo smart  _________________ I'm The DDR King!!!!!!!!!!!!!!!!!!  |
|
| Back to top |
|
 |
Deathshead Corporal

Joined: 18 Feb 2005 Posts: 87
|
Posted: Sat Feb 19, 2005 9:33 am Post subject: |
|
|
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 |
|
 |
|