Mod:Knightcore/ActorsKC: Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
No edit summary
Imbion (talk | contribs)
saving for sanity
Line 4: Line 4:
Note: Functions with an asteric next to their headers are imported from Halycon.
Note: Functions with an asteric next to their headers are imported from Halycon.


== GlanceThere ==
== Movement ==
 
=== FaceMovingCharacter* ===
Faces a moving character.
 
Arguments:
* <code>chara</code>, character: The character that will face the moving target.
* <code>target</code>, character: The character <code>chara</code> will face.
* <code>turnFrames</code>, integer: The amount of frames to take to turn.
* <code>breakDirection</code>, direction: The direction to stop turning at.
 
=== EightWayMove* ===
Walks to somewhere solely using 8 direction axis movement, first diagonally then straight.
 
Arguments:
* <code>chara</code>, character: The character that will be moving.
* <code>x</code>, integer: The amount of tiles to move on the x axis.
* <code>y</code>, integer: The amount of tiles to move on the y axis.
* <code>speed</code>, integer: The speed to move at.
 
=== EightWayMoveRS* ===
Walks to somewhere solely using 8 direction axis movement, first straight then diagonally.
 
Arguments:
* <code>chara</code>, character: The character that will be moving.
* <code>x</code>, integer: The amount of tiles to move on the x axis.
* <code>y</code>, integer: The amount of tiles to move on the y axis.
* <code>speed</code>, integer: The speed to move at.
 
=== RunInCircle* ===
Runs around in a circle.
 
Arguments:
* <code>chara</code>, character: The character that will be running around in a circle.
* <code>duration</code>, integer: The amount of time to run around in the circle.
* <code>speed</code>, integer: The speed to move at.
* <code>clockwise</code>, boolean, optional: True if moving clockwise.
* <code>run</code>, boolean, optional: True if the running animation should be used.
 
=== TurnTowardsLocation* ===
Turns towards the specified location. Used in cases of a character having a dynamic position.
 
Arguments:
* <code>chara</code>, character: The character that will be turning.
* <code>targetX</code>, integer: The coordinate in the x axis to turn towards.
* <code>targetY</code>, integer: The coordinate in the Y axis to turn towards.
* <code>turnDuration</code>, positive integer: How long to keep turning.
 
=== GlanceThere ===
Causes the actor to briefly "look" in a direction with a pause to delay continued execution.
Causes the actor to briefly "look" in a direction with a pause to delay continued execution.


== SpyAround ==
Arguments:
* <code>actor</code>, character: Who will be glancing.
* <code>direction</code>, direction: What direction to glance in.
* <code>frameDelay</code>, positive integer, optional: The frames to spend glancing. Default is 40.
 
=== SpyAround ===
Causes the actor to "look around" by rotating in several different directions in a particular way. The actor skips looking towards the direction they started on, ending on the specified direction.
Causes the actor to "look around" by rotating in several different directions in a particular way. The actor skips looking towards the direction they started on, ending on the specified direction.


== Emote ==
* <code>actor</code>, character: Who will be spying around.
* <code>startDir</code>, direction: The direction the sequence starts in.
* <code>seqVariant</code>, 1-4, optional: Select the specific variation of series of glances to do. Default 1.
* <code>endDir</code>, direction, optional: The direction that will be ended on, default to startDir.
* <code>frameDelay</code>, positive integer, optional: The amount of time to delay between each turn. Default is 20.
 
== Ground Emotes ==
=== Emote ===
The actor performs a ground emote.
The actor performs a ground emote.


== EmoteAndPause ==
=== EmoteAndPause ===
The actor performs a ground emote, and then pauses. Auto chosen timings are based off of Halycon's.
The actor performs a ground emote, and then pauses. Auto chosen timings are based off of Halycon's.


== TurnToCharaAnim ==
=== TurnToCharaAnim ===
Turn to another character with animation. Used over <code>GROUND:CharTurnToCharAnimated</code> to simplify code using the default value.  
Turn to another character with animation. Used over <code>GROUND:CharTurnToCharAnimated</code> to simplify code using the default value.  
== TurnToDirAnim ==
 
=== TurnToDirAnim ===
Turn to another direction with animation. Used over <code>GROUND:CharAnimateTurn</code> to simplify code using the default value.  
Turn to another direction with animation. Used over <code>GROUND:CharAnimateTurn</code> to simplify code using the default value.  


== TurnToDirAnimClosest ==
=== TurnToDirAnimClosest ===
Turn to another direction with an animation, calculating whenever turning clockwise or counterclockwise would be "faster" for more natural movement.
Turn to another direction with an animation, calculating whenever turning clockwise or counterclockwise would be "faster" for more natural movement.


== DoAnimThenStop ==
=== DoAnimThenStop ===
Perform a ground animation once, and then stop immediately when done.
Perform a ground animation once, and then stop immediately when done.


== ConvoStillStart ==
=== ConvoStillStart ===
Sets animation to none for all actors passed through a table. Used for "normal" conversations where the characters in the conversation stop their idle animations.
Sets animation to none for all actors passed through a table. Used for "normal" conversations where the characters in the conversation stop their idle animations.


== ConvoStillEnd ==
=== ConvoStillEnd ===
Stops the animations for all actors passed through a table, returning them to their idle animations.
Stops the animations for all actors passed through a table, returning them to their idle animations.


== FaceMovingCharacter* ==
=== ShakeHead* ===
Faces a moving character.
 
== EightWayMove* ==
Walks to somewhere solely using 8 direction axis movement, first diagonally then straight.
 
== EightWayMoveRS* ==
Walks to somewhere solely using 8 direction axis movement, first straight then diagonally.
 
== RunInCircle* ==
Runs around in a circle.
 
== TurnTowardsLocation* ==
Turns towards the specified location. Used in cases of a character having a dynamic position.
 
== ShakeHead* ==
Shakes the actor's head.
Shakes the actor's head.


== Hop* ==
=== Hop* ===
Makes the actor hop.
Makes the actor hop.


== DoubleHop* ==
=== DoubleHop* ===
Makes the actor hop twice.
Makes the actor hop twice.


== Recoil* ==
=== Recoil* ===
Makes the actor recoil.
Makes the actor recoil.


== Complain* ==
=== Complain* ===
Actor jumps up twice and complains.
Actor jumps up twice and complains.


== Shake* ==
=== Shake* ===
Shake in place for a brief moment.
Shake in place for a brief moment.


== StartTremble* ==
=== StartTremble* ===
Starts trembling until stopped.
Starts trembling until stopped.


== EndTremble* ==
=== EndTremble* ===
End the actor's trembling.
End the actor's trembling.

Revision as of 16:12, 21 October 2025

This article is a stub. You can help PMDO Wiki by expanding it.

The following functions are found in the ActorsKC.lua file in Knightcore. These functions can be called from other lua script files by including the line require 'knightcore.ActorsKC', and then called with the prefix ActorsKC.

Note: Functions with an asteric next to their headers are imported from Halycon.

Movement

FaceMovingCharacter*

Faces a moving character.

Arguments:

  • chara, character: The character that will face the moving target.
  • target, character: The character chara will face.
  • turnFrames, integer: The amount of frames to take to turn.
  • breakDirection, direction: The direction to stop turning at.

EightWayMove*

Walks to somewhere solely using 8 direction axis movement, first diagonally then straight.

Arguments:

  • chara, character: The character that will be moving.
  • x, integer: The amount of tiles to move on the x axis.
  • y, integer: The amount of tiles to move on the y axis.
  • speed, integer: The speed to move at.

EightWayMoveRS*

Walks to somewhere solely using 8 direction axis movement, first straight then diagonally.

Arguments:

  • chara, character: The character that will be moving.
  • x, integer: The amount of tiles to move on the x axis.
  • y, integer: The amount of tiles to move on the y axis.
  • speed, integer: The speed to move at.

RunInCircle*

Runs around in a circle.

Arguments:

  • chara, character: The character that will be running around in a circle.
  • duration, integer: The amount of time to run around in the circle.
  • speed, integer: The speed to move at.
  • clockwise, boolean, optional: True if moving clockwise.
  • run, boolean, optional: True if the running animation should be used.

TurnTowardsLocation*

Turns towards the specified location. Used in cases of a character having a dynamic position.

Arguments:

  • chara, character: The character that will be turning.
  • targetX, integer: The coordinate in the x axis to turn towards.
  • targetY, integer: The coordinate in the Y axis to turn towards.
  • turnDuration, positive integer: How long to keep turning.

GlanceThere

Causes the actor to briefly "look" in a direction with a pause to delay continued execution.

Arguments:

  • actor, character: Who will be glancing.
  • direction, direction: What direction to glance in.
  • frameDelay, positive integer, optional: The frames to spend glancing. Default is 40.

SpyAround

Causes the actor to "look around" by rotating in several different directions in a particular way. The actor skips looking towards the direction they started on, ending on the specified direction.

  • actor, character: Who will be spying around.
  • startDir, direction: The direction the sequence starts in.
  • seqVariant, 1-4, optional: Select the specific variation of series of glances to do. Default 1.
  • endDir, direction, optional: The direction that will be ended on, default to startDir.
  • frameDelay, positive integer, optional: The amount of time to delay between each turn. Default is 20.

Ground Emotes

Emote

The actor performs a ground emote.

EmoteAndPause

The actor performs a ground emote, and then pauses. Auto chosen timings are based off of Halycon's.

TurnToCharaAnim

Turn to another character with animation. Used over GROUND:CharTurnToCharAnimated to simplify code using the default value.

TurnToDirAnim

Turn to another direction with animation. Used over GROUND:CharAnimateTurn to simplify code using the default value.

TurnToDirAnimClosest

Turn to another direction with an animation, calculating whenever turning clockwise or counterclockwise would be "faster" for more natural movement.

DoAnimThenStop

Perform a ground animation once, and then stop immediately when done.

ConvoStillStart

Sets animation to none for all actors passed through a table. Used for "normal" conversations where the characters in the conversation stop their idle animations.

ConvoStillEnd

Stops the animations for all actors passed through a table, returning them to their idle animations.

ShakeHead*

Shakes the actor's head.

Hop*

Makes the actor hop.

DoubleHop*

Makes the actor hop twice.

Recoil*

Makes the actor recoil.

Complain*

Actor jumps up twice and complains.

Shake*

Shake in place for a brief moment.

StartTremble*

Starts trembling until stopped.

EndTremble*

End the actor's trembling.