Skip to content

Commit

Permalink
Refactored to no longer use pages
Browse files Browse the repository at this point in the history
Refactored to use button shortcuts

Added mod menu access in the Answer dormitory save point

Fixed returning from velvet room to bring you back where you called it except for inside dungeons

Added flag toggling
  • Loading branch information
TekkaGB committed Dec 11, 2020
1 parent ce802b5 commit b953f78
Show file tree
Hide file tree
Showing 19 changed files with 282 additions and 199 deletions.
267 changes: 144 additions & 123 deletions DATA/FIELD/ModMenu.flow

Large diffs are not rendered by default.

85 changes: 35 additions & 50 deletions DATA/FIELD/ModMenu.msg
Original file line number Diff line number Diff line change
@@ -1,62 +1,33 @@
[sel Mod_Menu1]
[sel Mod_Menu]
[f 0 8 -258][f 1 31]Call Event[e]
[f 0 8 -258][f 1 31]Call Field[e]
[f 0 8 -258][f 1 31] Call Field[e]
[f 0 8 -258][f 1 31]Call Battle[e]
[f 0 8 -258][f 1 31]Next[e]

[sel Mod_Menu2]
[f 0 8 -258][f 1 31]Call BGM[e]
[f 0 8 -258][f 1 31] Call BGM[e]
[f 0 8 -258][f 1 31]Call Movie[e]
[f 0 8 -258][f 1 31]Call Floor[e]
[f 0 8 -258][f 1 31]Next[e]

[sel Mod_Menu3]
[f 0 8 -258][f 1 31]Facilities[e]
[f 0 8 -258][f 1 31] Call Floor[e]
[f 0 8 -258][f 1 31]Change Flag[e]
[f 0 8 -258][f 1 31] Facilities[e]
[f 0 8 -258][f 1 31]Fast Travel[e]
[f 0 8 -258][f 1 31]Save[e]
[f 0 8 -258][f 1 31]Exit[e]
[f 0 8 -258][f 1 31] Save[e]

[sel Facilities_Menu1]
[sel Facilities_Menu]
[f 0 8 -258][f 1 31]Velvet Room[e]
[f 0 8 -258][f 1 31]Police Station[e]
[f 0 8 -258][f 1 31] Police Station[e]
[f 0 8 -258][f 1 31]Aohige Pharmacy[e]
[f 0 8 -258][f 1 31]Next[e]

[sel Facilities_Menu2]
[f 0 8 -258][f 1 31]Shinshoudo Antiques[e]
[f 0 8 -258][f 1 31] Shinshoudo Antiques[e]
[f 0 8 -258][f 1 31]Be Blue V[e]
[f 0 8 -258][f 1 31]Back[e]
[f 0 8 -258][f 1 31]Exit[e]

[sel Num_Menu1]
[f 0 5 -258][f 1 31]0[e]
[f 0 5 -258][f 1 31]1[e]
[f 0 5 -258][f 1 31]Next[e]
[f 0 5 -258][f 1 31]Back[e]

[sel Num_Menu2]
[f 0 5 -258][f 1 31]2[e]
[f 0 5 -258][f 1 31]3[e]
[f 0 5 -258][f 1 31]Next[e]
[f 0 5 -258][f 1 31]Back[e]

[sel Num_Menu3]
[f 0 5 -258][f 1 31]4[e]
[f 0 5 -258][f 1 31]5[e]
[f 0 5 -258][f 1 31]Next[e]
[f 0 5 -258][f 1 31]Back[e]

[sel Num_Menu4]
[f 0 5 -258][f 1 31]6[e]
[f 0 5 -258][f 1 31]7[e]
[f 0 5 -258][f 1 31]Next[e]
[f 0 5 -258][f 1 31]Back[e]

[sel Num_Menu5]
[f 0 5 -258][f 1 31]8[e]
[f 0 5 -258][f 1 31]9[e]
[f 0 5 -258][f 1 31]Next[e]
[f 0 5 -258][f 1 31]Back[e]
[sel Num_Menu]
[f 0 5 -258][f 1 31] 0[e]
[f 0 5 -258][f 1 31] 1[e]
[f 0 5 -258][f 1 31] 2[e]
[f 0 5 -258][f 1 31] 3[e]
[f 0 5 -258][f 1 31] 4[e]
[f 0 5 -258][f 1 31] 5[e]
[f 0 5 -258][f 1 31] 6[e]
[f 0 5 -258][f 1 31] 7[e]
[f 0 5 -258][f 1 31] 8[e]
[f 0 5 -258][f 1 31] 9[e]

[msg Welcome]
[f 0 8 -258][f 1 31]Mod Menu[n][f 0 4][e]
Expand All @@ -73,6 +44,9 @@
[msg SelectID3]
[f 0 8 -258][f 1 31]I.D. (3 digits)[n][f 0 4][e]

[msg SelectFlag]
[f 0 8 -258][f 1 31]Flag (4 digits)[n][f 0 4][e]

[msg SelectPosition]
[f 0 8 -258][f 1 31]Entry point I.D. (2 digits)[n][f 0 4][e]

Expand All @@ -85,3 +59,14 @@
[sel YesNo]
[f 0 5 -258][f 1 31]Yes[e]
[f 0 5 -258][f 1 31]No[e]

[sel OnOff]
[f 0 5 -258][f 1 31]On[e]
[f 0 5 -258][f 1 31]Off[e]
[f 0 5 -258][f 1 31]Cancel[e]

[msg CurrentFlag]
[f 0 8 -258][f 1 31]Flag [f 0 3 0] is currently set to [f 0 3 1][n][f 0 4][e]

[msg FlagConfirmation]
[f 0 8 -258][f 1 31]Flag [f 0 3 0] set to [f 0 3 1][n][f 0 4][e]
Binary file added DATA/FIELD/PACK/BASE_f004.bf
Binary file not shown.
Binary file added DATA/FIELD/PACK/BASE_f008.bf
Binary file not shown.
Binary file added DATA/FIELD/PACK/F004_010.PAC
Binary file not shown.
Binary file modified DATA/FIELD/PACK/F007_002.PAC
Binary file not shown.
Binary file added DATA/FIELD/PACK/F008_003.PAC
Binary file not shown.
Binary file modified DATA/FIELD/PACK/F032_002.PAC
Binary file not shown.
Binary file added DATA/FIELD/PACK/f004.bf
Binary file not shown.
18 changes: 18 additions & 0 deletions DATA/FIELD/PACK/f004.bf.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

//
// FlowScript decompiled by AtlusScriptLib by TGE (2017)
// In the unfortunate case of any bugs, please report them back to me.
//


//
// Imports
//

import( "BASE_f004.bf" );
import ( "../ModMenu.flow" );

void save_point_hook()
{
ModMenuDisplay(3);
}
Binary file modified DATA/FIELD/PACK/f007.bf
Binary file not shown.
24 changes: 12 additions & 12 deletions DATA/FIELD/PACK/f007.bf.flow
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ void save_point_hook()
OPEN_MSG_WIN();
MSG( 167 );

if ( FUNCTION_0083() != 6 || FUNCTION_0080() == 1 && FUNCTION_0081() == 31 )
if ( FUNCTION_0083() != 6 || GET_MONTH() == 1 && GET_DAY_OF_MONTH() == 31 )
{
FUNCTION_0006( 2 );
SET_MASK( 2 );
}

FUNCTION_0028( 6, 2 );
SET_SEL_CHOICE_KEYBIND( 6, 2 );
int localVariable69 = SEL( ChangedPrompt );
CLOSE_MSG_WIN();

Expand All @@ -39,17 +39,17 @@ void save_point_hook()
else if ( localVariable69 == 1 )
{

if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 520 ) == 1 )
if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 520 ) == 1 )
{
OPEN_MSG_WIN();
MSG( 127 );
CLOSE_MSG_WIN();
return;
}
else if ( FUNCTION_0080() == 4 && FUNCTION_0081() == 7 || FUNCTION_0007( 0 + 0x0400 + 0x0800 + 14 ) == 0 )
else if ( GET_MONTH() == 4 && GET_DAY_OF_MONTH() == 7 || BIT_CHK( 0 + 0x0400 + 0x0800 + 14 ) == 0 )
{

if ( FUNCTION_0084( 4, 21, 1, 31 ) == 1 && FUNCTION_0007( 0 + 0x0400 + 0x0800 + 14 ) == 0 )
if ( CHECK_TIME_SPAN( 4, 21, 1, 31 ) == 1 && BIT_CHK( 0 + 0x0400 + 0x0800 + 14 ) == 0 )
{
OPEN_MSG_WIN();
MSG( 121 );
Expand All @@ -59,7 +59,7 @@ void save_point_hook()

OPEN_MSG_WIN();
MSG( 124 );
FUNCTION_0028( 6, 1 );
SET_SEL_CHOICE_KEYBIND( 6, 1 );

if ( SEL( 4 ) != 0 )
{
Expand All @@ -71,19 +71,19 @@ void save_point_hook()
}


if ( FUNCTION_0007( 0 + 0x0400 + 2021 ) == 0 && FUNCTION_0084( 4, 7, 4, 20 ) == 1 || FUNCTION_0084( 3, 1, 3, 5 ) == 1 )
if ( BIT_CHK( 0 + 0x0400 + 2021 ) == 0 && (CHECK_TIME_SPAN( 4, 7, 4, 20 ) == 1 || CHECK_TIME_SPAN( 3, 1, 3, 5 ) == 1) )
{
CMN_FUNCTION_0008( 0 + 0x0400 + 1538 );
BIT_ON( 0 + 0x0400 + 1538 );
OPEN_MSG_WIN();

if ( FUNCTION_0084( 4, 7, 4, 20 ) == 1 )
if ( CHECK_TIME_SPAN( 4, 7, 4, 20 ) == 1 )
{
MSG( 125 );
}
else if ( FUNCTION_0084( 3, 1, 3, 5 ) == 1 )
else if ( CHECK_TIME_SPAN( 3, 1, 3, 5 ) == 1 )
{

if ( FUNCTION_0007( 0 + 0x0400 + 1934 ) == 1 )
if ( BIT_CHK( 0 + 0x0400 + 1934 ) == 1 )
{
MSG( 126 );
}
Expand Down
Binary file added DATA/FIELD/PACK/f008.bf
Binary file not shown.
59 changes: 59 additions & 0 deletions DATA/FIELD/PACK/f008.bf.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

//
// FlowScript decompiled by AtlusScriptLib by TGE (2017)
// In the unfortunate case of any bugs, please report them back to me.
//


//
// Imports
//

import( "BASE_f008.bf" );

void out_velvet_room_hook()
{
FADE( 6, 30 );
FADE_SYNC();

if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 0 ) == 1 )
{
BIT_OFF( 0 + 0x0400 + 0x0800 + 0 );
CALL_FIELD( 8, 9, 1, 0 );
return;
}
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 1 ) == 1 )
{
BIT_OFF( 0 + 0x0400 + 0x0800 + 1 );
FUNCTION_0115( 1, 0 );
FUNCTION_0128( 1, 2 );
return;
}
else if ( BIT_CHK(7001) )
{
BIT_OFF(7001);
CALL_FIELD( 6, 3, 3, 0 ); // return to student with glasses
return;
}
else if ( BIT_CHK(7002) )
{
BIT_OFF(7002);
CALL_FIELD( 7, 2, 0, 0 ); // return to dorm entrance
return;
}
else if ( BIT_CHK(7003) )
{
BIT_OFF(7003);
CALL_FIELD( 4, 10, 8, 0 ); // return to dorm entrance (answer)
return;
}
else
{
OPEN_MSG_WIN();
MSG( TEST_ERROR );
CLOSE_MSG_WIN();
CALL_FIELD( 8, 9, 1, 0 );
return;
}

}
Binary file modified DATA/FIELD/PACK/f032.bf
Binary file not shown.
Binary file modified DATA/FIELD/SCRIPT/FIELD.BF
Binary file not shown.
17 changes: 9 additions & 8 deletions DATA/FIELD/SCRIPT/FIELD.BF.flow
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,46 @@ void field_order_party_hook()
// Choose between mod menu and regular field menu
OPEN_MSG_WIN();
MSG( Choose );
SET_SEL_CHOICE_KEYBIND(6,20);
int select = SEL( NewPrompt );
CLOSE_MSG_WIN();
if (select == 0)
{
ModMenuDisplay(0);
)
else
else if (select == 1)
{
if ( FUNCTION_01E9() == 1 && FUNCTION_0007( 0 + 0x0400 + 0x0800 + 498 ) == 1 )
if ( FUNCTION_01E9() == 1 && BIT_CHK( 0 + 0x0400 + 0x0800 + 498 ) == 1 )
{
fes_order_party();
return;
}
else if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 507 ) == 1 )
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 507 ) == 1 )
{
tutorial_order_party();
return;
}
else if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 572 ) == 1 )
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 572 ) == 1 )
{
f031_operation();
return;
}
else if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 610 ) == 1 )
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 610 ) == 1 )
{
f052_operation();
return;
}
else if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 702 ) == 1 )
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 702 ) == 1 )
{
f034_operation();
return;
}
else if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 799 ) == 1 )
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 799 ) == 1 )
{
f035_operation();
return;
}
else if ( FUNCTION_0007( 0 + 0x0400 + 0x0800 + 498 ) == 1 )
else if ( BIT_CHK( 0 + 0x0400 + 0x0800 + 498 ) == 1 )
{
tartaros_order_party();
return;
Expand Down
Binary file modified DATA/FIELD/SCRIPT/NPCCOMU.BF
Binary file not shown.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@
## How to access in game
Mod menus for other Persona games were only called by the square button function. However, I had to improvise since the square button function only worked inside Tartarus. Other methods of accessing the menu includes:
- Talking to the Student with Glasses in Classroom 2-F who normally let's you just Fast Travel around town.
- Save points in Dormitory and Tartarus Entrance
- Save points in Dormitory (including the Answer) and Tartarus Entrance

## Features
- Choose a Field, Event, BGM Track, Cutscene, Floor, or Facility to load.
- Toggle flags
- Save wherever you can access the Mod Menu.
- Access the Fast Travel map.
- More soon to come...

## Issues
- Due to Persona 3 FES's select menu not expanding as much as Persona 4 Golden and Persona 5's select menus, I resorted to creating many "pages" making it a bit of a hassle to get through.
- Cannot be used in conjunction with the pnach that enables the debug menu. Don't fret though because the Mod Menu can do what the debug menu does plus more.
- Going to the Velvet Room in Tartarus/Abyssal of Time will bring you back to the entrance when leaving until I find the functions I need.
- Cannot be used in conjunction with the pnach that enables the debug menu. Don't fret though because the Mod Menu can do what the debug menu does plus more. You can also turn the Flag on yourself in mod menu (4065)
- Saving inside Tartarus with the Mod Menu then loading will place you in the first floor of the block rather than the floor you saved on.

## Usage
You can use the [Mod Compendium](https://amicitia.github.io/post/modcompendium) to create modded archives containing the [latest compiled Release](https://github.com/ShrineFox/Persona-4-Golden-Mod-Menu/releases).
If you don't have your P3 FES setup for modding, I recommend using the HostFS method for PCSX2 which you can setup by following [this tutorial video](https://www.youtube.com/watch?v=0Jft05FbFLw&feature=youtu.be&ab_channel=ShrineFox).


## Compiling
1. Download the latest build of TGE's [AtlusScriptCompiler](https://ci.appveyor.com/project/TGEnigma/atlusscripttoolchain/build/artifacts) ([source](https://github.com/TGEnigma/AtlusScriptToolchain)), which you can use to compile the **.flow** and **.msg** scripts **DATA\FIELD\SCRIPT\NPCCOMU.BF.flow**, **DATA\FIELD\SCRIPT\FIELD.BF.flow**, **DATA\FIELD\PACK\f007.bf.flow**, and **DATA\FIELD\PACK\f032.bf.flow** in this repository and recompile them into **.bf** format.
2. Download this [P4G Library](https://github.com/Tupelov/Persona-Library) that includes some function names used in this menu. Extract it and overwrite the contents of the AtlusScriptTools\Libraries folder.
3. Also download [TGE's PAKTools](https://github.com/TGEnigma/AtlusFileSystemLibrary/releases).
4. To use the compiled bf's in-game, take out the extra .flow.bf at the end of the compiled files. Also repack the f007.bf into F007\_002.PAC and f032.bf into F032\_002.PAC using [Amicitia](https://github.com/TGEnigma/Amicitia/releases/tag/v1.9.5).
3. To use the compiled bf's in-game, take out the extra .flow.bf at the end of the compiled files. Also repack the f004.bf into F004\_010.PAC, f007.bf into F007\_002.PAC, f008.bf into F008\_003.PAC, and f032.bf into F032\_002.PAC using [Amicitia](https://github.com/TGEnigma/Amicitia/releases/tag/v1.9.5).

0 comments on commit b953f78

Please sign in to comment.