tAPI Getting Started with Modding

Status
Not open for further replies.
This helps a lot, but I don't have a "Sources" folder (Yes, I actually looked). Do I make a new one?

EDIT: When typing the code, do you need those double slashes?
 
Thanks very much for the guides, berber! Greatly appreciated.

Question though, please. I have that silly ambition to make a bunch of new recipes for items that already exist, (as per your slime staff example) but I was wondering if it can all go in one file, or if each recipe needs its own file?

-----

The double slashes are comments. They'll be ignored by the compiler.
 
Thanks very much for the guides, berber! Greatly appreciated.

Question though, please. I have that silly ambition to make a bunch of new recipes for items that already exist, (as per your slime staff example) but I was wondering if it can all go in one file, or if each recipe needs its own file?

-----

The double slashes are comments. They'll be ignored by the compiler.
Thanks! :)
 
Oh, right. The "Sources" folder can actually be created manually. For example, my folder structure currently looks like Terraria -> tAPI -> Mods -> Local | PDB | Sources | Unsorted, whereas each red item is its own unique folder, with the | character just dividing filenames between files. I have no idea where the PDB folder came from, to be honest.

Oddly, I do have folders within the "Sources" folder that are named "Item" rather than "Items" but I'll defer to the advancement of tAPI technology for its correctness.
 
I support this thread! I also strongly suggest anyone who benefits from the information here like the OP. He has put a lot of time in to making these tutorials, a like is just a small way to say thank you for that effort. Nice work @berberborscing, keep it up :)
 
Ok i don't know what im doing wrong, but when i tried to build my mod to see if the Slime Staff recipe worked, it popped up this;

Terraria 1.2.4.1, tAPI Builder r14a

========================================
Building mod Mino's Recipes

Validating Jsons...
Compiling code...
SlimeStaff.cs (6,26)
Se esperaba }
}
^
Failed to build Mino's Recipes.

========================================

Built 0 mods.




My .cs file looks like this;

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace MinoRecipes.Items
{
public class SlimeStaff : ModBase
{
public override void OnLoad()
{
Recipe.newRecipe.createItem.SetDefaults(1309, false);
Recipe.newRecipe.createItem.stack = 1;
Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(9, false));
Recipe.newRecipe.requiredItem[0].stack = 20;
Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(23, false));
Recipe.newRecipe.requiredItem[1].stack = 100;
Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(29, false));
Recipe.newRecipe.requiredItem[2].stack = 1;
Recipe.newRecipe.requiredTile.Add(18);
Recipe.AddRecipe();
}
}

Help Please!!!
 
Ok i don't know what im doing wrong, but when i tried to build my mod to see if the Slime Staff recipe worked, it popped up this;

Terraria 1.2.4.1, tAPI Builder r14a

========================================
Building mod Mino's Recipes

Validating Jsons...
Compiling code...
SlimeStaff.cs (6,26)
Se esperaba }
}
^
Failed to build Mino's Recipes.

========================================

Built 0 mods.




My .cs file looks like this;

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace MinoRecipes.Items
{
public class SlimeStaff : ModBase
{
public override void OnLoad()
{
Recipe.newRecipe.createItem.SetDefaults(1309, false);
Recipe.newRecipe.createItem.stack = 1;
Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(9, false));
Recipe.newRecipe.requiredItem[0].stack = 20;
Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(23, false));
Recipe.newRecipe.requiredItem[1].stack = 100;
Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(29, false));
Recipe.newRecipe.requiredItem[2].stack = 1;
Recipe.newRecipe.requiredTile.Add(18);
Recipe.AddRecipe();
}
}

Help Please!!!
It needs another } at the end
 
I tried to make a mod that adds in one sword. It fails. No sword. Code attached to post.
It says it's enabled in tAPI, but I still see no sword.
Enabled.PNG
 

Attachments

  • Pumpking's Mod.zip
    2.1 KB · Views: 182
One question, are custom recipes supposed to be showed by the Guide? Because i watned to see if it worked, gave the Guide some gel and the slime staff didn't show up as one of the possible recipes, gave him wood, same thing, is this supposed to be that way? Or did i screw up? and if i did please tell me waht i ddi wrong
 
It's still not working. ;(
(it's probably some really nooby mistake)
Is your mod in a sources folder, or is it just in the tAPI Mods folder? You need to make a "Sources" folder and put it in there if so.

Or the texture line is wrong. In that case put the texture next to the weapon JSON in the weapons folder.
 
Is your mod in a sources folder, or is it just in the tAPI Mods folder? You need to make a "Sources" folder and put it in there if so.

Or the texture line is wrong. In that case put the texture next to the weapon JSON in the weapons folder.
I made a "Sources" folder in the "Mods" folder, and put the mod in there. Does the "Sources" folder have to be in "Local"? Or just "Mods"?
[DOUBLEPOST=1420138307][/DOUBLEPOST]
:indifferent: won't show the recipes, did i screw up? help pl0x D:
I think I did the same thing wrong.
 
Is it just me, or does the tAPI builder not work for anyone? I've re-installed MULTIPLE times, and no luck.
 
Ok, nvm, i feel like a complete idiot, i just saw, 0/11 mods loaded, and im like wat? Apparently my mod didn't load correctly, had to restart Terraria, the guide now shows it


*EPIC FACEPALM*
 
Thanks very much for the guides, berber! Greatly appreciated.

Question though, please. I have that silly ambition to make a bunch of new recipes for items that already exist, (as per your slime staff example) but I was wondering if it can all go in one file, or if each recipe needs its own file?

-----

The double slashes are comments. They'll be ignored by the compiler.
Whether or not you want all the recipes to have individual files is your choice.

If it's all one file, it'll be smaller.
If each recipe has its own file, you can edit them easier.
 
Status
Not open for further replies.
Back
Top Bottom