Mod:Knightcore/ScriptKC

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

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

TrySet

If the emote is a valid emote that exists, set it as the current emote. If not, throw an exception. Primarily for sanity reasons.

InstantTextNS

Shows a textbook with instant text and no speaker.

MoodTalk

Have the speaker speak a line while setting an emote.

Talk

Make the given speaker talk.

StartTalking

Have a new speaker start talking.

StartTalkingDuringConvo

Used to replicate EOS like behavior where there is a slight delay when a new speaker talks. Otherwise, just like StartTalking.

SilentSpeech

MoodTalk but without any text sound.

SilentSpeechDelay

SilentSpeech but with the new speaker delay.

Chaterbox

Loop through a table of lines and say them all.

ChatterboxOneEmote

Chatterbox, but set all lines with one single emote.

VoiceOver

Uses a "standard" voice over text box.

ChaterboxVO

Chatterbox, but with voiceover lines.

TalkNS

Talk with no speaker set for a speakerless textbox.

AskYesNo

Ask a yes-no question and return true if yes, false if no.

AskQuestion

Asks a question. Returns what option was selected for the question.

AskThenRun

Ask a question, then automatically chooses a script from the corresponding table to run.

Helper Functions

The following functions are unavailable to be accessed and are used throughout ScriptKC to run other functions.

VerifyEmote

Checks if the portrait emotion given is an emotion that exists and can be used. Otherwise, throws an exception. Ignores nil.