tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
Hi I am having the problem that when I build my mod everything runs fine no errors until I go to try and use it and it doesn't show up. The conclusion I have come to from about 2 hours worth of attempts and thought is that I noticed when building it doesn't say compiling code It gives

Terraria 1.2.4.1, tAPI Builder r15

========================================
Building mod Bomb

Validating Jsons...
Validating ModInfo.json

Packaging...
Compressing \Items\Bomb.png
Compressing \ModInfo.json

Done.

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

Built 1 mod.

In my Sources folder I have a folder named Bomb and Items

Bomb Folder contains
- Items Folder
BombInfo.json
ModInfo.json

BombInfo.json
{
"internalName": "Bomb",
"displayName": "Bomb",
"author": "SpikedPenguin",
"info": "A large explosion",
"version": "0.0.0"

}

ModInfo.json
{
"internalName" : "Bomb",
"displayName" : "Bomb",
"author" : "SpikedPenguin",
"info" : "A large explosion"
}

Inside the Items folder I have
- Bomb.png
- Bomb_Items.json

Bomb_Items.json
{
"displayName": "Bomb",
"texture": "Items/Bomb",
"size": [32, 32],
"maxStack": 20,
"value": [0, 0, 1, 0],
"tooltip": "A large explosion",

"recipes":
[{
"items": { "Dirt Block": 1 },
"tiles": [ "Work Bench" ],
"creates": 1
}]

}

Any ideas?
 
Figured it out nobody said that you have to save as all file types and put in manual extension .json otherwise you are compiling a item.json.txt and not a item.json
 
Make sure to download the most recent version create a desktop shortcut for the builder and application on install. If tApi is still not opening try and restart system or check the manager by pressing ctrl + alt + delete and see if it is running in background (for some unknown reason) is it giving you an error?
 
Why projectile animation won't work?
Code:
{
    "size": [28,62],
    "aiStyle": 20,
    "penetrate": -1,
    "timeLeft": 600,
"frameCount": 8,
    "friendly": true,
    "tileCollide": false,
    "melee": true,
    "hide": true
}
 
Why projectile animation won't work?
Code:
{
    "size": [28,62],
    "aiStyle": 20,
    "penetrate": -1,
    "timeLeft": 600,
"frameCount": 8,
    "friendly": true,
    "tileCollide": false,
    "melee": true,
    "hide": true
}
it's simple. you can't do projectile animations via JSON, you have to do it via code...
 
it's simple. you can't do projectile animations via JSON, you have to do it via code...
Tried this and it won't work too.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

using TAPI;
using Terraria;

namespace Tremor.Projectiles
{
    public class LaserDrilLProj : ModProjectile
    {              
        public override void PostAI()
        {        
            projectile.frameCounter++;
            if (projectile.frameCounter > .9)
            {
                projectile.frame++;
                projectile.frameCounter = 0;
            }
            if (projectile.frame >= 8)
            {
                projectile.frame = 1;
                return;
            }
        }
}
}
 
Tried this and it won't work too.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

using TAPI;
using Terraria;

namespace Tremor.Projectiles
{
    public class LaserDrilLProj : ModProjectile
    {             
        public override void PostAI()
        {       
            projectile.frameCounter++;
            if (projectile.frameCounter > .9)
            {
                projectile.frame++;
                projectile.frameCounter = 0;
            }
            if (projectile.frame >= 8)
            {
                projectile.frame = 1;
                return;
            }
        }
}
}
1. it's because you still need frameCount on the JSON
2. replace that projectile.frameCounter > .9 with projectile.frameCounter > 8.0
3. replace that projectile.frame >= 8 with projectile.frame >= 8.0
4. give me the texture...
 
I have a problem.
While loading the Mods, the game crashes.
It says:
"tAPI.exe has stopped working"

ModInfo
zIpAc.png


Item json
YV3wg.png


However, i have tried to change all items, tiles and names by replacing them with others.

jsonlint.com says that the codes are valid
 
Last edited:
I have a problem.
While loading the Mods, the game crashes.
It says:
"tAPI.exe has stopped working"

ModInfo
zIpAc.png


Item json
YV3wg.png


However, i have tried to change all items, tiles and names by replacing them with others.

jsonlint.com says that the codes are valid

First off: I'm pretty sure your internal name should never have any spaces in it. This shouldn't be causing the crash, but if you ever need the internalname later you'll want to change this.
Second, the texture property is unneeded if the texture is in the same directory as the json, although it needs to be the same name as the json. I'm pretty sure that something relating to this is why it's crashing.
Finally, I'd recommended you use something like pastebin or hastebin rather than a picture of text.
 
  • Like
Reactions: Hek
First off: I'm pretty sure your internal name should never have any spaces in it. This shouldn't be causing the crash, but if you ever need the internalname later you'll want to change this.
Second, the texture property is unneeded if the texture is in the same directory as the json, although it needs to be the same name as the json. I'm pretty sure that something relating to this is why it's crashing.
Finally, I'd recommended you use something like pastebin or hastebin rather than a picture of text.
Thanks for your reply!

Yeah, pastebin. I forgot about it.
Actually, one of the two things you suggested have fixed my problem.
 
I recently updated tAPI to r15 and tried to run the server and got the error:
Unhanded Exception: System.IO.FileNotFound: Could not loud file or assembly 'tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot fine the file specified.
at Terraria.ProgramServer.Main(String[] args)

I tried looking up what might have been causing it. I can run the normal Terraria server just fine, and I used to run the tAPI server just fine months and months ago when I last played. I did a fresh install of Terraria and tAPI r15 and am still getting the problem. Any suggestions or ideas as to what might be going wrong and how to fix it?
 
Status
Not open for further replies.
Back
Top Bottom