diff --git a/Artifact Tracker Patches_KID.ini b/Artifact Tracker Patches_KID.ini index 37ff59d..37b1633 100644 --- a/Artifact Tracker Patches_KID.ini +++ b/Artifact Tracker Patches_KID.ini @@ -1,3 +1,5 @@ +; Limiting by mod is a bit tricky at the time of writing. If a filter has only mod name, it will work as expected only when the mod is active. If the mod is not enabled, the keyword will be assigned to ALL items. To work around it, add at least one Editor ID, found in the mod, the rule will be skipped correctly. + Keyword = ETR_ExtraArtifact|Ingredient|ccBGSSSE037-Curios.esl,ccBGSSSE037_BunglersBane Keyword = ETR_ExtraArtifact|Book|TreasureHunter.esp,dunTreasMapWinterholdEast,-TreasHunterAgnarrNote,-treasHuntTharadsJournal,-treasHuntAdventurersJournal,-THDawnstarNote,-THDawnstarNote01,-ArxieTHMzuhlacJournal @@ -6,9 +8,9 @@ Keyword = ETR_ExtraArtifact|Book|treasure_hunt.esp,dunTreasMapPalePass,-dunTreas Keyword = ETR_ExtraArtifact|Potion|yumcheese.esp,snowcheesewedgeyum,-PROPERTYOFSHEOGORATHyum -; Seashells have VendorItemClutter, we need to include them explicitly +; Include seashells. They have VendorItemClutter, which is skipped via the ETR_ExcludeMiscKeywords formlist, we need to include them explicitly Keyword = ETR_ExtraArtifact|Misc Item|Seashells.esp,aaaSeaConchBlue -; Pouches with WACCF keywords +; Exclude pouches with WACCF keywords Keyword = ETR_NotArtifact|Armor|WAF_ClothingAccessories,-ClothingHead Keyword = ETR_NotArtifact|Armor|WAF_ClothingPouch diff --git a/Artifact Tracker Vanilla_KID.ini b/Artifact Tracker Vanilla_KID.ini index 10d5667..8abf29f 100644 --- a/Artifact Tracker Vanilla_KID.ini +++ b/Artifact Tracker Vanilla_KID.ini @@ -1,22 +1,53 @@ -; DB01Plate, NordWarHorn, ImperialWarHorn, DBTortureTools, DB06OlavaToken, dunUniqueBeeInJar, dunWaywardPassSkull01, dunUniqueFireflyInJar, dunUniqueDragonflyInJar, dunUniqueButterflyInJar, dunUniqueMothInJar, DancersFlute, BalbusForkNonEquip, MS11YsgramorsSoupSpoon +; Default inclusion list: +; - all playable weapons, +; - all playable apparel, +; - all books, excluding spell tomes, notes, and journals, +; - misc items without keywords, when KID is not loaded, +; - OR all misc items, when KID is loaded (excluding lockpicks and gold, exclude more items by keywords in the INI). + +; Ingredients, potions/food, and soul gems are excluded by default and can be included explicitly. + +; Filters below further customize the list of artifacts. Keyword Item Distributor is required for them to work. +; ETR_ExtraArtifact enables tracking of items, ETR_NotArtifact - disables. The order of evaluation vary from type to type, consult the source code. + + +; Include DB01Plate, NordWarHorn, ImperialWarHorn, DBTortureTools, DB06OlavaToken, dunUniqueBeeInJar, dunWaywardPassSkull01, dunUniqueFireflyInJar, dunUniqueDragonflyInJar, dunUniqueButterflyInJar, dunUniqueMothInJar, DancersFlute, BalbusForkNonEquip, MS11YsgramorsSoupSpoon Keyword = ETR_ExtraArtifact|Misc Item|0x1F6D4,0x200B6,0x200BA,0x20949,0x59654,0xB08C7,0xF6767,0xFBC3A,0xFBC3B,0xFBC3C,0xFBC3D,0x105109,0x1058AA,0x105A4E -; Treasure Maps +; Include treasure maps Keyword = ETR_ExtraArtifact|Book|0xEF07A,0xF33CD,0xF33CE,0xF33CF,0xF33D0,0xF33D1,0xF33D2,0xF33D3,0xF33D4,0xF33D5,0xF33E0 -; Soul Gem Fragments -Keyword = ETR_NotArtifact|Misc Item|0x67181,0x67182,0x67183,0x67184,0x67185 +; Include recipes +Keyword = ETR_ExtraArtifact|Book|VendorItemRecipe -; Dummy items +; Exclude dummy items. You never encounter vanilla dummy items, but who knows what modders do in their mods, right? Keyword = ETR_NotArtifact|Weapon|Dummy Keyword = ETR_NotArtifact|Armor|Dummy +Keyword = ETR_NotArtifact|Misc Item|Dummy + +; Exclude clutter +Keyword = ETR_NotArtifact|Misc Item|VendorItemClutter +Keyword = ETR_NotArtifact|Misc Item|VendorItemTool + +; Exclude crafting supplies +Keyword = ETR_NotArtifact|Misc Item|VendorItemOreIngot +Keyword = ETR_NotArtifact|Misc Item|VendorItemAnimalPart +Keyword = ETR_NotArtifact|Misc Item|VendorItemAnimalHide +Keyword = ETR_NotArtifact|Misc Item|VendorItemFireword +Keyword = ETR_NotArtifact|Misc Item|BYOHHouseCraftingCategorySmithing + +; Exclude soul gem fragments +Keyword = ETR_NotArtifact|Misc Item|0x67181,0x67182,0x67183,0x67184,0x67185 + +; Include gems +Keyword = ETR_ExtraArtifact|Misc Item|VendorItemGem,-0x67181,-0x67182,-0x67183,-0x67184,-0x67185 -; ClothingPoor +; Exclude ClothingPoor. Keep in mind, its coverage is far from ideal. WACCF slightly improves situation, but many items, perceived as clothing for the poor, will still lack this keyword. Keyword = ETR_NotArtifact|Armor|ClothingPoor -; Disenchantable items, minus daedric artifacts just in case +; Exclude disenchantable weapons and armor, minus daedric artifacts just in case Keyword = ETR_NotArtifact|Weapon|-MagicDisallowEnchanting,-DaedricArtifact,-WeapTypeStaff|E Keyword = ETR_NotArtifact|Armor|-MagicDisallowEnchanting,-DaedricArtifact|E -; Unenchanted staves +; Exclude unenchanted staves Keyword = ETR_NotArtifact|Weapon|WeapTypeStaff|-E diff --git a/Artifact Tracker.esp b/Artifact Tracker.esp index cbd186a..a63bae7 100644 Binary files a/Artifact Tracker.esp and b/Artifact Tracker.esp differ diff --git a/SKSE/Plugins/ArtifactTracker.dll b/SKSE/Plugins/ArtifactTracker.dll index 24f8be5..46779ab 100644 Binary files a/SKSE/Plugins/ArtifactTracker.dll and b/SKSE/Plugins/ArtifactTracker.dll differ diff --git a/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp b/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp index 1bfd74a..df645e1 100644 --- a/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp +++ b/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp @@ -18,7 +18,7 @@ namespace ArtifactTracker std::unordered_map g_persistentMap; RE::TESObjectREFR* g_cellStorage; - bool Init() + bool Init(bool bKID) { if (g_bLoaded) { return true; @@ -43,25 +43,23 @@ namespace ArtifactTracker g_homeKeyword = dataHandler->LookupForm(0xFC1A3, "Skyrim.esm"); // LocTypePlayerHouse - const auto recipeKeyword = dataHandler->LookupForm(0xF5CB0, "Skyrim.esm"); // VendorItemRecipe - const auto excludeKeywords = dataHandler->LookupForm(0x801, "Artifact Tracker.esp"); // ETR_ExcludeMiscKeywords const auto extraArtifactKeyword = dataHandler->LookupForm(0xAFC11A, "Update.esm"); // ETR_ExtraArtifact const auto notArtifactKeyword = dataHandler->LookupForm(0xAFC11C, "Update.esm"); // ETR_NotArtifact const auto npcRaceKeyword = dataHandler->LookupForm(0x13794, "Skyrim.esm"); // ActorTypeNPC - if (!g_cellContainer || !g_listNew || !g_listStored || !g_listFound || !g_persistentStorage || !g_homeKeyword || !recipeKeyword || !excludeKeywords || !extraArtifactKeyword || !notArtifactKeyword || !npcRaceKeyword) { + if (!g_cellContainer || !g_listNew || !g_listStored || !g_listFound || !g_persistentStorage || !g_homeKeyword || !extraArtifactKeyword || !notArtifactKeyword || !npcRaceKeyword) { SKSE::log::warn("Unable to load data from Artifact Tracker.esp"); RE::DebugMessageBox("Unable to load data from Artifact Tracker.esp, the mod is disabled."); return false; } - // Preloading item lists - std::map settings { { "DumpItemList", false }, }; LoadINI(&settings, "Data/SKSE/Plugins/ArtifactTracker.ini"); + // Preloading item lists + g_artifactFormTypes.insert(RE::FormType::Weapon); for (const auto& form : dataHandler->GetFormArray()) { if (form->GetPlayable() && !form->IsBound() && !form->weaponData.flags.all(RE::TESObjectWEAP::Data::Flag::kCantDrop) && !form->IsDeleted()) { @@ -86,14 +84,14 @@ namespace ArtifactTracker g_artifactFormTypes.insert(RE::FormType::Book); for (const auto& form : dataHandler->GetFormArray()) { - if (!form->TeachesSpell() && !form->IsDeleted() && (form->HasKeyword(recipeKeyword) || form->HasKeyword(extraArtifactKeyword) || BookCheck::IsBook(form)) && !form->HasKeyword(notArtifactKeyword)) { + if (!form->IsDeleted() && (form->HasKeyword(extraArtifactKeyword) || (!form->TeachesSpell() && BookCheck::IsBook(form))) && !form->HasKeyword(notArtifactKeyword)) { g_artifactMap[form->formID] = form; } } g_artifactFormTypes.insert(RE::FormType::Misc); for (const auto& form : dataHandler->GetFormArray()) { - if (form->GetPlayable() && !form->IsDeleted() && (form->HasKeyword(extraArtifactKeyword) || !form->HasKeywordInList(excludeKeywords, false)) && !form->HasKeyword(notArtifactKeyword) && strlen(form->GetName()) > 0) { + if (form->GetPlayable() && !form->IsDeleted() && (form->GetNumKeywords() == 0 || (!bKID && form->HasKeyword(extraArtifactKeyword)) || (bKID && (!form->HasKeyword(notArtifactKeyword) || form->HasKeyword(extraArtifactKeyword)))) && strlen(form->GetName()) > 0) { g_artifactMap[form->formID] = form; } } diff --git a/Source/ArtifactTrackerDLL/src/ArtifactTracker.h b/Source/ArtifactTrackerDLL/src/ArtifactTracker.h index e62e0fb..09f8283 100644 --- a/Source/ArtifactTrackerDLL/src/ArtifactTracker.h +++ b/Source/ArtifactTrackerDLL/src/ArtifactTracker.h @@ -15,7 +15,7 @@ namespace ArtifactTracker extern std::unordered_map g_persistentMap; extern RE::TESObjectREFR* g_cellStorage; - bool Init(); + bool Init(bool bKID = false); bool IsArtifact(const RE::TESForm* a_item); diff --git a/Source/ArtifactTrackerDLL/src/EventListener.cpp b/Source/ArtifactTrackerDLL/src/EventListener.cpp index 8fe7fb0..34ea2ce 100644 --- a/Source/ArtifactTrackerDLL/src/EventListener.cpp +++ b/Source/ArtifactTrackerDLL/src/EventListener.cpp @@ -19,7 +19,7 @@ auto EventListener::ProcessEvent( -> RE::BSEventNotifyControl { if (a_event->eventName == "KID_KeywordDistributionDone") { - ArtifactTracker::Init(); + ArtifactTracker::Init(true); } return RE::BSEventNotifyControl::kContinue;