• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Essentials Tutorial] Multiple Surf Themes

115
Posts
9
Years
  • Age 29
  • Seen Nov 17, 2023
As we all know, default essentials only allows us to define one surf theme for our entire game. But if you plan on having more than one region with different surf themes, or maybe just feel like having a different surf theme for a certain map, there is no way to accomplish this.

I was able to play around with a few of the scripts and figured out how to define the surf theme in each map's metadata. Please bear with me as there are multiple steps to this process.

1. In MiscData around line 114, add the highlighted line of code to this section:
Spoiler:

2. In Editor around line 3509, add the highlighted lines of code to this section:
Spoiler:
This will add a new field in the map's metadata for the map's surf theme.

3. PSystem_Utilities around line 1478-1481 insert the highlighted code underneath the def pbGetWildBattleBGM block:

Spoiler:

4. In PField_HiddenMoves around line 500, comment out surfbgm=pbGetMetadata(0,MetadataSurfBGM) and add the line surfbgm=pbGetSurfTheme underneath it:

Spoiler:

5. In PField_Field around line 1990 comment out the line surfbgm=pbGetMetadata($game_map.map_id,MetadataSurfTheme) and insert the line surfbgm=pbGetSurfTheme underneath it for BOTH pbAutoplayOnTransition AND FOR pbAutoplayOnSave YOU MUST DO THIS FOR BOTH OR ELSE THE SURF THEME WILL NOT PLAY CORRECTLY.

Spoiler:

That should be all you need to change. Now when you go into the editor and edit each map's metadata, there should be an extra field at the bottom of the list for the surf theme of that map.

b05m4We.png


WARNING: If you decide to go with this method, you will have to define a surf theme for every map that contains a surfable body of water. Otherwise it may not play anything when you surf.
 
150
Posts
8
Years
  • Age 31
  • Seen Jul 13, 2023
Very nice! You forgot one thing, though:

In MiscData, you need to initialize "MetadataSurfTheme". So around line 75~ you gotta add this:
Code:
MetadataMapWildVictoryME    = 16
MetadataMapTrainerVictoryME = 17
MetadataMapSize             = 18
[S-HIGHLIGHT]MetadataSurfTheme           = 19[/S-HIGHLIGHT]
I assume you just forgot to mention this part. :]
 
265
Posts
7
Years
  • Age 35
  • Seen Nov 19, 2023
This just might be what I've been searching for!!!!! Does this mean I can have a field battle background when battling in grass or against a trainer but if I'm surfing I'll get a different battle background? Please say this is so!!!!


:Edit: NVM realized this is for music. Is there a way to do this for battle backgrounds? I'm very new to game making so I'm not sure as to how to do this.
 
Last edited:
115
Posts
9
Years
  • Age 29
  • Seen Nov 17, 2023
This just might be what I've been searching for!!!!! Does this mean I can have a field battle background when battling in grass or against a trainer but if I'm surfing I'll get a different battle background? Please say this is so!!!!


:Edit: NVM realized this is for music. Is there a way to do this for battle backgrounds? I'm very new to game making so I'm not sure as to how to do this.

afaik you can only have one wild battle theme for each map, so if you have one route that is on land and the next route over is on water, you could do something like that, but you can't change the theme within the same map without some extra scripting.

As for trainer battle music, that's also defined per-map. You can in theory change certain trainer's music to whatever theme you want in trainertypes.txt, but it's based on trainer type, so if for example you define a bugcatcher's battle theme, it will apply to all bugcatchers in your game. Considering the swimmer trainer types are usually the only ones in water, you could just change the swimmer battle themes and pretty much all water-based trainer battles will have that unique theme.
 
Last edited:
265
Posts
7
Years
  • Age 35
  • Seen Nov 19, 2023
afaik you can only have one wild battle theme for each map, so if you have one route that is on land and the next route over is on water, you could do something like that, but you can't change the theme within the same map without some extra scripting.

As for trainer battle music, that's also defined per-map. You can in theory change certain trainer's music to whatever theme you want in trainertypes.txt, but it's based on trainer type, so if for example you define a bugcatcher's battle theme, it will apply to all bugcatchers in your game. Considering the swimmer trainer types are usually the only ones in water, you could just change the swimmer battle themes and pretty much all water-based trainer battles will have that unique theme.

So then this script is what I'm looking for then? Since setting the theme of a battle should then set the battle background as well?
 
115
Posts
9
Years
  • Age 29
  • Seen Nov 17, 2023
So then this script is what I'm looking for then? Since setting the theme of a battle should then set the battle background as well?

My script only allows you to set 1 surf theme per route, it has nothing to do with battles.

I made a suggestion to change swimmer trainer battle themes in the trainertypes.txt file that is included with default essentials, but having multiple battle themes per map based on if you're surfing/on land will require scripting which you would have to do on your own.
 
Last edited:
24
Posts
7
Years
  • Age 27
  • Seen Jan 17, 2024
I know that this is a late reply but I have to say this is an incredibly neat feature, especially when there are so many interesting underwater-environments that could be enhanced by special music.

By the way, would it be possible use a similar script for diving-themes as well?
 
Back
Top