![]() |
berries behavior in Berry forest in a npc script?
In FireRed, there are berries that sometimes spawn after every 512 steps in Berry Forest. Is it possible to see this same behavior in a script? I would like Lostelle to maybe (not always) give the player a random berry after every 512 steps. I know how to generate a random berry, but I don't know how to check or call for the amount of steps a player has taken.
Edit: So I tried playing around with a couple of "pedometer" vars that I found, but it seems like the only var that works is 0x4020, which is specifically used for repel. Is there another var I can use besides 0x4020 that won't roll over to 0x0 when it hits its set value? Here's a script I've tested with 0x4020. Spoiler:
EDIT: I figured out how to use 0x4023 which doesn't roll over back to 0x0 when it reaches its maximum value, which is 0x5DC. I had previously thought that all the pedometer vars counted downwards from the value I set. Turns out only 0x4020 (repel) counts downwards to 0x0 from the value I set, while 0x4023 counts upwards to the maximum value of 0x5DC from the value I set. The others (0x4021-0x4022) do roll over according to Spherical Ice with even shorter maximum values. Here's an example script that I finally got working. Spoiler:
0x4023 0x5DC is 1500 steps while 0x4023 0x3DC is 988 steps. Subtract the two and you'll end up with 512 steps. I will now make Lostelle give me a random berry- or not, every 512 steps I take! |
| All times are GMT -8. The time now is 9:14 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.