-
Notifications
You must be signed in to change notification settings - Fork 22
Decomp more script variable functions #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| s32 cur_chapter = LoadScriptVariableValueAtIndex(0, script_var_id, 0); | ||
| s32 cur_sub_sec = LoadScriptVariableValueAtIndex(0, script_var_id, 1); | ||
|
|
||
| if (cur_chapter == 0x35) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
To be merged after PR214.