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 → Still another Server/Client problem
Still another Server/Client problem
2003-08-05, 11:46 PM #1
Hi!
This time there is a key problem.
Code:
# Bump Light
#
# By Edward

symbols

message		activated
message		damaged

thing		light	mask=0x408
thing		x

keyframe	bump

end
#
code
startup:
	ThingLight(light,0,0.01);
activated:
	If(GetSenderRef()!=light) return;
	PlayKey(light,bump,1,0x002);
	ThingLight(x,1,0.9);
	sleep(1);
	ThingLight(x,0,1.1);
return;
damaged:
	If(GetSenderRef()!=light) return;
	PlayKey(light,bump,1,0x002);
	ThingLight(x,1,0.9);
	sleep(1);
	ThingLight(x,0,1.1);
return;
end

When I activate something (or damage it), the key that plays is a soft indication that I bumbed it... BUT! Only the server sees the animation, and the client sees it run to the center of the map at a speed that looks like warp... What flags, triggers, advanced cogging do I need this time?

/Edward
Edward's Cognative Hazards
2003-08-06, 2:47 AM #2
How exactly does the client's thing 'run' to the center of the map? Are you sure the message is not running more than once on the client computers? Is this an LEC keyframe or your own?

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-08-06, 4:36 AM #3
Run, as in... If I had givin it a frame and told it to MoveToFrame(thing,1,100);...
And I haven't a clue on how many times the message is being sent but I am hoping on once since you can't repeatedly activate it, nor damage it (unless you've got a repeater).
And it is a custom key...

/Edward
Edward's Cognative Hazards
2003-08-06, 2:30 PM #4
Quote:
<font face="Verdana, Arial" size="2">And I haven't a clue on how many times the message is being sent but I am hoping on once since you can't repeatedly activate it, nor damage it (unless you've got a repeater).</font>


Activation and damaging seem simple ingame, but understanding how they work in multiplayer is not. I doubt this would reveal much, but it should be tested.

Try using an LEC key and see if the model still goes to the level's center.



------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-08-07, 11:05 AM #5
That is going to be hard, since the object is only 2 meshes... A stick and a crystal, but I'll give it a try!
---
OK, still the same thing... I tried bryvmnt.key. Server saw it fall to peices, but the client saw it disappear!

/Edward
Edward's Cognative Hazards
2003-08-07, 2:42 PM #6
Changing the model shouldn't matter that much, so try switching to an LEC model as well.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-08-07, 11:11 PM #7
OK, I changed the 3DO to KYle, and the key to kycharge, and the same thing happened. Server saw Kyle do his nice saber swing, but the client saw him disappear.

/Edward
Edward's Cognative Hazards
2003-08-08, 8:53 PM #8
And you tried putting in print statements for the clients? If you have and the client is not getting duplicate messages, then I'm out of guesses. I'd offer to test it for you, but I don't have two computers to set up a game with. [http://forums.massassi.net/html/frown.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-08-08, 11:26 PM #9
Quote:
<font face="Verdana, Arial" size="2">Originally posted by SaberMaster:
And you tried putting in print statements for the clients? If you have and the client is not getting duplicate messages, then I'm out of guesses. I'd offer to test it for you, but I don't have two computers to set up a game with. [http://forums.massassi.net/html/frown.gif]

</font>


You could ask a friend to help you test it! Any friends of yours who has a LapTop? Then he could come over with his computer, hook you two up, and test this problem!

/Edward
Edward's Cognative Hazards
2003-08-09, 2:50 PM #10
try this if you want.
Code:
# Bump Light
#
# By Edward
#===============
flags=0x240
symbols
#---------------
message     activated
message     damaged
message     trigger
message     timer

thing       light     mask=0x408
thing       x

keyframe    bump

int         is_busy=0     local
int         bump_trig=1
#---------------
end
#===============
code
#---------------
startup:
	//-Clear the IS_BUSY...
	is_busy = 0;
	ThingLight(light, 0, 0.01);
return;
#---------------
activated:
	//-Check to see if the cog is busy...
	if(is_busy == 1)
		return;
	//-Make sure it was the light...
	if(GetSenderRef() != light)
		return;
	SendTrigger(-1, bump_trig, 0, 0, 0, 0);
return;
#---------------
damaged:
	//-Check to see if the cog is busy...
	if(is_busy == 1)
		return;
	//-Make sure it was the light...
	if(GetSenderRef() != light)
		return;
	SendTrigger(-1, bump_trig, 0, 0, 0, 0);
return;
#---------------
trigger:
	//-Make sure that its the right trigger...
	if(GetSourceRef() != bump_trig)
		return;
	//-Check to see if the cog is busy...
	if(is_busy == 1)
		return;
	//-Make the cog busy and set a timer that is as
	//-long as the bump keyframe...
	is_busy = 1;
	SetTimerEx(GetKeyLen(bump), 1, 0, 0);
	//-Play key and turn the light on...
	PlayKey(light, bump, 1, 0x2);
	ThingLight(x, 1, 0.9);
	SetTimerEx(1.0, 2, 0, 0);
return;
#---------------
timer:
	//-Clear the IS_BUSY...
	if(GetSenderID() == 1)
		{
		is_busy = 0;
		return;
		}
	//-Turn light off...
	else
	if(GetSenderID() == 2)
		ThingLight(x, 0, 1.1);
return;
#===============
end

i took out the sleep just because i dont like useing it, you can put it back if you want.
i didnt try it so i dont know if it will work.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2003-08-10, 5:01 AM #11
Thank you DSLS_DeathSythe! It realy helped! Both see the thing bounce when bumped!
I guess, if I'm going to make any elaborate COGs like this, I'll have to use a trigger in all of them...

/Edward
Edward's Cognative Hazards

↑ Up to the top!