yess, you are doing it right, where did you put the second code, does it show up at the merchant?
Hi! Since Terraria code is too annoying, I just CAN'T figure out how to properly create a new item.
Inspired by MrBlueSL, I want to make a item that switch between day and night.
What I have right now:
Item.cs
Player.csCode:else if (this.type == 1966) { this.channel = true; this.damage = 0; this.useStyle = 4; this.name = "Day Orb"; this.shoot = 18; this.width = 24; this.height = 24; this.useSound = 8; this.useAnimation = 20; this.useTime = 20; this.rare = 1; this.noMelee = true; this.toolTip = "Summons the day"; this.value = Item.sellPrice(1, 0, 0, 0); this.color = new Color(189, 173, 23, 200); }
aaand I put it to sell at the merchant.Code:if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1966) { Main.dayTime = true; Main.time = 0.0; }
What I have to do now? I am doing right until here?
Thanks!
yess, you are doing it right, where did you put the second code, does it show up at the merchant?
I put my code right after this:
I don't know where I can edit how an item works, but I found this.. looks like when item type 1959 is used, a buff is added to the player.Code:if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1959) { this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); }
So I just create my own line, but changing Main.dayTime to true and Main.time to 0.0
Another thing: I've changed all variables that put a limit on how many items the game can have (added 1) AND I created a texture for my item, exported it to .xnb, but nothing happens
And no, the item doesn't show up at the merchant..