- 239
- Posts
- 8
- Years
- Seen yesterday
[Pokeemerald] Custom Battle Transition Mugshots
This feature lets you add mugshot transitions for any trainer battle. It also lets you define custom battle transitions per trainer.
In order to keep the system as simple/flexible as possible, I've made the mugshot load based on a variable. Here is the repo to pull from.
How to add:
Setup:
Notes:
Hopefully this wasn't too complex. I tried to keep it as user-friendly as possible without adding too many variables/setup steps. Please report any bugs.
This feature lets you add mugshot transitions for any trainer battle. It also lets you define custom battle transitions per trainer.
In order to keep the system as simple/flexible as possible, I've made the mugshot load based on a variable. Here is the repo to pull from.
How to add:
- git remote add ghoul https://github.com/ghoulslash/pokeemerald
- git pull ghoul b_mugshot
Setup:
- add your mughot Id to include/constants/battle_transition.h. I've added MUGSHOT_MAY there as an example
[*]I've added two elements to the trainer data structure (in red below). In your trainer structure, set .hasCustomTransition to TRUE, and then set .transition to B_TRANSITION_MUGSHOT (Note, you can set the transition to anything you like and it will override the regular battle transition. Eg. give Wally a B_TRANSITION_REGISTEEL transition).
Code:struct Trainer { /*0x00*/ u8 partyFlags; /*0x01*/ u8 trainerClass; /*0x02*/ u8 encounterMusic_gender; // last bit is gender /*0x03*/ u8 trainerPic; /*0x04*/ u8 trainerName[12]; /*0x10*/ u16 items[4]; /*0x18*/ bool8 doubleBattle; /*0x1C*/ u32 aiFlags; /*0x20*/ u8 partySize; [COLOR="Red"] /*0x24*/ u8 transition:7; u8 hasCustomTransition:1;[/COLOR] /*0x28*/ union TrainerMonPtr party; };
- sMugshotsTrainerPicIDsTable
- sMugshotsOpponentRotationScales ({0x200, 0x200} should be fine, but dealer's choice)
- sMugshotsOpponentCoords ({0, 0} should be fine, but again its case-dependent)
- sOpponentMugshotsPals
- NOTE: you can use an existing palette from the elite four, or simply make your own palette using the existing mugshot tiles/palettes
Code:EventScript_BattleMay:: lockall faceplayer msgbox sText_SomeIntro, MSGBOX_DEFAULT setvar VAR_MUGSHOT_ID, MUGSHOT_MAY trainerbattle_no_intro TRAINER_MAY_ROUTE_103_TORCHIC, sText_MayLose
Notes:
- I had a palette loading issue when using sMugshotPal_Brendan and sMugshotPal_May together.
Hopefully this wasn't too complex. I tried to keep it as user-friendly as possible without adding too many variables/setup steps. Please report any bugs.