tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
Not sure if this has been asked but, i would like to know how to make custom ai for your npc/boss and how to get a blizzard staff effect for a weapon(i have the spread/offset of the projectile just cant get the trajectory correct).

Thanks,
Drok
 
Not sure if this has been asked but, i would like to know how to make custom ai for your npc/boss and how to get a blizzard staff effect for a weapon(i have the spread/offset of the projectile just cant get the trajectory correct).

Thanks,
Drok
ModNPC and ModProjectile classes (which you use for your custom NPCs & Projectiles respectively) have a hook called AI() (public override void AI()) , you can use it to make them do whatever it is you want them to do.

As for controlling simulating the effect of a blizzard staff , merely pick a point above the player , and shoot a projectile straight at that player from that point, blizzard staff does 4 shots per use if I recall correctly.
(if you mean the dust it uses , you'd use Dust.NewDust(arguments) to make your desired dust appear)
 
I can't seem to set or change the name of a player in tAPI R11. It always resets to the default.

Edit: Seems to be working now.
 
Last edited:
To make a pickaxe, make a sword with a pickaxe texture and put a pick value in the JSON.
"pick": "100" for instance, that would give it 100% pickaxe power

As for putting custom items into recipes, I do that all the time!
When writing the recipe, instead of putting in
"items": { "Wood": 10, "Rock": 1 } <- that would not work
but instead
"items": { "Wood": 10, "internalModname:Rock" 1 } <- that will work

If you don't know your mod's internal name, you can find out in the ModInfo file your mod has.

People like you are why I don't give up on things! But, does this work in r11? If so can you give me the updated sword code? 'Cause r5 code doesn't really work anymore :/
 
People like you are why I don't give up on things! But, does this work in r11? If so can you give me the updated sword code? 'Cause r5 code doesn't really work anymore :/
R5 code (I suppose TheHuckleberryWill's code) does work for R11, the only conflict I have received from transfer from old code to R11 was the
holy removal of constructors from CS files
but pickaxes dont need CS files, so his tutorial should be working for you
 
R5 code (I suppose TheHuckleberryWill's code) does work for R11, the only conflict I have received from transfer from old code to R11 was the
holy removal of constructors from CS files
but pickaxes dont need CS files, so his tutorial should be working for you

Oh, that's strange, because TheHuckleberryWill's sword tutorial isn't working for me. I'd post code but I'm on mobile(and I have to got to sleep)also, there is no error in Terraria when I test. I guess I'll use jsonlint for help. And I'd probably learn about constructors tomorrow, thanks for the tip though :)
 
Just wondering the what is wrong with this JSON code, that causes it not to work.

{
"name": "Wooden Spear Sword",
"displayName": "Wooden Spear Sword",
"texture": "Item/WoodenSpear",
"size": [64, 64],
"maxStack": 1,
"value": [0, 0, 0, 50],
"rare": 1,
"tooltip": "Sucky lookin spear!",
"useStyle": 1,
"useAnimation": 15,
"useTime": 15,
"damage": 5,
"knockback": 5,
"useSound": 4,
"autoReuse": true,
"useTurn": true,
"melee": true,
"recipes":[{
"items": { "Mushroom": 1 },
"tiles": ["Work Bench"],
"creates": 1
}]
}


Yes it's a weird code, but it doesn't craft or it simply does not exist.
(also I know not how to put the code in a fancy box!)
 
Just wondering the what is wrong with this JSON code, that causes it not to work.
{
"name": "Wooden Spear Sword",
"displayName": "Wooden Spear Sword",
"texture": "Item/WoodenSpear",
"size": [64, 64],
"maxStack": 1,
"value": [0, 0, 0, 50],
"rare": 1,
"tooltip": "Sucky lookin spear!",
"useStyle": 1,
"useAnimation": 15,
"useTime": 15,
"damage": 5,
"knockback": 5,
"useSound": 4,
"autoReuse": true,
"useTurn": true,
"melee": true,
"recipes":[{
"items": { "Mushroom": 1 },
"tiles": ["Work Bench"],
"creates": 1
}]
}
Yes it's a weird code, but it doesn't craft or it simply does not exist.
(also I know not how to put the code in a fancy box!)

Well, for starters, you don't need a display name and a internal name, as long as the .json and .png files have the same name, it isn't required, same for textures. I think you add another "}" after the last "}"
 
I'm having trouble using tAPI, in terms of literally running it. I just installed r11 today, I'm running legit terraria 1.2.4.1 through steam on windows 7 and ive installed tAPI into my terraria directory as well as game launcher to manage it.
Yet, I cannot open it and all that shows up is this when I try to run it http://prntscr.com/4y88in

If anyone could help that would be appreciated, I used to use tConfig loads and wish to mod again, thanks :)
 
I'm having trouble using tAPI, in terms of literally running it. I just installed r11 today, I'm running legit terraria 1.2.4.1 through steam on windows 7 and ive installed tAPI into my terraria directory as well as game launcher to manage it.
Yet, I cannot open it and all that shows up is this when I try to run it http://prntscr.com/4y88in

If anyone could help that would be appreciated, I used to use tConfig loads and wish to mod again, thanks :)
Try checking / clearing out your "documents/my games/terraria/tAPI" folder , or clear out the steam folder , reinstall terraria , then game launcher and then tAPI.
 
Try checking / clearing out your "documents/my games/terraria/tAPI" folder , or clear out the steam folder , reinstall terraria , then game launcher and then tAPI.
Thanks, Because I haven't played terraria since forever, I removed all game files after uninstalling and then did what you said, It seems to be working now so thank you and yay, I can mod again :3
 
Hi everybody i post here to know if you could help me because i did some codes for a item and when i run a world with the mod tAPI just crash and i would like to know what is going wrong (i watched a video to do it and it is my first item :/ so i'm a litle frustrated)

{
"displayName": "marteau en béton",
"texture": "item/marteauEnBéton",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "c'est un marteau",

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

}

i wrote this in french because.... i'm french LOL i also add the sprite of the item so you can see his name
 

Attachments

  • marteauEnBéton.png.png
    marteauEnBéton.png.png
    504 bytes · Views: 237
Hi everybody i post here to know if you could help me because i did some codes for a item and when i run a world with the mod tAPI just crash and i would like to know what is going wrong (i watched a video to do it and it is my first item :/ so i'm a litle frustrated)

{
"displayName": "marteau en béton",
"texture": "item/marteauEnBéton",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "c'est un marteau",

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

}

i wrote this in french because.... i'm french LOL i also add the sprite of the item so you can see his name
the file you uploaded is named marteauEnBeton.png.png <--- you have .png twice there , remove one.
 
thx for your rapid answer :D but still crashing and i forgot to mention that when i did this on r10 the game wasn't crashing but the item wasn't craftable and when i did it on r11 the game just crash
 
Edit:
thx for your rapid answer :D but still crashing and i forgot to mention that when i did this on r10 the game wasn't crashing but the item wasn't craftable and when i did it on r11 the game just crash

I tried to add your item and this is the crash:
Code:
TAPI.Mods+LoadException: Eikesters Decoration Pack.tapi: TAPI.Mods+LoadException: Json "JsonData object" Missing texture: item/marteauEnB�ton

   bei TAPI.ModJsonHandler.PropTexture(JsonData j, String key, IDictionary`2 dict, String defaultKey)
   bei TAPI.ModJsonHandler.HandleItem(ModBase modBase, JsonData j, String fname)
   bei TAPI.ModJsonHandler.Handle(ModBase modBase)
   bei TAPI.Mod.<Load>b__0(BinBuffer bb)
   bei TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
   bei TAPI.Mods.HandleModFile(FPath path, Action`1 action)
   bei TAPI.Mod.Load()
   bei TAPI.Mods.Load()
   bei TAPI.Mods.Load()

the Game can't handle chars like this, simply change all "é" to "e" (even the displayName because ingame you'd get it replaced with a '*'), also you dont need the "texture" parameter if the png filename is the same as the json filename
 
Last edited:
Edit:


I tried to add your item and this is the crash:
Code:
TAPI.Mods+LoadException: Eikesters Decoration Pack.tapi: TAPI.Mods+LoadException: Json "JsonData object" Missing texture: item/marteauEnB�ton

   bei TAPI.ModJsonHandler.PropTexture(JsonData j, String key, IDictionary`2 dict, String defaultKey)
   bei TAPI.ModJsonHandler.HandleItem(ModBase modBase, JsonData j, String fname)
   bei TAPI.ModJsonHandler.Handle(ModBase modBase)
   bei TAPI.Mod.<Load>b__0(BinBuffer bb)
   bei TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
   bei TAPI.Mods.HandleModFile(FPath path, Action`1 action)
   bei TAPI.Mod.Load()
   bei TAPI.Mods.Load()
   bei TAPI.Mods.Load()

the Game can't handle chars like this, simply change all "é" to "e" (even the displayName because ingame you'd get it replaced with a '*'), also you dont need the "texture" parameter if the png filename is the same as the json filename

still crashing i don't know what is going wrong i removed all the "é" and the "texture" : "item/marteauEnBeton" i post the code again so you can see how it is at this point
Code:
{
    "displayName": "marteau en beton",
    "size": [32, 32],
    "maxStack": 99,
    "value": [0, 5, 0, 0],
    "tooltip": "c'est un marteau",

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

}
 
i renamed the png file but idk where i can find the .tAPI i just know how to find the compressed one
btw i go to eat 14:12 i'm back :)
 
Last edited:
Status
Not open for further replies.
Back
Top Bottom