Brass Scientist Layn π΄
Torch God
I am making a mod and since I'm not experienced with programming there are some errors, so this thread is for people to help me with that
using Terraria;
using Terraria.ModLoader;
namespace PowerRising.Dusts
{
public class HeroDust : ModDust
{
public override void OnSpawn(Dust dust)
{
dust.noGravity = true;
dust.noLight = false;
dust.scale = 2f;
}
}
}
It worked!Sorry if you have already fixed this but here is the solution. As the error message states it is expecting a } to close a { . So your code wasn't really wrong it was just formatted incorrectly. There were also a few other errors in your code that I fixed too.
Fixed code:
C#:using Terraria; using Terraria.ModLoader; namespace PowerRising.Dusts { public class HeroDust : ModDust { public override void OnSpawn(Dust dust) { dust.noGravity = true; dust.noLight = false; dust.scale = 2f; } } }
If you have any other errors post them here and I will try to respond as fast as I can.
The trail is green but that's just cause I snatched TerraBlade code.
It also forms the trail too far back.
View attachment 351622
I'm tryna make it red coloured.Send me the code of the sword so I can try to fix the dust trail. Also, are you trying to make the dust another color? If so tell me what color.
I'm tryna make it red coloured.
int num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.25f);
Main.dust[num309].velocity *= -0.25f;
num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.25f);
Main.dust[num309].velocity *= -0.25f;
Main.dust[num309].position -= projectile.velocity * 0.5f;
public override void AI()
{
Vector2 dustPosition = projectile.Center + new Vector2(Main.rand.Next(-4, 5), Main.rand.Next(-4, 5));
Dust dust = Dust.NewDustPerfect(dustPosition, ModContent.DustType<HeroDust>(), null, 100, Color.Red, 0.8f);
}
using PowerRising.Dusts;
Not what I intended the texture to look like but it's still cool so I'm gonna keep it
View attachment 351655
You are calling for a vanilla ItemID but using the ID for a modded item.View attachment 351662
recipe.AddIngredient(ItemID.DragonEssence, 1);
recipe.AddIngredient(null, "NameOfModdedItemHere");
Thanks!You are calling for a vanilla ItemID but using the ID for a modded item.
Try replaceing it with mod.ItemType("DragonEssence");
ItemID only works with items from vanilla Terraria. For example, ff you were tying to call for a modded projectile you would use mod.ProjectileType . Or for a tile, you would use mod.TileType .
Hope this helps!
EDIT: I posted this a few minutes ago and saw that you were using this as a recipe and I wanted to show another way you could do this specifically for recipes.
Code:recipe.AddIngredient(null, "NameOfModdedItemHere");
This should also work but I would only recommend using it in recipes.
Sorry if this gets complex but armor textures can be complicated .View attachment 351682
View attachment 351683
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace RisingPower.Items.Armor
{
[AutoloadEquip(EquipType.Body)]
public class HeroChestplate : ModItem
{
public override void SetStaticDefaults()
{
base.SetStaticDefaults();
DisplayName.SetDefault("Hero Chestplate");
Tooltip.SetDefault("This is a piece of the legendary Hero Armor.");
}
public override void SetDefaults()
{
item.width = 18;
item.height = 18;
item.value = 10;
item.rare = 8;
item.defense = 35;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BeetleScaleMail);
recipe.AddIngredient(mod.ItemType("DragonEssence"));
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
recipe.AddIngredient(ItemID.BeetleShell);
recipe.AddIngredient(mod.ItemType("DragonEssence"));
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Thanks! I have the sprites for the female and armsSorry if this gets complex but armor textures can be complicated .
This error means you are missing a texture for an item. Chestplates need multiple textures all with different purposes to work. First, rename your texture called "HerosChestplate" to "HerosChestplate_Body" Then, you will also need to get textures for "HerosChestplate_Arms" and "HerosChestplate_FemaleBody" and a texture just named "HerosChestplate" which will be the texture you see when you have the item in your inventory.
Here are a few sample textures for those so you can get an idea of what they need to look like.
Arms texture:
FemaleBody texture(For this one I would recommend just copy/pastinging your already existing HerosChestplate_Body texture):
ItemTexture(What you would see in inventory):
Hopefully I could help you with this, sorry if my explanation was too complicated.