tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
OK, I renamed the folder to items, and put the stuff in there, but now I still cannot craft the item.
"recipes":[{
"items": { "Mushroom": 1 },
"tiles": ["Work Bench"],
"creates": 1
}]
Not sure if it has anything to do with my recipe being messed up or what.
 
OK, I renamed the folder to items, and put the stuff in there, but now I still cannot craft the item.
"recipes":[{
"items": { "Mushroom": 1 },
"tiles": ["Work Bench"],
"creates": 1
}]
Not sure if it has anything to do with my recipe being messed up or what.

Ok,

A: Make sure it's in /Items (CAPITALS MATTER HERE) instead of /Item, we changed the folder name if you are still confused on that issue.

B: Did you enable the mod ingame? Mods are disabled by default, you need to turn them on yourself.

C: Can you post your entire .json? Your recipe syntax is correct, but something else in the json might be breaking it.
 
Ok,

A: Make sure it's in /Items (CAPITALS MATTER HERE) instead of /Item, we changed the folder name if you are still confused on that issue.

B: Did you enable the mod ingame? Mods are disabled by default, you need to turn them on yourself.

C: Can you post your entire .json? Your recipe syntax is correct, but something else in the json might be breaking it.

Yes, it was the capital on Items! Thanks! Now I can swing my Wooden Spear Sword with ease!
 
If you already have the 1.2.2 downgrade and r10 installed no just rename tapi r10 to tapi 1.2.2 and r11 to tapi 1.2.4.1 and add them again, if not downgrade to 1.2.2 ( select downgrade patches then 1.2.2) and install tapi r10 and rename it and then add it to game launcher
 
i guess you have hidden fileendings because there is no json file in your tapi, i guess it appears like "marteauEnBeton.json" on your hdd but it is "marteauEnBeton.json.txt" with .txt being hidden on your system, not sure why it would crash tho

Well i think i would restart my item from the begining, thx for your help by the way i'll maybee need you again :p
have a nice day
 
Sucks that I am no good at any sort of coding (or spriting for the matter) :c

Would love to just grab the ideas in my head and just put em in a mod for people to enjoy.
 
I tried to make a weapon inflict the On Fire! buff upon hit, but it's not working! Here is the CS code:
Code:
using Terraria;
using System;
using System.Diagnostics;
using Microsoft.Xna.Framework;

using TAPI;

namespace berberborscing.Items
{
public class Tizona : ModItem
    {
        public void DamageNPC (Player myPlayer, NPC npc, ref int damage, ref float knockback)
        {
            npc.AddBuff (24, 300, true);
        }
        public void DealtNPC (Player myPlayer, NPC npc, ref int damage, ref float knockback)
        {
            npc.AddBuff (24, 300, true);
        }
    }
}
 
I tried to make a weapon inflict the On Fire! buff upon hit, but it's not working! Here is the CS code:
Code:
using Terraria;
using System;
using System.Diagnostics;
using Microsoft.Xna.Framework;

using TAPI;

namespace berberborscing.Items
{
public class Tizona : ModItem
    {
        public void DamageNPC (Player myPlayer, NPC npc, ref int damage, ref float knockback)
        {
            npc.AddBuff (24, 300, true);
        }
        public void DealtNPC (Player myPlayer, NPC npc, ref int damage, ref float knockback)
        {
            npc.AddBuff (24, 300, true);
        }
    }
}
Set the bool in the AddBuff method to false, as that's what debuffs tend to use. Also make sure the item is actually using the cs file. I think you also forgot to override the hooks.
 
Set the bool in the AddBuff method to false, as that's what debuffs tend to use. Also make sure the item is actually using the cs file. I think you also forgot to override the hooks.
Setting it to false did not work. Overriding gave me this error:
JnoBQn8.png

I think some things need to be added / removed after DamageNPC but I don't know what..

I deleted the DealtNPC hook because I realised that was the wrong one
 
Setting it to false did not work. Overriding gave me this error:
JnoBQn8.png

I think some things need to be added / removed after DamageNPC but I don't know what..
Just get rid of DamageNPC altogether. DealtNPC should do the job.

EDIT: or if you wish to keep it, altho having two methods that are meant to run one after the other is kinda pointless in my opinion especially since they are going to run the same code, the right arguments are these
Code:
public override void DamageNPC(Player owner, NPC npc, int hitDir, ref int damage, ref float knockback, ref bool crit, ref float critMult)
I'm not entirelly sure of the difference between DamageNPC and DealtNPC and a TAPI dev could probably englighten us on this, but when it comes to debuffs, I do actually use DamageNPC in my codes and never noticed any unexpected behavior.
 
Just get rid of DamageNPC altogether. DealtNPC should do the job.

EDIT: or if you wish to keep it, altho having two methods that are meant to run one after the other is kinda pointless in my opinion especially since they are going to run the same code, the right arguments are these
Code:
public override void DamageNPC(Player owner, NPC npc, int hitDir, ref int damage, ref float knockback, ref bool crit, ref float critMult)
I'm not entirelly sure of the difference between DamageNPC and DealtNPC and a TAPI dev could probably englighten us on this, but when it comes to debuffs, I do actually use DamageNPC in my codes and never noticed any unexpected behavior.
DamageNPC is called before dealing the attack on the NPC & allows modification of the damage and etc. before it is actually used.
DealtNPC, as the name mentions, is when you've dealt damage to the NPC already.

They're different in terms of where you can see what was the actual damage dealt to the NPC in DealtNPC, and apply debuffs after the attack rather than before it. (which is relevant to things like Ichor, where debuffing before dealing damage would increase the damage of the hit already, rather than attacks following the original)

For sticking to vanilla's way of doing things, you'd pick DealtNPC for debuffs.
 
Umm is this the builder not working or something wrong with my code?

System.IO.FileNotFoundException: Unable to find the specified file.
at TAPI.Extensions.Size(FPath path)
at TAPI.ModCompile.Compile(FPath sourceDir, FPath outputFile, Action`1 ActionProgress)
at tAPI_Builder.MainWindow.<>c__DisplayClass8.<BtnBuild_Click>b__0()

Just always something new to throw me off :O
 
Umm is this the builder not working or something wrong with my code?

System.IO.FileNotFoundException: Unable to find the specified file.
at TAPI.Extensions.Size(FPath path)
at TAPI.ModCompile.Compile(FPath sourceDir, FPath outputFile, Action`1 ActionProgress)
at tAPI_Builder.MainWindow.<>c__DisplayClass8.<BtnBuild_Click>b__0()

Just always something new to throw me off :O
That's a new one... care to pack and upload your mod folder?
 
I need help. I installed T-api. works fine. but when putting in mods, it crashes. pls help.

edit: using R11. Fresh install
 
Its actually doing it with all the mods I try to build, so what should I upload? I'm using R11 compatible setup so unless something changed...
Just upload the Sources folder in this case, I hope we can find the issue and help you out.
I need help. I installed T-api. works fine. but when putting in mods, it crashes. pls help.

edit: using R11. Fresh install
What mods are you trying to put in there? R10 mods are not compatible with R11.
 
Status
Not open for further replies.
Back
Top Bottom