Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UnrealGame.SpecialVehicleObjective


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
// SpecialVehicleObjectives are used to mark the end of special paths that a vehicle is required to reach, but have something a vehicle cannot
// get (like a pickup). Bots will only consider following one of these paths if it is enabled and the bot is controlling a vehicle of one the
// allowed classes. When they reach this point, they will exit the vehicle and continue to the associated actor on foot.

class SpecialVehicleObjective extends RoadPathNode;

var() array<class<Vehicle> > AccessibleVehicleClasses; //classes of vehicles that are capable of reaching this point
var() name AssociatedActorTag;
var() float MaxDist; //if greater than 0, bots will never go here unless they are already this close
var Actor AssociatedActor;
var bool bEnabled;
var SpecialVehicleObjective NextSpecialVehicleObjective;
var Pawn TeamOwner[4]; //AI pawns currently headed to this point

function PostBeginPlay()
{
    local UnrealMPGameInfo G;

    Super.PostBeginPlay();

    foreach AllActors(class'Actor', AssociatedActor, AssociatedActorTag)
        break;

    G = UnrealMPGameInfo(Level.Game);
    if (G != None)
    {
        NextSpecialVehicleObjective = G.SpecialVehicleObjectives;
        G.SpecialVehicleObjectives = self;
    }
}

function bool IsAccessibleTo(Pawn BotPawn)
{
    local int i;

    if (!bEnabled || (MaxDist > 0 && VSize(BotPawn.Location - Location) > MaxDist))
        return false;

    for (i = 0; i < AccessibleVehicleClasses.length; i++)
        if (ClassIsChildOf(BotPawn.Class, AccessibleVehicleClasses[i]))
            return true;

    return false;
}

function Trigger(Actor Other, Pawn EventInstigator)
{
    bEnabled = false;
}

function Untrigger(Actor Other, Pawn EventInstigator)
{
    if (AssociatedActor != None)
        bEnabled = true;
}

function Reset()
{
    bEnabled = false;
}

defaultproperties
{
     bNotBased=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:38:48.000 - Creation time: Wed 7/2/2007 19:16:51.953 - Created with UnCodeX