The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script XSE's "hidesprite" command is uh, not hiding the sprite (https://www.pokecommunity.com/showthread.php?t=412759)

PinkPrincessRei August 20th, 2018 11:35 AM

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

masterquestmq August 20th, 2018 12:14 PM

Quote:

Originally Posted by PinkPrincessRei (Post 9915906)
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!

kalarie August 20th, 2018 2:28 PM

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...

PinkPrincessRei August 20th, 2018 6:51 PM

Quote:

Originally Posted by kalarie (Post 9915945)
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.

PinkPrincessRei August 20th, 2018 6:55 PM

Quote:

Originally Posted by masterquestmq (Post 9915913)
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 August 21st, 2018 1:42 AM

Quote:

Originally Posted by PinkPrincessRei (Post 9916007)
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 :)


All times are GMT -8. The time now is 9:14 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.