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 → What's up with my cogs??
What's up with my cogs??
2000-12-14, 9:11 AM #1
A friend and I beta tested Dralloc Arena for the first time yesterday, and we stumbled upon this little problem.

When playing multiplayer, only the host experiences the COG work. For example, I have a cog named TJC_ROT.cog. It is used to rotate a thing. While playing, the host sees the thing rotate, but not the client (joiner). I have about 3 other cogs that do the same thing.

Any ideas why this is doing this to me? I have 6 days until I gotta release this level, so I GOTTA fix it! Any help would be greatly appreciated. [http://forums.massassi.net/html/smile.gif]

------------------
BeefCaike - Creator Of The Most Anticipated Level Series For Jedi Knight! The Dralloc Series
2000-12-14, 10:23 AM #2
Post the cogs. Chances are, the verbs that make the event happen are local-only, and you'll need to use SendTrigger().

-Jipe
2000-12-14, 11:01 AM #3
Here is the Shield Replenishing one...

Code:
# Shield Replenishing Cog
# By FantomJedi@AOL.com
#

symbols

sector	     powerup
sound	     uppower
int         player                           local
message     startup
message     entered

end

#           :þ

code

#           :þ

startup:
player = GetLocalPlayerThing();
   SetInv(player, 60, 100); 

return;

#           :þ

entered:
   // Secret already visited
   if (powerup = getcursector()) 
ChangeInv(player, 60, 200.0);
  PlaySoundLocal(uppower, 2, 0, 0x0);

Return;

end


Here is the Rotating Thing cog...

Code:
# 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


and the LEC Damage Sector cog. I used it to heal instead of damage by using a negative variable.

Code:
# Jedi Knight Cog Script
#
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# 00_sectordamage.cog
#
# Apply constant amount of damage to a player in a sector.
# Sector can heal instead, if a negative number is used for the "damage" variable.
#
# 01/31/97 [CYW]
# 04/14/97 [YB]  Disabled the pulse if the damageSector is not linked in
#                Reduced the damageInterval and increased the damage
# 06/27/97 [DB]  Changed damage type to 0x1


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

symbols

message		startup
message		pulse

sector		damageSector			# the deadly sector.

flex		damageInterval=1.0		# how often damage is applied in seconds.
flex		damage=4.0			# how much damage is applied

thing		victim		local		# actors and players affected.
int		type		local

end

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

code

# ........................................................................................

startup:
	if(damageSector > -1) SetPulse(damageInterval);
	return;

# ........................................................................................

pulse:
	victim = FirstThingInSector(damageSector);
	while (victim != -1)
	{
		type = GetThingType(victim);
		// If we have an actor (2) or a player (10)
		if ((type==2) | | (type==10))
		{
			// Do the damage or healing.
			if (damage > 0)
			{								
				DamageThing(victim, damage, 0x1, victim);
			}
			else
			{
				HealThing(victim, -damage);
			}
		}
		victim = NextThingInSector(victim);
	}
	return;

# ........................................................................................

end


There can't be much wrong with that one, but it still doesn't work right when you are the client. Could it be that there is one cog causing all the problems with all the others? I have little knowledge when it comes to proper coding of cogs, so bare with me. [http://forums.massassi.net/html/smile.gif]

Thanks!

------------------
BeefCaike - Creator Of The Most Anticipated Level Series For Jedi Knight! The Dralloc Series
2000-12-14, 5:35 PM #4
here is what is wrong
if (powerup = getcursector())
ChangeInv(player, 60, 200.0);
PlaySoundLocal(uppower, 2, 0, 0x0);

use this

if (GetThingSector(playerx) == powerup)
{
ChangeInv(player, 60, 200.0);
PlaySoundLocal(uppower, 2, 0, 0x0);
}

------------------
Keith: "Perhaps there was an age in which people had Knowledge of Magic..."
Keith: "Perhaps there was an age in which people had Knowledge of Magic..."
JK cogs
2000-12-18, 4:54 AM #5
Thanks Keith, I'll try it! [http://forums.massassi.net/html/smile.gif]

------------------
BeefCaike - Creator Of The Most Anticipated Level Series For Jedi Knight! The Dralloc Series

↑ Up to the top!