Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Cog to animate designated textures
Cog to animate designated textures
2009-10-13, 12:12 PM #1
Hey yawl. This one should be easy, as even *I* was able to do it without any help.

I made a custom saber handle 3do with multi-cel mats.

Then I modified either weap_saber or kyle.cog (can't remember) to constantly animate the designated material. It was capable of animating 10 mats if nessesary.

As I recall, it worked in single player and on any map. I can't remember how to do it now. All I can manage is to make jk crash lol.

Thanks, thmootch

edit: to illustrate my point http://www.imagedump.com/index.cgi?pick=get&tp=530379
2009-10-13, 3:55 PM #2
MaterialAnim(material, cells_per_second, flags); is what you want.

The material should be defined in the symbols.

eg;

Code:
Symbols
...
material  matname="some_material.mat"
...
end
code
...
MaterialAnim(matname, 4, 0);
...
end
And when the moment is right, I'm gonna fly a kite.
2009-10-13, 4:29 PM #3
Edit: If I put anything in the symbols section of weap_saber it wont animate and changing weapons crashes jk. So I tried kyle.cog, and the only problem is that the mat wont animate. I tried 00twinkle.mat to make sure my mats werent faulty.

[ignore]Thanks a lot. I wasn't sure if that was it, so now I know I just have to see what I did wrong.

Um what section of the code does it go in? I tried startup.

edit-timer section no worky[/ignore]
2009-10-13, 7:22 PM #4
The code should go under the Startup handler.
And when the moment is right, I'm gonna fly a kite.
2009-10-14, 3:47 AM #5
That's because gbk messed up the code. :P

First, there are no quotes for the mat in the symbols section.
Second, you want flags 0x1 so that the animation will loop.

Here's a little sample cog. If you were to pop this into your resource directory and have it run with JK, it'd animate your material on startup.

Code:
# Jedi Knight Cog Script
#
# AnimMat.COG
#
# Animates a material on startup.
#
# Xzero
#=======================================================================================

symbols

message startup

material animMat=yourmaterial.mat        local

// Desired FPS
int    fps=30        local

end
# ========================================================================================
code

startup:

	MaterialAnim(animMat, FPS, 0x1);

return;

end


Just take the required portions of this cog (FPS, AnimMat, and MaterialAnim verb) and place them in the same spots but in the weap_saber.cog

You don't need FPS, you can change it directly in the MaterialAnim verb, this way you don't need to copy it over. Though it helps if you're animating 10 mats and want them to have the same FPS.
2009-10-14, 4:08 AM #6
Originally posted by Xzero:
That's because gbk messed up the code. :P

Give me break, it's been 6 years since I've written a cog. :(
And when the moment is right, I'm gonna fly a kite.
2009-10-14, 5:52 AM #7
Originally posted by gbk:
Give me break, it's been 6 years since I've written a cog. :(


hehe, you've got your break.
2009-10-16, 2:14 PM #8
Thanks fellas. *leans in for the hug*

↑ Up to the top!