getCombatLevel
getCombatLevel: (Actor) -> numberThe actor's combat level: an NPC's transformed composition's, a player's appearance's.
client:createMenuEntry(…):getActor()| Method | Returns | Description |
|---|---|---|
getCombatLevel() | number | The actor's combat level: an NPC's transformed composition's, a player's appearance's. |
getName() | string? | The actor's name, non-breaking spaces made spaces; nil for a despawned NPC or a player with none. |
isInteracting() | boolean | Whether the actor's target is an NPC or a player (not a tile). It can be true while getInteracting() is nil (the target is out of range… |
getInteracting() | Actor? | The actor this one interacts with, found across the client's world views, or nil. |
getHealthRatio() | number | The health of the first health bar's current update, in getHealthScale() units; -1 with no bar showing. The current update is the newest… |
getHealthScale() | number | The first health bar's width, the most getHealthRatio() can be; -1 with no bar. |
getWorldLocation() | WorldPoint | The server-side tile: the head of the actor's path in its world view, plus that view's base, on its plane. Ahead of where it renders while… |
getLocalLocation() | LocalPoint | The client-side position in local units (128 a tile), where the actor renders: interpolated between tiles while it moves. |
getCameraFocus() | LocalPoint | Where the camera orbits while it follows the actor (client:getCameraFocusEntity() is the actor then): its getLocalLocation(). |
getWorldView() | WorldView | The world view the actor is in: the top level, or a world entity's (a boat's). |
getOrientation() | number | The orientation the actor is turning to (0..2047). |
getCurrentOrientation() | number | The orientation the actor renders at now. |
getAnimation() | number | The animation playing (AnimationID), -1 for none. |
setAnimation(number) | () | Set the animation playing, through the game's own sequence setter. No AnimationChanged follows. Does nothing on a despawned actor. |
getAnimationFrame() | number | The frame of the animation playing, -1 for none. |
setAnimationFrame(number) | () | Set the frame of the animation playing. |
getAnimationFrameCycle() | number | The client cycles the animation has spent on its current frame (getAnimationFrame()'s): 1 up to the frame's length (`Animation:getFrameLe… |
getAnimationLoopCount() | number | How many times the animation has looped since it started: 0 until it first passes its end, then 1 more each time it does. Starting another… |
getPoseAnimation() | number | The pose (idle or movement) animation playing, -1 for none. |
setPoseAnimation(number) | () | Set the pose animation playing. |
getPoseAnimationFrame() | number | The frame of the pose animation, -1 for none. |
setPoseAnimationFrame(number) | () | Set the frame of the pose animation. |
getPoseAnimationFrameCycle() | number | The client cycles the pose animation has spent on its current frame (getPoseAnimationFrame()'s); 0 with none, or once the actor has despa… |
getIdlePoseAnimation() | number | The idle pose animation. |
setIdlePoseAnimation(number) | () | Set the idle pose animation. |
getIdleRotateLeft() | number | The idle turn-left animation. |
setIdleRotateLeft(number) | () | Set the idle turn-left animation. |
getIdleRotateRight() | number | The idle turn-right animation. |
setIdleRotateRight(number) | () | Set the idle turn-right animation. |
getWalkAnimation() | number | The walk animation. |
setWalkAnimation(number) | () | Set the walk animation. |
getWalkRotate180() | number | The walk-backwards animation. |
setWalkRotate180(number) | () | Set the walk-backwards animation. |
getWalkRotateLeft() | number | The walk-left animation. |
setWalkRotateLeft(number) | () | Set the walk-left animation. |
getWalkRotateRight() | number | The walk-right animation. |
setWalkRotateRight(number) | () | Set the walk-right animation. |
getRunAnimation() | number | The run animation. |
setRunAnimation(number) | () | Set the run animation. |
getSpotAnims() | {ActorSpotAnim} | The spot animations the actor carries, one per slot in use, in slot order. |
hasSpotAnim(number) | boolean | Whether any slot carries spot animation spotAnimId. |
getGraphic() | number | The actor's single graphic: the first spot animation's id, or -1. |
setGraphic(number) | () | Set the actor's single graphic: every spot animation removed, then (for an id above -1) graphic put in slot 0. No GraphicChanged follow… |
setSpotAnimFrame(number) | () | Set the frame of the first spot animation (in slot order), if the actor carries one. |
getCanvasTilePoly() | Polygon? | The canvas polygon of the tile under the actor's local location (one tile; an NPC answers its whole size), or nil when a corner does no… |
getCanvasTextLocation(Graphics2D, string, number) | Point? | The canvas point to draw text at, centred over the actor zOffset up: the anchor's x less half the text's width in the graphics' current… |
getCanvasTextLocationForWidth(number, number) | Point? | The point getCanvasTextLocation(graphics, text, zOffset) gives, for text textWidth pixels wide, without a graphics (outside a render, o… |
getCanvasImageLocation(BufferedImage, number) | Point? | The canvas point that centres image over the actor, zOffset up: its top-left corner, or nil when the point does not project. |
getCanvasSpriteLocation(SpritePixels, number) | Point? | The canvas point that centres sprite over the actor, zOffset up: its top-left corner, or nil when the point does not project. |
getMinimapLocation() | Point? | Where the actor is on the minimap, or nil when it is outside the minimap's radius or the minimap is hidden. |
getLogicalHeight() | number | The model's logical height, roughly where the health bar is drawn (200 until a model has set it). |
getWorldArea() | WorldArea | The world area the actor covers: its world location and size (an NPC's composition size, 1 for a player). |
getOverheadText() | string? | The text over the actor's head, nil for none. |
setOverheadText(string) | () | Replace the text over the actor's head, through the game's own string assign (a chat filter does this in onOverheadTextChanged). |
getOverheadCycle() | number | The client cycles the overhead text still shows for. |
setOverheadCycle(number) | () | Set the client cycles the overhead text shows for. |
isDead() | boolean | Whether the actor has died: set when a death health bar reaches 0 (when ActorDeath is posted), cleared when one rises above 0. |
setDead(boolean) | () | Set the dead flag isDead() answers. |
getFootprintSize() | number | The side of the actor's footprint in local units, which ground heights under it are sampled over. |
getAnimationHeightOffset() | number | The vertical offset the actor's animation renders it at. |
getConvexHull() | Shape? | The outline of the actor's model on the canvas this frame: the convex hull of the model the client builds for it, at its local location and… |
getModel() | Model? | The model the client builds for the actor this frame, a copy; nil in HD, off the game thread or once the actor is gone. |
getRenderMode() | number | How the client draws the actor (Renderable.RENDERMODE_*), its own answer: a player 2 (RENDERMODE_SORTED_NO_DEPTH); an NPC 2 when its mo… |
isPresent() | boolean | Whether the actor is still in the game. |
| Method | Returns | Description |
|---|---|---|
ActorDeath.getActor | Actor | The actor; never nil. From a legacy (differ) delivery read after the actor left the map, the handle it had, with its last-known values. |
AnimationChanged.getActor | Actor | The actor; read getAnimation() on it for the new animation. Never nil: from a legacy (differ) delivery about an actor that has left the… |
GraphicChanged.getActor | Actor? | The actor. nil from a legacy delivery (a client where the actor sites do not install), which does not say whether it is an NPC or a playe… |
HitsplatApplied.getActor | Actor | The actor hit; never nil. From a legacy (differ) delivery read after the actor left the map, the handle it had, with its last-known value… |
InteractingChanged.getSource | Actor? | The actor whose target changed. nil from a legacy delivery (a client where the actor sites do not install), which does not say whether it… |
InteractingChanged.getTarget | Actor? | The actor it targets now, nil for none. |
MenuEntry.getActor | Actor? | getNpc(), else getPlayer(). |
OverheadTextChanged.getActor | Actor? | The actor. nil from a legacy delivery (a client where the actor sites do not install), which does not say whether it is an NPC or a playe… |
Projectile.getInteracting | Actor? | The same as getTargetActor(). |
Projectile.getSourceActor | Actor? | The actor it was fired from, looked up in the top-level world view, or nil (fired from a tile, or the actor is gone). |
Projectile.getTargetActor | Actor? | The actor it is aimed at, looked up in the top-level world view, or nil when it is aimed at a tile (or the actor is gone). |
getCombatLevelgetCombatLevel: (Actor) -> numberThe actor's combat level: an NPC's transformed composition's, a player's appearance's.
getNamegetName: (Actor) -> string?The actor's name, non-breaking spaces made spaces; nil for a despawned NPC or a player with none.
isInteractingisInteracting: (Actor) -> booleanWhether the actor's target is an NPC or a player (not a tile). It can be true while getInteracting() is nil (the target is out of range).
getInteractinggetInteracting: (Actor) -> Actor?The actor this one interacts with, found across the client's world views, or nil.
getHealthRatiogetHealthRatio: (Actor) -> numberThe health of the first health bar's current update, in getHealthScale() units; -1 with no bar showing. The current update is the newest arrived, until it expires.
getHealthScalegetHealthScale: (Actor) -> numberThe first health bar's width, the most getHealthRatio() can be; -1 with no bar.
getWorldLocationgetWorldLocation: (Actor) -> WorldPointThe server-side tile: the head of the actor's path in its world view, plus that view's base, on its plane. Ahead of where it renders while it walks. On an NPC-owned boat (a charter ship's crew, a trial's master), the sea tile under where it renders instead, the tile its scene:npcs() row measures by.
getLocalLocationgetLocalLocation: (Actor) -> LocalPointThe client-side position in local units (128 a tile), where the actor renders: interpolated between tiles while it moves.
getCameraFocusgetCameraFocus: (Actor) -> LocalPointWhere the camera orbits while it follows the actor (client:getCameraFocusEntity() is the actor then): its getLocalLocation().
getWorldViewgetWorldView: (Actor) -> WorldViewThe world view the actor is in: the top level, or a world entity's (a boat's).
getOrientationgetOrientation: (Actor) -> numberThe orientation the actor is turning to (0..2047).
getCurrentOrientationgetCurrentOrientation: (Actor) -> numberThe orientation the actor renders at now.
getAnimationgetAnimation: (Actor) -> numberThe animation playing (AnimationID), -1 for none.
setAnimationsetAnimation: (Actor, number) -> ()Set the animation playing, through the game's own sequence setter. No AnimationChanged follows. Does nothing on a despawned actor.
getAnimationFramegetAnimationFrame: (Actor) -> numberThe frame of the animation playing, -1 for none.
setAnimationFramesetAnimationFrame: (Actor, number) -> ()Set the frame of the animation playing.
getAnimationFrameCyclegetAnimationFrameCycle: (Actor) -> numberThe client cycles the animation has spent on its current frame (getAnimationFrame()'s): 1 up to the frame's length (Animation:getFrameLengths()) once a cycle has run on it; 0 with no animation, or once the actor has despawned.
getAnimationLoopCountgetAnimationLoopCount: (Actor) -> numberHow many times the animation has looped since it started: 0 until it first passes its end, then 1 more each time it does. Starting another animation, or the same one again, starts the count over. 0 with no animation, or once the actor has despawned.
getPoseAnimationgetPoseAnimation: (Actor) -> numberThe pose (idle or movement) animation playing, -1 for none.
setPoseAnimationsetPoseAnimation: (Actor, number) -> ()Set the pose animation playing.
getPoseAnimationFramegetPoseAnimationFrame: (Actor) -> numberThe frame of the pose animation, -1 for none.
setPoseAnimationFramesetPoseAnimationFrame: (Actor, number) -> ()Set the frame of the pose animation.
getPoseAnimationFrameCyclegetPoseAnimationFrameCycle: (Actor) -> numberThe client cycles the pose animation has spent on its current frame (getPoseAnimationFrame()'s); 0 with none, or once the actor has despawned.
getIdlePoseAnimationgetIdlePoseAnimation: (Actor) -> numberThe idle pose animation.
setIdlePoseAnimationsetIdlePoseAnimation: (Actor, number) -> ()Set the idle pose animation.
getIdleRotateLeftgetIdleRotateLeft: (Actor) -> numberThe idle turn-left animation.
setIdleRotateLeftsetIdleRotateLeft: (Actor, number) -> ()Set the idle turn-left animation.
getIdleRotateRightgetIdleRotateRight: (Actor) -> numberThe idle turn-right animation.
setIdleRotateRightsetIdleRotateRight: (Actor, number) -> ()Set the idle turn-right animation.
getWalkAnimationgetWalkAnimation: (Actor) -> numberThe walk animation.
setWalkAnimationsetWalkAnimation: (Actor, number) -> ()Set the walk animation.
getWalkRotate180getWalkRotate180: (Actor) -> numberThe walk-backwards animation.
setWalkRotate180setWalkRotate180: (Actor, number) -> ()Set the walk-backwards animation.
getWalkRotateLeftgetWalkRotateLeft: (Actor) -> numberThe walk-left animation.
setWalkRotateLeftsetWalkRotateLeft: (Actor, number) -> ()Set the walk-left animation.
getWalkRotateRightgetWalkRotateRight: (Actor) -> numberThe walk-right animation.
setWalkRotateRightsetWalkRotateRight: (Actor, number) -> ()Set the walk-right animation.
getRunAnimationgetRunAnimation: (Actor) -> numberThe run animation.
setRunAnimationsetRunAnimation: (Actor, number) -> ()Set the run animation.
getSpotAnimsgetSpotAnims: (Actor) -> {ActorSpotAnim}The spot animations the actor carries, one per slot in use, in slot order.
hasSpotAnimhasSpotAnim: (Actor, number) -> booleanWhether any slot carries spot animation spotAnimId.
getGraphicgetGraphic: (Actor) -> numberThe actor's single graphic: the first spot animation's id, or -1.
setGraphicsetGraphic: (Actor, number) -> ()Set the actor's single graphic: every spot animation removed, then (for an id above -1) graphic put in slot 0. No GraphicChanged follows. Does nothing on a despawned actor.
setSpotAnimFramesetSpotAnimFrame: (Actor, number) -> ()Set the frame of the first spot animation (in slot order), if the actor carries one.
getCanvasTilePolygetCanvasTilePoly: (Actor) -> Polygon?The canvas polygon of the tile under the actor's local location (one tile; an NPC answers its whole size), or nil when a corner does not project.
getCanvasTextLocationgetCanvasTextLocation: (Actor, Graphics2D, string, number) -> Point?The canvas point to draw text at, centred over the actor zOffset up: the anchor's x less half the text's width in the graphics' current font (getStringBounds), or nil when the point does not project. The text is measured only when it does.
getCanvasTextLocationForWidthgetCanvasTextLocationForWidth: (Actor, number, number) -> Point?The point getCanvasTextLocation(graphics, text, zOffset) gives, for text textWidth pixels wide, without a graphics (outside a render, or with a width measured once). getCanvasTextLocation measures the text itself; the x is the anchor's minus textWidth / 2, truncated to an int.
getCanvasImageLocationgetCanvasImageLocation: (Actor, BufferedImage, number) -> Point?The canvas point that centres image over the actor, zOffset up: its top-left corner, or nil when the point does not project.
getCanvasSpriteLocationgetCanvasSpriteLocation: (Actor, SpritePixels, number) -> Point?The canvas point that centres sprite over the actor, zOffset up: its top-left corner, or nil when the point does not project.
getMinimapLocationgetMinimapLocation: (Actor) -> Point?Where the actor is on the minimap, or nil when it is outside the minimap's radius or the minimap is hidden.
getLogicalHeightgetLogicalHeight: (Actor) -> numberThe model's logical height, roughly where the health bar is drawn (200 until a model has set it).
getWorldAreagetWorldArea: (Actor) -> WorldAreaThe world area the actor covers: its world location and size (an NPC's composition size, 1 for a player).
getOverheadTextgetOverheadText: (Actor) -> string?The text over the actor's head, nil for none.
setOverheadTextsetOverheadText: (Actor, string) -> ()Replace the text over the actor's head, through the game's own string assign (a chat filter does this in onOverheadTextChanged).
getOverheadCyclegetOverheadCycle: (Actor) -> numberThe client cycles the overhead text still shows for.
setOverheadCyclesetOverheadCycle: (Actor, number) -> ()Set the client cycles the overhead text shows for.
isDeadisDead: (Actor) -> booleanWhether the actor has died: set when a death health bar reaches 0 (when ActorDeath is posted), cleared when one rises above 0.
setDeadsetDead: (Actor, boolean) -> ()Set the dead flag isDead() answers.
getFootprintSizegetFootprintSize: (Actor) -> numberThe side of the actor's footprint in local units, which ground heights under it are sampled over.
getAnimationHeightOffsetgetAnimationHeightOffset: (Actor) -> numberThe vertical offset the actor's animation renders it at.
getConvexHullgetConvexHull: (Actor) -> Shape?The outline of the actor's model on the canvas this frame: the convex hull of the model the client builds for it, at its local location and current orientation, at its footprint's ground height less its animation height offset. nil when it does not project, with no scene, in HD (no model is readable there) or once the actor is gone.
getModelgetModel: (Actor) -> Model?The model the client builds for the actor this frame, a copy; nil in HD, off the game thread or once the actor is gone.
getRenderModegetRenderMode: (Actor) -> numberHow the client draws the actor (Renderable.RENDERMODE_*), its own answer: a player 2 (RENDERMODE_SORTED_NO_DEPTH); an NPC 2 when its model override dresses it as a player or its type is drawn so, else 0 (RENDERMODE_DEFAULT; also once it is gone).
isPresentisPresent: (Actor) -> booleanWhether the actor is still in the game.