Results 1 to 3 of 3
  1. #1
    yatchi's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0

    Question Making a new item

    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
    Code:
    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);
                }
    Player.cs
    Code:
    if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1966)
                    {
                        Main.dayTime = true;
                        Main.time = 0.0;
                    }
    aaand I put it to sell at the merchant.

    What I have to do now? I am doing right until here?

    Thanks!

  2. #2
    Tjessx's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    belgium
    Posts
    34
    Reputation
    10
    Thanks
    172
    yess, you are doing it right, where did you put the second code, does it show up at the merchant?

  3. #3
    yatchi's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    I put my code right after this:

    Code:
    if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1959)
                    {
                        this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true);
                    }
    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.

    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..

Similar Threads

  1. How can make a new KSSN list?(KSSN + name)
    By kiltje12 in forum WarRock Korea Hacks
    Replies: 1
    Last Post: 07-08-2008, 04:20 AM
  2. I make a New ACC
    By taurin in forum WarRock Korea Hacks
    Replies: 3
    Last Post: 04-07-2008, 09:01 AM
  3. [TUT] How to make the new stamina
    By Th3 0wnzman in forum Visual Basic Programming
    Replies: 9
    Last Post: 02-24-2008, 03:11 AM
  4. Dave Make A New Form!
    By mikelmao in forum General
    Replies: 3
    Last Post: 07-07-2007, 07:28 PM
  5. standy told me to make a new thread
    By EleMentX in forum Spammers Corner
    Replies: 9
    Last Post: 12-11-2006, 04:40 PM