Skip to content
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

(Default Off) Item Description Headers #4767

Merged
merged 12 commits into from
Sep 3, 2024

Conversation

ghoulslash
Copy link
Collaborator

@ghoulslash ghoulslash commented Jun 11, 2024

Adds description headers from my pokeemerald branch. It uses callnative instead of script cmds to cause fewer conflicts. A config has been added which is Off by default so as not to break saves. I added the itemFlags to saveblock3 as well

config:
0 = off
1 = on first obtain (uses save space)
2 = always shot description (no save space required)

item_header

@AlexOn1ine
Copy link
Collaborator

Ghoul, do you think you could add an option that shows the header without using up saveblock space so it will basically show up each time you obtain the item even if it is a duplicate?

@Bassoonian
Copy link
Collaborator

Do you think there’s a way this could depart from your actual branch? It’s a commonly merged in branch, so if expansion can handle the conflicts from the original to this one, it would make it significantly easier for people downstream

@ghoulslash
Copy link
Collaborator Author

Ghoul, do you think you could add an option that shows the header without using up saveblock space so it will basically show up each time you obtain the item even if it is a duplicate?

Yeah, that's a good option. OW_SHOW_ITEM_DESCRIPTIONS = 0: off, 1 = first time, 2 = always ?

Do you think there’s a way this could depart from your actual branch? It’s a commonly merged in branch, so if expansion can handle the conflicts from the original to this one, it would make it significantly easier for people downstream

Yeah, can probably move out of item.c to help conflicts. Good idea.

@AlexOn1ine
Copy link
Collaborator

Yeah, that's a good option. OW_SHOW_ITEM_DESCRIPTIONS = 0: off, 1 = first time, 2 = always ?
Sounds good, thx.

data/maps/Route109_SeashoreHouse/scripts.inc Outdated Show resolved Hide resolved
data/maps/Route109_SeashoreHouse/scripts.inc Outdated Show resolved Hide resolved
data/scripts/berry_tree.inc Outdated Show resolved Hide resolved
data/scripts/berry_tree.inc Outdated Show resolved Hide resolved
data/maps/MtChimney/scripts.inc Outdated Show resolved Hide resolved
asm/macros/event.inc Outdated Show resolved Hide resolved
data/maps/MtChimney/scripts.inc Show resolved Hide resolved
…move code to overworld.c to prevent issues with users whove merged original branch. fix styling
@ghoulslash
Copy link
Collaborator Author

okay added extra config values and moved code to overworld.c. ready for re review

src/overworld.c Outdated
#else
void ScriptShowItemDescription(struct ScriptContext *ctx)
{
u8 UNUSED headerType = ScriptReadByte(ctx);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is there an unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why is there an unused?

For when the config is off. Otherwise you end with a bunch of warnings

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just tried compiling it with line 3478 removed (making it an empty function like the one below), and it compiles just fine :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the ScriptReadByte(ctx); is necessary to consume the argument of showitemdescription and showberrydescription (i.e. .byte 0 and .byte 1 respectively). Otherwise those bytes will be interpreted as commands 0 and 1 (nop and nop1 respectively, which are harmless in Expansion, but ripe for being replaced by downstream projects).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then perhaps we need to just add the ScriptReadByte functions but without specified variable to store the returned value in?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mrgriffin, @ghoulslash could any of you respond to this please? 👀

Copy link
Collaborator

@AlexOn1ine AlexOn1ine Aug 30, 2024

Choose a reason for hiding this comment

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

@mrgriffin @ghoulslash could any of you get back to this? It is the last thing needed to be addressed for a merge 😅

@AlexOn1ine
Copy link
Collaborator

Is there a way we could block the contents of GetSetItemObtained and saveblock with an ifdef block and the rest with a normal if condition to get rid of the ifdefs in the scripts?

include/global.h Outdated Show resolved Hide resolved
@Bassoonian Bassoonian added this to the 1.10 milestone Jun 26, 2024
@pkmnsnfrn
Copy link
Collaborator

If we can complete an emerald playthrough with this on, would that be enough to say "it's probably good"?

@AlexOn1ine
Copy link
Collaborator

Conflicts

ghoulslash and others added 2 commits August 4, 2024 12:29
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
@ghoulslash
Copy link
Collaborator Author

conflicts handled and removed saveblock address comment from global.h. Ready for re-review
If we can complete an emerald playthrough with this on, would that be enough to say "it's probably good"?
that would be the idea scenario, but it's a pretty big requirement. I think the branch has existed long enough that most test cases are handled by now

@pkmnsnfrn
Copy link
Collaborator

that would be the idea scenario, but it's a pretty big requirement

its 3 hours to get to the champion at 1x. I'm just curious what you and alex think is an acceptable merge criteria after the code review, and it sounds like you're saying "nothing, this PR is already battle tested"

@AlexOn1ine
Copy link
Collaborator

that would be the idea scenario, but it's a pretty big requirement

its 3 hours to get to the champion at 1x. I'm just curious what you and alex think is an acceptable merge criteria after the code review, and it sounds like you're saying "nothing, this PR is already battle tested"

A play-through is not necessary. I'll merge it once the open question gets answered.

src/overworld.c Outdated Show resolved Hide resolved
include/overworld.h Outdated Show resolved Hide resolved
@AlexOn1ine AlexOn1ine added the new-feature Adds a feature label Aug 7, 2024
@pkmnsnfrn pkmnsnfrn marked this pull request as draft August 28, 2024 02:50
@ghoulslash ghoulslash marked this pull request as ready for review September 3, 2024 17:48
@AlexOn1ine AlexOn1ine merged commit 28a9ad3 into rh-hideout:upcoming Sep 3, 2024
1 check passed
@Bassoonian
Copy link
Collaborator

Bassoonian commented Sep 7, 2024

In my old implementation in my hack, I had a memset(&gSaveBlock2Ptr->itemFlags, 0, sizeof(gSaveBlock2Ptr->itemFlags)); in NewGameInitData. This doesn't seem to be here, which means that the item flags don't get reset. Is this intentional?

move code to overworld.c to prevent issues with users whove merged original branch

This also failed 100% because the original code doesn't get moved, it just gets duplicated right now which leaves behind a bunch of silent conflicts for the user to solve

@AlexOn1ine
Copy link
Collaborator

I squashed this PR because ghoul made a brand new branch that had nothing to do with the old history

@AsparagusEduardo
Copy link
Collaborator

AsparagusEduardo commented Sep 7, 2024

I squashed this PR because ghoul made a brand new branch that had nothing to do with the old history

We should do the same thing we did for BW map headers then, so avoid conflicts for downstream.

@ghoulslash ghoulslash deleted the rhh/desc_headers branch September 10, 2024 01:07
@AsparagusEduardo AsparagusEduardo added the category: overworld Pertains to out-of-battle mechanics label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: overworld Pertains to out-of-battle mechanics new-feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants