Tool HTML ScRepacker [v0.0.22] - Twine/Sugarcube game modding tool

nuqqur

Member
Donor
May 8, 2018
159
192
Overview

ScRepacker is a modding tool for Twine/Sugarcube games, supporting the following:
  • Extracting JS, CSS and passage files (in Twee v3 format) from Twine HTML file
  • Merging changed files back into Twine HTML file
    • Live merge option is available which monitors the source folder for changes and immediately rebuilds the HTML and reloads the page on every change
  • Generating a .diff file (basically a mod file) that contains all the changes made to game files, to distribute as mods
  • Applying mod (.diff) files to a Twine HTML file
    • Live patch option is available which injects UI to the HTML that allows toggling mods on and off
ScRepacker is a command-line utility, but it comes with scripts that you can drag&drop the HTML file onto, running the command specified in the script file name. It is mainly intended to be used via drag&drop, but can be used via terminal if someone finds that to be more convenient. Using the drag&drop scripts will open a terminal window showing the output. This window closes automatically if the command ran successfully, but remains open if any errors were encountered. The terminal output is not very detailed, but every time the utility is used, it saves a much more detailed log file in screpacker-logs directory.

Links

Git repository:
Releases (Mega):

Latest version: 0.0.22

You don't have permission to view the spoiler content. Log in or register now.

Supported environments

Only Windows and Linux binary releases will be published. I do not own any Apple devices so I cannot build, test or provide reliable instructions for using it on MacOS. However, the source code may be compatible with MacOS, so if anyone wants to try building it themselves from the source code, try it and let me know whether it works - I might some issues that break it on MacOS but I will not test that it keeps working for future releases.

This tool uses Git and GNU Patch internally, which are bundled with Windows releases, but are expected to be installed on Linux.

The tool should work on most Twine v3 games as it does not rely on specific story formats. I have mainly only used it one game though, and have not extensively tested it with various games, so if you encounter issues with other games, let me know so I could try and fix those.

Usage

No commands overwrite the original .html file. All new files/folders are created in the same folder as the .html.

Extracting
  • Drag&drop <game>.html onto screpacker-extract
  • If successful, the CSS/JS/passages will be extracted into src folder
You don't have permission to view the spoiler content. Log in or register now.

Merging
  • Make the changes you want to the CSS/JS/passage files in src
  • Drag&drop <game>.html onto screpacker-merge
  • If successful, <game>.merged.html file is created that includes the changes
You don't have permission to view the spoiler content. Log in or register now.

Export changes as mod
  • Make the changes you want to the CSS/JS/passage files in src, and optionally test them with merge feature
  • Drag&drop <game>.html onto screpacker-diff-default
  • If successful, mods/default.diff file is created, which can be shared with others to apply your changes to their game
You don't have permission to view the spoiler content. Log in or register now.

Apply mods
  • Put the mods (.diff files) you want to use in the mods directory
  • Drag&drop <game>.html onto screpacker-patch
  • If successful, <game>.modded.html file is created which has the mods applied to it


Merging (live reload)
  • Make sure game files are extracted to src folder
  • Drag&drop <game>.html onto screpacker-livemerge. The terminal window is supposed to stay open for as long as you wish live merge/reload to function
  • If successful, <game>.livemerged.html file is created
  • Open <game>.livemerged.html, optionally click on "Auto-Reload" button in the top left corner to enable auto-reload
  • Whenever you save any changes to files in src, <game>.livemerged.html is regenerated with those changes, and the page autoreloads if you enabled that, or you can manually reload
You don't have permission to view the spoiler content. Log in or register now.

Apply mods (with UI)
  • Add the mods you want to mods folder
  • Drag&drop <game>.html onto screpacker-livepatch. The terminal windows is supposed to stay open for as long as you wish the mod toggle UI to work
  • If successful, <game>.livepatched.html file is created
  • Open <game>.livepatched.html, click on the "MODS" button in top left corner, enable mods you want using the "S" button in front of each mod, and use the "Apply" button to apply them
  • The mod list automatically updates as you remove and add mod files to mods folder
You don't have permission to view the spoiler content. Log in or register now.
 
Last edited: