Anonymous Player
Terrarian
Is there some sort of Step by Step thing for this? I find it confusing trying to install this.
Is there some sort of Step by Step thing for this? I find it confusing trying to install this.
To specify a name, you have to make it lowercase "item.name".I'm having a problem finishing this code for my custom vanity head. When I type item.Name I get an error saying "Property or indexer 'item.Name' cannot be assigned to -- it is read only." Also, Autoload says "Cannot find a suitable method to override." Can someone tell me what is wrong with my code?
What? No. Item names are defined in SetStaticDefaults().To specify a name, you have to make it lowercase "item.name".
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Item Name");
Tooltip.SetDefault("Tooltip Description");
}
What? No. Item names are defined in SetStaticDefaults().
Code:public override void SetStaticDefaults() { DisplayName.SetDefault("Item Name"); Tooltip.SetDefault("Tooltip Description"); }
I have a question: on a mac, how would I quickly switch between modded and vanilla terraria? All descriptions of how to do this are made for windows. All of said descriptions (as far as I can tell) don't work on mac. If someone could help that'd be much appreciated. Thanks![]()
how did you do that little box you got for your replies and junk?I didn't forget about that, at least not in my current version. Please note this is not in any way an up-to-date version. Here's an example of how you'd add a requiredTile
This is taken from a mod I'm currently working on ^^
Code:Recipes.QuickRecipe(this, ItemID.SlimeStaff, 1, new int[,] { { ItemID.Gel, 200 }, { ModItems.OddStaff, 1 } }, TileID.TinkerersWorkbench);
If you want the above example, I can give you that snippet really quick,
Code:public static void QuickRecipe(Mod mod, int createItemType, int createItemStack, int[,] requiredItemsArray, int requiredTile) { ModRecipe recipe = new ModRecipe(mod); for (int i = 0; i < requiredItemsArray.Length / 2; i++) { recipe.AddIngredient(requiredItemsArray[i, 0], requiredItemsArray[i, 1]); } recipe.AddTile(requiredTile); recipe.SetResult(createItemType, createItemStack); recipe.AddRecipe(); }
At the bottom right of someone's post, you can click the Reply link and it'll put it in your message as a quote block.how did you do that little box you got for your replies and junk?
Try this:I would like some help with a custom projectile, an animated one. All references I could find were outdated, and I've tried a lot. I have it in a gif and in a spritesheet png but neither shows up animated, but the projectile otherwise works fine. Here it is. Any help appreciated. Thanks.
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Lenicus");
Main.projFrames[projectile.type] = 7; //This is an animated projectile
}
public override void AI()
{
//this is projectile dust
int DustID2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width + 2, projectile.height + 2, mod.DustType("DustName"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 20, default(Color), 2.9f);
Main.dust[DustID2].noGravity = true;
//this make that the projectile faces the right way
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
projectile.localAI[0] += 1f;
projectile.alpha = (int)projectile.localAI[0] * 2;
if (projectile.localAI[0] > 130f) //projectile time left before disappears
{
projectile.Kill();
}
// Loop through the 56 animation frames, spending 15 ticks on each.
if (++projectile.frameCounter >= 15)
{
projectile.frameCounter = 0;
if (++projectile.frame >= 56)
{
projectile.frame = 0;
}
}
}
Thanks, but where are the animated projectiles in ExampleMod?Try this:
You should look at ExampleMod, that would help you with this sort of stuff.Code:public override void SetStaticDefaults() { DisplayName.SetDefault("Lenicus"); Main.projFrames[projectile.type] = 7; //This is an animated projectile } public override void AI() { //this is projectile dust int DustID2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width + 2, projectile.height + 2, mod.DustType("DustName"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 20, default(Color), 2.9f); Main.dust[DustID2].noGravity = true; //this make that the projectile faces the right way projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; projectile.localAI[0] += 1f; projectile.alpha = (int)projectile.localAI[0] * 2; if (projectile.localAI[0] > 130f) //projectile time left before disappears { projectile.Kill(); } // Loop through the 56 animation frames, spending 15 ticks on each. if (++projectile.frameCounter >= 15) { projectile.frameCounter = 0; if (++projectile.frame >= 56) { projectile.frame = 0; } } }
Make sure you use the spritesheet
no I meant for the junk like signatures etc.At the bottom right of someone's post, you can click the Reply link and it'll put it in your message as a quote block.
Or do you mean the code?
Press the Insert button next to the arrows and press Code
![]()