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 → Grav Switch.
Grav Switch.
2000-11-19, 2:24 AM #1
I have this cog, it changes the gravity in a level, but when i use it in a multiplayer level, it only changes the gravity for the host, how can i change it so it effects everyone? I think i might have to add the 0x100 flag somewhere, but i dont know where.

Here is the code:
Code:
# Jedi Knight Cog Script
#
# 00_gravswitch.cog
#
# This COG will change the gravity of the entire level when activated.
# Has three settings: low, medium, and high. Each activation changes the
# setting. Low gravity makes multiplayer games very...interesting. :P
# Make the switch a thing - one of those consoles would be nice.
# Also plays a sound when used. :-)
# 
# This file is not supported by LucasArts Entertainment Company
# Scripted 1998 by Zero.

symbols

message     activated

flex		number1	local

thing		console

sound		gravalarm

end

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

code

activated:
	number1 = GetGravity();

	PlaySoundGlobal(gravalarm, 1.0, 0.0, 0x10000);

	if(number1 == 1)
	{
		print("Gravity Level: normal");
		SetGravity(4.0);
		number1 == 4;
		return;
	}
	if(number1 == 4)
	{
		print("Gravity Level: high");
		SetGravity(7.0);
		number1 == 7;
		return;
	}
	if(number1 == 7)
	{
		print("Gravity Level: low");
		SetGravity(1.0);
		number1 == 1;
		return;
	}
	
	return;
end


------------------
"It's been, one week since we got the scene, cheating lovers and cousians that marry,
5 days since they had the show with the hermaphrodite, the slut and the crack ho,
3 days since we heard the tale about the guy who learned his woman was a shemale,
yesterday it occured to me, that i've been watching a bit too much jerry springer!"
2000-11-19, 7:55 PM #2
If your going to add the flag, it needs to be inserted before the symbols as "flags=0xXXX", where "X" is the number you want.

Hope that helps...

------------------
"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
2000-11-20, 6:10 AM #3
Well, i added the flag, but there is a slight technical difficulty, it doesnt work, now i have added new messeges to it. But that shouldent effect it, here is the code so far:
Code:
# Jedi Knight Cog Script
#
# 00_gravswitch.cog
#
# This COG will change the gravity of the entire level when activated.
# Has three settings: low, medium, high, and off. Each activation changes the
# setting. Low gravity makes multiplayer games very...interesting. :P
# Make the switch a thing - one of those consoles would be nice.
# Also plays a sound when used. :-)
#
#  
# This file is not supported by LucasArts Entertainment Company
# Scripted 1998 by Zero.
flags=0x100 
symbols

message     activated

flex		number1	local

thing		console

sound		gravalarm

end

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

code

activated:
	number1 = GetGravity();

	PlaySoundGlobal(gravalarm, 1.0, 0.0, 0x10000);

	if(number1 == 0)
	{
		print("Station Gravity Level At: 1.0 *Normal*");
		SetGravity(4.0);
		number1 == 4;
		return;
	}
	if(number1 == 4)
	{
		print("Station Gravity Level At: 7.0 !Caution Recomended"");
		SetGravity(7.0);
		number1 == 7;
		return;
	}
	if(number1 == 7)
	{
		print("Station Gravity Level At: 1.0 Low !Caution Recomended!");
		SetGravity(1.0);
		number1 == 1;
		return;
	}
	if(number1 == 1)
	{
		print("*!WARNING STATION GRAVITY SYSTEMS OFFLINE LEVEL AT 0.0: If You Jump... You Will Not Come Down!*");
		SetGravity(0.0);
		number1 == 0;
		return;
	}
	return;
end

Can anyone see any problems with it, i can't but i dont really know what to look for...

[This message has been edited by TSS_CapricusLDR (edited November 20, 2000).]
2000-11-22, 5:04 AM #4
You have double quotes closing the string in your second print command.

[This message has been edited by The Orkin Man (edited November 22, 2000).]
2000-11-24, 10:23 AM #5
COGwirter
helps in these sticky situations
I'm just an old man with a skooma problem.

↑ Up to the top!