Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mods #11

Closed
SimpleDioney opened this issue Apr 10, 2024 · 13 comments
Closed

Mods #11

SimpleDioney opened this issue Apr 10, 2024 · 13 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@SimpleDioney
Copy link

Would there be any options to add mods to the game? I tried installing steamodded, however, the apk does not recognize the modifications, only the button appears.

@blake502
Copy link
Owner

It's theoretically possible, but quite tricky. The issues is that Steamodded expects mods at %appdata%\Balatro\Mods, which would translate to /sdcard/Android/data/com.unofficial.balatro/files/save/game/Mods or /data/data/com.unofficial.balatro/files/save/Mods on Android.
If you can find a way to reliably modify those directories, I'm open to hearing about it. My tests with ADB have been mostly unsuccessful.

@blake502 blake502 added documentation Improvements or additions to documentation help wanted Extra attention is needed enhancement New feature or request labels Apr 10, 2024
@PGgamer2
Copy link
Contributor

PGgamer2 commented Apr 11, 2024

It seems Steamodded uses a library called nativefs which allows Löve2d to access files and folders outside the save directory. A simple solution would be to modify the SMODS.MODS_DIR field after the mod loader installer injects its code and set it to a more accessible folder (for example, something like /storage/emulated/0/Steamodded/)

To make such a change the AndroidManifest also probably needs the READ_EXTERNAL_STORAGE and MANAGE_EXTERNAL_STORAGE flags.

@blake502 blake502 removed the documentation Improvements or additions to documentation label Apr 12, 2024
@blake502
Copy link
Owner

Now that I can reliably modify the save directory (thanks again TheCatRiX), I'm open to looking into this-- but it's low priority for me at the moment. Given the info from @PGgamer2's comment though, it may be trickier than I initially expected. I'm not even sure whether nativefs support Android-- there doesn't seem to be any mention of platform on the readme.

@surskitt
Copy link

surskitt commented Apr 13, 2024

I was able to get mods working by just copying them to the Mods directory under the com.unofficial.balatro data directory:

$ adb shell mkdir -p /data/local/tmp/balatro/files/save/game/Mods
$ adb push Mods/. /data/local/tmp/balatro/files/save/game/Mods/
$ adb shell run-as com.unofficial.balatro find
.
./cache
./cache/game.love
./cache/oat_primary
./cache/oat_primary/arm64
./cache/oat_primary/arm64/base.art
./code_cache
./shared_prefs
./files
./files/save
./files/save/game
./files/save/game/settings.jkr
./files/save/game/1
./files/save/game/1/meta.jkr
./files/save/game/1/save.jkr
./files/save/game/1/profile.jkr
./files/save/game/Mods
./files/save/game/Mods/FoldButton.lua
./files/save/game/Mods/milckqol.lua
./files/save/game/Mods/quickrestart_steamodded.lua
./files/save/game/Mods/EscapeExitButton.lua
./files/save/game/Mods/FlushHotkeys-scrollwheel.lua
./files/save/game/Mods/Rumble.lua
./files/save/game/Mods/AchievementsEnabler.lua
./files/save/game/Mods/DVPreview.lua
./files/save/game/Mods/DVSimulate.lua
./files/save/game/Mods/FasterStakesUnlock.lua
./files/save/game/Mods/FlushHotkeys.lua
./files/save/game/Mods/BetterMouseAndGamepad.lua
./files/save/game/Mods/MoreSpeeds.lua
./files/game
./databases
./no_backup

I've not tested it extensively, but Divvy's preview and MoreSpeeds are working completely fine.

This was made a lot easier by the recent update that also let me push my saves, thanks to the two of you for figuring that out.

@blake502
Copy link
Owner

In that case, it sounds like beta-0.5.3 and up should automatically support mods without any additional changes?

@surskitt
Copy link

surskitt commented Apr 13, 2024

Yeah it should already work. I can't confirm, I'm not actually running your program directly since I'm on linux, but the mods should get copied alongside the saves in that step.

@blake502
Copy link
Owner

In that case, I'm willing to say "Mods are not officially supported, but will probably work" haha.

@CUexter
Copy link

CUexter commented Apr 14, 2024

i dont know why but if i have some texture pack it doesnt seems to able to read the file, it simply say it does not exist.

@CUexter
Copy link

CUexter commented Apr 14, 2024

@JonJaded
Copy link

JonJaded commented May 4, 2024

Before anyone wastes 10 minutes of time like me, the Mods folder NEEDS to be a capital M, atleast on iOS. Kinda just hit me a little late that its super specific.

@Azyzraissi
Copy link

Before anyone wastes 10 minutes of time like me, the Mods folder NEEDS to be a capital M, atleast on iOS. Kinda just hit me a little late that its super specific.

So it does work outside of the box or something needs to be done? Should I inject steammoded or just go with the the normal setup?

@CUexter
Copy link

CUexter commented Jun 5, 2024 via email

@Azyzraissi
Copy link

A bit tricky to setup but works fine now ! Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants