• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Other] Error when using XSE and giving Pokeballs

CJBlazer

Rogon, the Ninja Pokemon
  • 72
    Posts
    13
    Years
    I don't get what I am doing wrong. I am editing this one trainer in Viridian Forest (the first one you see.). I want him to give you 5 Pokeballs when you talk to him and this is the script I used

    Spoiler:


    and this somehow becomes the result
    Spoiler:


    The last two lines glitch up for some reason. Is there a reason why they always combine? Am I doing something wrong?
     
    Don't see the error, try changing where the error is to a different color

    Also it's a lot easier if you post the original script.. All the numbers and stuff just annoying added text
     
    #org 0x160529 :(

    Why is the script inserted there? If the script is glitching it might be because it is overlapping/colliding with other information.

    Wait// Did you open this viridian forest trainer and just edit straight in? That'll be your problem.

    What you need to do is point new scripts at empty/available space - even if its an edit, as if you extend the script it'll overwrite the next one.

    Write your scripts like this:

    #dynamic 0x740000

    #org @start
    lock
    faceplayer
    checkflag 0x25E
    if 0x1 goto @flagisset
    msgbox 0x8190717 MSG_KEEPOPEN '"You don't have any Pokeballs?\nWel..."
    checkitemroom 0x160 0x1
    compare LASTRESULT 0x0
    if 0x1 goto @next
    ...etc...

    By using the dynamic command at the top you're asking XSE to find free space for each of your @pointers. If you do this any time you change/make an addition to a script (or making a brand new one) you shouldn't have problems with the script changing or deforming.

    Here is a useful scripting tutorial: https://www.pokecommunity.com/threads/164276
     
    Sorry, been out most of the week.

    I tried dynamic offset and it wont compile it. The error is at the end. The two strings collide with one another.

    this is another example. The same thing keeps happening

    Spoiler:


    The last two lines keep colliding with one another.
     
    Have you decompiled and changed them at all after the first compiling? Using a dynamic offset won't cause these problems unless you make a mistake afterwards. I find it curious that your main branch is at 0x1689BB though, doesn't look you used dynamic offset there? :(

    >>> Anyway, to fix this you need to either repoint the texts or delve in with a hex-editor and look where the actual problem lies. First is probably easiest, especially if you haven't used hex before.
     
    Last edited:
    0x1689BB is the trainer's script offset that I am editing. Thats why I am using that script.
     
    Back
    Top