WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@slaw-22
Copy link
Contributor

@slaw-22 slaw-22 commented Nov 29, 2025

To be merged after PR214.

s32 cur_chapter = LoadScriptVariableValueAtIndex(0, script_var_id, 0);
s32 cur_sub_sec = LoadScriptVariableValueAtIndex(0, script_var_id, 1);

if (cur_chapter == 0x35) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to know what this constant / enum value is. I couldn't see an enum of chapters or story progression. Maybe this is in Unionall? I've found the file format specification for Unionall but not the data itself.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't find anywhere that this value is documented. There's a partial list of scenario flag values at https://wiki.skytemple.org/index.php/Scenario_Main_Values, but it doesn't go all the way to 0x35.

void EventFlagBackup();
bool8 DumpScriptVariableValues(u8* dest);
bool8 RestoreScriptVariableValues(u8* src);
void InitProgress();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally this would go into story_progress.h, but LoadScriptVarValuePair (below) fits better in script_variable.h.

#define PMDSKY_STORY_PROGRESS_H

void UpdateProgress(enum script_var_id script_var_id, s32 progress, s32 sub_progress);
bool8 IsStoryBeforePoint(enum script_var_id script_var_id, s32 chapter, s32 sub_section);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are the terms chapter, and sub_section idiomatic names used within the community?

These IsStory* methods are almost always called with a script_var_id of VAR_SCENARIO_MAIN where the enum comment says that the indexed elements are chapter and sub_section.

Copy link
Collaborator

Choose a reason for hiding this comment

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

"subsection" is more of a technical term and most people don't think about that level of subdivision, so the term is fine. "Chapter" is displayed in-game, so it is widely used by the community.

#define PMDSKY_STORY_PROGRESS_H

void UpdateProgress(enum script_var_id script_var_id, s32 progress, s32 sub_progress);
bool8 IsStoryBeforePoint(enum script_var_id script_var_id, s32 chapter, s32 sub_section);
Copy link
Collaborator

Choose a reason for hiding this comment

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

"subsection" is more of a technical term and most people don't think about that level of subdivision, so the term is fine. "Chapter" is displayed in-game, so it is widely used by the community.

s32 cur_chapter = LoadScriptVariableValueAtIndex(0, script_var_id, 0);
s32 cur_sub_sec = LoadScriptVariableValueAtIndex(0, script_var_id, 1);

if (cur_chapter == 0x35) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't find anywhere that this value is documented. There's a partial list of scenario flag values at https://wiki.skytemple.org/index.php/Scenario_Main_Values, but it doesn't go all the way to 0x35.

@AnonymousRandomPerson AnonymousRandomPerson merged commit 69ea6f2 into pret:main Nov 29, 2025
1 check passed
github-actions bot pushed a commit that referenced this pull request Nov 29, 2025
@slaw-22 slaw-22 deleted the Scripting6 branch December 7, 2025 06:55
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