Post by glyn on Aug 21, 2010 0:58:02 GMT
Alright guys. Animated sprays in L4D2. First off there are some limitations:
- File size, 120KB max. There's no limit to the number of frames, but if it exceeds this file size then it wont show in-game. Working within the 120KB boundary I was able to get about 3 frames at 256x256, and around 11 frames at 128x128.
- The frame rate is fixed and I don't think it can be modified. It's something like 4fps.
- L4D2 will only accept animated sprays in the VTF format.
Thankfully though it's pretty simple to create one:
Whatever your source is, you're gonna have to prepare a separate image file for each frame. So, you can either:
- Create them all by hand in a graphics editor.
- If it's from a GIF, you can use GIFSplitter to extract each frame. Get it here (freeware): www.snapfiles.com/get/gifsplitter.html
- Or let's say you want to use footage from a video like I did with BRUNO, you can do the following:
1. Get VirtualDub installed; It's a freeware video editor. Get it here: virtualdub.sourceforge.net/
2. If you're working with anything other than raw AVI's, chances are you'll need some codecs. For me the movie was in the Xvid format so I whacked the Vista Codec pack on my machine. You can get it here (freeware): www.free-codecs.com/vista_codec_package_download.htm
3. Run VirtualDub, open your movie and mark the beginning and end of the segment you want with the "Mark In" and "Mark Out" buttons at the bottom. Then go to File -> Export -> Image Sequence -> JPEG or whatever, and OK.
4. Finally, if you only want a particular section of the screen you can also group crop them in Paint Shop Pro and such.
Once you've got all of your frames together, you need one more piece of software, VTFEdit (also freeware). Get it here: nemesis.thewavelength.net/index.php?p=41
*Make sure you get the older version (1.2.5). The latest didn't work for me. If you can't get it, let me know and I'll send it you.
Open VTFEdit and go to File -> Import. Select all the images for your spray. Once you open them, you'll see a VTF Options screen. Leave all the settings as default, apart from Maximum Width and Maximum Height in the bottom left. Use any values up to 256, but make sure they're both the same. I used 128 (the spray will always be the same size in-game, but it'll be lower quality. Lower value means more blocky). I also made sure the images were 128x128 before I imported them to avoid complications, but I hear that VTFEdit will resize them for you.
Once you've set the width/height, press OK and you'll see the preview. You can hit play to test it (remember it will playback much slower in-game). Finally just hit File -> Save, and you're done. Set that VTF file as your spray and (so long as it's 120KB or less) it should be cool.
- File size, 120KB max. There's no limit to the number of frames, but if it exceeds this file size then it wont show in-game. Working within the 120KB boundary I was able to get about 3 frames at 256x256, and around 11 frames at 128x128.
- The frame rate is fixed and I don't think it can be modified. It's something like 4fps.
- L4D2 will only accept animated sprays in the VTF format.
Thankfully though it's pretty simple to create one:
Whatever your source is, you're gonna have to prepare a separate image file for each frame. So, you can either:
- Create them all by hand in a graphics editor.
- If it's from a GIF, you can use GIFSplitter to extract each frame. Get it here (freeware): www.snapfiles.com/get/gifsplitter.html
- Or let's say you want to use footage from a video like I did with BRUNO, you can do the following:
1. Get VirtualDub installed; It's a freeware video editor. Get it here: virtualdub.sourceforge.net/
2. If you're working with anything other than raw AVI's, chances are you'll need some codecs. For me the movie was in the Xvid format so I whacked the Vista Codec pack on my machine. You can get it here (freeware): www.free-codecs.com/vista_codec_package_download.htm
3. Run VirtualDub, open your movie and mark the beginning and end of the segment you want with the "Mark In" and "Mark Out" buttons at the bottom. Then go to File -> Export -> Image Sequence -> JPEG or whatever, and OK.
4. Finally, if you only want a particular section of the screen you can also group crop them in Paint Shop Pro and such.
Once you've got all of your frames together, you need one more piece of software, VTFEdit (also freeware). Get it here: nemesis.thewavelength.net/index.php?p=41
*Make sure you get the older version (1.2.5). The latest didn't work for me. If you can't get it, let me know and I'll send it you.
Open VTFEdit and go to File -> Import. Select all the images for your spray. Once you open them, you'll see a VTF Options screen. Leave all the settings as default, apart from Maximum Width and Maximum Height in the bottom left. Use any values up to 256, but make sure they're both the same. I used 128 (the spray will always be the same size in-game, but it'll be lower quality. Lower value means more blocky). I also made sure the images were 128x128 before I imported them to avoid complications, but I hear that VTFEdit will resize them for you.
Once you've set the width/height, press OK and you'll see the preview. You can hit play to test it (remember it will playback much slower in-game). Finally just hit File -> Save, and you're done. Set that VTF file as your spray and (so long as it's 120KB or less) it should be cool.