tModLoader How to set up your mod using Visual Studio (MVS)

One question(it's a hard one): In Visual Studio you can choose to show all files in the solution explorer. If you choose to show all files you will see the .png files(your sprites). The are only visible when I choose to show all files but then I see other files too like bin and obj. How can I choose which files will be visible all the time?

I don't really understand, because I see png files by default as well. I guess you want a view like this?
Qw4CVyF.png


Can you maybe try Window -> Reset Window LayouT
 
Tried that, didn't work. This is my view right now.
2015-07-18 20_12_36-Mod Sources - Microsoft Visual Studio.png

When I press this button the .png pictures become visible
2015-07-18 20_14_00-Mod Sources - Microsoft Visual Studio.png

But then I see other files which i don't need to see. Do you know how to make the .png pictures visible all the time? Just like your view.
 
Tried that, didn't work. This is my view right now. View attachment 64140
When I press this button the .png pictures become visible View attachment 64141
But then I see other files which i don't need to see. Do you know how to make the .png pictures visible all the time? Just like your view.

I'll have to figure that out somehow, I was showing them to me by default ever since I installed MVS. Can you try this?
Menu: Project -> Show all files...
Then select them in the solution explorer, right click and include them in the project. You can turn off "Show all files" after that.

This should fix your problem.
 
I'll have to figure that out somehow, I was showing them to me by default ever since I installed MVS. Can you try this?


This should fix your problem.
That only works for the file I choose to include to the project. Every .png file I add after that becomes invisible until i press Show all files.

Edit: I found the problem. When I put in the .png files I put them in the folder for the mod, not through Visual Studio. When I drag and drop them directly into Visual Studio they become visible. My bad.
 
That only works for the file I choose to include to the project. Every .png file I add after that becomes invisible until i press Show all files.

That is because only files included in the project show. There's nothing you can do about that. You can automatically add files by Right Click -> Existing Item or dragging the images into the 'Items' folder.
 
That is because only files included in the project show. There's nothing you can do about that. You can automatically add files by Right Click -> Existing Item or dragging the images into the 'Items' folder.
I edited my post, I managed to solve the problem. Thanks for your help:)
 
There is actually a way to do it programmatically, the only problem is the wildcard will dissappear the moment you touch the folder from within MVS. So to me that is not a right approach :)

I edited my post, I managed to solve the problem. Thanks for your help:)

If you want, you can hand edit your csproj file.
There will be an itemgroup somewhere saying things like this:
Code:
<Content Include="Items\ExampleSword.png" />
You'll want to delete content like that and add this wildcard:
Code:
<Content Include="Items\*.*" />
This will add any file in the folder. Or only for png:
Code:
<Content Include="Items\*.png" />
 
Last edited:
Right click on your blank solution -> Choose New Project -> Go to Visual C#/Windows Desktop -> You should see the Empty Project in the list ->Choose it and there you got your Empty Project
Okay, I believe you. When I did this I didn't right-click the solution in the solution manager, I clicked file then I went looking through every single template category looking for a blank project template and didn't find one. I resorted to looking it up online and still couldn't find it, attempted uninstalling the program but it froze in the process so that was a real pain, restarted, uninstalled it, came here and posted, read your post, attempted re-installing it, froze during installation, tried cancelling it, froze during cancellation. Thanks the task manager for helping me ever so greatly in ending their faulty processes. I can't even begin to comprehend as to why I even began installing Visual Studio again when I already had Express and the .iso for it that I intended to put it on the other computer. Can you confirm this one thing for me, when you click file > new project > can you find an empty project? If you can then that means that I must have clicked on something wrong on the initial installation that would not pop-up on any of the attempted re-installations (probably because they were unsuccessful). Thanks for the future post, hopefully it will put my mind to ease with an answer.
 
Okay, I believe you. When I did this I didn't right-click the solution in the solution manager, I clicked file then I went looking through every single template category looking for a blank project template and didn't find one. I resorted to looking it up online and still couldn't find it, attempted uninstalling the program but it froze in the process so that was a real pain, restarted, uninstalled it, came here and posted, read your post, attempted re-installing it, froze during installation, tried cancelling it, froze during cancellation. Thanks the task manager for helping me ever so greatly in ending their faulty processes. I can't even begin to comprehend as to why I even began installing Visual Studio again when I already had Express and the .iso for it to put it on the other computer. Can you confirm this one thing for me, when you click file > new project > can you find an empty project? If you can then that means that I must have clicked on something wrong on the initial installation that would not pop-up on any of the attempted re-installations (probably because they were unsuccessful).

Yes you can. Just gotta make sure you have at least the c# workspace. Just don't do it via the top menu, there you can create an empty solution.
You want to right click the solution -> new project -> windows desktop (on the left) -> Empty Project
I'm pretty sure I put these exact steps in this tutorial...

Edit: Pretty sure it works from the top menu too, just make sure you're in the 'Windows Desktop' and it should be somewhere in the middle.
 
Yes you can. Just gotta make sure you have at least the c# workspace. Just don't do it via the top menu, there you can create an empty solution.
You want to right click the solution -> new project -> windows desktop (on the left) -> Empty Project
I'm pretty sure I put these exact steps in this tutorial...

Edit: Pretty sure it works from the top menu too, just make sure you're in the 'Windows Desktop' and it should be somewhere in the middle.
It works from the top menu too. It should work from every "New Project" when you have the c# workspace.
 
Yes you can. Just gotta make sure you have at least the c# workspace. Just don't do it via the top menu, there you can create an empty solution.
You want to right click the solution -> new project -> windows desktop (on the left) -> Empty Project
I'm pretty sure I put these exact steps in this tutorial...

Edit: Pretty sure it works from the top menu too, just make sure you're in the 'Windows Desktop' and it should be somewhere in the middle.
The thing is though, the tldr was tldr for me.
 
Update: (21-07-2015)
(Set up a mod)
  • (For MVS 2015) Add -> New Project -> Windows -> Classic Desktop -> Empty Project
 
Update: (21-07-2015)
(Notice)
  • Note for MVS 2015: Also creates an invisible .vs folder inside which will show on the build tab, I could ask @bluemagic123 to remove it from the build list but for now simply ignore it.
 
Do I have to add every image through VS ? If I drop them into the folder they dont show up in VS

Edit: Nevermind. I read the old posts ^^
 
Whats the problem?

1ZTfgKL.png


Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terranova.Items;
using Terranova.Items.Armor;
using Terranova.NPCs;

namespace Terranova
{
    public class Terranova : Mod
    {
        public override void SetModInfo(out string name, ref ModProperties properties)
        {
            name = "Terranova";
            properties.Version = "v1";
            properties.Author = "Hek";
            properties.Autoload = true;
        }

        public override void Load()
        {
            SetGlobalItem(new TerranovaItem());
            SetGlobalNPC(new TerranovaNPC());
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(this);
            recipe.AddIngredient(null, "ItemID.DirtBlock", 1);
            recipe.SetResult(ItemID.GravitationPotion, 20);
            recipe.AddRecipe();

            RecipeHelper.AddBossRecipes(this);
        }
    }
}

Edit: Nevermind, figured it out x) I just replaced "TerranovaItem" into "GlobalItem"
 
Last edited:
Do I have to add every image through VS ? If I drop them into the folder they dont show up in VS

Edit: Nevermind. I read the old posts ^^

Sorry I didn't notice your posts, somehow I didn't receive a notification.
Glad you could manage to fix it on your own :D
 
Back
Top Bottom