Standalone [1.3] tModLoader - A Modding API

That should be in the ModTile, right? I'm afraid it still can't be placed. :/
I really have no idea what could be wrong with it, at this point. My original code was pretty much copied straight out of ExampleChair.SetDefaults from the ExampleMod.
Ooooh, you can't even place it? :O I now see why... You have not defined any useStyle in your ModItem class, which means... Well, it means your item cannot be used basically. The thing you want to do is add the following line to the SetDefaults function of your totemPole ModItem class:
Code:
item.useStyle = 1;

how do you add recipes to items? like how night's edge can be crafted with light's bane or blood butcher.
You mean adding recipes to vanilla items? If so, just create a class that extends from 'Mod' and use the AddRecipes function in there to add recipes for vanilla items by just setting the correct item ID in the 'recipe.SetResult' method.
 
how do you add recipes to items? like how night's edge can be crafted with light's bane or blood butcher.
Code:
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(this);
recipe.AddIngredient(Terraria.ID.ItemID.LightsBane, 1);
recipe.SetResult(Terraria.ID.ItemID.NightsEdge);
recipe.AddRecipe();
recipe.AddIngredient(Terraria.ID.ItemID.BloodButcherer, 1);
recipe.SetResult(Terraria.ID.ItemID.NightsEdge);
recipe.AddRecipe();
}

Put something like that in your mod's main file. (The one with the same name as your mod.) You just add multiple recipes for the item. Basically, each time you call AddRecipe() you're "emptying" the "recipe" object, at least as far as I can tell. You then add ingredients and set result again.

Ooooh, you can't even place it? :O I now see why... You have not defined any useStyle in your ModItem class, which means... Well, it means your item cannot be used basically. The thing you want to do is add the following line to the SetDefaults function of your totemPole ModItem class:
Code:
item.useStyle = 1;

Doh! I thought I had mentioned that earlier, my mistake. That did in fact fix it. I still have some tweaking to do, but I think I can handle what's left.

EDIT: Actually, what IS the adjTiles[] object? That was copied out of the ExampleChair tile and I can't seem to find where it's used.
 
Last edited:
how do you add recipes to items? like how night's edge can be crafted with light's bane or blood butcher.
(I'm assuming you are asking about making recipes from multiple input options. I realize others have answered already, but I was already typing, so this should be useful for someone.) There is the simple way and the "better" way.

The simple way is to just create two different recipes.
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MagicMirror);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();

recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.IceMirror);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();

The better way is to use craft groups. For example, there is a vanilla Craft group called Wood, which allows recipes to use any type of wood:
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddCraftGroup(CraftGroup.Wood, 2);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();

If you want to make your own recipe groups, do the following in your "mod" class:
Code:
public override void AddRecipeGroups()
{
            RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + " " + "Magic Mirror", new int[]
            {
                ItemType("ExampleMirror"),
                ItemID.IceMirror,
                ItemID.MagicMirror
            });
            RecipeGroup.RegisterGroup("ExampleMod:MagicMirrors", group);
}

Then make recipes like this:
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddRecipeGroup("ExampleMod:MagicMirrors");
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();

The main advantage to using craft groups is avoiding mistakes and writing clearer code. There are 8 types of wood in the Wood craftgroup. If you make 8 recipes, and later decide to change the recipe amounts needed, chances are you will mistype and problems will arise.

Also, make sure to include "using Terraria.ID;" at the top. It really makes everything clearer and looks better. "ItemID.Gel" is much better than "Terraria.ID.ItemID.Gel"
 
Last edited:
Put something like that in your mod's main file. (The one with the same name as your mod.) You just add multiple recipes for the item. Basically, each time you call AddRecipe() you're "emptying" the "recipe" object, at least as far as I can tell. You then add ingredients and set result again.
thank you, this is what i was looking for.
 
(I'm assuming you are asking about making recipes from multiple input options. I realize others have answered already, but I was already typing, so this should be useful for someone.) There is the simple way and the "better" way.

The simple way is to just create two different recipes.
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MagicMirror);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();

recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.IceMirror);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();
The better way is to use craft groups. For example, there is a vanilla Craft group called Wood, which allows recipes to use any type of wood:
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddCraftGroup(CraftGroup.GetVanillaGroup("Wood"), 2);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();
If you want to make your own craft groups, do the following in your "mod" class:
Code:
public override void AddCraftGroups()
{
AddCraftGroup("MagicMirrors", Lang.misc[37] + " " + "Magic Mirror", ItemID.IceMirror,ItemID.MagicMirror);
}
Then make recipes like this:
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddCraftGroup(mod, "MagicMirrors");
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();
The main advantage to using craft groups is avoiding mistakes and writing clearer code. There are 8 types of wood in the Wood craftgroup. If you make 8 recipes, and later decide to change the recipe amounts needed, chances are you will mistype and problems will arise.

Also, make sure to include "using Terraria.ID;" at the top. It really makes everything clearer and looks better. "ItemID.Gel" is much better than "Terraria.ID.ItemID.Gel"

It's worth noting that Jopojelly's method is *much* better for large-scale applications. I didn't mention it at the time primarily because I wasn't sure of the details.
ya my computer did not load the second one at first :p thank you both
 
All right, yet another issue with this darned tile-placement.

The last recommendation for the ModTile's SetDefaults ran into some unusual issues: namely, the tile would place a bit to the left of the cursor and couldn't be placed unless the space immediately to the right would also be a valid placement option. It did *not* actually take up a 2-wide area, as another totem could be placed directly to the right of it afterwards.

In an attempt to combat this, I changed from TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4) to Style1xX, and manually set the height to 4 instead of the width to 1. While this does seem to have overcome the placement issues, it now doesn't show the bottom-most tile when attempting to place (but does once it's already *been* placed) and when destroying one totem, all other totems touching it will also be destroyed. In addition, each totem drops two of itself.

Tile is here:
Code:
  class totemPole : ModTile
  {
  public override void SetDefaults()
  {
  Main.tileFrameImportant[Type] = true;
  Main.tileNoAttach[Type] = true;
  Main.tileLavaDeath[Type] = false;
  TileObjectData.newTile.CopyFrom(TileObjectData.Style1xX);
  TileObjectData.newTile.Height = 4;
  TileObjectData.newTile.StyleWrapLimit = 111;
  TileObjectData.addTile(Type);
  adjTiles = new int[] { TileID.Chairs };
  }

  //This is the drop code.
  public override void KillMultiTile(int i, int j, int frameX, int frameY)
  {
  Item.NewItem(i * 16, j * 16, 32, 64, mod.ItemType("totemPole"));
  }
  }

Item:
Code:
class totemPole : ModItem
{
  public override void SetDefaults()
  {
  item.name = "Totem Pole";
  item.width = 32;
  item.height = 64;
  item.maxStack = 99;
  AddTooltip("A decorative pole. Best not carry it.");
  item.autoReuse = true;
  item.useAnimation = 15;
  item.useTime = 10;
  item.useSound = 1;
  item.useStyle = 1;
  item.consumable = true;
  item.value = 400;
  item.createTile = mod.TileType("totemPole");
  }

  public override void AddRecipes()
  {
  ModRecipe recipe = new ModRecipe(mod);
  recipe.AddIngredient(Terraria.ID.ItemID.Wood, 10);
  recipe.SetResult(this);
  recipe.AddRecipe();
  }
}

I'm going to guess that the game is somehow treating adjacent totems as a single object; that's the only explanation I can think up for why they would all break at once.

As for the double drops and the missing tile, I have no clue.
 
All right, yet another issue with this darned tile-placement.

The last recommendation for the ModTile's SetDefaults ran into some unusual issues: namely, the tile would place a bit to the left of the cursor and couldn't be placed unless the space immediately to the right would also be a valid placement option. It did *not* actually take up a 2-wide area, as another totem could be placed directly to the right of it afterwards.

In an attempt to combat this, I changed from TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4) to Style1xX, and manually set the height to 4 instead of the width to 1. While this does seem to have overcome the placement issues, it now doesn't show the bottom-most tile when attempting to place (but does once it's already *been* placed) and when destroying one totem, all other totems touching it will also be destroyed. In addition, each totem drops two of itself.

Tile is here:
Code:
  class totemPole : ModTile
  {
  public override void SetDefaults()
  {
  Main.tileFrameImportant[Type] = true;
  Main.tileNoAttach[Type] = true;
  Main.tileLavaDeath[Type] = false;
  TileObjectData.newTile.CopyFrom(TileObjectData.Style1xX);
  TileObjectData.newTile.Height = 4;
  TileObjectData.newTile.StyleWrapLimit = 111;
  TileObjectData.addTile(Type);
  adjTiles = new int[] { TileID.Chairs };
  }

  //This is the drop code.
  public override void KillMultiTile(int i, int j, int frameX, int frameY)
  {
  Item.NewItem(i * 16, j * 16, 32, 64, mod.ItemType("totemPole"));
  }
  }

Item:
Code:
class totemPole : ModItem
{
  public override void SetDefaults()
  {
  item.name = "Totem Pole";
  item.width = 32;
  item.height = 64;
  item.maxStack = 99;
  AddTooltip("A decorative pole. Best not carry it.");
  item.autoReuse = true;
  item.useAnimation = 15;
  item.useTime = 10;
  item.useSound = 1;
  item.useStyle = 1;
  item.consumable = true;
  item.value = 400;
  item.createTile = mod.TileType("totemPole");
  }

  public override void AddRecipes()
  {
  ModRecipe recipe = new ModRecipe(mod);
  recipe.AddIngredient(Terraria.ID.ItemID.Wood, 10);
  recipe.SetResult(this);
  recipe.AddRecipe();
  }
}

I'm going to guess that the game is somehow treating adjacent totems as a single object; that's the only explanation I can think up for why they would all break at once.

As for the double drops and the missing tile, I have no clue.
So fixing the 'destroying one totem results in two being destroyed' can be resolved by changing the third parameter in your KillTile function (the '32') to 16. Other than that, you might want to try something like the following for your tile's SetDefaults function:
Code:
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.Width = 1;
TileObjectData.newTile.Height = 4;
TileObjectData.newTile.Origin = new Point16(0, 0);
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.UsesCustomCanPlace = true;
TileObjectData.newTile.LavaDeath = true;
TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 };
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.addTile(Type);
Try that, see if it works ;)
 
So fixing the 'destroying one totem results in two being destroyed' can be resolved by changing the third parameter in your KillTile function (the '32') to 16. Other than that, you might want to try something like the following for your tile's SetDefaults function:
Code:
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.Width = 1;
TileObjectData.newTile.Height = 4;
TileObjectData.newTile.Origin = new Point16(0, 0);
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.UsesCustomCanPlace = true;
TileObjectData.newTile.LavaDeath = true;
TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 };
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.addTile(Type);
Try that, see if it works ;)
That first bit should have been obvious; I'm ashamed I didn't catch it myself! That fixes both the double drop bug and the adjacent-destruction bug.

All visuals are now rendering properly, but for some reason it's being placed from the top instead of the bottom-- not a huge deal, but inconsistent with how the rest of the game works. Fixed by changing the Origin's second argument to 3. (Presumably, changing the first argument would be helpful in centering wide items.)

I'm going to guess that AnchorBottom means that there has to be a solid block beneath the tile in order for it to exist, and the CoordinateHeights/Width/Padding have to do with the position of each part of the tile in its sprite.

Thanks for all the help!
 
If PreNPCLoot returns false, NPCLoot will not be called.

All that you'll need to change what a mob drops is the PreNPCLoot hook. If you want to change all its drops, then you can return false. But really, the main reason I allow the modder to return false is to emulate the behavior of Meteor Head in hardmode. If you only want to change some of its drops, then NPCLoader has a blockLoot field to which you can add the IDs of the drops you want to change. This will disable the item from being created until NPC.NPCLoot ends, so if you still want to create the item you'll need to call Item.NewItem before you add the ID to blockLoot.

ModNPC.NPCLoot and GlobalNPC.NPCLoot gets called in addition to the vanilla loot, so the boss will still be able to drop all of its normal stuff. You shouldn't have to do anything special to make sure the expert treasure bags work fine (unless you're creating your own boss), but you will have to override GlobalItem.OpenVanillaBag and/or GlobalItem.PreOpenVanillaBag in order to modify their loot.



You can either download mods from the Mod Browser menu, or you can download mods from these forums then move the .tmod file to the "Mods" folder inside your "ModLoader" folder inside your "Terraria" folder.


Alright, I played around a bit and I think I got everything working perfectly. One question remains - I know multiplayer isn't implemented yet, of course, so I don't know if this is a question that can be answered. If you override PreNPCLoot or NPCLoot or whatever, will the game know to only drop a client-side boss bag? Or will specifying client-side vs. server-side drops something that won't be possible until multiplayer is implemented?

Thanks for the help!
 
Alright, I played around a bit and I think I got everything working perfectly. One question remains - I know multiplayer isn't implemented yet, of course, so I don't know if this is a question that can be answered. If you override PreNPCLoot or NPCLoot or whatever, will the game know to only drop a client-side boss bag? Or will specifying client-side vs. server-side drops something that won't be possible until multiplayer is implemented?

Thanks for the help!
Assuming that you stick with the bossBag field and call DropBossBags (or whatever the names were) everything should behave properly once server support is added.
 
Assuming that you stick with the bossBag field and call DropBossBags (or whatever the names were) everything should behave properly once server support is added.

I did this:
Code:
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.KingSlimeBossBag);
There's a specific way to do it for boss bags?

Also there seems to a weird bug in play. The first time I open a boss bag it's fine, but the second time, the bag doesn't open and the inventory slots that come after the one with the bag flash really quickly, like it's unable to draw past the boss bag for a very brief moment. Happened with at least two boss bags.

Code:
        public override bool PreOpenVanillaBag(string context, Terraria.Player player, int arg)
        {
            if (context == "bossBag")
            {
                if (arg == ItemID.KingSlimeBossBag)
                {
                    List<ItemStack> drops = VanillaLootTables.KingSlimeExpert.GetRandomLootDrop();
                    foreach (ItemStack i in drops)
                    {
                        Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, i.id, i.stack);
                    }
                    return false;
                }
            ...
            }
        return true;
    }

GetRandomLoot just returns a list of item id's and stack sizes, randomly chosen from a LootTable object I wrote. It works fine for normal mode drops, but only works once when clicking the expert mode bag until I reload the mod. Given that it's probably due to something in one of the classes I wrote I doubt anyone can help me, but just in case...
 
Last edited:
I did this:
Code:
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.KingSlimeBossBag);
There's a specific way to do it for boss bags?

Also there seems to a weird bug in play. The first time I open a boss bag it's fine, but the second time, the bag doesn't open and the inventory slots that come after the one with the bag flash really quickly, like it's unable to draw past the boss bag for a very brief moment. Happened with at least two boss bags.

Code:
        public override bool PreOpenVanillaBag(string context, Terraria.Player player, int arg)
        {
            if (context == "bossBag")
            {
                if (arg == ItemID.KingSlimeBossBag)
                {
                    List<ItemStack> drops = VanillaLootTables.KingSlimeExpert.GetRandomLootDrop();
                    foreach (ItemStack i in drops)
                    {
                        Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, i.id, i.stack);
                    }
                    return false;
                }
            ...
            }
        return true;
    }

GetRandomLoot just returns a list of item id's and stack sizes, randomly chosen from a LootTable object I wrote. It works fine for normal mode drops, but only works once when clicking the expert mode bag until I reload the mod. Given that it's probably due to something in one of the classes I wrote I doubt anyone can help me, but just in case...
To drop boss bags, you pretty much just call npc.DropBossBags(), and it will give everyone boss bags depending on either the vanilla NPC's ID or the ModNPC's bossBag field.

For your weird problem, this probably won't help but you could try calling Player.QuickSpawnItem instead of Item.NewItem for future server compatibility.
 
hmmm... how do i make a gun that shoots bullets? i feel like i read somewhere on the wiki that the id for bullets is 10 but i can't find that now :( so i don't know. thanks in advance. EDIT: i looked at the example mod again and i realized that i am an idiot and that gun does shoot vanilla bullets :)
 
Last edited:
To drop boss bags, you pretty much just call npc.DropBossBags(), and it will give everyone boss bags depending on either the vanilla NPC's ID or the ModNPC's bossBag field.

For your weird problem, this probably won't help but you could try calling Player.QuickSpawnItem instead of Item.NewItem for future server compatibility.

Cool, that works. Doesn't fix my weird bug though. It looks like it gets to the line
Code:
List<ItemStack> drops = VanillaLootTables.KingSlimeExpert.GetRandomLootDrop();
Before something breaks. Gotta do some digging now...

EDIT: fixed it, stupid mistake on my part.
 
Last edited:
hey i hope maker sees this but so im trying to make a tmodloader mod and i can sprite and code but what do i use plz hurry and respond if you know thx
 

tModLoader-Logo1.png

Current version: v0.6
Compatible with Terraria 1.3.0.8
Platforms: Windows, Mac, Linux

  1. Introduction
  2. Creating Mods
    1. Documentation
    2. Example Mod
    3. Instructions
    4. Help and Resources
  3. Legal Stuff
  4. Credits
  5. Download
    1. Direct Download
    2. Open Source
    3. Past Versions
  6. Installation
  7. Version History
  8. The Future
  9. News


YdXk3Ru.png

tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3.

tModLoader saves worlds and players separately from vanilla worlds and players. Vanilla worlds and players can be ported to tModLoader worlds and players simply by copying over save files. Modded content is saved in files separate from .plr and .wld files, so you can also port modded players and worlds back to vanilla at the cost of losing your modded stuff.

My goal for tModLoader it to make it simple as possible while giving the modder powerful control over the game. A secondary goal is that anyone who works with tModLoader enough will be able to make their own standalone mods. tModLoader is designed in a way as to minimize the effort required for me to update to future Terraria versions. Feel free to either suggest hooks or push hooks to Github (link in a later section).

Also please don't email me, I almost never check my email.



INqo7SN.png

Documentation
Link to Documentation
The documentation contains everything you need to know about what tModLoader has to offer. It contains information on all the features, hooks, etc., in tModLoader, complete with descriptions on what everything is used for. Unlike other modding API's, this documentation is kept up-to-date as features are added. Do note that often it will even be ahead of the current released version.

Example Mod
I use an example mod to test features that I add to tModLoader. You can download a zip file here so you can use it to learn how to make your own things.
Example Mod v0.6 Download

Instructions

To create a mod, first run tModLoader. Click on the "Mod Sources" button in the main menu, then click on the "Open Sources" button to open the folder which contains your mod sources. In this folder, create another folder for your mod, then put all of your .cs files and .png files in that folder. When you are done, build your mod from the "Mod Sources" menu . If the mod failed to build, the game will show you one compile error, and give you an option to view all compile errors as a text file. If the mod successfully builds you will be returned to the main menu. If the game crashes or a mod fails to load, the game will display the error and also give you the option to view the error as a text file. Mods that crash on loading are automatically disabled. Mods are automatically enabled when they are built.

If you are using Mac/Linux, it is possible that your mod will fail to build, no matter what you do. In this case, you will have to pre-compile your mod (see documentation on build.txt for more info).

To distribute a mod, once you have built it, click on the "Mods" button in the main menu, then click on the "Open Mods Folder" button. You will find a file with the .tmod extension for you to distribute.

To install someone else's mod, simply copy the .tmod file to your own Mods folder.

Help and Resources
http://forums.terraria.org/index.ph...amples-handy-code-snippets.28901/#post-656323

I and other people who can help with problems can usually be found in the following chatrooms:
http://www.esper.net/publicirc.php (channel = #tapi)
https://discord.gg/0ZhxukM0qzlWKEqe



Iujuy01.png

Disclaimer and Agreements
  • By downloading tModLoader, you agree to everything in this disclaimer and agreements.
  • I am not responsible for anything that happens to your computer if you download tModLoader. Common sense stuff.
  • Do not use tModLoader to do anything that breaks the Terraria Forums rules.
  • Mods uploaded through the Mod Browser are tagged with your Steam username, so we will know if you do something bad.
  • You are allowed to mod tModLoader (similar to how tModLoader is a mod of Terraria), given that you provide a link to this thread.



j0Qj6pd.png

  • the tModLoader team
  • @Chicken Bones - Creating the code patcher so others can contribute
  • @Itamar - Help with mount support
  • Re-Logic - Creating such a great game to mod
  • The tAPI team - Creating tAPI, the 1.2 modding API



rIPriBf.png

Current version: v0.6
Direct Download Links:
Windows | Mac | Linux


Open Source
In case you want to see how messy my code has become, tModLoader is now open source! Feel free to suggest features either on this thread or over Github.
Github Repository Link




xC00PcG.png

Instructions

Once your download is complete, you should have a zipped folder. Unzip this folder. Open the extracted folder and you should see a README file. All the instructions are in there. If you wish to create mods, make sure that you click on the "Setup Modder Environment" button after you install tModLoader.
(Ever since making the installer this section isn't as useful, heh)



HiViKx8.png

-Proofed ModRecipe methods against modder mistakes
-Mac support
-.cs files are no longer saved as .tmod resources (woops!)
-Made mods compatible cross-platform
-Added support for building .dll files as mods
-Added Unload hook for Mod
-Revamped how minimap handles mod tiles and walls to cut down minimap's RAM usage
-Fixed bug that made .twld files larger than they had to be
-Made some private Projectile fields public
-Fixed bug where Jungle Temple door cannot be unlocked
-Fixed bug with sign GUI
-Fixed bug where cloud saves are not separate from vanilla cloud saves
-Added mod browser - an easy way to upload / download mods
-Basic buff support
-Added support for platform-like tiles
-Fixed bug where miscellaneous custom sounds don't work
-Improved saving for mannequins and item frames with modded items
-Gave ModDusts their own types
-Added hooks for vanity effects for armor sets
-Linux support
-Made a fancy installer
-Partial music support
-Added "Open Mods Folder" button to Mods menu
-Added support for animating vanilla tiles
-Added support for using vanilla textures
-Two mods can no longer share the same internal name
-Mods must now share names with the folder that contains their content
-Added a default mod that will always be enabled
-Loading mods now completely refreshes recipe list
-Added support for storing items whose mods are unloaded
-Added support for custom NPC banners
-Added support for singleplayer chat + ChatInput hook
-Added support for custom sounds
-Improved system for gores
-Added partial support for mounts
-Added support for miscellaneous file resources in .tmod files
-Added CanTownNPCSpawn and CheckConditions hooks for NPCs
-Added TownNPCName and GetChat hooks for NPCs
-Added SetChatButtons and OnChatButtonClicked hook for NPCs
-Added SetupShop and SetupTravelShop hooks for NPCs
-Fixed bug where locked Jungle Temple door can be opened
-Added BuffTownNPC hook
-Added TownNPCAttackStrength, TownNPCAttackCooldown, TownNPCAttackProj, TownNPCAttackProjSpeed hooks for NPCs
-Added TownNPCAttackShoot, TownNPCAttackMagic, and TownNPCAttackSwing hooks for NPCs
-Added DrawTownAttackGun and DrawTownAttackSwing hooks for NPCs
-Added ScaleExpertStats hook for NPCs
-Added PreAI, AI, PostAI, SendExtraAI, and ReceiveExtraAI hooks for projectiles and NPCs
-Added FindFrame and HitEffect hooks for NPCs
-Added aiType field for ModProjectile and ModNPC + animationType field for ModNPC
-Added support for gores
-Added TileCollideStyle, OnTileCollide, PreKill, and Kill hooks for projectiles
-Added PreNPCLoot and NPCLoot hooks for NPCs
-Added BossLoot hook and bossBag field for NPCs
-Made it easier to customize vanilla NPC loot
-Added CanHitNPC and CanHitPvp hooks for items
-Added CanHitNPC, ModifyHitNPC, and ModifyHitNPC hooks for projectiles
-Added CanHitPvp, ModifyHitPvp, and OnHitPvp hooks for projectiles
-Added CanHitPlayer, ModifyHitPlayer, and OnHitPlayer hooks for projectiles
-Added CanHitPlayer, ModifyHitPlayer, and OnHitPlayer hooks for NPCs
-Added CanHitNPC, ModifyHitNPC, and OnHitNPC hooks for NPCs
-Added CanBeHitByPlayer, ModifyHitByPlayer, and OnHitByPlayer hooks for NPCs
-Added CanBeHitByProjectile, ModifyHitByProjectile, and OnHitByProjectile hooks for NPCs
-Added Colliding hook for projectiles and StrikeNPC hook for NPCs
-Added support for NPC map icons
-Added BossHeadSlot, BossHeadRotation, and BossHeadSpriteEffects hooks for NPCs
-Added support for NPC music
-Added GetAlpha, drawOffset, PreDraw, and PostDraw hooks for projectiles
-Added GetAlpha, PreDraw, drawOffsetY, and PostDraw hooks for NPCs
-Added EditSpawnRate, EditSpawnRange, CanSpawn, EditSpawnPool, and SpawnNPC hooks for NPCs
-Added OpenBossBag hook for items
-Added NearbyEffects hook for tiles
-Code is now optimized by compiler
-Deleting players and worlds will now also delete the associated .tplr and .twld files
-Fixed bug where stackable mod items (ie ammo) can have prefixes
-Fixed bug where vanilla NPC display names are wrong
-Fixed bug where open modded doors invalidate houses
-Removed a log write I accidentally left in
-Possibly other stuff I've forgotten
-Updated to Terraria 1.3.0.8
-Modded world and player data now saves in separate .tplr and .twld files
-Added tModLoader version to main menu
-Added support for theoretically infinite recipes
-Improved error-handling
-Added support for crafting groups
-Added PreOpenVanillaBag and OpenVanillaBag hooks for GlobalItem
-Gave tModLoader exe an (uncreative) icon
-Fixed bug where multi-tile subtiles and alternates are not checked
-Fixed bug where Main.tileValue doesn't work for modded tiles
-Added CanKillTile hook for tiles
-Added support for doors, chests, and beds
-Fixed assembly resolve for dll and mod references
-Added GrabRange, GrabStyle, and OnPickup hooks for items
-Bugfixed custom projectiles and NPCs
-Finally fixed bug where "Build + Reload" wouldn't unload mods
-Hopefully fixed dll reference system
-Autoloading now occurs before manual loading
-Added README to installation
-Added support for multiple global entities per mod
-Added support for autoloading global entities
-Added support for autoloading multiple EquipTypes per item
-Fixed bug where AddTooltip duplicates tooltips
-Improved dll reference system
-Fixed bug where missing equipment textures crashes the game
-Made WorldGen class public
-Added support for walls
--Added support for wall kill sounds, dust, drops, and kill-related hooks
--Added support for wall map colors and names, and related hooks
--Added ModifyLight and RandomUpdate hooks for walls
--Added AnimateWall, PreDraw, and PostDraw hooks for walls
-Added MouseOver and Slope hooks for tiles
-Added support for very basic projectiles and NPCs (Untested)
-Wiring._wireList is now public
-Fixed bug where GlobalItem.SetDefaults did not change vanilla names and tooltips
-Added build properties to specify display and dependency stuff
--Mod author and version are now build properties
--Added support for mod and dll dependencies
-Modified WorldFile.ValidateWorld so worlds containing modded stuff can load
-Added support for custom tiles (ModTile and GlobalTile)
--Added support for tile kill sounds, dust, drops, and kill-related hooks
--Added support for custom TileObjectData and multi-tile blocks
--Added ModifyLight, SetSpriteEffects, AnimateTile, PreDraw, and PostDraw hooks for tiles
--Added support for tile map colors and names, and related hooks
--Added RandomUpdate and TileFrame hooks for tiles
--Added mineResistance and minPick fields for ModTile
--Added CanPlace and AdjTiles hooks for tiles
--Added RightClick and HitWire hooks for tiles
-Added ConsumeItem hook for ModRecipe
-Added PreDrawInInventory and PostDrawInInventory hooks for items
-Fixed bug with removing custom armor from mannequins
-Improved error-handling for missing textures
-Safeproofed installation process
-Mod.Load is no longer abstract
-Removed some log writes that I accidentally left in
-Fixed bug with custom item data saving
-Mods now build as a single file that includes image resources
-Added support for automatically loading items, etc.
-Updated to Terraria 1.3.0.7
-Added ModItem.AddRecipes hook
-Added support for custom dust through ModDust
-Added CanEquipAccessory hook for items
-Added GlobalNPC with PreNPCLoot and NPCLoot hooks since everyone wants that
-Added ModItem.SaveCustomData and ModItem.LoadCustomData hooks
-Made tooltips easier to add
-Mods that crash the game while loading are now auto-disabled
-Mods are now auto-enabled when they are built
-Added a button to the Mod Sources menu to open the Mod Sources folder
-In-game error messages now appear when the game would have crashed and when a build fails
-Item display names can now be separated from internal names in the SetDefault hook
-Added a ton of hooks for ModItem and GlobalItem
--CanUseItem, UseStyle, UseItemFrame, UseItem, and ConsumeItem
--HoldStyle, HoldItem, and HoldItemFrame
--Shoot, ConsumeAmmo, UseItemHitbox, and MeleeEffects
--ModifyHitNPC, OnHitNPC, ModifyHitPvp, and OnHitPvp
--UpdateInventory, UpdateEquip, UpdateAccessory, IsArmorSet, and UpdateArmorSet
--CanRightClick, RightClick, and Update
--VerticalWingSpeeds and HorizontalWingSpeeds
--GetAnimation (ModItem only), GetAlpha, PreDrawInWorld, and PostDrawInWorld
-Added support for armors and accessories
-Fixed decompile bug that caused minimaps to not save
-Updated to Terraria v1.3.0.6
-Fixed missing .dll bug when building mods
-Split ModLoader class into ModLoader and ItemLoader
-Slightly changed the way modded items are saved
-Updated to Terraria v1.3.0.5
-Added support for prefixes for modded items
-Vastly improved the GUI for building and loading mods
--Menu shows status of loading and building mods
--Added menus that show lists of mods and mod sources
--Added the ability to enable and disable mods
--Added the ability to build mods individually
-Added GlobalItem
-Support for mods, recipes, and basic items



PjZa7pT.png

My goals for the next update:

v0.6.1:
-Make mods unload in the reverse order they were loaded - Complete
-Add PostSetupContent loading hook for mods - Complete
-Finish music support - Complete
-Fix bug where ModifyHitNPC for items and ModifyHitByItem for NPCs doesn't modify damage - Complete
-Fix bug with animation speed for modded items in the world - Complete
-Add ModPlayer class - Complete
-Add Clone hook for items - Complete
-Fix bug where any mod tile can be put into Extractinator - Complete
-Add ResetEffects and UpdateDead hooks for ModPlayer - Complete
-Add SaveCustomData and LoadCustomData hooks for ModPlayer - Complete
-Make custom data for modded items from unloaded mods persistent - Complete
-Make ItemIO from Terraria.ModLoader.IO public - Complete
-Add ExtractinatorUse hook for items - Complete
-Add SetupStartInventory hook for ModPlayer - Complete
-Add UpdateBiomes and UpdateBiomeVisuals hooks for ModPlayer - Complete
-Add support for screen shaders and custom skies - Complete
-Add disableSmartCursor field for ModTile - Complete
-Add AutoLightSelect hook for ModItem and AutoSelect hook for tiles - Complete
-Add support for torches - Complete
-Add PostUpdate hook for items - Complete
-Add SetDrawPositions hook for ModTile - Complete
-Add UpdateBadLifeRegen, UpdateLifeRegen, and NaturalLifeRegen hooks for ModPlayer - Complete
-Add PreUpdate, SetControls, PreUpdateBuffs, and PostUpdateBuffs hooks for ModPlayer - Complete
-Add PostUpdateEquips, PostUpdateMiscEffects, PostUpdateRunSpeeds, and PostUpdate hooks for ModPlayer - Complete
-Add SetMatch hook for items and FrameEffects hook for ModPlayer - Complete
-Add PreHurt, Hurt, PreKill, and Kill hooks for ModPlayer
-Add PreItemCheck and PostItemCheck hooks for ModPlayer
-Add GetWeaponDamage and GetWeaponKnockback hooks for ModPlayer
-Add projOnSwing field for ModItem
-Add ConsumeAmmo, Shoot, and MeleeEffects hooks for ModPlayer
-Add OnHitAnything hook for ModPlayer
-Add CanHitNPC, ModifyHitNPC, and OnHitNPC hooks for ModPlayer
-Add CanHitNPCWithProj, ModifyHitNPCWithProj, and OnHitNPCWithProj hooks for ModPlayer
-Add CanHitPvp, ModifyHitPvp, and OnHitPvp hooks for ModPlayer
-Add CanHitPvpWithProj, ModifyHitPvpWithProj, and OnHitPvpWithProj hooks for ModPlayer
-Add CanBeHitByNPC, ModifyHitByNPC, and OnHitByNPC hooks for ModPlayer
-Add CanBeHitByProjectile, ModifyHitByProjectile, and OnHitByProjectile hooks for ModPlayer
-Make a fishing and quest hooks for ModPlayer
-Add WalkDust, MouseOverFar, and HurtPlayer hooks for tiles
-Add hooks for grappling hooks
-Add support and hooks for PlayerLayer (custom player drawing)
-Add hooks for buffs
-Add super epic boss to ExampleMod - 6% Complete
-Add support for switching item forms

Tentative Future Plans
v0.6.2: Hooks for worlds, more support for storing unloaded mod content
v0.6.3: Hooks for mounts and tile entities
v0.6.4: Hooks for interfaces
v0.6.5: Server support + hooks for network
Further in the future: JSON support + other stuff I'm forgetting + full release



dwFwaFN.png

v0.6 is now released! Cross-platform compatibility! Woo!
http://forums.terraria.org/index.php?threads/1-3-tmodloader-a-modding-api.23726/page-161#post-777542

Might wanna take down the mod browser :/ People are using it to bypass the forum's rule of deleted items and other rules :/
Maybe it should be changed so that the mod needs approval from you or something
 
Might wanna take down the mod browser :/ People are using it to bypass the forum's rule of deleted items and other rules :/
Maybe it should be changed so that the mod needs approval from you or something
Thanks for reporting. We'll remove it, and since we have the Steam names for everyone who uploads mods we'll try to see if we can stop that user from uploading that mod.

@jopojelly
 
There's a rule against deleted items? I learn something every day.

Is it just the "DeletedItemsMod" that is in violation?
 
Back
Top Bottom