Skip to content
Haoming edited this page Aug 27, 2024 · 2 revisions

For API usages, this Extension takes seven parameters:

enable: Boolean = true
mode: String = "Basic" | "Advanced" | "Mask"
separator: String = ""
direction: String = "Horizontal" | "Vertical" | null
background: String = "None" | "First Line" | "Last Line" | null
background_weight: Number = 0.1 ~ 1.5 | null
mapping: Array = Array[] | Object[] | null

To use the Extension with API, add the following example object to the alwayson_scripts entry of your payload, and adjust the parameters as needed

Common Parameters

  • enable is always true (Otherwise why are you here)
  • mode is always required
  • separator is always required
    • Can just pass in an empty string ("") to use the newline character

Basic Mode

  • direction is always required
  • background is always required
    • background_weight is required if background is not set to "None"; otherwise can just be null
  • mapping can just be null
example payload
"forge couple": {
    "args": [
        true,
        "Basic",
        "",
        "Horizontal",
        "None",
        null,
        null
    ]
}

Advanced Mode

  • direction can just be null
  • background can just be null
  • background_weight can just be null
  • mapping is an array of array
    • Each array corresponds to a region, with five values: x1, x2, y1, y2, and weight.
    • Refer to README for the rules of the values
example payload
"forge couple": {
    "args": [
        true,
        "Advanced",
        "",
        null,
        null,
        null,
        [
            [
                "0.0",
                "0.5",
                "0.0",
                "1.0",
                "1.0"
            ],
            [
                "0.5",
                "1.0",
                "0.0",
                "1.0",
                "1.0"
            ]
        ]
    ]
}

Mask

  • direction can just be null
  • background is always required
    • background_weight is required if background is not set to "None"; otherwise can just be null
  • mapping is an array of dictionary
    • Each dictionary corresponds to a region, with two key-value pairs: mask and weight
    • The mask is a grayscale image where white color is active, encoded in base64
    • The weight is a float
example payload
"forge couple": {
    "args": [
        true,
        "Mask",
        "",
        null,
        "First Line",
        0.5,
        [
            {
                "mask": "<mask in base64>",
                "weight": 1.0
            },
            {
                "mask": "<mask in base64>",
                "weight": 1.0
            }
        ]
    ]
}
Clone this wiki locally