Need help knowing whats wrong with my code!

jamiesmith9255

Steampunker
I was ok back in the day using Tapi and its been over 2 or so years since i'v modded and i'm vary rusty i want to know if some one can give me a hand on what i'm doing wrong? I foe a basic Sword.

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

namespace YourModName.Items.Weapons //where is located
{
public class YourSword : ModItem
{
public override void SetDefaults()
{
item.name = "Test Blade"; //Sword name
item.damage = 130; //Sword damage
item.melee = true; //if it's melee
item.width = 78; //Sword width
item.height = 78; //Sword height
item.toolTip = "My Best Moded Sword"; //Item Description
item.useTime = 25; //how fast
item.useAnimation = 25;
item.useStyle = 1; //Style is how this item is used, 1 is the style of the sword
item.knockBack = 5; //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("YourProjectileName");
item.shootSpeed = 8f; //projectile speed
}
public override void AddRecipes() //How to craft this sword
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1); //you need 1 DirtBlock
recipe.AddTile(TileID.WorkBenches); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}
 
Failed to load C:\Users\Brown\Documents\My Games\Terraria\ModLoader\Mod Sources\TestBlade\build.txt
System.FormatException: Input string was not in a correct format.
at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent)
at System.Version.TryParseVersion(String version, VersionResult& result)
at System.Version.Parse(String input)
at System.Version..ctor(String version)
at Terraria.ModLoader.BuildProperties.ReadBuildFile(String modDir)
at Terraria.ModLoader.ModCompile.ReadProperties(String modFolder, IBuildStatus status)
 
Failed to load C:\Users\Brown\Documents\My Games\Terraria\ModLoader\Mod Sources\TestBlade\build.txt
System.FormatException: Input string was not in a correct format.
at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent)
at System.Version.TryParseVersion(String version, VersionResult& result)
at System.Version.Parse(String input)
at System.Version..ctor(String version)
at Terraria.ModLoader.BuildProperties.ReadBuildFile(String modDir)
at Terraria.ModLoader.ModCompile.ReadProperties(String modFolder, IBuildStatus status)
k, that's the version string in build.txt.

It should be "version = 0.2" or something like that. No letters, 2 to 4 numbers separated by periods.
 
I,m a bit lost on what your saying as this is my first with C,s files and not use to it. still is there a way you can put it in term were i can understand or if there is a way show me what you mean? Also thank you i'v been wanting to learn for a long time how C,s works but it seemed hard well to me and its been so long so thank you so far for helping me.
 
I,m a bit lost on what your saying as this is my first with C,s files and not use to it. still is there a way you can put it in term were i can understand or if there is a way show me what you mean? Also thank you i'v been wanting to learn for a long time how C,s works but it seemed hard well to me and its been so long so thank you so far for helping me.
I was saying you had an error in the file named build.txt. The version must conform to the format. If you'd like, you can use this generator to generate a simple working mod that you can build off of: http://javid.ddns.net/tModLoader/generator/ModSkeletonGenerator.html

Or, you can use it to see the correct format for the build.txt file
 
Thank you vary much and by the way i see how much you help others on the forums i just want to say your a vary kind person for that and shows your appreciation for others. I will see if it helps me out even more and i think it will!
[doublepost=1461493148,1461492649][/doublepost]well I just put in the simple lay out but it's telling me thing :sigh:

error CS0006: Metadata file 'C:\Users\Brown\Desktop\Terraria\ModCompile\tModLoaderMac.exe' could not be found
 
Thank you vary much and by the way i see how much you help others on the forums i just want to say your a vary kind person for that and shows your appreciation for others. I will see if it helps me out even more and i think it will!
[doublepost=1461493148,1461492649][/doublepost]well I just put in the simple lay out but it's telling me thing :sigh:

error CS0006: Metadata file 'C:\Users\Brown\Desktop\Terraria\ModCompile\tModLoaderMac.exe' could not be found
The install instructions for tmodloader tell you to copy in all the files from the zip. Go do that. Also, is that the directory where the Terraria.exe is stored?
 
Ok so I found out what happen xD my Norton Security blocked it due to it being a new (Being a 3 days or so new) file last time i downloaded it and i must of not seen it or walked away when it did it. So now i have it. That was the last time i downloaded it and now that i did it agin i see what went wrong files that are less the 2 weeks old get blocked unless i unblock them so thanks i would have not known that was the problem. `:D
 
Back
Top Bottom