Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/remapper/src/beatmap.ts>Difficulty

A framework for Beat Saber map scripting.
Go to Latest
class Difficulty
import { Difficulty } from "https://deno.land/x/remapper@3.0.0/src/beatmap.ts";

Constructors

new
Difficulty(input: DIFFPATH, output?: DIFFPATH)

Creates a difficulty. Can be used to access various information and the map data. Will set the active difficulty to this.

Properties

private
postProcesses: Map<unknown[] | undefined, PostProcessFn<unknown>[]>
arcs: Arc[]

All arcs in the map.

basicEventTypesKeywords: Json

Unknown.

bombs: Bomb[]

All bombs in the map.

boostColorLeft: Vec3

The left boost light color.

boostColorRight: Vec3

The right boost light color.

boostEvents: BoostEvent[]

All light boost color events. Doesn't include basic event version.

BPMChanges: BPMChange[]

All BPM changes.

chains: Chain[]

All chains in the map.

colorLeft: Vec3

The left object color.

colorRight: Vec3

The right object color.

customData

Custom data in the map.

customEvents: CustomEventInternals.BaseEvent[]

All custom events in the map.

diffRank: number

The difficulty rank.

diffSet: Json

The Json of the difficulty set (e.g. Standard) that this difficulty is contained in inside of the Info.dat.

diffSetMap: Json

The Json of the difficulty set map (e.g. Hard) that this difficulty is contained in inside of the Info.dat.

diffSetName: string

The name of the difficulty set. E.g. Standard

editorOffset: number

Unknown

editorOldOffset: number

Unknown

events: EventInternals.AbstractEvent[]

All basic events in the map.

fakeBombs: Bomb[]

All fake bombs in the map.

fakeChains: Chain[]

All fake chains in the map.

fakeNotes: Note[]

All fake notes in the map.

fakeWalls: Wall[]

All fake walls in the map.

fileName: string

The filename for this difficulty.

geoMaterials: Record<string, GeometryMaterial>

All materials for geometry.

information: string[]

Information to display in the info button.

json: Json

The Json of the entire difficulty.

label: string

The custom difficulty name.

lightColorLeft: Vec3

The left light color.

lightColorRight: Vec3

The right light color.

lightEventBoxes: LightEventBox[]

All light event boxes. (V3 lighting)

lightRotationBoxes: LightRotationBox[]

All rotation event boxes. (V3 light rotating)

mapFile: DIFFPATH

The path to the output file of this difficulty.

name: string

The name of the difficulty. E.g. Hard

NJS: number

The note jump speed for this difficulty.

notes: Note[]

All notes in the map.

offset: number

The note offset for this difficulty.

pointDefinitions: Record<string, RawKeyframesAny>

Point definitions in the map. Used as arbitrary animation data.

rawEnvironment: EnvironmentInternals.BaseEnvironment[]

The unaliased environment object array.

rawSettings: Json

The unaliased settings object.

relativeMapFile: DIFFNAME

The filename of the output file of this difficulty.

requirements: string[]

The mod requirements for this difficulty.

rotationEvents: RotationEvent[]

All rotation events in the map. Used for 90 and 360 levels. Doesn't include basic event version.

readonly
settings: Proxy

The settings to be set for this difficulty.

suggestions: string[]

The mod suggestions for this difficulty.

useBasicEvents: boolean

Unknown, probably enables/disables basic events.

version: string

The beatmap version.

wallColor: Vec3

The color for walls.

walls: Wall[]

All walls in the map.

warnings: string[]

Warnings to display in the info button.

waypoints: Json[]

All waypoints. Not much is known about what these do.

Methods

private
colorArrayToTuple(array: Vec3)
private
pruneInput(
object: Json,
property: string,
value: any,
)
abstractEvents(fn: (arr: CustomEventInternals.AbstractEvent[]) => void)

Returns a callback function providing an array of all AbstractEvent events.

addPostProcess<T>(object: T[] | undefined, fn: PostProcessFn<T>)

Allows you to add a function to be run on save of this difficulty.

animateComponents(fn: (arr: CustomEventInternals.AnimateComponent[]) => void)

Returns a callback function providing an array of all AnimateComponent events.

animateTracks(fn: (arr: CustomEventInternals.AnimateTrack[]) => void)

Returns a callback function providing an array of all AnimateTrack events.

assignPathAnimations(fn: (arr: CustomEventInternals.AssignPathAnimation[]) => void)

Returns a callback function providing an array of all AssignPathAnimation events.

assignPlayerToTracks(fn: (arr: CustomEventInternals.AssignPlayerToTrack[]) => void)

Returns a callback function providing an array of all AssignPlayerToTrack events.

assignTrackParents(fn: (arr: CustomEventInternals.AssignTrackParent[]) => void)

Returns a callback function providing an array of all AssignTrackParent events.

doPostProcess<T = unknown>(object?: T[] | undefined)

Runs the post process functions in this difficulty.

environment(fn: (arr: Environment[]) => void)

Returns a callback function providing an array of all Environment objects.

geometry(fn: (arr: Geometry[]) => void)

Returns a callback function providing an array of all Geometry objects.

Go through every animation in this difficulty and optimize it. Warning, this is an expensive action and may be redundant based on what has already been optimized.

require(requirement: MODS, required?)

Add/remove a mod requirement from the difficulty.

save(diffName?: DIFFPATH)

Saves the difficulty.

suggest(suggestion: MODS, suggested?)

Add/remove a mod suggestion from the difficulty.