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 → Ladder cog doesn't work in Multiplaying, please help me fix this...
Ladder cog doesn't work in Multiplaying, please help me fix this...
2002-06-12, 5:06 PM #1
here it is

symbols
message activated
message touched
message exited
message entered
message pulse

sector ClimbSector1=-1 linkid=4
sector ClimbSector2=-1 linkid=4
sector ClimbSector3=-1 linkid=4
sector ClimbSector4=-1 linkid=4
sector ClimbSector5=-1 linkid=4
sector Climbsector6=-1 linkid=4

int climbing=0 local
int player local
int x local

end

code


exited: //get off ladder, left the ladder sector
if(climbing==0) return;
player=GetLocalPlayerThing();

//Make sure player did not enter another climbing sector
for(x=0; x<6; x=x+1)
{
if(ClimbSector1[x]!=-1)
if(getthingsector(player)==ClimbSector1[x]) return;
}

ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
detachthing(player);
climbing=0;
return;

entered: //at top of ladder (note: called when reached from top area or when climbing ladder)
if(climbing==1) return;
player=GetLocalPlayerThing();
detachthing(player);
ClearPhysicsFlags(player, 0x1);
SetPhysicsFlags(player, 0x2002);
if(Ladder3DO > -1) attachthingtothing(player,Ladder3DO);
if(LadderTexture > -1) attachthingtosurface(Player, LadderTexture);
climbing=1;
setpulse(0.5);
return;

pulse:

if(climbing==0)
{
setpulse(0);
return;
}
stopthing(getlocalplayerthing());

//Failsafe--make sure player is in a climb sector
for(x=0; x<6; x=x+1)
{
if(ClimbSector1[x]!=-1)
if(getthingsector(player)==ClimbSector1[x]) return;
}
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
detachthing(player);
climbing=0;
return;

end
God Bless,
Adam
2002-06-12, 6:43 PM #2
Your problem is simple:

Player = Getlocalplayerthing();


That command doesnt work correctly in MP. It seems to return the host, instead of the actual 'local' player.


Use 'Newplayer' instead, and make Player equal the senderref.

In other words,
Code:
Newplayer:
Player = Getsenderref();
Stop;



Bingo, problems solved... [http://forums.massassi.net/html/wink.gif]

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-06-13, 5:34 PM #3
Ok, I did what you wanted me to do, but i must of done somthing wrong, because now it doesn't even work, here is the edited one:

symbols
message activated
message touched
message exited
message entered
message pulse

sector ClimbSector1=-1 linkid=4
sector ClimbSector2=-1 linkid=4
sector ClimbSector3=-1 linkid=4
sector ClimbSector4=-1 linkid=4
sector ClimbSector5=-1 linkid=4
sector Climbsector6=-1 linkid=4

int climbing=0 local
int player local
int x local

end

code


exited: //get off ladder, left the ladder sector
if(climbing==0) return;
player=Getsenderref();

//Make sure player did not enter another climbing sector
for(x=0; x<6; x=x+1)
{
if(ClimbSector1[x]!=-1)
if(getthingsector(player)==ClimbSector1[x]) return;
}

ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
detachthing(player);
climbing=0;
return;

entered: //at top of ladder (note: called when reached from top area or when climbing ladder)
if(climbing==1) Newplayer;
Player=Getsenderref();
detachthing(player);
ClearPhysicsFlags(player, 0x1);
SetPhysicsFlags(player, 0x2002);
if(Ladder3DO > -1) attachthingtothing(player,Ladder3DO);
if(LadderTexture > -1) attachthingtosurface(Player, LadderTexture);
climbing=1;
setpulse(0.5);
return;

pulse:

if(climbing==0)
{
setpulse(0);
return;
}
stopthing(Getsenderref());

//Failsafe--make sure player is in a climb sector
for(x=0; x<6; x=x+1)
{
if(ClimbSector1[x]!=-1)
if(getthingsector(player)==ClimbSector1[x]) return;
}
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
detachthing(player);
climbing=0;
return;

end
God Bless,
Adam
2002-06-13, 5:36 PM #4
was i only suppsed to change one of the:

Player = Getlocalplayerthing();
??????????????????????????????????
God Bless,
Adam
2002-06-13, 5:51 PM #5
newplayer is a message, not a command like GetThingFlags(thing); [http://forums.massassi.net/html/rolleyes.gif] I also don't think that GetSenderRef() in the pulse returns the 'player'. replace it with player and try it out. [http://forums.massassi.net/html/smile.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

[edit - bad punctuation]

[This message has been edited by Descent_pilot (edited June 15, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-15, 7:12 AM #6
GBK, How sure are you of that? I thought GetLocalPlayerThing() worked correctly in MP.

Gilgalad, I skimmed over it, and saw a few things there:

GetSenderRef() only returns a thing value in a pulse if you used SetThingPulse() to start it.
AttachThingToSurf() - not surface - does not work properly.
ladder3do is undefined.
laddertexture is undefined.

You need to carefully review your code.

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited June 15, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-06-15, 9:32 AM #7
MP code isnt my area of expertise, but as far as I know, Getlocalplayerthing() returns the host, reguardless of what machine the query is run on.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-06-16, 7:15 PM #8
Didn't you guys already have this arguement?
Cynic (sin'ik) n. One of a sect of ancient Greek philosophers who held that virtue is the ultimate goal of life, their doctrine gradually coming to symbolize insolent self-righteousness.

Drink So-Be, and play longer!
2002-06-16, 7:49 PM #9
Could some one please fix this cog for me? I'm having no luck at all... If you want to mess with the origanal please email me at: [url="mailto:adm4him@aol.com"]mailto:adm4him@aol.com[/url]adm4him@aol.com</A>
God Bless,
Adam

↑ Up to the top!