Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Legacy:BlockablePath

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 01:55, 18 November 2007 by Wormbo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.