Mod:Knightcore/SceneKC
Main Page: Mod:Knightcore
The following functions are found in the SceneKCC.lua file in Knightcore. These functions can be called from other lua script files by including the line require 'knightcore.SceneKC', and then called with the prefix SceneKC.
Note: Functions with an asteric next to their headers are imported from Halycon.
DirToNum*
Translates a direction into a corresponding number.
Arguments:
dir, direction: The direction to translate.
Returns: A number representation of the direction
NumToDir*
Translates a number into a corresponding direction.
Arguments:
num, direction: The number to translate.
Returns: A direction that corresponds to the number
PromptSaveAndQuit*
Prompts the player with a save and quit menu.
SendInvToStorage*
Sends the player's inventory to storage. Will be moved to a different namespace in the future.
GroundWarpInZone
Fading out, warp to another ground map within the current zone.
Arguments:
groundMap, string: The name of the ground map to warp to.targetWarp, string: The marker to set the entrance to.keepMusic, boolean, optional: True/unused to keep playing the music, false to not.
FadeOutRefreshParty
Fade out and then refresh the party.
OneDungeonJunction
Create a single dungeon junction (with only one dungeon as an option to enter) that asks if the player wants to enter the dungeon. If the player said yes, then send them to the dungeon. If they said no, return right away. Coroutines can be run depending on a boolean variable, or alternatively every time the player chooses to enter the dungeon.
Arguments:
dunID, string: The ID of the dungeon zone to travel to.doCallback, variable that is a boolean, optional: Whenever to run callback or not. Used to set up cutscens that run depending on a save variable, such as cutscenes that will run only during the first time entering the dungeon. Default is false.callback, function, optional: The function to run when doCallback is true. Not required if the callback feature before entering isn't used.alwaysRun, function, optional: The function to always run when entering the dungeon. Usually used for setting save variables.structID, integer, optional: The structure ID that will be entered. Default is 0.mapID, integer, optional: The map ID that will be entered. Default is 0.entryPoint, string, optional: The entry point to enter the map with. Default is 0.stakes, stake, optional: The stakes that will be applied for this advenure. Default isRogueEssence.Data.GameProgress.DungeonStakes.Risk.recorded, boolean, optional: True if the dungeon adventure is recorded, false if not.silentRestrict, boolean, optional: True if restrictions are silenced, false if not.
KangashkhanRock*
Called inside of a ground map function, pulls up the menu that is previewed when opening a Kangashkhan Rock or other store points.
MoveCharAndCamera*
Moves the character and camera simultaneously.
Arguments:
chara, character: The character who will be moved with the camera.x, positive integer: The x location to move to.y, positive integer: The y location to move to.run, boolean, optional: True to have the character use the running animation, false/unused to not.charSpeed, positive integer, optional: The speed the character moves at.cameraFramesneeds a custom number if this is used.cameraFrames, positive integer, optional: The amount of frames for the camera to use. Use only ifcharSpeedis used.
MoveCamera*
Moves the camera to the target coordinates at a given speed.
Arguments:
x, positive integer: The x coordinate to move the camera to.y, positive integer: The y coordinate to move the camera to.speedpositive integer, optional: The speed the camera moves at. Default is 2.
CenterCamera*
Centers the camera on the given characters.
Arguments:
charList, table: The table of characters to be centered on.startX, positive integer, optional: The X coordinate to start the camera from. Default is the camera's current position.startY, positive integer, optional: The Y coordinate to start the camera from. Default is the camera's current position.speed, positive integer, optional: The speeds to move at. Defaults to 1.
PanCamera*
Pans the camera towards the target location. Use no parameters to pan the camera on the player.
Arguments:
startX, positive integer, optional: The X coordinate to start the camera from. Default is the camera's current position.startY, positive integer, optional: The Y coordinate to start the camera from. Default is the camera's current position.speed, positive integer, optional: The speeds to move at. Defaults to 1.endX, positive integer, optional: The X coordinate to pan to. Nil to pan to player.endY, positive integer, optional: The Y coordinate to pan to. Nil to pan to player.endY, positive integer, optional: The Y coordinate to pan to. Nil to pan to player.
DoubleFlash*
Does a double flash like in a boss transition.
Arguments:
sound, boolean, optional: True to play the sound, false/unused to not.
