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 → Debuggin'
Debuggin'
2001-05-07, 4:36 PM #1
I just made a cog for my level so that you can pick whether you have a Jan skin or a Kyle skin and they have different points to spawn at when they pick their skin, but it doesn't work. I suspect that it has something to do with the GetSource Ref or jkGetLocalPlayerThing.

Here it is:

Code:
# The Gender Choice for the begining of my level.
# [scott_karana]

symbols

thing player local
thing manspawn  //ghost for the spawn
thing womanspawn  // see above comment... :P
model male=ky.3do local
model female=kya10.3do local
surface man linkid=1
surface woman linkid=2
message activated
end

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

code

player=jkGetLocalPlayerThing;
activated:
if (GetSourceRef==player)
{
if (GetSenderID() == 1)
{
Teleport(player,manspawn);
SetThingModel(player,male);
}
if (GetSenderID() == 2)
{
Teleport(player,womanspawn);
SetThingModel(player,female);
}
}

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

end

Can someone help? Oh, and sorry for picking on the guy who kept asking about gamma. I'm havin' the same problem now... [http://forums.massassi.net/html/redface.gif] j/k,j/k!!! [http://forums.massassi.net/html/biggrin.gif]
Hey, I'm here! But who cares?
2001-05-08, 9:05 AM #2
There are a few problems with the code. The
player=jkGetLocalPlayerThing; statement needs to follow the Activated: message - otherwise it isn't carried out. There needs to be a return; statement at the end. Hope that helps. [http://forums.massassi.net/html/smile.gif]

Code:
# The Gender Choice for the begining of my level.
# [scott_karana]
symbols
thing player local
thing manspawn  //ghost for spawning the male model
thing womanspawn  // see above comment... :P
model male=ky.3do local
model female=kya10.3do local
surface man linkid=1
surface woman linkid=2
message activated
end
# =======================================
code
activated:
player=jkGetLocalPlayerThing;
if (GetSourceRef==player)
  {
  if (GetSenderID() == 1)
    {
    Teleport(player,manspawn);
    SetThingModel(player,male);
    }
  else if (GetSenderID() == 2)
    {
    Teleport(player,womanspawn);
    SetThingModel(player,female);
    }
  }
return;
end


------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton

[This message has been edited by Sylvicolus (edited May 08, 2001).]
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-05-08, 10:07 AM #3
And shouldn't the
Code:
if (GetSourceRef==player)
{
if (GetSenderID() == 1)
{

be written as
Code:
if(GetSourceRef==player && GetSenderID() == 1) 
Gravity isn't MY fault--I voted for velcro.
2001-05-08, 10:11 AM #4
Doesn't have to be.

------------------
Together we stand.
Divided we fall.
2001-05-08, 11:21 AM #5
Oh thanks, I don't believe that I missed that! Wow, CogWriter's syntax checker needs to be improved...
Hey, I'm here! But who cares?
2001-05-08, 1:36 PM #6
Boba Rhett, the code is checking whether the linkid is = 1 or = 2 so those if statements are separate.
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-05-10, 5:58 AM #7
Oh, hehe, it's TeleportThing, not Teleport... [http://forums.massassi.net/html/biggrin.gif] GOTCHA!
Hey, I'm here! But who cares?

↑ Up to the top!