Skip to content

Withered-Flower-0422/MultiBall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

MultiBall

MultiBall patch for Ballex².

Usage

  1. Put the whole Assets folder in %USERPROFILE%\AppData\LocalLow\Mushreb\BME Pro HDRP.
  2. Drag the MultiBall item into the scene.
  3. If you want MultiBall tips, drag the MultiBallTip item into the scene. The tip will show up after first ball appending in the game.
  4. Then you can use the MultiBall related items in BME Pro HDRP like official items.

Warning

MultiBall is currently incompatible with custom ball.

Config

MultiBall

Variable Name Type Description
switchBallKeys string[] The keys to switch the ball. There are two strings in the array. The first is the key to switch the ball when in Four Direction View Mode, and the second is the key to switch the ball when in Free View Mode or First Person View Mode.
cameraEase bool How the camera moves when switching the ball. If set to true, the camera will follow the ball smoothly. If set to false, the camera will jump to the ball's position.
easeDistance float This works only when cameraEase is set to true. Only when the distance between the start switching position and the target position is less than this value, the camera will follow the ball smoothly. Otherwise, the camera will jump to the target position. If the value is set to negative, the camera will always follow the ball smoothly.

MultiBallTip

Variable Name Type Description
duration int How long the tip will stay on the screen. The unit is frame. If set to negative, the tip will stay on the screen until the next section.

Apis

Get apis by:

/**
 * @import { MultiBallMessage } from "multiBall:message"
 * @import { MultiBallManager } from "multiBallApi"
 */

/** @param {*} msg @returns {msg is MultiBallMessage} */
const isMultiBallMessage = msg => msg?._brand === "MultiBallMessage"

/** @type {MultiBallManager} */
let multiBallManager

/** @satisfies {RegisterEvent[]} @typedef {ExpectTrue<IsUnique<typeof registerEvents>>} */
export const registerEvents = /** @type {const} */ (["OnReceiveCustomEvent"])

/** @type {OnEvents<typeof registerEvents>} */
export const onEvents = (self, { OnReceiveCustomEvent }) => {
    if (OnReceiveCustomEvent) {
        const msg = OnReceiveCustomEvent[0]
        if (isMultiBallMessage(msg)) {
            if (msg.OnLoadMultiBall) {
                multiBallManager = msg.OnLoadMultiBall.multiBallManager
            }
        }
    }
}

Tip

Install BST to get type hints.

About

MultiBall patch for Ballex²

Topics

Resources

License

Stars

Watchers

Forks