Always snap to grid

UE2:Actor native functions (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT2004 Object >> Actor (native functions)

Contents

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


[edit]

Audio functions

Sound playback

DemoPlaySound

native simulated event DemoPlaySound (Sound Sound, optional ESoundSlot Slot, optional float Volume, optional bool bNoOverride, optional float Radius, optional float Pitch, optional bool Attenuate)

Internal function to records sounds when recording demos. "Replicates" sound playback to the DemoRecSpectator. You shouldn't have to call this directly as it is automatically called by PlaySound and PlayOwnedSound when a demo is being recorded locally.

GetSoundDuration

native final function float GetSoundDuration (Sound Sound)

Returns the length of a sound in real seconds, i.e. not scaled by Level.TimeDilation.

PlayOwnedSound

native simulated final function PlayOwnedSound (Sound Sound, optional ESoundSlot Slot, optional float Volume, optional bool bNoOverride, optional float Radius, optional float Pitch, optional bool Attenuate)

Plays a sound locally. When called on a server, the sound is played locally and broadcasted to all clients that could possibly hear the sound, except to the client owning the actor. Clientsidely this function just plays the sound.

The idea behind this selective broadcasting is that the client knows when to play the sound through its own simulation code. This makes it easier to e.g. synchronize sounds to the animations of the selected weapon.

Parameters
See PlaySound. The only difference is that Attenuate defaults to False because this function's main use is for playing sounds of the selected weapon and other player inventory.

PlaySound

native(264) final function PlaySound (Sound Sound, optional ESoundSlot Slot, optional float Volume, optional bool bNoOverride, optional float Radius, optional float Pitch, optional bool Attenuate)

Plays a sound, optionally with additional parameters like volume and sound pitch.

This is the only function where it matters where it was called from: Serversidely PlaySound determines whether it should broadcast the sound playback to all clients by examinating whether it was called from a simulated function. If it was, the sound will only be played locally for a listen server or serverside demorecording. If the calling function does not have the simulated modifier, the sound is broadcasted to all players that could potentially hear the sound. Clientsidely this function just plays the sound.

Parameters
  • Sound - the sound to play. Could also be a SoundGroup or ProceduralSound.
  • Slot - a sound slot to play the sound in. Only one sound can play per actor and slot. Never use SLOT_Ambient here, use the AmbientSound property instead. Defaults to SLOT_Misc if omitted.
  • Volume - the volume to play the sound at. Defaults to TransientSoundVolume. If the actor has an Instigator that owns the actor or if the Actor is its own Instigator, the volume is scaled by the Instigator's SoundDampening value.
  • bNoOverride - prevents the sound from being overridden by later sounds being played in the same sound slot of the same actor. Defaults to False.
  • Radius - overrides the sound's default radius. Defaults to TransientSoundRadius if omitted. If zero, the sound's default radius.
  • Pitch - overrides the playback pitch of the sound. Values greater than 1.0 speed up the sound and make it sound higher, values less than 1.0 make it slower and sound deeper. Defaults to 1.0 if omitted.
  • Attenuate - whether to use 3D positional playback for the player owning the actor playing the sound. Defaults to True. Specifying False has no effect if the actor is not owned by the player hearing the sound. For replicated sounds this only has an effect if the actor playing the sound is relevant to the client.

Music playback

AdjustVolume

native final function bool AdjustVolume (int Handle, float NewVolume)

Sets the volume of the stream identified by the handle value.

AllowMusicPlayback

native final function AllowMusicPlayback (bool Allow)

Changes whether regular game music should be played. Used by the music player to disable map music while playing custom music. Does not affect stream music.

PauseStream

native final function bool PauseStream (int Handle)

Pauses the music stream specified by the handle value.

PlayMusic

native final function int PlayMusic (string Song, optional float FadeInTime)

Creates a new game music track and starts playing the specified song through it. Returns a handle value for the track, which can be used to stop only this music track with StopMusic().

PlayStream

native final function int PlayStream (string Song, optional bool UseMusicVolume, optional float Volume, optional float FadeInTime, optional float SeekTime)

Creates a new music stream and starts playing it. Returns a handle value for the stream, which can be used to pause or stop the playback or change the volume.

SeekStream

native final function int SeekStream (int Handle, float Seconds)

Sets a new playback position on the music stream identified by the handle value.

StopAllMusic

native final function StopAllMusic (optional float FadeOutTime)

Stops all game music tracks currently playing.

StopMusic

native final function StopMusic (int SongHandle, optional float FadeOutTime)

Stops the game music track identified by the handle value.

StopStream

native final function StopStream (int Handle, optional float FadeOutTime)

Stops the stream music track identified by the handle value.

Text-to-speech

TextToSpeech

native function TextToSpeech (string Text, float Volume)

Used the operating system's text-to-speech system (if available) to synthesize voice output.

Parameters
  • Text - the text to speak.
  • Volume - the output volume.


[edit]

Physics functions

Unreal physics functions

AttachToBone

native final function bool AttachToBone (Actor Attachment, name BoneName)

Attaches another actor to a specific skeletal mesh bone of this actor. If no bone name was specified, the actor is directly attached to this actor. Returns False on failure, including when this actor does not have a mesh.

As part of the attachment process, the other actor's Base is set to this actor and the actor is added to this actor's Attached array.

AutonomousPhysics

native(3971) final function AutonomousPhysics (float DeltaSeconds)


DetachFromBone

native final function bool DetachFromBone (Actor Attachment)

Undoes the effects of AttachToBone(Attachment) by separating the specified actor from this actor. Returns False if this actor does not have a mesh to detach the specified actor from.

FastTrace

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

Performs a zero-width line trace from TraceStart to TraceEnd (both absolute world coordinates) and returns True if it did not hit any world geometry between the two points.

GetClosestBone

native final function name GetClosestBone (Object.Vector loc, Object.Vector ray, out float boneDist, optional name BiasBone, optional float BiasDistance)

If the actor has a skeletal mesh, this function will return the name of the bone closest to the specified trace ray. The BiasBone will be preferred if it is not further away from the trace ray than BiasDist. If no BiasBone was specified or the trace ray didn't get close enough to it, the closest bone to the trace ray is returned.

The most important use for this function is to detect locational hits, especially head shots with the sniper rifle (ClassicSniperRifle) and lightning gun (SniperRifle).

IsJoinedTo

native final function bool IsJoinedTo (Actor Other)

Checks whether this actor is somehow joined to the other actor, either through regular attachment with AttachToBone or SetBase functions or via any KConstraint actor.

Move

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

Moves this actor by the delta vector and checks for collisions according to the actor's collision settings. Unlike SetLocation, the collision checks are performed for the entire movement path.

MoveSmooth

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

Smoothly moves the actor by the delta vector and checks for collisions according to the actor's collision settings. Like Move, collision checks are performed for the entire path, but additionally the actor is moved along a hit wall instead of just stopping there.

OnlyAffectPawns

native final function OnlyAffectPawns (bool B)

Modifies the value of bOnlyAffectPawns, i.e. whether this actor ignores any collisions with non-Pawn actors.

SetBase

native(298) final function SetBase (Actor NewBase, optional Object.Vector NewFloor)

Attaches the actor to a new base actor and optionally specifies a new floor normal.

SetCollision

native(262) final function SetCollision (optional bool NewColActors, optional bool NewBlockActors, optional bool NewBlockPlayers)

Adjusts this actor's collision settings. Another important collision setting, bCollideWorld, can be manipulated directly.

SetCollisionSize

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

Sets the size of this actor's collision cylinder.

SetLocation

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

Sets this actor's Location. At the target location, a collision check is performed according to the collision settings. If this actor collides with world geometry and the target location is inside a wall, SetLocation first attempts to adjust the location so the actor fits there. If that fails, the actor stays where it was before the SetLocation call and this function returns False.

SetPhysics

native(3970) final function SetPhysics (EPhysics newPhysics)

Adjusts the actor's Physics mode.

SetRelativeLocation

native final function bool SetRelativeLocation (Object.Vector NewLocation)

Sets the RelativeLocation for an attached actor.

SetRelativeRotation

native final function bool SetRelativeRotation (Object.Rotator NewRotation)

Sets the RelativeRotation for an attached actor.

SetRotation

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

Sets the Rotation of this actor. If the actor does not fit in its current location due to the newly aligned collision shape, this function returns False. Note that the default collision cylinder is not actually affected by thew actor's rotation.

SuggestFallVelocity

native final function Object.Vector SuggestFallVelocity (Object.Vector Destination, Object.Vector Start, float MaxZ, float MaxXYSpeed)

Attempts to calculate a velocity vector so that an actor starting at Start ends up at Destination if only affected by gravity. The MaxZ and MaxXYSpeed parameters specify the maximum vertical and horizontal velocity magnitudes allowed for the return value.

This function is used by the AI to determine the fire direction for grenade-like projectiles, to find out whether a jump is possible and to calculate the jump velocity for regular and impact jumps.

Trace

native(277) 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 Material Material)

Performs a line check and returns the first actor that was hit. Returns the map's LevelInfo if a BSP surface was hit and None if nothing was hit.

Parameters:

  • HitLocation - returns the world location where the trace has hit an actor. Origin if nothing was hit.
  • HitNormal - returns a unit vector pointing away from the hit actor's surface. Returns the zero vector if nothing was hit.
  • TraceEnd - the target world location to trace towards.
  • TraceStart - the source world location to start tracing from. Defaults to the actor's location if omitted.
  • bTraceActors - whether all colliding actors should be traced. If False, only world geometry is traced. Defaults to True if the calling actor can collide (bCollideActors), otherwise defaults to False.
  • Extent - the trace extent. Defaults to the zero vector, which performs a simple line check. Non-zero extents should have the same positive value for all three vector components, otherwise results may be unpredictable.
  • Material - returns the hit surface material for BSP or terrain, None for other types of hit actors. For terrain the "most dominant" material of the hit terrain section is used, based on the average layer alpha values on that terrain section.

TraceThisActor

native final function bool TraceThisActor (out Object.Vector HitLocation, out Object.Vector HitNormal, Object.Vector TraceEnd, Object.Vector TraceStart, optional Object.Vector Extent)

Performs a trace check on the collision of the calling actor and returns True if it did not hit this actor. World geometry and other actors are ignored.

Karma physics functions

KAddAngularImpulse

native final function KAddAngularImpulse (Object.Vector AngImpulse)


KAddImpulse

native final function KAddImpulse (Object.Vector Impulse, Object.Vector Position, optional name BoneName)


KDisableCollision

native final function KDisableCollision (Actor Other)


KEnableCollision

native final function KEnableCollision (Actor Other)


KGetActorGravScale

native final function float KGetActorGravScale ()


KGetCOMOffset

native final function KGetCOMOffset (out Object.Vector offset)


KGetCOMPosition

native final function KGetCOMPosition (out Object.Vector pos)


KGetDampingProps

native final function KGetDampingProps (out float lindamp, out float angdamp)


KGetFriction

native final function float KGetFriction ()


KGetImpactThreshold

native final function float KGetImpactThreshold ()


KGetInertiaTensor

native final function KGetInertiaTensor (out Object.Vector it1, out Object.Vector it2)


KGetMass

native final function float KGetMass ()


KGetSkelMass

native final function float KGetSkelMass ()


KIsAwake

native final function bool KIsAwake ()


KScaleJointLimits

native final function KScaleJointLimits (float scale, float stiffness)


KSetActorGravScale

native final function KSetActorGravScale (float ActorGravScale)


KSetBlockKarma

native final function KSetBlockKarma (bool newBlock)


KSetCOMOffset

native final function KSetCOMOffset (Object.Vector offset)


KSetDampingProps

native final function KSetDampingProps (float lindamp, float angdamp)


KSetFriction

native final function KSetFriction (float friction)


KSetImpactThreshold

native final function KSetImpactThreshold (float thresh)


KSetInertiaTensor

native final function KSetInertiaTensor (Object.Vector it1, Object.Vector it2)


KSetMass

native final function KSetMass (float mass)


KSetRestitution

native final function KSetRestitution (float rest)


KSetSimParams

native final function KSetSimParams (KSimParams SimParams)


KWake

native final function KWake ()


Karma rigid body functions

KDrawRigidBodyState

native final function KDrawRigidBodyState (KRigidBodyState RBState, bool AltColour)


KGetRBQuaternion

native final function Object.Quat KGetRBQuaternion ()


KGetRestitution

native final function float KGetRestitution ()


KGetRigidBodyState

native final function KGetRigidBodyState (out KRigidBodyState RBstate)


KGetSimParams

native final function KGetSimParams (out KSimParams SimParams)


KRBVecFromVector

native final function KRBVec KRBVecFromVector (Object.Vector v)


KRBVecToVector

native final function Object.Vector KRBVecToVector (KRBVec RBvec)


KSetStayUpright

native final function KSetStayUpright (bool stayUpright, bool allowRotate)


KSetStayUprightParams

native final function KSetStayUprightParams (float stiffness, float damping)


Karma ragdoll functions

KAddBoneLifter

native final function KAddBoneLifter (name BoneName, Object.InterpCurve LiftVel, float LateralFriction, Object.InterpCurve Softness)


KFreezeRagdoll

native final function KFreezeRagdoll ()


KIsRagdollAvailable

native final function bool KIsRagdollAvailable ()


KMakeRagdollAvailable

native final function KMakeRagdollAvailable ()


KRemoveAllBoneLifters

native final function KRemoveAllBoneLifters ()


KRemoveLifterFromBone

native final function KRemoveLifterFromBone (name BoneName)


KSetSkelVel

native final function KSetSkelVel (Object.Vector Velocity, optional Object.Vector AngVelocity, optional bool AddToCurrent)



[edit]

Animation-related functions

Mesh animations

AnimBlendParams

native final function AnimBlendParams (int Stage, optional float BlendAlpha, optional float InTime, optional float OutTime, optional name BoneName, optional bool bGlobalPose)


AnimBlendToAlpha

native final function AnimBlendToAlpha (int Stage, float TargetAlpha, float TimeInterval)


AnimIsInGroup

native final function bool AnimIsInGroup (int Channel, name GroupName)


AnimStopLooping

native final function AnimStopLooping (optional int Channel)


EnableChannelNotify

native final function EnableChannelNotify (int Channel, int Switch)


FreezeAnimAt

native final function FreezeAnimAt (float Time, optional int Channel)


GetAnimParams

native final function GetAnimParams (int Channel, out name OutSeqName, out float OutAnimFrame, out float OutAnimRate)


GetNotifyChannel

native final function int GetNotifyChannel ()


HasAnim

native(263) final function bool HasAnim (name Sequence)


IsAnimating

native(282) final function bool IsAnimating (optional int Channel)


IsTweening

native final function bool IsTweening (int Channel)


LinkSkelAnim

simulated native final function LinkSkelAnim (MeshAnimation Anim, optional Mesh NewMesh)


LockRootMotion

native final function LockRootMotion (int Lock)


LoopAnim

native(260) final function bool LoopAnim (name Sequence, optional float Rate, optional float TweenTime, optional int Channel)


PlayAnim

native(259) final function bool PlayAnim (name Sequence, optional float Rate, optional float TweenTime, optional int Channel)


SetAnimFrame

native final function SetAnimFrame (float Time, optional int Channel, optional int UnitFlag)


StopAnimating

native final function StopAnimating (optional bool ClearAllButBase)


TweenAnim

native(294) final function bool TweenAnim (name Sequence, float Time, optional int Channel)


LIPSinc animations

CurrentLIPSincAnim

native final function string CurrentLIPSincAnim ()


HasLIPSincAnim

native final function bool HasLIPSincAnim (name LIPSincAnimName)


IsPlayingLIPSincAnim

native final function bool IsPlayingLIPSincAnim ()


PlayLIPSincAnim

native final function PlayLIPSincAnim (name LIPSincAnimName, optional float Volume, optional float Radius, optional float Pitch)


StopLIPSincAnim

native final function StopLIPSincAnim ()


Controlling individual bones

BoneRefresh

native final function BoneRefresh ()


GetBoneCoords

native final function Object.Coords GetBoneCoords (name BoneName)


GetBoneRotation

native final function Object.Rotator GetBoneRotation (name BoneName, optional int Space)


GetRootLocation

native final function Object.Vector GetRootLocation ()


GetRootLocationDelta

native final function Object.Vector GetRootLocationDelta ()


GetRootRotation

native final function Object.Rotator GetRootRotation ()


GetRootRotationDelta

native final function Object.Rotator GetRootRotationDelta ()


SetBoneDirection

native final function SetBoneDirection (name BoneName, Object.Rotator BoneTurn, optional Object.Vector BoneTrans, optional float Alpha, optional int Space)


SetBoneLocation

native final function SetBoneLocation (name BoneName, optional Object.Vector BoneTrans, optional float Alpha)


SetBoneRotation

native final simulated function SetBoneRotation (name BoneName, optional Object.Rotator BoneTurn, optional int Space, optional float Alpha)


SetBoneScale

native final function SetBoneScale (int Slot, optional float BoneScale, optional name BoneName)



Force-feedback functions

ChangeBaseParamsFeedbackEffect

native(569) final function ChangeBaseParamsFeedbackEffect (string EffectName, optional float DirectionX, optional float DirectionY, optional float Gain)


ChangeSpringFeedbackEffect

native(568) final function ChangeSpringFeedbackEffect (string EffectName, float CenterX, float CenterY)


ForceFeedbackSupported

native final function bool ForceFeedbackSupported (optional bool Enable)


PlayFeedbackEffect

native(566) final function PlayFeedbackEffect (string EffectName)


StopFeedbackEffect

native(567) final function StopFeedbackEffect (optional string EffectName)


Rendering-related functions

ClearStayingDebugLines

native final function ClearStayingDebugLines ()


DrawDebugCircle

native final function DrawDebugCircle (Object.Vector Base, Object.Vector X, Object.Vector Y, float Radius, int NumSides, byte R, byte G, byte B)


DrawDebugLine

native final function DrawDebugLine (Object.Vector LineStart, Object.Vector LineEnd, byte R, byte G, byte B)


DrawDebugSphere

native final function DrawDebugSphere (Object.Vector Base, float Radius, int NumDivisions, byte R, byte G, byte B)


DrawStayingDebugLine

native final function DrawStayingDebugLine (Object.Vector LineStart, Object.Vector LineEnd, byte R, byte G, byte B)


GetRenderBoundingSphere

native final function Object.Plane GetRenderBoundingSphere ()


LinkMesh

simulated native final function LinkMesh (Mesh NewMesh, optional bool bKeepAnim)


ResetStaticFilterState

native final function ResetStaticFilterState ()


SetDrawScale

native final function SetDrawScale (float NewScale)


SetDrawScale3D

native final function SetDrawScale3D (Object.Vector NewScale3D)


SetDrawType

native final function SetDrawType (EDrawType NewDrawType)


SetStaticMesh

native final function SetStaticMesh (StaticMesh NewStaticMesh)


Other native functions

AddToPackageMap

native final function AddToPackageMap (optional string PackageName)


Clock

native final function Clock (out float time)


ConsoleCommand

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


CopyObjectToClipboard

native function CopyObjectToClipboard (Object Obj)


DebugClock

native final function DebugClock ()


DebugUnclock

native final function DebugUnclock ()


Destroy

native(279) final function bool Destroy ()


Error

native(233) final function Error (coerce string S)


GetCacheEntry

native final function bool GetCacheEntry (int Num, out string GUID, out string Filename)


GetMapName

native(539) final function string GetMapName (string NameEnding, string MapName, int Dir)


GetMeshName

native final function string GetMeshName ()


GetNextInt

native final function string GetNextInt (string ClassName, int Num)


GetNextIntDesc

native final function GetNextIntDesc (string ClassName, int Num, out string Entry, out string Description)


GetNextSkin

native(545) final function GetNextSkin (string Prefix, string CurrentSkin, int Dir, out string SkinName, out string SkinDesc)


GetURLMap

native(547) final function string GetURLMap (optional bool bIncludeOptions)


GetUrlOption

native final function string GetUrlOption (string Option)


MakeNoise

native(512) final function MakeNoise (float Loudness)


MoveCacheEntry

native final function bool MoveCacheEntry (string GUID, optional string NewFilename)


PlayerCanSeeMe

native(532) final function bool PlayerCanSeeMe ()


SetOwner

native(272) final function SetOwner (Actor NewOwner)


SetTimer

native(280) final function SetTimer (float NewTimerRate, bool bLoop)


Spawn

native(278) final function Actor Spawn (class<ActorSpawnClass, optional Actor SpawnOwner, optional name SpawnTag, optional Object.Vector SpawnLocation, optional Object.Rotator SpawnRotation)


UnClock

native final function UnClock (out float time)


UpdateURL

native final function UpdateURL (string NewOption, string NewValue, bool bSaveDefault)