CSS Spray Tutorial

Started by Lee, July 01, 2007, 06:13:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lee

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 (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
[imglink]http://77.108.129.49/fahtags/ms2.jpg[/imglink]  

Do some Folding today! Click the above link. :)

Luminance

#1
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 :)

Also known as Lycan Lumi - On Aszune known as: Luminescence lvl 80 shammy
Best knife, double kill:
-=[dMw]=-Lumi|T.Wolve killed -=[dMw]=-Sithy with knife.
-=[dMw]=-Lumi|T.Wolve killed -=[dMw]=-R@ng3R with knife.

Lee

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.
[imglink]http://77.108.129.49/fahtags/ms2.jpg[/imglink]  

Do some Folding today! Click the above link. :)

WhiteWolf

..if you have time and interest to make me one:) Just let me know if you're interested to make me one:flirty:
[SIGPIC][/SIGPIC]

Lee

[imglink]http://77.108.129.49/fahtags/ms2.jpg[/imglink]  

Do some Folding today! Click the above link. :)

WhiteWolf

#5
Sure I did my friend:) Thank you for that my friend:rolleyes: But it didnt wokr:/
[SIGPIC][/SIGPIC]

Lee

Whitewolfs' problem was all sorted.

Thanks for the sticky, mystery sticky person. :)
[imglink]http://77.108.129.49/fahtags/ms2.jpg[/imglink]  

Do some Folding today! Click the above link. :)

WhiteWolf

[SIGPIC][/SIGPIC]

Lee

Fixed broken link. Any chance anyone with a more permanent domain could host Smiddy.rar? :)
[imglink]http://77.108.129.49/fahtags/ms2.jpg[/imglink]  

Do some Folding today! Click the above link. :)

Jabbs

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.
Start Folding and get yourself one of those nice new badge thingies, it\'s a good cause.  Check out the stats

[email]jabbs@deadmen.co.uk[/email]

Lee

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
[imglink]http://77.108.129.49/fahtags/ms2.jpg[/imglink]  

Do some Folding today! Click the above link. :)

Xenon

Thank you Lee master for teaching us!:rolleyes:

OnE ShOt OnE KiLl No LuCk JuSt SkIlL:boxing: