Skip to content

Commit

Permalink
Merge pull request #18 from TheBestAstroNOT/main
Browse files Browse the repository at this point in the history
Added Decompilation of Flowscripts for P3RE
  • Loading branch information
AnimatedSwine37 authored Dec 15, 2024
2 parents 5213310 + 1f4c372 commit 5a5a624
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 30 deletions.
53 changes: 29 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.4)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
ffi (1.15.5-x64-mingw-ucrt)
ffi (1.17.0-x64-mingw-ucrt)
ffi (1.17.0-x86_64-linux-gnu)
forwardable-extended (2.6.0)
google-protobuf (3.23.4-x64-mingw-ucrt)
google-protobuf (3.23.4-x86_64-linux)
google-protobuf (4.29.1-x64-mingw-ucrt)
bigdecimal
rake (>= 13)
google-protobuf (4.29.1-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jekyll (4.3.2)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -37,41 +42,41 @@ GEM
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-tabs (1.1.1)
jekyll-tabs (1.2.1)
jekyll (>= 3.0, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
just-the-docs (0.5.4)
jekyll (>= 3.8.5)
jekyll-seo-tag (>= 2.0)
rake (>= 12.3.1)
kramdown (2.4.0)
rexml
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.3)
rake (13.0.6)
public_suffix (6.0.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.1.2)
rexml (3.3.9)
rouge (4.5.1)
safe_yaml (1.0.5)
sass-embedded (1.64.1-x64-mingw-ucrt)
google-protobuf (~> 3.23)
sass-embedded (1.64.1-x86_64-linux-gnu)
google-protobuf (~> 3.23)
sass-embedded (1.82.0-x64-mingw-ucrt)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86_64-linux-gnu)
google-protobuf (~> 4.28)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)
unicode-display_width (2.6.0)
webrick (1.9.1)

PLATFORMS
x64-mingw-ucrt
Expand Down
6 changes: 5 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ games:
full_name: Persona 3 Portable
platform: PC

- short_name: P3RE
full_name: Persona 3 Reload
platform: PC

- short_name: P4G
full_name: Persona 4 Golden
platform: PC
Expand All @@ -50,4 +54,4 @@ games:

- short_name: P3F
full_name: Persona 3 FES
platform: PS2
platform: PS2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Now you've cloned your fork to your computer! You can see the files by clicking
## Running Locally
Before you start making changes it's a good idea to run the site locally, then you can see exactly how your changes will look as you make them.

This site is generated using [Jekyll](https://jekyllrb.com/) which uses [Ruby](https://www.ruby-lang.org/en/) so first you'll need to install Ruby **3.1.x**. For a comprehensive guide check out [Ruby's installation documentation](https://www.ruby-lang.org/en/documentation/installation/).
This site is generated using [Jekyll](https://jekyllrb.com/) which uses [Ruby](https://www.ruby-lang.org/en/) so first you'll need to install Ruby **3.2.x**. For a comprehensive guide check out [Ruby's installation documentation](https://www.ruby-lang.org/en/documentation/installation/).

{: .info }
> For Windows users the easiest way to do so is using [Ruby Installer](https://rubyinstaller.org/downloads/)
>
> Download the latest **Ruby+Devkit 3.1** file and run it (as of writing **Ruby+Devkit 3.1.4-1**)
> Download the latest **Ruby+Devkit** file and run it (as of writing **Ruby+Devkit 3.3.6-2**)
Once you've installed Ruby open up a terminal in the folder you cloned your fork to. Then to install Jekyll and this site's dependencies run the following two commands:

Expand All @@ -55,7 +55,7 @@ bundle exec jekyll serve
If all went well you can now go to [http://127.0.0.1:4000/persona-modding-docs/](http://127.0.0.1:4000/persona-modding-docs/) in your browser to see the site running locally.

{: .info }
> If you get an error that the `ffi` gem could not be found locally, double check that you're using Ruby **3.1.x** by running `ruby -v`. If you're on a newer version please downgrade to 3.1.
> If you get an error that the `ffi` gem could not be found locally, double check that you're using Ruby **3.2.x** by running `ruby -v`. If you're on a newer version please downgrade to 3.2.
Whenever you change a file from now on, the site will automatically update to reflect the changes although you will have to reload the page.

Expand Down Expand Up @@ -297,4 +297,4 @@ After you do so you'll be taken to a page where you need to enter some details a

The final thing to do is wait, the pr will be manually reviewed by someone (probably me, AnimatedSwine) and if everything's good it'll be merged into main for everyone to see.

If there are problems you may be asked to make changes, if this happens just do the same as before: make changes locally, commit, and push the changes and your pr will automatically update to include them.
If there are problems you may be asked to make changes, if this happens just do the same as before: make changes locally, commit, and push the changes and your pr will automatically update to include them.
70 changes: 70 additions & 0 deletions flowscript/p3re-pc/decompilation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Decompiling Flowscripts
layout: page
parent: P3RE Flowscript Editing
grand_parent: Flowscript
nav_order: 1
games: ['P3RE']
---

<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>

## Introduction

Flowscripts are responsible for handling logic during gameplay in almost all Persona games and several other Atlus entries. For example, enemy AI, setting and checking flags for displaying dialog, starting scripted battles etc. They are stored in BF_*.uasset files.

## Pre-requisites

There are a couple of options you can go with to decompile flowscripts but generally you should install FModel so you can find flowscripts in your game files if needed:
1. [**FModel**](https://github.com/4sval/FModel/releases/latest) is the go-to tool for viewing and extracting files from Persona 3 Reload. Select Unreal Engine 4.27 and make sure to enter the AES key / decryption key in Directory > AES: 0x92BADFE2921B376069D3DE8541696D230BA06B5E4320084DD34A26D117D2FFEE

2. [**Unreal Atlus Script**](https://gamebanana.com/mods/501844) is a mod you can install for the game which can dump all BMDs and BFs which are currently loaded ingame. It's a great tool to use if you know how to trigger the flowscripts. It is also the best way to add modified flowscripts to the game but that will be covered in the Compilation section.

3. [**Atlus Script GUI**](https://github.com/ShrineFox/AtlusScriptGUI) is an alternative to Atlus Script Tools. Although it uses atlus script tools to decompile the scripts it has a user friendly GUI which you can use to decompile the scripts you find via Fmodel. This is the easiest way to decompile flowscripts.

4. [**Atlus Script Tools Cli**](https://github.com/tge-was-taken/Atlus-Script-Tools) is the tool you should use if you have experience working in command prompt/powershell and need to decompile BF files that you find via Fmodel.

## Decompiling FlowScripts

### Using the Unreal Atlus Script Mod

1. After installing the mod, open Reloaded-II and navigate to your mods list for P3RE.

2. Now select the Unreal Atlus Script mod and click on configure mod

3. Then set Dump BFs to decompile, Decompile BF Endianess to Both and click on save.

4. Close the configuration window and launch the game. The mod will now dump any loaded BFs to the dump folder inside the Unreal Atlus Script mod folder. To navigate to it's mod folder select the mod and click on Open Folder.

![]({%link assets/images/flowscript/p3re-pc/UASSetting.png %})

### Using Atlus Script GUI

1. After installing Atlus Script GUI (Must be a newer version than v3.5). Launch the app and on the top right corner click on game and then select Persona 3 Reload from the list.

2. Now drag any BF_*.uasset file over the "Drag a .BF or .BMD to decompile" box.

![]({%link assets/images/flowscript/p3re-pc/AtlusScriptGuiGameSetting.png %})

### Using Atlus Script Tools Cli
After installing Atlus Script Tools (It is recommended that you add the program to your systems PATH so it can be accessed from any folder but not required.) use the following command to decompile a BF_*.uasset file.

{: .warning }
>Flowscripts can be decompiled using 2 different Outformats V4BE and V4. To figure out which one you need to try any one of them and if you get any errors during decompilation try the other outformat.
V4 Outformat Command:
```
AtlusScriptCompiler <Path to BF_*.uasset> -Decompile -Library P3RE -Encoding UTF-8 -OutFormat V4
```

V4BE Outformat Command:
```
AtlusScriptCompiler <Path to BF_*.uasset> -Decompile -Library P3RE -Encoding UTF-8 -OutFormat V4BE
```
10 changes: 10 additions & 0 deletions flowscript/p3re-pc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: P3RE Flowscript Editing
layout: page
parent: Flowscript
nav_order: 1
has_children: true
games: ['P3RE']
---

In this section we'll cover various methods for editing different types of assets related to the text in Persona 3 Reload.
2 changes: 1 addition & 1 deletion text/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ nav_order: 8
has_children: true
---

In the following sections will eventually be information on editing text I hope.
The following sections cover editing text assets and other similar assets for Persona games.
10 changes: 10 additions & 0 deletions text/p3re-pc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: P3RE Text Editing
layout: page
parent: Text
nav_order: 1
has_children: true
games: ['P3RE']
---

In this section we'll cover various methods for editing different types of assets related to the text in Persona 3 Reload.

0 comments on commit 5a5a624

Please sign in to comment.