-
Notifications
You must be signed in to change notification settings - Fork 0
Modding Guide ‐ Getting Started
This series of articles will give you the information necessary to make basic mods for Prey (2017) using Chairloader Mod Loader.
If you have any questions, feel free to ask them over at the Prey Discord Server in #prey-modding
.
Prey is built using the CRYENGINE game engine. The "hard" game logic is written in C++ and is compiled into the PreyDll.dll binary file. But the most of the actual game settings are stored in various XML files in the game assets.
Game assets are stored in *.pak
files in the game folder. When running the game, all files from PAKs are combined into a single virtual file system. If a file with the same name exists in multiple PAKs, then PAKs loaded at a later point override files from earlier PAKs.
The game supports two types of PAK files.
- Regular ZIP archives. You can read and write them using any archive tool (e.g. 7-Zip).
- GOG and EGS versions use this format.
- Encrypted PAKs. They can only be read by the game or special extraction tools.
- Steam uses this format.
The game loads PAKs from GameSDK\Precache
last. This lets you install custom PAKs in this folder with the name like patch_[any name you want].zip
(e.g. patch_chairloader.pak
). This is how most existing mods are installed into Prey.
Note:
GameSDK\Precache
folder doesn't exist in EGS version but it's still supported if you make it manually.
As part of the modding process, you will need to edit XML files of huge sizes (sometimes thousands of lines long). If do this directly, not only will you go insane, but your mod will be incompatible with every other mod that modifies the same file.
Chairloader solves this problem. As a mod author, you only need to specify the changes to the game files. Chairloader will take all changes from all installed mods and will merge them into a single file.
To follow this guide, you must install Chairloader and make sure it works.
- Install Chairloader
- Open folder:
ChairManager/PreyFiles
. You should seeFilesExtracted.dat
and a set of folders.
Additionally, you can install a few tools to make modding easier.
This is the recommended option.
Preditor is a mod editor for Prey. Each Preditor project runs in a separate environment. It lets you test mods independent from each other and without risk of damaging your save files.
Note: At the moment, Preditor doesn't support level file merging. Use Chairloader for level mods for the time being.
-
Enable Developer Mode in Windows. This is required because Preditor uses symbolic links to reduce disk space usage when merging non-XML files.
- If you can't enable Developer Mode or don't use Windows 10, you MUST run Preditor.exe as Administrator.
-
Open ChairManager folder.
-
Launch
Preditor.exe
. You should see the Project Select dialog.
-
Press
New Project
. -
Fill in the fields.
- Mod Name. This is the internal name of the mod. It should look like
authorName.mySuperMod
. - Display Name. This is the name that the use will see. Example:
My Super Mod
- Author. This is your name. Example:
Myself
- Has a DLL. If you're making a DLL mod, tick this checkbox and type the DLL name.
- Project Location. Where to place your mod.
- Create Project Folder. If ticked, a new folder with the mod name will be created.
- Mod Name. This is the internal name of the mod. It should look like
-
Press
Create
-
Select your mod in the project list. This will open Preditor with just your mod loaded.
-
Adjust windows for your liking.
Recommended layout
- Choose an internal name for your mod. It should look like
authorName.mySuperMod
. - Open Prey installation folder and then open
Mods
folder. - Create a folder with your mod's internal name (e.g.
authorName.mySuperMod
) inMods
. - Copy
Examples/AuthorName.ModExample/ModInfo.xml
from ChairManager to the created folder. - Open
ModInfo.xml
in a text editor (e.g. VS Code). - Adjust attributes to match your mod. See the descriptions above (in Option A. Using Preditor).
- Open ChairManager
- Install and Enable your mod.
- Press
Save mod list
andMerge mods
.
Now that you have a mod, you can start modifying files. Follow the Basic XML Mod guide to get an idea on how XML mods work.