docs.xiv.zone/content/dalamud/dalamud.md

65 lines
3.4 KiB
Markdown
Raw Normal View History

2022-07-16 18:54:44 -04:00
---
title: "Integrating Dalamud"
2022-07-16 18:54:44 -04:00
---
If you're developing your own launcher, you might be interested in integrating [Dalamud](https://github.com/goatcorp/Dalamud) support. Here's a detailed
2022-07-16 18:54:44 -04:00
walk-through of setting up a proper Dalamud environment.
2023-09-23 09:09:31 -04:00
# Grabbing .NET Runtime
2022-07-16 18:54:44 -04:00
You'll need a .NET environment to actually launch Dalamud, since it's based it uses .NET. It won't try to use your system .NET, and will require to put it into a separate directory.
In order to determine which .NET runtime you need, first check the Dalamud Distribution server using the following URL:
2022-07-16 18:54:44 -04:00
`https://kamori.goats.dev/Dalamud/Release/VersionInfo`
2022-07-16 18:54:44 -04:00
This will return a JSON containing keys for `runtimeVersion`. This is the required .NET runtime, which then can be fetched directly from Microsoft:
2022-07-16 18:54:44 -04:00
`https://dotnetcli.azureedge.net/dotnet/Runtime/%1/dotnet-runtime-%1-win-x64.zip`
`https://dotnetcli.azureedge.net/dotnet/WindowsDesktop/%1/windowsdesktop-runtime-%1-win-x64.zip`
You can then extract both zip files into some directory, henceforth called `$RUNTIME_DIR`.
2023-09-23 09:09:31 -04:00
# Grabbing Dalamud
2022-07-16 18:54:44 -04:00
Now you can grab Dalamud from Dalamud Distribution (`https://kamori.goats.dev/Dalamud/Release/VersionInfo`) where the URL is `downloadUrl`.
2022-07-16 18:54:44 -04:00
You can then extract this zip file, and the resulting directory will be referred to as `$DALAMUD_DIR`.
**Note:** You can find out the version of Dalamud you have installed by reading the dependencies file, located under `$DALAMUD_DIR/Dalamud.deps.json`.
2023-09-23 09:09:31 -04:00
# Grabbing Dalamud assets
2022-07-16 18:54:44 -04:00
These are not grabbed by Dalamud (for some reason) and instead you must download these yourself. These include fonts, icons and other things which are required for regular operation.
You can find the asset manifest at:
`https://kamori.goats.dev/Dalamud/Asset/Meta`
2022-07-16 18:54:44 -04:00
This is simply a long JSON describing where to find the assets, the current version and where to put them. It's recommended to use the `packageUrl` to download all of the assets at once. The directory you put assets in will be called `$DALAMUD_ASSET_DIR`.
2022-07-16 18:54:44 -04:00
2023-09-23 09:09:31 -04:00
# Launching Dalamud
2022-07-16 18:54:44 -04:00
Now with all of your ugly ducklings in a row, you can begin launching Dalamud! First, please make
sure these environment variables are set **on the game process and all relevant processes and children**. Please double check these, as Dalamud may silently fail without them.
* `DALAMUD_RUNTIME` should be set to your `$RUNTIME_DIR`.
2022-07-16 18:54:44 -04:00
* If you are in Wine, please set `XL_WINEONLINUX`.
2023-09-23 09:09:31 -04:00
1. Launch `$DALAMUD_DIR/Dalamud.Injector.exe`.
2022-07-16 18:54:44 -04:00
* You may be able to launch the injector without any additional configuration, but it's recommended to set these.
* Arguments:
2023-09-23 09:09:31 -04:00
1. The arguments for the game.
2022-07-16 18:54:44 -04:00
2. Base64-encoding of a JSON dictionary which may contain these options:
* WorkingDirectory - overrides the working directory for Dalamud
* ConfigurationPath - the file path of `dalamudConfig.json`
* PluginDirectory - the directory for the `installedPlugins` folder
* AssetDirectory - should point to `$DALAMUD_ASSET_DIR`.
* DefaultPluginDirectory - the default directory for the `devPlugin` folder.
* DelayinitializeMs - how much Dalamud should wait before injection
* GameVersion - the (base) game version string
* Language - language code of the game
* OptOutMbCollection - whether or not to opt out from anonymous marketboard statistics collection
2023-09-23 09:09:31 -04:00
2. If successful, the game should freeze for a few momements and Dalamud will successfully inject!