FTBTeam / FTB-Mods-Issues

Any mod issues, be it FTB Teams, Quests or any other of our mods can be reported here!
22 stars 1 forks source link

[Bug]: Complicated Quest Chapter File Rename Issue #796

Open alfredggttv opened 1 year ago

alfredggttv commented 1 year ago

Mod

FTB Quests

Mod version

ftb-quests-forge-1902.4.11-build.207

Forge / Fabric version

43.2.11

Modpack & version

ATM8 1.0.17/1.0.18

What issue are you having?

Recently renamed a few of the questline files to better match what they cover (i.e. resourceful_ways -> mystical_ag).

When players updated to the newest version, the old files still remain for the quest. In this case, ATM8v 1.0.17 had getting_started as a questline, which got renamed to main_chapter1 in v. 1.0.18. While this isn't an issue for those with a fresh install, a unique bug/problem shows up.

The duplicate (in this case main_chapter1) loses all dependencies. When you delete the original file (in this case getting_started) from the folder, the quest shows up without any connections. I believe this has something to do with the second file needing the same dependencies from the original quest chapter.

Summary of the actual bug: Having 2 quest chapter files (separately named) with the same quests and IDs causes the second file to lose all dependencies.

Crashlogs

No response

Steps to reproduce

  1. Duplicate a quest chapter
  2. Rename the new duplicate file something different. Maintain the same quests and IDs, but refer to the new file name instead of the old one.
  3. Load into the world.
  4. Duplicate quest chapter will lose all dependencies.

Anything else to note?

As this is a specifically unique bug/problem, I'm always down for a Discord chat.

alfredggttv commented 1 year ago

To make it even more weird, when server owners update from a previous version, completing any of the quests in the renamed chapters re-triggers the toasts for every quest they have already completed, causing either a crash or massive lag.

desht commented 1 year ago

but refer to the new file name instead of the old one.

What does this mean? Refer to the new file name where?

alfredggttv commented 1 year ago

In the file, it has "Filename" and I changed it to reflect the new file name.

desht commented 1 year ago

OK. If I understand right, you loaded up a quest book with 2 duplicate chapters, i.e. containing quests with duplicate ID's. That's basically a corrupted quest book, so I'm not surprised weird stuff happens. If you're going to rename a chapter in your pack (which is not necessary; players don't see the internal filename, only the chapter title), you really really need to be sure the old one isn't still distributed with the pack. So the upgrade process must delete the old file somehow.

About the only thing I would be prepared to do here is more input validation while loading the quest book; as I said, this is basically corrupted data, and the best thing to do would be to error out and refuse to load the book in this case.

alfredggttv commented 1 year ago

What's weird is that while it may be a corrupted quest book, it recognizes that they share the same ID's and converts the second one to one without any dependencies at all. The crashes come from the quests being spammed that they are done because the old file (from previous versions) gets auto-converted to have 0 dependencies, which means having any of those quest requirements completed will auto-complete them.

I've also noticed something similar happening with random reward files. For me, I shove all of the rewards I want for the reward into a chest and then import it into FTBquests via the command. When I do this, the filename doesn't match the name of the Random Reward. Instead, it is just a bunch of numbers (which I'm guessing is the ID). When I change the name of the reward file to match the name of the Random Rewards, it completely removes any weight I've added onto the rewards. It also removes any "extra" rewards, like if I were to give it a random chance to give 1-3.

Is this just a fallback to not crash/corrupt the files whenever you rename the files? Also, renaming the files happened because of needing to be organized, but won't be done again mid-pack.

alfredggttv commented 1 year ago

For my last example, when the file gets renamed, it goes from this:

{ item: "botania:elementium_ingot", random_bonus: 2 }

To this:

{ item: "botania:elementium_ingot" }

This happens even if there isn't a duplicate. I think it has something to do with the name being changed, then.

desht commented 1 year ago

Maybe I wasn't very clear: renaming your quest files like this is not supported.