Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → [pokecrystal] How to disappear a sprite without it coming right back?

#1 2016-05-13 05:30:20

Rangi
Member
Registered: 2016-05-09
Post 4/809

[pokecrystal] How to disappear a sprite without it coming right back?

Long-term plan: rematch Gym Leaders in the Fighting Dojo on different days, like in HGSS. And use callbacks for other sorts of things.

Short-term plan: write a callback that makes the Black Belt's sprite disappear when you walk in (not even on a particular day; just, make it go away).

Here's my code, based on the UnionCaveB2F script for making Lapras show up:

FightingDojo_MapScriptHeader:
.MapTriggers:
    db 0
.MapCallbacks:
    db 1
    ; callbacks
    dbw MAPCALLBACK_OBJECTS, HideBlackBelt
HideBlackBelt:
    disappear FIGHTINGDOJO_BLACK_BELT
    ; jumptext UnknownText_0x189bc0
    ; waitbutton
    return

This doesn't work. When I walk in, the Black Belt is still there. I added the commented-out jumptext as a test, and he does disappear, but returns once the text box closes. (Actually, the text shows up twice, then there's a screen-shaking effect and it doesn't show up again.)

I've tried using "end" instead of "return" there, and using a trigger instead of a callback:

FightingDojo_MapScriptHeader:
.MapTriggers:
    db 1
    ; triggers
    dw HideBlackBelt, $0000
.MapCallbacks:
    db 0

None of those work.

My guess is that there's a corresponding file I need to edit, but nothing has an obvious name like "callbacks.asm". Any help, please?

(Once I do get it working, my plan is to have sixteen Gym Leader person events, and the callback will disappear all of them, then check the day and re-appear a particular few.)

Edit: If I replace "disappear FIGHTINGDOJO_BLACK_BELT" with "moveperson FIGHTINGDOJO_BLACK_BELT, $4, $8", it works as expected—the Black Belt is at a different location as soon as I walk in. Also, "disappear FIGHTINGDOJO_POKE_BALL" works. But trying to disappear the Black Belt, or a custom third sprite that's basically a copy+pasted Black Belt, doesn't.

Last edited by Rangi (2016-05-13 09:05:26)


ROM hack: Pokémon Polished Crystal (GitHub) — version 2.2.0 released!

Offline

#2 2016-05-13 22:31:18

Tauwasser
Member
Registered: 2010-10-16
Post 445/448

Re: [pokecrystal] How to disappear a sprite without it coming right back?

You can't hide people events in callback type 1 unless they have a flag id associated with them, because the events themselves haven't been loaded yet. You might try callback type 2, but it might not be permanent (saving and reloading). In general, if you want to permanently hide people events, you need to sacrifice a flag.

cYa,

Tauwasser

Offline

#3 2016-05-14 05:08:17

Rangi
Member
Registered: 2016-05-09
Post 5/809

Re: [pokecrystal] How to disappear a sprite without it coming right back?

Thanks a lot! It would have taken me quite a while to figure that out.

It also turns out that having 16 or more person events defined at once crashes the game. (The most an original map uses is 14 for TeamRocketBaseB2F and TeamRocketBaseB3F.) Still, that won't be a problem. Just have to make a few events and vary their sprites, since only 2 or 3 are needed at a time.

(The "variablesprite" macro is ideal for that. It's used in some... interesting ways in the original code, with things like SPRITE_OLIVINE_RIVAL being reused for swimmers after the rival event. I discovered this when I was Surfing around the Whirl Islands before triggering the event and thought the swimming rival sprites were a bug.)


ROM hack: Pokémon Polished Crystal (GitHub) — version 2.2.0 released!

Offline

  • Index
  • → Help/Question
  • → [pokecrystal] How to disappear a sprite without it coming right back?

Board footer

Powered by FluxBB