Slay the Spire

Slay the Spire

ModTheSpire
shadopariah Aug 24, 2024 @ 4:22pm
Modded Game Crashes on Launch [FIXED]
FIX:
Open file explorer, navigate to "%LOCALAPPDATA%", this should open a directory path ending in "...\AppData\Local"
Create the folder "ModTheSpire" in the "Local" folder
Right click the new "ModTheSpire" folder -> properties -> Security tab -> (make sure "Everyone" is selected) Edit... -> give them full control (read/write/execute/modify/etc)
Run the modded game from steam, everything should work



When I try to play the modded game (mods and Mod The Spire downloaded from workshop) it launches, says it is running for a few seconds, then stops. I am able to play the base game without issue but modded crashes using just the ModTheSpire mod - I have also tried running the modded version with my friend's working mod list and got the same crashing behavior

Full contents of "...\SlayTheSpire\sendToDevs\mts_launcher.log":
Aug 23, 2024 10:33:03 PM com.megacrit.mtslauncher.MtsFinder writeSteamAppIDFile
FINE: The file 'steam_appid.txt' exists. Not creating it...
Aug 23, 2024 10:33:03 PM com.megacrit.mtslauncher.MtsFinder findModLauncher
INFO: ModTheSpire appears to be installed.
Aug 23, 2024 10:33:03 PM com.megacrit.mtslauncher.Main main
INFO: Executing jar from: E:\SteamLibrary\steamapps\workshop\content\646570\1605060445\ModTheSpire.jar
Aug 23, 2024 10:33:03 PM com.megacrit.mtslauncher.Main main
INFO: Successfully launched Mod the Spire! Exiting cleanly.


Full contents of "...\SlayTheSpire\sendToDevs\mts_process_launch.log":
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at com.evacipated.cardcrawl.modthespire.lib.SpireConfig.<init>(SpireConfig.java:46)
at com.evacipated.cardcrawl.modthespire.Loader.main(Loader.java:152)
Exception in thread "main" java.lang.NullPointerException
at com.evacipated.cardcrawl.modthespire.Loader.main(Loader.java:156)



-- Personal Investigation


Checking the Git repo at Git link [github.com] to investigate the second error about a null pointer that causes the crash it looks like "MTS_CONFIG" fails to be created from "MTS_CONFIG = new SpireConfig(null, "ModTheSpire", defaults);"



I think I found the root cause in "ConfigUtils.java".



I am using Windows 11 and have my steam library on my D: and E: drives (I installed and re-installed on each drive getting crashes on both). This causes the jar file to be in the respective drive's steam workshop (ex. "E:\SteamLibrary\...\ModTheSpire.jar") which also successfully creates the "E:\SteamLibrary\steamapps\common\SlayTheSpire\steam_appid.txt" file also in its respective drive.


However in "ConfigUtils.java" it determines the Drive from my window variables %LOCALAPPDATA% and %APPDATA% - both of which use the drive C:


This causes "SpireConfig.java" line 46 to then try and create your spire config in my C: drive - it does not have the needed permissions to make the directory, fails, catches and prints the error, then tries to continue on and use MTS_CONFIG which is NULL from the new SpireConfig(...) call failing.


To test this theory I created the folder "ModTheSpire" in my windows directory at "%LOCALAPPDATA%" and the contents of "...\mts_process_launch.log": became:
java.io.IOException: Access is denied
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at com.evacipated.cardcrawl.modthespire.lib.SpireConfig.<init>(SpireConfig.java:46)
at com.evacipated.cardcrawl.modthespire.Loader.main(Loader.java:152)
Exception in thread "main" java.lang.NullPointerException
at com.evacipated.cardcrawl.modthespire.Loader.main(Loader.java:156)


Which seems to show it is an access/permissions problem. However, my friend has the base game and mod installed on their non-OS drive and their modded game runs so i'm not sure what is different on my end.

RESOLVED by giving full control of the manually created "ModTheSpire" folder in "%LOCALAPPDATA%" to everyone - there can't be permission issues if everyone has permission (:
< >
Showing 1-1 of 1 comments
buzzered5 Nov 21, 2024 @ 12:37am 
Thank you so much, you fixed this exact issue I was having on Windows lol
< >
Showing 1-1 of 1 comments
Per page: 1530 50