MaybeMaru / moonchart

An easy way to manage rhythm game chart formats
MIT License
21 stars 4 forks source link

more examples of how to use it #1

Closed Slushi-Github closed 2 weeks ago

Slushi-Github commented 2 months ago

I've been trying to figure out how to use the library for a while now, but I don't understand how to use it. How can I convert a chart from StepMania, Osu!Mania, Quaver, to Psych? is it possible?

MaybeMaru commented 2 months ago

All formats supported by the library can be imported, converted and exported between Here's an example of converting a Quaver chart to Psych, it would work the same with Osu!Mania or StepMania formats

var quaver= new Quaver().fromFile("test/quaver.qua");
var psych = new FNFPsych().fromFormat(quaver);

// Here's the psych chart as a string that you can save as a json file
var psychChart = psych.stringify().data;
MaybeMaru commented 2 months ago

Let me know if you run into any problems

Slushi-Github commented 2 months ago

Let me know if you run into any problems

I get this error when I want to read a file from StepMania:

Call Stack:
moonchart/formats/StepMania.hx (line 166)
moonchart/formats/BasicFormat.hx (line 214)
moonchart/formats/BasicFormat.hx (line 173)
moonchart/formats/BasicFormat.hx (line 137)
slushi/states/MoonChartState.hx (line 111)
flixel/addons/ui/FlxButtonPlus.hx (line 292)
openfl/events/EventDispatcher.hx (line 426)
openfl/display/DisplayObject.hx (line 1398)

Uncaught Error:
[UncaughtErrorEvent type="uncaughtError" bubbles=true cancelable=true error="Null Object Reference"]

I followed the way to use it as you explained in the examples:


    // filePathInEngine + filePath == ".engineUtils/MoonChartConverter/Song.sm", diffculty is ""
    else if (format == "STEPMANIA") {
        stepmaniaFormat = new StepMania().fromFile(filePathInEngine + filePath, null, diffculty); // Crash here
    }

    var newChartFormat = new FNFPsych();

    else if (format == "STEPMANIA" && stepmaniaFormat != null) {
                  newChartFormat.fromFormat(stepmaniaFormat);
    }
MaybeMaru commented 2 months ago

From what im seeing the error is due to the StepMania format not finding the difficulty youre trying to input Loading stepmania charts stuff is typesafe (maybe i should prevent the crash by warning and loading any other diff it can find lol) Double check if its related to that, if not pls send the chart so i can figure out the error

MaybeMaru commented 2 weeks ago

Closed due to inactivity