-
-
Notifications
You must be signed in to change notification settings - Fork 36
About
Open-Terraria-API, known as OTAPI, is an API for modification development for Terraria. The API is injected into the Terraria binary through the OTAPI Patcher. The patched assembly will now expose the OTAPI. OTAPI is the combination of the OTAPI patcher as well as the defined OTAPI modifications for the patcher to perform.
The point of OTAPI is to provide a low level baseline consisting of hook points, vanilla class replacements, and optimizations to build on top of for the purpose of game modification.
OTAPI uses IL patching in order to inject code into existing .NET assemblies. These assemblies are the Terraria game assemblies. The patcher is run and pointed at the Terraria assembly as well as pointed at the OTAPI modifications. The process functions something like this:
Run patcher: patch.exe --source TerrariaServer.exe --modify OTAPI.Modifications\**\OTAPI.Modification.*.dll --out OTAPI.dll
The patcher will now:
- Load the source assembly.
- Yield all the
ModificationBase
instances from the--modify
glob. - Run the modifications which do the rewrites.
- ILRepack all the types from the modification satellite assemblies into the output.
- Write output.
OTAPI started with DeathCradle and has evolved to its current state with some collaboration from the Nyx Studios team.
OTAPI v2 is currently in early active development with help from Nyx. The project is available under the v2
branch of the OTAPI Repo on GitHub. It is licensed with the MIT License.
Soon(TM)