The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script How to hide sprites until they are requireed for a script tile

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 January 28th, 2021 (2:48 AM).
DaleH771's Avatar
DaleH771 DaleH771 is offline
Wannabe comeback hacker
 
Join Date: Oct 2011
Gender: Male
Posts: 184
Hi all,

Thanks again to anybody who has helped me with a scripting query lately.

Another issue I have encountered...

I have a script tile which only becomes active after you defeat the third gym. The script activates after you exit the gym. Upon activation I want Prof Oak to walk into the players view, talk to the player, and then walk off and disappear again.

My issue: I inserted the Overworld for Prof Oak into AM, however I want the sprite to be hidden until the script is activated. Prof Oak's overworld should then be unhidden, he walks on screen, talks, walks off screen, becomes hidden again.

I can successfully remove the sprite but am struggling to keep the sprite as hidden before the script and only showing once the script begins. If I set the sprite to hidden in AM and use 'showsprite' this does not work. Prof Oak remains invisible.

I tried to use to 'movesprite' function but that does not seem to work? My logic here was that I could have Oak as non-hidden in the corner of the map, move his sprite at the start of the script, he walk on screen, talk, walk off screen and then disappear. All other aspects of the script work fine.

Any help with the 'movesprite' function or another alternative would be appreciated. My hacks pre-release is getting so close and I'm mega excited, just need to resolve a few issues like the above... Thanks all!
__________________
After ten years I've returned to my hack...!



https://www.pokecommunity.com/showthread.php?p=10288306#post10288306
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old January 28th, 2021 (2:30 PM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
Since prof. needs to be hidden until the third gym, here's what you can do:

1.) - in Advance Map, add a person event, and move Oak somewhere close to the gym, but outside field of view while exiting said gym so that he can
walk to the player without appearing out of nowhere.
- In the map where prof. is located, make a level script that hides prof's sprite, and sets his flag. Lets use flag 210 for example. (assign it in AM.)
- Lets say we use var number 4010 for that script tile, and var value of 0x1. (so it only activates after beating the third gym)
- The script won't activate after you beat the third gym, and after that event you can set the var value of var number 0x4010, to 0x1.

2.) - The level script should hide prof. if var value is 0x0 (the player didn't beat the third gym.) (hidesprite and setflag.)
- The level script should show/unhide Oak's ow if the var value is 0x1 (player has beaten the third gym.) (showsprite and clearflag.)
- The level script should hide Oak again, after the player talks to him, and the var number 0x4010 is set to var value of 0x2 (the script is no longer activated, or you can simply set the var number to 0x0 again, it doesn't matter.) (hidesprite and setflag.)

That should cover how to show and hide the sprite, now I'll try to explain the movesprite command and the "hidden" behaviour byte.

--- I'm not sure, but movesprite probably works on moving sprites that are in players field of view, try using movesprite2 for sprites that are outside players field of view.

--- If a sprite is hidden, and showsprite isn't working, it's most likely because "hidden" is a behaviour byte, and the sprite is technically still showing because it was never hidden with a command like "hidesprite". Another example of a behaviour byte (movement type) would be the "no movement" type, the first in the list. (value is 0x0).

So, if you want to move a sprite that's outside players field of view, and that has a movement type of "hidden", you could try using a "movesprite2" command along with something like "behaviour 0x[person event number] 0x[behaviour byte]" to change it from "hidden" to "no movement" to show it that way.
__________________
Pokemon NeonBlue:
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old January 30th, 2021 (12:28 PM).
DaleH771's Avatar
DaleH771 DaleH771 is offline
Wannabe comeback hacker
 
Join Date: Oct 2011
Gender: Male
Posts: 184
Quote:
Originally Posted by mcferaligatr View Post
Since prof. needs to be hidden until the third gym, here's what you can do....
Hey, thanks so much for the response! I’ll give this a go. I didn’t want to get level scripts involved but it may be my only solution then.
__________________
After ten years I've returned to my hack...!



https://www.pokecommunity.com/showthread.php?p=10288306#post10288306
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:18 AM.