- 32
- Posts
- 14
- Years
- Seen Dec 5, 2023
The var numbers for scripts on map tiles give those scripts unique identities. It's been my experience that some scripts don't like to run if they don't have a variable assigned to them (but I'm probably doing something wrong).minor said:A) what does altering the var number on tile scripts do? (the ones you walk on)
With a var number assigned to the script, you can "turn off" the script simple by assigning a different value to that variable in a script.
That is, a good way to ensure that a script only runs once (even after warping back into an area) is to include a line such as "setvar 0x5000 (or whatever your scripts assigned var is) 0x1"
As far as your other concerns, just by looking at your scripts I can't say for sure; however I can say that you do not need the "pause" line at all.
Setting flag 0x828 may or may not be the problem; it's the flag which enables the "Pokemon" section on the Start menu.
minor said:anyways here the script. appreciate it if you could point out what's wrong and how i can fix it? thanks.
checkflag 0x200
if 0x1 goto @done
faceplayer
msgbox @talk1 0x6
pause 0x1
message @talk2 0x5
callstd 1
if 0x1 goto @fight
else goto @no
end
I don't know that it's necessary, but put "lock" and "faceplayer" at the very beginning of script; there's no need for them anywhere else after, usually.
You entered "message" rather than "msgbox" before @talk2.
Instead of callstd 1, put in "compare LASTRESULT 0x1"; LASTRESULT is not a command, it's a variable where data is temporarily stored. In this case, the answer to the yes/no question.
Also, it looks like you assigned flag 0x200 to this fight/dialogue; make sure you have the script set that flag at some point, if you want it recognize that the fight has already occurred.