• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Reading a pointer from a custom table of pointers (to script bank)

222
Posts
6
Years
    • Seen Nov 18, 2023
    I'm working on a system that reads pointers from a table based on the value of a variable. I could probably just make a condition script, except for the fact that the variable in question will have hundreds of values throughout the game (it is the variable controlling the player's progress). Every pointer in the table I am making points to a string which will be used with a preparemsg command. It seems using loadpointer is the way to go but it does not accept variables. It would seem self-modifying code is the way to go here, where the script will custom-write a pointer based on the variable but I'm not sure where to go from here. No variation of writebytetooffset accepts variables either, so I can't dynamically write the self-modifying code to the part of the ROM where the loadpointer command is located. Do I need ASM for this? I doubt it, since what I'm trying to do is simple enough...

    Thanks for any insight on this.

    Edit: ASM is required, have most of it done. Just need to figure out how to access script banks in ASM...
     
    Last edited:
    Back
    Top