Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZ1337 committed Jun 14, 2024
1 parent 6a4efb1 commit 9d9b21c
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "papers-tools"
version = "0.1.0"
version = "1.0.0"
edition = "2021"
authors = ["creepycode"]

Expand Down
71 changes: 63 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,73 @@
# Papers Tools

## Unpacking `Art.dat`:
## Unpacking `sharedassets0.assets`:

```bash
./papers-tools -i ./Art.dat -o ./out -g /path/to/game/dir
./papers-tools -g /path/to/steamapps/common/PapersPlease unpack
```

## Packing a folder into the `Art.dat` format:
You can also pass the Art.dat file as the input directly.

## Patching

To overwrite textures, just put the new texture in the same path as the original one, with the same name. For example,
to replace the `RifleTranq.png` texture, put the new texture in `patch/assets/textures/RifleTranq.png`.
Editing xml files is also supported. The tool will merge your changes with the original file. Example for adding a new
paper (`patch/assets/data/Papers.xml`):

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<papers>
<paper id="ExamplePaper" outer="ExamplePaperOuter.png" reveal="fromslot" oddshape="true">
<page image="ExamplePaperInner.png"/>
</paper>
</papers>
```

for more information on the format, just check out the unpacked files.
Replacing audio files is also supported, but a separate json file is needed to map the original audio file to the new
one. Example (json path: `patch/audio_patches.json` audio path: `patch/audio/awp.fsb`):

```json
[
{
"objectName": "border-gunshot",
"patchedPath": "audio/awp.fsb",
"loadType": 0,
"channels": 2,
"frequency": 48000,
"bitsPerSample": 16,
"length": 4.642667,
"isTrackerFormat": false,
"subsoundIndex": 0,
"preloadAudioData": false,
"loadInBackground": false,
"legacy3d": true,
"compressionFormat": "adpcm"
}
]
```

Please note that the audio files need to be unity compatible fmod sound banks. Any other format will not work.

To apply the patch, run:

```bash
./papers-tools -i ./dir -o Art-modded.dat -g /path/to/game/dir
./papers-tools -g /path/to/steamapps/common/PapersPlease patch -p patch
```

The first folder will not be included in the asset names when packing. So make sure your folder structure is something like:
* `./dir/assets/some_texture.png`
* `./dir/assets/some_other_texture.png`
* `./dir/assets/fonts/some_font.fnt`
`-p patch` can be omitted if the patch is in the default path `patch`.

## Reverting

To revert the changes made by the patch, run:

```bash
./papers-tools -g /path/to/steamapps/common/PapersPlease revert
```

For less common used commands, check the built-in help:

```bash
./papers-tools -h
```
1 change: 1 addition & 0 deletions src/command/patch/audio_patcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub fn patch_audio(audio_patches_path: &PathBuf, game_dir: &PathBuf, repack_info
.context("Failed to get parent directory of audio patches file")?;

let mut offset = 0u64;
println!("Patching {} audio clips...", audio_patches.len());
for patch in &audio_patches {
if patch.patched_path.extension() != Some(OsStr::new("fsb")) {
anyhow::bail!("Only FSB files are supported for audio patches.");
Expand Down

0 comments on commit 9d9b21c

Please sign in to comment.