forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Item Ball refactor / Pluralize item names for giveitem and finditem #3942
Merged
Bassoonian
merged 14 commits into
rh-hideout:upcoming
from
PokemonSanFran:item_ball_refactor
Jan 14, 2024
Merged
Item Ball refactor / Pluralize item names for giveitem and finditem #3942
Bassoonian
merged 14 commits into
rh-hideout:upcoming
from
PokemonSanFran:item_ball_refactor
Jan 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added GetObjectEventTrainerRangeFromTemplate Added Common_EventScript_FindItem
This was referenced Jan 8, 2024
Replaced scripts with Common_EventScript_FindItem
Moved to item_ball.c
Wrote a Python script to convert your repo's finditems to the new format (and also cleans up the now unused finditem scripts, both in inc files and pory files): https://hastebin.com/share/epepoworow.python This means that this should now qualify for merging. |
pkmnsnfrn
force-pushed
the
item_ball_refactor
branch
from
January 9, 2024 14:40
f7bf1f4
to
1d0d413
Compare
AsparagusEduardo
previously requested changes
Jan 9, 2024
…ead of ITEMS_COUNT
…ald-expansion into item_ball_refactor
https://github.com/rh-hideout/pokeemerald-expansion/pull/3942\#discussion_r1446415663 https://github.com/rh-hideout/pokeemerald-expansion/pull/3942\#discussion_r1446415525 https://github.com/rh-hideout/pokeemerald-expansion/pull/3942\#discussion_r1446415409 https://github.com/rh-hideout/pokeemerald-expansion/pull/3942\#discussion_r1446415130
Reverted global.fieldmap to original state, per feedback
|
Bassoonian
approved these changes
Jan 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Common_EventScript_FindItem
, usingtrainerRange_berryTreeId
to define item andmovementRangeX
to define quantityCommon_EventScript_FindItem
Usage
Existing Items
This branch will convert all the existing scripts in vanilla
pokeemerald
to useCommon_EventScript_FindItem
. No quantity is defined for these items, which defaults to 1.If developers would like to convert item ball scripts that they have added to their repo, @Bassoonian has written a python script capable of doing so. Developers will need to run some version of the following command in their repo:
wget https://raw.githubusercontent.com/rh-hideout/pokeemerald-expansion/f7bf1f4e320ce00d3434f337aaf796b2489e6ced/item_ball_refactor_helper.py -O item_ball_refactor_helper.py && chmod +x item_ball_refactor_helper.py && python3 item_ball_refactor_helper.py && rm item_ball_refactor_helper.py
New Items
When a developer wants to add a new item ball to the overworld of their game, they can do so either via json or Porymap. Regardless of the method, the result will be the same - if the player has room in their bag, the item will be picked up, added to the inventory, and the flag for that item will be set.
Porymap (reccomended)
When adding a new object to a map, the object's fields must be set as follows:
Common_EventScript_FindItem
(the script used for all item balls)FLAG_ITEM_HAMMERLOCKE_GREAT_BALL
(the flag used for the item in question, needs to be manually created by the developer and assigned)ITEM_GREAT_BALL
(the constant for the item the player should receive)10
(the amount of the item the player should receive. if this is 0, the player will receive 1.)json
For the new object, add the following element to the
object_events
of themap.json
for the map being edited.Testing
Clean Branch
You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:
### Patchwget https://github.com/rh-hideout/pokeemerald-expansion/files/13856855/patch-item_ball_refactor_testing.patch -O item.patch ; git apply item.patch ; rm item.patch
Patches are only cool when its a single commmit or a string of commits. Now that I've merged with upcoming, the patches broken and I can't be arsed to fix it.
Repo
git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion item_ball_refactor
Manual Tests
To recreate my testing environment, you can either:
Download
wget https://github.com/PokemonSanFran/pokeemerald-expansion/raw/025c822c3b003b568d14f68e8ee3abc87969cf42/pokeemerald.sav -O pokeemerald.sav ; wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/025c822c3b003b568d14f68e8ee3abc87969cf42/data/scripts/debug.inc -O data/scripts/debug.inc ; wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/025c822c3b003b568d14f68e8ee3abc87969cf42/data/maps/Route102/map.json -O data/maps/Route102/map.json
Manually Apply
Verified Scenarios
Each item in the following lists goes to a timestamped YouTube link with each specific scenario being tested.
- Pick up an item ball where movementRangeX is defined as 255Pick up an item ball where movementRangeX is defined as 15
Pick up an item ball where movementRangeX is defined as 0
Pick up an item ball where trainerRange_berryTreeId is defined as ITEMS_COUNT + 1
Pick up an existing item ball
Given 2 Max Potion
Given 4 Master Ball
Given 1 Cheri Berry
Given 99 TM42
Given 3 Basement Key
Features this PR does NOT handle:
Credits
Please credit these people instead of me.
deokishisu
ShinyDragonHunter
CopyItemNameHandlePlural
ghoulslash
gText_ObtainedTheItems
,EventScript_ObtainedItemMessage
, andEventScript_ObtainedItem
.Jaizu
gText_PlayerFoundItems
,EventScript_FoundItemMessage
, andEventScript_FoundItem
.Discord Contact Info
I am
pkmnsnfrn
. I have already started a discussion thread.