Skip to content

Beatmap Objects

Swifter edited this page Nov 25, 2024 · 35 revisions

Prerequisites

  • Make sure you've read about difficulties before continuing.

Property Translations

What is this?

Raw JSON ReMapper
b beat

Creating

ReMapper typically comes with 2 functions to create beatmap objects.

For example, let's look at creating a new ColorNote. The rm.colorNote function will be used to create it, and there's multiple ways we can use it.

Option #1

First we pass the difficulty, and then we pass an object {} with all of the fields we want on the note.

rm.colorNote(map, {
    beat: 3,
    cutDirection: rm.NoteCut.DOWN
})
  • TIP: Press Ctrl + Space to show all of the fields available in the object:

image

  • TIP: Hover over a written property to get a description of what it does:

image

Option #2

We pass the difficulty, and then we provide individual properties that are organized in order of relevance (e.g. beat, color, cut direction...).

rm.colorNote(map, 3, rm.NoteType.BLUE, rm.NoteCut.DOWN)
  • TIP: Press Ctrl + Space while inside the parenthesis of a function (where the parameters are being written) to display all of the parameters you can write. You can use the arrow keys to switch between the 2 options.

image

Duplicating

Let's say you have some note on the beatmap you'd like to duplicate. To do this, you can use the copy function on it. This will create a copy of the note and push it to the same difficulty automatically.

const object2 = object1.copy()

Removing

If you want some object to no longer be on the difficulty anymore, you can call the remove function on it.

object.remove()

This will mutate (change) the difficulty's arrays to no longer contain the object anymore.

Unsafe Custom Data

You might have noticed properties that are usually in customData are directly on the class instead.

For example, customData.localRotation becomes just localRotation.

// RAW
object.customData.localRotation

// REMAPPER
object.localRotation

You should always prefer properties that are directly on the class.


On load, all the properties that will be directly on the class are taken off of the customData object. The remaining customData object is given to the class as unsafeCustomData.

// This is a simplified example of what happens on load

const inputJson = {
    customData: {
        localRotation: [0, 0, 0]
    }
}

object.localRotation = inputJson.customData.localRotation
delete inputJson.customData.localRotation

object.unsafeCustomData = inputJson.customData

On save, all the customData related properties (such as localRotation) are recombined with unsafeCustomData.

// This is a simplified example of what happens on save

const outputJson = {
    customData: {
        localRotation: object.localRotation,
        ...object.unsafeCustomData
    }
}

Clone this wiki locally