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 → STRRANGE error, only works right 5 times...
STRRANGE error, only works right 5 times...
2003-02-06, 8:15 PM #1
I made two cogs. A server cog which sends out a trigger, then a local working client cog.
I have a crank 3do which has a lever and a wheel. I have an animation where the crank pulls down and the wheel spins.

The idea is, the user walks up to an elevator, activates the crank, the crank plays the animation, then goes up right before the animation finishes (don't worry about that, the timing is right). The elevator goes up, halts for a sec, then goes back down. This was all probably obvious, but I don't wanna leave ya without details.

The problem here? Well I activate the crank once, it works PERFECT walla. I was like holy crap that's sweet. Well I keep doin it. The fifth time I do it, the animation doesn't work. The crank doesn't play the animation. EVERYTHING ELSE WORKS.... confusing.

Here's the two cogs:
Code:
# Crank & Elevator Controller - WuLf
symbols
thing	crank
thing	player	local

sound	DoneSound

flex	Activateable	local

message	startup
message	activated
message	timer
end

code

startup:
Activateable = 1;
Return;

activated:
player=GetLocalPlayerThing();
if(Activateable == 1)
	{
	 SendTrigger(-1, 666, player, 0, 0, 0);
	 SetTimer(6);
	 Activateable = -1;
	}
Return;

timer:
PlaySoundThing(DoneSound, crank, 0.9, 1, 6, 0x80);
Activateable = 1;
Return;
end


Cog two:
Code:
# Crank & Elevator Client - WuLf
flags=0x240

symbols

keyframe	CrankStart
thing		Crank
thing		Elevator
sound		CrankSound
flex	Speed
message	trigger
message	timer
end

code


trigger:
if(GetSourceRef() == 666)
	{
	 PlayKey(Crank, CrankStart, 1, 0x4);
	 PlaySoundThing(CrankSound, Crank, 0.9, 1, 6, 0x80);
	 SetTimerEx(1.0, 1, 0, 0);
	}
Return;

timer:
if(GetSenderID() == 1)
	{
 	 MoveToFrame(Elevator, 1, Speed);
	 SetTimerEx(4.0, 2, 0, 0);
	 Return;
	}

if(GetSenderID() == 2)
	{
	 MoveToFrame(Elevator, 0, Speed);
	}
Return;


end


I'm sooo confused, hopefully someone who is smarter than I can find the problem.

[This message has been edited by Sabre_Wulf (edited February 06, 2003).]
2003-02-07, 9:50 AM #2
I don't see why the cog stops on the fifth time running.

Here's a simplification in the first cog.
In the Symbols section make " flex Activateable=1 local " then you don't need the Startup: message or code there.

In the second cog I don't see what would call the timer message for the second if statement: if(GetSenderID() == 2)

------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2003-02-07, 1:39 PM #3
I KNOW!!! I KNOW!!! It's because you are using 666 as your ID.

On a more serious note. It could be because you pressed the button before the cog had reset. Just try to wait between trials
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2003-02-07, 3:53 PM #4
Quote:
<font face="Verdana, Arial" size="2">Originally posted by SG-fan:
I KNOW!!! I KNOW!!! It's because you are using 666 as your ID.

On a more serious note. It could be because you pressed the button before the cog had reset. Just try to wait between trials
</font>


That's what I figured, but no. I tried waiting a while after each time. NOPE. It's strange.
2003-02-07, 6:35 PM #5
Maybe it's because the keys keep playing over eachother and eventually it can't play anymore. It's similar to the animation problem with Seifer's pov. If this is the problem, then use the StopKey(); fucntion.
I am _ Ace_1 _ , and I approve this message.
2003-02-07, 7:00 PM #6
Could you post the level (or just that part) so I can play with the cog.

There might be a bug on how the frames are set up. Doubt it, but maybe.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2003-02-07, 8:30 PM #7
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Ace1:
Maybe it's because the keys keep playing over eachother and eventually it can't play anymore. It's similar to the animation problem with Seifer's pov. If this is the problem, then use the StopKey(); fucntion.</font>


Were you aware that you are brilliant? That did it. The StopKey fixed it. Thanks Sooo much.
2003-02-08, 8:49 AM #8
Oh well, I was beaten to it. [http://forums.massassi.net/html/frown.gif]
That's ok. I don't know too much about keyframes. Just barely started making them myself. Anyway glad the problem's fixed.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2003-02-08, 8:46 PM #9
Yeah I wasn't big on keyframes until recently. I've had to work with them a lot lately. I should've known that was the problem, but that thought never slipped through my mind. Thanks much!

PS: hehehe it's really cool watching the level pull down and the wheel spin hehehe... I'm sucha dork lol.
2003-02-09, 2:55 PM #10
I actually thought the problem wasn't keyframes, but I posted it anyway.
I am _ Ace_1 _ , and I approve this message.

↑ Up to the top!