My program doesn't have bugs. It just develops random features.

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[edit]

DemoPlaySound[edit]

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[edit]

native final function float GetSoundDuration (Sound Sound)

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

PlayOwnedSound[edit]

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[edit]

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[edit]

AdjustVolume[edit]

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

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

AllowMusicPlayback[edit]

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[edit]

native final function bool PauseStream (int Handle)

Pauses the music stream specified by the handle value.

PlayMusic[edit]

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[edit]

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[edit]

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

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

StopAllMusic[edit]

native final function StopAllMusic (optional float FadeOutTime)

Stops all game music tracks currently playing.

StopMusic[edit]

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

Stops the game music track identified by the handle value.

StopStream[edit]

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

Stops the stream music track identified by the handle value.

Text-to-speech[edit]

TextToSpeech[edit]

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[edit]

AttachToBone[edit]

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[edit]

native(3971) final function AutonomousPhysics (float DeltaSeconds)


DetachFromBone[edit]

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[edit]

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[edit]

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[edit]

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[edit]

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[edit]

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[edit]

native final function OnlyAffectPawns (bool B)

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

SetBase[edit]

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[edit]

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[edit]

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

Sets the size of this actor's collision cylinder.

SetLocation[edit]

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[edit]

native(3970) final function SetPhysics (EPhysics newPhysics)

Adjusts the actor's Physics mode.

SetRelativeLocation[edit]

native final function bool SetRelativeLocation (Object.Vector NewLocation)

Sets the RelativeLocation for an attached actor.

SetRelativeRotation[edit]

native final function bool SetRelativeRotation (Object.Rotator NewRotation)

Sets the RelativeRotation for an attached actor.

SetRotation[edit]

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[edit]

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[edit]

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[edit]

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[edit]

KAddAngularImpulse[edit]

native final function KAddAngularImpulse (Object.Vector AngImpulse)


KAddImpulse[edit]

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


KDisableCollision[edit]

native final function KDisableCollision (Actor Other)


KEnableCollision[edit]

native final function KEnableCollision (Actor Other)


KGetActorGravScale[edit]

native final function float KGetActorGravScale ()


KGetCOMOffset[edit]

native final function KGetCOMOffset (out Object.Vector offset)


KGetCOMPosition[edit]

native final function KGetCOMPosition (out Object.Vector pos)


KGetDampingProps[edit]

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


KGetFriction[edit]

native final function float KGetFriction ()


KGetImpactThreshold[edit]

native final function float KGetImpactThreshold ()


KGetInertiaTensor[edit]

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


KGetMass[edit]

native final function float KGetMass ()


KGetSkelMass[edit]

native final function float KGetSkelMass ()


KIsAwake[edit]

native final function bool KIsAwake ()


KScaleJointLimits[edit]

native final function KScaleJointLimits (float scale, float stiffness)


KSetActorGravScale[edit]

native final function KSetActorGravScale (float ActorGravScale)


KSetBlockKarma[edit]

native final function KSetBlockKarma (bool newBlock)


KSetCOMOffset[edit]

native final function KSetCOMOffset (Object.Vector offset)


KSetDampingProps[edit]

native final function KSetDampingProps (float lindamp, float angdamp)


KSetFriction[edit]

native final function KSetFriction (float friction)


KSetImpactThreshold[edit]

native final function KSetImpactThreshold (float thresh)


KSetInertiaTensor[edit]

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


KSetMass[edit]

native final function KSetMass (float mass)


KSetRestitution[edit]

native final function KSetRestitution (float rest)


KSetSimParams[edit]

native final function KSetSimParams (KSimParams SimParams)


KWake[edit]

native final function KWake ()


Karma rigid body functions[edit]

KDrawRigidBodyState[edit]

native final function KDrawRigidBodyState (KRigidBodyState RBState, bool AltColour)


KGetRBQuaternion[edit]

native final function Object.Quat KGetRBQuaternion ()


KGetRestitution[edit]

native final function float KGetRestitution ()


KGetRigidBodyState[edit]

native final function KGetRigidBodyState (out KRigidBodyState RBstate)


KGetSimParams[edit]

native final function KGetSimParams (out KSimParams SimParams)


KRBVecFromVector[edit]

native final function KRBVec KRBVecFromVector (Object.Vector v)


KRBVecToVector[edit]

native final function Object.Vector KRBVecToVector (KRBVec RBvec)


KSetStayUpright[edit]

native final function KSetStayUpright (bool stayUpright, bool allowRotate)


KSetStayUprightParams[edit]

native final function KSetStayUprightParams (float stiffness, float damping)


Karma ragdoll functions[edit]

KAddBoneLifter[edit]

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


KFreezeRagdoll[edit]

native final function KFreezeRagdoll ()


KIsRagdollAvailable[edit]

native final function bool KIsRagdollAvailable ()


KMakeRagdollAvailable[edit]

native final function KMakeRagdollAvailable ()


KRemoveAllBoneLifters[edit]

native final function KRemoveAllBoneLifters ()


KRemoveLifterFromBone[edit]

native final function KRemoveLifterFromBone (name BoneName)


KSetSkelVel[edit]

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



[edit]

Animation-related functions

Mesh animations[edit]

AnimBlendParams[edit]

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


AnimBlendToAlpha[edit]

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


AnimIsInGroup[edit]

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


AnimStopLooping[edit]

native final function AnimStopLooping (optional int Channel)


EnableChannelNotify[edit]

native final function EnableChannelNotify (int Channel, int Switch)


FreezeAnimAt[edit]

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


GetAnimParams[edit]

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


GetNotifyChannel[edit]

native final function int GetNotifyChannel ()


HasAnim[edit]

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


IsAnimating[edit]

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


IsTweening[edit]

native final function bool IsTweening (int Channel)


LinkSkelAnim[edit]

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


LockRootMotion[edit]

native final function LockRootMotion (int Lock)


LoopAnim[edit]

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


PlayAnim[edit]

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


SetAnimFrame[edit]

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


StopAnimating[edit]

native final function StopAnimating (optional bool ClearAllButBase)


TweenAnim[edit]

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


LIPSinc animations[edit]

CurrentLIPSincAnim[edit]

native final function string CurrentLIPSincAnim ()


HasLIPSincAnim[edit]

native final function bool HasLIPSincAnim (name LIPSincAnimName)


IsPlayingLIPSincAnim[edit]

native final function bool IsPlayingLIPSincAnim ()


PlayLIPSincAnim[edit]

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


StopLIPSincAnim[edit]

native final function StopLIPSincAnim ()


Controlling individual bones[edit]

BoneRefresh[edit]

native final function BoneRefresh ()


GetBoneCoords[edit]

native final function Object.Coords GetBoneCoords (name BoneName)


GetBoneRotation[edit]

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


GetRootLocation[edit]

native final function Object.Vector GetRootLocation ()


GetRootLocationDelta[edit]

native final function Object.Vector GetRootLocationDelta ()


GetRootRotation[edit]

native final function Object.Rotator GetRootRotation ()


GetRootRotationDelta[edit]

native final function Object.Rotator GetRootRotationDelta ()


SetBoneDirection[edit]

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


SetBoneLocation[edit]

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


SetBoneRotation[edit]

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


SetBoneScale[edit]

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



Force-feedback functions[edit]

ChangeBaseParamsFeedbackEffect[edit]

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


ChangeSpringFeedbackEffect[edit]

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


ForceFeedbackSupported[edit]

native final function bool ForceFeedbackSupported (optional bool Enable)


PlayFeedbackEffect[edit]

native(566) final function PlayFeedbackEffect (string EffectName)


StopFeedbackEffect[edit]

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


Rendering-related functions[edit]

ClearStayingDebugLines[edit]

native final function ClearStayingDebugLines ()


DrawDebugCircle[edit]

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


DrawDebugLine[edit]

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


DrawDebugSphere[edit]

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


DrawStayingDebugLine[edit]

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


GetRenderBoundingSphere[edit]

native final function Object.Plane GetRenderBoundingSphere ()


LinkMesh[edit]

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


ResetStaticFilterState[edit]

native final function ResetStaticFilterState ()


SetDrawScale[edit]

native final function SetDrawScale (float NewScale)


SetDrawScale3D[edit]

native final function SetDrawScale3D (Object.Vector NewScale3D)


SetDrawType[edit]

native final function SetDrawType (EDrawType NewDrawType)


SetStaticMesh[edit]

native final function SetStaticMesh (StaticMesh NewStaticMesh)


Other native functions[edit]

AddToPackageMap[edit]

native final function AddToPackageMap (optional string PackageName)


Clock[edit]

native final function Clock (out float time)


ConsoleCommand[edit]

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


CopyObjectToClipboard[edit]

native function CopyObjectToClipboard (Object Obj)


DebugClock[edit]

native final function DebugClock ()


DebugUnclock[edit]

native final function DebugUnclock ()


Destroy[edit]

native(279) final function bool Destroy ()


Error[edit]

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


GetCacheEntry[edit]

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


GetMapName[edit]

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


GetMeshName[edit]

native final function string GetMeshName ()


GetNextInt[edit]

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


GetNextIntDesc[edit]

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


GetNextSkin[edit]

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


GetURLMap[edit]

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


GetUrlOption[edit]

native final function string GetUrlOption (string Option)


MakeNoise[edit]

native(512) final function MakeNoise (float Loudness)


MoveCacheEntry[edit]

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


PlayerCanSeeMe[edit]

native(532) final function bool PlayerCanSeeMe ()


SetOwner[edit]

native(272) final function SetOwner (Actor NewOwner)


SetTimer[edit]

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


Spawn[edit]

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


UnClock[edit]

native final function UnClock (out float time)


UpdateURL[edit]

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