tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
Still waiting for the day when Terraria modding API documentation websites aren't steaming piles of utterly useless crap and actually trying to accomplish something isn't 9001% impossible to research
 
Still waiting for the day when Terraria modding API documentation websites aren't steaming piles of utterly useless crap and actually trying to accomplish something isn't 9001% impossible to research
me too... me too.

They are extremely tedious and time consuming to do. I have also mentioned this before but previously several members of the team were out of work and had tons of time. This is no longer the case, so free time we have right now is spent fixing existing issues or having lives outside of tAPI. After the holidays I will revisit the docs with the team and see if we can't get them fleshed out a little more.
 

In all seriousness though, I hope something is eventually hammered out, I'm just the slightest bit frustrated because I can't seem to get Terraria to decompile correctly and so I'm kind of blind (and left working with the mangled tConfig wiki for support.) I'm extremely satisfied with what has been accomplished though, and I hope Redigit eventually gets a built-in modding system working. For now, this is far beyond expectations. Keep it up guys, it's much appreciated! :)

And I would actually like to request some help regarding the decompiling. I keep getting entirely empty files (Item, Main, NPC, Player, Projectile, etc .cs...what's happening?)
 
Last edited:
In all seriousness though, I hope something is eventually hammered out, I'm just the slightest bit frustrated because I can't seem to get Terraria to decompile correctly and so I'm kind of blind (and left working with the mangled tConfig wiki for support.) I'm extremely satisfied with what has been accomplished though, and I hope Redigit eventually gets a built-in modding system working. For now, this is far beyond expectations. Keep it up guys, it's much appreciated! :)

And I would actually like to request some help regarding the decompiling. I keep getting entirely empty files (Item, Main, NPC, Player, Projectile, etc .cs...what's happening?)
Caution - Player Created Game Enhancement Rules & Guidelines
I'm sorry, but no one here is allowed to help you decompile Terraria and would get in trouble for doing so. Explaining how to do it is effectively the same as sharing the decompiled source

As for pointers with getting started modding. Please check out the Template Mod linked in the OP of this thread - it has some great information! Also, Will Huxtable made some tutorials for tAPI which will give you the basics but they are outdated. So compare them to the template mod to fill in the gaps. Lastly, you are welcome to join the IRC channel and ask us questions in real time.

So long as you are moving forward, and not asking us to basically do it all for you. We are always willing to help new modders there! (link / info also on the OP)

I know it's hard to find information, and hopefully that will change soon. Don't give up though, once you know all the hooks and variables you can access, just about everything is possible to mod in Terraria. Hell, you could even mod in a game of ping played with moving tiles and a projectile if you wanted......
 
Caution - Player Created Game Enhancement Rules & Guidelines
I'm sorry, but no one here is allowed to help you decompile Terraria and would get in trouble for doing so. Explaining how to do it is effectively the same as sharing the decompiled source.

Uh...how...what? How in the world is any modding done if you can't get any information on how the source functions work? What? I'm so confused and even more frustrated now.
 
Uh...how...what? How in the world is any modding done if you can't get any information on how the source functions work? What? I'm so confused and even more frustrated now.
I didn't say you couldn't do it. Just that sharing information about how to do it is against the forum rules.
 
I didn't say you couldn't do it. Just that sharing information about how to do it is against the forum rules.

This is bullocks v_v must it be all that secretive and whatnot? This really explains why modding progress is so slow and dispersed since nobody can communicate on how things actually work. Sigh. I just wanted to make a simple spell for demonstration purposes on the Weapon/Spell Megathread on the other forums. Not worth the immense time and effort to make something even remotely close. Oh well. Thanks for the help anyway.
 
Just decompile the damned thing already. tAPI is basically modified vanilla source - we CAN'T PUBLISH THAT. Not only is it against the forum rules - it's also AGAINST THE LAW OF EVERY COUNTRY I HAPPEN TO KNOW.
I can't decompile it - it doesn't work for me, that's my problem. It would be so much easier if it was just permissibly published somewhere.
 
Okay, let's move away from the source sharing and decompiling topic please - it is both against the rules and off topic
 
I'm sorry, but no one here is allowed to help you decompile Terraria and would get in trouble for doing so. Explaining how to do it is effectively the same as sharing the decompiled source.
+
Okay, let's move away from the source sharing and decompiling topic please - it is both against the rules and off topic
+
WE HIGHLY DISCOURAGE ANYONE TO MOD WITHOUT PRIOR DECOMPILING OF TAPI (OR AT LEAST TERRARIA). Unless you're doing only basic JSON stuff.
=
???
 
Your point? Just get a damn decompiler already.
Also Arkhalis already told you to join our IRC channel to get the decompiler all of us use, as it's kinda hard to find, at least this version of it.
If you're still insisting, go ask Re-Logic for permission for us to publish tAPI (and in turn vanilla) source code, lol. Good luck doing that.
 
Your point? Just get a damn decompiler already.
Also Arkhalis already told you to join our IRC channel to get the decompiler all of us use, as it's kinda hard to find, at least this version of it.
If you're still insisting, go ask Re-Logic for permission for us to publish tAPI (and in turn vanilla) source code, lol. Good luck doing that.

Getting extremely mixed messages here. One tells me to not talk about it and it's a big no-no, next says just come on over to the good ol' IRC chat to decompile. Legal or illegal? Can't tell anymore. In any case, I've figured what I needed out anyway.
 
Not legal, but you wouldn't listen and @Arkhalis had enough of this talk.
I'm on the barely-legal border. I shouldn't have talked about it in here, but that's the actual way people mod here, so no way I could NOT talk about it.
 
I want my Night Owl to spawn with a 33% chance at night, and only on the surface. This code works at spawning it, but it makes the mob spawn everywhere, and at day time too
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace berberborscing.NPCs
{
    public class NightOwl : ModNPC
    {
        public override bool CanSpawn( int x, int y, int type, Player spawnedOn)
        {  
            return Main.rand.Next(0, 3) == 0;
        }
    }
}
 
I want my Night Owl to spawn with a 33% chance at night, and only on the surface. This code works at spawning it, but it makes the mob spawn everywhere, and at day time too
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace berberborscing.NPCs
{
    public class NightOwl : ModNPC
    {
        public override bool CanSpawn( int x, int y, int type, Player spawnedOn)
        { 
            return Main.rand.Next(0, 3) == 0;
        }
    }
}
Looks like you don't define any region nor time when it can spawn. And you check constantly and have a 1/3 chance of it spawning. Do you want it to be like the traveling merchant spawns or how blood moons/solar eclipses are determined?
 
Not legal, but you wouldn't listen and @Arkhalis had enough of this talk.
I'm on the barely-legal border. I shouldn't have talked about it in here, but that's the actual way people mod here, so no way I could NOT talk about it.

Gotcha. I understand it all now. Sorry for being a #$&*.

I found what I wanted, but now I have another problem: my spell won't damage anything. I tried switching it to the Golden Shower projectile instead, but still nothing happens. The projectiles just go right through every enemy without causing damage or inflicting debuffs. There isn't even any debugging to do - it's literally just a copy of Golden Shower. Wat do?

{
"name": "Chains",
"Texture": "chains",
"displayName": "Chains",
"maxStack": 1,
"holdoutOffset": [3.0,2.0],
"useStyle": 5,
"useAnimation": 18,
"useTime": 6,
"autoReuse": true,
"width": 28,
"height": 30,
"rare": 7,
"tooltip": "Get 'em all tied up.",
"knockback": 6,
"useTurn": true,
"shootSpeed": 10,
"mana": 1,
"crit": 4,
"magic": true,
"reuseDelay": 5,
"value": [0,7,33,1],
"noMelee": true,
"useSound": 8,
"shoot": 280,
"recipes": [{"items": {"Dirt Block": 1}, "creates": 1}]
}
 
Gotcha. I understand it all now. Sorry for being a #$&*.

I found what I wanted, but now I have another problem: my spell won't damage anything. I tried switching it to the Golden Shower projectile instead, but still nothing happens. The projectiles just go right through every enemy without causing damage or inflicting debuffs. There isn't even any debugging to do - it's literally just a copy of Golden Shower. Wat do?

{
"name": "Chains",
"Texture": "chains",
"displayName": "Chains",
"maxStack": 1,
"holdoutOffset": [3.0,2.0],
"useStyle": 5,
"useAnimation": 18,
"useTime": 6,
"autoReuse": true,
"width": 28,
"height": 30,
"rare": 7,
"tooltip": "Get 'em all tied up.",
"knockback": 6,
"useTurn": true,
"shootSpeed": 10,
"mana": 1,
"crit": 4,
"magic": true,
"reuseDelay": 5,
"value": [0,7,33,1],
"noMelee": true,
"useSound": 8,
"shoot": 280,
"recipes": [{"items": {"Dirt Block": 1}, "creates": 1}]
}
You have no "damage" defined.
 
Code:
if ((!Main.dayTime &&  Main.bloodMoon && Main.rand.Next(20) == 0) ||
                (!Main.dayTime &&  Main.bloodMoon && Main.rand.Next(10) == 0))
            {
                return true;
            }
            return false;
like this?
 
You have no "damage" defined.
tgihd4vlq9.gif


Thank you.
 
Status
Not open for further replies.
Back
Top Bottom