There is no spoon

Legacy:BlockablePath

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Unfortunately a BlockedPath is an one-way actor; once it is triggered, there is no way to make it blocked again. However, it would be simple enough to create a two-way BlockedPath with just a few lines of UnrealScript, and it even works. Also note that setting a path node's ExtraCost to anything less than said 100,000,000 doesn't reliably prevent bots from using this path. (...fill in detailed description here.)

The code necessary to make a BlockedPath actor that can be toggled follows below. Create A Subclass explains how to add this to a map.

class BlockablePath extends NavigationPoint
 
var() bool bInitiallyActive
 
function Trigger( actor Other, pawn EventInstigator )
{
     bInitiallyActive=!bInitiallyActive;
 
     if (bInitiallyActive)
         ExtraCost=100000000;
     else
         ExtraCost=0;
 }
 
 function PostBeginPlay()
 {
     if (bInitiallyActive)
         ExtraCost=100000000;
     else
         ExtraCost=0;
 }

Comments[edit]

PiX So does this custom class replicate on dedicated servers?

Wormbo: Paths are generally only used on the server. There's absolutely no need to replicate them.