Nexus Modding > Mod Development / Released Mods

Adding custom animations

<< < (2/6) > >>

Mularac:
uhm.. are you sure that the tga file has to be done withouth the alpha channel? in test run the game would run the whole picture, not each frame. Here's my coding:

the effect


--- Code: ---ANI 40 "panorama" #BL_ADD #APM_ONCE 25 5 5

--- End code ---

and the particle


--- Code: ---PARTICLE "Hyper"

    duration 8
   
    SEQUENCE
        type 40
        fps 25
        startframe 0
        size 0 {dur 0.5 lerpto 5} {dur 3.5 lerpto 17} {dur 4 lerpto 25}
    END
   
END

--- End code ---

Arparso:

--- Quote ---uhm.. are you sure that the tga file has to be done withouth the alpha channel?
--- End quote ---
You can also save it with an alpha channel, if you're going to use one of the alpha blending modes (such as #BL_ALPHA, #BL_ALPHAINVERT and #BL_ALPHAADD) - otherwise you don't need that channel and can free some memory this way. DXT1-compressed 24-bit textures without an alpha channel take up only half the memory a DXT3-compressed 32-bit texture needs. ;)


--- Quote ---in test run the game would run the whole picture, not each frame.
--- End quote ---
What are the dimensions of your texture? Width and height of the packed image should be a power of two, such as 128, 256, 512, 1024 or 2048. Width and height don't need to be the same, though, so you can safely use a 2048x128 texture, if that fits your needs.

Mularac:

--- Quote ---What are the dimensions of your texture? Width and height of the packed image should be a power of two, such as 128, 256, 512, 1024 or 2048. Width and height don't need to be the same, though, so you can safely use a 2048x128 texture, if that fits your needs.

--- End quote ---

uhm... that could be an issue, I'm currently using an image of 640x640 (25 blocks of 128x128 frames, 5 colums and 5 rows)
I'll give it a shot

Arparso:
Then make it a 1024x512 image: 4 rows with 8 frames each. You don't have to fill the last row, just leave the remaining frames empty. This is why you have to set the total number of frames in mod_ani.ini ;)

jstubbles:
Bear in mind too, that if you're going to be using the BL_ALPHA blend mode, your alphas need to be premultiplied. By that I mean you have to compensate for the funky way gfx cards handle pixel blending. If you just create the particle on a black BG w/alpha, your sprite will have a black halo around it, for example (if using bl_alpha). Here's an example of a non-premultiplied alpha on a white BG and the "halo" effect:




Now this is an example of the premultiplied particle I created for our BSG mod:



and this is the texture sheet:



As you can see, it's on a black BG and there's no halo effects. The premultiplied alpha makes the texture look pretty funky, since the pixels are being spread around like that. But the alpha channel is what culls it out to perfection :)

Here's the alpha chan, which looks how you'd expect it to look:




@Arparso - thanks for the tip on using XnView to create the sheets! My god, I was doing it all by hand in Photoshop - what a nightmare! I've been using XnView for years and didn't know about that feature :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version