|
1 | | -# HAT |
| 1 | +# HAT - Simple mod loader for FEZ |
2 | 2 |
|
3 | | -## Overview |
| 3 | + |
4 | 4 |
|
5 | | -**HAT** is a [MonoMod](https://github.com/MonoMod/MonoMod)-based mod loader for FEZ, currently in development. When patched into the FEZ instance, it can be used to dynamically load game modifications on the game launch. The mods themselves can add/override assets or inject its own logic. |
| 5 | +## Overview |
6 | 6 |
|
7 | | -## Building |
| 7 | +**HAT** is a [MonoMod](https://github.com/MonoMod/MonoMod)-based mod loader for FEZ, currently in development. Its main purpose is to make process of FEZ modding slightly easier for end user. |
8 | 8 |
|
9 | | -1. Clone repository. |
10 | | -2. Copy all dependencies listed in `Dependencies` directory and paste them into said directory. |
11 | | -3. Build it. idk. it should work. |
| 9 | +When patched into the FEZ instance, it can be used to dynamically load game modifications on the game launch. Correctly prepared mods can add/override game assets or inject its own logic through custom-made plugin. |
12 | 10 |
|
13 | 11 | ## Installing mod loader |
14 | 12 |
|
15 | 13 | 1. Download [MonoMod](https://github.com/MonoMod/MonoMod/releases) (for .NET 4.5.2) and unpack it in the game's directory. |
16 | | -2. Put FEZ.HAT.mm.dll in the game's directory. |
| 14 | +2. Download latest `FEZ.HAT.mm.dll` from Release tab and put it in the game's directory. |
17 | 15 | 3. Run command `MonoMod.exe FEZ.exe` (or drag `FEZ.exe` onto `MonoMod.exe`). This should generate new executable file called `MONOMODDED_FEZ.exe`. |
18 | 16 | 4. Run `MONOMODDED_FEZ.exe` and enjoy modding! |
19 | 17 |
|
20 | 18 | In the future, this process will be automated by a custom-made installer/mod manager (something like Olympus for Celeste's Everest). |
21 | 19 |
|
22 | 20 | ## Adding mods |
23 | 21 |
|
24 | | -1. On first HAT launch, "Mods" directory should be created in the executable's directory. If not, create it. |
25 | | -2. Put a mod in this directory |
| 22 | +1. On first HAT launch, `Mods` directory should be created in the executable's directory. If not, create it. |
| 23 | +2. Download the mod's archive and put it in this directory. |
26 | 24 | 3. Start the game. |
27 | 25 |
|
28 | 26 | It's that simple! |
29 | 27 |
|
30 | | -## Creating your own mod |
31 | | - |
32 | | -1. Create a mod's directory. You can name it whatever, but it would be nice if it at least contained the actual mod's name to avoid confusion. |
33 | | - |
34 | | -2. In your mod's directory, create `Metadata.xml` file. Its content should look roughly like this: |
35 | | - |
36 | | -```xml |
37 | | -<Metadata> |
38 | | - <Name>YourModName</Name> |
39 | | - <Description>Short description of your mod.</Description> |
40 | | - <Author>YourName</Author> |
41 | | - <Version>1.0</Version> |
42 | | - <LibraryName></LibraryName> |
43 | | -</Metadata> |
44 | | -``` |
| 28 | +## Building HAT |
45 | 29 |
|
46 | | -3. If you want to add new assets or override existing ones, create `Assets` directory within your mods directory. All valid files within it will be loaded as game assets with path relative to the `Assets` directory. Currently, the only supported format is `.xnb`. As of right now, there isn't really a good way of creating `.xnb` assets and you have to rely on [FEZRepacker](https://github.com/Krzyhau/FEZRepacker). |
47 | | - |
48 | | -4. If you want to append a library with a custom logic, put it in your mod's directory and put its name with extension into the `LibraryName` property in mod's metadata. The library will be loaded only if its extension ends with `.dll`. |
49 | | - |
50 | | -## Creating custom logic |
51 | | - |
52 | | -Mod loader loads library file given in metadata as an assembly, then attempts to create instances of every public class inheriting from game's `IGameComponent` interface before initialization (before any services are created). After the game has been initialized, it adds created instances into the list of game's components and initializes them, allowing their `Update` and `Draw` (use `DrawableGameComponent`) to be properly executed within the game's loop. |
53 | | - |
54 | | -In order to create a HAT-compatible library, start by creating an empty C# library project. Then, add `FEZ.exe`, `FezEngine.dll` and all other needed game's dependencies as references - make sure to set "Copy Local" to "False" on all of those references, otherwise you will ship your mod with copies of those files. |
| 30 | +1. Clone repository. |
| 31 | +2. Copy all dependencies listed in `Dependencies` directory and paste them into said directory. |
| 32 | +3. Build it. idk. it should work. |
55 | 33 |
|
56 | | -Once you have your project done, create a public class inheriting from either `GameComponent` or `DrawableGameComponent` and add your logic there. Once that's done, build it and put it in the mod's directory. |
| 34 | +## "Documentation" |
| 35 | +- [Create your own HAT modifications](/Docs/createmods.md) |
| 36 | +- [Additional HAT behaviour](/Docs/additional.md) |
57 | 37 |
|
58 | | -For help, you can see an example of already functioning mod: [FEZUG](https://github.com/Krzyhau/FEZUG). |
| 38 | +## Mods created for HAT |
| 39 | +- [FEZUG](https://github.com/Krzyhau/FEZUG) - a power tool for speedrun practicing and messing with the game (NOT PORTED YET) |
| 40 | +- [FezSonezSkin](https://github.com/Krzyhau/FezSonezSkin) - mod replacing Gomez skin with Sonic-like guy seen in Speedrun Mode thumbnail (NOT PORTED YET) |
0 commit comments