tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
Hard to say without you sharing the logs. There are a few bugs with tAPI's multiplayer right now, but if you are using fresh characters/worlds using identical mods, it SHOULD be fine.

If you're trying to "uninstall" it by removing the tAPI folder in your documents, you're doing it wrong. Uninstall Terraria, then reinstall it, and tAPI will be gone.
Thats what I thought I had to do. Thanks!
 
I'm pretty sure I've seen this happen in vanilla as well. If you'd rather stick to the same world, follow the instructions from my post on the previous page about using the developer console, and fill an empty slot with a picksaw, dig through to the room, then trash the picksaw and disable the dev console :dryadtongue:

Clicking the Developer Console button gives this error:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at TAPI.Menu+<>c__DisplayClass315.<CreateMenus>b__152()
at TAPI.MenuPage.Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch SP)
at TAPI.Menu.DrawMenu()
at Terraria.Main.Draw(Microsoft.Xna.Framework.GameTime gameTime)

:C
 
Code:
        public override void OnAllModsLoaded()
         {
            if(!Main.dedServ) {
                Main.itemTexture[4] = textures["Vanilla/CopperBroadsword"];
         }
            if(WWorld.SuperHardmode == true) {
                Main.itemTexture[190] = textures["Vanilla/SunflowerSword"];
    }
I tried to change item texture after Super Hardmode being activated. It is not activated but texture is changed (The Sunflower Sword).
 
Code:
        public override void OnAllModsLoaded()
         {
            if(!Main.dedServ) {
                Main.itemTexture[4] = textures["Vanilla/CopperBroadsword"];
         }
            if(WWorld.SuperHardmode == true) {
                Main.itemTexture[190] = textures["Vanilla/SunflowerSword"];
    }
I tried to change item texture after Super Hardmode being activated. It is not activated but texture is changed (The Sunflower Sword).

I believe OnAllModsLoaded is called in the menu, not when you enter a world. Try ModWorld's Load hook.

Code:
public override void Load(BinBuffer bb)
{
    if (this.SuperHardmode)
    {
        Main.itemTexture[190] = textures["Vanilla/SunflowerSword"];
    }
    else
    {
        // I'd say you should set it back to what it was (i have no idea) here as
        //  if they load a SuperHardmode world then one that isn't, the texture
        //  the texture will stay, that is if you don't set it back right here
        Main.itemTexture[190] = WhateverTheDefaultIs;
    }
}
 
Code:
Terraria 1.2.4.1, tAPI Builder r14a

========================================
Building mod Tremor Mod

Validating Jsons...
Compiling code...
Vanilla.cs  (30,68)
  "Tremor.Items.Vanilla.Load(TAPI.BinBuffer)": couldnt find a method to override
        public override void Load(BinBuffer bb)
                             ^
Failed to build Tremor Mod.

========================================

Built 0 mods.
I believe OnAllModsLoaded is called in the menu, not when you enter a world. Try ModWorld's Load hook.

Code:
public override void Load(BinBuffer bb)
{
    if (this.SuperHardmode)
    {
        Main.itemTexture[190] = textures["Vanilla/SunflowerSword"];
    }
    else
    {
        // I'd say you should set it back to what it was (i have no idea) here as
        //  if they load a SuperHardmode world then one that isn't, the texture
        //  the texture will stay, that is if you don't set it back right here
        Main.itemTexture[190] = WhateverTheDefaultIs;
    }
}
Terraria 1.2.4.1, tAPI Builder r14a

========================================
Building mod Tremor Mod

Validating Jsons...
Compiling code...
Vanilla.cs (30,68)
"Tremor.Items.Vanilla.Load(TAPI.BinBuffer)": couldnt find a method to override
public override void Load(BinBuffer bb)
^
Failed to build Tremor Mod.

========================================

Built 0 mods.
 
Code:
Terraria 1.2.4.1, tAPI Builder r14a

========================================
Building mod Tremor Mod

Validating Jsons...
Compiling code...
Vanilla.cs  (30,68)
  "Tremor.Items.Vanilla.Load(TAPI.BinBuffer)": couldnt find a method to override
        public override void Load(BinBuffer bb)
                             ^
Failed to build Tremor Mod.

========================================

Built 0 mods.

Either:
  1. That isn't in a class that extends ModWorld, or
  2. Load doesn't exist as a hook anymore
 
Hey guys i having a problem it says there:
ReinforcedQueenBee.json: Invalid JSON file.
Invalid token '"' in input string
and here is the code
Code:
{
   "displayName": "ReinforcedQueenBee",
   "size": [164,621],
   "value": [0,0,10,0],
   "npcSlots": 1,
   "aiStyle": 222,
   "animationType": 3,
   "frameCount": 4,
   "lifeMax": 7000,   
   "defense": 39,
   "damage": 60,
   "soundHit" : 1,
   "soundKilled" : 1,
   "knockbackResist": 25.8,
   "buffImmunity": [24, 39],
   "noGravity": true
   "noTileCollide": true
   "lavaImmune": true

   "drops": [
     {
       "item": "Iron Helmet",
       "chance": 0.5
     }
is there a way to fix it? i not know :/
 
Hey guys i having a problem it says there:
ReinforcedQueenBee.json: Invalid JSON file.
Invalid token '"' in input string
and here is the code
Code:
...
is there a way to fix it? i not know :/

Code:
   "noGravity": true
   "noTileCollide": true
   "lavaImmune": true

Those lines are missing a comma at the end.

I also assume you end the "[" that you started for drops and you also end the "{" you started for the json file.
 
Code:
   "noGravity": true
   "noTileCollide": true
   "lavaImmune": true

Those lines are missing a comma at the end.

I also assume you end the "[" that you started for drops and you also end the "{" you started for the json file.
Input doesn't evaluate to proper JSON text
 
Input doesn't evaluate to proper JSON text
Try this, I commented what I changed:
Code:
{
    "displayName": "ReinforcedQueenBee",
    "size": [164, 621],
    "value": [0, 0, 10, 0],
    "npcSlots": 1,
    "aiStyle": 222,
    "animationType": 3,
    "frameCount": 4,
    "lifeMax": 7000,
    "defense": 39,
    "damage": 60,
    "soundHit": 1,
    "soundKilled": 1,
    "knockbackResist": 25.8,
    "buffImmunity": [24, 39],
    "noGravity": true, // Added comma
    "noTileCollide": true, // Added comma
    "lavaImmune": true, // Added comma

    "drops": [
        {
            "item": "Iron Helmet",
            "chance": 0.5
        }
    ] // Closed the drops array
} // Closed the json object
 
I'm not sure if you guys found this already, but I found a bug with regards to custom crafting stations. After the player goes near a custom crafting station, no matter how far away the player goes, the game will always think the player is near that kind of tile. This is caused by the AdjTiles() method in the Player class, specifically this part of the code:
Code:
for (int i = 0; i < 340; i++)
{
    this.oldAdjTile[i] = this.adjTile[i];
    this.adjTile[i] = false;
}
So it updates the fact that the player is no longer near any vanilla crafting tile, but doesn't account for the mod tiles, which have an ID larger than 340.
 
**EDIT**

I figured it out. Turns out, I neglected to set my folder options to show file extensions, so for each "New Text Document" I was making, it still had the txt filetype. :derp:
 
Last edited:
I seem to be having an issue with hairstyles. Basically, I am using one of the long hairstyles from the stylist, but whenever I equip a mod vanity hat (hairType set to show the full hair OR the alt hair, I get the same issue regardless), it seems to cut the hair midway.

Vanilla Wizard Hat (supposedly showing alt-hair)
3fef30db47.png


Modded hat showing alternative hair (hairType 1)
305f73c062.png


Modded had showing full hair (hairType 2)
eb9523a3c9.png
 
So I thought I'd delve into mod developing, though I've run across an issue where a mod I developed through the use of this [video] does not work. I am not getting an error, but it's not showing up as a craftable. I was wondering if someone here can give me some guidance, and have a poke at where I went wrong.

{
"displayName": "Golden Orb",
"texture": "Item/goldenorb",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "A orb made of gold ore!",
"recipes":
[{
"items": { "Gold Ore": 15 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}

I have it setup, I have the texture, it should just be an craftable, obtainable item. I built it and I haven't come across any issues. I'm not sure why, with the materials in hand, that it isn't working. I'm new to this and I get the feeling that the video I followed left some important details out.
 
Last edited:
So I thought I'd delve into mod developing, thought I've run across an issue where a mod I developed through the use of this [video] does not work. I am not getting an error, but it's now showing up as a craftable. I was wondering if someone here can give me some guidance, and have a poke at where I went wrong.

{
"displayName": "Golden Orb",
"texture": "Item/goldenorb",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "A orb made of gold ore!",
"recipes":
[{
"items": { "Gold Ore": 15 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}

I have it setup, I have the texture, it should just be an craftable, obtainable item. I built it and I haven't come across any issues. I'm not sure why, with the materials in hand, that it isn't working. I'm new to this and I get the feeling that the video I followed left some important details out.
Are you sure the item is being loaded at all? Is the Items folder properly named? ("Items" is the correct name, case sensitive).

EDIT: Checked out the video, looks like the guy actually names the folder "Item", which might be your issue.
 
So I thought I'd delve into mod developing, thought I've run across an issue where a mod I developed through the use of this [video] does not work. I am not getting an error, but it's now showing up as a craftable. I was wondering if someone here can give me some guidance, and have a poke at where I went wrong.

{
"displayName": "Golden Orb",
"texture": "Item/goldenorb",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "A orb made of gold ore!",
"recipes":
[{
"items": { "Gold Ore": 15 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}

I have it setup, I have the texture, it should just be an craftable, obtainable item. I built it and I haven't come across any issues. I'm not sure why, with the materials in hand, that it isn't working. I'm new to this and I get the feeling that the video I followed left some important details out.
I didn't check the contents of the video but you have 2 noticable mistakes here.
The first is that in "texture" your destination folder is "Item" and not "Items" - that is a change that happened from tConfig to tAPI.
The second is that you have "texture", that's not necessary & not ever recommended unless the item's json filename mismatches the png's filename.
 
So I thought I'd delve into mod developing, thought I've run across an issue where a mod I developed through the use of this [video] does not work. I am not getting an error, but it's now showing up as a craftable. I was wondering if someone here can give me some guidance, and have a poke at where I went wrong.

{
"displayName": "Golden Orb",
"texture": "Item/goldenorb",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "A orb made of gold ore!",
"recipes":
[{
"items": { "Gold Ore": 15 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}

I have it setup, I have the texture, it should just be an craftable, obtainable item. I built it and I haven't come across any issues. I'm not sure why, with the materials in hand, that it isn't working. I'm new to this and I get the feeling that the video I followed left some important details out.

First, make sure the folder you're putting your items in is called Items and not Item

Second, and this was my issue, see to it that you're not saving your files as .txt (mine were along the lines of AccHoverBoots.json.txt). If your file types are saying Text Document, then make sure your folder options aren't set to "Hide extensions for known file types." This way, you can rename them to their proper file type.

Third, are you sure your mod is loaded? Go into your tAPI game again, click Mods, and click on your mod, and make sure it's enabled. Then, click 'Reload Mods'.
 
Status
Not open for further replies.
Back
Top Bottom