Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OW_AUTO_SIGNPOST and associated metatile behaviors #5044

Merged
merged 47 commits into from
Sep 21, 2024

Conversation

pkmnsnfrn
Copy link
Collaborator

@pkmnsnfrn pkmnsnfrn commented Jul 27, 2024

INCORPORATES A FEATURE BRANCH - DO NOT SQUASH!

Description

Player interacting with signpost with new metatile behaviors

  • Ported @ghoulslash's signpost branch to expansion
  • Added @ShinyDragonHunter's variant of FRLG's Message Box
  • Added OW_AUTO_SIGNPOST and matching metatile behaviors MB_SIGNPOST, MB_POKEMON_CENTER_SIGN, MB_POKEMART_SIGN, allowing players to replicate the behavior of signposts in FRLG.

Usage

OW_AUTO_SIGNPOST

In include/config/overworld.h, developers must set OW_AUTO_SIGNPOST to TRUE. This will also add three metatile behaviors to the existing list.

Metatile Behaviors

No tilesets within vanilla Emerald have been modified. Users will need to manually add the new metatile behaviors to the relevent metatiles.

Functionality

When OW_AUTO_SIGNPOST is enabled and the player walking into a space where they are facing north and facing a metatile with MB_SIGNPOST behavior, the following occurs:

  • The message box changes to match the sign message box from FRLG
  • The script assigned to that metatile automatically runs.
    • If the metatile behavior is MB_POKEMON_CENTER_SIGN or MB_POKEMART_SIGN, generic scripts for those signs are run.
  • After WALK_AWAY_SIGNPOST_FRAMES has elapsed, the player can walk away from the sign without finishing the scripts.

Sign Message Box

The message box from FRLG cannot directly be ripped, as the message box from FRLG and Emerald are slightly different sizes. This uses a modified version that was created by @ShinyDragonHunter.

Original Modified
Red reading the Route 1 Signpost Brendan reading the Petalburg City Signpost

Testing

Clean Branch

You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:

Patch

wget https://files.catbox.moe/a96tdk.patch -O signpost.patch ; git apply signpost.patch ; rm signpost.patch

Repo

git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion signpost

Manual Tests

After replicating the branch, to recreate my testing environment, you can either directly download the debug script and config file, or manually create the changes.

Download

wget https://files.catbox.moe/2mmvxp.bin -O data/tilesets/primary/general/metatile_attributes.bin && wget https://files.catbox.moe/sd7gwo.h -O include/config/overworld.h

Manual Testing

  • Open the config file and change OW_AUTO_SIGNPOST to TRUE.
  • Change the following metatile behaviors in the Primary Tileset:
    • The signpost to have MB_SIGNPOST.
    • The Pokémon Center tiles to have MB_POKEMON_CENTER_SIGN
    • The Pokémon Mart tiles to have MB_POKEMART_SIGN
  • Compile the game
  • Start a new save
  • Run Cheat Start
  • Leave the truck
  • Player should try
    • leaving the truck
    • walking up to the sign
    • presses A
    • walking away from and back towards the sign
    • walking away from sign before script finishes
    • walking towards Pokémon Center sign
    • walking away from sign before script finishes
    • walking towards Pokémon Mart sign
    • walking away from sign before script finishes

Verified Scenarios

All videos attempt to show the player:

  • leaving the truck
  • walking up to the sign
  • presses A
  • walking away from and back towards the sign
  • walking away from sign before script finishes
  • walking towards Pokémon Center sign
  • walking away from sign before script finishes
  • walking towards Pokémon Mart sign
  • walking away from sign before script finishes
signpost.mp4

People who collaborated with me in this PR

This was originally written by by @ghoulslash. The Emerald variant of FRLG's Message Box was created by @ShinyDragonHunter.

Discord Contact Info

I am pkmnsnfrn on Discord.

@pkmnsnfrn
Copy link
Collaborator Author

Feel free to squash anything AFTER (not including) 5657f83

src/metatile_behavior.c Outdated Show resolved Hide resolved
src/script.c Outdated Show resolved Hide resolved
@AlexOn1ine
Copy link
Collaborator

agbcc fails

@pkmnsnfrn pkmnsnfrn marked this pull request as ready for review July 27, 2024 22:47
@pkmnsnfrn
Copy link
Collaborator Author

Ready for review pending CI

@AlexOn1ine
Copy link
Collaborator

any reason the graphics changed?

@pkmnsnfrn
Copy link
Collaborator Author

any reason the graphics changed?

Are you referring to graphics/text_window/signpost.png and graphics/text_window/signpost.bin? If so, please see "Sign Message Box" in the PR desc

@Bassoonian Bassoonian added type: feature branch merge Update from feature branches and removed new-feature Adds a feature labels Aug 10, 2024
src/field_control_avatar.c Outdated Show resolved Hide resolved
src/field_control_avatar.c Outdated Show resolved Hide resolved
src/field_control_avatar.c Outdated Show resolved Hide resolved
src/script.c Outdated Show resolved Hide resolved
src/script.c Outdated Show resolved Hide resolved
@pkmnsnfrn pkmnsnfrn dismissed Bassoonian’s stale review August 28, 2024 03:04

answered feedback

src/field_control_avatar.c Outdated Show resolved Hide resolved
src/field_control_avatar.c Outdated Show resolved Hide resolved
src/field_control_avatar.c Outdated Show resolved Hide resolved
src/field_message_box.c Outdated Show resolved Hide resolved
src/scrcmd.c Outdated Show resolved Hide resolved
src/script.c Outdated Show resolved Hide resolved
@Bassoonian Bassoonian merged commit 8ba96fd into rh-hideout:upcoming Sep 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: overworld Pertains to out-of-battle mechanics type: feature branch merge Update from feature branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants