When will Tmodloader be 1.4 compatible
To Al0n37 does have an outdated code. Add "Player player," to and public override void HorizontalWingSpeeds(ref float speed, ref float acceleration) and public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(10,30) : error CS0115: 'noname.Items.WingsName.Autoload(ref string, ref string, System.Collections.Generic.IList<Terraria.ModLoader.EquipType>)': no se encontró ningún miembro adecuado que invalidar
c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(32,30) : error CS0115: 'noname.Items.WingsName.VerticalWingSpeeds(ref float, ref float, ref float, ref float, ref float)': no se encontró ningún miembro adecuado que invalidar
c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(42,30) : error CS0115: 'noname.Items.WingsName.HorizontalWingSpeeds(ref float, ref float)': no se encontró ningún miembro adecuado que invalidar
(sorry i have terraria in spanish)
code:
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace noname.Items
{
public class LatormWings : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}
public override void SetDefaults()
{
item.name = "LatormWings";
item.width = 22;
item.height = 20;
item.toolTip = "";
item.value = 10000;
item.rare = 4;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = 10; //wings Height
}
public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising,
ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentMultiplier = 3f;
constantAscend = 0.135f;
}
public override void HorizontalWingSpeeds(ref float speed, ref float acceleration)
{
speed = 9f;
acceleration *= 2.5f;
}
public override void AddRecipes() //How to craft this item
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "latorm", 10); //you need 10 Wood
recipe.AddTile(TileID.anvil); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
the code is from Al0n37 . i think i have this error because its outdated
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace noname.Items
{
public class LatormWings : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}
public override void SetStaticDefaults() {
DisplayName.SetDefault("LatormWings");
Tooltip.SetDefault("");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 20;
item.value = 10000;
item.rare = 4;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = 10; //wings Height
}
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentMultiplier = 3f;
constantAscend = 0.135f;
}
public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
{
speed = 9f;
acceleration *= 2.5f;
}
public override void AddRecipes() //How to craft this item
{
ModRecipe recipe = new ModRecipe (mod);
recipe.AddIngredient(null, "latorm", 10);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Are you using the 64-bit version?When will version v0.11.7.5 come out?
I don't see something wrong with this NPC other than it have no defense at all.I'm pretty new to modding, I have done it for only a couple of days, and I need help. For some reason, some of my enemies despawn instantly when coming into contact with about 75% of my modded weapons. Can you figure out why, and help me? I'll attach code of one of the enemies. (I know that this enemy will not spawn by the way.)
public class Legs : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Legs");
Main.npcFrameCount[npc.type] = Main.npcFrameCount[NPCID.Harpy];
}
public override void SetDefaults()
{
npc.width = 32;
npc.height = 32;
npc.lifeMax = 1000;
npc.damage = 25;
npc.defense = 0;
npc.HitSound = SoundID.NPCHit17;
npc.DeathSound = SoundID.NPCDeath15;
npc.value = 7500f;
npc.knockBackResist = 1f;
npc.aiStyle = 26;
aiType = NPCID.Unicorn;
animationType = NPCID.Zombie;
}
public override void HitEffect(int hitDirection, double damage)
{
for (int i = 0; i < 10; i++)
{
int dustType = 5;
int dustIndex = Dust.NewDust(npc.position, npc.width, npc.height, dustType);
Dust dust = Main.dust[dustIndex];
dust.velocity.X = dust.velocity.X + Main.rand.Next(-50, 51) * 0.01f;
dust.velocity.Y = dust.velocity.Y + Main.rand.Next(-50, 51) * 0.01f;
dust.scale *= 1f + Main.rand.Next(-30, 31) * 0.01f;
}
}
}
I don't see something wrong with this NPC other than it have no defense at all.
There may be a chance the error is caused by the 75% of your weapons, so you may want to attach your weapon code too.
Nothing wrong with that either... The extremely high damage of the weapon and the absolute zero defense of the NPC might've caused it to die immediately. Another thing that could've happened was that your sound was off and the NPC did not have gore.Here's one of the weapons that always instantly kills enemies.
public class FirebloomSpellbook : ModItem
{
public override void SetDefaults()
{
item.damage = 500;
item.magic = true;
item.mana = 10;
item.width = 28;
item.height = 32;
item.useTime = 75;
item.useAnimation = 75;
item.useStyle = 5;
item.knockBack = 10;
item.value = 30000;
item.rare = 8;
item.UseSound = SoundID.Item88;
item.autoReuse = true;
item.shootSpeed = 15f;
item.shoot = 85;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float numberProjectiles = 20;
float rotation = MathHelper.ToRadians(180);
position += Vector2.Normalize(new Vector2(speedX, speedY)) * 180f;
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1))) * .2f; // Watch out for dividing by 0 if there is only 1 projectile.
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
}
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<Upgrade>(), 1);
recipe.AddIngredient(ItemID.FlowerofFire, 1);
recipe.AddIngredient(ItemID.Sunflower, 5);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
public override void SetDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.newTile.AnchorWall = true;
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 };
TileObjectData.addTile(Type);
disableSmartCursor = true;
}
public override void SetDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
//TileObjectData.newTile.AnchorWall = true;
TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 };
TileObjectData.addTile(Type);
disableSmartCursor = true;
}
I'm using the 32-bit version why?Are you using the 64-bit version?
The 64-bit version is a more experimental than public mode. It is slower on updates, if you wait long enough, the 64-bit Tmodloader may catch up.I'm using the 32-bit version why?
public override bool CanUseItem(Player player){ //right click functionality
if (player.altFunctionUse == 2){
item.UseSound = SoundID.Item100;//placeholder
item.useStyle = ItemUseStyleID.HoldingUp;
item.useTime = 10;//placeholder
item.useAnimation = 10;//placeholder
item.noMelee = true;
item.buffType = ModContent.BuffType<GhostbladeBuff>();
item.buffTime = 360;
}
else {
item.UseSound = SoundID.Item1;
item.useStyle = ItemUseStyleID.SwingThrow;
item.useTime = 10;
item.useAnimation = 25;
item.noMelee = false;
}
return base.CanUseItem(player);
}
Aint working appears 1 error idk why (changed "name" and "texture" putted back these things but keep appearing the error)To Al0n37 does have an outdated code. Add "Player player," to and public override void HorizontalWingSpeeds(ref float speed, ref float acceleration) and public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
There are some extra errors I have noticed:
TileID.anvil is not the ID for an anvil, it should be this instead: TileID.Anvils
In SetDefaults, item.toolTip = ""; and item.name = "LatormWings"; is outdated. Instead, make a new class thingy called SetStaticDefaults
public override void SetStaticDefaults() {
DisplayName.SetDefault("LatormWings");
Tooltip.SetDefault("");
}
C#:using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace noname.Items { public class LatormWings : ModItem { public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips) { equips.Add(EquipType.Wings); return true; } public override void SetStaticDefaults() { DisplayName.SetDefault("LatormWings"); Tooltip.SetDefault(""); } public override void SetDefaults() { item.width = 22; item.height = 20; item.value = 10000; item.rare = 4; item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { player.wingTimeMax = 10; //wings Height } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { ascentWhenFalling = 0.85f; ascentWhenRising = 0.15f; maxCanAscendMultiplier = 1f; maxAscentMultiplier = 3f; constantAscend = 0.135f; } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) { speed = 9f; acceleration *= 2.5f; } public override void AddRecipes() //How to craft this item { ModRecipe recipe = new ModRecipe (mod); recipe.AddIngredient(null, "latorm", 10); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); } } }
I hope that works!
P.S: There is another modding tutorial video called Modding Master class made by Lynx on youtube, although cancelled for 1.4, it is up to date.
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace noname.Items
{
public class LatormWings : ModItem
{
public override bool Autoload(ref string LatormWings, ref string LatormWings_Wings, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}
public override void SetStaticDefaults() {
DisplayName.SetDefault("LatormWings");
Tooltip.SetDefault("a");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 20;
item.value = 10000;
item.rare = 4;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = 10; //wings Height
}
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentMultiplier = 3f;
constantAscend = 0.135f;
}
public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
{
speed = 9f;
acceleration *= 2.5f;
}
public override void AddRecipes() //How to craft this item
{
ModRecipe recipe = new ModRecipe (mod);
recipe.AddIngredient(null, "latorm", 10);
recipe.AddTile(TileID.Anvils);
}
}
}
Whenever you have this type of error: no suitable method found to override. You simply replace 'override' with 'static' or 'virtual'Aint working appears 1 error idk why (changed "name" and "texture" putted back these things but keep appearing the error)
C#:using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace noname.Items { public class LatormWings : ModItem { public override bool Autoload(ref string LatormWings, ref string LatormWings_Wings, IList<EquipType> equips) { equips.Add(EquipType.Wings); return true; } public override void SetStaticDefaults() { DisplayName.SetDefault("LatormWings"); Tooltip.SetDefault("a"); } public override void SetDefaults() { item.width = 22; item.height = 20; item.value = 10000; item.rare = 4; item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { player.wingTimeMax = 10; //wings Height } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { ascentWhenFalling = 0.85f; ascentWhenRising = 0.15f; maxCanAscendMultiplier = 1f; maxAscentMultiplier = 3f; constantAscend = 0.135f; } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) { speed = 9f; acceleration *= 2.5f; } public override void AddRecipes() //How to craft this item { ModRecipe recipe = new ModRecipe (mod); recipe.AddIngredient(null, "latorm", 10); recipe.AddTile(TileID.Anvils); } } }
error:[19:31:52] [8/ERROR] [tML]: C:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(19,29) : error CS0115: 'LatormWings.Autoload(ref string, ref string, IList<EquipType>)': no suitable method found to override
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace noname.Items
{
public class LatormWings : ModItem
{
public virtual bool Autoload(ref string LatormWings, ref string LatormWings_Wings, IList<EquipType> equips) // you can also do static.
{
equips.Add(EquipType.Wings);
return true;
}
public override void SetStaticDefaults() {
DisplayName.SetDefault("LatormWings");
Tooltip.SetDefault("a");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 20;
item.value = 10000;
item.rare = 4;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = 10; //wings Height
}
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentMultiplier = 3f;
constantAscend = 0.135f;
}
public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
{
speed = 9f;
acceleration *= 2.5f;
}
public override void AddRecipes() //How to craft this item
{
ModRecipe recipe = new ModRecipe (mod);
recipe.AddIngredient(null, "latorm", 10);
recipe.AddTile(TileID.Anvils);
}
}
}