Actor
Actors represent objects that exist in the game world. Every player character, NPC, building piece, decoration, container, map object, mod controller, and even the sky is an actor.
Actor type in Ratchet is used to contain functions that are shared across all of those objects and can be used on any type that inherits from an actor.
spawnActor function
Syntax:
Actor|nil spawnActor( string actorType, Vector location [, Rotator rotation ] )| Actor Type | Lua Object |
|---|---|
| TotPuppet | TotPuppet |
| TotBoxZone | TotZone |
| TotSphereZone | TotZone |
DANGER
This feature is currently not working (Puppets/Zones will spawn but cannot be edited).
findActor function
Returns an actor instance (or nil) based on their name in the game world.
This will always return the general Actor type and never the specific class of an object.
Syntax:
Actor|nil findActor( string name )Example:
local actor = findActor("MC_KnightsSanity_C_0")WARNING
This is a heavy and potentially slow operation, it should not be used too often!
Additionally, working with unsupported UE actors can be dangerous. Only use this function if you know what you're doing. There is no downcasting in Ratchet (e.g. converting Actor to Character).
getActorsInRadius function
Syntax:
table<Actor> getActorsInRadius( Vector location, float radius )IsValid function
Syntax:
bool Actor:IsValid()GetActorName function
Syntax:
string Actor:GetActorName()GetClassName function
Syntax:
string Actor:GetClassName()GetPathName function
Syntax:
string Actor:GetPathName()GetLocation function
Syntax:
Vector Actor:GetLocation()GetRotation function
Syntax:
Rotator Actor:GetRotation()SetLocation function
Syntax:
bool Actor:SetLocation( Vector location, bool sweep, bool teleport )SetRotation function
Syntax:
bool Actor:SetRotation( Rotator rotation )GetFeetLocation function
Syntax:
Vector Actor:GetFeetLocation()SetLocationAndRotation function
Syntax:
bool Actor:SetLocationAndRotation( Vector location, Rotator rotation, bool sweep, bool teleport )Teleport function
Syntax:
bool Actor:Teleport( Vector location [, Rotator rotation ] )GetDistanceTo function
Syntax:
float Actor:GetDistanceTo( Actor other )GetHorizontalDistanceTo function
Syntax:
float Actor:GetHorizontalDistanceTo( Actor other )GetVerticalDistanceTo function
Syntax:
float Actor:GetVerticalDistanceTo( Actor other )GetVelocity function
Syntax:
Vector Actor:GetVelocity()GetForwardVector function
Syntax:
Vector Actor:GetForwardVector()GetUpVector function
Syntax:
Vector Actor:GetUpVector()HasTag function
Syntax:
bool Actor:HasTag( string tag )IsOverlappingActor function
Syntax:
bool Actor:IsOverlappingActor( Actor other )GetEyesViewPoint function
Syntax:
Vector, Rotator Actor:GetEyesViewPoint()Destroy function
Syntax:
void Actor:Destroy()CallFunction function
This is equivalent to Call Function By Name in the DevKit.
Only use this if you know what you're doing.
Syntax:
void Actor:CallFunction( string name )