Skip to content
MyLegGuy edited this page Jul 12, 2020 · 11 revisions

If you get confused about a type, check out the custom type list.

These are for Lua scripts. To execute from .scr scripts, do "luastring <command>". Example: "luastring Wait(100)".


OutputLine(string/int jpADVName, string jpMessage, string/int advName, string Message, LineEndType e)

  • Basic command to put text on the screen. Text will wrap by itself, but you can also use \n explicitly.
  • Pass NULL for advName if you don't want one.
  • If you are using ADV name image mode, you can pass the ID number as advName instead.
  • Pass nil/NULL for jpADVName and jpMessage if you don't want them.

ClearMessage()

  • Clears the text on the screen. Also copies the text to the textlog.

OutputLineAll(_ignored, string Message, LineEndType e)

  • Output all this text to the screen at once, no fancy letter by letter animation.

Wait(int milliseconds)

  • Waits for the passed number of milliseconds if the user isn't skipping

DrawScene(string imageFilename, int fadeInTime)

  • Changes the background to CG/imagefilename.png
  • It takes fadeInTime milliseconds to fade in.

DrawBG(string imageFilename, int fadeInTime)

  • Exact same as DrawScene

DrawSceneWithMask(string imageFilename, _ignored, _ignored, _ignored, int fadeInTime)

  • Same as DrawScene

PlayBGM(int slot, string musicFilename, int volume, _ignored)

  • Plays BGM/musicFilename.(ogg/wav) as BGM in the passed BGM slot. If another BGM is in that slot, it will be stopped and freed. volume is 0 to 256.
  • slot should be <10.

FadeOutBGM(int slot, int fadeInTime, bool shouldWaitForFinish)

  • Fades out the BGM in the passed slot in fadeInTime milliseconds.
  • Will wait for the BGM to finish fade out if shouldWaitForFinish is true.

SetValidityOfInput(bool isValid)

FadeAllBustshots(int fadeoutTime, bool waitForFadein)

  • Fades out all bustshots in fadeoutTime milliseconds and waits if waitForFadein is true.

DisableWindow()

  • Disables the textbox.

DrawBustshot(int slot, string imageFilename, int xOffset, int yOffset, _ignored, _ignored, _ignored, _ignored, _ignored, _ignored, _ignored, _ignored, int isInvisible, int layer, int fadeInTime, bool waitForFadein)

  • Draws a bustshot in the passed slot.
  • Image should be at CG/imageFilename.png
  • If isInvisible isn't 0, the bust is invisible, making it so you wasted your time.
  • The greater the layer argument, the higher it's drawn. If it's over 31, it's drawn over the text box.

DrawBustshotWithFiltering(int slot, string imageFilename, _ignored, _ignored, int xOffset, int yOffset, _ignored, _ignored, _ignored, _ignored, _ignored, int isInvisible, int layer, int fadeInTime, bool waitForFadein)

  • Same as DrawBustshot but with slightly different unused arguments.

FadeBustshot(int slot, _ignored, _ignored, _ignored, _ignored, _ignored, int fadeInTime, bool waitForFadein)

  • Fades the bustshot in the passed slot in fadeInTime milliseconds. If waitForFadein is true, wait for that to finish.

FadeBustshotWithFiltering(int slot, _ignored, _ignored, _ignored, _ignored, _ignored, int fadeInTime, bool waitForFadein)

  • Exact same as FadeBustshot

PlaySE(int slot, string audioFilename, int volume, _ignored)

  • Plays a sound effect from SE/audioFilename.(ogg/wav)
  • volume is 0 to 256.

StopBGM(int slot)

  • Instantly stops BGM in slot.

CallScript(string filename)

  • Runs the script at Scripts/filename.txt

Select(int numOptions, table arrayOfOptions)

  • Lets the user select an option from a passed table of strings. Get the choice result with LoadValueFromLocalWork("SelectResult")
// Select example
possibleUserChoices = {};
possibleUserChoices[1] = "choice 1";
possibleUserChoices[2] = "choice 2";
Select( #possibleUserChoices, possibleUserChoices );
OutputLine(0,0,0,tostring(LoadValueFromLocalWork( "SelectResult" )),Line_WaitForInput);

LoadValueFromLocalWork(string name)

  • If name is "SelectResult" then returns 0 based result from last selection

CallSection(string functionName)

  • Calls a Lua function named functionName
  • No real reason to use this

JumpSection(string functionName)

  • Same as CallSection

ChangeScene(string functionName, _ignored, _ignored, _ignored)

  • Changes background to CG/functionName.png instantly

DisplayWindow()

  • Shows the window.

MoveBust(int sourceSlot, int destSlot)

  • Move the bust in sourceSlot to destSlot. Will overwrite whatever is in destSlot.

DebugFile(string message)

  • Writes a string to log.txt.

PlayVoice(int slot, string filename, int volume)

  • Plays an ogg/wav file from voice/filename.(ogg/wav)
  • Volume is 0 to 256
  • Voice slots are shared with SE slots

FadeBG(int fadeinTime, bool waitForFadein)

  • Instantly removes the background.

DrawFilm(int filmType, int filmR, int filmG, int filmB, int filmA, _ignored, _ignored, _ignored)

  • If filmType isn't <= 1, the filter will be white with transparency of 127/255.
  • If filmType is 0 or 1, a filter will be drawn over the screen with the supplied RGBA values.

FadeFilm()

  • Instantly removes the film.

SetColorOfMessage(bool _unknown, int r, int g, int b)

  • Sets the color for all the text on screen.
  • You cannot have multiple colors at once, it's a global setting.
  • Also applies to new text. Stays until you fix it.

GetRandomNumber(int exclusiveBound)

  • Generates a random whole number from [0,exclusiveBound)
  • In the actual game (not in my engine), the chance of getting (exclusiveBound-1) generated is nearly 0.

HideWindow(int time)

TODO

  • DrawSprite
  • MoveSprite
  • FadeSprite

int ImageChoice(<normal image 1>, <hover image 1>, <select image 1>, [normal image 2], [hover image 2], [select image 2], [normal image ....])

  • Command for pretty choice selection.
  • Each choice has three images. A normal image, which is what the choice looks like normally. A hover image, which is what the choice looks like when the player's cursor is over it. And a select image, which is what the choice looks like while the user is selecting it, meaning when their cursor is over it and they're holding the select button.
  • You can pass as many choices as you want, but I don't think they'll scroll. Also, just to be clear, you're passing image filenames.
  • This command returns the zero-based index of the user's selection. If you need to use this command from a custom VNDS game, it's also available as a VNDS command.