Standalone [1.3] tModLoader - A Modding API

error CS1703: An assembly with the same identity 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' has already been imported. Try removing one of the duplicate references.

What am i doing wrong?:confused:

Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace TrueBlades.Items.Weapons  
{
    public class TrueHorsemansBlade : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "True Horseman's Blade";    
            item.damage = 201;           
            item.melee = true;           
            item.width = 65;              //Sword width
            item.height = 65;             //Sword height
            item.toolTip =   //Item Description
            item.useTime = 20;          //how fast
            item.useAnimation = 25;
            item.useStyle = 1;        //Style is how this item is used, 1 is the style of the sword
            item.knockBack = 10;      //Sword knockback
            item.value = 100;
            item.rare = 10;
            item.useSound = 1;       //1 is the sound of the sword
            item.autoReuse = true;   //if it's capable of autoswing.
            item.useTurn = true;
            item.shoot = mod.ProjectileType();
            item.shootSpeed = 8f;                //projectile speed                
        }
        public override void AddRecipes()  //How to craft this sword
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.TheHorsemansBlade, 1826);
            recipe.AddIngredient(ItemID.BrokenHeroSword, 1570);
        recipe.AddTile(TileID.MythrillAnvil);
        recipe.AddTile(TileID.OrichalcumAnvil);
        recipe.SetResult(this);    
        recipe.AddRecipe();

        }
        public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            player.AddBuff(mod.BuffType(), 400);  //400 is the buff time
        }
        public override void MeleeEffects(Player player, Rectangle hitbox)
        {
            if (Main.rand.Next(1) == 0)
            {
                int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("DustName"));
            }
        }
    }
}
 
Hello again! @jopojelly, I got dem red squigglys at the bottom last bracket, it says 'Identifier expected'View attachment 150269

At a glance, I can see a few problems with that particular line.

1. Identifiers cannot have spaces, not sure if those are properly underscored or not, but if they are not, you will need to remove those spaces.
2. Are you trying to call a function named "The"? Anything inside of parenthesis will be treated as a function call.
3. The comma inside there should be a period, and the period at the end should not be there.
 
hey can you fix the bug with the tmod loader mod brouser its not letting me download mods it keeps saying to haevy
[doublepost=1480809633,1480809514][/doublepost]plz fix brousing to get mods it broke and my game reset and all my stuff is mods that I cant get by using the "old fashion" way I cant plz fix thx is so
[doublepost=1480809749][/doublepost]nvm! it fixed it self :D
 
I just have a small question about tmodloader: Where is the wavebank file that tmodloader uses? Or does tmodloader use tracks from the normal terraria wavebank file?
 
I
At a glance, I can see a few problems with that particular line.

1. Identifiers cannot have spaces, not sure if those are properly underscored or not, but if they are not, you will need to remove those spaces.
2. Are you trying to call a function named "The"? Anything inside of parenthesis will be treated as a function call.
3. The comma inside there should be a period, and the period at the end should not be there.
I'll be honest, I think I rushed into coding. I have no idea what I'm doing, do you know any resources to help me understand this complicated art? Ty
[doublepost=1480827156,1480826856][/doublepost]Cheers all! My mod did not work again while Building + Reloading!
c:\Users\_____\Documents\My Games\Terraria\ModLoader\Mod Sources\The Dank Mod\The Dank Mod.cs(30,5) : error CS1519: Invalid token '}' in class, struct, or interface member declaration

c:\Users\_____\Documents\My Games\Terraria\ModLoader\Mod Sources\The Dank Mod\Items\Weapons\The Feminist's Blade.cs(6,18) : error CS0101: The namespace 'TheDankMod.Items.Weapons' already contains a definition for 'TheFeministsBlade'
 
Is this going to be updates for the newest version of Terraria any time soon? I really wanna play the newest Thorium update alongside the newest vanilla.
 
Is this going to be updates for the newest version of Terraria any time soon? I really wanna play the newest Thorium update alongside the newest vanilla.
Patience please, I know you wanna beat the sh:red:t out of The Old One's Army with modded weapons but c'mon, the devs are trying their hardest
 
Heeeeelooooo!! This is the kid who can't do jack sh:red:t with coding!! This is what I got:
c:\Users\Masud\Documents\My Games\Terraria\ModLoader\Mod Sources\The Dank Mod\The Dank Mod.cs(30,5) : error CS1519: Invalid token '}' in class, struct, or interface member declaration
My code:
Capture5.PNG
 
So while we wait, how hard is it to update mods? I assume it's not just to change some version number somewhere, and you have to change a lot of stuff? Or do you have to just change a lot of the reference the updates changed?

Why does it take so long time? Is it just because the modd author doesn't have time, or is there a lot that needs to be change whenever Terraria updates? (have no clue about modding, just that it's almost always hard to update mods for the right game version on most games (except Bethesda games))
 
either my terraira is bugged or tmodloader it keeps crashing whenever it says initialising modloader it crash's btw using the normal Version and latest update
 
either my terraira is bugged or tmodloader it keeps crashing whenever it says initialising modloader it crash's btw using the normal Version and latest update

What Versions of TModloader and Terraria are you using?

If youre using 1.3.4 the Old ones Army will make you crash when bundled up with TModloader + Many Mods.

I myself did the Rookie mistake of Updating my Terraria to 1.3.4 without waiting for TModloader to do the same (It is still in Version 1.3.3, and Bluemagic123 said that his Team would wait for Update 1.3.4.1 to come Out before Updating).

Also nice Avatar :)
[doublepost=1480872820,1480872614][/doublepost]
Patience please, I know you wanna beat the sh:red:t out of The Old One's Army with modded weapons but c'mon, the devs are trying their hardest

You have one too many } , i think.
Or, like Kazzymodus said, you have an Empty Class and i am just to dumb to notice.
Try this:

Make a public class file named TheDankMod.Items.Weapons, or just TheDankMod.Items .
then, fill that class with attributes like: using Terraria.ID(Just write down the ones that are in terrarias actual Item/Melee Weapon file.)
note that you also need a New ID for your TheFeministBlade. (What kind of name is that :) ) The ID into both your TheFeministBlade category, as well as into your new melee weapon file.
If you want your weapon to be dropped as well, i recommend making a dummy monster with any small texture you want.
Oh and dont forget to use TModloader in your TheDankMod.Weapon class.

Kazzymodus, correct me if i am Wrong or missing something. (Highly possible.)
 
Last edited:
Heeeeelooooo!! This is the kid who can't do jack sh:red:t with coding!! This is what I got:
c:\Users\Masud\Documents\My Games\Terraria\ModLoader\Mod Sources\The Dank Mod\The Dank Mod.cs(30,5) : error CS1519: Invalid token '}' in class, struct, or interface member declaration
My code:
View attachment 150576
Like I said before, you're pasting a file path into an empty class, which makes no sense to the compiler. What are you trying to do, and why?
 
Sorry if am forgetting I think I asked already but is there way to fix "server under heavy load" for modbrowsers downloads? There is mods I am interested but they have broken download links.
Depends on the Spriter, really.

I myself cannot draw in real Life, so i just ask a Friend who sometimes draws for me.
But most of the time i use some sort of Preset like a Weapon Sprite that is already in the Game or on my Friends paper.



Oops wrong link.
 
Last edited:
What Versions of TModloader and Terraria are you using?

If youre using 1.3.4 the Old ones Army will make you crash when bundled up with TModloader + Many Mods.

I myself did the Rookie mistake of Updating my Terraria to 1.3.4 without waiting for TModloader to do the same (It is still in Version 1.3.3, and Bluemagic123 said that his Team would wait for Update 1.3.4.1 to come Out before Updating).

Also nice Avatar :)
[doublepost=1480872820,1480872614][/doublepost]

You have one too many } , i think.
But i have only 5 mods..

CalamityMod

ImkSushiMod

MaxStackPlus

VanillaTweaks

Wmitf

the only big mod here is the frist btw the frist time i tried it worked but now :I idk what happend
 
But i have only 5 mods..

CalamityMod

ImkSushiMod

MaxStackPlus

VanillaTweaks

Wmitf

the only big mod here is the frist btw the frist time i tried it worked but now :I idk what happend


Try different Combinations of those 5 Mods and try to find out which one is causing the Bug.
Or at least thats what i Do when a Mod for Terraria or MC is not Working.
My guess is that one of ImkSushiMods recipes has the same ID as one of Calamity Mods, but if thats the case you can use a Imks .json file to change the ID.
(I think)
 
Back
Top Bottom