Results 1 to 4 of 4
  1. #1
    Kirag's Avatar
    Join Date
    Aug 2014
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0

    {terraria 1.2.4.1} Can't get item to work

    So for literally 2 hours straight searching on the forums and even longer through my own source code I cannot figure out how to add a completely new item, new image and everything. I can get the items stats in but for some reason the the tool-tip wont apply nor will the icon apply to the item. Maybe there is something that I have missed, maybe not...some help/clerification would be great! (No I will not swich to tAPI or tConfig...my ideas and plans doesn't work at all with those)
    Changes/Additions I have done so far:
    Created a new image in .png and converted it to .xnb (Tested and works when changing a buff icon, but now renamed to Item_2749)

    Edit: Ok the item is now in the game but for some reason the item information is not showing up :/ and for some reason beds refuse to set spawn point >_>

    (Note: All code bits are from different lines in the file its from...)
    Item.cs
    Code:
    if (type == 2749)
                {
                    this.name = "Item Test";
                    this.useStyle = 1;
                    this.useTurn = true;
                    this.useAnimation = 25;
                    this.useTime = 25;
                    this.autoReuse = true;
                    this.width = 24;
                    this.height = 28;
                    this.damage = 12;
                    this.pick = 100;
                    this.scale = 1.15f;
                    this.useSound = 1;
                    this.knockBack = 2f;
                    this.rare = 3;
                    this.value = 27000;
                    this.melee = true;
                    return;
                }
    
    			if (this.type >= 2750)
    			{
    				this.type = 0;
    			}
    for (int i = 0; i < 2750; i++)
    				{
    					if (Main.itemName[i] == ItemName)
    					{
    						this.SetDefaults(i, false);
    						this.checkMat();
    						return;
    					}
    				}
    ItemID.cs
    Code:
    public const short ItemTest = 2749;
    Lang.cs
    Code:
    case 2749:
                        return "Item Test";
    Recipe.cs
    Code:
                Recipe.addRecipe();
                Recipe.newRecipe.createItem.SetDefaults(2749, false);
                Recipe.newRecipe.requiredItem[0].SetDefaults(19, false);
                Recipe.newRecipe.requiredItem[0].stack = 12;
    			Recipe.addRecipe()
    		public static void tTip()
    		{
                for (int i = 1; i < 2750; i++)
    			{
    				Item item = new Item();
    				item.SetDefaults(i, false);
    				if (item.toolTip2 != "" && item.toolTip2 != null)
    				{
    					string.Concat(new object[]
    					{
    						"case ",
    						i,
    						": return \"",
    						item.toolTip2,
    						"\";"
    					});
    				}
    			}
    		}
    Main.cs
    Code:
    public const int maxItemTypes = 2750;
    public static bool[] itemFlameLoaded = new bool[2750];
    public static Texture2D[] itemTexture = new Texture2D[2750];
    public static Texture2D[] itemFlameTexture = new Texture2D[2750];
    public static string[] itemName = new string[2750];
                for (int num16 = 0; num16 < 2750; num16++)
    			{
    				Item item = new Item();
    				item.SetDefaults(num16, false);
    				Main.itemName[num16] = item.name;
    				if (item.headSlot > 0)
    				{
    					Item.headType[item.headSlot] = item.type;
    				}
    				if (item.bodySlot > 0)
    				{
    					Item.bodyType[item.bodySlot] = item.type;
    				}
    				if (item.legSlot > 0)
    				{
    					Item.legType[item.legSlot] = item.type;
    				}
    			}
    for (int num12 = 0; num12 < 2750; num12++)
    			{
    				Main.itemTexture[num12] = base.Content.Load<Texture2D>(string.Concat(new object[]
    				{
    					"Images",
    					Path.DirectorySeparatorChar,
    					"Item_",
    					num12
    				}));
    			}
    Last edited by Kirag; 08-27-2014 at 01:53 PM.

  2. #2
    pepsi_cola's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    Do you have a working source code for 1.2.4.1? If so, can I get a copy?

  3. #3
    Tjessx's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    belgium
    Posts
    34
    Reputation
    10
    Thanks
    172
    Search your entire source code on the number 2748(previous item id), you'll figure out that you forgot some places to edit.
    If it doesn't work afterwards, pm me then we will look trough it together

  4. #4
    Threadstarter
    New Member
    Kirag's Avatar
    Join Date
    Aug 2014
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by pepsi_cola View Post
    Do you have a working source code for 1.2.4.1? If so, can I get a copy?
    My source is custom decompile, but if you want a clean source there is one on the forum section that I have found

    Quote Originally Posted by Tjessx View Post
    Search your entire source code on the number 2748(previous item id), you'll figure out that you forgot some places to edit.
    If it doesn't work afterwards, pm me then we will look trough it together
    Yea Just did and for some dumb reason the tooltip wasn't showing up due to it being under the wrong language location so moved it arround and fixed it X.x Now I am looking for a artist to help out with boss/npc textures for the general mod and thinking of ideas for the hackclient version.

Similar Threads

  1. Replies: 4
    Last Post: 08-19-2014, 01:02 AM
  2. [Help Request] Installed a farm bot and cant figure out how to uninstall it!
    By chrisf99 in forum CrossFire Help
    Replies: 8
    Last Post: 07-24-2014, 08:24 AM
  3. Cant figure out how to bypass? Can anyone help?
    By ShoeStrinqs in forum CrossFire Help
    Replies: 2
    Last Post: 09-01-2011, 04:50 PM
  4. Cant figure out how to bypass? Can anyone help?
    By ShoeStrinqs in forum Suggestions, Requests & General Help
    Replies: 0
    Last Post: 08-31-2011, 11:00 PM
  5. Help i cant figure out how to use public hack on combat arms
    By bkyourway in forum Suggestions, Requests & General Help
    Replies: 2
    Last Post: 10-25-2008, 06:35 PM