Skip to content

CSharp Scripting

Did you know Legion also supports C# scripting now?
Check out Legion scripting information here

CSharp scripting is in version 4.18 and up.

Section titled “CSharp scripting is in version 4.18 and up.”

This is a big change, required a lot of reworking and we did as much testing as we reasonably could to ensure this doesn’t break too much.

  1. There may very well be bugs, please report them! (Discord/Matrix/Forums)
  2. This is new to TazUO, features may be missing/incomplete.
  • For cs projects to have autocomplete/intellisense/etc, the .cs files need to be in a CS Project, so TUO will automatically create a .csproj file in your LegionScripts folder, please note that for advanced users, nothing in the csproj file will actually apply in-game, it’s strictly to enable auto-complete in your IDE(You don’t need to do anything, this is for information only).
  • You can add using statements for various libraries needed in your scripts, but if they aren’t already available to TUO they won’t be available in your scripts(You won’t be able to add external libraries/nuget packages, etc)
  • You won’t be able to include other cs files you create, so your scripts will need to be one-file.
  • Threading/async does work, but use at your own risk, if you lock a thread up, don’t exit a thread properly, cross-thread access variables incorrectly, that is on you, we can’t protect against that, so my recommendation is: If you are note 100% sure that you are coding your cross-threading correctly, don’t do it.