1

All hardcoded filters can be overridden in INI

This commit is contained in:
Eddoursul 2022-07-07 03:04:51 +02:00
parent 00fe1f78a7
commit 01dbb4bf9d
7 changed files with 51 additions and 20 deletions

View File

@ -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

View File

@ -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
; ClothingPoor
; 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
; 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

Binary file not shown.

Binary file not shown.

View File

@ -18,7 +18,7 @@ namespace ArtifactTracker
std::unordered_map<RE::FormID, RE::TESObjectREFR*> 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<RE::BGSKeyword>(0xFC1A3, "Skyrim.esm"); // LocTypePlayerHouse
const auto recipeKeyword = dataHandler->LookupForm<RE::BGSKeyword>(0xF5CB0, "Skyrim.esm"); // VendorItemRecipe
const auto excludeKeywords = dataHandler->LookupForm<RE::BGSListForm>(0x801, "Artifact Tracker.esp"); // ETR_ExcludeMiscKeywords
const auto extraArtifactKeyword = dataHandler->LookupForm<RE::BGSKeyword>(0xAFC11A, "Update.esm"); // ETR_ExtraArtifact
const auto notArtifactKeyword = dataHandler->LookupForm<RE::BGSKeyword>(0xAFC11C, "Update.esm"); // ETR_NotArtifact
const auto npcRaceKeyword = dataHandler->LookupForm<RE::BGSKeyword>(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<std::string, bool> 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<RE::TESObjectWEAP>()) {
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<RE::TESObjectBOOK>()) {
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<RE::TESObjectMISC>()) {
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;
}
}

View File

@ -15,7 +15,7 @@ namespace ArtifactTracker
extern std::unordered_map<RE::FormID, RE::TESObjectREFR*> g_persistentMap;
extern RE::TESObjectREFR* g_cellStorage;
bool Init();
bool Init(bool bKID = false);
bool IsArtifact(const RE::TESForm* a_item);

View File

@ -19,7 +19,7 @@ auto EventListener::ProcessEvent(
-> RE::BSEventNotifyControl
{
if (a_event->eventName == "KID_KeywordDistributionDone") {
ArtifactTracker::Init();
ArtifactTracker::Init(true);
}
return RE::BSEventNotifyControl::kContinue;