| Danny-E 33 |
November 26th, 2016 11:39 PM |
Quote:
Originally Posted by Eclaire Farron
(Post 9498579)
@Danny-E 33 Holy awesomesauce matee you finally done it!!!! I looking this improvement yellow version long time ago. Anyways before I play this my 1st question is it compatible in GBA mode!? 2nd question you intend not to include misty's portrait and sprite like you did in RED/BLUE?
|
It is not a GBA rom, but it will work on a GBA emulator that also supports GBC roms, such as VBA, as well as on a real GBA on a flashcart if the flashcart supports it.
Thanks for pointing out the Misty sprite.. Somehow I goofed. Not only did I forget to switch Misty's Yellow sprite to Misty's GSC sprite, I managed to replace it with Misty's Red/Blue sprite. I'll get this fixed and upload an update soon. Thanks for pointing it out!
Quote:
Originally Posted by longlostsoldier
(Post 9499354)
Ah, let's see if I can remember...
Okay, so, when I first wanted to change Pikachu's sprite, I simply looked for where it called PIKACHU_SPRITE. This led me to overworld/map_sprites.asm, and the routine LoadSpriteSetFromMapHeader and it looked like asking it to load based on a flag a different sprite should work. However when I modified it to alternatively call a Raichu sprite based on a flag, this ended up only working in some areas and not others.
I then went and looked at the sprite tables - there are a bunch of sprite tables for each outdoors map I think, and it looks like Pikachu is added to all of them. Modifying it, say replacing pikachu there with clefairy, led to being followed by that sprite in those areas instead. So my thought is that there must be two different methods for loading sprites in Yellow, based on whether you are indoors or outdoors, perhaps because outdoor sprites need to be able to change dynamically when you walk into the next area but indoor sprites do not as you only warp to new areas. I was hoping if you knew if that was the case or not. I haven't found a second routine that calls PIKACHU_SPRITE anywhere though.
|
Oh right, of course.
Your assumptions are pretty much correct.
All outdoor maps are assigned a sprite set. These sprites in a sprite set are the only sprites available once the map is loaded.
Indoor maps aren't given a sprite set. Instead, they basically load sprites "on demand".
To fix outdoor maps, you should tweak the end of the "InitOutsideMapSprites:" routine in engine/overworld/map_sprites.asm
That routine currently contains these lines:
Code:
ld c, a
ld b, 0
ld a, (wSpriteSetID - wSpriteSet)
ld hl, SpriteSets
call AddNTimes ; get sprite set offset
ld de, wSpriteSet
ld bc, (wSpriteSetID - wSpriteSet)
call CopyData ; copy it to wSpriteSet
call LoadMapSpriteTilePatterns
where register a contains the sprite set id minus 1.
After CopyData is called, [wSpriteSet] contains the value SPRITE_PIKACHU (because every single sprite set begins with SPRITE_PIKACHU).
So after the call to CopyData and before the call to LoadMapSpriteTilePatterns, you could add a few lines of code that checks to see if the player has Raichu and if so, overwrite the value at wSpriteSet with a different sprite id.
If you have any more questions on this, feel free to send me a pm or join our irc.
|