• Our software update is now concluded. You will need to reset your password to log in.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
Reaction score

Profile posts Latest activity Postings About

  • Understandable. ASM can have that really ugly look.

    Also, I think I made a mistake in my last couple of texts. I am not sure but I think "writebytetooffset (RAM address) (byte value to write at that address)" should be "writebytetooffset (byte value to write at that address) (RAM address)". Please make sure from XSE command lists!
    This is something I was unable to do using scripts alone.
    You can use "writebytetooffset (RAM address) (byte value to write at that address)" to put a constant value at the specified RAM address. But I couldn't transfer a variable's value like that. There might be a command to do so but I dont know which it is.

    It can be easily done using ASM, though. I can help you make something to accomplish the task if you want and if you are comfortable with using ASM.
    My bad! Yes you can do that too! You can use:
    "comparefarbytetobyte (RAM address) (value to compare to)
    if (condition) call/goto @somewhere"

    The limitation here is that you can only do one byte check using one comparefarbytetobyte. For the gender of player, it is okay because gender value is stored using only one byte. But the values of variable often takes up two bytes of spaces. If you want to compare something like that, then you have to compare bytes multiple times.

    The conditions to check here are same as the condition checks for the variable in my last message.
    Replying to your post in this thread because I did not want to mix up two topics there!

    Anyways, the variables can be directly manipulated in XSE without the use of their address.
    You can use something like: "setvar (variable number) (value)" to assign a value to a particular variable. Just like your example in the post, setvar 0x4001 0x00 will cause the variable 0x4001 to have value 0 stored in it.

    If you wish to use this value/variable for a different task, then you can use the following syntax:
    compare (variable to compare) (value to compare with)
    if (condition) call/goto @true

    There is a bit to explain here.
    "compare (variable to compare) (value to compare with)" is self-explanatory. If you write "compare 0x4001 0x0", then the game will check if variable 0x4001 is equal to 0, or greater than or less than 0, etc etc.

    The "(condition)" is the main focus here. In case of flags, there are only two options to check: set or cleared. That is why after a checkflag we do either "if 0x0 goto @somewhere" or "if 0x1 goto @somewhere"

    But the check for variables go even further. There can be values from 0x0 up to 0x5 over there. Each value has a different meaning:
    0x0 = Lower Than
    0x1 = Equals
    0x2 = Greater Than
    0x3 = Lower than or Equal to
    0x4 = Greater than or Equal to
    0x5 = Not exactly equal to

    Here is an example to clear things more. Say, you wanted to know if variable 0x4069 is greater than 0x5. If it is greater than 0x5, then the code would branch to a different portion. Then the comparison would be:
    compare 0x4069 0x5
    if 0x2 goto @otherpart

    You can also use 'call' in place of 'goto'. The difference between 'goto @there' and 'call @there' is:
    'goto @there' tells the code to just entirely branch off to the new location if the said condition is true and ignore everything below the goto line.
    'call @there' tells the code to go to the specified new location, do the stuffs written there and then come and continue executing orders from the line below the call line.

    I hope this helps! Sorry if the explanation has become a little too big! You can ask me for more help if needed! Also, there are some fantastic XSE script tutorials in Pokecommunity! You can check them out!
  • Loading…
  • Loading…
  • Loading…