Conversation Between Entaro Ceraphenine and GokhanP
1 to 9 of 9
  1. Entaro Ceraphenine
    July 18th, 2020 6:35 PM
    Entaro Ceraphenine
    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!
  2. GokhanP
    July 18th, 2020 1:32 PM
    GokhanP
    Sorry for the late reply. I don't really wanna get into that ASM language or something. It's really beyond me . Thank you for your attention though. Really helped me out!
  3. Entaro Ceraphenine
    July 10th, 2020 5:52 AM
    Entaro Ceraphenine
    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.
  4. GokhanP
    July 10th, 2020 5:16 AM
    GokhanP
    Hey it's me again. I have one more question. What if I want to set a farbyte's value to another variable like 0x4001? It gives the error "Overflow" when I try to use the command "copyvar 0x02XXXXXX 0x4001". Is this possible though? Thanks.
  5. Entaro Ceraphenine
    July 8th, 2020 11:53 PM
    Entaro Ceraphenine
    You're welcome ^_^
  6. GokhanP
    July 8th, 2020 11:09 AM
    GokhanP
    Alright, that's what I was searching for. Thank you so much for that :)
  7. Entaro Ceraphenine
    July 8th, 2020 11:03 AM
    Entaro Ceraphenine
    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.
  8. GokhanP
    July 8th, 2020 10:43 AM
    GokhanP
    Thanks so much for this explanation. But my question was different. I asked if I can manipulate the RAM Variables (link) on a script.

    Let's say I want to check if gender is equal to male.

    [0x0300500C] + 0x0008 1b Gender (00/01 m/f)
    Here's the address of the value of the gender variable. I want to use this variable in my script. How can I do that? Do those addresses behave like normal variables like 0x4001?

    Thanks in advance.
  9. Entaro Ceraphenine
    July 8th, 2020 10:30 AM
    Entaro Ceraphenine
    Hello!
    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!