Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 |
/** * * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. */ class GameCrowdAgentBehavior extends Object native abstract; /** If true, agent should idle (not move between destinations)/ */ var() bool bIdleBehavior; /** actor to aim at during actions */ var actor ActionTarget; /** Agent must be within this distance of the player to perform this behavior */ var() float MaxPlayerDistance; /** If true, must face action target before starting behavior */ var() bool bFaceActionTargetFirst; /** If true, pass on to agents encountered */ var() bool bIsViralBehavior; /** * So for some behaviors we only want the original agents to be able to pass on the bViralBehavior flag. * You will want to check for this flag in your specific behavior's event PropagateViralBehaviorTo. * * NOTE: Currently, there is no default implementation of that that we are are all calling super. to utilize that functionality * **/ var() bool bPassOnIsViralBehaviorFlag; /** * How long we should propagate the viral behavior. Basically, you can get into situations where the the behavior will never go away as it * keeps getting propagated to others over and over and the various timers get started again. */ var() float DurationOfViralBehaviorPropagation; /** This is the time we will stop propagating the bIsViralBehavior flag **/ var transient float TimeToStopPropagatingViralBehavior; /** true when agent is currently panicked */ var bool bIsPanicked; /** Agent currently implementing this behavior instance */ var GameCrowdAgent MyAgent; /** * Called every tick when agent is currently idle (because bIdleBehavior is true) * * @RETURN true if should end idle (bIdleBehavior should also become false) */ native function bool ShouldEndIdle(); /** * Agent's current behavior gets ticked */ native function Tick(float DeltaTime); /** * This function is called on an archetype - do not modify any properties here! */ function bool CanBeUsedBy(GameCrowdAgent Agent, vector CameraLoc) { return VSizeSq(CameraLoc - Agent.Location) < MaxPlayerDistance*MaxPlayerDistance; } /** * Event when agent is facing action target, called if bFaceActionTarget=true */ event FinishedTargetRotation(); /** * Handles movement destination updating for agent. * * @RETURNS true if destination updating was handled */ native function bool HandleMovement(); /** * Called when Agent activates this behavior */ function InitBehavior(GameCrowdAgent Agent) { MyAgent = Agent; if( DurationOfViralBehaviorPropagation > 0.0f ) { TimeToStopPropagatingViralBehavior = MyAgent.WorldInfo.TimeSeconds + DurationOfViralBehaviorPropagation; } } /** * Called when Agent stops this behavior */ function StopBehavior() { } /** * Anim end notification called by GameCrowdAgent.OnAnimEnd(). */ event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime); /** * Get debug string about agent behavior */ function string GetBehaviorString() { return "Behavior: "$self; } /** * Notification that MyAgent is changing destinations */ function ChangingDestination(GameCrowdDestination NewDest); /** * Returns action agent wants behavior to be moving toward. */ function Actor GetDestinationActor() { return MyAgent.CurrentDestination; } /** * Called if agent wants to provide an action target to its behavior. */ function ActivatedBy(Actor NewActionTarget) { ActionTarget = NewActionTarget; } /** * When two agents encounter each other, and one has a viral behavior and the other doesn't, * the viral behavior is called to have a chance to propagate itself to the uninfected OtherAgent. */ event PropagateViralBehaviorTo(GameCrowdAgent OtherAgent); /** * Return true if agent is allowed to go to destination while performing this behavior */ function bool AllowThisDestination(GameCrowdDestination Destination) { return true; } /** * return true if get kismet or new behavior from this destination */ function bool AllowBehaviorAt(GameCrowdDestination Destination) { return true; } defaultproperties { MaxPlayerDistance=10000.0 bPassOnIsViralBehaviorFlag=TRUE } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |