I already ruled out this method because there are a very limited amount of timers that the player gets access to. And since each honey tree would need its own timer, there would not be enough timers for it to work.
btw, my goal with all this honey tree stuff is to have a system in my hack that works similarly to that of D/P/Pt (lots of trees that can all keep track of when honey was slathered on them).
There may be something you can do even with a limited number of timers.
Don't start the timer when the tree is checked. Instead, always have the timer counting, and simply record the time at which the tree is checked.
So let's say I check the tree when the timer is, I don't know... Say 0x0123. And I want the honey to wear off in 0x1000. So when I check the tree, I'll store the current time (0x0123) in some variable. When I check it again later, I compare that variable's stored time to the
new current time, and if more than 0x1000 has passed, the honey wears off.
The only way this could break is if the timer loops around more than once between checking the trees. You'd need some kind of extra code (maybe a walking script?) to handle that emergency case.
But essentially,
Pseudocode for tree script
Code:
if tree flag is set:
// honey already applied
if (current time - tree var) > honey expiration time:
unset tree flag
else:
"There's already honey on this tree."
if tree flag is unset:
"Want to apply some honey?"
if yes:
set tree flag
tree var = current time
And you'd just use one flag and one scripting variable for each tree. (Also, running checks every ten or twenty steps via the walking script could prevent timer overflow from breaking the count. You'd just want to reserve tree flags and vars in advance, so you don't have to modify the walking script every single time you add a tree.)
Remember, though, that even in a cleared and script-free ROM, script vars are in short supply!
Thanks for the suggestion. :) I decompiled Daisy's script and found the part of the script with the special(s) that seem to have something to do with the "timer".
Code:
#org 0x168DB9
special 0x187
compare 0x800D 0x2
if 0x1 goto 0x81A7AE0
special 0x188
compare 0x4025 0x1F4
if 0x0 goto 0x8168E46
...
Wait... Compare 0x4025 to 0x1F4?
That's odd... There's a "secret" script that the game engine calls directly, when a save file is first created. It sets several flags
and it sets 0x4025 to 0x1F4.
And now we see that used in Daisy's script (how the hell did I miss that when making my list?). Weird.
Then I used JPAN's thread on the special and special2 commands in the R&D section to figure out what the specials are for. And...they didn't really make any sense to me...
Special 187 can be ignored. It's called by everything from legendary battles to PokeCenter nurses to, as you've discovered, Daisy. No idea what 188 does.