# Local Cooking / Building

## Preparation

Before starting a local cooking process, confirm that you have directory for your mod at. If it is missing, create a new directory:

`HogwartsLegacyCreatorKit\WindowsNoEditor\Phoenix\Mods\{ModName}`

## Creating the .pak file(s)

Open a terminal and navigate to your `HogwartsLegacyCreatorKit\Engine\Binaries\DotNET` installation directory. In it you should find an `AutomationTool.exe` executeable, that needs to be called with several arguments:

```powershell
.\AutomationTool.exe packageugc -Project="PATH TO Phoenix.uproject" -PluginPath="PATH TO MOD.uplugin" -CookLocal="true" -Version="PhoenixGameUGC_v1" -BasedOnReleaseVersion="PhoenixGameUGC_v1"
```

Change the `Project` and `PluginPath` values according to your environment and run the command.

Grab a coffee :coffee: , this may take a while.

{% hint style="danger" %}
If an error message gets shown that states `Could not find a part of the path: ...` , the directory from the preparation step is missing.
{% endhint %}

The final output can be found in&#x20;

`HogwartsLegacyCreatorKit\PhoenixGame\Mods\{ModName}\Saved\StagedBuilds\WindowsNoEditor\Phoenix\Mods\{ModName}\Content\Paks\WindowsNoEditor`

You can copy the contents of the folder into your `Hogwarp/Mods` folder.

## Reducing the .pak file size

By default, the cooked mod includes some additional *DevelopmentAssetRegistry* binary which increase the output file by several megabytes but is not needed. You can manually unpak the file and repack without the binary.

You can use the following [Batch file](https://gist.github.com/ToeKneeRED/63a8867a2b6f028cab4562171e57ebfc) (credits to Toe Knee) and provide the `.pak` file (e.g. via Drag & Drop). This will remove the unnecessary binary and reduce the file size.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hogwarp.com/hogwarp/scripting/client-side/setting-up-mods/local-cooking-building.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
