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
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
Adam