Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2018-07-17 04:03:39

rbroab
Member
Registered: 2017-06-13
Post 69/86

Crystal Blue Surf Sprite

Trying to change the surf sprite in Pokemon Crystal to always use the blue palette. Tired of seeing the red Lapras when playing as a male character. But I'm having trouble locating any type of script that dictates what color the surf sprite is. The surf sprite palette might be based on the palette of the character, in which case, would any know how to change the male sprite to use a blue palette while surfing?

Offline

#2 2018-07-17 16:31:22

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,550/3,580

Re: Crystal Blue Surf Sprite

You'd just want to track down the code that makes you start surfing and have it overwrite the player's palette ID as well with the Blue one. Then find the routine that changes you back, and make it restore the proper palette ID so you don't stay blue. Ironically, I've only done this in Gold (you're blue while surfing in Pokemon Christmas), haven't looked up the equivalent functions for Crystal yet to be able to tell you more specifically.

Offline

#3 2018-07-17 17:58:38

rbroab
Member
Registered: 2017-06-13
Post 72/86

Re: Crystal Blue Surf Sprite

I believe this is the code I should be looking at, correct? Where cp PLAYER_SURF is loading the surf sprite and PLAYER_SURF_PIKA is the Pikachu surf sprite but I don't need to worry about that.

Functionc922: ; c922 (3:4922)
    ld de, ENGINE_FOGBADGE
    call CheckBadge
    jr c, .asm_c956
    ld hl, BikeFlags
    bit 1, [hl] ; always on bike
    jr nz, .asm_c95c
    ld a, [PlayerState]
    cp PLAYER_SURF
    jr z, .asm_c959
    cp PLAYER_SURF_PIKA
    jr z, .asm_c959
    call GetFacingTileCoord
    call GetTileCollision
    cp $1
    jr nz, .asm_c95c
    call CheckDirection
    jr c, .asm_c95c
    callba CheckFacingObject
    jr c, .asm_c95c
    ld a, $1
    ret

I also just stumbled upon this, which I assume is important for changing the sprite back. So I'd just need a script to see if the character is set to male and then run the script to palette swap? Then run a similar script when returning to land?

WaterToLandSprite: ; 803f9
    push bc
    ld a, PLAYER_NORMAL
    ld [PlayerState], a
    call Functione4a ; UpdateSprites
    pop bc
    ret

And finally I found this. Some script and function about player palettes. Functionc225 is also used in reference to Kris's palette for trading in the pokemon center trade/battle colosseum. Unfortunately I don't exactly know what the function does or what the numbers in the script stand for.

SetPlayerPal:
    ld a, [ScriptVar] ; 1 - 8
    add $7 ; 8 - 15
    ld [wPlayerPalette], a
    swap a ; parameter for Functionc225
    ld [ScriptVar], a
    ret

callasm SetPlayerPal 
special Functionc225

Last edited by rbroab (2018-07-17 18:35:43)

Offline

#4 2018-07-17 18:44:45

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,552/3,580

Re: Crystal Blue Surf Sprite

You must be using an older version of pokecrystal for some reason, since those label names look really outdated. Why is that?

Offline

#5 2018-07-17 18:55:46

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,553/3,580

Re: Crystal Blue Surf Sprite

What I did in Gold was to hijack this script's equivalent and add a line that would be... (I think)

loadvar wPlayerPalette, 1

(since 1 is the blue OW palette). And then you'd need to set it back to Red (palette 0) when you get off surf (but check the gender first, since you don't want Kris turning Red if you're the girl). Once I'm free in a bit I'll look around harder and try this out anyway, since I want to add it to my pokecrystal hack anyway, and just hadn't gotten around to looking this stuff back up.

Last edited by Mateo (2018-07-17 18:56:12)

Offline

#6 2018-07-17 19:29:51

rbroab
Member
Registered: 2017-06-13
Post 73/86

Re: Crystal Blue Surf Sprite

If you take a look, let me know what you come up with. I can't find the script that sets the gender or if there are any calls back to that.

Yeah it's definitely outdated. I'm actually using the twitch plays pokemon anniversary crystal rom base. Something about starting in Kanto then ending up in Johto, story edits, added trainers, new dungeons and features was extremely appealing. I had just been making edits for personal use. Finally hit a wall and that's when I had discovered this whole community. But at that point I was thousands of edits in. No way I could simply port all of that into an updated version of pokecrystal. Most of the time I have to work backwards, and not much is labeled so I'm stuck using other bits around the script for context. It's been a pain.

Offline

Board footer

Powered by FluxBB