View Full Version : COGging a keyframe animation
rob_whatman
06-24-2002, 09:53 AM
Well, this is what I've done so far - I've used PuppetJedi to design a nice keyfile animation of a crashing snowspeeder. Now I want to write the COG to make it appear during a level when a player enters a sector or crosses an adjoin. In fact, I'd like it if it could work using any message at all, because so far I am having no luck!
I am making my level in MotS, which might be the trouble, as I've gotten keys to play OK in Jedi Knight by following tutorials. Are there different flags etc I don't know about for the PlayKeyFrame command, for example?
Descent_pilot
06-24-2002, 01:04 PM
Give me the cog you have so far. Have you checked it in Parsec or CogWriter?
------------------
The Sniper Missions. Current project, The Sniper Missions
ZOOIkes
06-25-2002, 10:02 AM
ZZZZZZZZZZzzzzzz....
http://forums.massassi.net/html/wink.gif
check the cog in the post below.
[This message has been edited by ZOOIkes (edited June 26, 2002).]
Descent_pilot
06-25-2002, 06:10 PM
Try this.
# Jedi Knight Cog Script
#
# key_player.cog
#
# A basic keyframe player cog
#
# [DP]
#
# Demo cog for rob_whatman
symbols
surface adjoin
thing speeder
keyframe key0
int done=0 local
message crossed
end
## Code Section
code
crossed:
if(!done) // So it doesn't play twice
{
done = 1;
PlayKey(speeder, key0, 1, 0x14); // This is the line that will play the key
}
return;
end
If you want sound or add it to a master cog, come back here, I'll give you that cog. P.S. there's no PlayKeyFrame(); line in cog. http://forums.massassi.net/html/wink.gif
Edited, to help ease ZOOIkes pain. http://forums.massassi.net/html/tongue.gif (and so I can spell his name right http://forums.massassi.net/html/redface.gif )
------------------
The Sniper Missions. Current project, The Sniper Missions
[This message has been edited by Descent_pilot (edited June 26, 2002).]
ZOOIkes
06-26-2002, 02:45 AM
whoops, I must have been asleep when I wrote that http://forums.massassi.net/html/smile.gif
rob_whatman
06-26-2002, 11:15 AM
Many thanks for the COG, Descent_pilot! My COG was a mess, cobbled together from the Mots cutscene COGs. Its nice to see how neat COGS should look.
Sadly, my animation still doesn't play. Is there anything else I should check for? I am just a beginner at all this.
P.S. Maybe ZOOKies has some ideas, when he finally wakes up... http://forums.massassi.net/html/smile.gif
Descent_pilot
06-26-2002, 09:44 PM
Use the double click select in the cog placer thingy in JED. That will get the right key file. Try messing around with the key flags, shouldn't change anything, but it might work. Add this line just above the If statement.
If(GetSenderRef() != GetLocalPlayerThing()) Return; One more thing, you don't need the 'thing speeder' in the symbols section.
------------------
The Sniper Missions. Current project, The Sniper Missions
SaberMaster
06-27-2002, 12:31 PM
Pilot, the cog you posted should work, but what you said in that last post is wrong. The senderref of the crossed message is the adjoin that was crossed, not the player. And you need to have the speeder defined for the first param of PlayKey().
The problem is probably with the keyframe.
------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).
Descent_pilot
06-27-2002, 01:03 PM
So I was right in the first place. http://forums.massassi.net/html/redface.gif *blushes* It would be GetSourceRef() instead. http://forums.massassi.net/html/redface.gif That's a good example why you shouldn't write cogs late at night.
------------------
The Sniper Missions. Current project, The Sniper Missions
rob_whatman
06-28-2002, 01:19 PM
Descent-pilot, be of good cheer - thanks to your COG, I have gotten my keyframes moving! I tried keyframing in JK, and got the template of C3PO to dance (very disturbing, I know...). So, I realised I had forgotten to put a PUP file in my MotS snowspeeder template, so I was essentially keyframing a 'flying brick'. I just added cr.pup to the template.
The other thing was to do with a niggly difference btw JK and MotS. I altered the flag in your COG so that the PlayKey line reads:
PlayKey(speeder, key0, 1, 0x4);
That seemed to do it. Much thanks and respect at you!
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.