Skip to content

Mod Docker API

Hanaka edited this page Mar 20, 2022 · 1 revision

The Mod Docker API is a API designed for mods that can be used if the mod is being played under Mod Docker (like detect additional copies).

Usage

Make a new RPY file (or use a existing one) and add this code to the top of your script.

init 1 python:
    try:
        import ddmd_api
        ddmdApi = ddmd_api.ModDocker_API()
    except: pass

or

init 1 python:
    persistent.api_present = False
    try:
        import ddmd_api
        persistent.api_present = True
    except: pass
    
    if persistent.api_present:
        ddmdApi = ddmd_api.ModDocker_API()

Available Options

Obtaining the currently loaded mods' base folder

Function Arguments Example Syntax Returns
get_current_container_path() None ddmd_api.get_current_container_path() <path/to/base/folder>

Obtaining the currently loaded mods' game folder

Function Arguments Example Syntax Returns
get_current_container_game_folder() None ddmd_api.get_current_container_game_folder() <path/to/game/folder>

Obtaining the currently loaded mods' name

Function Arguments Example Syntax Returns
get_current_container_name() None ddmd_api.get_current_container_name() "<Mod Name>"

Obtaining the currently loaded mods' version number

Function Arguments Example Syntax Returns
get_current_container_version() None ddmd_api.get_current_container_version() "1.0.0"

Obtaining the currently loaded mods' build name

Function Arguments Example Syntax Returns
get_current_container_build_name() None ddmd_api.get_current_container_build_name() "<ModBuildName>"

Obtaining the currently loaded mods' saves folder

Function Arguments Example Syntax Returns
get_current_container_save_folder() None ddmd_api.get_current_container_save_folder() "<path/to/saves/folder>"

Check for multiple copies of the same mod

Function Arguments Example Syntax Returns
is_multiple_copies() None ddmd_api.is_multiple_copies() True | False

[BETA] Set a multipersistent file for your mods (series of mods)

Function Arguments Example Syntax Returns
set_multipersistent() persist_name: str ddmd_api.set_multipersistent("gov.sdc.weiss") None

[BETA] Gets the current multipersistent variable

Function Arguments Example Syntax Returns
get_multipersistent() None ddmd_api.get_multipersistent() MultiPersistent()