So I'm muddling through scripting, and I've hit a snag. I want the script to run as you enter your rival's house for the first time, but putting it on the warp only activates it as you leave.
This is alright with me, as I'm more interested in why it's running twice even with the proper flags set.
This is what I have so far:
#org 0x8740A71
'-----------------------------------
lock
checkflag 0x1000
if true jump 0x8740B77 ' Flag is set
msgbox 0x8740A8F ' \v\h06:Hey \v\h01! I...
callstd MSG_LOCK ' Built-in lock command
release
applymovement 0x1 0x8740B79 ' walk_down walk_down ...
setflag 0x1000
end
#org 0x8740B77
'-----------------------------------
release
end
#org 0x8740A8F
= \v\h06:Hey \v\h01! I finally decided.\nI'm outta here!\pYou can tag along\nif you like. I'm going\pto pester Mr. Boone\nfor a pokemon, and then\pI'm off to see the world.\nYou should do the same.\pUnless you LIKE squatting\nin an abandoned house...
#org 0x8740B79
M walk_down walk_down walk_down walk_down walk_left walk_down walk_down walk_down end
The problem with this is that though the script runs correctly when you step on the tile to leave, if you immediately head back into the room and approach it from the east or west sides it runs the dialogue again.
X=the script tile:
V
X
Approaching it here, the script runs fine. Then if you approach the tile like this:
>X
Or X<
It runs the script again, despite the flag being set.
Any thoughts?