Slay the Spire

Slay the Spire

The Beaked
Aphid 13 Jul, 2019 @ 5:50am
Sacred deck crash experimentation and observations.
Now that I have some time to have investigated this...
Sacred deck will cause a crash with certain other mods.

First, I assumed it might have to do with 'too many cards'. I.e. if you have too many mods. However, I also found a way it could possibly be just a specific mod.

I used the ingame console to do 'add relic beaked:SacredDeck' with various combinations of other mods.

One way is to use just "The Beaked" and "The Animator".

I do not really know how you're going to fix this; but plain disabling another mod with it isn't really a solution; we want to find the root cause, right? Looking at the stack trace again (see comments on main page),

11:41:59.298 ERROR core.CardCrawlGame> Exception caught
java.lang.NullPointerException: null
at basemod.patches.com.megacrit.cardcrawl.cards.AbstractCard.CreateCardImageSwitch$CreateCardImage.Prefix(CreateCardImageSwitch.java:26) ~[BaseMod.jar:?]
at com.megacrit.cardcrawl.cards.AbstractCard.createCardImage(AbstractCard.java) ~[?:?]
at com.megacrit.cardcrawl.cards.AbstractCard.<init>(AbstractCard.java:363) ~[?:?]
at com.megacrit.cardcrawl.cards.AbstractCard.<init>(AbstractCard.java:298) ~[?:?]
at basemod.abstracts.CustomCard.<init>(CustomCard.java:74) ~[?:?]
at beaked.cards.fakeCards.CharacterSelectCard.<init>(CharacterSelectCard.java:21) ~[BeakedTheCultist.jar:?]
at beaked.relics.SacredDeck.openCharSelectMenu(SacredDeck.java:48) ~[BeakedTheCultist.jar:?]
at beaked.relics.SacredDeck.onEquip(SacredDeck.java:40) ~[BeakedTheCultist.jar:?]
at com.megacrit.cardcrawl.relics.AbstractRelic.update(AbstractRelic.java:385) ~[?:?]
at beaked.relics.SacredDeck.update(SacredDeck.java:76) ~[BeakedTheCultist.jar:?]
at com.megacrit.cardcrawl.rooms.AbstractRoom.updateObjects(AbstractRoom.java:239) ~[?:?]
at com.megacrit.cardcrawl.dungeons.AbstractDungeon.update(AbstractDungeon.java:2480) ~[?:?]
at com.megacrit.cardcrawl.core.CardCrawlGame.update(CardCrawlGame.java:871) ~[?:?]
at com.megacrit.cardcrawl.core.CardCrawlGame.render(CardCrawlGame.java:422) [?:?]
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225) [?:?]
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126) [desktop-1.0.jar:?]

I see here that the crash happens in BaseMod.jar. The specific line of code is:

ReflectionHacks.setPrivate(__instance, AbstractCard.class, "bgColor", BaseMod.getBgColor(__instance.color).cpy());

That means one of the parameters to this function is NULL, or getBgColor returns NULL. Now here the interesting part is that it's not a specific card that's really the problem, the crash happens immediately, even before getting to the sub-menu of that character.

Considering that this menu is created by iterating over all card colours, I surmise that indeed, the colour does exist, but has no proper bg colour.

Looking through the animator code, there's some code about an 'UNNAMED' character that it adds to the character pool, in addition to the animator character itself. That has its own card colour and card pool and starting cards, but it's not immediately available.

I have a suspicion that this is where the problem lies.

Edit: Note: I don't think you're supposed to be able to play this character yet, it has very few cards. Possibly that character colour should not be selectable in the sacred deck menu.



Last edited by Aphid; 13 Jul, 2019 @ 5:56am
< >
Showing 1-1 of 1 comments
Moocowsgomoo  [developer] 24 Jul, 2019 @ 11:55am 
You were 100% correct, the animator's unnamed character was missing a BG color and that was causing the issue. Thanks for the detailed report, much appreciated!
< >
Showing 1-1 of 1 comments
Per page: 1530 50