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       

Jamez's crosshair fix??
Page 1 of 1
DieHard Wolfers Forum Index -> 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
Guest




Last Visit:





PostPosted: Sun Mar 27, 2005 8:02 pm
   Subject: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

What id Jamez's Crosshiar fix? cause when I press the button to put it on screen (x) it doesnt go there...

dugtrio17 told me there was one so i came here.

thanks
Guest




Last Visit:





PostPosted: Mon Mar 28, 2005 8:54 am
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If you use the tutorial that Jamez wrote on his website, when you press the button to show the crosshair it will flash very fast on and off. You have to modify it a little bit to not make it do that. But if you look at the part of the code where the MLI cheat is defined you can find out how to fix this.
Sporb2000
DieHard SS
DieHard SS


Joined: 27 Dec 2004
Last Visit: 26 May 2009

Topics: 19
Posts: 383
Location: New Zealand - Invercargill
newzealand.gif

PostPosted: Mon Mar 28, 2005 4:01 pm
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yo Flamer , you couldnt post an url for that Tute could you? i wouldnt mind usin it but i lost it n i cant find it anymore Embarassed

_________________
I Like (Brackets)
Guest




Last Visit:





PostPosted: Tue Mar 29, 2005 1:34 am
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

http://verdammt.ionichost.com/sct_16.php.
That`s Jamez crosshair tutorial.
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 Mar 29, 2005 2:24 am
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Here's my tutorial I wrote a little bit ago:

Adding the crosshair

This tutorial creates a crosshair that triggers when you press the 'X' button. You will need a sprite editor for Wolfenstein to make the crosshair graphics. Each weapon will have a different crosshair, and the code is easy customized to allow for more crosshairs, and for weapons to share a crosshair.

Open WL_DEF.H and add the following sprite constants:

::: CODE :::

//
// Crosshairs
//
   SPR_CROSSHAIR1,SPR_CROSSHAIR2,CROSSHAIR3,


Now search for "gamestate". You should encounter the gamestate structure. Add under the "int ammo" definition: "int crosshair". It should now look like:

::: CODE :::

//---------------
//
// gamestate structure
//
//---------------

typedef   struct
{
   int         difficulty;
   int         mapon;
   long      oldscore,score,nextextra;
   int         lives;
   int         health;
   int         ammo;
   int         crosshair;   //This is the line you added
   int         keys;
   weapontype      bestweapon,weapon,chosenweapon;

   int         faceframe;
   int         attackframe,attackcount,weaponframe;

   int         episode,secretcount,treasurecount,killcount,
            secrettotal,treasuretotal,killtotal;
   long      TimeCount;
   long      killx,killy;
   boolean      victoryflag;      // set during victory animations
} gametype;


Save and close WL_DEF.H . Now open WL_DRAW.C and find the "DrawPlayerWeapon" function. Locate this statement inside:

::: CODE :::

void DrawPlayerWeapon (void)
{
    int   shapenum;

#ifndef SPEAR
    if (gamestate.victoryflag)
    {
        if (player->state == &s_deathcam && (TimeCount&32) )
         SimpleScaleShape(viewwidth/2,SPR_DEATHCAM,viewheight+1);
       return;
    }
#endif


And add this statement underneath:

::: CODE :::

    if (gamestate.crosshair)
    {
        switch (gamestate.weapon)
        {
       case wp_pistol:
       SimpleScaleShape(viewwidth/2,SPR_CROSSHAIR1,viewheight+1); break;
       case wp_machinegun:
       SimpleScaleShape(viewwidth/2,SPR_CROSSHAIR1,viewheight+1); break;
       case wp_chaingun:
       SimpleScaleShape(viewwidth/2,SPR_CROSSHAIR1,viewheight+1); break;
   }
    }


Now, open WL_AGENT.C and locate the CheckWeaponChange function. Add the following code just before the last '}':

::: CODE :::

    if (Keyboard[sc_X] && !gamestate.crosshair)
        gamestate.crosshair=1;
    else if (Keyboard[sc_X] && gamestate.crosshair)
        gamestate.crosshair=0;


To make the crosshair, open up an editor like FloEdit and add the three crosshair sprites.

Now when playing, press X and a crosshair will come up, and each weapon has it's own crosshair.

There you go
-Deathshead

Hope that helps

_________________
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
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Tue Mar 29, 2005 12:11 pm
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Easy Fix:

Open WL_AGENT.C and change this:

::: CODE :::
   if(Keyboard[sc_X])
   {
    if(gamestate.crosshair == 0)
    {
    gamestate.crosshair = 1;
    }
    else
    {
    gamestate.crosshair = 0;
    }
        }


to this:

::: CODE :::
   if(Keyboard[sc_X])
   {
    if(gamestate.crosshair == 0)
    {
    gamestate.crosshair = 1;
    IN_ClearKeysDown();
    }
    else
    {
    gamestate.crosshair = 0;
           IN_ClearKeysDown();
    }
        }


Simple.

_________________
Steam: http://steamcommunity.com/id/stormx312
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

Topics: 49
Posts: 903
Location: Seattle
usa.gif

PostPosted: Tue Mar 29, 2005 3:28 pm
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow, I've seen that command alot, but I never stopped to see what it did. Nice work, Kyle! I've learned something today. I'm glad I told Garfeild I was too lazy to tell him the fix at the moment Smile

_________________
Sporb2000
DieHard SS
DieHard SS


Joined: 27 Dec 2004
Last Visit: 26 May 2009

Topics: 19
Posts: 383
Location: New Zealand - Invercargill
newzealand.gif

PostPosted: Tue Mar 29, 2005 9:02 pm
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ugg - it displays a fat ugly pixel bound reticle - try this

case wp_pistol:
SimpleScaleShape(viewwidth/2,SPR_CROSSHAIR1,(viewheight+1)/2)break; ::: or /4 ,depends on how big u want it :::

makes it smaller and nicer looking - HEY thats my first bit of code Advice *Rejoices*

looky here - cant post the actual sprite for the reticle coz it keeps gettn mangled but it looks way better whne you add the few characters i put

D'oh , Stupid image shack keeps rootin me pics Mad

_________________
I Like (Brackets)
ThunderEnema
I am Death Incarnate
I am Death Incarnate


Joined: 05 Jul 2012
Last Visit: 15 Nov 2017

Topics: 4
Posts: 185
Location: Washington
usa.gif

PostPosted: Mon Aug 07, 2017 9:15 pm
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I hate to bump such an old thread, but I like this particular crosshair tutorial (being able to use a different crosshair for each type of weapon is awesome). My question: I am using weapon bobbing and I notice the crosshair bobs with the weapon. How do I make the crosshair stationary?

_________________
"When I see someone wearing crocs in public, I have all the information I need to know that I will never get along with that person." -Me
ThunderEnema
I am Death Incarnate
I am Death Incarnate


Joined: 05 Jul 2012
Last Visit: 15 Nov 2017

Topics: 4
Posts: 185
Location: Washington
usa.gif

PostPosted: Tue Aug 08, 2017 2:44 am
   Subject: Re: Jamez's crosshair fix??
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Disregard previous message... I fixed it. Smile

_________________
"When I see someone wearing crocs in public, I have all the information I need to know that I will never get along with that person." -Me
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> 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] Screen Colours
Author: Zombie_Plan
4 526 Tue May 03, 2005 12:43 am
Zombie_Plan View latest post
No new posts [Help!] Reinforcement only comes out in one place *angry*
Author: wolf3dbreaker
6 799 Sat Apr 16, 2005 8:02 pm
Tricob View latest post
No new posts [Tutorial] Two weapons One button
Author: Guest
20 720 Fri Feb 18, 2005 8:12 pm
jamez View latest post
No new posts [Info] Modifying The PG13 screen displayed
Author: JackaL
2 637 Thu Sep 23, 2004 12:21 pm
TexZK View latest post
No new posts [Info] How to Animate a Title Screen?
Author: Guest
5 259 Mon Jul 14, 2003 11:41 am
Guest 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