Skip to content
Loom0.1.0
Source

Guides

Modding Whiskerwood

Set up the Whiskerwood mod kit, write a small mod in Loom, and load it in the game. The mod adds up the numbers to 100 and writes the total to the game’s mod log.

Game
Whiskerwood
Platform
Windows · Linux

You write the mod inside the mod kit, an Unreal project laid out like the game. The kit turns it into a package that Whiskerwood loads from its mods folder.

  1. Mod kit · Unreal editor
    1. Your modMods/PK_LoomSum/BP_MapLoad.lm
    2. Loom buildsThe Blueprint, beside the file, on save
    3. Cook & InstallPacks the folder into a .pak
  2. Whiskerwood
    1. Mods folder.pak and .uplugin, side by side
    2. Colony loadsThe mod runs and writes to the mod log
    1. Install Whiskerwood.
    2. Set up the mod kit as its README describes, including the custom build of Unreal it needs.
    3. Add the Whiskerwood mod kit build of Loom to the kit’s Plugins folder, as in Installing Loom. On Linux, use the Source build.
    4. Open the kit in the editor. Under Project Settings › Plugins › Loom, add /Game/Mods/ to Instanced Class Paths.

    Why the last step: the kit’s copies of the game’s Blueprints are stand-ins, and the real ones only exist inside the game. So a mod can create components and widgets only from its own Blueprints and from native (C++) classes. Listing /Game/Mods/ tells Loom which Blueprints are the mod’s own.

  1. On the kit’s toolbar, choose Mod Tools › New Mod….

    In the dialog it opens:

    • Mod name: PK_LoomSum, so the code below works as is. It becomes the mod’s folder. The dialog asks for letters and digits only, but the underscore is fine.
    • Display name and Description: what players see. Write what you like.
    • The rest can stay as they are.

    This makes the folder Content/Mods/PK_LoomSum/. Add BP_MapLoad.lm to it: the Actor where a mod starts, which runs when a colony loads.

  2. Put this in BP_MapLoad.lm and save. Loom builds the Blueprint beside it.

    Content/Mods/PK_LoomSum/BP_MapLoad.lm
    blueprint BP_MapLoad : Actor at /Game/Mods/PK_LoomSum/BP_MapLoad
    var Total: int = 0
    fn Sum(N: int) {
    Total = 0
    let I: int = 0
    while I <= N {
    Total = Total + I
    I = I + 1
    }
    }
    fn Status() -> string {
    return "PK_LoomSum: Total " + string(Total)
    }
    on ReceiveBeginPlay {
    Sum(100)
    ModAPI.GetModAPI().LogMessage(Status(), false)
    }

    on ReceiveBeginPlay runs when the colony loads. ModAPI.GetModAPI().LogMessage writes a line to the mod log. Starting each line with the mod’s name makes it easy to find.

    1. In the kit’s Content Browser, right-click the PK_LoomSum folder and choose Cook & Install.

    2. Start Whiskerwood and load a colony.

    3. Open the mod log.

    Mod log
    %LOCALAPPDATA%\Whiskerwood\Saved\Logs\modlog.txt
    ~/.local/share/Steam/steamapps/compatdata/2489330/pfx/drive_c/users/steamuser/AppData/Local/Whiskerwood/Saved/Logs/modlog.txt

    The last line should read:

    PK_LoomSum: Total 5050

    On Linux the game runs through Steam’s Proton, so its folders sit inside Steam’s compatibility data. The path assumes Steam’s default library.

Cook & Install puts the mod in the game’s mods folder, as a folder holding PK_LoomSum.pak and PK_LoomSum.uplugin. To share it, zip that folder. Players unzip it into the same place.

Mods folder
%LOCALAPPDATA%\Whiskerwood\Saved\mods\PK_LoomSum\
~/.local/share/Steam/steamapps/compatdata/2489330/pfx/drive_c/users/steamuser/AppData/Local/Whiskerwood/Saved/mods/PK_LoomSum/

Every mod’s folder sits in /Game/Mods/, beside every other mod a player has installed, so its name has to be unique. Start it with a short prefix of your own, such as your initials, and use the same one for all your mods. PK_ is the prefix of Loom’s demos. In your own mods, use yours, in the folder’s name and in the paths in your Loom files.

Next steps