summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobodySociety <43542553+NobodySociety@users.noreply.github.com>2019-12-06 23:00:43 -0500
committerNobodySociety <43542553+NobodySociety@users.noreply.github.com>2019-12-06 23:00:43 -0500
commitf42098410b83dbabc3ac7eb253d56601e34359f1 (patch)
tree3020527e8ae17615b44a8eda9bd97808208c8ff6
parente59dc970a60b95f58ee97bae2e30a8c20c01d315 (diff)
Updated to include how to use the item as default in the overworld
-rw-r--r--Adding-items-that-act-like-HMs.md25
1 files changed, 24 insertions, 1 deletions
diff --git a/Adding-items-that-act-like-HMs.md b/Adding-items-that-act-like-HMs.md
index 4b8f350..5b03f06 100644
--- a/Adding-items-that-act-like-HMs.md
+++ b/Adding-items-that-act-like-HMs.md
@@ -179,4 +179,27 @@ All of these are in [engine/events/overworld.asm](../blob/master/engine/events/o
* `Script_UsedStrength`
* Flash does not show the Pokémon's name
* `Script_UsedWhirlpool`
-* `Script_UsedWaterfall` \ No newline at end of file
+* `Script_UsedWaterfall`
+
+### Using the item as default on the overworld
+
+Even with the item added and it being functional, the game will still check for a pokemon in the party to use the HM move when attempting to interact with a cuttable tree on the overworld. This is a simple fix.
+
+If we look in [engine/events/overworld.asm](../blob/master/engine/events/overworld.asm) at the bottom, we'll see `TryCutOW`. This function is called when the player interacts with a cuttable tree, normally it checks the party first for a pokemon with cut, then for the appropriate badge, so we'll change it.
+
+```Diff
+TryCutOW::
+- ld d, CUT
+- call CheckPartyMove
+- jr c, .cant_cut
+
+- ld de, ENGINE_HIVEBADGE
+- call CheckEngineFlag
++ ld a, CHAINSAW
++ ld [wCurItem], a
++ ld hl, wNumItems
++ call CheckItem
+ jr c, .cant_cut
+```
+
+This removes the checks for an eligible pokemon and badge, and just checks for the item in the bag. \ No newline at end of file