babalae/better-genshin-impact · error · PartySetupFailedException
未能打开队伍配置界面
Error message
未能打开队伍配置界面
What it means
SwitchPartyTask.Start attempts to open the party-setup screen by sending the OpenPartySetupScreen hotkey up to 2 times, each followed by 7x600ms checks for Bv.IsInPartyViewUi. If neither attempt detects the party-view UI, it throws PartySetupFailedException because it cannot proceed to party selection.
Source
Thrown at BetterGenshinImpact/GameTask/Common/Job/SwitchPartyTask.cs:79
{
await Delay(600, ct);
using var raCheck = CaptureToRectArea();
if (Bv.IsInPartyViewUi(raCheck))
{
isOpened = true;
break;
}
}
if (isOpened)
{
break; // 页面已打开,跳出循环
}
}
if (!isOpened)
{
throw new PartySetupFailedException("未能打开队伍配置界面");
}
}
await Delay(500, ct);
using var ra = CaptureToRectArea();
var partyViewBtn = ra.Find(ElementRecognition.Get("PartyBtnChooseView", ra));
// OCR 当前队伍名称(无法单字,中间禁止空格)
var currTeamName = ra.Find(new RecognitionObject
{
RecognitionType = RecognitionTypes.Ocr,
RegionOfInterest = new Rect(partyViewBtn.Right, partyViewBtn.Top, (int)(350 * _assetScale),
partyViewBtn.Height)
}).Text;
var tempName = currTeamName
.Replace("\"", "") // 移除所有双引号(核心新增,解决日志里的""问题)View on GitHub (pinned to a7cb36712d)
Solutions
- Ensure the game is on the main UI and out of combat/domains where party setup is blocked.
- Verify GIActions.OpenPartySetupScreen maps to the correct current hotkey and that input focus is on the game window.
- Update the Bv.IsInPartyViewUi detector for the current game version.
- Increase maxAttempts or the 7x600ms check budget if the screen loads slowly.
Defensive patterns
Strategy: try-catch
Try / catch
try { await partyTask.Start(partyName, ct); }
catch (PartySetupFailedException ex) when (ex.Message == "未能打开队伍配置界面")
{ _logger.LogError(ex, "打开队伍配置界面失败:检查快捷键绑定与游戏焦点"); } Prevention
- Ensure the game window has input focus and the OpenPartySetupScreen hotkey is valid.
- Do not call from combat/domain states where party setup is blocked.
- Keep Bv.IsInPartyViewUi detectors current; raise the attempt/budget if loading is slow.
When it happens
Trigger: After confirming main UI, the loop sends SimulateAction(GIActions.OpenPartySetupScreen) twice; all 7 detection checks per attempt return Bv.IsInPartyViewUi==false, so isOpened stays false.
Common situations: The OpenPartySetupScreen hotkey binding changed or is not registered in the current game version; the game ignored input (focus lost, input blocked); Bv.IsInPartyViewUi detector markers changed; a slow load exceeded the ~4.2s per-attempt budget; the party screen was disabled in the current game state (e.g. in combat/domain).
Related errors
- 未能打开队伍选择页面
- 切换角色:点击逻辑槽位 {logicalSlot} 的换下按钮后,未在 {RemoveConfirmationTimeo
- 切换角色:点击队伍槽位后未打开角色列表
- 切换角色:角色列表关闭后未返回队伍配置页
- 未能返回主界面
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/0bab65b147ced63a.
Report an issue: GitHub.