BlueWaterMelon
Golem
there is two why and the first one doesn't work so there is an other copy the file and paste it in the terraria folder and i have already the older version there
c:\Users\Dominik\Documents\My Games\Terraria\ModLoader\Mod Sources\TheRebirthMod\TheRebirthMod.cs(8,26) : error CS0115: 'TheRebirthMod.TheRebirthMod
using System;
using Terraria;
using Terraria.ModLoader;
namespace TheRebirthMod {
public class TheRebirthMod : Mod
{
public override void SetModInfo(out string name, ref ModProperties properties)
{
name = "TheRebirthMod";
properties.Autoload = true;
}
}}
public class IchorKnife : ModItem
{
public int durability = 1000;
public override void SetDefaults()
{
item.name = "Ichor Knife";
item.toolTip = "Decreases target's defense";
item.autoReuse = true;
item.useStyle = 1;
item.shootSpeed = 12f;
item.damage = 29;
item.width = 18;
item.height = 20;
item.useSound = 39;
item.useAnimation = 16;
item.useTime = 16;
item.noUseGraphic = true;
item.noMelee = true;
item.value = Item.sellPrice(0, 20, 0, 0);
item.knockBack = 2.75f;
item.melee = true;
item.rare = 8;
item.shoot = mod.ProjectileType("IchorKnifeProjectile");
}
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Main.spriteBatch.DrawString(Main.fontItemStack, durability.ToString(), new Vector2(position.X - 8f, position.Y + 11f), Color.White, 0f, default(Vector2), scale, SpriteEffects.None, 0f);
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
durability--;
return true;
}
public override bool CanUseItem(Player player)
{
return durability > 0;
}
public override void SaveCustomData(BinaryWriter writer)
{
writer.Write(durability);
}
public override void LoadCustomData(BinaryReader reader)
{
durability = reader.ReadInt32();
}
public class IchorKnifeProjectile : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Ichor Knife";
projectile.alpha = 0;
projectile.scale = 1f;
projectile.width = 14;
projectile.height = 28;
projectile.aiStyle = 2;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.melee = true;
//projectile.light = 0.2f;
projectile.ignoreWater = true;
//aiType = 48;
}
public override bool PreAI()
{
Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 1f, 1f, 0f);
int d = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 169, 0f, 0f, 100, default(Color), 1f);
if (Main.rand.Next(2) == 0)
{
Main.dust[d].noGravity = true;
Main.dust[d].scale *= 1.5f;
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
projectile.ai[0] += 1f;
if (projectile.ai[0] >= 35f)
{
projectile.velocity.Y = projectile.velocity.Y + 0.4f;
projectile.velocity.X = projectile.velocity.X * 0.97f;
}
if (projectile.velocity.Y > 16f)
{
projectile.velocity.Y = 16f;
}
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(69, 600, false);
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1);
return true;
}
public class IchorKnifeOnPickup : ModItem
{
public override void SetDefaults()
{
item.name = "Ichor Knife";
item.consumable = true;
item.maxStack = 1000;
item.width = 18;
item.height = 20;
item.rare = 8;
}
public override bool OnPickup(Player player)
{
for (int i = 0; i < 51; i++)
{
Item item2 = player.inventory[i];
if (item2.stack > 0 && item2.type > 0 && item2.type == mod.ItemType("IchorKnife"))
{
if (((IchorKnife)item2.modItem).durability <= 999)
{
Main.PlaySound(7, (int)player.position.X, (int)player.position.Y, 0);
ItemText.NewText(item, item.stack, false, false);
((IchorKnife)item2.modItem).durability += item.stack;
break;
}
}
if (i == 50)
{
int a = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, mod.ItemType("IchorKnifeOnPickup"), item.stack, false, 0, false, false);
Main.item[a].noGrabDelay = 60;
}
}
return false;
}
the errorthe codeCode:c:\Users\Dominik\Documents\My Games\Terraria\ModLoader\Mod Sources\TheRebirthMod\TheRebirthMod.cs(8,26) : error CS0115: 'TheRebirthMod.TheRebirthMod
Code:using System; using Terraria; using Terraria.ModLoader; namespace TheRebirthMod { public class TheRebirthMod : Mod { public override void SetModInfo(out string name, ref ModProperties properties) { name = "TheRebirthMod"; properties.Autoload = true; } }}
No. You can draw projectiles behind tiles if you want with DrawBehind.Is there a way to draw dusts behind tiles?
Thanks! Good to know.No. You can draw projectiles behind tiles if you want with DrawBehind.
When you build, it should show up in the Mods menu. I'm not sure if it is automatically enabled, so enable it and reload, then go in game and see if your recipes worked.When you build a mod how do you test it, where does the build go?
There are issues with Mac/Linux and the mod browser. Download mods from the threads here.ERROR: can open up the 'Mod Browser", but can't search or something other.
Please fix!
[P.S.: I'm on mac]
Well, from my understanding, everything you could do with json you can just do in the SetDefaults method:Can you please make tmodloader as easy to mod as tAPI? i just don't understand how to mod using .cs files
{
"code": "MissileLauncher",
"displayName": "Missile Launcher",
"tooltip": ["Fires Missiles"],
"size": [24,16],
"scale": 0.8,
"maxStack": 1,
"value": [0,2,0,0],
"useStyle": 5,
"useAnimation": 8,
"useTime": 8,
"damage": 20,
"rare": 1,
"noUseGraphic": true,
"knockback": 5.5,
"autoReuse": false,
"useSound": "MetroidMod:MissileShot",
"shoot": "MetroidMod:MissileProj",
"shootSpeed": 15,
"noMelee": true,
"ranged": true,
"recipes":
[{
"items": { "Meteorite Bar": 10, "Musket": 1, "Grenade": 3 },
"tiles": [ "Anvil" ],
"creates": 1
},
{
"items": { "Meteorite Bar": 10, "The Undertaker": 1, "Grenade": 3 },
"tiles": [ "Anvil" ],
"creates": 1
}]
}
using Terraria.ID;
using Terraria.ModLoader;
namespace ExampleMod.Items
{
public class MissileLauncher : ModItem
{
public override void SetDefaults()
{
item.name = "Missile Launcher";
item.toolTip = "Fires Missiles";
item.width = 24;
item.height = 16;
item.scale = 0.8f;
item.maxStack = 1;
item.value = 200000;
item.useStyle = 5;
item.useAnimation = 8;
item.useTime = 8;
item.damage = 20;
item.rare = 1;
item.noUseGraphic = true;
item.knockBack = 5.5f;
item.autoReuse = true;
item.useSound = mod.GetSoundSlot(SoundType.Item, "MissileShot");
item.shoot = mod.ProjectileType("MissileProj");
item.shootSpeed = 15;
item.noMelee = true;
item.ranged = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MeteoriteBar, 10);
recipe.AddIngredient(ItemID.Musket, 1);
recipe.AddIngredient(ItemID.Grenade, 3);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this, 1);
recipe.AddRecipe();
recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MeteoriteBar, 10);
recipe.AddIngredient(ItemID.TheUndertaker, 1);
recipe.AddIngredient(ItemID.Grenade, 3);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this, 1);
recipe.AddRecipe();
}
}
}
how do you make a item be dropped by an npc(including Precentge)
em could if give me a example