Use console commands to start MQ102 on Vault exit

Replace direct TESQuest::SetStage usage with console commands to reliably start and advance MQ102 when leaving COVault109. TryStartOutOfTimeQuest now includes RE::Console, issues `startquest MQ102` and `setstage MQ102 10`, and uses a static one-time guard (outOfTimeQuestStartIssued) to avoid repeated issuance. Removed the unreliable currentStage check and adjusted constants/naming and log output. Updated changelog and dev-log to document the implementation and touched compiled script binary.
This commit is contained in:
2026-06-30 22:46:06 +12:00
parent 771f855f89
commit a6d4cc2ba6
4 changed files with 26 additions and 18 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ For testing notes, milestone summaries, known issues, and next steps, see [`docs
## [Unreleased]
### Added
- Quest auto-start on COVault109 exit: "Out of Time" quest (MQ102) now starts automatically and sets to stage 10 when the player leaves COVault109 for the first time.
- Quest auto-start on COVault109 exit: "Out of Time" quest (MQ102) now starts automatically via console `startquest`/`setstage` commands when the player leaves COVault109 for the first time.
- Complexion texture form reference (`complexionFormId`) to appearance payload so hands, arms, and body match the synced skin tone (follows the existing hair colour pattern).
- Appearance protocol version 3 with an optional `tints` field (character tint layers: skin tone, complexion, makeup, beard shade) so proxies can mirror the sender's skin colour and facial detail.
- Capture of player/NPC `tintingData` in `CaptureLocalAppearance`, plus game-thread application of tints onto runtime proxies: existing entries are updated in place by template ID, and missing entries are reconstructed against the proxy race's tint templates (skipped when no template resolves).
+7 -4
View File
@@ -10,20 +10,23 @@ failed experiments, successful tests, and next steps.
## 2026-06-30 - COVault109 Exit Quest Auto-Start
### Summary
Added automatic quest start for "Out of Time" (MQ102, FormID: 0x0001CC2A) when the player first leaves COVault109. The quest is started and immediately set to stage 10, skipping the vault entry sequence. This provides a smoother transition into the multiplayer world after character creation.
Added automatic quest start for "Out of Time" (MQ102, FormID: 0x0001CC2A) when the player first leaves COVault109. The quest is started with `startquest MQ102` and immediately moved to stage 10 with `setstage MQ102 10`, skipping the vault entry sequence. This provides a smoother transition into the multiplayer world after character creation.
### Files Changed
- `plugin/src/main.cpp`
- `changelog.md`
- `docs/dev-log.md`
### Details
- Added `TryStartOutOfTimeQuest()` helper function that uses `TESDataHandler::LookupForm` to safely resolve the MQ102 quest from Fallout4.esm.
- Function includes safety checks: verifies data handler availability, confirms quest form resolution, and skips if the quest is already started.
- Added `TryStartOutOfTimeQuest()` helper function that uses `TESDataHandler::LookupForm` to safely resolve the MQ102 quest from Fallout4.esm before issuing console quest commands.
- Function includes safety checks: verifies data handler availability, confirms quest form resolution, and only issues the commands once per plugin session.
- Called during the solo cell exit detection in `PollLocalPlayerTransform()` when `soloCellTransformSuppressed` transitions from true to false.
- Logs informational messages on quest start and warnings for any resolution failures.
### Testing
- Compile test: no linter errors.
- Initial in-game log check showed the COVault109 exit trigger fired, but direct `TESQuest::SetStage(10)` did not visibly start MQ102.
- Updated implementation to use console `startquest MQ102` and `setstage MQ102 10`, matching existing project command patterns.
- Removed the `currentStage != 0` skip because the first failed direct-stage attempt could leave a non-zero stage without visibly starting the quest on that save.
- Recommended manual check: create a new character, complete Vault 111, exit into the Commonwealth world, and verify that MQ102 is started and set to stage 10 (check quest menu or `getquestcompletedstage 0001CC2A` console command).
- Verify the quest does not start if the player re-enters and exits COVault109 (safety check works).
+13 -8
View File
@@ -13,6 +13,7 @@
#include "RE/B/BIPED_OBJECT.h"
#include "RE/B/BipedAnim.h"
#include "RE/B/BSFixedString.h"
#include "RE/C/Console.h"
#include "RE/I/IAnimationGraphManagerHolder.h"
#include <algorithm>
@@ -671,7 +672,12 @@ namespace
void TryStartOutOfTimeQuest()
{
constexpr auto MQ102_FORM_ID = 0x0001CC2A;
constexpr auto MQ102_TARGET_STAGE = 10;
constexpr auto kMQ102TargetStage = 10;
static bool outOfTimeQuestStartIssued = false;
if (outOfTimeQuestStartIssued) {
return;
}
auto* dataHandler = RE::TESDataHandler::GetSingleton();
if (!dataHandler) {
@@ -685,15 +691,14 @@ namespace
return;
}
if (quest->currentStage != 0) {
return;
}
quest->SetStage(MQ102_TARGET_STAGE);
outOfTimeQuestStartIssued = true;
RE::Console::ExecuteCommand("startquest MQ102");
RE::Console::ExecuteCommand("setstage MQ102 10");
LogInfoWithLocalPlayerPrefix(std::format(
"Started quest MQ102 (Out of Time) and set to stage {}, triggered by leaving COVault109.",
MQ102_TARGET_STAGE));
"Issued startquest MQ102 and setstage MQ102 {} after leaving COVault109; previous currentStage={}.",
kMQ102TargetStage,
quest->currentStage));
}
const char* GetSpecialMovementType(