System Functions

Return to Functions

SetStgFrame

    Arguments:
        1) real: left
        2) real: top
        3) real: right
        4) real: bottom
        5) real: minRenderPriorityI
        6) real: maxRenderPriorityI

Sets the STG space frame with the given rectangle and minimum and maximum (integer) render priorities.

Default values are (32, 16, 416, 464, 20, 80).

GetScore

    Return Type:
        real

Returns the current score.

AddScore

    Arguments:
        1) real: score

Adds the given value to the score.

GetGraze

    Return Type:
        real

Returns the current graze count.

AddGraze

    Arguments:
        1) real: graze

Adds the given value to the graze count.

GetPoint

    Return Type:
        real

Returns the current amount of point items collected.

AddPoint

    Arguments:
        1) real: point

Adds the given value to the point count.

SetItemRenderPriorityI

    Arguments:
        1) real: renderPriorityI

Sets the render priority for items, on a 0 to 100 scale.

Default is 60.

SetShotRenderPriorityI

    Arguments:
        1) real: renderPriorityI

Sets the render priority for shots, on a 0 to 100 scale.

Default is 50.

GetStgFrameRenderPriorityMinI

    Return Type:
        real

Returns the lowest render priority for the STG frame, on a 0 to 100 scale.

Default is 20.

GetStgFrameRenderPriorityMaxI

    Return Type:
        real

Returns the highest render priority for the STG frame, on a 0 to 100 scale.

Default is 80.

GetItemRenderPriorityI

    Return Type:
        real

Returns the render priority for items, on a 0 to 100 scale.

GetShotRenderPriorityI

    Return Type:
        real

Returns the render priority for shots, on a 0 to 100 scale.

GetPlayerRenderPriorityI

    Return Type:
        real

Returns the render priority for the player, on a 0 to 100 scale.

GetCameraFocusPermitPriorityI

    Return Type:
        real

Returns the highest render priority the 2D camera can affect, on a 0 to 100 scale.

Default is 79.

GetStgFrameLeft

    Return Type:
        real

Returns the leftmost coordinate of the STG frame (playing field).

Default is 32.

GetStgFrameTop

    Return Type:
        real

Returns the topmost coordinate of the STG frame (playing field).

Default is 16.

GetStgFrameWidth

    Return Type:
        real

Returns the width of the STG frame (playing field).

Default is 384.

GetStgFrameHeight

    Return Type:
        real

Returns the height of the STG frame (playing field).

Default is 448.

GetScreenWidth

    Return Type:
        real

Returns the width of the screen (resolution) as defined in the .def.

Default is 640.

GetScreenHeight

    Return Type:
        real

Returns the height of the screen (resolution) as defined in the .def.

Default is 480.

GetMaxScreenWidth

    Return Type:
        real

Returns the largest screen width defined in the .def.

If only one screen size is defined, this has the same effect as GetScreenWidth.

GetMaxScreenHeight

    Return Type:
        real

Returns the largest screen height defined in the .def.

If only one screen size is defined, this has the same effect as GetScreenHeight.

GetWindowWidth

    Return Type:
        real

Returns the current width of the window.

GetWindowHeight

    Return Type:
        real

Returns the current height of the window.

IsReplay

    Return Type:
        bool

Returns true if a replay is playing, otherwise returns false.

AddArchiveFile

    Return Type:
        bool

Adds the path to use when reading images or sounds from an archive file.

Returns true if the archive was successfully read, otherwise returns false.

IsSkipMode

    Return Type:
        bool

Returns true if the game is currently in skip (fast-forward) mode, otherwise returns false.

GetDnhConfigValue

    Arguments:
        1) real const: configType
        2) varies: ... (varargs args)
    Return Type:
        varies

Returns a value from dnh's current config data based on the given config type.

SetDnhConfigValue

    Arguments:
        1) real const: configType
        2) varies: ... (varargs args)

Sets a value to dnh's current config data based on the given config type.

Note: This will persist for the rest of the session, but in order to be saved, SaveDnhConfigFile must be called.

DnhConfig_GetWindowStyle

    Return Type:
        real

Returns the window style from DnhConfig.

(fullscreen, windowed)

DnhConfig_GetWindowSizeIndex

    Return Type:
        real

Returns the window size index from DnhConfig.

This is an index into the window size list defined in rdnh.def.

DnhConfig_GetFrameskipMode

    Return Type:
        real

Returns the frameskip mode from DnhConfig

(1/1, 1/2, 1/3, Automatic)

DnhConfig_IsVsync

    Return Type:
        bool

Returns a boolean indicating whether or not vertical sync is enabled in DnhConfig.

DnhConfig_IsBorderlessFullScreen

    Return Type:
        bool

Returns a boolean indicating whether or not borderless fullscreen mode is enabled in DnhConfig.

DnhConfig_IsIntegerScale

    Return Type:
        bool

Returns a boolean indicating whether or not integer scaling for borderless fullscreen mode is enabled in DnhConfig.

Note: In official Touhou this is known as "DOT by DOT" mode.

DnhConfig_GetPadIndex

    Return Type:
        real

Returns the currently set pad index, chosen from the list of pads displayed in config.exe.

DnhConfig_GetVirtualKey

    Arguments:
        1) real const: virtualKeyID
    Return Type:
        real array

Returns an array of info about the given virtual key in DnhConfig.

[keyboardKey, padIndex, padButton]

DnhConfig_IsLogWindow

    Return Type:
        bool

Returns a boolean indicating whether or not the LogWindow is enabled in DnhConfig.

DnhConfig_IsLogFile

    Return Type:
        bool

Returns a boolean indicating whether or not logging to a file is enabled in DnhConfig.

DnhConfig_IsMouseVisible

    Return Type:
        bool

Returns a boolean indicating whether or not mouse visibility is enabled in DnhConfig.

DnhConfig_GetUserValue

    Arguments:
        1) real const: valueIndex
    Return Type:
        bool

Returns a user-defined real number value that was saved within DnhConfig at a given index. 8 user-defined indices (0-7) are available.

DnhConfig_SetWindowStyle

    Arguments:
        1) real const: style

Sets the window style in DnhConfig.

(fullscreen, windowed)

DnhConfig_SetWindowSizeIndex

    Arguments:
        1) real: windowSizeIndex

Sets the window size index in DnhConfig.

This is an index into the window size list defined in rdnh.def.

DnhConfig_SetFrameskipMode

    Arguments:
        1) real const: mode

Sets the frameskip mode in DnhConfig.

DnhConfig_SetVsync

    Arguments:
        1) bool: enable

Enables or disables vertical sync in DnhConfig.

DnhConfig_SetBorderlessFullScreen

    Arguments:
        1) bool: enable

Enables or disables borderless fullscreen mode in DnhConfig.

DnhConfig_SetIntegerScale

    Arguments:
        1) bool: enable

Enables or disables integer scaling for borderless fullscreen mode is enabled in DnhConfig.

Note: In official Touhou this is known as "DOT by DOT" mode.

DnhConfig_SetPadIndex

    Arguments:
        1) real: padIndex

Sets the pad index, chosen from the list of pads displayed in config.exe.

DnhConfig_SetVirtualKey

    Arguments:
        1) real const: virtualKeyID
        2) real const: keyboardKey
        3) real: padIndex
        4) real: padButton

Maps a virtual key to a keyboard key and/or pad button.

Note: The pad button can be acquired from CheckPadState()

DnhConfig_SetLogWindow

    Arguments:
        1) bool: enable

Enables or disables the LogWindow in DnhConfig.

DnhConfig_SetLogFile

    Arguments:
        1) bool: enable

Enables or disables logging to files in DnhConfig.

DnhConfig_SetMouseVisible

    Arguments:
        1) bool: enable

Enables or disables mouse visibility in DnhConfig.

DnhConfig_SetUserValue

    Arguments:
        1) real: index
        2) real: value

Sets a user-defined real number value that is saved within DnhConfig at a given index. 8 user-defined indices (0-7) are available.

SaveDnhConfigFile

    Return Type:
        bool

Saves the current config data to the module directory and returns true if successful.

This file is named config.dat by default.

DnhDef_GetPackageScriptPath

    Return Type:
        string

Returns the package script path defined in rdnh.def (PackageScriptMain)

DnhDef_GetScreenSizes

    Return Type:
        2D real array

Returns an array of screen sizes defined in rdnh.def in the format: [[x, y], [x, y], [etc]]

This will be the screen size defined for each aspect ratio (Screen_4_3, Screen_16_9, etc)

DnhDef_GetWindowSizes

    Return Type:
        2D real array

Returns the full array of window sizes defined in rdnh.def in the format: [[x, y], [x, y], [etc]]

DnhDef_GetDefaultWindowSizeIndex

    Return Type:
        real

Returns the default window size index.

This is the index of the window size to start with by default when no config data exists.