maranethan 🐿
Eye of Cthulhu
By can they combine, I meant in the same mod, not if they are compatible together.
This is Many
Retinazer
Wdym I dont understandBy can they combine, I meant in the same mod, not if they are compatible together.
maranethan 🐿
Eye of Cthulhu
I wasn’t trying to ask if mods were compatible with resource packs,Wdym I dont understand
I was asking if you could put them in the same file.
This is Many
Retinazer
oh, about this IDKI wasn’t trying to ask if mods were compatible with resource packs,
I was asking if you could put them in the same file.
elmage78
Terrarian
Properties are used mainly for organization like specifing where will the srpites from weapons be searched for (leave blank and it will search the .png with the same name and same folder (the most used))Introduction
Hey guys! Have you ever wanted to create mods? If yes (like me), this tutorial is for you!
We will make mods for version 1.4.3 of Terraria.
Let's get down to business!
What are we going to study in this tutorial:
- How to go in modding
- How to create mod skeleton
- What is in the sources of the mod and how to use that
How to go in modding
First, you should know C#. Terraria is written on it and, accordingly, mod for it must also be written on it too.
I didn't know C# in my early days in modding, so I was very unprogressive.
Second, you need tModLoader. You can download it here.
Third, you can install a programming environment like Visual Studio (download).
Of course, you can work in notepad, but it is very inconvenient and there, unlike the Visual Studio,
it is impossible to use the .csproj file, with the help of which Visual Studio will be able to detect errors and know the entire Terraria library (like all item IDs).
How to create mod skeleton
1. Run tModLoader and click Workshop
View attachment 406044
2. Click Develop Mods and then click Create Mod
View attachment 406046
View attachment 406047
3. Fill in these fields
- Mod name in code (eg. MyMod)
- Mod public name (eg. My First Mod)
- Mod Author(s) (eg. This is Many)
- Mod's first item. It will be sword. We will see it in the next tutorial!
View attachment 406050
4. Click Open Sources
View attachment 406051
Now you can develop your mod!
What is in the sources of the mod and how to use that
Your mod sources will be look like that (yes, I'm on mac):
View attachment 406053
Let's take a look at each file in order!
build.txt
It contains information about the mod - its name, author, version, homepage etc. You can customise it, o' course!
Default stats:
displayName = My First Mod (the name of the mod)
author = This is Many (author of the mod)
version = 0.1 (mod version)
Additional Stats:
homepage = https://discord.gg/Z5v6JX6gEH (the main page of the mod, maybe discord server etc.)
hideCode = true/false (hide the mod's code of extracting?)
hideResources = true/false (hide the mod's .png files of extracting?)
includeSource = true/false (include mod sources on extracting?)
buildIgnore = *.csproj, *.user, obj\*, bin\*, .vs\*, Old\*, Other\* (files that you don't want to built in mod)
description.txt
Yes, the mod description. Nothing special except something:
[i/s1:981]
You can place that in your description to do item sprites in it! just replace 981 with ID of item you want to see!
View attachment 406055
icon.png
Mod icon in game. You will already have the frame for it in mod folder (View attachment 406057), but you can create your own!
Also there are 3 types of icons:
- icon is a default icon in game. Must be 80x80 pixels.
- icon_workshop is optional and it is an icon in steam workshop. Must be 512x512 pixels.
- icon_small is a bestiary filter of your mod. Must be 30x30 pixels.
MyMod.cs
This is a mod main file, like Main.cs in Terraria code. Can contain many things, we will learn about them in next tutorials!
MyMod.csproj
Used by Visual Studio to able it finding errors and know entire Terraria library.
Properties
I don't know what it is, but nobody touches it, and neither will we.
Items
Yes, creating mod. This folder will contain all your mod items.
I would suggest creating a new folder named Content and putting it there, it will be much cleaner than just throwing it all around in the mod folder.
We will learn basic sword in the next tutorial
Ending
Thanks to everyone who read this tutorial to the end. I hope it will help many beginners in modding. I worked really hard on this tutorial, and I hope it was helpful. Any questions allowed in comments! See you on the next tutorial!
Git Gud
Previous Tutorial / Next Tutorial (coming soon!)
This is Many
Retinazer
Thanks, we will know it nowProperties are used mainly for organization like specifing where will the srpites from weapons be searched for (leave blank and it will search the .png with the same name and same folder (the most used))
This is Many
Retinazer
lieWhen the 2nd tutorial? Soon!
MiniDev
Terrarian
Ahh... I think I bored from Unity... Oh mods written on C#. Ok time to try smth new!
This is Many
Retinazer
Good luck!Ahh... I think I bored from Unity... Oh mods written on C#. Ok time to try smth new!
Benskylark
Terrarian
Dude awesome. I did too!I HAVE mastered a coding website for kids…
Quartef12345
Terrarian
Im not sure if you are still responding but my spirtes are very very big
theyre bigger than moonlord im trying to fix it but no luck so far, if you or someon elese knows whats going on pls respond i dont know wat im doing
theyre bigger than moonlord im trying to fix it but no luck so far, if you or someon elese knows whats going on pls respond i dont know wat im doing
This is Many
Retinazer
Terraria sprite scaling is very sucky. It is unseen on smaller sprites, but sprites that are bigger than 90x90px often float on distance from hand. It is adviced to not use item sprites larger than 100x100pxIm not sure if you are still responding but my spirtes are very very big
theyre bigger than moonlord im trying to fix it but no luck so far, if you or someon elese knows whats going on pls respond i dont know wat im doing
Quartef12345
Terrarian
i found out, i was downloading my images after i had done them as a png but the way i was donwloaading them was making them 1200x1200 pixels. Thank you for your help ur articles have been very cool and helpefullTerraria sprite scaling is very sucky. It is unseen on smaller sprites, but sprites that are bigger than 90x90px often float on distance from hand. It is adviced to not use item sprites larger than 100x100px
Tangytim777
Terrarian
I keep getting error code CS0119 because ItemID isn't defined although me and my friend have double checked the code and your code and neither of us could see a difference?
This is Many
Retinazer
Are you using Terraria.ID?I keep getting error code CS0119 because ItemID isn't defined although me and my friend have double checked the code and your code and neither of us could see a difference?
Tangytim777
Terrarian
u mean
"using Terraria.ID;" line 5 yes
"using Terraria.ID;" line 5 yes
Last edited:
This is Many
Retinazer
post the error how it looksu mean
"using Terraria.ID;" line 5 yes
Tangytim777
Terrarian
I figured it out tysm
on an unrelated note.post the error how it looks
do you know how to change the standard prefixes/reforges like heavy or godly? i have looked at the copper shortsword in the example mod, and they use an GlobalItem class to override an item but i can't find a way to change prefixes.
This is Many
Retinazer
Sorry, never worked wirh prefixes. Try asking on tModLoader discord serveron an unrelated note.
do you know how to change the standard prefixes/reforges like heavy or godly? i have looked at the copper shortsword in the example mod, and they use an GlobalItem class to override an item but i can't find a way to change prefixes.
Similar threads
- Replies
- 63
- Views
- 6K
- Replies
- 33
- Views
- 13K
-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.