I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX

Difference between revisions of "UE3:Actor native functions (UDK)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Talk)
m (1 revision: class descriptions for UDK January update (part 1))
(No difference)

Revision as of 05:36, 17 January 2010

UDK Object >> Actor (native functions)

Contents

Actor native functions in other games:
RTNP, U1, UT, U2, U2XMP, UE2Runtime, UT2003, UT2004, UT3
Other member categories for this class:
enums, events, instance functions, internal variables, structs

Native functions

AttachComponent

native final function AttachComponent (ActorComponent NewComponent)

Adds a component to the actor's components array, attaching it to the actor.

Parameters:

  • NewComponent - The component to attach.

AutonomousPhysics

native(3971) final function AutonomousPhysics (float DeltaSeconds)


ChartData

native final function ChartData (string DataName, float DataValue)

Draw some value over time onto the StatChart. Toggle on and off with

ClampRotation

simulated final native function bool ClampRotation (out Object.Rotator out_Rot, Object.Rotator rBase, Object.Rotator rUpperLimits, Object.Rotator rLowerLimits)

Clamps out_Rot between the upper and lower limits offset from the base

ClearAllTimers

native final function ClearAllTimers (optional Object inObj)

Clears all previously set timers

ClearTimer

native final function ClearTimer (optional name inTimerFunc, optional Object inObj)

Clears a previously set timer, identical to calling SetTimer() with a <= 0.f rate.

Parameters:

  • inTimerFunc - the name of the timer to remove or the default one if not specified

Clock

native final function Clock (out float time)


ConsoleCommand

native function string ConsoleCommand (string Command, optional bool bWriteToLog)


ContainsPoint

native final function bool ContainsPoint (Object.Vector Spot)


CreateAudioComponent

native final function AudioComponent CreateAudioComponent (SoundCue InSoundCue, optional bool bPlay, optional bool bStopWhenOwnerDestroyed, optional bool bUseLocation, optional Object.Vector SourceLocation, optional bool bAttachToSelf)


Destroy

native(279) final noexport function bool Destroy ()


DetachComponent

native final function DetachComponent (ActorComponent ExComponent)

Removes a component from the actor's components array, detaching it from the actor.

Parameters:

  • ExComponent - The component to detach.

FastTrace

native(548) noexport final function bool FastTrace (Object.Vector TraceEnd, optional Object.Vector TraceStart, optional Object.Vector BoxExtent, optional bool bTraceBullet)


FindBase

native function FindBase ()

Attempts to find a valid base for this actor

FindSpot

native final function bool FindSpot (Object.Vector BoxExtent, out Object.Vector SpotLocation)


fixedTurn

native final function int fixedTurn (int Current, int Desired, int DeltaRate)

Returns a new rotation component value

Parameters:

  • Current - is the current rotation value
  • Desired - is the desired rotation value
  • DeltaRate - is the rotation amount to apply

ForceUpdateComponents

native function ForceUpdateComponents (optional bool bCollisionUpdate, optional bool bTransformOnly)


GetALocalPlayerController

native final function PlayerController GetALocalPlayerController ()

Return first found LocalPlayerController. Fine for single player, in split screen, one will be picked.

GetAvoidanceVector

final native function Object.Vector GetAvoidanceVector (const out array<ActorObstacles, Object.Vector GoalLocation, float CollisionRadius, float MaxSpeed, optional int NumSamples, optional float VelocityStepRate, optional float MaxTimeTilOverlap)

Calculates a direction (unit vector) to avoid all actors contained in Obstacles list, assuming each entry in Obstacles is also avoiding this actor. Based loosely on RVO as described in http://gamma.cs.unc.edu/RVO/icra2008.pdf .

GetBaseMost

native function Actor GetBaseMost ()

Walks up the Base chain from this Actor and returns the Actor at the top (the eventual Base). this->Base is NULL, returns this.

GetBoundingCylinder

native function GetBoundingCylinder (out float CollisionRadius, out float CollisionHeight) const


GetComponentsBoundingBox

native final function GetComponentsBoundingBox (out Object.Box ActorBox) const


GetDestination

native final virtual function Object.Vector GetDestination (Controller C)

returns the position the AI should move toward to reach this actor accounts for AI using path lanes, cutting corners, and other special adjustments

GetGravityZ

native function float GetGravityZ ()

Get gravity currently affecting this actor

GetTargetLocation

simulated native function Object.Vector GetTargetLocation (optional Actor RequestedBy, optional bool bRequestAlternateLoc) const

Parameters:

  • RequestedBy - the Actor requesting the target location
  • bRequestAlternateLoc - optional) - return a secondary target location if there are multiple

Returns:

the optimal location to fire weapons at this actor

GetTeamNum

simulated native function byte GetTeamNum ()


GetTerminalVelocity

native function float GetTerminalVelocity ()

returns terminal velocity (max speed while falling) for this actor. Unless overridden, it returns the TerminalVelocity of the PhysicsVolume in which this actor is located.

GetTimerCount

native final function float GetTimerCount (optional name inTimerFunc, optional Object inObj)

Gets the current count for the specified timer, defaults to 'Timer' if no function is specified. Returns -1.f if the timer is not currently active.

Parameters:

  • inTimerFunc - the name of the timer to remove or the default one if not specified

GetTimerRate

native final function float GetTimerRate (optional name TimerFuncName, optional Object inObj)

Gets the current rate for the specified timer.

Parameters:

  • TimerFuncName - the name of the function to check for a timer for; 'Timer' is the default

Returns:

the rate for the given timer, or -1.f if that timer is not active

Note: GetTimerRate('SomeTimer') - GetTimerCount('SomeTimer') is the time remaining before 'SomeTimer' is called

GetURLMap

native(547) final function string GetURLMap ()


IsBasedOn

native noexport final function bool IsBasedOn (Actor TestActor)

iterates up the Base chain to see whether or not this Actor is based on the given Actor

Parameters:

  • TestActor - the Actor to test for

Returns:

whether or not this Actor is based on TestActor

IsInPersistentLevel

native final function bool IsInPersistentLevel () const

whether this Actor is in the persistent level, i.e. not a sublevel

IsOverlapping

native noexport final function bool IsOverlapping (Actor A)


IsOwnedBy

native noexport final function bool IsOwnedBy (Actor TestActor)

iterates up the Owner chain to see whether or not this Actor is owned by the given Actor

Parameters:

  • TestActor - the Actor to test for

Returns:

whether or not this Actor is owned by TestActor

IsPlayerOwned

native simulated function bool IsPlayerOwned ()

Searches the owner chain looking for a player.

IsTimerActive

native final function bool IsTimerActive (optional name inTimerFunc, optional Object inObj)

Returns true if the specified timer is active, defaults to 'Timer' if no function is specified.

Parameters:

  • inTimerFunc - the name of the timer to remove or the default one if not specified

MakeNoise

native(512) final function MakeNoise (float Loudness, optional name NoiseType)


ModifyTimerTimeDilation

native final function ModifyTimerTimeDilation (const name TimerName, const float InTimerTimeDilation, optional Object inObj)

This will search the Timers on this actor and set the passed in TimerTimeDilation *

Move

native(266) final function bool Move (Object.Vector Delta)


MoveSmooth

native(3969) noexport final function bool MoveSmooth (Object.Vector Delta)


MovingWhichWay

native function EMoveDir MovingWhichWay (out float Amount)

This will return the direction in LocalSpace that that actor is moving. This is useful for firing off effects based on which way the actor is moving. *

NativePostRenderFor

simulated native function NativePostRenderFor (PlayerController PC, Canvas Canvas, Object.Vector CameraPosition, Object.Vector CameraDir)

Hook to allow actors to render HUD overlays for themselves. Assumes that appropriate font has already been set

PauseTimer

native final function PauseTimer (bool bPause, optional name inTimerFunc, optional Object inObj)

Pauses/Unpauses a previously set timer

Parameters:

  • bPause - whether to pause/unpause the timer
  • inTimerFunc - the name of the timer to pause or the default one if not specified
  • inObj - object timer is attached to

PlayerCanSeeMe

native(532) final function bool PlayerCanSeeMe ()


PlaySound

native noexport final function PlaySound (SoundCue InSoundCue, optional bool bNotReplicated, optional bool bNoRepToOwner, optional bool bStopWhenOwnerDestroyed, optional Object.Vector SoundLocation, optional bool bNoRepToRelevant)


PointCheckComponent

native noexport final function bool PointCheckComponent (PrimitiveComponent InComponent, Object.Vector PointLocation, Object.Vector PointExtent)

Run a point check against just this PrimitiveComponent. Return TRUE if we hit.

NOTE: the actual Actor we call this on is irrelevant!

PrestreamTextures

native function PrestreamTextures (float Seconds, bool bEnableStreaming)

Calls PrestreamTextures() for all the actor's meshcomponents.

Parameters:

  • Seconds - Number of seconds to force all mip-levels to be resident
  • bEnableStreaming - Whether to start (TRUE) or stop (FALSE) streaming

ReattachComponent

native final function ReattachComponent (ActorComponent ComponentToReattach)

Detaches and immediately reattaches specified component. Handles bWillReattach properly.

ResetTimerTimeDilation

native final function ResetTimerTimeDilation (const name TimerName, optional Object inObj)

This will search the Timers on this actor and reset the TimerTimeDilation to 1.0f *

SetBase

native(298) noexport final function SetBase (Actor NewBase, optional Object.Vector NewFloor, optional SkeletalMeshComponent SkelComp, optional name AttachName)


SetCollision

native(262) final noexport function SetCollision (optional bool bNewColActors, optional bool bNewBlockActors, optional bool bNewIgnoreEncroachers)


SetCollisionSize

native(283) final function SetCollisionSize (float NewRadius, float NewHeight)


SetCollisionType

native final function SetCollisionType (ECollisionType NewCollisionType)


SetDrawScale

native final function SetDrawScale (float NewScale)


SetDrawScale3D

native final function SetDrawScale3D (Object.Vector NewScale3D)


SetForcedInitialReplicatedProperty

native final function SetForcedInitialReplicatedProperty (Property PropToReplicate, bool bAdd)

adds/removes a property from a list of properties that will always be replicated when this Actor is bNetInitial, even if the code thinks the client has the same value the server already does This is a workaround to the problem where an LD places an Actor in the level, changes a replicated variable away from the defaults, then at runtime the variable is changed back to the default but it doesn't replicate because initial replication is based on class defaults Only has an effect when called on bStatic or bNoDelete Actors Only properties already in the owning class's replication block may be specified

Parameters:

  • PropToReplicate - the property to add or remove to the list
  • bAdd - true to add the property, false to remove the property

SetHardAttach

native final function noexport SetHardAttach (optional bool bNewHardAttach)


SetHidden

native final function SetHidden (bool bNewHidden)

Changes the value of bHidden.

Parameters:

  • bNewHidden - The value to assign to bHidden.

SetHUDLocation

simulated native function SetHUDLocation (Object.Vector NewHUDLocation)

function used to update where icon for this actor should be rendered on the HUD

Parameters:

  • NewHUDLocation - is a vector whose X and Y components are the X and Y components of this actor's icon's 2D position on the HUD

SetLocation

native(267) final function bool SetLocation (Object.Vector NewLocation)


SetNetUpdateTime

final native function SetNetUpdateTime (float NewUpdateTime)

Updates NetUpdateTime to the new value for future net relevancy checks

SetOnlyOwnerSee

native final function SetOnlyOwnerSee (bool bNewOnlyOwnerSee)

changes the value of bOnlyOwnerSee

Parameters:

  • bNewOnlyOwnerSee - the new value to assign to bOnlyOwnerSee

SetOwner

native(272) final function SetOwner (Actor NewOwner)


SetPhysics

native(3970) noexport final function SetPhysics (EPhysics newPhysics)


SetRelativeLocation

native final function bool SetRelativeLocation (Object.Vector NewLocation)


SetRelativeRotation

native final function bool SetRelativeRotation (Object.Rotator NewRotation)


SetRotation

native(299) final function bool SetRotation (Object.Rotator NewRotation)


SetTickGroup

native final function SetTickGroup (Object.ETickingGroup NewTickGroup)

Changes the ticking group for this actor

SetTickIsDisabled

native final function SetTickIsDisabled (bool bInDisabled)

turns on or off this Actor's desire to be ticked (bTickIsDisabled) because this is implemented as a separate tickable list, calls to this function to disable ticking will not take effect until the end of the current list to avoid shuffling elements around while they are being iterated over

SetTimer

native(280) final function SetTimer (float InRate, optional bool inbLoop, optional name inTimerFunc, optional Object inObj)

Sets a timer to call the given function at a set interval. Defaults to calling the 'Timer' event if no function is specified. If InRate is set to 0.f it will effectively disable the previous timer.

NOTE: Functions with parameters are not supported!

Parameters:

  • InRate - the amount of time to pass between firing
  • inbLoop - whether to keep firing or only fire once
  • inTimerFunc - the name of the function to call when the timer fires

SetZone

native final noexport function SetZone (bool bForceRefresh)

updates the zone/PhysicsVolume of this Actor

Parameters:

  • bForceRefresh - forces the code to do a full collision check instead of exiting early if the current info is valid

Spawn

native noexport final function coerce Actor Spawn (class<ActorSpawnClass, optional Actor SpawnOwner, optional name SpawnTag, optional Object.Vector SpawnLocation, optional Object.Rotator SpawnRotation, optional Actor ActorTemplate, optional bool bNoCollisionFail)

Spawn an actor. Returns an actor of the specified class, not of class Actor (this is hardcoded in the compiler). Returns None if the actor could not be spawned (if that happens, there will be a log warning indicating why) Defaults to spawning at the spawner's location.

Note: ActorTemplate is sent for replicated actors and therefore its properties will also be applied at initial creation on the client. However, because of this, ActorTemplate must be a static resource (an actor archetype, default object, or a bStatic/bNoDelete actor in a level package) or the spawned Actor cannot be replicated

SuggestTossVelocity

native noexport final function bool SuggestTossVelocity (out Object.Vector TossVelocity, Object.Vector Destination, Object.Vector Start, float TossSpeed, optional float BaseTossZ, optional float DesiredZPct, optional Object.Vector CollisionSize, optional float TerminalVelocity, optional float OverrideGravityZ, optional bool bOnlyTraceUp)


SupportsKismetModification

native final virtual function bool SupportsKismetModification (SequenceOp AskingOp, out string Reason) const

whether this Actor can be modified by Kismet actions primarily used by error checking to warn LDs when their Kismet may not apply changes correctly (especially on clients)

Parameters:

  • AskingOp - Kismet operation to which this Actor is linked
  • Reason - out) - If this function returns false, contains the reason why the Kismet action is not allowed to execute on this Actor

Returns:

whether the AskingOp can correctly modify this Actor

Trace

native(277) noexport final function Actor Trace (out Object.Vector HitLocation, out Object.Vector HitNormal, Object.Vector TraceEnd, optional Object.Vector TraceStart, optional bool bTraceActors, optional Object.Vector Extent, optional out TraceHitInfo HitInfo, optional int ExtraTraceFlags)

Trace a line and see what it collides with first. Takes this actor's collision properties into account. Returns first hit actor, Level if hit level, or None if hit nothing.

TraceAllPhysicsAssetInteractions

native noexport final function bool TraceAllPhysicsAssetInteractions (SkeletalMeshComponent SkelMeshComp, Object.Vector EndTrace, Object.Vector StartTrace, out array<ImpactInfoout_Hits, optional Object.Vector Extent)


TraceComponent

native noexport final function bool TraceComponent (out Object.Vector HitLocation, out Object.Vector HitNormal, PrimitiveComponent InComponent, Object.Vector TraceEnd, optional Object.Vector TraceStart, optional Object.Vector Extent, optional out TraceHitInfo HitInfo, optional bool bComplexCollision)

Run a line check against just this PrimitiveComponent. Return TRUE if we hit.

NOTE: the actual Actor we call this on is irrelevant!

UnClock

native final function UnClock (out float time)


WillOverlap

final native function bool WillOverlap (Object.Vector PosA, Object.Vector VelA, Object.Vector PosB, Object.Vector VelB, float StepSize, float Radius, out float Time)

Steps from each position given the respective velocities performing simple radius checks