tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
pls help !!
I have the newest gamelauncher version installed
I have tAPI r15 installed
My terraria version is 1.2.4.1
I have Grox's base mod v1.0.5
and I have OmnirsNOSpack v1.0.3.10
I have them both enabled and I've tried reloading them at least 5 times
I still cannot seem to get the omnir mod to work (when i start a world, its just vanilla terraria)
There are no videos or forums for this troubleshooting
That mod is almost entirely based around enemy spawns. Walk around for a bit
 
Hi, I am having trouble loading my mod. I build it in tAPI Builder and I go in-game and enable it, but when I click reload mods, tAPI crashes.

I ran the code through pro.jsonlint.com and it said it was fine. Any ideas why this is happening?
 
Last edited:
Hi, I am having trouble loading my mod. I build it in tAPI Builder and I go in-game and enable it, but when I click reload mods, tAPI crashes.

I ran the code through pro.jsonlint.com and it said it was fine. Any ideas why this is happening?
If you mod successfully builds, then your .json files are alright. If it crashes while trying to load your already built mod, then the problems are most likely with your .cs files and/or image file names.
 
If you mod successfully builds, then your .json files are alright. If it crashes while trying to load your already built mod, then the problems are most likely with your .cs files and/or image file names.
Well I haven't gone as advanced as .cs files yet, so I guess it is the image names. Is there anything special I need to do to the names of the .png or .json files?
 
Well I haven't gone as advanced as .cs files yet, so I guess it is the image names. Is there anything special I need to do to the names of the .png or .json files?
You need to make sure that the .png files have the exact same name as the .json files, capitalization and everything, just with the different extension.
Also, on a second thought, another possibility is that your .json files might be missing some properties (I think there was a problem once when I didn't give an item a value, for example). I don't remember whether that gets caught in the builder or the loader though.
 
You need to make sure that the .png files have the exact same name as the .json files, capitalization and everything, just with the different extension.
Also, on a second thought, another possibility is that your .json files might be missing some properties (I think there was a problem once when I didn't give an item a value, for example). I don't remember whether that gets caught in the builder or the loader though.
Okay, I have singled out the problem: It is my Thief's Cuirass. The names for the files are:

Thief'sCuirass.json
Thief'sCuirass.png
Thief'sCuirass_Arms.png
Thief'sCuirass_Body.png
Thief'sCuirass_Female_Body.png


And here is the code for the .json:

{
"displayName": "Thief's Cuirass",
"size": [30, 20],
"maxStack": 1,
"value": [0,8,0,0],
"rare": 3,
"tooltip": "A protective and light cuirass used by thieves.",
"defense": 5,
"armorBody": true,
"hasHands": true,
"setName": "Thief",

"recipes":
[{
"items": {"Bunny": 5, "Squirrel": 5, "Iron Bar": 4},
"tiles": ["Anvil"],
"creates": 1
}]
}
 
Okay, I have singled out the problem: It is my Thief's Cuirass. The names for the files are:

Thief'sCuirass.json
Thief'sCuirass.png
Thief'sCuirass_Arms.png
Thief'sCuirass_Body.png
Thief'sCuirass_Female_Body.png


And here is the code for the .json:

{
"displayName": "Thief's Cuirass",
"size": [30, 20],
"maxStack": 1,
"value": [0,8,0,0],
"rare": 3,
"tooltip": "A protective and light cuirass used by thieves.",
"defense": 5,
"armorBody": true,
"hasHands": true,
"setName": "Thief",

"recipes":
[{
"items": {"Bunny": 5, "Squirrel": 5, "Iron Bar": 4},
"tiles": ["Anvil"],
"creates": 1
}]
}
Try removing the s from Arms in your arms image file. (I find that rule somewhat annoying tbh :p)
 
So, how do I make the Mana Heal effect? Healing has an effect that shows how much you were healed by, but what is the mana one called?
 
If I wanted to make a new spectre helmet, what would the set name be?
Vanilla armor sets don't use set names; instead they actually check the IDs for all the other armor the player has equipped. So you'll actually have to override these two methods from the ModItem class, and manually check the item IDs:
public virtual void ArmorSetBonus(Player player)
public virtual bool IsArmorSet(Player player, bool vanity)

If you also want to make the player transparent, you'll need to override this method too:
public virtual void VanitySetBonus(Player player)
 
[Seems like this is a good place to post problems?]

Server Problems

I Recently installed tAPI on a fresh install of Terraria (Steam), and played around with it on multiplayer without mods for a while before deciding to test a few. Against Scooter's comment that his mod would likely not function on multiplayer, I gave it a go. It ended quickly, to say the least, with rapid-fire crashes left and right concerning both the tAPI main client and the tAPI dedicated server client. Seeing as how things were starting to get pretty messy, I uninstalled the game on Steam and hunted down every file related to Terraria until I was certain i would have a clean slate.

However, the server/client issues persisted through a clean install, and as for the root cause; I am quite confused.

My re-install steps were as followed:
  1. Uninstall Terraria via Steam
  2. Uninstall tAPI via control panel
  3. Uninstall all Terraria-related files within My Documents
  4. Re-install Terraria via Steam
  5. Install tAPI (r15, downloaded from here...) [Installed into the Steam/Steamapps/Common/Terraria directory]
After these steps I immediately launched Terraria and attempted to Host and Play a server without running any mods. This immediately prompts a "tAPI Server has stopped working" message. Next I attempted to create a dedicated one, via the Open Dedicated Server in-client feature. While it also recieves its own specially generated "xxxx" has stopped working, there is also some obviously incorrect text in the CMD prompt:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assemply 'tAPI, Version = 1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The System cannot find the file specified.
At Terraria.ProgramServer.Main<String[] args>

Anyways, it seems something isn't being seen (duh), but I am unable to figure out what I am doing wrong here >.< Assistance to resolve this problem would be appreciated, as after 7 or 8 fresh re-installs I am losing my wits.

Thanks for helping a lost soul,
Icarium
 
Vanilla armor sets don't use set names; instead they actually check the IDs for all the other armor the player has equipped. So you'll actually have to override these two methods from the ModItem class, and manually check the item IDs:
public virtual void ArmorSetBonus(Player player)
public virtual bool IsArmorSet(Player player, bool vanity)

If you also want to make the player transparent, you'll need to override this method too:
public virtual void VanitySetBonus(Player player)

Why for the life of me is this not spawning a projectile when I hit an enemy?
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Terraria;
using TAPI;

namespace Terra.Buffs
{
    public class SpectreBuff : TAPI.ModBuff
    {    
    public override void DamageNPC(Projectile projectile, NPC npc, int hitDir, ref int damage, ref float knockback, ref bool crit, ref float critMult)
    {
        if (projectile.magic)
        {
        Projectile.NewProjectile(npc.position.X, npc.position.Y, projectile.velocity.X, projectile.velocity.Y, "Terra:SpectreWisp", damage, knockback);
        }
    }
    }
}
 
Why for the life of me is this not spawning a projectile when I hit an enemy?
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Terraria;
using TAPI;

namespace Terra.Buffs
{
    public class SpectreBuff : TAPI.ModBuff
    {   
    public override void DamageNPC(Projectile projectile, NPC npc, int hitDir, ref int damage, ref float knockback, ref bool crit, ref float critMult)
    {
        if (projectile.magic)
        {
        Projectile.NewProjectile(npc.position.X, npc.position.Y, projectile.velocity.X, projectile.velocity.Y, "Terra:SpectreWisp", damage, knockback);
        }
    }
    }
}
Hm, that's a good question. There's several different possibilities I can think of, so let's narrow things down. A handy thing I use when I want real-time feedback to see whether or not code is executing is Main.NewText. So for example, you can add Main.NewText("test", 255, 255, 255, false); and if that piece of code is called, then test will appear in the chatbox. So try putting that line inside the if statement; that we can find out if it's either never getting created, or despawning as soon as it's created.
 
Hm, that's a good question. There's several different possibilities I can think of, so let's narrow things down. A handy thing I use when I want real-time feedback to see whether or not code is executing is Main.NewText. So for example, you can add Main.NewText("test", 255, 255, 255, false); and if that piece of code is called, then test will appear in the chatbox. So try putting that line inside the if statement; that we can find out if it's either never getting created, or despawning as soon as it's created.

It was the fact that it wasn't penetrating. But more importantly, I set the damage to 1, but it's dealing 175 damage to my player when it collides with them.
 
It was the fact that it wasn't penetrating. But more importantly, I set the damage to 1, but it's dealing 175 damage to my player when it collides with them.
Hm, that sounds like a problem with AI. Are you using an aiStyle or did you make a custom AI method?
 
I have a problem with tAPI r15 , the tAPI server file crashes on launch , and the host and play don't work ... so i can't make servers for me and my friend , and my friend's terraria crashes upon launch . (Just a little thing , why is the tAPI file .pdb ?)
 
I have a problem with tAPI r15 , the tAPI server file crashes on launch , and the host and play don't work ... so i can't make servers for me and my friend , and my friend's terraria crashes upon launch . (Just a little thing , why is the tAPI file .pdb ?)
Hello,
You seem to be having the same issue as me (no one has replied to it yet). If you find a fix, let me know =P I have been trying to get this crazy thing working for hours now!
 
Status
Not open for further replies.
Back
Top Bottom