TheJazMaster
Terrarian
Can someone please tell me how to make mods for Terraria 1.3 or redirect me to a topic about a valid mod making tool?
this.shoot = 2;
I haven't really touched tModLoader at all, but I'll see what I can do to help you. You of course, have to download the program, which you can get from the Download section of the opening post. After that, you should install it in which it creates folders to start making your mods. Now that you've got these, you would need to go to the tModLoader's mod folders, which you can find in this location:Can you make a detailed explanation on how to make mods with it? I haven't done anything similar and I have no idea what to do.
author = bluemagic123
version = v0.6
displayName = Example Mod
author = Faux Nom
version = 1.0
displayName = My First Mod
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace myFirstMod
{
public class myFirstMod : Mod
{
public override void SetModInfo(out string name, ref ModProperties properties)
{
name = "myFirstMod";
}
}
}
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace myFirstMod.Items
{
public class myFirstItem : ModItem
{
public override void SetDefaults() //This lets you set the properties of the items
{
item.name = "My First Item";
item.width = 20;
item.height = 20;
item.maxStack = 999;
AddTooltip("This is a modded item.");
item.value = 100;
item.rare = 1;
}
public override void AddRecipes() //This lets you make a recipe for your item
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock);
recipe.SetResult(this, 999);
recipe.AddRecipe();
}
}
}
Don't forget to have 'properties.Autoload = true;' in the SetModInfo function! Otherwise the item won't get loaded.I haven't really touched tModLoader at all, but I'll see what I can do to help you. You of course, have to download the program, which you can get from the Download section of the opening post. After that, you should install it in which it creates folders to start making your mods. Now that you've got these, you would need to go to the tModLoader's mod folders, which you can find in this location:
C:\Users\<yourUserName>\Documents\My Games\Terraria\ModLoader
From here, you will see many folders, which are logs, mod sources, mods, and players. Now we go to mod sources and you should see that it is empty initially. So let's create a folder for your mod, let's call it... myFirstMod. Now that you have created this folder I think you have to make a txt file for your mod called build.txt. From here you just put stuff like name and stuff. Here's one from the ExampleMod that the creator of tModLoader uploaded for us for reference.
Code:author = bluemagic123 version = v0.6 displayName = Example Mod
So the properties you only need to make for your build.txt are the author, version, and displayName. So let's set up the build.txt we're gonna use for myFirstMod.
Code:author = Faux Nom version = 1.0 displayName = My First Mod
Now we got our build.txt. Afterwards we'll make a cs file for it. This part I don't think I know what I'm doing so I may be completely wrong. You can make a cs file by just changing the extension name of a txt file extension .txt to a cs file which is file extension .cs, if you have the view file extensions on in windows explorer. If you can't see file extensions then click the view tab found near the place where it says file. From here just checkbox File Name Extensions. We'll call the cs file myFirstMod.cs. Here we would put this code to display the name of the mod.
Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace myFirstMod { public class myFirstMod : Mod { public override void SetModInfo(out string name, ref ModProperties properties) { name = "myFirstMod"; } } }
Now that we have that, we'll now make a folder inside of our myFirstMod folder called Items to get ourselves a really basic item. Here we will make our first item. Inside our Items folder, we will make a new cs file named myFirstItem.cs. In here we will set all the properties of the item. I'm gonna borrow code from the ExampleMod. Here's how it should look like.
Code:using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace myFirstMod.Items { public class myFirstItem : ModItem { public override void SetDefaults() //This lets you set the properties of the items { item.name = "My First Item"; item.width = 20; item.height = 20; item.maxStack = 999; AddTooltip("This is a modded item."); item.value = 100; item.rare = 1; } public override void AddRecipes() //This lets you make a recipe for your item { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.DirtBlock); recipe.SetResult(this, 999); recipe.AddRecipe(); } } }
Before we call it off, we need a texture for our item, so we need to have a png image to serve as our texture in which you name it as myFirstItem. Both the cs file and the png file have to have the same name so that tModLoader can properly load the item into the game. Now you have your first item, though I highly doubt this would actually work because I have never used tModLoader before.
Where do I find this setting?Don't forget to have 'properties.Autoload = true;' in the SetModInfo function! Otherwise the item won't get loaded.
Seeing as you haven't touched tModLoader, this seems like a nice explanation! Kudos.
You just set it into the mod cs file's SetModInfo, which in the case of the example it would be inside the myFirstMod.cs. There is a hook in there called SetModInfo() in which you add the "properties.Autoload = true" in between the brackets with "name".So when I make a modded item or anything I have to write it's properties in a txt file and change it to cs when I'm done?
Where do I find this setting?
This is my cs file inside my mod folder in txt form:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace myFirstMod
{
public class myFirstMod : Mod
{
public override void SetModInfo(out string name, ref ModProperties properties, properties.Autoload = true)
{
name = "myFirstMod";
}
}
}
Is there anything wrong here?
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace myFirstMod
{
public class myFirstMod : Mod
{
public override void SetModInfo(out string name, ref ModProperties properties, properties.Autoload = true)
{
name = "myFirstMod";
properties.Autoload = true; //This is where we set the properties.Autoload code so the mod will work as Eldrazi said.
}
}
}
Nope.Imagine if you could find complete codes for everything, ITEM, MeleeWeapon,RangedWeapon,MagicWeapon,Consumable etc etc...
People would copy that and be able to make huge mods without having to spend ages learning computer languages.
If someone here had just made that possible...
I wrote this but erased it again... What I wanted to say is that alot of people, by the looks of it, come here. What if they could make a gigantic mod in a matter of minutes with the right tool? Updates, yes, but with enough ideas and a tool to create with they'll complete their mod very fast. People are very creative.Nope.
New updates come out the whole thing would have to be updated.
Repositories, compiling, updates, time, willingness.
Such a "domain" of code wouldn't be possible just because you're too lazy to write some code.
It exists, it's called the source code.I wrote this but erased it again... What I wanted to say is that alot of people, by the looks of it, come here. What if they could make a gigantic mod in a matter of minutes with the right tool? Updates, yes, but with enough ideas and a tool to create with they'll complete their mod very fast. People are very creative.
I have a pic somewhere on my phone from the wikia saying "Terraria 1.3 coming out april 2014", let's just imagine that a super creative kid started making a mod and wanted to complete it, and was able to, before that april 2014, people would be able to play his mod for a very long time. I don't think the next update is coming very soon either....
Yes, can you redirect me to the sourcecode?It exists, it's called the source code.
Anyway, if everyone is just making clones of vanilla terraria items, modding would be extremely boring. Copy pasting is fine for getting an idea of the structure of a mod, but it is a crutch.
For example, imagine you wanted to make a minion and you came across the code for Stardust dragon (and everyone comes across the same code). People would shovel out stardust dragon clones (with various damage values) and all the mods would be extremely boring. It takes an understanding of how to actually code to make something unique worth anyone's time. (At least, for Minions and NPC behaviors. There are still a lot of copy paste opportunities in other aspects of modding.)
We can't share source code on the internet.Yes, can you redirect me to the sourcecode?
Could you show us the whole error + the code it's referring to?Can someone help me with this error
" error CS1001: Identifier expected"
i've been trying to make a mod but this comes up...
You're missing an opening curly bracket for your namespace.heres the code i made
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace RandomMod
public class RandomMod : Mod
{
public override void SetModInfo(out string name, ref ModProperties properties, properties.Autoload = true)
{
name = "RandomMod";
properties.Autoload = true;
}
}
}
The bracket is in the wrong place. Look at your class and where that opening bracket is. public class RandomMod so the bracket is *after* the name of the class. This applies to namespaces too.the error is still there,
heres the error
c:\Users\Person Person\Documents\My Games\Terraria\ModLoader\Mod Sources\RandomMod\RandomMod.cs(9,108) : error CS1001: Identifier expected
heres my code
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace{ RandomMod
public class RandomMod : Mod
{
public override void SetModInfo(out string name, ref ModProperties properties, properties.Autoload = true)
{
name = "RandomMod";
properties.Autoload = true;
}
}
}
can you help me?