Skip to content

Useful _GameSpecific.lua Commands

MyLegGuy edited this page Jun 23, 2020 · 14 revisions

OptionsEnableVoiceSetting(bool isEnabled)

  • Enables or disables the voice setting in the options. This should be enabled if you're using PlayVoice command.

OptionsLoadADVBox()

  • Loads the ADV textbox.

OptionsSetTextMode(TextMode t)

  • Set text mode. TEXTMODE_NVL or TEXTMODE_ADV

OptionsSetTipExist(bool doExist)

  • Sets the existence of TIPS. If false, TIP menu won't be shown in navigation menu. This command is obsolete because custom games should be made in VNDS mode where there is no TIP menu.

oMenuQuit(int enabled)
oMenuVNDSSettings(int enabled)
oMenuVNDSSave(int enabled)
oMenuRestartBGM(int enabled)
oMenuArtLocations(int enabled)
oMenuScalingOption(int enabled)
oMenuVNDSBustFade(int enabled)
oMenuDebugButton(int enabled)
oMenuTextboxMode(int enabled)
oMenuTextOverBG(int enabled)
oMenuFontSize(int enabled)

  • If these settings should be shown in the settings menu. Please pass "1" to show them or "0" to hide them.

textOnlyOverBackground(int enabled)

  • Force the "textbox full/small" setting. Passing "1" will set "textbox: small". Please only use this command if you're embedding your game in the VPK because this command will overwrite the user's own "textbox full/small" setting in the options file. Also note that you should call "oMenuTextOverBG(0)" to make it so the user can't change this setting back after you set it.

dynamicAdvBoxHeight(int enabled)

  • If the ADV box height should change depending on how much text is being shown right now. Only applies if you set your game to ADV mode. If you use a custom image for the ADV box it's recommended you disable dynamic height using this command.

advboxHeight(int height)

  • Manually set the height of the ADV box. If you're using a custom image for the ADV box you should call this with the argument being the height of your custom image.

OptionsSetIncludedFileExtensions(bool includeExtensions)

  • If the filenames you pass for sound and image functions include the file extension in them.

OptionsCanChangeBoxAlpha(bool enabled)

  • If the user can change the alpha of the message box. If you're using ADV mode and you're using a custom image for your ADV box and your ADV box isn't a solid color, please use this command to disable the user's box alpha setting. When this setting is enabled, the ADV box will be drawn without changing its transparency (255).
  • However, if you somehow enter NVL mode then the setting will reappear and be used for the box. This is to prevent you from being stuck with 255 alpha, obscuring the game. (v2.9.3+)

OptionsSetPositionSize(int width, int height)

  • When passing position arguments to the DrawBustshot or setimg, the values you pass to this function will act as the maximum width and height. Your position arguments will scale depending on these. To put it simply, this is the internal screen size, how big your scripts should THINK the screen is.

setADVNameSupport(int areSupported)

  • Tell the engine if names are supported for ADV mode.
  • 0 - Names not supported
  • 1 - Names supported
  • 2 - Names supported, and the user can't turn them off

advNamesPersist(int persistLevel)

  • ADV name persistence level.
  • 0 - Default. Name must be set every time. For Lua scripts, this means it must be set with each OutputLine command. For VNDS scr scripts, this means before every text command.
  • 1 - Name is only cleared when ClearMessage is used. Default mode for Higurashi PS3 patch.
  • 2 - Name is never cleared automatically. For Lua scripts, pass an empty string as the name in an OutputLine to clear. For scr scripts, run "advname" with no arguments.

OptionsSetFontSize(int size)

  • Set font size. 32 is default.
  • You may also want to disable the setting with oMenuFontSize

scalePixels(int fake, int isHeight)

  • Scale pixels from the fake screen size (specified by OptionsSetPositionSize) to the actual current screen size.
  • Pass 0 for isHeight to scale as width, pass 1 to scale as height.
  • This is useful for functions that take exact pixel counts, like advboxHeight function

setTextboxTopPad(int pad)

  • Extra space between top of textbox and where the text starts

loadImageNameSheet(string relativeName)

  • Load the sprite sheet used for ADV name image mode. The filename passed is like one you'd pass to load a bustshot. It's relative to the CG folder.
  • There's an alternative way to display names in ADV mode. It uses a sprite sheet to display the names as images instead of text. After defining where the names are in the sprite sheet, ID's are used to refer to which one you want to display. Refer to OutputLine or advnameim function documentation for where to put ID.

defineImageName(int id, int x, int y, int w, int h)

  • Define where a name is in the ADV name image. This information is bound to the supplied ID.

setADVNameImageHeight(int height)

  • How tall the ADV name images will be when displayed inside the textbox.

GBPLAT