Dead Men Walking

Forum Archive 2023 => dMw's Community Centre => Community Archive => Photography, Art and Design => Topic started by: Lee on July 01, 2007, 06:13:13 PM

Title: CSS Spray Tutorial
Post by: Lee on July 01, 2007, 06:13:13 PM
Hi there, i thought i'd offer an updated and conclusive guide to making sprays in CSS. :) This is from my limited knowledge and what i know works, so if you find any suggestion or errors please feel free to let me know. I'll try to get some pictures to accompany each section soon.

Standard Picture Spray

From what i'm aware, smaller seems to be better and they are more likely to work if they are square shaped rather than rectangular. They must be in either of the following formats - .jpg/.bmp/.tga or .vtf. These are easy enough to make, to import them into the game go to 'options' then select 'import spray' and browse to your image of choice.

Static Transparent Spray

You will preferably need Photoshop for this, i don't know the way to do it in any other program, however i'm sure it's possible along similiar lines.

1) Open up Photoshop and create a new image with a transparent background.
2) Import or create your new image, make sure that whatever you want to be transparent in the picture is still showing the chequered background.
3) Merge all the layers down (Shift + Ctrl + E) and Ctrl + click the little mini picture on the layer, it should select only the part you want to be visible.
4) Select the Channels tab in your Layers window, then click on 'Save selection as channel' and click the empty box in the new layer which appeared, the bit which will appear transparent should turn red and in the mini pic it should show the visible bit as white and the transparent bit as black.
5) Press Ctrl + D to deselect (not sure if this is needed, i'll test it later on).
6) Go to File > Save as, then choose the format as Targa (.tga) and name it to whatever you wish. Save it as 32 bit.
7) Open up CSS and import it through the 'options' menu.

Animated Spray

You will need to download Smiddy (http://sulphent.freehostia.com/Smiddy.rar) (Download WinRar to open .rar files). Extract this into a new folder somewhere.

Try to get each file as small as possible, because if the end result is bigger than 120kb, it won't work!

The dimension of your pictures must be a power of 2.

If you want to make a current gif into a spray you should open the gif in Imageready and go to File > Export > Animation Frames As Files (remember to check dimensions are a power of 2).

1) Create each frame of your animation and save them. Make sure they are all saved as .tga files at 32 bit!
2) Name the first frame in the animation as spray001, next as spray002..etc..
3) Move each frame into your smiddy/hl2/materialsrc/animated folder.
4) Open spray.txt and change the endframe number to the last frame in your gif.
5) Go back to the main Smiddy folder and double click on the convert.bat file, it shouldn't say any errors in here! Once you hit a key to continue it will close it.
6) Navigate to your smiddy\hl2\materials\animated folder and rename the two files to whatever you wish, keeping the extensions intact of course.
7) Move these files to your counter-strike source\cstrike\materials\VGUI\logos folder.
8) Open CSS and choose your spray from the spray list (it should be in there and showing the first frame of your animation).

If you hear the spray sound but see no spray or if it's not working at all then it's likely that the .vtf file you created was too big! (over 120kb). Unfortunately you will have to create a smaller picture.

Animated Transparent Spray

This is easy to explain, remember to make sure your file dimensions are a power of 2 and as small in file size as possible.

Follow the steps of the Static Transparent Spray for each frame of your animation, then continue from step 2 of the Animated Spray.


Well that's all for now, i'll try to update it as soon as possible and make it as easy to understand as possible. But now i have to leave it as this, as i have to be ready for the tourney! :D
Title: CSS Spray Tutorial
Post by: Luminance on July 01, 2007, 06:33:10 PM
24 bit is the highest in PaintshopProX, but css says it should work anyways.

I did exactly like you did, but the only thing the lil screen shows after selecting it, are black/purple squares, and when i retry it shows the standard bullet spray.

I don't know why, but it shows/acts excactly the same as the one you hosted yesterday, so i think its my pc rather then me not being able to use ur guide :)
Title: CSS Spray Tutorial
Post by: Lee on July 02, 2007, 04:27:06 PM
That's pretty strange indeed. Maybe deleting the VGUI folder would help? This will delete any of your sprays from in the game though, but if they are somewhere on your comp you can import them again. Just try deleting it to the recycle bin first.
Title: I would like to have a spray..
Post by: WhiteWolf on August 01, 2007, 11:19:37 AM
..if you have time and interest to make me one:) Just let me know if you're interested to make me one:flirty:
Title: CSS Spray Tutorial
Post by: Lee on August 03, 2007, 05:24:25 PM
Check PM. :D
Title: CSS Spray Tutorial
Post by: WhiteWolf on August 03, 2007, 07:29:29 PM
Sure I did my friend:) Thank you for that my friend:rolleyes: But it didnt wokr:/
Title: CSS Spray Tutorial
Post by: Lee on August 14, 2007, 11:14:26 PM
Whitewolfs' problem was all sorted.

Thanks for the sticky, mystery sticky person. :)
Title: CSS Spray Tutorial
Post by: WhiteWolf on August 16, 2007, 01:39:03 PM
Thanks you Lee:)
Title: CSS Spray Tutorial
Post by: Lee on July 05, 2008, 11:37:53 PM
Fixed broken link. Any chance anyone with a more permanent domain could host Smiddy.rar? :)
Title: CSS Spray Tutorial
Post by: Jabbs on July 05, 2008, 11:51:44 PM
Quote from: Lee;236651Fixed broken link. Any chance anyone with a more permanent domain could host Smiddy.rar? :)

I have a reseller account so I can host unlimited domains with unlimited webspace with unlimited emails with unlimited bandwidth.

I can host on any number of domains, just PM me and I can sort it.
Title: CSS Spray Tutorial
Post by: Lee on July 06, 2008, 12:36:09 AM
Thanks for the offer Jabbs, but I noticed Doc's PM first, so I have responded. :) However if there are any problems, i'll get in touch with you. :D
Title: CSS Spray Tutorial
Post by: Xenon on July 06, 2008, 11:44:09 PM
Thank you Lee master for teaching us!:rolleyes: