How to create a mod with Microsoft Visual Studio (MVS) [tModLoader 0.8]

How to create a mod with Microsoft Visual Studio (MVS) [tModLoader 0.5]

Translated and supplemented by Warten. Link to the original. (In English)
Attention! ask stupid questions like: Why doesn't the Russian language work? Will drive the author into a wild rage.

How to create a mod with Microsoft Visual Studio (MVS) [tModLoader 0.8]

Home
Remember: if your religion forbids reading the FAQ, google and use a translator, you can not wait for help here. General.

  • Set tModLoader... Then run installer.exe again and click setup modding environment.
  • Make sure you have the latest .NET Framework installed.
  • Make sure you have XNA Framework .dll files (Or download).
  • Download and install Microsoft Visual Studio, Community Edition.
    (Install from C # workspace. Attention!: install with English) It is only for 30 days! Later you need to register an account for off. website and enter the program, it's free.
  • And of course, basic knowledge of C #. It's easy, read tutorials, guides and do any regular program before you start modding.

There are some things you should know before starting modding:

  • First of all, this manual is for tModLoader and it may (or may not) change as we update it.
  • Make sure you have the latest Microsoft .NET Framework (4.5 or higher) to prevent any problems.
  • Terraria uses XNA Framework libraries, so you will need DLLs in your mod. They are needed to prevent errors when writing code. You can download mine or find them yourself if you have the XNA Framework (Preferred).
  • And of course, don't forget Microsoft Visual Studio itself.
How to create a mod with Microsoft Visual Studio (MVS) [tModLoader 0.8]

Introduction
MVS will help you auto-complete code by showing errors, and in general ... It will make the process of coding much faster and easier.
Microsoft Visual Studio is an application for creating many kinds of programs. You've probably heard of it before, and perhaps someone has even used it.
If this is your first time using MVS, I recommend reviewing / reading the C # guides / tutorials first. There are a lot of them on the Internet.

How to create a mod with Microsoft Visual Studio (MVS) [tModLoader 0.8]

How to create your mod (hereafter - project) in MVS
It is better to use MVS with installed English. tongue! After installation and launch, you will see the start page, close it. Then do everything as in the list.

  1. Click File -> New -> Project (Templates -> Other project types -> Visual Studio Solutions) name it “Mod Sources” (Without quotes)
  2. Set location: documents \ My Games \ Terraria \ ModLoader
  3. Click OK
  4. Click Add -> New Project -> Windows -> Classic Desktop -> Empty Project
  5. Enter the name of the mod (In English, without special characters and spaces)
  6. Click OK
  7. Right click on the new project (Right) -> Add -> Class (name it the same as you named the mod)
  8. Then write the code like here: (MODNAME is the name of your mod)
    using System; using Terraria; using Terraria.ModLoader; namespace MODNAME { public class MODNAME : Mod { public MODNAME() { Properties = new ModProperties() { Autoload = true, AutoloadGores = true, AutoloadSounds = true }; } } }
  9. Now open your text editor. Enter these lines there:
    author = This is your nickname, name, whatever, write whatever you want;
    version = version, any digits;
    displayName = this is the name of the mod that will be shown in the menu, here you can already write spaces, special characters, but you can't use Cyrillic! (Russian letters)
    homepage = if you zip the post, you can copy the link here
    hideCode = is it possible to open the mod and see its code (true / false)
    hideResources = is it possible to open the mod and see its textures (true / false)
    includeSource=true
    buildIgnore = * .csproj, * .user, obj \ *, bin \ *, .vs \ *
    includePDB=true
    ^ We do not touch the last three.
  10. Name the resulting file build.txt and drop it into your project (Just drag and drop)
  11. Then right-click on your project -> references -> Add reference (Add libraries (.dll) that you downloaded, and modified Terraria.exe (With the modloader installed, you know))
  12. That's all, now you can start terraria and try building the mod in the mod sources tab to check if you did everything right. If not, then repeat... You don't need to compile the mod!

    Tips
    Some tips:
    • Try to keep internal names such as namespaces and classes clean. That is, try to avoid special characters, spaces, dashes, etc. etc.
    • If you don't understand anything, ask yourself: Do you have any knowledge of C # in this case? If not, then read the C # tutorials / guides and then come back.
      My tips:
    • Take a look at the source code of ExampleMod carefully, it contains almost everything that tModLoader can do at this time.
    • Note for MVS, it creates a .vs folder which will show up in the mod sources tab. Just ignore her.
    • Before you start modding you should at least know the very basics of C #.
      You can mostly learn these basics by building console applications.
      Don't be afraid to try doing something yourself!
      Experience with programming other applications will be a huge plus in the future.
      C # tutorials (In English. Search for yourself in Russian.)
    • http://www.tutorialspoint.com/csharp/
    • http://csharp.net-tutorials.com/
    • http://www.homeandlearn.co.uk/csharp/csharp.html
      Additional links.
    • Documentation (eng)
    • IDs of items, tiles, etc.


      //end?
TerrariaGo - Everything for Terraria (Terraria) free download

  1. Arseny

    Mmma is it possible to script for creating a helmet bib and pants

    Reply
    1. terrariago-admin author

      I have no squeaks

      Reply