Kid Gaara
Terrarian
What is the number?Knockback is a weird value, something ludicrous like that won't do that much because the max knockback caps at a much smaller number.
What is the number?Knockback is a weird value, something ludicrous like that won't do that much because the max knockback caps at a much smaller number.
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.
Your code is't right, as far as I can tell. It should look something more like this:I put these files in, probably doing something stupid
They didnt show up in mymods area of tmod
I did put them in the mods folder.
This is the code of it
{
"displayName": "Test Weapon",
"texture": "Item/TestWeapon",
"size": [64, 64],
"maxStack": 1,
"value": [100, 0, 0, 0],
"rare": 7,
"tooltip": "My sword for testing, in mint condition.",
"useStyle": 1,
"useAnimation": 50,
"useTime": 50,
"damage": 100,
"knockback": 10,
"useSound": 1,
"autoReuse": true,
"useTurn": true,
"melee": true,
"recipes":[{
"items": { "Dirt Block": 1 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}
Can someone go through and find out why it doesnt show up in my mods folder? It has an .enable file, and it is a .tmod file.
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace MOD.Items.Weapons //where is located
{
public class Test : ModItem
{
public override void SetDefaults()
{
item.name = "Test"; //Sword name
item.damage = 9999; //Sword damage
item.melee = true; //if it's melee
item.width = 200; //Sword width
item.height = 200; //Sword height
item.toolTip = "Tooltip"; //Item Description
item.useTime = 100; //how fast
item.useAnimation = 25;
item.useStyle = 1; //Style is how this item is used, 1 is the style of the sword
item.knockBack = 100; //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;
}
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();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
player.AddBuff(mod.BuffType("BuffName"), 400); //400 is the buff time
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.Next(1) == 0)
{
}
}
}
}
May i borrow this as a template?Your code is't right, as far as I can tell. It should look something more like this:
Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace MOD.Items.Weapons //where is located { public class Test : ModItem { public override void SetDefaults() { item.name = "Test"; //Sword name item.damage = 9999; //Sword damage item.melee = true; //if it's melee item.width = 200; //Sword width item.height = 200; //Sword height item.toolTip = "Tooltip"; //Item Description item.useTime = 100; //how fast item.useAnimation = 25; item.useStyle = 1; //Style is how this item is used, 1 is the style of the sword item.knockBack = 100; //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; } 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(); } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { player.AddBuff(mod.BuffType("BuffName"), 400); //400 is the buff time } public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.Next(1) == 0) { } } } }
Go right ahead! also, make sure to save it as a .cs file.May i borrow this as a template?
One question, what about the sprite of the sword? Where is that in there?Go right ahead! also, make sure to save it as a .cs file.
Just name the image the same as the .cs file and you will be fine.One question, what about the sprite of the sword? Where is that in there?
Thanks! Time to start making it.Just name the image the same as the .cs file and you will be fine.
Another question, do i have to delete the things that say //before themJust name the image the same as the .cs file and you will be fine.
Thanks! Time to start making it.
[doublepost=1480101413,1480101271][/doublepost]
Another question, do i have to delete the things that say //before them
Nice.before the // you need that. Those are all statements. Anything that starts with // is a comment and will be ignored when compiled. Each statement ends with a semicolon ;
Can anyone help me with my little problem?Umm...?
Help??Code: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.
To do that, you have to find out what a reference is, and delete the duplicate reference. Atleast thats how it seems when I read the error report.Can anyone help me with my little problem?
Thats where i got my original coding, the one that didnt work.Can anyone help me with my little problem?
[doublepost=1480103881,1480103585][/doublepost]@Kid Gaara may I suggest, Al0n37 has tutorials on their youtube channel, and they may help you out He/She has a lot of modding tutorials on their channel for terraria, covering everything.
I got it from there because i am a noob at coding, and i am trying to learn the basics.Can anyone help me with my little problem?
[doublepost=1480103881,1480103585][/doublepost]@Kid Gaara may I suggest, Al0n37 has tutorials on their youtube channel, and they may help you out He/She has a lot of modding tutorials on their channel for terraria, covering everything.
Oh, you just put it in your mods folder? Actually, there is a lot more than that. You have to have a folder with a whole bunch of stuff, and put it into mod sources. In Al0n37's newer videos, they include a link for where you can download the whole tutorial mod folder. Put it in Mod Sources, then go into the Terraria main screen >mod sources > Build and reload the modTo do that, you have to find out what a reference is, and delete the duplicate reference. Atleast thats how it seems when I read the error report.
Where did you put your file? I put mine in the mods folder, it is a .cs file, but it didnt show up.
[doublepost=1480103957,1480103893][/doublepost]
Thats where i got my original coding, the one that didnt work.
Why is it taking so long? Is it hard to code all the new stuff from 1.3.4?
It's Thanksgiving week, we are away from our computers. Plus we have school. And yes, lots has changed in 1.3.4.Why is it taking so long? Is it hard to code all the new stuff from 1.3.4?
Never mind. I got it in Mod sources as necassary.Just one more thing. An error report.Oh, you just put it in your mods folder? Actually, there is a lot more than that. You have to have a folder with a whole bunch of stuff, and put it into mod sources. In Al0n37's newer videos, they include a link for where you can download the whole tutorial mod folder. Put it in Mod Sources, then go into the Terraria main screen >mod sources > Build and reload the mod