diff --git a/docs/01 - scripting.md b/docs/01 - scripting.md index d4a9c54..398c8fe 100644 --- a/docs/01 - scripting.md +++ b/docs/01 - scripting.md @@ -4,12 +4,19 @@ This will teach you how to use Rhythmo's special scripting system. Basically, yo Your script should either be located in `assets/scripts/[name].hxs`, or in `assets/songs/[song-name]/[name].hxs`.
However, if your script is a scripted state or substate, it should be located in `assets/classes/[name].hxs`. -**NOTE: These Haxe syntaxes are not supported**: -* `package` -* `import` (there's another function that emulates the purpose of this function) -* `class` -* `typedef` -* `metadata` +## Limitations +The following are not supported: +* Keywords: + * `package` + * `import` (there's another function that emulates the purpose of this function) + * `class` + * `typedef` + * `metadata` + * `final` +* Wildcard imports +* Access modifiers (e.g., `private`, `public`) +* Multi-line comments (`/* ... */`) + ## Default Variables * `Function_Stop` - Cancels functions (e.g., `startCountdown`, `endSong`). diff --git a/docs/02 - adding-a-custom-song.md b/docs/02 - adding-a-custom-song.md index 769becf..69c4433 100644 --- a/docs/02 - adding-a-custom-song.md +++ b/docs/02 - adding-a-custom-song.md @@ -1,26 +1,13 @@ # How to Add a Custom Song -This will teach you how to add your own song to the game. Really, it's pretty simple. +This will teach you how to add your own song to the game. -## Adding your Song -First of all, you need to add your song to the Song Selection Menu.
-To do that, go to `assets/songs.json`. Then, to add your song, use this template: -```json -{ - "name": "Song Name", - "diff": 1 -} -``` - -Now, to add your song's cover, it should be in `assets/images/covers/[song-name].png`.
-Keep in mind, your song name should be lowercase and any spaces should be replaced with a dash.
-Also, the size of your cover should be a square, preferably `720 by 720`. +## Song Audio +First of all, you need your song's audio. You only need an audio file with your music called `music.ogg`.
+It should be located in `assets/songs/[song-name]/music.ogg`. -## Adding Song Data -For song data, you need the following: -* `assets/songs/[song-name]/chart.json` -* `assets/songs/[song-name]/music.ogg` - -For your chart, use this empty template: +## Song Data +Now, you need your chart.
+For your chart, copy this empty template: ```json { "song": "Song Name", @@ -29,10 +16,29 @@ For your chart, use this empty template: "timeSignature": [4, 4] } ``` +It should be called `chart.json` and should be located in `assets/songs/[song-name]/chart.json`. -## Charting +### Charting To chart your song, go to `PlayState.hx` and then press "7" to go to ChartingState.
Or you can go to your song in `SongSelectState.hx`, and use `SHIFT + ENTER`. When you're done, simply save the chart by using `Save Chart` or `Save Chart As`.
-Denpending on what you choose, it should save in `assets/songs/[song-name]/chart.json` or `./[song-name].json`. \ No newline at end of file +Denpending on what you choose, it should save in `assets/songs/[song-name]/chart.json` or `./[song-name].json`. + +## Adding your Song to the Song Selection Menu +To add your song to the Song Selection Menu, go to `assets/songs.json`.
+Then, to add your song, use this template: +```json +{ + "name": "Song Name", + "diff": 1 +} +``` + +Now, for your song's cover, it should be in `assets/images/covers/[song-name].png`.
+Keep in mind, your song's name should be lowercase and any spaces should be replaced with a dash.
+Also, the size of your cover should be a square, preferably `720 by 720`. + +## Adding a Script (Optional) +Additionally, you also add in a script that will only run on a specific song.
+See [Scripting](https://github.com/Joalor64GH/Rhythmo-SC/blob/main/docs/01%20-%20scripting.md) for more. \ No newline at end of file diff --git a/docs/03 - adding-a-custom-language.md b/docs/03 - adding-a-custom-language.md index b036174..9805e4c 100644 --- a/docs/03 - adding-a-custom-language.md +++ b/docs/03 - adding-a-custom-language.md @@ -3,7 +3,7 @@ This is another simple tutorial on how to add a custom language. ## Adding your Language Firstly, you need to edit these two main text files: -* `assets/languages/languagesList.txt` - Your list of languages. (de, en, es, fr, and so on...) +* `assets/languages/languagesList.txt` - Your list of languages. (e.g., `de`, `en`, `es`, `fr`) * `assets/languages/languagesData.txt` - This is so that your language can be pushed into `LanguagesState.hx`. To add your language into `languagesData.txt`, use this format: @@ -16,6 +16,6 @@ So, for example, if you wanted to add German, it would look like: Deutsch (Deutschland):de ``` -Now, you need your `.json` file, which should be located in `assets/languages/[language-code].json`. +Now, you need your `.json` file, which should be located in `assets/languages/[language-code].json`.
Of course, this contains the data for your language.
To add your data, just copy [this](/assets/languages/en.json), and edit it with your translations. \ No newline at end of file diff --git a/docs/04 - adding-a-mod.md b/docs/04 - adding-a-mod.md index 0b6ab83..26f1e7b 100644 --- a/docs/04 - adding-a-mod.md +++ b/docs/04 - adding-a-mod.md @@ -1,19 +1,17 @@ # How to Add a Mod This tutorial simply shows you how you can add your own mod. -## Creating the Folder -Create a folder in the `mods` folder and rename it to whatever you want. - +## Creating a Folder +Create a folder in the `mods` folder and rename it to whatever you want.
Doing this manually isn't a problem, but it would be better and faster if you copy-and-pasted the Template. ![](https://github.com/user-attachments/assets/85d6cc54-72e0-406f-b5a0-131b65e32b62?raw=true) ![](https://github.com/user-attachments/assets/add932d1-8a09-40c8-ae2a-89d57ca1c9cf?raw=true) -## In-Game Mod Info - -The info for a mod is stored in two files. Those two files are `_polymod_meta.json` and `_polymod_icon.png`. +## Mod Metadata +The mod metadata comes in two files. Those two files are `_polymod_meta.json` and `_polymod_icon.png`. -### `_polymod_meta.json` +### `_polymod_meta.json` (Required) In `_polymod_meta.json`, you can define the mod name, the name of the author, etc. Example: @@ -28,14 +26,34 @@ Example: } ``` -### `_polymod_icon.png` -As for `_polymod_icon.png`, it's just a simple `.png` icon for the mod. Any square image is recommended. Just keep in mind that **whatever image it is, it will always be squished into a `75 x 75` resolution**. +### `_polymod_icon.png` (Optional) +As for `_polymod_icon.png`, it's just a simple `.png` icon for the mod. Any square image is recommended, preferably `150 x 150`. Just keep in mind that **whatever image it is, it will always be squished into a `75 x 75` resolution**. If you've done everything correctly, your mod should appear in the Mods Menu.
Then, you're basically good to go! +## Mod Structure +Each folder in your mod should be used as follows: +* `_append` - Modify existing files without actually replacing them. +* `achievements` - For storing achievement data. Each achievement should be listed in `achList.txt`. +* `classes` - Scripted States and Substates. +* `fonts` - Font files. Pretty self-explanatory. +* `images` - All images in your mod. + * `images/achievements` - The icons for your achievemnts. + * `images/covers` - The covers for your songs. + * `images/credits` - Used for credit icons. + * `images/gameplay` - Used for gameplay UI. + * `images/menu` - Used for menu assets. +* `languages` - For storing language data. +* `music` - Non-gameplay related music. +* `scripts` - Scripts that run on every song. +* `songs` - Songs used for gameplay. + * `songs/[song-name]/chart.json` - Your song's chart. + * `songs/[song-name]/music.ogg` - Your song's music. Can also be a `.wav`. + * `songs/[song-name]/[script-name].hxs` - Song-specific script (optional). +* `sounds` - All sound effects. + For further documentation, check out [polymod.io](https://polymod.io/docs/). ## Quick Example - -Here's a quick example by [EliteMasterEric](https://twitter.com/EliteMasterEric) » [here](https://github.com/EnigmaEngine/ModCore-Tricky-Mod) « +Here's a quick example by [EliteMasterEric](https://twitter.com/EliteMasterEric) » [here](https://github.com/EnigmaEngine/ModCore-Tricky-Mod) « \ No newline at end of file diff --git a/docs/05 - adding-custom-credits.md b/docs/05 - adding-custom-credits.md index 6485a7e..6c04f6b 100644 --- a/docs/05 - adding-custom-credits.md +++ b/docs/05 - adding-custom-credits.md @@ -2,7 +2,7 @@ If you want to add your own credits to `CreditsState.hx`, this will show you how to. ## Adding Custom Credits -To add your custom credits, you first need to navigate to `assets/credits.json`.
+To add your custom credits, you first need to go to `assets/credits.json`.
Then you can edit the following: * `menuBG` - Your custom menu background. * `menuBGColor` - The color of your custom background (`[R, G, B]`). diff --git a/source/options/ControlsSubState.hx b/source/options/ControlsSubState.hx index fc70c03..d86d957 100644 --- a/source/options/ControlsSubState.hx +++ b/source/options/ControlsSubState.hx @@ -129,12 +129,11 @@ class ControlsSubState extends ExtendableSubState { if (Input.justPressed('any')) { if (gamepadMode) { var keyPressed:FlxGamepadInputID = gamepad.firstJustPressedID(); - if (gamepad != null && keyPressed.toString() != FlxGamepadInputID.NONE) { + if (gamepad != null && keyPressed.toString() != FlxGamepadInputID.NONE) SaveData.settings.gamepadBinds[curSelected] = keyPressed; - } - } else { + } else SaveData.settings.keyboardBinds[curSelected] = FlxG.keys.getIsDown()[0].ID.toString(); - } + SaveData.saveSettings(); Input.refreshControls(); FlxG.sound.play(Paths.sound('select')); diff --git a/source/states/ChartingState.hx b/source/states/ChartingState.hx index 1857dc7..fe74241 100644 --- a/source/states/ChartingState.hx +++ b/source/states/ChartingState.hx @@ -225,11 +225,7 @@ class ChartingState extends ExtendableState { var snappedGridSize = (gridSize / (beatSnap / Conductor.stepsPerSection)); dummyArrow.x = Math.floor(FlxG.mouse.x / gridSize) * gridSize; - - if (Input.pressed('shift')) - dummyArrow.y = FlxG.mouse.y; - else - dummyArrow.y = Math.floor(FlxG.mouse.y / snappedGridSize) * snappedGridSize; + dummyArrow.y = (Input.pressed('shift')) ? FlxG.mouse.y : Math.floor(FlxG.mouse.y / snappedGridSize) * snappedGridSize; } if (FlxG.mouse.justPressed) { diff --git a/source/states/EditorState.hx b/source/states/EditorState.hx index 085d2ef..cfb91c0 100644 --- a/source/states/EditorState.hx +++ b/source/states/EditorState.hx @@ -30,6 +30,8 @@ class EditorState extends ExtendableState { daText = new FlxText(5, FlxG.height - 24, 0, "", 12); daText.setFormat(Paths.font('vcr.ttf'), 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(daText); + + changeSelection(0, false); } override function update(elapsed:Float) { @@ -46,8 +48,9 @@ class EditorState extends ExtendableState { } } - private function changeSelection(change:Int = 0) { - FlxG.sound.play(Paths.sound('scroll')); + private function changeSelection(change:Int = 0, ?playSound:Bool = true) { + if (playSound) + FlxG.sound.play(Paths.sound('scroll')); curSelected = FlxMath.wrap(curSelected + change, 0, options.length - 1); grpOptions.forEach(function(txt:FlxText) { txt.alpha = (txt.ID == curSelected) ? 1 : 0.6; diff --git a/source/states/InitialState.hx b/source/states/InitialState.hx index eee03c4..f4f451f 100644 --- a/source/states/InitialState.hx +++ b/source/states/InitialState.hx @@ -19,7 +19,7 @@ class InitialState extends ExtendableState { trace('current platform: ${PlatformUtil.getPlatform()}'); - #if (desktop || UPDATE_CHECK) + #if (desktop && UPDATE_CHECK) UpdateState.updateCheck(); #else trace('Sorry! No update support on: ${PlatformUtil.getPlatform()}!'); diff --git a/source/states/ModsState.hx b/source/states/ModsState.hx index e14ee88..53aa15d 100644 --- a/source/states/ModsState.hx +++ b/source/states/ModsState.hx @@ -67,15 +67,12 @@ class ModsState extends ExtendableState { mustResetMusic = true; ExtendableState.switchState(new MenuState()); } else if (Input.justPressed('accept')) { - if (!FlxG.save.data.disabledMods.contains(ModHandler.trackedMods[curSelected].id)) { + if (!FlxG.save.data.disabledMods.contains(ModHandler.trackedMods[curSelected].id)) FlxG.save.data.disabledMods.push(ModHandler.trackedMods[curSelected].id); - FlxG.save.flush(); - changeSelection(); - } else { + else FlxG.save.data.disabledMods.remove(ModHandler.trackedMods[curSelected].id); - FlxG.save.flush(); - changeSelection(); - } + FlxG.save.flush(); + changeSelection(); } } diff --git a/source/substates/PauseSubState.hx b/source/substates/PauseSubState.hx index ce9159f..2318fa5 100644 --- a/source/substates/PauseSubState.hx +++ b/source/substates/PauseSubState.hx @@ -50,11 +50,11 @@ class PauseSubState extends ExtendableSubState { override function update(elapsed:Float) { super.update(elapsed); - if (isTweening) { - tipTxt.screenCenter(X); + tipTxt.screenCenter(X); + + if (isTweening) timer = 0; - } else { - tipTxt.screenCenter(X); + else { timer += elapsed; if (timer >= 3) changeText();