- 17
- Posts
- 6
- Years
- Seen Sep 23, 2020
I've run into an issue with the Map Scripts section in Advance map.
I want a script to execute when the player enters a house, and a variable is equal to either 1, 2 or 3. (Afterwards, the variable will be set to 4)
So I added 3 map scripts, each checking the value of variable 4055:
![[PokeCommunity.com] [AdvanceMap/XSE] Map/level scripts not running when they use the same variable with different value. [PokeCommunity.com] [AdvanceMap/XSE] Map/level scripts not running when they use the same variable with different value.](https://data.pokecommunity.com/attachments/12/12783-c38503b5e6bbb677397435570fdf9467.jpg)
(the only difference is map script number, the variable and value)
However, only script #1 will execute.
Any ideas how I can fix this?
I want a script to execute when the player enters a house, and a variable is equal to either 1, 2 or 3. (Afterwards, the variable will be set to 4)
So I added 3 map scripts, each checking the value of variable 4055:
![[PokeCommunity.com] [AdvanceMap/XSE] Map/level scripts not running when they use the same variable with different value. [PokeCommunity.com] [AdvanceMap/XSE] Map/level scripts not running when they use the same variable with different value.](https://data.pokecommunity.com/attachments/12/12783-c38503b5e6bbb677397435570fdf9467.jpg)
(the only difference is map script number, the variable and value)
However, only script #1 will execute.
- If 0x4055 equals to 1, the script will run.
- But if 0x4055 equals to 2 or 3, the script won't run.
- If I set the value box for script #1 to 0002 or 0003, the script will run when 0x4055 is either 2 or 3, respectively.
Any ideas how I can fix this?
Spoiler:
(if it helps, here's the map script offset and the relevant pointers)
Code:
#org 0x71A334
#raw 0x3
#raw pointer 0x8800400
#raw 0x2
#raw pointer 0x8168FE1
#raw 0x2
#raw pointer 0x8168FF0
#raw 0x2
#raw pointer 0x871A349
#raw 0x0
'--------------- Script #1
#org 0x168FE1
#raw word 0x4055
#raw word 0x1
#raw pointer 0x8800440
#raw word 0x0
'--------------- Script #2
#org 0x168FF0
#raw word 0x4055
#raw word 0x2
#raw pointer 0x8800440
#raw word 0x0
'--------------- Script #3
#org 0x71A349
#raw word 0x4055
#raw word 0x3
#raw pointer 0x8800440
#raw word 0x0
Last edited: