zuelong / save-the-spire

A save editor for the game Slay the Spire
16 stars 13 forks source link

"Bottled" Cards causing game to crash #17

Closed zuelong closed 6 years ago

zuelong commented 6 years ago

Bottled Flame, Lightning, and Tornado all cause the game to crash.

This probably has something to do with not adding the card to the JSON correctly.

Needs more research

ntower commented 6 years ago

Looks like when there's a bottled card there needs to not only be an entry in the relics section of the json, but also one at the top level listing the name of the bottled card. Here's a json from a save file with a bottled tornado (note the part saying "bottled_tornado": "Corruption",)

bottledTornado.txt

Any thoughts on what sort of ui you'd like for this?

My first thought was when they add a bottled relic to the deck, a prompt comes up for them to select a card (listing just the cards currently in the deck). That handles one case, but it's also possible they already have the relic in the deck, and then they delete the card that corresponds to. I'd guess that a relic that refers to a nonexistent card might cause a crash as well.

Another possibility would be to let them add the relic without the prompt, but then enhance the Item component to have a button they can click to select what card to pair it with. This same button can be used in the case where they delete the corresponding card and need to change the relic. Also would want a way to notify them that then need to deal with the relic before they can export.

ntower commented 6 years ago

Tested what happens if the bottled relic refers to a nonexistent card: no crash, it simply doesn't put anything into the opening hand, drawing a random hand as normal.

Also tested what happens if it refers to a card of the wrong type (eg, bottled tornado referring to a non-power). The card starts the game in the hand, so it appears the type is only checked when they acquire the relic.

zuelong commented 6 years ago

My initial thought was to add a pop-up when the relic is added. If we add anything to the item component, I'm afraid it will look too cluttered.

Maybe we add a button to the UI and make the next card clicked the bottled card?

We can also maybe make the "bottled" cards a different color and display a warning upon deletion.

I'm really up for any solution that will fix the issue. If you have a particular avenue you wish to pursue, i say go for it.

zuelong commented 6 years ago

Closing this since the issue is solved, opening a new issue with "enhancements" tag for figuring out how to filter cards by type