tModLoaderFile structure?

LilStarla

Terrarian
I've been modding Skyrim for a while now, so understanding file structure is no big deal to me. tModLoader, however, doesn't appear to be clear about how files must be structured in order for a mod to be successfully built. I made a simple glass sword mod last night, and it worked without any hesitation. I decided to add a glass pickaxe, too... well... problems started. I eventually got it to work but let's just say my solution did not feel correct... (renaming mod folder)

So... this morning I decided I would make a dryad's sword. I went to the skeleton generator thingy and got an examplesword.cs file, drew up its sprite and I'm getting this error...

Error.png


You can tell I don't plan on stopping with a sword... I want to make an entire class, I guess... Anyway here is my file structure...

Folder 1.png Folder 2.png

And here is my .cs file for the sword...

Code.png

So what's the hold up? Are my files out of order or is there something wrong with the code? Keep in mind I want to add a complete weapon, armor and tool set to this mod so I guess I need some pointers on how to properly add to it.

Thanks for any help! :dryadgrin:
 
I've been modding Skyrim for a while now, so understanding file structure is no big deal to me. tModLoader, however, doesn't appear to be clear about how files must be structured in order for a mod to be successfully built. I made a simple glass sword mod last night, and it worked without any hesitation. I decided to add a glass pickaxe, too... well... problems started. I eventually got it to work but let's just say my solution did not feel correct... (renaming mod folder)

So... this morning I decided I would make a dryad's sword. I went to the skeleton generator thingy and got an examplesword.cs file, drew up its sprite and I'm getting this error...

View attachment 181252

You can tell I don't plan on stopping with a sword... I want to make an entire class, I guess... Anyway here is my file structure...

View attachment 181253 View attachment 181254

And here is my .cs file for the sword...

View attachment 181255

So what's the hold up? Are my files out of order or is there something wrong with the code? Keep in mind I want to add a complete weapon, armor and tool set to this mod so I guess I need some pointers on how to properly add to it.

Thanks for any help! :dryadgrin:
You're ending your namespace with a . operator (it says DryadSword.Items.), so it's expecting another namespace identifier. Just remove the . and you're golden.
 
jopojelly was right about the recipes lines. I noticed that when I compared it to my working Glass sword file. Thanks for the link, but no thanks for stating the obvious, though. Give me time. I literally just started teaching myself C# last night. :dryadnaughty:

I found a few other syntax errors and it seems to be working now. So it was all in my code and not in my file structure...

So when I go to, say, add my pickaxe (spriting it now) I need to make sure that namespace in it's file reads DryadEquipment (the main folder?) and that public class is DryadPickaxe : ModItem (the .cs and .png within the items folder?) and then the rest speaks for itself, ya?
 
jopojelly was right about the recipes lines. I noticed that when I compared it to my working Glass sword file. Thanks for the link, but no thanks for stating the obvious, though. Give me time. I literally just started teaching myself C# last night. :dryadnaughty:

I found a few other syntax errors and it seems to be working now. So it was all in my code and not in my file structure...

So when I go to, say, add my pickaxe (spriting it now) I need to make sure that namespace in it's file reads DryadEquipment (the main folder?) and that public class is DryadPickaxe : ModItem (the .cs and .png within the items folder?) and then the rest speaks for itself, ya?
The namespace should read whatever folder the .cs file is in. So if it's in a folder Items in DryadEquipment, the namespace should be DryadEquipment.Items.
 
Got it. So far I've made 3 weapons in the last hour, so I'm advancing. So from what I understand each type of item requires the data under public override void SetDefaults to be unique to that item... %:sigh:
 
Back
Top Bottom