Skip to content

feat: sar_unlocked_chapters also unlocks coop courses - #384

Open
PortalRex wants to merge 6 commits into
p2sr:masterfrom
PortalRex:feat/unlock-coop-courses
Open

PortalRex wants to merge 6 commits into
p2sr:masterfrom
PortalRex:feat/unlock-coop-courses

Conversation

@PortalRex

Copy link
Copy Markdown
Member

sar_unlocked_chapters now also unlocks coop courses up to its value: the hub doors, the hub level select screens and the challenge mode lists (main menu and in game). Saved progress isn't touched, so no achievements are awarded. Unlock only: 0 acts like -1. Hub changes apply to the host and take effect when the hub loads.

Tested on Windows and Linux. Windows hasn't been tested in game for the hub level select part yet.

Detour CPortalMPGameRules::GetActiveBranches (the hub script's
GetHighestActiveBranch) to return at least min(sar_unlocked_chapters, 6).
Completion data is left alone, so the hub awards no course achievements.
Host side only; Windows signature only.
…menu challenge mode list

Linux inlines the MP.complete title data read into CLeaderboardMapItem::SetChapterAndMapInfo, so
patch the point where its completion checks meet with a call to a stub that sets the result for
maps of courses up to sar_unlocked_chapters.
…cked coop courses

The hub's level select screens and arrows use the IsLevelComplete script function and
coop_lobby_select_level, which both read the server's real completion data, so a course that
was only unlocked opened on its first map with the arrows off. Treat the maps of unlocked
courses as completed in that script function and add coop_lobby_select_level's force argument
for them.
@PortalRex

Copy link
Copy Markdown
Member Author

linux CI failed due to ubuntu-latest changing to ubuntu-24.04 fixes but you can decide what you wanna do amj

@ThisAMJ

ThisAMJ commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

lol why the fuck

I would only ever want this for the cm list (like sp). if it's to lock courses i.e. for solocoop (which it's not), then will you increase the cvar as maps are completed? why separate the unlocked state from completion? as a verifier you should know what a nightmare this is. it also changes the default behavior for the majority of players who set the cvar to 999 in configs (to unlock the cm list, as intended) and never touch it again.

@PortalRex

Copy link
Copy Markdown
Member Author

whoops sorry bout that amj =), this is now the same as sp

This branch has not been deployed

No deployments
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