Here is the code i used, Comments by me :
Code:
class SW_LadderVolume extends LadderVolume placeable;
var(SW_Ladder) rotator NewWallDirection;
// From Epics LadderVolume:
simulated event PostBeginPlay()
{
local Ladder L, M;
local vector Dir;
Super.PostBeginPlay();
//WallDir = Rotation;
// This is where NewWallDirection is passed to WallDir.
WallDir = NewWallDirection;
LookDir = vector(WallDir);
if ( !bAutoPath && (LookDir.Z != 0) )
{
ClimbDir = vect(0,0,1);
for ( L=LadderList; L!=None; L=L.LadderList )
for ( M=LadderList; M!=None; M=M.LadderList )
if ( M != L )
{
Dir = Normal(M.Location - L.Location);
if ( (Dir dot ClimbDir) < 0 )
Dir *= -1;
ClimbDir += Dir;
}
ClimbDir = Normal(ClimbDir);
if ( (ClimbDir Dot vect(0,0,1)) < 0 )
ClimbDir *= -1;
}
}
defaultproperties
{
}
Bookmarks