Skip to content
Luke edited this page Dec 19, 2016 · 1 revision

The following instructions are based around using a freshly cloned repository.

Step 1

Open the desired solution.

For servers use OTAPI.Server.sln, for clients you must use the particular solution that matches the framework being used e.g. OTAPI.Client.Xna.sln for the Windows XNA version.

Step 2

Acquire dependencies

Windows users can simply run the prebuild.ps1 file in Visual Studio which will automate the process of downloading the official Terraria binaries. Simply run Invoke-Expression .\prebuild.ps1 in the Package Manager Console in Visual Studio.

For those who are unable to do this and wish to build OTAPI.Server.sln, you need to manually download the official binaries (located on the footer of terraria.org). Open the downloaded archive and get the Windows (no matter the platform) binary and place the TerrariaServer.exe in \wrap\TerrariaServer
For those who are unable to do this and wish to build OTAPI.Client.*.sln, you will need to locate where your game installation is and copy the Terraria.exe into <OTAPI\wrap\Terraria\

Step 3

Restore NuGet packages and build

Now that the official binaries can be found we can go ahead and prepare to build. If you are not using Visual Studio you will need to restore any packages using NuGet. Once everything is resolved you can proceed with the building of the solution - make sure you build all OTAPI.Modifications! If you are using Visual Studio simply right click on the solution and click Rebuild Solution - this will automatically restore any NuGet packages and build the solution in one go.

Step 4

Run the patcher

You should by now have a solution that builds, so you are now able to run the patcher against the built modifications using OTAPI.Patcher.

For those who are using OTAPI.Server.sln the defaults will be automatically used, so you can simply just run OTAPI.Patcher. For those who are using OTAPI.Client.*.sln, you will need to add a few project command line arguments to instruct OTAPI what it needs to have as it's source assembly, the source modifications, and it's output path. The most common set of arguments are:

-source=../../../wrap/Terraria/Terraria.exe -modifications=../../../OTAPI.Modifications/OTAPI.**/bin/Debug/OTAPI.**.dll -output=../../../OTAPI.dll

You are now ready to run the patcher.

Step 5

Verify

If you have done everything correctly you should now notice the console print a line similar to Running 36 modifications.. This is very important as it is indicating how many modifications and hooks were applied to the source assembly. If you have 0 there is something wrong - typically your solution won't be build fully.