• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

[Cross-Platform] Prism modding API for 1.3

Eli10293

Spazmatism
NOTE: THIS IS A PRERELEASE. SOME IMPORTANT FEATURES ARE MISSING AND/OR IT MIGHT BE UNSTABLE.

Disclaimer
  • This is an unofficial tool, it is not licensed to Re-Logic, Re-Logic is not at fault for any damage caused by using this program.
  • There is already a tool used to create mods for 1.3, but Prism is in no way related to it.

Introduction

Prism is a cross-platform, open-source modding API for Terraria 1.3. It allows the creation and management of multiple mods at once. It can be seen as the successor to tAPI and tConfig.

Prism, unlike tAPI and tConfig, uses code injection to achieve this, instead of using the decompiled source code. Because of this, no Re-Logic code is included in the code repository, and can be (and is) made open-source. Everyone can contribute if they spot a bug or want to add a feature. The link to the GitHub repository is put under the 'Download' section.

Another effect of the usage of code injection is that it is easier to update to a newer version of Terraria. The code does not have to be decompiled and the changes do not have to be added by hand over and over again. It does break when certain code is rewritten, but it is fast and relatively easy to trace.
Any Terraria.exe file can be 'fed' to the patcher (required for GOG/Steam and platform differences, see the installation instructions), but it will break when given a Terraria <1.3 executable (including mods). It might (but is not guaranteed to) work with certain tools that use and/or create their own Terraria.exe file, but the Prism patcher executable must be used as the final step because it outputs a Prism.Terraria.dll file, which is loaded by Prism.exe.

It runs on Windows, Linux and OS X, is compatible with Steam, GOG and the Game Launcher. The mono runtime must be installed to use Prism.

The current team consists of these people (and a few others who wish to remain unknown by setting their visibility to 'Private' in that list).

Prism uses a separate folder for player and world saves, "My Games\Terraria\Prism\..." (or its equivalent on Linux/OS X). Separate .prism files are created for mod data, so one can copy the .plr and .wld files to/from the Prism folders.

If you want to submit a bug of feature request, please use the GitHub issue tracker rather than replying to the thread, so we can keep track of it more easily. Some/most members of the team are usually present on the tAPI IRC channel (irc.esper.net/6667#tapi). There is also a Gitter room.

Prism may seem harder to use than other modding tools, but it can reward good programmers (à la C++ or Haskell).​

Features
A (non-exhausive, incomplete) list of features:
  • Custom items, monsters, NPCs, projectiles and mounts, as well as custom behaviours
  • Player, world, game, ... hooks, to manage the state of the game, or to execute code at a specific point
  • Custom sound effects and background music
  • Tiles and are not supported yet. Tiles are notoriously hard to mess with (without letting the game crash), and there is not much space left for extra wall IDs, due to technical limitations (the ID is a `byte`, and about 210 walls exist already).
  • Multiplayer is not supported yet. The usage of multiplayer is not prevented, but it is almost guaranteed to break.
  • Prism is in the prerelease stage. A to-do list of features is available here.
Documentation

There is currently no documentation available because we are/have been busy creating Prism itself, but some kind of example mod exists, but it is mainly used to test Prism.

If you want to build Prism yourself, see the README.md file on the repo. It also contains a small section on how to create a mod.​

Download

See the GitHub release page. Installation instructions are provided there and should be read, especially for Linux and OS X users.

The source code can be viewed, cloned and forked on the GitHub repository.
Note that there are two major branches, "master" and "develop". "master" contains the code of the current release, "develop" is the most recent, in-developement (and probably unstable) code.​

License

See LICENSE on the GitHub repository (Artistic License 2.0)

This license agreement is a legal agreement between you and the Prism team.
By installing Prism, you agree to be bound by this agreement. If you do not agree to the terms of this Agreement, you may not install or use Prism.

Furthermore, you may not violate the rules presented in the Player-Created Game Enhancements: Rules & Guidelines thread.

Note that Prism is provided 'as is', it is never, in any event, the fault of the Prism team nor any of its members if damage in any kind occurs by the use of Prism or its consequences (e.g. using a mod).​

Credits
  • Everyone at Re-Logic for creating Terraria
  • All contributors and several others for assisting in the Prism developement process, it be either code or help with porting it to Linux and/or OS X.
  • Surfpup and the tAPI team for creating the programs that lead to Prism.
  • Bullseye55 for a lot of testing.
I just saw the list of people of work on it... WILL HUXTABLE IS ALIVE!?!?!??!?!
I really wish he would have posted more tAPI coding vids and also can someone message him to make prism modding videos?
 

GOUST

Terrarian
Distro: Linux Lite 2.0

Error message when following install directions and running Prism.sh in terminal.

Output Error:
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ #!/bin/bash
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ command -v mono >/dev/null 2>&1 || { echo >&2 "You must install Mono to use Prism. See the documentation."; exit 1; }
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ if [ "$(uname)" == "Darwin" ]; then
> LD_LIBRARY_PATH=$(pwd)/osx:$LD_LIBRARY_PATH
> elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
> LD_LIBRARY_PATH=$(pwd)/lib64:$LD_LIBRARY_PATH
> fi
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ mono Prism.exe
xdg-open: unexpected argument 'fatal'
Try 'xdg-open --help' for more information.
A fatal error occured:
System.TypeInitializationException: An exception was thrown by the type initializer for Prism.AssemblyResolver ---> System.IO.FileNotFoundException: Could not load file or assembly '/home/zxmrdubstepxz/.local/share/Steam/steamapps/common/Terraria/Prism.Terraria.dll' or one of its dependencies. The system cannot find the file specified.
File name: '/home/zxmrdubstepxz/.local/share/Steam/steamapps/common/Terraria/Prism.Terraria.dll'
at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetAssemblyName (string,System.Reflection.AssemblyName)
at System.Reflection.AssemblyName.GetAssemblyName (System.String assemblyFile) [0x00000] in <filename unknown>:0
at Prism.AssemblyResolver..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Prism.Program.Init () [0x00000] in <filename unknown>:0
at Prism.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$


------------------------------------------------------------------------------------------------------------

What does the mean? I really want to start making mods for this Terraria on Linux.
 

Nopezal

Skeletron Prime
Distro: Linux Lite 2.0

Error message when following install directions and running Prism.sh in terminal.

Output Error:
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ #!/bin/bash
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ command -v mono >/dev/null 2>&1 || { echo >&2 "You must install Mono to use Prism. See the documentation."; exit 1; }
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ if [ "$(uname)" == "Darwin" ]; then
> LD_LIBRARY_PATH=$(pwd)/osx:$LD_LIBRARY_PATH
> elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
> LD_LIBRARY_PATH=$(pwd)/lib64:$LD_LIBRARY_PATH
> fi
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ mono Prism.exe
xdg-open: unexpected argument 'fatal'
Try 'xdg-open --help' for more information.
A fatal error occured:
System.TypeInitializationException: An exception was thrown by the type initializer for Prism.AssemblyResolver ---> System.IO.FileNotFoundException: Could not load file or assembly '/home/zxmrdubstepxz/.local/share/Steam/steamapps/common/Terraria/Prism.Terraria.dll' or one of its dependencies. The system cannot find the file specified.
File name: '/home/zxmrdubstepxz/.local/share/Steam/steamapps/common/Terraria/Prism.Terraria.dll'
at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetAssemblyName (string,System.Reflection.AssemblyName)
at System.Reflection.AssemblyName.GetAssemblyName (System.String assemblyFile) [0x00000] in <filename unknown>:0
at Prism.AssemblyResolver..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Prism.Program.Init () [0x00000] in <filename unknown>:0
at Prism.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$


------------------------------------------------------------------------------------------------------------

What does the mean? I really want to start making mods for this Terraria on Linux.
Have you read the documentation? Most of the time, that gives you answers.
You can find the docs on the OP.
 

GOUST

Terrarian
I'm no dev. and defiantly not a coder, but i think the problem is here.
Thanks for noticing that, but that was a command. Basicly saying, do this else: "You must install Mono to use Prism. See the documentation."
And I do have all types of mono installed and up to date. I think its an issue with some of the .dll's
 

PoroCYon

Terrarian
Distro: Linux Lite 2.0

Error message when following install directions and running Prism.sh in terminal.

Output Error:
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ #!/bin/bash
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ command -v mono >/dev/null 2>&1 || { echo >&2 "You must install Mono to use Prism. See the documentation."; exit 1; }
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ if [ "$(uname)" == "Darwin" ]; then
> LD_LIBRARY_PATH=$(pwd)/osx:$LD_LIBRARY_PATH
> elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
> LD_LIBRARY_PATH=$(pwd)/lib64:$LD_LIBRARY_PATH
> fi
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$ mono Prism.exe
xdg-open: unexpected argument 'fatal'
Try 'xdg-open --help' for more information.
A fatal error occured:
System.TypeInitializationException: An exception was thrown by the type initializer for Prism.AssemblyResolver ---> System.IO.FileNotFoundException: Could not load file or assembly '/home/zxmrdubstepxz/.local/share/Steam/steamapps/common/Terraria/Prism.Terraria.dll' or one of its dependencies. The system cannot find the file specified.
File name: '/home/zxmrdubstepxz/.local/share/Steam/steamapps/common/Terraria/Prism.Terraria.dll'
at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetAssemblyName (string,System.Reflection.AssemblyName)
at System.Reflection.AssemblyName.GetAssemblyName (System.String assemblyFile) [0x00000] in <filename unknown>:0
at Prism.AssemblyResolver..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Prism.Program.Init () [0x00000] in <filename unknown>:0
at Prism.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$
[email protected]:~/.local/share/Steam/steamapps/common/Terraria$


------------------------------------------------------------------------------------------------------------

What does the mean? I really want to start making mods for this Terraria on Linux.
You didn't seem to have patched your Terraria.exe. Did you read the README text at the download link?
 

GOUST

Terrarian
You didn't seem to have patched your Terraria.exe. Did you read the README text at the download link?
I tried and got this: http://i.imgur.com/7oD3QK0.png

I have done this exactly:
Downloaded the api .zip file and extracted it to a folder on my desktop.
I then went to my terraria steam folder and grabbed terraria.exe and put it in the API folder and ran patcher with "mono terminal(runtime)"
and I was prompted to patched so I did.
I then got that error message ( http://i.imgur.com/7oD3QK0.png ) and just proceeded anyways. I copied terraria.exe (patched) to my
...common/terrara/ folder and copied Prisim.exe and .sh with that. I tried to start the .sh with terminal and got: ( http://i.imgur.com/ocW1i5a.png )
I dont know what to do.

Distro: Linux Lite 2.0 32x
 

PoroCYon

Terrarian
I tried and got this: http://i.imgur.com/7oD3QK0.png

I have done this exactly:
Downloaded the api .zip file and extracted it to a folder on my desktop.
I then went to my terraria steam folder and grabbed terraria.exe and put it in the API folder and ran patcher with "mono terminal(runtime)"
and I was prompted to patched so I did.
I then got that error message ( http://i.imgur.com/7oD3QK0.png ) and just proceeded anyways. I copied terraria.exe (patched) to my
...common/terrara/ folder and copied Prisim.exe and .sh with that. I tried to start the .sh with terminal and got: ( http://i.imgur.com/ocW1i5a.png )
I dont know what to do.

Distro: Linux Lite 2.0 32x
Maybe you should try building from source, the binary provided is built on (and probably for) Windows.
 
Top Bottom