QUESTION: Is there a way to check if a pokemon is holding an item?
-When you enter a map, it looks for level scripts
-In Oaks Lab, the script your looking for is #2
-If it is a #2 or 4 script, it looks at the Variable Flag (for this, it is 4055)
-It checks that this Variable for its Value (set previously, default is 0000) and if it isn't equal to the number given in the Map script, it doesn't activate. But if it is equal, it does activate.
(if MAP-VALUE>VAR-VALUE=not activate, if MAP-VALUE<VAR-VALUE=not activate, if MAP-VALUE=VAR-VALUE=activate)
In the script tile that we step on in Pallet Town to activate the script, we see this.
This means the next time we enter the Oaks Lab, the script will activate.
But, why doesn't it activate again?
In the Oaks Lab Level script, we observe this
This make it so you don't see this script again until the Var Value is equal again.
People kind of act the same way, but with flags.
It works like thisIn fire red, oaks lab has a level script but doesnt activate when you walk in by yourself, only after oak makes you come in. How does this work? Does it have a checkflag or something?
-When you enter a map, it looks for level scripts
-In Oaks Lab, the script your looking for is #2
-If it is a #2 or 4 script, it looks at the Variable Flag (for this, it is 4055)
-It checks that this Variable for its Value (set previously, default is 0000) and if it isn't equal to the number given in the Map script, it doesn't activate. But if it is equal, it does activate.
(if MAP-VALUE>VAR-VALUE=not activate, if MAP-VALUE<VAR-VALUE=not activate, if MAP-VALUE=VAR-VALUE=activate)
In the script tile that we step on in Pallet Town to activate the script, we see this.
XSE:|LINE 0045| setvar 0x4055 0x1
This means the next time we enter the Oaks Lab, the script will activate.
But, why doesn't it activate again?
In the Oaks Lab Level script, we observe this
XSE:|LINE 0028| setvar 0x4055 0x2
This make it so you don't see this script again until the Var Value is equal again.
People kind of act the same way, but with flags.
Your welcome.Thanks for explaining that.I looked into it and seen it had something to do with the variable 4055,but i couldnt figure it all out.
Last edited: