Skip to content

feat: access RE::BSTSmartPointer<BSScript::Object> without using global var - #113

Merged
AtomCrafty merged 3 commits into
MissCorruption:mainfrom
shad0wshayd3-TES5:alt-prop-getter
Sep 18, 2026
Merged

AtomCrafty merged 3 commits into
MissCorruption:mainfrom
shad0wshayd3-TES5:alt-prop-getter

Conversation

@shad0wshayd3

Copy link
Copy Markdown
  • updates Papyrus::SetFrameworkQuest to store an RE::TESQuest pointer rather than an RE:BSTSmartPointer<RE:BSScript::Object>
  • updates LoadSettings<T> to call Util::ScriptObject::FromForm to fetch a temporary RE::BSTSmartPointer<RE::BSScript::Object> using the stored RE::TESQuest pointer

Comment thread src/Config/Papyrus.h Outdated
template <typename T>
static void LoadSetting(T& variable, const std::string& propertyName, const T& defaultValue)
{
auto MCMScript = Util::ScriptObject::FromForm(MCMQuest, "QuickLootIEMCM");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just do this once in UpdateVariables and pass the script to LoadSetting. It's currently retrieving the script object again and again for every single variable we want to read.

@AtomCrafty

Copy link
Copy Markdown
Collaborator

@shad0wshayd3 lmk if you want to do that yourself or if I should do it.

@AtomCrafty
AtomCrafty merged commit 2a669f5 into MissCorruption:main Sep 18, 2026
@AtomCrafty

Copy link
Copy Markdown
Collaborator

Thanks! Now that I look at this again I wonder whether we even need SetFrameworkQuest in the first place. We might just be able to look up the quest form directly via TESDataHandler. But that's an experiment for another time.

@shad0wshayd3
shad0wshayd3 deleted the alt-prop-getter branch September 18, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants