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 → how do you make this cog local so everyone feels the effects
how do you make this cog local so everyone feels the effects
2001-07-11, 5:13 PM #1
I have imported the 00_Grav_Switch off this site into my level and when i hosted a serial connection i noticed that only the host gets the results of it here is the code:

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

2001-07-11, 6:51 PM #2
make it:

Code:
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");
SendTrigger(-1, 999, 4, 0, 0, 0);
number1 == 4;
return;
}
if(number1 == 4)
{
// print("Gravity Level: high");
SendTrigger(-1, 999, 7, 0, 0, 0);
number1 == 7;
return;
}
if(number1 == 7)
{
// print("Gravity Level: low");
SendTrigger(-1, 999, 1, 0, 0, 0);
number1 == 1;
return;
}
return;
end


Then in a local cog, like kyle.cog add the

message trigger

to symbols and add this code in local cog.

Code:
trigger:

if(GetSourceRef() == 999)
{
SetGravity(GetParam(0));
if(Param(0) == 4) Print("Gravity Level: NORMAL");
if(Param(0) == 7) Print("Gravity Level: HIGH");
if(Param(0) == 1) Print("Gravity Level: LOW");
}
Return;

↑ Up to the top!