Banner
Views: 844,328,216
Time:
24 users online: 400Baud,  Anorakun, AntiDuck, autisticsceptile1993,  BeeKaaaay, brickblock369, elieltonl, EvanEMV, h.carrell, Hooded Edge, hsialin,  Koopster, Kori, Kusrry,  Maarfy, Paithus, SimFan96, Smibbix, Sonck's entertainment, steven3004, TheMorganah, wildertw33, Yoshimaster96, Zandro - Guests: 48 - Bots: 69 Users: 46,417 (2,766 active)
Latest: wildertw33
Tip: When determining a time limit, remember that players won't be as familiar with the level as you are. If you normally complete the level with the timer around 100, others might run out of time on their first try.Not logged in.
NPC Sprite seems to interfere with Dragon Coin saving in SA1 hack
Forum Index - SMW Hacking - SMW Hacking Help - NPC Sprite seems to interfere with Dragon Coin saving in SA1 hack
Pages: « 1 »
So I have been trying to figure this problem out for some time now. After a long time of testing and re testing I think I might have narrowed down the problem. The issue is that I want to be able save the dragon coins found in levels and have it show up on the overworld map that the coins were collected. I am working with an SA1 enabled rom, I am using the overworld counters patch, the individual dragon coin save patch, and applying bwram plus. Everything seems to work fine for the most part but I will occasionally have a level not register that all the coins were collected. What I finally figured out is that the NPC sprite seems to interfere with saving the dragons when spoken to in level. If you "talk" to the sprite and it is set to display a message that is set a different level number, the coins will not save once you beat the level. This does not happen if the message that the sprite displays is from a level number that the original game is programmed to read from. It only happens when it displays a custom message that you tell the sprite to read that is set to read from another level. This is done using the palette editor and setting the x position to match. I don't know if I am wording all of this clearly but I am sure that this NPC sprite is the culprit to the coin saving issue. I really want to use the NPC sprite but I can't figure out what is happening in the code to make it so that dragon coins won't save when the message is triggered. Any help with this would be greatly appreciated.


This is the npc sprite

https://pastebin.com/Y3NbaHFB

--------------------
I used to put Mario figures in the pipes of my basement to send them on adventures. Plumber dug em out 27 years later. Mission complete I'd say.
You've narrowed the problem down really well! Without having tested it, it looks like it's pretty much as you said. When the NPC sprite displays a message from another level, it tricks the game into thinking the current level number is something else, but it never restores the proper level number after it's done, so it leaves the dragon coin patch thinking you're in another level.

Here's a quick fix that might work. After print "INIT ",pc, add these lines:

Code
LDA $13BF|!Base2
STA !C2,x


and after ReturnZ:, add these:

Code
LDA !C2,x
STA $13BF|!Base2


Not sure how well this will work, especially when there are multiple NPCs on-screen at the same time, but it's worth a try.

(Also, thanks for reminding me that I've been meaning to remake those sprites sometime. The current ones are showing their age.)

--------------------


 
Well I tested it out. Good news is that it saves the coins now. Bad news is that it causes the npc to only read messages from the level it is in rather than being able to tell it to read from other levels. However, if you have it set to read 2 messages it will display the second message you tell it to read from.

--------------------
I used to put Mario figures in the pipes of my basement to send them on adventures. Plumber dug em out 27 years later. Mission complete I'd say.
So after playing around with I did find something that kinda works. If you put the second part of the routine you gave me where you said to put it, it resets the level data before the sprite can read from the right palette. However, I did find that if you put that same routine into any of the parts that handle the sprite's general movement it will work exactly as you would want it to. However, the issue is that it is only good if there is only one npc sprite on the screen. If there is more than one, the sprite will reset the other's palette before it can get the custom message out. You can have more than one npc in the same level but they have to be spaced far enough apart so that they don't show up together. I only have one case where I have 2 npc sprites on the screen at once that need to display messages so I just took the routine out of the stationary one. This is fine for my hack but I can't seem to find a solution to fix the overall problem so that other people can use it if they choose to have more than one npc on screen at a time.

--------------------
I used to put Mario figures in the pipes of my basement to send them on adventures. Plumber dug em out 27 years later. Mission complete I'd say.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - NPC Sprite seems to interfere with Dragon Coin saving in SA1 hack

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy