![]() |
[Emerald] Items as HMs: Checkitem doesn't seem to work
Here is the first script I made:
'--------------- #org 0xE3CFBC lockall checkflag 0x867 if 0x0 goto 0x8290721 checkitem 0x167 0x1 compare LASTRESULT 0x6 if 0x1 goto 0x8290721 setanimation 0x0 LASTRESULT bufferitem 0x0 0x167 checkitem 0x167 0x1 msgbox 0x829072E MSG_YESNO '"This tree looks like it can be\ncu..." compare LASTRESULT 0x0 if 0x1 goto 0x829072B msgbox 0x8290771 MSG_KEEPOPEN '"[player] used [buffer1]!" closeonkeypress doanimation 0x2 waitstate goto 0x8290710 '--------------- #org 0x290721 msgbox 0x829077D MSG_KEEPOPEN '"This tree looks like it can be\ncu..." releaseall end '--------------- #org 0x29072B closeonkeypress releaseall end '--------------- #org 0x290710 applymovement LASTTALKED 0x829071F waitmovement 0x0 hidesprite LASTTALKED releaseall end '--------- ' Strings '--------- #org 0x29072E = This tree looks like it can be\ncut down!\pWould you like to use [buffer1]? #org 0x290771 = [player] used [buffer1]! #org 0x29077D = This tree looks like it can be\ncut down! '----------- ' Movements '----------- #org 0x29071F #raw 0x5B 'mov5B #raw 0xFE 'End of Movements The problem is that I can cut trees even if I don't have the item 0x167 in my bag despite using the checkitem command. Why is this happening? Did I do wrong somewhere? Thanks for your answers. |
Here's a version of your script that will work:
Spoiler:
Your issue stemmed these three lines in your original script: Quote:
Whenever you're making a script, I'd highly suggest that you use dynamic pointers. It ensures that you don't overwrite anything in the ROM by accident and if you're trying to get help here, its easier for others to follow the script's structure. |
Thanks a lor DrFuji! I understood what you meant and can now proceed further!
The script I wrote had originally a dynamic offset command, but when I compiled the line disappeard, replaced by the offset the script went to and I just copypasted it. |
| All times are GMT -8. The time now is 9:13 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.