The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script What determines which person event is top of another while overlapping?

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 September 13th, 2019 (2:24 AM).
U.Flame's Avatar
U.Flame U.Flame is offline
Maker of Short Games
 
Join Date: Jun 2008
Location: Unknown
Age: 27
Gender: Male
Nature: Jolly
Posts: 1,322
In my script, there are 2 person events involved. One is a boulder, one is an NPC, and the NPC jumps over the boulder in the script. While they do so, the boulder appears to be on top of their sprite in the parts that overlap rather than their sprite being on top of the boulder. What determines which person event appears on top of the other during an overlap like this? I tried switching their events around to see if its a priority related to the event number, but nothing changed from that.
__________________
The more you learn about something, the more you realize just how much you don't know. I've shelved my more ambitious ideas in favor of smaller, more feasible projects and contributions. While I still have an ongoing project, and still intend to experiment with improving Gen 3's multiplayer, it's been much less stressful doing smaller things, like entries for Anthroyd's MAGM contests.

Of which you can check out here:
Naillevaihcam
Magical Altering Gym Menagerie
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old September 13th, 2019 (1:53 PM). Edited September 13th, 2019 by Anthroyd.
Anthroyd's Avatar
Anthroyd Anthroyd is offline
Professor
 
Join Date: May 2016
Location: United States
Gender: Male
Posts: 210
Which direction does your NPC "jump?" I believe the draw order depends on the sprite's y position on the screen. If your NPC is jumping "downward" then it'll appear "behind" the boulder until it reaches the midpoint of the boulder's sprite, then your NPC will be drawn "in front of" the boulder. If you jump from left to right or from right to left, your sprite will appear above the boulder always. If you jump from bottom to top, your sprite will appear above the boulder during the first half of the jump, then clip behind the boulder during the second half.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old September 13th, 2019 (8:22 PM).
U.Flame's Avatar
U.Flame U.Flame is offline
Maker of Short Games
 
Join Date: Jun 2008
Location: Unknown
Age: 27
Gender: Male
Nature: Jolly
Posts: 1,322
Quote:
Originally Posted by Anthroyd View Post
Which direction does your NPC "jump?" I believe the draw order depends on the sprite's y position on the screen. If your NPC is jumping "downward" then it'll appear "behind" the boulder until it reaches the midpoint of the boulder's sprite, then your NPC will be drawn "in front of" the boulder. If you jump from left to right or from right to left, your sprite will appear above the boulder always. If you jump from bottom to top, your sprite will appear above the boulder during the first half of the jump, then clip behind the boulder during the second half.
Interesting. The NPC is jumping from right to left, but appears behind the boulder. Could it maybe act differently when its an NPC instead of a player, or jumping because of an applymovenent command? Well if its due to the Y position, how can I go about manipulating that?
__________________
The more you learn about something, the more you realize just how much you don't know. I've shelved my more ambitious ideas in favor of smaller, more feasible projects and contributions. While I still have an ongoing project, and still intend to experiment with improving Gen 3's multiplayer, it's been much less stressful doing smaller things, like entries for Anthroyd's MAGM contests.

Of which you can check out here:
Naillevaihcam
Magical Altering Gym Menagerie
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old September 13th, 2019 (11:03 PM).
Anthroyd's Avatar
Anthroyd Anthroyd is offline
Professor
 
Join Date: May 2016
Location: United States
Gender: Male
Posts: 210
Quote:
Originally Posted by U.Flame
Interesting. The NPC is jumping from right to left, but appears behind the boulder. Could it maybe act differently when its an NPC instead of a player, or jumping because of an applymovenent command? Well if its due to the Y position, how can I go about manipulating that?
Hmm... try changing the movement to just walking from right to left. Does the NPC switch to being drawn in front of the boulder? If so, then it certainly is based off of the y position of the sprite, because the jumping animation moves the y position upwards, above the boulders, resulting in that drawing order. If you change it from just walking right to left and the boulder is still drawn in front, then I'm probably wrong about the whole y position thing.
__________________
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old September 13th, 2019 (11:28 PM). Edited September 14th, 2019 by U.Flame.
U.Flame's Avatar
U.Flame U.Flame is offline
Maker of Short Games
 
Join Date: Jun 2008
Location: Unknown
Age: 27
Gender: Male
Nature: Jolly
Posts: 1,322
Quote:
Originally Posted by Anthroyd View Post
Hmm... try changing the movement to just walking from right to left. Does the NPC switch to being drawn in front of the boulder? If so, then it certainly is based off of the y position of the sprite, because the jumping animation moves the y position upwards, above the boulders, resulting in that drawing order. If you change it from just walking right to left and the boulder is still drawn in front, then I'm probably wrong about the whole y position thing.
Yep, even walking they're still behind the boulder. I've tried every jump direction to no avail. It seems like the only time their sprite is in front is when standing directly underneath so the head is shown over the boulder. But all other movement seems to put them behind it.
__________________
The more you learn about something, the more you realize just how much you don't know. I've shelved my more ambitious ideas in favor of smaller, more feasible projects and contributions. While I still have an ongoing project, and still intend to experiment with improving Gen 3's multiplayer, it's been much less stressful doing smaller things, like entries for Anthroyd's MAGM contests.

Of which you can check out here:
Naillevaihcam
Magical Altering Gym Menagerie
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old September 17th, 2019 (5:16 PM). Edited September 17th, 2019 by U.Flame.
U.Flame's Avatar
U.Flame U.Flame is offline
Maker of Short Games
 
Join Date: Jun 2008
Location: Unknown
Age: 27
Gender: Male
Nature: Jolly
Posts: 1,322
I found a workaround, but I hesitate to call this solved since the base question of "what determines which sprite is shown on top of another" remains unanswered.

For my script, I made a duplicate tile that looks like a boulder, and swapped them around with setmaptile and movesprite commands. It works just like how I wanted it so that's good enough for me at least.
__________________
The more you learn about something, the more you realize just how much you don't know. I've shelved my more ambitious ideas in favor of smaller, more feasible projects and contributions. While I still have an ongoing project, and still intend to experiment with improving Gen 3's multiplayer, it's been much less stressful doing smaller things, like entries for Anthroyd's MAGM contests.

Of which you can check out here:
Naillevaihcam
Magical Altering Gym Menagerie
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

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:19 AM.