How Do We Create Our Own Crosshair?

PiercingDegreePiercingDegree Join Date: 2002-02-02 Member: 149Members
<div class="IPBDescription">Yeah, a noobs question</div> How do we create our own crosshair?

What program do we use?

and THE important question : is it hard to create?

Comments

  • ctxctx Join Date: 2002-11-02 Member: 4592Members
    It's easy, IMO.

    You need SprGen and MSPaint.
  • PiercingDegreePiercingDegree Join Date: 2002-02-02 Member: 149Members
    Where can I find these programs?

    Are they free?
  • ctxctx Join Date: 2002-11-02 Member: 4592Members
    edited December 2002
    <a href='http://www.pcxweb.netfirms.com/SprGenSprView.zip' target='_blank'>[ SprGen + SprView ]</a>
  • ctxctx Join Date: 2002-11-02 Member: 4592Members
  • PiercingDegreePiercingDegree Join Date: 2002-02-02 Member: 149Members
  • TacoSupremeTacoSupreme Join Date: 2002-11-01 Member: 2562Members
    Here is a short tutorial on how to create a quick crosshair.

    Open MSPaint (Start ->Programs ->Accessories->Paint), goto Image->Attributes (or Ctrl+E) select the dimensions for your crosshair. They have to be the standard multiples of 2 and all, something like 32x32 is a good size to start with. Then Zoom in and draw it pixel by pixel, maybe with some help form the circle and line tools. Finally when done save it as a 256 color bitmap. File->Save As then under Save as Type, select 256 color bitmap.

    Next run SprWiz and select the .bmp file, when it asks about transperancy select Alphatest, that will make all the white color transparent (White is in slot 255 by default when using MSPaint). This will generate a sprite file, you can call it anything you want.

    Now to see your crosshair in game there is 1 more step. Copy you sprite to C:\sierra\half-lfe\ns\sprites (or whatevet your dir is). And you will need to edit the weapons.txt file for your crosshair. Lets say you made a new crosshair for the LMG. You would edit weapon_machinegun.txt.

    That file looks like this:
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->10
    weapon   320 320w 160 0 80 20
    weapon_s  320 320w-s 160 0 80 20
    ammo   320 640hud7 48 72 24 24
    crosshair  320 crosshairs 24 0 24 24
    autoaim   320 crosshairs 0 72 24 24
    weapon   640 640mw2 0 180 170 45
    weapon_s  640 640mw2-s 0 180 170 45
    ammo   640 640hud7 48 72 24 24
    crosshair  640 crosshairs  0 72 24 24
    crosshair  640 crosshairs 24 0 24 24<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    The 10 at the top is the number of sprites in the file, you wont need to change that unless you add a new line (Like adding a crosshair for something that doesnt have one like the knife)
    You just need to change one line really. You need to edit that crosshair line, but there are 2 you say, well no problem. One has a 320 at the beginning and that is for people running in 320x240 resolution, the other one has a 640 and is for people running in 640x480 or higher (ie. most everyone) You need to change the line to something like this:
    crosshair 640 lmg 0 0 32 32

    The first column is what type of sprite it is, this is a crosshair sprite
    The next column is what resolution it is for, this is for 640x480 and greater
    Next is the Sprite file, you type in what it is without the .spr on the end, and the file should be in c:\sierra\half-life\ns\sprites or c:\sierra\half-life\valve\sprites
    Next is where the image starts in how many pixels from the top down (this is used so you can have multiple sprites stored in 1 file to cut down on storage space)
    Next is where the image starts in pizels from the left side over.
    Next is the width of the sprite in pixels
    Finally is the heighth of the sprite in pixels

    Ok so after setting all that up, you have your new sprite in your ns/sprites directory, you have your weapons_.txt file edited to link up the gun you want with your sprite, you are ready to see it in game.

    Good Luck!
  • ElboElbo Join Date: 2002-08-23 Member: 1218Members
    Pin this thread! <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' valign='absmiddle' alt='tounge.gif'><!--endemo-->

    GJ! Just what I needed.
    Thank you taco
  • PiercingDegreePiercingDegree Join Date: 2002-02-02 Member: 149Members
    Wow.. thanks Taco, That's a really good tutorial, I've understood the first time! <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
  • ctxctx Join Date: 2002-11-02 Member: 4592Members
    I find SprGen is easier, as all you have to do is edit SPRITES.QC

    But, good tutorial Taco.
  • ElboElbo Join Date: 2002-08-23 Member: 1218Members
    and how do you do transperacy (sp?)
    like the shine-through ness...
    as in the hud...
  • danshyudanshyu Join Date: 2002-11-01 Member: 2105Members
    edited December 2002
    And if you want to creat a semi-transparent crosshair, you'll need Photoshop or Paint Shop Pro.

    Here is a tutorial from wavelength regarding the matter:

    <a href='http://www.thewavelength.net/oldsite/2dart/tutorials/sprites.html' target='_blank'>http://www.thewavelength.net/oldsite/2dart...ls/sprites.html</a>
  • ElboElbo Join Date: 2002-08-23 Member: 1218Members
    Erhm....
    I still don't understand <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' valign='absmiddle' alt='confused.gif'><!--endemo-->
    Maybe it's because it's rather late...
    I'll look into it tommorow (which sort of sprite do I need for semi-transperacy?)

    alphatest, additive or the other 2?
  • JimJim Join Date: 2002-11-26 Member: 9989Members
    im pretty sure its additive...
  • TacoSupremeTacoSupreme Join Date: 2002-11-01 Member: 2562Members
    Glad everyone like the tutorial, I can write more in depth ones, or on a different subject if someone would like to see more.

    Basically here is how additive transparency works.
    The ammount of black in a color is its transparency, so black is totally transparent, a dark red is partially transparent, and white or a solid color is totally there. To make something more transparent you just make it darker. I haven't really done much with additive transparency, because I never had any sprite that used additive that I wanted to edit. I have read a bit, and thats the way they explain it =p

    If this does not explain it well enough I'll go into more detail. If anyone still needs help with alphatest sprites let me know.
  • TacoSupremeTacoSupreme Join Date: 2002-11-01 Member: 2562Members
    edited December 2002
    EDIT: oops double post.
  • BioHazBioHaz Join Date: 2002-02-18 Member: 226Members
    Additive for XHairs doesnt work, you have to use IndexAlpha. The rest of the HUD is additive.
  • ElboElbo Join Date: 2002-08-23 Member: 1218Members
    Taco, can I interest you in writing a sprite tutorial for <a href='http://home.planet.nl/~meij2462/' target='_blank'>Lab16</a>?
    I would give proper credit where credit is due.
    Anyway, you can find my e-mail in my profile (or you can pm me)
    Let me know...
Sign In or Register to comment.