The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script XSE's "hidesprite" command is uh, not hiding the sprite

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old August 20th, 2018 (11:35 AM). Edited August 20th, 2018 by PinkPrincessRei.
PinkPrincessRei PinkPrincessRei is offline
 
Join Date: Jul 2018
Gender: Female
Posts: 8
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?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old August 20th, 2018 (12:14 PM).
masterquestmq's Avatar
masterquestmq masterquestmq is offline
Enthusiastic Rom Hacker
 
Join Date: Nov 2010
Gender: Male
Posts: 193
Quote:
Originally Posted by PinkPrincessRei View Post
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!
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old August 20th, 2018 (2:28 PM). Edited August 20th, 2018 by kalarie.
kalarie kalarie is online now
 
Join Date: Jun 2008
Posts: 760
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...
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old August 20th, 2018 (6:51 PM).
PinkPrincessRei PinkPrincessRei is offline
 
Join Date: Jul 2018
Gender: Female
Posts: 8
Quote:
Originally Posted by kalarie View Post
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.
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old August 20th, 2018 (6:55 PM).
PinkPrincessRei PinkPrincessRei is offline
 
Join Date: Jul 2018
Gender: Female
Posts: 8
Quote:
Originally Posted by masterquestmq View Post
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!
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old August 21st, 2018 (1:42 AM).
masterquestmq's Avatar
masterquestmq masterquestmq is offline
Enthusiastic Rom Hacker
 
Join Date: Nov 2010
Gender: Male
Posts: 193
Quote:
Originally Posted by PinkPrincessRei View Post
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 :)
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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