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 → Help! my rotation cog won't work in MP
Help! my rotation cog won't work in MP
2003-08-23, 12:56 AM #1
I need some help. I had just finished a new MP level and was quite relieved to finally have it finished, only to find much to my dismay that when I tried to play it with friends one of the cogs I used didn’t work right. My level contains these two rotating catwalks that need to rotate in opposite directions of each other to make it difficult to reach the conc rifle. I used the tjc_rot.cog available here on Massassi, and on the host computer it works perfectly. But for my friends joining my game the two catwalks just freeze at odd angles. I’ve spent several hours going nuts trying to find some way to fix it. Nothing I’ve tried
works. I tried entering this into the template of my catwalks:

type=cog move=physics physflags=0x200 maxrotvel=200 angvel=(0/180/0)

has suggested in an earlier thread by someone, and it works except that when Kyle is standing on it he doesn’t ride it quite right, it sort of rotates underneath him. I also tried to use a 2 frame elevator cog, but that didn’t work quite right either. I don’t know much about cogs, but I feel fairly certain that I have set up this tjc_rot cog the way its supposed to be and that I’ve set up the frames for the catwalks the way they need to be for this cog. It works fine on the host computer, but not on any of my friend’s computers when they join. I really need one of you cogging geniuses to help me. I consider these two catwalks to be an important part of my level. If anyone out there could modify this cog to make it work or write me another one I would be eternally grateful. I’m not a great editor and I can accept that, all I want is for my level to work. Please help me before I pull all of my hair out. Here’s the cog I was trying to use.

# Jedi Knight Cog Script
#
# TJC_rotwalk.cog
#
# Generic spinning walk cog. the walkway's first frame should have a yaw of 360 to make
it spin in continus circles.
# lagg can cause the walkway to pause breifly at the end of each turn.
#
# JK version
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols
thing walkway
sound whoosh
int dummy local
flex time desc=speed
message startup
message arrived
end

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

code
arrived:
StopSound(dummy, 0);
startup:
dummy = PlaySoundThing(whoosh, walkway,5,5,10,0x81);
RotatePivot(walkway, 0, Time);
return;

# ........................................................................................
end


Woah, sorry this was so long, its just that I’ve gotten frantic. Thanks.
2003-08-23, 9:52 AM #2
here's one that you can try if you want.
Code:
##########################################################
# Jedi Knight Cog Script  (JK)
#---------------------------------------------------------
# ROT_WALKWAY00.COG
# -Rotates an object (walkWay) continously.
# -To change the direction of the spin make the spin_time
#  negative. EXAMPLE: spin_time=-2 will spin in the
#  opposite direction of spin_time=2.
# -Each time you use this cog in your level the SPIN_TRIG
#  needs to be set to a different number.
# -SPIN_TRIG also needs to be different from any
#  other triggers in anyother cogs that uses triggers in
#  your level.
#---------------------------------------------------------
# Written By DSLS_DeathSythe
# This COG is NOT supported by LucasArts Entertainment Co.
##########################################################
flags=0x240
symbols
#---------------------------------------------------------
message     startup
message     arrived
message     trigger

thing       player=-1                                local
thing       joiner=-1                                local

thing       walkWay=-1
sound       spinning_snd=-1
flex        spin_time=2.0

vector      thng_look                                local
flex        x_cord=0.0                               local
flex        y_cord=0.0                               local
flex        z_cord=0.0                               local

int         spin_trig=1
#---------------------------------------------------------
end
#=========================================================
code
#---------------------------------------------------------
startup:
	Sleep(0.5);
	player = GetLocalPlayerThing();
	if(IsServer())
		{
		thng_look = GetThingLVec(walkWay);
		x_cord = VectorX(thng_look);
		y_cord = VectorY(thng_look);
		z_cord = VectorZ(thng_look);
		}
	else
		SendTrigger(0, spin_trig, 1, player, 0, 0);
	PlaySoundThing(spinning_snd, walkWay, 1.0, -1, -1, 0x1);
arrived:
	if(IsServer())
		SendTrigger(-1, spin_trig, 0, 0, 0, 0);
return;
#---------------------------------------------------------
trigger:
	if(GetSourceRef() != spin_trig)
		return;
	if(GetParam(0) == 1)
		{
		joiner = GetParam(1);
		if(IsServer())
			SendTrigger(joiner, spin_trig, 2, x_cord, y_cord, z_cord);
		return;
		}
	else
	if(GetParam(0) == 2)
		{
		StopThing(walkWay);
		thng_look = VectorSet(GetParam(1), GetParam(2), GetParam(3));
		SetThingLook(walkWay, thng_look);
		return;
		}
	RotatePivot(walkWay, 0, spin_time);
return;
##########################################################
end

setup for it is mostly the same as the one you posted. just one thing different, it uses a trigger (spin_trig). each time you use this cog in your level the spin_trig needs to be a different number, and it needs to be different from anyother triggers in anyother cogs.
i tested it in MP and it worked for me, but i only had one other computer join. having more join shouldnt mess it up (i hope [http://forums.massassi.net/html/redface.gif])
one thing that might look weird is when someone joins the game the platforms wont spin at first but they will start spinning. the person that joins wont notice it unless where he spawns is within veiw of the spinning platforms.

the template i used was 2x8catwalk and i didnt have to modify it at all.
frame setup should be the same as the one you posted.

any questions just ask.
hope it will do for you, good luck.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited August 23, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-08-23, 6:03 PM #3
It works!! Awesome! [http://forums.massassi.net/html/biggrin.gif] Thanks DeathSythe, you are too cool. It will be some time tomorrow before I actually get to test it with others joining, but since it worked for you, I see no reason why it wouldn’t work for me. And assuming it does, my level is finally complete! Thanks again man, you have lifted a huge feeling of frustrated hopelessness off of me. It’ll be great to finally have my level work right. I am forever appreciative [http://forums.massassi.net/html/biggrin.gif]
2003-08-24, 4:06 PM #4
Well, I finally got to test it in multiplayer with two people joining and the walk ways do spin, which is great, but unfortunately there’s still a small problem. If one person sees another standing on the walkway, he won’t actually appear to be standing on it from the other players view, he’ll be kind of floating ahead of the turning walk way. Its like they started spinning at a different time on each person’s computer I guess, so its like they’re not turning in sync with each other. If a person was on the catwalk and no one was
around to see it, it wouldn’t matter, but the thing is that this area is highly visible and the idea is that while your trying to get across the catwalks to nab that conc rifle, your highly vulnerable to being shot at from several positions. Is it possible to fix that? If it can’t be done then that’s okay, you’ve helped me a lot already. Thanks for getting them to spin for
me anyway.
2003-08-24, 5:39 PM #5
ok here another one you can try.
Code:
##########################################################
# Jedi Knight Cog Script  (JK)
#---------------------------------------------------------
# ROT_WALKWAY00.COG
# -Rotates an object (walkWay) continously.
# -To change the direction of the spin make the spin_time
#  negative. EXAMPLE: spin_time=-2 will spin in the
#  opposite direction of spin_time=2.
# -Each time you use this cog in your level the SPIN_TRIG
#  needs to be set to a different number.
# -SPIN_TRIG also needs to be different from any
#  other triggers in anyother cogs that uses triggers in
#  your level.
#---------------------------------------------------------
# Written By DSLS_DeathSythe
# This COG is NOT supported by LucasArts Entertainment Co.
##########################################################
flags=0x240
symbols
#---------------------------------------------------------
message     startup
message     arrived
message     trigger

thing       walkWay=-1
sound       spinning_snd=-1
flex        spin_time=2.0

int         sync_count=0                            local

int         spin_trig=1
#---------------------------------------------------------
end
#=========================================================
code
#---------------------------------------------------------
startup:
	Sleep(0.5);
	sync_count = 0;
	JumpToFrame(walkWay, 0, GetThingSector(walkWay));
	PlaySoundThing(spinning_snd, walkWay, 1.0, -1, -1, 0x1);
arrived:
	if(IsServer())
		SendTrigger(-1, spin_trig, 0, 0, 0, 0);
return;
#---------------------------------------------------------
trigger:
	if(GetSourceRef() != spin_trig)
		return;
	if(sync_count >= 3)
		{
		JumpToFrame(walkWay, 0, GetThingSector(walkWay));
		sync_count = 0;
		}
	sync_count = sync_count + 1;
	RotatePivot(walkWay, 0, spin_time);
return;
##########################################################
end

this one's setup is the same as the last one, all you should have to do is replace the last one with this one and all should work.
this ones weird thing is that every 3 spins it does a syncing thing and that should keep them in the same spin on each computer.
the part that may look funny is when it does the syncing if one end of the walkway looks different from the other end it will look like the walkway just instantly turned around and is facing the other direction or something like that. its kind of hard to explain, you will notice it if it happens. if you dont notice it, eh... oh well its no problem then.
i did test this cog between my computers and it worked for me, but again it may mess up with more but i dont see how it could this time i hope it doesnt.
try it, i hope it works for you.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited August 24, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-08-25, 6:53 PM #6
Hey,DeathSythe. Sorry it took me so long to try your new cog. Thanks a billion man, it
works great. Sometimes when I’m watching someone else on the walk, if that person is
moving around, he will momentary appear to slide off of the platform and then be right
back on it, but my friends seem confident that this is due to lag (either that or they’re getting tired of helping me test levels [http://forums.massassi.net/html/smile.gif]) so if that’s the case then theres really nothing that can be done about that. Either way it works well enough to suit my needs. Thanks a lot for your help once more. Its great of all of you in this cog forum to provide us amateurs with so much help for free.



[This message has been edited by Mayjur _Typo (edited August 25, 2003).]

↑ Up to the top!