lorddusk / HQM

Hardcore Questing Mode
GNU Lesser General Public License v3.0
77 stars 61 forks source link

[Request] NBT sensitive as quest item type #157

Closed CourtBard closed 5 years ago

CourtBard commented 8 years ago

Although there are several ways to determine a match for a quest (Precise, NBT Independent, Fuzzy, Ore Dict), none of those work for items with lots of NBT data, but you only want to match on one or a few of the NBT tags. Could you add a "NBT Tag dependent" match criteria? You could either make it so that it would allow you to pick the item from your inventory and then show a list of all of the NBT tags and allow the quest creator to choose which of those NBT tags they want to match on. Or simply have an editable text field where the quest creator could type in the NBT Tag and Value (possibly colon seperated). That way, any item that matched those specific NBT tags would be considered a match, even if all of the other NBT tags were different.

airbreather commented 8 years ago

Can you be more specific about what match you're looking for? I totally understand what you're getting at, but it's honestly a fairly hard problem to solve in the general case (at least right now), and much easier to solve on a case-by-case basis.

For example, one use case is matching saplings / bees / butterflies from Forestry. Perhaps you want to match "any Common Drone", or even just "any Meadows bee (queen / drone / princess, doesn't matter)". https://github.com/Vexatos/BeeSpecific adds support for exactly that via a plugin, and our modpack uses it to great effect.

CourtBard commented 8 years ago

Bees were one example of specific NBT data, but there are numerous others as well. Most machines in tech mods like Thermal expansion have NBT data relating to sides, energy, etc. Enchanted weapons and armor is another one. Say you want a quest item to be a diamond helmet with aqua affinity, but they have one that got aqua affinity and protection. It would be nice to be able to specify the NBT tag relating to the aqua affinity, but not matter that there are other enchantments as well.

It actually would not be that difficult to accomplish. HQM already reads item data and NBT data. It also has a way to list things like when you select the type of monster for a kill quest. All you would need to do would be to read in the NBT Compound and list out the various tags. Then allow the quest maker to select one or more that they want to use as the match. Then in the quest detection, check the NBT Compound for each of the specified tags and if they exist, then it is a match.

I did not know that there was a plugin for bees. I appreciate the heads up on that. I will definitely have to check that out. It would still be great to have the ability to specify specific NBT Tags to match built into HQM. I think it would allow quest makers a lot more freedom in designing their quests/progression.

noobanidus commented 5 years ago

This may be an option especially with Anvil-based "crafting" doing subsets of enchantments. Darkhax has some LGPL-licensed code for checking for subsets of NBT, so we should be able to uses that.