Severed-Chains icon indicating copy to clipboard operation
Severed-Chains copied to clipboard

RB3 Modding Changes

Open Zychronix opened this issue 1 year ago • 2 comments

Zychronix avatar Dec 09 '24 16:12 Zychronix

ShopTypeEvent seems slippery to use where its used in ShopScreen, line 143.

Do we handle the scenario where a mod that changes an equipment shop to an item shop but the inventory remains untouched and continues to contain equipment? Everything from here is strongly typed and an eq shop vs item shop has implicit and explicit expectations.

If we don't care and don't want to hand hold, thats fine.

example

04:12:43.770 [Hardware legend.game.Main:64] ERROR: ----------------------------------------------------------------------------
04:12:43.770 [Hardware legend.game.Main:65] ERROR: Crash detected
04:12:43.770 [Hardware legend.game.Main:66] ERROR: Severed Chains 3.0.0-SNAPSHOT-beta commit COMMIT built null
04:12:43.770 [Hardware legend.game.Main:69] ERROR: We have attempted to generate a recovery save. You can load it next time you run Severed Chains.
04:12:43.770 [Hardware legend.game.Main:72] ERROR: Please copy this crash log and send it to us in the Player Help channel in the Legend of Dragoon Discord server.
04:12:43.770 [Hardware legend.game.Main:73] ERROR: https://discord.gg/legendofdragoon
04:12:43.770 [Hardware legend.game.Main:76] ERROR: Message: class legend.lodmod.items.HealingPotionItem cannot be cast to class legend.game.inventory.Equipment (legend.lodmod.items.HealingPotionItem and legend.game.inventory.Equipment are in unnamed module of loader 'app')
04:12:43.770 [Hardware legend.game.Main:79] ERROR: ----------------------------------------------------------------------------
04:12:43.770 [Hardware legend.game.Main:80] ERROR: Stack trace:
java.lang.ClassCastException: class legend.lodmod.items.HealingPotionItem cannot be cast to class legend.game.inventory.Equipment (legend.lodmod.items.HealingPotionItem and legend.game.inventory.Equipment are in unnamed module of loader 'app')
	at legend.game.inventory.screens.ShopScreen.render(ShopScreen.java:147)
	at legend.game.inventory.screens.MenuScreen.renderScreen(MenuScreen.java:72)
	at legend.game.inventory.screens.MenuStack.propagate(MenuStack.java:128)
	at legend.game.inventory.screens.MenuStack.render(MenuStack.java:100)
	at legend.game.Scus94491BpeSegment_8002.loadAndRenderMenus(Scus94491BpeSegment_8002.java:810)
	at legend.game.Scus94491BpeSegment.lambda$gameLoop$46(Scus94491BpeSegment.java:416)
	at legend.core.RenderEngine.lambda$init$18(RenderEngine.java:609)
	at legend.core.opengl.Window$Events.onDraw(Window.java:792)
	at legend.core.opengl.Window.tickFrame(Window.java:432)
	at legend.core.opengl.Action.run(Action.java:46)
	at legend.core.opengl.Action.tick(Action.java:32)
	at legend.core.opengl.Window.run(Window.java:408)
	at legend.core.RenderEngine.run(RenderEngine.java:1008)
	at legend.core.GameEngine.start(GameEngine.java:256)
	at legend.game.Main.main(Main.java:40)
04:12:43.770 [Hardware legend.game.Main:82] ERROR: Please copy this crash log and send it to us in the Player Help channel in the Legend of Dragoon Discord server.
04:12:43.770 [Hardware legend.game.Main:83] ERROR: https://discord.gg/legendofdragoon

Potentially the purpose of 'changing' a shop type should either have a) guard rails (that may be better suited in and done in ShopItemEvent and ShopEquipmentEvent) or b) done closer to the ShopRegistry stuff.

Ink230 avatar Feb 17 '25 09:02 Ink230

@Zychronix re @Ink230's comment shopType is no more, shops can contain both weapons and items simultaneously

LordMonoxide avatar Feb 18 '25 01:02 LordMonoxide