Skip to content

Commit

Permalink
Merge pull request #26 from AnimatedSwine37/main
Browse files Browse the repository at this point in the history
Update Readme + Bug Fixes
  • Loading branch information
TekkaGB authored Mar 2, 2022
2 parents 6bc63f4 + 0b9fe35 commit 454b958
Show file tree
Hide file tree
Showing 24 changed files with 174 additions and 80 deletions.
1 change: 1 addition & 0 deletions OtherMods/ConsistentReaper.flow
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import("../build/input/field/script/r_dungeon.bf");
import("ConsistentReaper.msg");

// Called whenever a treasure box spawns and determines what it is
Expand Down
4 changes: 4 additions & 0 deletions OtherMods/DungeonOptions/DungeonTravel.flow
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ void SelectFloor()

int nextFloor = selection + EntranceFloor;

// Turn on the "in dungeon" flag if we're entering the dungeon
if(floor == EntranceFloor && nextFloor != EntranceFloor)
BIT_ON( 3075 );

common_floor_change();

if (ConsitentReaper && ( nextFloor == 5 || nextFloor == 20 || nextFloor == 40 || nextFloor == 60 || nextFloor == 80 || nextFloor == 100 || nextFloor == 120 || nextFloor == 140 || nextFloor == 160 ))
Expand Down
2 changes: 1 addition & 1 deletion OtherMods/DungeonOptions/OrganizeParty.flow
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ int ChooseMember(int text, int mask)
bool EnableOrganizeParty()
{
// You can't switch party members until after you've saved Yukiko
if (CHECK_TIME_SPAN(4, 10, 4, 30) && BIT_CHK(0 + 0x0400 + 1569))
if (DATE_CHK(4,17) || (CHECK_TIME_SPAN(4, 10, 4, 30) && BIT_CHK(0 + 0x0400 + 1569)))
return false;

int availableMembers = 0;
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,24 @@ More features will continue to be added as game functions are discovered.
- QuickTravelPlus (extended quicktravel options in Yasogami High and around the town of Inaba)
- IntroSkip (start the game at 4/20)
- VRGameOverSkip (skips velvet room scene after game over) by [TekkaGB](https://github.com/TekkaGB) ([see mod release](https://gamebanana.com/gamefiles/13301))
- DungeonOptions (fast travel to any dungeon floor after deadline, heal, use goho-ms, organize party) by [TekkaGB](https://github.com/TekkaGB) ([see mod release](https://gamebanana.com/gamefiles/13356))
- DungeonOptions (fast travel to any dungeon floor after deadline, heal, use goho-ms, organize party, and more) by [TekkaGB](https://github.com/TekkaGB) ([see mod release](https://gamebanana.com/gamefiles/13356))
- SaveAnywhere by [Tupelov](https://github.com/Tupelov) ([see mod release](https://gamebanana.com/gamefiles/13318))
- FindAFriend by [AnimatedSwine37](https://gamebanana.com/members/1742760) ([see mod release](https://gamebanana.com/gamefiles/12921))
- ConsistentReaper by [TekkaGB](https://github.com/TekkaGB) ([see mod release](https://gamebanana.com/gamefiles/13381))
- Scooter Ride Count (adds a count that shows how many times you need to ride your scooter) [rudiger__gb](https://gamebanana.com/members/1491857)
- Dungeon Text Fixes by [rudiger__gb](https://gamebanana.com/members/1491857) ([see mod release](https://gamebanana.com/mods/50907))
- Remove Events by [AnimatedSwine37](https://gamebanana.com/members/1742760) ([see mod release](https://gamebanana.com/mods/50924))
- Save Everyday by [AnimatedSwine37](https://gamebanana.com/members/1742760) ([see mod release](https://gamebanana.com/mods/138058))
## Usage (PC)
1. Download and unzip [Aemulus Package Manager](https://gamebanana.com/tools/6878) and add the [latest compiled Release](https://github.com/ShrineFox/Persona-4-Golden-Mod-Menu/releases) to the "Packages" folder.
2. Point Aemulus to your P4G game directory's "mods" folder and build the Mod Menu in combination with any other mods you may want to install.
3. Use the [latest p4gpc.modloader](https://amicitia.github.io/post/p4g-pc-modloader) with [Reloaded II](https://github.com/Reloaded-Project/Reloaded-II/releases) to launch P4G with mods.
1. Follow the [Beginner's Guide to Modding Persona 4 Golden](https://gamebanana.com/tuts/13379) if you haven't already got mods setup for P4G.
2. Install this mod by dragging the [latest release](https://github.com/ShrineFox/Persona-4-Golden-Mod-Menu/releases/latest) of the mod into [Aemulus](https://github.com/TekkaGB/AemulusModManager/) or using the one click install on the [Gamebanana page](https://gamebanana.com/gamefiles/13256).
3. Build your Aemulus loadout with this mod enabled and play the game!
## Compiling the scripts yourself
You don't have to follow this section if you're merely installing the mod. This is for developers who want to make changes to the mod.
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 is used to compile the **.flow** and **.msg** scripts 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) which is used to repack BIN/PAK files.
4. Edit the build.bat file with the paths to your AtlusScriptCompiler and PAKTool exe files. Name your edited copy build_local.bat.
5. Place the **init_free.bin file from your copy of the game** in the build/input folder (see below).
6. Run build_local.bat.
2. Download [TGE's PAKTools](https://github.com/TGEnigma/AtlusFileSystemLibrary/releases) which is used to unpack BIN/PAK files.
3. Edit the build.bat file with the paths to your AtlusScriptCompiler and PAKTool exe files. Name your edited copy build_local.bat.
4. Place init_free.bin from your unpacked copy of the game (details on unpacking the game in the Unpacking Persona 4 Golden section of the [Beginner's Guide](https://gamebanana.com/tuts/13379)) into the build/input folder.
5. Run build_local.bat.

When you run the bat, the **field.bf** script will be recompiled into a new BF file including the Mod Menu (with the latest changes) and packed into a new init_free.bin.
- **field.bf** can be found in **init_free.bin** (extracted from data_e.cpk with [preappfile](https://amicitia.github.io/post/preappfile) or from data00004.pac with [NR2_unpacker](https://modworkshop.net/mod/17641).)
Now in your build/output folder you will have the entire compiled mod. You can copy this directly into an Aemulus package and then build your mods with Aemulus. If you'd like you can also just change the output path in your build_local.bat directly to your Aemulus package's folder so everything is immediately ready to build in Aemulus after you run build_local.bat.
60 changes: 16 additions & 44 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,29 @@ set BUILD_PATH=.\build
set INPUT_PATH=%BUILD_PATH%\input
set OUTPUT_PATH=%BUILD_PATH%\output

if exist "%OUTPUT_PATH%\data_e" rmdir /s /q "%OUTPUT_PATH%\data_e"
if exist "%OUTPUT_PATH%\tblpatches" rmdir /s /q "%OUTPUT_PATH%\tblpatches"
if not exist %BUILD_PATH% mkdir %BUILD_PATH%
if not exist %INPUT_PATH% mkdir %INPUT_PATH%
if not exist %OUTPUT_PATH% mkdir %OUTPUT_PATH%
if not exist %OUTPUT_PATH%\data_e mkdir %OUTPUT_PATH%\data_e
if not exist %OUTPUT_PATH%\data_e\init_free mkdir %OUTPUT_PATH%\data_e\init_free
if not exist %OUTPUT_PATH%\data_e\init_free\field mkdir %OUTPUT_PATH%\data_e\init_free\field
if not exist %OUTPUT_PATH%\data_e\init_free\field\script mkdir %OUTPUT_PATH%\data_e\init_free\field\script
if not exist %OUTPUT_PATH%\data_e\field mkdir %OUTPUT_PATH%\data_e\field
if not exist %OUTPUT_PATH%\data_e\field\pack mkdir %OUTPUT_PATH%\data_e\field\pack
if not exist %OUTPUT_PATH%\data_e\scheduler mkdir %OUTPUT_PATH%\data_e\scheduler
if not exist %OUTPUT_PATH%\tblpatches mkdir %OUTPUT_PATH%\tblpatches
if not exist "%OUTPUT_PATH%" mkdir "%OUTPUT_PATH%"
if not exist "%OUTPUT_PATH%\data_e" mkdir "%OUTPUT_PATH%\data_e"
if not exist "%OUTPUT_PATH%\data_e\init_free" mkdir "%OUTPUT_PATH%\data_e\init_free"
if not exist "%OUTPUT_PATH%\data_e\init_free\field" mkdir "%OUTPUT_PATH%\data_e\init_free\field"
if not exist "%OUTPUT_PATH%\data_e\init_free\field\script" mkdir "%OUTPUT_PATH%\data_e\init_free\field\script"
if not exist "%OUTPUT_PATH%\data_e\field" mkdir "%OUTPUT_PATH%\data_e\field"
if not exist "%OUTPUT_PATH%\data_e\field\pack" mkdir "%OUTPUT_PATH%\data_e\field\pack"
if not exist "%OUTPUT_PATH%\data_e\field\script" mkdir "%OUTPUT_PATH%\data_e\field\script"
if not exist "%OUTPUT_PATH%\data_e\scheduler" mkdir "%OUTPUT_PATH%\data_e\scheduler"
if not exist "%OUTPUT_PATH%\tblpatches" mkdir "%OUTPUT_PATH%\tblpatches"

%PAKPACK% unpack "%INPUT_PATH%\init_free.bin"
%PAKPACK% unpack "%INPUT_PATH%\field\pack\fd007_001.arc"
%PAKPACK% unpack "%INPUT_PATH%\field\pack\fd007_002.arc"
%PAKPACK% unpack "%INPUT_PATH%\field\pack\fd010_002.arc"
%PAKPACK% unpack "%INPUT_PATH%\field\pack\fd020_001.arc"
%PAKPACK% unpack "%INPUT_PATH%\field\pack\fd023_001.arc"

%COMPILER% .\init_free\field.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\init_free\field\script\field.bf" -Hook
%COMPILER% .\field\dungeon.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\script\dungeon.bf" -Hook
%COMPILER% .\field\dungeon01.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\script\dungeon01.bf" -Hook
%COMPILER% .\field\lmap.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\script\lmap.bf" -Hook
%COMPILER% .\field\f007.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\pack\fd007_001\f007.bf" -Hook
%COMPILER% .\field\f007_002.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\pack\fd007_002\f007.bf" -Hook
%COMPILER% .\field\f010.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\pack\fd010_002\f010.bf" -Hook
%COMPILER% .\field\f020.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\pack\fd020_001\f020.bf" -Hook
%COMPILER% .\field\f023.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\pack\fd023_001\f023.bf" -Hook
%COMPILER% .\scheduler\scheduler_01.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_01.bf" -Hook
%COMPILER% .\scheduler\scheduler_02.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_02.bf" -Hook
%COMPILER% .\scheduler\scheduler_03.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_03.bf" -Hook
%COMPILER% .\scheduler\scheduler_04.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_04.bf" -Hook
%COMPILER% .\scheduler\scheduler_05.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_05.bf" -Hook
%COMPILER% .\scheduler\scheduler_06.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_06.bf" -Hook
%COMPILER% .\scheduler\scheduler_07.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_07.bf" -Hook
%COMPILER% .\scheduler\scheduler_08.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_08.bf" -Hook
%COMPILER% .\scheduler\scheduler_09.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_09.bf" -Hook
%COMPILER% .\scheduler\scheduler_10.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_10.bf" -Hook
%COMPILER% .\scheduler\scheduler_11.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_11.bf" -Hook
%COMPILER% .\scheduler\scheduler_12.bf.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\scheduler\scheduler_12.bf" -Hook
%COMPILER% .\OtherMods\ConsistentReaper.flow -Compile -OutFormat V1 -Library P4G -Encoding P4 -Out "%OUTPUT_PATH%\data_e\field\script\dungeon.bf" -Hook

Xcopy /E /I /Y .\field "%OUTPUT_PATH%\data_e\field"
copy .\OtherMods\IntroSkip.flow "%OUTPUT_PATH%\data_e\field\pack\fd020_001\IntroSkip.bf.flow"

del /s /q "%INPUT_PATH%\init_free\*"
rmdir /s /q "%INPUT_PATH%\init_free"
del /s /q "%INPUT_PATH%\field\pack\fd007_001\*"
rmdir /s /q "%INPUT_PATH%\field\pack\fd007_001"
del /s /q "%INPUT_PATH%\field\pack\fd007_002\*"
rmdir /s /q "%INPUT_PATH%\field\pack\fd007_002"
del /s /q "%INPUT_PATH%\field\pack\fd010_002\*"
rmdir /s /q "%INPUT_PATH%\field\pack\fd010_002"
del /s /q "%INPUT_PATH%\field\pack\fd020_001\*"
rmdir /s /q "%INPUT_PATH%\field\pack\fd020_001"
del /s /q "%INPUT_PATH%\field\pack\fd023_001\*"
rmdir /s /q "%INPUT_PATH%\field\pack\fd023_001"
copy .\tblpatches\MSG_Patches.tbp "%OUTPUT_PATH%\tblpatches\MSG_Patches.tbp"
Binary file removed build/input/field/pack/fd007_001.arc
Binary file not shown.
Binary file removed build/input/field/pack/fd010_002.arc
Binary file not shown.
Binary file removed build/input/field/script/dungeon.bf
Binary file not shown.
Binary file removed build/input/scheduler/scheduler_04.bf
Binary file not shown.
14 changes: 0 additions & 14 deletions field/dungeon.bf.flow

This file was deleted.

2 changes: 0 additions & 2 deletions field/f020.bf.flow

This file was deleted.

4 changes: 2 additions & 2 deletions field/f007.bf.flow → field/pack/fd007_001/f007.flow
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Imports
//

import( "../build/input/field/pack/fd007_001/f007.bf" );
import( "f007.bf.msg" );
import( "f007.bf" );
import( "f007.msg" );

//
// Script-level variable definitions
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion field/f007_002.flow → field/pack/fd007_002/f007.flow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import("../build/input/field/pack/fd007_002/f007.bf");
import("f007.bf");

void door_entrance_hook()
{
Expand Down
4 changes: 2 additions & 2 deletions field/f010.bf.flow → field/pack/fd010_002/f010.flow
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Imports
//

import( "../build/input/field/pack/fd010_002/f010.bf" );
import( "f010.bf.msg" );
import( "f010.bf" );
import( "f010.msg" );

//
// Procedure declarations
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions field/pack/fd020_001/f020.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import( "f020.bf" );
import( "IntroSkip.bf.flow" );
2 changes: 1 addition & 1 deletion field/f023.bf.flow → field/pack/fd023_001/f023.flow
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Imports
//

import( "../build/input/field/pack/fd023_001/f023.bf" );
import( "f023.bf" );

//
// Procedure declarations
Expand Down
File renamed without changes.
43 changes: 43 additions & 0 deletions field/script/fc0.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import("fc0.bf");

void foodCourt_init_hook()
{
// BIT_ON(1556); // Make it so party s links don't become unavailable if you go to the food court and leave

if ((GET_WEATHER() == 1) || (GET_WEATHER() == 7))
{
FLD_FUNCTION_0007(10244, 1);
}
else
{
FLD_FUNCTION_0007(10244, 0);
}

if ((CHECK_TIME_SPAN(12, 8, 3, 31) == 1) && (BIT_CHK(23) == 0))
{
FLD_FUNCTION_0007(10243, 1);
}
else
{
FLD_FUNCTION_0007(10243, 0);
}

if (DATE_CHK(8, 18) == 1)
{
FLD_FUNCTION_0007(10245, 1);
FLD_FUNCTION_0007(10247, 0);
}
else
{
FLD_FUNCTION_0007(10245, 0);
FLD_FUNCTION_0007(10247, 1);
}

FLD_FUNCTION_0007(10246, 0);
FLD_FUNCTION_0007(10257, 0);

if (CHECK_TIME_SPAN(7, 11, 3, 31))
{
FLD_FUNCTION_0008(10242, 1, 0, 0, 1);
}
}
43 changes: 43 additions & 0 deletions field/script/fc1.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import("fc1.bf");

void foodCourt_init_hook()
{
// BIT_ON(1556); // Make it so party s links don't become unavailable if you go to the food court and leave

if ((GET_WEATHER() == 1) || (GET_WEATHER() == 7))
{
FLD_FUNCTION_0007(10244, 1);
}
else
{
FLD_FUNCTION_0007(10244, 0);
}

if ((CHECK_TIME_SPAN(12, 8, 3, 31) == 1) && (BIT_CHK(23) == 0))
{
FLD_FUNCTION_0007(10243, 1);
}
else
{
FLD_FUNCTION_0007(10243, 0);
}

if (DATE_CHK(8, 18) == 1)
{
FLD_FUNCTION_0007(10245, 1);
FLD_FUNCTION_0007(10247, 0);
}
else
{
FLD_FUNCTION_0007(10245, 0);
FLD_FUNCTION_0007(10247, 1);
}

FLD_FUNCTION_0007(10246, 0);
FLD_FUNCTION_0007(10257, 0);

if (CHECK_TIME_SPAN(7, 11, 3, 31))
{
FLD_FUNCTION_0008(10242, 1, 0, 0, 1);
}
}
43 changes: 43 additions & 0 deletions field/script/fc2.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import("fc2.bf");

void foodCourt_init_hook()
{
// BIT_ON(1556); // Make it so party s links don't become unavailable if you go to the food court and leave

if ((GET_WEATHER() == 1) || (GET_WEATHER() == 7))
{
FLD_FUNCTION_0007(10244, 1);
}
else
{
FLD_FUNCTION_0007(10244, 0);
}

if ((CHECK_TIME_SPAN(12, 8, 3, 31) == 1) && (BIT_CHK(23) == 0))
{
FLD_FUNCTION_0007(10243, 1);
}
else
{
FLD_FUNCTION_0007(10243, 0);
}

if (DATE_CHK(8, 18) == 1)
{
FLD_FUNCTION_0007(10245, 1);
FLD_FUNCTION_0007(10247, 0);
}
else
{
FLD_FUNCTION_0007(10245, 0);
FLD_FUNCTION_0007(10247, 1);
}

FLD_FUNCTION_0007(10246, 0);
FLD_FUNCTION_0007(10257, 0);

if (CHECK_TIME_SPAN(7, 11, 3, 31))
{
FLD_FUNCTION_0008(10242, 1, 0, 0, 1);
}
}
4 changes: 2 additions & 2 deletions field/lmap.bf.flow → field/script/lmap.flow
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Imports
//

import( "../build/input/field/script/lmap.bf" );
import( "lmap.bf.msg" );
import( "lmap.bf" );
import( "lmap.msg" );

//
// Procedure declarations
Expand Down
File renamed without changes.

0 comments on commit 454b958

Please sign in to comment.