Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-11-28 16:16:24

~Red
Member
Registered: 2010-10-16
Post 271/276

Gen 1 - Changing an Overworld Map with a Flag

Would it be possible to load a different version of an overworld map when a certain flag is set? I want to go through the backstory of the cinnabar volcano, with cinnabar looking partially destroyed to begin with and then after defeating blaine in seafoam it switches to it's GSC map to show the procedural damage of the volcano.

Offline

#2 2016-11-29 04:25:15

Mmmmmm
Member
From: West Virginia
Registered: 2015-05-17
Post 184/260

Re: Gen 1 - Changing an Overworld Map with a Flag

Maybe you could alter the way map connections work to be able to load different map indexes based on whether flags are set. Before you get the Volcanobadge, it loads the old map when you get close to Cinnabar, but after you get it the game loads GSC Cinnabar.

Offline

#3 2016-11-30 00:56:29

Danny-E 33
Administrator
Registered: 2012-06-09
Post 999/1,048

Re: Gen 1 - Changing an Overworld Map with a Flag

I would probably start with LoadMapHeader: in home/overworld.asm

LoadMapHeader: reads from MapHeaderPointers: to find the header for the newly loaded map.
Edit that function so that if the newly loaded map is Cinnabar Island and if that flag is set, then replace the fetched address (CinnabarIsland_h:) with a different, hard coded address of a duplicate header.

This duplicate header for Cinnabar Island would be an exact copy of data/mapHeaders/cinnabarisland.asm, but replace the pointer to CinnabarIslandBlocks with a pointer to the alternate blocks data. (and possibly a different pointer to an alternate set of text pointers, scripts and objects, depending on how much you want to change)

Like Mmmmmm says, the way connections work would also have to be modified so that Cinnabar Island would be "previewed" correctly while standing within a connected map.

But getting the right map header loaded would be a good start.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#4 2016-11-30 22:22:49

~Red
Member
Registered: 2010-10-16
Post 272/276

Re: Gen 1 - Changing an Overworld Map with a Flag

Danny-E 33 wrote:

I would probably start with LoadMapHeader: in home/overworld.asm

LoadMapHeader: reads from MapHeaderPointers: to find the header for the newly loaded map.
Edit that function so that if the newly loaded map is Cinnabar Island and if that flag is set, then replace the fetched address (CinnabarIsland_h:) with a different, hard coded address of a duplicate header.

This duplicate header for Cinnabar Island would be an exact copy of data/mapHeaders/cinnabarisland.asm, but replace the pointer to CinnabarIslandBlocks with a pointer to the alternate blocks data. (and possibly a different pointer to an alternate set of text pointers, scripts and objects, depending on how much you want to change)

Like Mmmmmm says, the way connections work would also have to be modified so that Cinnabar Island would be "previewed" correctly while standing within a connected map.

But getting the right map header loaded would be a good start.

Since I'm removing the oak walks up to you script entirely (you get a pokemon a different way) I could use this flag elsewhere. Why does the new mapheader need to be hardcoded? I've already set up map $0B to have the new cinnabar version so I could just route it to that address surely?

Last edited by ~Red (2016-11-30 22:23:40)

Offline

#5 2016-12-02 22:41:30

Danny-E 33
Administrator
Registered: 2012-06-09
Post 1,000/1,048

Re: Gen 1 - Changing an Overworld Map with a Flag

Sure, you could do that too. At the beginning of LoadMapHeader: in home/overworld.asm, if the ID in [wCurMap] is CINNABAR_ISLAND and that flag is set, then replace [wCurMap] with $b.

You should take this kind of approach because you wouldn't have to make additional changes to blacking out or flying or other things that return you to Cinnabar Island that don't use map connections.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

Board footer

Powered by FluxBB