Skip to content
TiberiumFusion edited this page Oct 17, 2022 · 47 revisions

TTPlugins Wiki

TTPlugins is the user plugin framework for Terraria Tweaker 2.3+. For a basic overview of this project, please see the README.

This wiki is intended for plugin authors and explains how to write your own plugins. TTPlugins and its integration with Terraria Tweaker 2 attempts to enable a low bar of entry to writing plugins. General competence in writing & understanding managed software is all you need to get started, but prior experience with the .NET ecosystem and the specific technologies used by Terraria and TTPlugins is highly recommended.

This wiki assumes you are familiar with the following:

  • Version 5.0 of the C# language and the versions of the .NET Framework used by the software below
  • Terraria Tweaker 2, which targets .NET Framework 4.5.2 and facilitates creating, managing, and applying your plugins
  • Terraria itself, which targets the .NET Framework 4.0 Client Profile and is built upon XNA 4.0
  • The disassembly tool of your choice, such as ILSpy

◆ Main Topics

These articles cover the process for creating typical plugins, the framework available to plugin code, and some best practices.

◆ Advanced Topics

◆ Example Plugins

  • SinglePatchDemo
    • A basic plugin that increases player speed.
  • PersistentSavedataDemo
    • An "upgrade" of the SinglePatchDemo plugin. Gives the player a speed boost that can be controlled with ingame hotkeys and uses persistent savedata to save the speed boost intensity between Terraria launches.
  • PrecompiledPluginDemo
    • A basic plugin that increases player defense. This plugin is part of a Visual Studio project that demonstrates how to precompile plugins.
  • CompleteWeaponDemo
    • An advanced plugin that adds a new weapon (+ projectile) to Terraria, using embedded assembly resources. This plugin is precompiled with a Visual Studio project.

Technical reference

MSDN-style technical docs for TTPlugins can be found here. Be warned, the descriptions & remarks are very limited, so this information may only be useful for understanding code layout and finding specific functions.