Additive crosshairs? Created 7 years ago2016-07-05 08:57:54 UTC by EsprimoP EsprimoP

Created 7 years ago2016-07-05 08:57:54 UTC by EsprimoP EsprimoP

Posted 7 years ago2016-07-05 08:57:54 UTC Post #330686
I made my custom crosshairs sprite. Every pixel except the crosshairs is black so it would be invisible and the crosshairs will be transparent. I'm using Sprite Explorer, I save the bmp as 8-bit depth and save the sprite as Additive, I configure it for each weapon in sprites/<weapon>.txt
In game every crosshair sprite is correctly displayed for every weapon except that they are not additive. The should be transparent with black invisible, they are normal. Nothing invisible, nothing transparent. Can this be done in a code maybe or is there another way outside coding?
EsprimoP EsprimoPwEight
Posted 7 years ago2016-07-05 09:25:52 UTC Post #330687
Check how other crosshair SPR are done, see if there is a mistake
Posted 7 years ago2016-07-05 10:25:05 UTC Post #330689
What other sprites? In valve, original half life, crosshairs are Alphatest. I want mine to be Additive.
EsprimoP EsprimoPwEight
Posted 7 years ago2016-07-05 11:46:58 UTC Post #330692
Can you post a screenshot of your SPR in Sprite Explorer ?

Looking at HL code, you won't be able to set it to additive since HSPRITE is basiclly an "int" variable. So if you want to do this through code, you will need to code your own system.
Posted 7 years ago2016-07-05 19:08:48 UTC Post #330694
Did you convert to grayscale first? Also, the pallete has to have 256 color slots.
Posted 7 years ago2016-07-05 19:50:42 UTC Post #330695
@Shepard62700FR (A lil spoiler but oh well)
User posted image
I see, it just gets the type from the spr file.

@Half-Rats

Wouldn't that make the crosshairs not colorful? And yes as I mentioned in the first post the image file was 8-bit.
Is making colorful crosshair sprites additive even possible? AKA does the engine make all additive sprites glow in set color? (For instance, orange for health, armor, etc.)
EsprimoP EsprimoPwEight
Posted 7 years ago2016-07-05 20:52:12 UTC Post #330697
All additive sprites will glow in the programmed HUD color. In order to make full color sprites, you have to have it set to alphatest.

Additive cannot be full color.
Posted 7 years ago2016-07-06 11:53:08 UTC Post #330711
Alright then, thanks.
EsprimoP EsprimoPwEight
Posted 7 years ago2016-07-06 17:30:22 UTC Post #330714
Original Half-Life crosshairs (and blood) have Alpha-Test transparency. Additive transparency is using for other HUD's elements, muzzleflashes, fire effects etc. Crosshairs just were hardcoded to be non-additive, as I assume.
Posted 7 years ago2016-07-06 18:23:03 UTC Post #330715
Ugh, same results...
What is the key color that is invisible? Is it the grey one from the original half life crosshairs sprite? Because I tried it and nothing... (No, I didn't take a wild guess to select the right grey one, I copied the color from the original crosshairs.
EsprimoP EsprimoPwEight
Posted 7 years ago2016-07-06 19:04:30 UTC Post #330718
Can you send the file with your crosshairs ? It looks like the image above is down, I would like to reproduce the issue on my end.
Posted 7 years ago2016-07-06 20:36:06 UTC Post #330723
I deleted it. Check your PMs
EsprimoP EsprimoPwEight
Posted 7 years ago2016-07-07 10:51:24 UTC Post #330727
I tried everything I could, but it doesn't work, here are some very important stuff to note :
  • The image must be a 256 colors bitmap (BMP), nothing else.
  • The image's dimension must be dividable by 8 and not exceed 256x256, this isn't the case of your crosshairs.
  • The sprite must be Alphatest and VP_PARALLEL.
  • For transparency, Alphatest uses the last color from the 256 colors palette.
  • Sprite Explorer ** up the palette when creating the SPR, use Sprite Wizard instead.
EDIT : This might help
You must be logged in to post a response.