feat: quest journal decorator with resolved quest data#413
Closed
Gerkinfeltser wants to merge 2 commits into
Closed
feat: quest journal decorator with resolved quest data#413Gerkinfeltser wants to merge 2 commits into
Gerkinfeltser wants to merge 2 commits into
Conversation
Standalone SKSE plugin providing get_quest_journal() decorator for SkyrimNet. Resolves <Alias=...>, <alias=...>, and <Global=Name> tokens in quest names, objective text, and journal body text. Uses engine's ParseString (RELOCATION_ID 23429/23897) and journal entry resolver (24778/25259). Triple-source quest discovery: PlayerCharacter::questLog, questTargets (compass markers), and displayed objectives. Includes demo prompt template based on jykej's party quests layout. See PR_DRAFT.md in SkyrimNet_iPrompts repo for full details.
Contributor
Author
|
(Superseded by #417) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quest Journal Decorator
Summary
Adds a
get_quest_journal()decorator that exposes resolved quest journal content — objective text with<Alias=...>tokens properly resolved,<Global=...>progress counters substituted, and journal body text — for both vanilla and modded quests.Problem
SkyrimNet's existing quest decorators (
get_all_active_quests(),get_selected_quests()) return raw engine data:<Alias.ShortName=QuestGiver>instead of "Ysolda" or<alias=locationAlias>instead of "Fellglow Keep"<Global=FFR07TeethCount>/<Global=FFR07TeethTotal>instead of "1/5"GetName()value, producing blank headersThe engine resolves these tokens at UI render time only. Papyrus has no API to resolve them.
Solution
A standalone SKSE plugin (intended for integration into SkyrimNet proper) that hooks into the engine's text resolution pipeline:
Alias Token Resolution
Uses
BGSQuestInstanceText::ParseString(RELOCATION_ID 23429/23897) — the same function the Experience mod uses. Normalizes<alias=to<Alias=before resolution. Handles<Alias=Name>,<alias=Name>, and<alias.PronounObj=Name>tokens.Global Variable Resolution
Looks up
TESGlobalforms by editorID to substitute<Global=Name>tokens with actual integer values. Turns(<Global=FFR07TeethCount>/<Global=FFR07TeethTotal>)into(1/5).Journal Body Text
Uses
RELOCATION_ID(24778, 25259)to resolveBGSLocalizedStringDLstring IDs into actual journal entry text — the same function the game's journal menu calls.Template Integration
Updated
0610_party_quests.prompt(based on a prompt by jykej, modified to use journal data) as a demo/test template. Cross-referencesget_selected_quests()withget_quest_journal(player.UUID):[DONE]for completed)The template is a working reference for other SkyrimNet prompt authors — customize layout/filtering for your own character setups.
What Changed
<Alias.ShortName=QuestGiver><alias=locationAlias>(<Global=...>/<Global=...>)****(empty name, invisible)Example Output
Files
CppAPI/src/main.quest_journal.cpp— standalone SKSE plugin (332 lines)CppAPI/.buildenv/CMakeLists.txt— build target forSkyrimNetQuestJournalDecoratorSKSE/Plugins/SkyrimNetQuestJournalDecorator.dll— compiled pluginSKSE/Plugins/SkyrimNet/prompts/submodules/character_bio/0610_party_quests.prompt— updated templateTechnical Notes
kPostPostLoad(notkDataLoaded) to avoid template caching race conditionPlayerCharacter::questLog(journal entries),questTargets(compass markers at offset 0x598), displayed objectives (states 1/3/5)GetName()→ first objectivedisplayText→editorIDBSReadLockGuardfor quest alias data,BSSpinLockGuardfor questTargetsisMisc(questType==6),inQuestLog,displayed(per-objective) flagsSKSE\SkyrimNetQuestJournalDecorator.log. SetQJ_LOG_ENABLEDto0to disable (compile-time)Known Limitations
kDormantstate (0) with no questLog or questTargets entries. Invisible to all three SKSE data sources. Hard limitation.Journal_QuestsTab::unk30). Not persisted, not inTESQuest::data.flags, not accessible via SKSE. Misc tasks always show when tracked.PlayerCharacter::questLogincludes rumor/auto-triggered quests the player hasn't actively started.show_inactive_questsdefaults tofalse.isMiscis approximate — Based on engine questType==6. Some quests the game shows as misc have different engine types (e.g., 3DNPC's3DNPCMQ9).ParseStringrequires live quest — Alias resolution only works while quest is running with populated aliases.Integration Path
This is a standalone DLL for development/testing. For integration into SkyrimNet:
BuildQuestJournalJson()+ helpers into the main SkyrimNet DLL's decorator systemPublicRegisterDecoratorcall with internal registrationtrackedByPlayerboolean to simplify template cross-referencing