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 → PA Cog
PA Cog
2001-06-14, 12:50 AM #1
I had a problem with this cog a while back but now I have it cornered and working somewhat correctly.

While I was testing it alone it looked like it worked fine.. but when I went to actually implement with one of my friends I discovered that no matter who touches the switch it prints my name where it should place the name of the player that touched the switch:

===========================================
activated:

playsoundpos(beep, SurfaceCenter (printswitch), 1, -1, -1, 0);

If(status==1) Return;
status=1;

jkStringClear();
jkStringConcatUNIString(unistring0);
jkStringConcatSpace();
jkStringConcatPlayerName(player);
jkStringConcatSpace();
jkStringConcatUNIString(unistring1);
jkStringOutput(-3, -1);
SetTimer(delay);
Return;
============================================

I am guessing it has to do with identifying who "player" is. Little help?

------------------
~~~~~~~~~~~~~~~~~~~~~~~~~

"That's the Force for you... So much power, so many holes to fall into."


Jedi Master Labri
~~~~~~~~~~~~~~~~~~~~~~~~~

"That's the Force for you... So much power, so many holes to fall into."


Jedi Master Labri
2001-06-14, 6:20 AM #2
add player = GetSenderRef(); after the activated message
2001-06-14, 1:59 PM #3
Yeah he's right. It just assumed that you wanted it to think you hit the switch. Oops. lol
2001-06-15, 7:40 AM #4
Almost there..
===========================================
activated:
player = GetSenderRef();
playsoundpos(beep, SurfaceCenter (printswitch), 1, -1, -1, 0);

If(status==1) Return;
status=1;

jkStringClear();
jkStringConcatUNIString(unistring0);
jkStringConcatSpace();
jkStringConcatPlayerName(player);
jkStringConcatSpace();
jkStringConcatUNIString(unistring1);
jkStringOutput(-3, -1);
SetTimer(delay);
Return;
============================================

Now when I press the switch I get:

Part1 (Space). Part2

Now I dont get any name at all [http://forums.massassi.net/html/smile.gif]
Any suggestions?

------------------
~~~~~~~~~~~~~~~~~~~~~~~~~

"That's the Force for you... So much power, so many holes to fall into."


Jedi Master Labri

[This message has been edited by Jedi Master Labri (edited June 15, 2001).]
~~~~~~~~~~~~~~~~~~~~~~~~~

"That's the Force for you... So much power, so many holes to fall into."


Jedi Master Labri
2001-06-15, 8:12 AM #5
do you have player defined in the symbols?
2001-06-15, 1:21 PM #6
You might be better having the cog run locally on each machine.

Add 'flags=0x240' above the symbols section of your cog. This will make the cog run locally and unsynced. Since all your cog does is broadcast a message, this will work well.

Now on to your code:

Code:
startup:
  player=GetLocalPlayerThing();
Return;

activated:
playsoundpos(beep, SurfaceCenter (printswitch), 1, -1, -1, 0);

If(status==1) Return;
status=1;

jkStringClear();
jkStringConcatUNIString(unistring0);
jkStringConcatSpace();
jkStringConcatPlayerName(player);
jkStringConcatSpace();
jkStringConcatUNIString(unistring1);
jkStringOutput(-3, -1);
SetTimer(delay);
Return;



Raynar

------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis

↑ Up to the top!