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 → PlayKey() Help
PlayKey() Help
2001-01-18, 12:43 AM #1
I'm trying to write a simple cog for Blue_Bot's CTF level that plays a key on a 3do. Try as I might I can't get it to work. The 3do is fine, the key is fine, but the PlayKey() verbs simply aren't doing anything. Here's the cog:

Code:
flags=0x240


symbols


keyframe flagKey desc=The keyframe for the flags.


thing goldFlag desc=The gold team's flag.
thing redFlag desc=The red team's flag.


message startup
message timer


end


# ========================================================================================


code


startup:
	SetTimer (3);

timer:
	print ("startup");
	blah = PlayKey(goldFlag, flagKey, 2, 0x3);
	blah = PlayKey(redFlag, flagKey, 2, 0x3);
	print ("done");

end

I've tried using 1, 2, and 0 for the int, and I've tried using 20, 0x4, and 0x3 for the flags, and also leaving off the flag entirely.

Any help would be appreciated.

[This message has been edited by blujay (edited January 18, 2001).]
KOP_blujay
Just dancin'...and singin'...in the Force.
2001-01-18, 7:09 AM #2
I'm not sure if this will help, but try leaving off the "blah ="...



------------------
"Build a better level, and the JK community will beat a path to your door." - Randy
The TechCenter
"Build a better level, and the JK community will beat a path to your door." - Randy
GuardianFox.Net
2001-01-18, 10:20 AM #3
You might try putting 'return;' at the end of each message segment. Does the debug text appear?

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2001-01-19, 12:18 AM #4
Randy, I didn't have the "blah =" at first, but then I saw it in another cog; it might have been weap_fists.cog. So I thought I'd try it, although it really shouldn't make any difference, and it didn't.

Raynar, yes, the debug text appears, when the 3-second timer executes. The cog itself is working, but the PlayKey verbs aren't.

I asked Blue_Bot to try testing the cog on ky.3do with a ky*.key, and it didn't even work then. So I'm pretty sure the cog is the problem, not the 3do or the key, both of which check out fine in Jed and Puppet Jedi.

Thanks to both of you for replying. If you have any other ideas, please let me know.
KOP_blujay
Just dancin'...and singin'...in the Force.
2001-01-19, 1:57 PM #5
KEYs are very tricky. They almost always cause me problems.

Perhaps the length of the key is the issue. In other words, the key itself should loop. I wouldn't use the timer.

Use an integer like "played" or something, and see if you can get it to run once. If you do that you'll be able to eliminate the possibility that the timer is the cause of the problem.

Also, for testing purposes, try using something like entered for your message instead of startup to avoid possible complications with other startup cogs. That way you be sure that you're able to observe the 3do precisely when the key is to be played.

------------------
"Dead Reckoning and now Dead Reckoning 2"
Dead Reckoning
2001-01-19, 4:52 PM #6
Ah, you do of course realise that the red & gold flags are already running key animations, as set up in the ctf_main.cog. I know very little about key files, but they could be conflicting. Try modifying the ctf_main.cog to remove the exiting key and then retry. Just an idea.

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2001-01-20, 2:02 AM #7
Quilty, well, as I said in the first post, he tried it with ky.3do and a ky*.key and it still did not work, so I'm pretty sure the cog is the problem. I might try doing that myself though.

The timer doesn't make the key loop, because the timer does not re-set itself. The timer is set by the startup event, then the timer executes, and then that's it.

I don't think using another message will help, because the code in the timer executes, just not the PlayKey() verb. But I'll try it. I can see the 3do anyway, because I stuck it in a default box, so I'm right next to it when it executes.

Thanks for your ideas though. [http://216.105.160.32/html/smile.gif]

Ray, yeah, but this cog is not for the "capturable flags." When Blue_Bot asked me to make it I thought it was, but he actually wants it for a decorative flag to hang in the bases. Thanks though. [http://216.105.160.32/html/smile.gif]
KOP_blujay
Just dancin'...and singin'...in the Force.

↑ Up to the top!