• 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✓] XSE's "hidesprite" command is uh, not hiding the sprite

  • 8
    Posts
    5
    Years
    • Seen May 25, 2020
    This is one of the simplest scripts imaginable, and I don't know why it isn't working. The sprite is the pokeball sprite used for every other "pickupable" item in the game. The player is supposed to activate it, the pokeball disappears, and then they get one of the event tickets, depending on which of the four items it is (eon ticket, mystic ticket, aurora ticket, or old sea map). The pokeball sprite should then stay disappeared if the player leaves the area.

    What's happening is, when I activate the item, I do get the ticket, however the pokeball does not disappear from the ground. I can keep reactivating it and getting the item again and again. I have literally no clue what is causing this, as the script really is very simple and there are very few places for errors to be introduced.

    Here's the script for the Eon Ticket:
    Code:
    #org 0x854386
    hidesprite 0x12
    giveitem 0x113 0x1 MSG_OBTAIN
    setflag 0x8B3
    setflag 0x23
    release
    end

    The script for the other tickets are identically structured, just with the person id, item id, and flags set to the appropriate values.

    First line is supposed to hide the sprite, you know, the way it does for literally every single item in the game except these ones for some reason. Second line gives the player one of whichever ticket it is. Third line is the flag to activate that particular ticket so that it is a selectable option when you try to sail from the boat lady. Fourth line is an unused flag (my scripts use unused flags 0x20 to 0x23 for the four tickets) that is set so that that item does not reappear when you reenter the area. (Fifth and sixth lines are release and end, which should require no explanation.)

    Again, my issue is not that the item reappears after disappearing; I know how to set a flag so that it stays gone. My issue is that the item never disappears the in the first place.

    Does anyone have any ideas why the hell this incredibly simple command, which I have used successfully in the past, is just flat out not working here?
     
    Last edited:

    masterquestmq

    Enthusiastic Rom Hacker
  • 194
    Posts
    13
    Years
    • Seen Nov 19, 2023
    This is one of the simplest scripts imaginable, and I don't know why it isn't working. The sprite is the pokeball sprite used for every other "pickupable" item in the game. The player is supposed to activate it, the pokeball disappears, and then they get one of the event tickets, depending on which of the four items it is (eon ticket, mystic ticket, aurora ticket, or old sea map). The pokeball sprite should then stay disappeared if the player leaves the area.

    What's happening is, when I activate the item, I do get the ticket, however the pokeball does not disappear from the ground. I can keep reactivating it and getting the item again and again. I have literally no clue what is causing this, as the script really is very simple and there are very few places for errors to be introduced.

    Here's the script for the Eon Ticket:
    Code:
    #org 0x854386
    hidesprite 0x12
    giveitem 0x113 0x1 MSG_OBTAIN
    setflag 0x8B3
    setflag 0x23
    release
    end

    The script for the other tickets are identically structured, just with the person id, item id, and flags set to the appropriate values.

    First line is supposed to hide the sprite, you know, the way it does for literally every single item in the game except these ones for some reason. Second line gives the player one of whichever ticket it is. Third line is the flag to activate that particular ticket so that it is a selectable option when you try to sail from the boat lady. Fourth line is an unused flag (my scripts use unused flags 0x20 to 0x23 for the four tickets) that is set so that that item does not reappear when you reenter the area. (Fifth and sixth lines are release and end, which should require no explanation.)

    Again, my issue is not that the item reappears after disappearing; I know how to set a flag so that it stays gone. My issue is that the item never disappears the in the first place.

    Does anyone have any ideas why the hell this incredibly simple command, which I have used successfully in the past, is just flat out not working here?


    Hmm, think the issue here is the hidesprite command. What is the person event no. on Advance Map?

    If it's 12, then the hidesprite command should read hidesprite 0xC (since all numbers in AM is read as a hex rather than decimal.

    Try this.

    If not, it could potentially be the flag you're using. I find using flags above 0x200 as a safe bet.

    Hope this helps!
     
  • 760
    Posts
    16
    Years
    • Seen yesterday
    The hidesprite command only hides the sprites for as long as the script is active, after you start walking again the sprite will reappear. You'll need to assign a flag to the item by setting a flag in the 'person id' in advancemap to keep it hidden. (Look at what the original games use as flags to be safe). If there's an item flag attached to the sprite, the 'giveitem' command will automatically hide the sprite and set the flag.

    Hope this helps...
     
    Last edited:
  • 8
    Posts
    5
    Years
    • Seen May 25, 2020
    The hidesprite command only hides the sprites for as long as the script is active, after you start walking again the sprite will reappear. You'll need to assign a flag to the item by setting a flag in the 'person id' in advancemap to keep it hidden. (Look at what the original games use as flags to be safe). If there's an item flag attached to the sprite, the 'giveitem' command will automatically hide the sprite and set the flag.

    Hope this helps...

    Thank you for the reply! I looked at some in-game "pickupable" items and they all had this format:

    Code:
    #org 0x2910CE
    giveitem 0x4D 0x1 MSG_FIND
    end

    Which was surprising to say the least, every tutorial I've watched had more complex scripts than that for picking up items. Do you think it's possible that I could copy this script format for my own as long as I use the same pokeball sprite? Or is this a case of vanilla content in the game having something, like, hard-wired about it that can't be replicated by external scripts?

    I'm quite new to this, so I don't even know how much I don't know about the intricacies of hacking, if you know what I mean.
     
  • 8
    Posts
    5
    Years
    • Seen May 25, 2020
    Hmm, think the issue here is the hidesprite command. What is the person event no. on Advance Map?

    If it's 12, then the hidesprite command should read hidesprite 0xC (since all numbers in AM is read as a hex rather than decimal.

    Try this.

    If not, it could potentially be the flag you're using. I find using flags above 0x200 as a safe bet.

    Hope this helps!

    Thank you very much for the reply! I was quite frustrated with not being able to get this working. I really did just forget to convert the person id to hex, I had never tried this in a scene with more than 9 person events before so I just didn't think about it. That's all a part of learning, and it really shows me how many little things there are that I don't know yet. Thank you!
     

    masterquestmq

    Enthusiastic Rom Hacker
  • 194
    Posts
    13
    Years
    • Seen Nov 19, 2023
    Thank you very much for the reply! I was quite frustrated with not being able to get this working. I really did just forget to convert the person id to hex, I had never tried this in a scene with more than 9 person events before so I just didn't think about it. That's all a part of learning, and it really shows me how many little things there are that I don't know yet. Thank you!

    No worries, hope it works now!

    Think we all have a lot to learn no matter how long you've been doing this you always find something new :)
     
    Back
    Top