Skip to content

Field manual / Level editor

actor — Actor

Actor: registering the model and animations (creation events), the command queue, state, attachment and link points. Functions without an actor argument act on host (the exe has no form for another actor).

Summary

Model and animations (on host, usually in creation events)

actor::RegisterAnimationMaps a logical animation name to an actual animation for state 0..8 of the current actor.
actor::RegisterIdleAnimationAdds an idle animation to the current actor for state 0..8 with a random-selection weight.
actor::NotInPlaceAnimationMarks an animation of the current actor as displacing (not in place): its offsets are measured from the reference animation.
actor::ReferenceAnimationSets the reference animation of the current actor; offsets of not-in-place animations are measured from its first frame.
actor::RegisterExtraBodyGives the current actor an extra body: a mesh drawn at the actor's position, in slot 0…3 (replacing the previous one); with still 0 the actor's animations play on it, otherwise it holds the first frame.
actor::SetWalkSpeedSets the current actor's movement speed for a walk animation, in world pixels per tick; speed must be a float.
actor::ModifyScaleMultiplies the current actor's model scale by k.
actor::SetModelOffsetSets the offset of the actor's model from its position; only the axes passed as float are changed.
actor::SetModelAngleSets the orientation correction of the current actor's model in degrees; float only.
actor::InitStateSets the current actor's state (selects its animation set).

Control and the command queue (the actor is an argument)

actor::PlacePlaces an enabled actor at point index of an area (the angle comes from the point), on floor 0 or 1; the form actor::Place(name, x, y[, dir]) places it on battle grid tile (x, y), dir in eighths of a turn.
actor::SetAnimationQueues a one-shot animation for the actor after its current commands; "idle" is the idle of the current state.
actor::SetAsyncAnimationQueues a one-shot animation for the actor without waiting for it to finish; reverse plays it from the last frame.
actor::SetStateSets the actor's state and, if the actor is not busy, picks a new idle.
actor::QueueStateAdds a stance change to the actor's command queue; in battle 0 and 1 become 7 and 8, and stance 4 also removes meshes from link points.
actor::TextEffectShows popup text from string.tab with number text (or by a UI text key: "no_ammo") above a placed actor (like "No ammo" in battle) and plays battle_noammo.
actor::InAreaTrue if the actor's background position is inside the area.
actor::StopStops the actor: clears the command queue, the path and the current command.
actor::VibratoMakes the actor sway with the given amplitude and phase step per tick; both must be floats.
actor::WalkOnTrackPlaces the actor at point start of area track at the given height and leads it along the remaining points at walking speed, turning along the way.
actor::SetFloorPuts the actor on floor 1 (.wm2) if floor is 1, otherwise on floor 0 (.wm).
actor::QueueDelayAdds a pause of ticks ticks to the actor's command queue.
actor::QueueJustifyPositionWhen the actor's command queue reaches this entry, shifts the actor by the offset of the displayed pose from the last frame of the current animation; the next animation starts without blending.
actor::QueuePlaceWhen the actor's command queue reaches this entry, places the actor at point index of the area (floor 0) and drops the rest of the queue; the next animation starts without blending.
actor::QueueCallWhen the actor's command queue reaches this entry, calls a script function of the object named like the actor.
actor::CallImmediately calls a script function of the object named like the actor (not through the queue).
actor::PutBackItemQueues putting a two-handed weapon from the hands onto the back: "hide_back", meshes are removed from link points, the weapon goes to "back", stance 0.
actor::PutFrontItemQueues taking a two-handed weapon from the back: after animation blending, meshes are removed from link points, stance 1, "hide_back" in reverse without waiting, 30 ticks, the weapon goes to "two_hands".

Attachment and link points

actor::AttachByLinkAttaches the actor to a link point of the parent's mesh, and it moves together with the parent.
actor::AttachAttaches the actor to the parent with the given offset, and it moves together with the parent: a and b horizontally in the parent's axes, c vertically, in world units; angle is added to the parent's angle.
actor::DetachAllFromDetaches all actors attached to the parent and resets their model offsets.
actor::LinkRiderThe actor rides the calling object at this link point of its mesh and is drawn together with it in its own animations (Smoke Rider pilots).
actor::ShowLinkMeshShows a mesh at a link point of the current actor (Headnail's saws).
actor::HideLinkMeshRemoves the mesh from a link point of the current actor (the reverse of actor::ShowLinkMesh).
actor::ShowItemInHandShows an item's mesh in the actor's hand (point two_hands for two-handed items, otherwise one_hand).
actor::HideAllLinkMeshesRemoves all meshes attached to the actor's link points.

Functions

actor::RegisterAnimation(int, string, string) → int

Classic: RegisterAnimation

Maps a logical animation name to an actual animation for state 0..8 of the current actor.

actor::RegisterIdleAnimation(int, string, int) → int

Classic: RegisterIdleAnimation

Adds an idle animation to the current actor for state 0..8 with a random-selection weight. Without a weight nothing is registered.

actor::NotInPlaceAnimation(string) → int

Classic: NotInPlaceAnimation

Marks an animation of the current actor as displacing (not in place): its offsets are measured from the reference animation.

actor::ReferenceAnimation(string) → int

Classic: ReferenceAnimation

Sets the reference animation of the current actor; offsets of not-in-place animations are measured from its first frame.

actor::RegisterExtraBody(int, int, string) → int

Classic: RegisterExtraBody

Gives the current actor an extra body: a mesh drawn at the actor's position, in slot 0…3 (replacing the previous one); with still 0 the actor's animations play on it, otherwise it holds the first frame. Types are strictly int, int, string. Not used in the game's scripts.

actor::SetWalkSpeed(string, float) → int

Classic: ActorSetWalkSpeed

Sets the current actor's movement speed for a walk animation, in world pixels per tick; speed must be a float.

actor::ModifyScale(float) → int

Classic: ActorModifyScale

Multiplies the current actor's model scale by k.

actor::SetModelOffset(string, float, float, float) → int

Classic: SetActorAddVariables

Sets the offset of the actor's model from its position; only the axes passed as float are changed.

actor::SetModelAngle(float) → int

Classic: AdjustAngle

Sets the orientation correction of the current actor's model in degrees; float only.

actor::InitState(int) → int

Classic: SetActorState

Sets the current actor's state (selects its animation set).

actor::Place(string, string, int, ?int) → int

Classic: PlaceActor

Places an enabled actor at point index of an area (the angle comes from the point), on floor 0 or 1; the form actor::Place(name, x, y[, dir]) places it on battle grid tile (x, y), dir in eighths of a turn. Returns 1 if placement happened.

actor::SetAnimation(string, string, ?int) → int

Classic: Actor_SetAnimation

Queues a one-shot animation for the actor after its current commands; "idle" is the idle of the current state. noBlend = 1 means no blending with the previous animation.

actor::SetAsyncAnimation(string, string, ?int, ?int) → int

Classic: Actor_SetAsyncAnimation

Queues a one-shot animation for the actor without waiting for it to finish; reverse plays it from the last frame. noBlend = 1 means no blending with the previous animation.

actor::SetState(string, int, ?int) → int

Classic: Actor_SetState

Sets the actor's state and, if the actor is not busy, picks a new idle. flag = 1 means the next animation is not blended.

actor::QueueState(string, int) → int

Classic: Actor_QueueState

Adds a stance change to the actor's command queue; in battle 0 and 1 become 7 and 8, and stance 4 also removes meshes from link points. Not used in the game's scripts.

actor::TextEffect(string, any) → int

Classic: Actor_TextEffect

Shows popup text from string.tab with number text (or by a UI text key: "no_ammo") above a placed actor (like "No ammo" in battle) and plays battle_noammo.

actor::InArea(string, string) → bool

Classic: ActorInArea

True if the actor's background position is inside the area.

actor::Stop(string) → int

Classic: StopActor

Stops the actor: clears the command queue, the path and the current command.

actor::Vibrato(string, float, float) → int

Classic: Vibrato

Makes the actor sway with the given amplitude and phase step per tick; both must be floats.

actor::WalkOnTrack(string, string, ?float, ?int) → int

Classic: WalkOnSceneryTrack

Places the actor at point start of area track at the given height and leads it along the remaining points at walking speed, turning along the way.

actor::SetFloor(string, int) → int

Classic: SetActorMap

Puts the actor on floor 1 (.wm2) if floor is 1, otherwise on floor 0 (.wm).

actor::QueueDelay(string, int) → int

Classic: Actor_QueueDelay

Adds a pause of ticks ticks to the actor's command queue.

actor::QueueJustifyPosition(string) → int

Classic: Actor_QueueJustifyPosition

When the actor's command queue reaches this entry, shifts the actor by the offset of the displayed pose from the last frame of the current animation; the next animation starts without blending.

actor::QueuePlace(string, string, int) → int

Classic: Actor_QueuePlace

When the actor's command queue reaches this entry, places the actor at point index of the area (floor 0) and drops the rest of the queue; the next animation starts without blending.

actor::QueueCall(string, string, string) → int

Classic: Actor_QueueGOScriptFunc

When the actor's command queue reaches this entry, calls a script function of the object named like the actor.

actor::Call(string, string, string) → any

Classic: Actor_GORunFun

Immediately calls a script function of the object named like the actor (not through the queue).

actor::PutBackItem(string) → int

Classic: ActorPutBackItem

Queues putting a two-handed weapon from the hands onto the back: "hide_back", meshes are removed from link points, the weapon goes to "back", stance 0. Does nothing without a two-handed item in hand. Not used in the game's scripts.

actor::PutFrontItem(string) → int

Classic: ActorPutFrontItem

Queues taking a two-handed weapon from the back: after animation blending, meshes are removed from link points, stance 1, "hide_back" in reverse without waiting, 30 ticks, the weapon goes to "two_hands". Not used in the game's scripts.

actor::Attach(string, string, float, float, float, float) → int

Classic: AttachActors

Attaches the actor to the parent with the given offset, and it moves together with the parent: a and b horizontally in the parent's axes, c vertically, in world units; angle is added to the parent's angle. All four must be floats. Not used in the game's scripts.

actor::DetachAllFrom(string) → int

Classic: DetachActorsFrom

Detaches all actors attached to the parent and resets their model offsets.

actor::LinkRider(string, string) → int

Classic: LinkActor

The actor rides the calling object at this link point of its mesh and is drawn together with it in its own animations (Smoke Rider pilots).

actor::ShowLinkMesh(string, string, ?int) → int

Classic: ActivateLink

Shows a mesh at a link point of the current actor (Headnail's saws). The port ignores the third argument.

actor::HideLinkMesh(string) → int

Classic: DeactivateLink

Removes the mesh from a link point of the current actor (the reverse of actor::ShowLinkMesh). Not used in the game's scripts.

actor::ShowItemInHand(string, string) → int

Classic: Actor_ActivateLink

Shows an item's mesh in the actor's hand (point two_hands for two-handed items, otherwise one_hand).

actor::HideAllLinkMeshes(string) → int

Classic: Actor_DeactivateAllLinks

Removes all meshes attached to the actor's link points.