Different Sprites

   4110   5   1
User Avatar
Member
10 posts
Joined: Feb. 2008
Offline
Hello,

I'm really stuck with this, if anyone could have a look at it that'd be much appreciated..

I've got particles as sprites and I would like a different sprite for every particle.
Appended to my Popnet is an attribute that overrides the material, that works fine.
Only when I tell it retrieve different images for each sprite does it bomb! See the render below.

I'm using the string: path/sprite`$ID%2`.tga

Thanks

Attachments:
diffsprite.hipnc (298.6 KB)
Picture 243.png (39.5 KB)

User Avatar
Member
4140 posts
Joined: July 2005
Offline
I did a quick test and it seemed fine, which seems to indicate it's the name of your maps. Based on your hip you should have two maps, sprite0.tga and sprite1.tga, thus only two different images on the sprites.

Cheers,

J.C.
John Coldrick
User Avatar
Member
10 posts
Joined: Feb. 2008
Offline
ah, brilliant thanks J.C - I'm such a knuckle head :? - I got the numbering of my maps all wrong. I had sprite1.tga & sprite2.tga.. it works now, thankyou.

The only other thing I'd like to get my head around is having 2 different image sequences that loop for the sprite material.

Lets say I have sprite1_000.tga to sprite1_010.tga
and sprite2_000.tga to sprite2_010.tga

what kind of expressions would I dabble with to get a result?

alex
User Avatar
Member
1631 posts
Joined: July 2005
Offline
You can try:
path/sprite`$ID%2`_`padzero(3, int( fit01( rand($ID+394), 0, 10) ) )`.tga

Cheers!
steven
User Avatar
Member
4140 posts
Joined: July 2005
Offline
If you're happy without any time offset:

sprite`$ID%2`_$F3.tga

would work, but again make sure the root names are sprite0 and sprite1. You could always add 1 to the mod calculation I guess.

with a time offset, you'll want something along the lines of:


sprite`$ID%2_`padzero(3,$F + int(fit01(rand($ID),0,20)))`.tga

although I'm typing that blindy and someone will likely mock me soon…

That should add up to 20 frames to the current frame number, so you'd need to have post 20 frames as tmaps.

cheers,

J.C.
John Coldrick
User Avatar
Member
10 posts
Joined: Feb. 2008
Offline
fantastic - i'll give it a whirl - thanks for your help guys, it's beginning to make sense to me bit by bit.. alex
  • Quick Links