Help with mods.

Lord Yharim

Terrarian
I am making a mod with VS, and I have all of the references and such set up, and I watched a video and followed all of the instructions, but no matter what I try, It says all of my code is bad. PLEASE HELP.
 
Sorry to be vague. Currently I am working on a pickaxe (but I have worked on lots of other stuff as well and I had the same problems) I got the code from github, (which means it might be wrong). But I added all of the nessecary references to Visual Studio, and it did not recognise any of my code whatsoever. I watched a tutorial and that person had no issues at all. So I don't know what to do. I appreciate any help you can give though.
 
Can you post a screenshot of the error you are getting in tmodloader when you try to build your mod?
Here is a screenshot from VS. As you can see, all of my code is underlined in red. And here is the message I get when I try to load it in game.
 

Attachments

  • Screenshot (1).png
    Screenshot (1).png
    147.2 KB · Views: 61
  • Screenshot (2).png
    Screenshot (2).png
    346.7 KB · Views: 56
The second picture tells you the issue is on line 13.
You're trying to set item.name, but that's not how you set the name
You set the name using another method
C#:
public override void SetStaticDefaults() {
    DisplayName.SetDefault("Item Name");
    Tooltip.SetDefault("Item Tooltip");
}

The reason everything is red in your VS is because you didn't set up all the references properly.
I find it best to create the mod skeleton using the options in tModLoader and then leave the mod in the folder it gets created in. That way all the references are already handled by tModLoader
 
The second picture tells you the issue is on line 13.
You're trying to set item.name, but that's not how you set the name
You set the name using another method
C#:
public override void SetStaticDefaults() {
    DisplayName.SetDefault("Item Name");
    Tooltip.SetDefault("Item Tooltip");
}

The reason everything is red in your VS is because you didn't set up all the references properly.
I find it best to create the mod skeleton using the options in tModLoader and then leave the mod in the folder it gets created in. That way all the references are already handled by tModLoader
Thanks so much. Also, After I create the mod skeleton, how do I use visual studio to make the rest of the mod?
 
Back
Top Bottom