I am currently learning scripting (on Fire Red), and despite tutorials I can't find an answer to the following question : I get it (because I found a list of flags used by the game) that I can't set flags randomly ... But from my experiments, it seems to work to same for variables, and I can't find anywhere a list of variables used by the game ... is there any I would have missed ?
For the story (and maybe to make it a little clearer for you people, too), I was checking the game's scripts to figure out how the first battle against the rival was handled in Oak's Laboratory, especially how to prevent the green squares with a "S" in them (in Advance Map) to trigger the rival battle over and over again. At that time I only knew the "flag technique" to make something disappear from the map, but I couldn't find any setflag to do the trick ...
Through experiments I discovered that some setvar play was actually doing the job ... ! In that case, it's the variable n°4055, the value to trigger the battle being 3, so in the end the value is 4 to prevent the first rival battle from repeating itself. But in some other map, I lowered the value to 3 and went back to Laboratory ... and (as I feared) the battle is triggered again !
So here is my question (again) : the same way that flags do, variables' values seem to carry over from map to map if they're not cleared ... and it may become a cause of bugs since I don't plan to make a hack from scratches. So, is there anywhere a list of variables used by the game ? Or do I have to go through all the game's scripts to find out ?
Thanks in advance for the help (and my apologizes if I made mistakes, I'm French).
I believe this is what you want...A complete list of all the variables used in Firered, at least in scripts, courtesy of DavidJCobb.
What you've stumbled on is actually one of the best things a hacker could ask for...the ability to control scripts without using any flags. Some people will use this to make almost every script in their hack run on a single variable, freeing the other 254 or so variables for other uses. They manage to do this by making every script increment the variable by one, and since variables are two bytes, this means you can have 65,535 script events from one variable, way more than can be done with flags.