tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
Does anyone have a sample sprite sheet for normal leg armor? The one in the template mod doesn't help much since it is of a robe bottom.

Also, I am unable to get a multi-projectile weapon to work properly. Or do I just need to add a recipe in the C#? I'm still confused on whether the C# and JSON work together or not on one item...
Attached
 

Attachments

  • Player_Pants.png
    Player_Pants.png
    1.5 KB · Views: 177
I want to request feature. ModWorld already has `PreHitWire`, but in order to create interconnected devices (like pumps or teleports) a hook that will be invoked when all wires in single mesh are processed is required. `PostTripWire` or something similar.
 
It doesnt work for me. If i put a mod into the local folder tapi crashes! Is there anyone who knows how to fix it?
 
I am using these two codes
And I'm not sure why I am not getting multiple projectiles when I shoot the gun. Either I don't understand how things work, but I'm trying to do things like they are in the template mod. I have no idea whether both the JSON and C# are necessary to do this kind of stuff.

using Terraria;
using System;
using System.Diagnostics;
using Microsoft.Xna.Framework;

using TAPI;

namespace The_Luposi.Items
{
public class RevegskardeMSX4 : ModItem
{
public override bool PreShoot(Player player,Vector2 ShootPos,Vector2 ShootVelocity,int projType,int Damage,float knockback)
{
int ShotAmt = 2;
int spread = 65;
float spreadMult = 0.05f;
for(int i = 0; i < ShotAmt; i++)
{
float vX = ShootVelocity.X+(float)Main.rand.Next(-spread,spread+1) * spreadMult;
float vY = ShootVelocity.Y+(float)Main.rand.Next(-spread,spread+1) * spreadMult;

Projectile.NewProjectile(ShootPos.X,ShootPos.Y,vX,vY,projType,Damage,knockback,Main.myPlayer);
}
return false;
}
}
}



{
"displayName": "Revegskarde MSX-4",
"size": [60,38],
"maxStack": 1,
"value": [0, 1, 0, 0],
"rare": 9,
"tooltip": "'The Ultimatum is Here'",
"useStyle": 5,
"useAnimation": 4,
"scale": 1,
"useTime": 10,
"damage": 60,
"holdoutOffset": [-8,0],
"knockback": 12,
"useSound": 13,
"holdStyle": 0,
"autoReuse": true,
"useTurn": false,
"melee": false,
"ranged": true,
"noUseGraphic": false,
"shoot": 14,
"shootSpeed": 5,
"recipes":[{
"items": { "Dirt Block": 1 },
"tiles": ["Work Bench"],
"creates": 1
}]
}

Also... How is this compressed lol.
 
So I'm trying to make a gun that fires as fast or faster then the megashark and i can only get it to fire one projectile every 6 or so seconds
Code:
{
    "displayName": "Mega gun",
    "size": [42,40],
    "maxStack": 1,
    "value": [6,6,6,6],
    "rare": 9,
    "tooltip": "Test",
    "useStyle": 5,
    "useAnimation": 7,
    "useTIme": 1,
    "damage": 50,
    "knockback": 3,
    "useSound": 11,
    "autoReuse": true,
    "ranged": true,
    "noMelee": true,
    "shoot": 14,
    "shootSpeed": 7,
    "useAmmo": 14,
   
    "recipes":
    [{
        "items": { "Dirt Block": 1 },
        "tiles": [ "Work Bench" ],
        "creates": 1
    }]
}
tr
 
So I'm trying to make a gun that fires as fast or faster then the megashark and i can only get it to fire one projectile every 6 or so seconds
Code:
{
    "displayName": "Mega gun",
    "size": [42,40],
    "maxStack": 1,
    "value": [6,6,6,6],
    "rare": 9,
    "tooltip": "Test",
    "useStyle": 5,
    "useAnimation": 7,
    "useTIme": 1,
    "damage": 50,
    "knockback": 3,
    "useSound": 11,
    "autoReuse": true,
    "ranged": true,
    "noMelee": true,
    "shoot": 14,
    "shootSpeed": 7,
    "useAmmo": 14,
  
    "recipes":
    [{
        "items": { "Dirt Block": 1 },
        "tiles": [ "Work Bench" ],
        "creates": 1
    }]
}
tr

try reduce "shootSpeed" to 1. If it is faster, then adjust to your desire value.
 
So I'm trying to make a gun that fires as fast or faster then the megashark and i can only get it to fire one projectile every 6 or so seconds
Code:
{
    "displayName": "Mega gun",
    "size": [42,40],
    "maxStack": 1,
    "value": [6,6,6,6],
    "rare": 9,
    "tooltip": "Test",
    "useStyle": 5,
    "useAnimation": 7,
    "useTIme": 1,
    "damage": 50,
    "knockback": 3,
    "useSound": 11,
    "autoReuse": true,
    "ranged": true,
    "noMelee": true,
    "shoot": 14,
    "shootSpeed": 7,
    "useAmmo": 14,
  
    "recipes":
    [{
        "items": { "Dirt Block": 1 },
        "tiles": [ "Work Bench" ],
        "creates": 1
    }]
}
Your problem is likely the "useTIme" - I should not be capital. Also a use time of 1 will likely result in a continuous stream of bullets. useAnimation being 7 will currently result in your weapon firing 7 bullets per use IIRC. Try to match your useAnimation with your useTime if you want it to work like a normal gun (non burst mode)

try reduce "shootSpeed" to 1. If it is faster, then adjust to your desire value.
Actually I believe shootSpeed modifies at what velocity the projectile is fired, rather than modifying the delay in between shots.
 
Your problem is likely the "useTIme" - I should not be capital. Also a use time of 1 will likely result in a continuous stream of bullets. useAnimation being 7 will currently result in your weapon firing 7 bullets per use IIRC. Try to match your useAnimation with your useTime if you want it to work like a normal gun (non burst mode)
I think it should be mentioned that if an item has a useAnimation of less than 2, the gun won't fire anything, 'cause--my best guess is--it's firing faster than it can spawn the projectile. The fastest gun you can get is by setting useTime and useAnimation to 2, or you could have useAnimation set to 2 and useTime set to 1... Well, that's the way it was with tConfig, anyway. Terraria 1.2.x/tAPI r11+ might have better coding. Best thing to do is to test it.
 
Your problem is likely the "useTIme" - I should not be capital. Also a use time of 1 will likely result in a continuous stream of bullets. useAnimation being 7 will currently result in your weapon firing 7 bullets per use IIRC. Try to match your useAnimation with your useTime if you want it to work like a normal gun (non burst mode)

I fixed it by correcting the "useTime" and changing both "useTime" and "useAnimation" to 3 thanks!
 
How I can create a "Developer-like" armor? So my armor will inflict debuffs if other player will try to wear it.

Easiest way I would think is to create a "key" file of some form, and then set a parameter for the mod's onload call to see if the key exists or not on the individual client.

As it has been said, you cannot directly use the in-game functioning, but you can mirror it with some clever "trickery".
 
Hey guys its me again with another problem so i was trying to add some effects to my armor hood, theirs no errors when i build the mod but the effects just don't work
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using TAPI;
using Terraria;

namespace Bensmod.Items
{
    public class Nightmarehood : ModItem
    {
        public override void Effects(Player player) //op accessory is op
        {
            player.magicDamage += 80;
            player.manaRegenDelayBonus += 4;
            player.manaRegenBonus += 100;
        }
    }
}
 
So uh, I was messing around with an armor in r13 that I hadn't finished spriting yet, I think I found a bug...
e9JnJ6C.png
As you can see, the face kinda clips through the arm partially when there texture is completely transparent there, and it looks really awkward. Not really sure what's causing it, I tried other vanilla armors that are transparent there (like the treasure hunter shirt), but it only seems to happen with mod armors
 
Hello.I'm having a bug in tAPI r13.
I install everything play in a new map with a new character and close the map.
When I open my map again the mod items are withour sprites.What can I do?
 
So uh, I was messing around with an armor in r13 that I hadn't finished spriting yet, I think I found a bug...
e9JnJ6C.png
As you can see, the face kinda clips through the arm partially when there texture is completely transparent there, and it looks really awkward. Not really sure what's causing it, I tried other vanilla armors that are transparent there (like the treasure hunter shirt), but it only seems to happen with mod armors
This is not a bug, but rather a lack of a feature you use.
Terraria has player drawing where if an armor has a hand sprite but no 'hasHands' , the skin's hands won't be drawn.
Same goes for the arms.
(so basically, it expects to draw a full skin covering arm / hand , but you don't give it that , and its not ordered to draw the skin)
you can add "hasArms": true / "hasHands": true, to your json in order to get those to be drawn.
Hey guys its me again with another problem so i was trying to add some effects to my armor hood, theirs no errors when i build the mod but the effects just don't work
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using TAPI;
using Terraria;

namespace Bensmod.Items
{
    public class Nightmarehood : ModItem
    {
        public override void Effects(Player player) //op accessory is op
        {
            player.magicDamage += 80;
            player.manaRegenDelayBonus += 4;
            player.manaRegenBonus += 100;
        }
    }
}
If I had to guess, the json of your mod item mismatches the class name of your item (if the item is named Nightmare Hood , the class needs to be named NightmareHood respectively, not Nightmarehood)

It doesnt work for me. If i put a mod into the local folder tapi crashes! Is there anyone who knows how to fix it?
If you could say which mod is causing this issue and verify that the mod is for tAPI's latest version , that would be helpful.
Mods for older version of tAPI may break and/or not load properly.
 
Does anyone know of a way to check what armour set bonus the player currently has? I know I could could check each individual armour piece that's worn but that would be beyond tedious for what I am doing.
 
Just a heads up here - I think CanTownNPCSpawn isn't working. I had a world opened for three in game days, and no custom Town NPCs spawned. I don't think there was anything wrong on my end either, because as soon as I changed to CanSpawn, with the exact same conditions, one spawned within minutes. I'm using r13a.
 
Last edited:
Status
Not open for further replies.
Back
Top Bottom