Fandom

Surfpup's tConfig Mod Wiki

Changelog/v2

< Changelog

124pages on
this wiki
Add New Page
Comments0 Share

Release 12 (v0.22)Edit

v0.22.8Edit

  • Updated installer to stop and tell you if you have the wrong directory selected. This seems to have tripped up/confused a lot of people.
  • Basic functionality for auto-updating tConfig itself is in place. Needs more testing however!
  • Began work on automatic update check & download for .obj files. You specify a version number and a URL in Config.ini. The URL must point to a text file containing a version number and the URL pointing to the .obj file. Updates are checked for when you start the game; if any are available you'll see a "Updates Available!" menu option. Otherwise you'll see "Check for Updates". When you click on it, it brings up the list of mods with updates available, indicating their new version number, and letting you choose which ones to download. Then click "Download Updates & Reload Mods" to get the updates! Example files:

Config.ini (in your mod's source folder):

[Settings]
;'version' is mostly related to save data. Most people won't need to use it unless they make an update that changes how the save/load methods work.
version=1
;'DLversion' is the version number compared against the version number you post online, for the purpose of figuring out whether a newer version is available.
;DLversion can have two decimal places
DLversion=1.0
;URL pointing to a text file, which must contain the version number on the first line, and the URL to the .obj file on the second line
url=https://content.wuala.com/contents/Surfpup/Documents/Projects/Terraria/Release/ModPacks/Portal%20Mod/version.txt

version.txt (online somewhere):

1.0
http://content.wuala.com/contents/Surfpup/Documents/Projects/Terraria/Release/ModPacks/Portal%20Mod/Portal%20Mod.obj?dl=1

v0.22.7Edit

  • May have fixed the issue which allows you to hit an enemy way-too-many times with one swing. You should be able to hit an enemy up to 3 times max. Also, this check was added to player versus player attacks.
  • Fixed: Tiles weren't being initialized on the client when playing multiplayer
  • Fixed/Changed: ModWorld.Initialize wasn't getting called before ModifyWorld() - it is now. May be important for certain kinds of mods.
  • Added average color values for walls to world.txt (for mapping tools)
  • This release will require everyone to recompile their mods.

v0.22.6Edit

  • Added new Player method: void FrameEffect(Player player) - Similar to the PlayerFrame() method, but it gets called for all items, buffs, etc and doesn't care about set bonuses.
  • Modpack builder now searches through subdirectories recursively, so you can have more organized folders!
  • You can now "include" another file's text into a .cs file by adding something like the following to the file: #INCLUDE "filename.cs"
  • Moved Projectile Initialize() method call to a different location, so it is possible to modify certain values such as the velocity, damage, or other values passed into NewProjectile()
  • New networking capabilities
    • Save/Load for ModWorld no longer transfers data
    • Instead, we have two new methods for handling networking data transfers
      • void NetReceive(int msg, BinaryReader reader)
      • void NetSend(int msg, BinaryWriter writer)
      • Called on the server:
        • void PlayerConnected(int playerID) - Called on the server when a player connects
        • void PlayerDisconnected(int playerID) - Called on the server when a player disconnects -Not working as expected
        • void SyncPlayers() - Called on the server when a player joins, and periodically afterwards.
        • Use NetMessage.SendData, or NetMessage.SendModData in these methods to send data to the player(s)
    • Call NetMessage.SendData with 100 as the msgType, the mod 'id' value, and your own message ID number, and NetSend() will be called. Here's a simple example of sending a random number to the client periodically (dumb example, but it's a start):

World.cs:

public static int randomNum;
public void Initialize() {
	randomNum=WorldGen.genRand.Next();
}

public void UpdateWorld() {
	if(Main.netMode==2 && (Main.time % 200 == 0)) {
		int modIndex = Config.mods.IndexOf("ModName");
		NetMessage.SendData(100, -1, -1, "", modIndex, 1);
	}
}
public void NetReceive(int msg, BinaryReader reader) {
	int num=reader.ReadInt32();
	Main.NewText("Msg="+msg+", Received "+num);
	Console.WriteLine("Msg="+msg+", Received "+num);
}
public void NetSend(int msg, BinaryWriter writer) {
	writer.Write(randomNum);
	Main.NewText("Msg="+msg+",Sent "+randomNum);
	Console.WriteLine("Msg="+msg+",Sent "+randomNum);
}
  • Updated 'furniture' attribute for tiles - you can now set it to 'torch' or 'door'
  • Fixed crash that occured after mod reloading when connecting to a server
  • New simplified method for sending messages:
    • public static void SendModData(int modIndex, int msgID, int remoteClient = -1, int ignoreClient = -1, params object[] parameters)
    • Improved documentation to be released soon

v0.22.5Edit

  • Fixed server issues with saving/generating a world
  • Updated modpack builder to save color averages, which is loaded and saved to world files

v0.22.4Edit

  • ???

v0.22.3Edit

  • Updated InterfaceObj class
    • You can now specify the color of a text button
      • public int AddText(string text, int x, int y, bool clickable,float scale=1f, Color color=new Color())
    • Fixed issue with using an item when clicking on a text button
  • Made most methods in Main into public methods
  • Fixed issue with invalid IDs - fixes the common dictionary key error. There was an issue in which the ID for "Unloaded Item" wasn't getting saved. Also, for any ID that is unknown, it will make it into an "Unloaded Item" and you shouldn't lose any data.
  • Added average color of mod tiles to world.txt (useful for tools/map editors)

v0.22.2Edit

  • Multiplayer Synchronization for the ModWorld class. Currently uses the Save() and Load() methods. They will get synchronized when a player joins and then every 30 minutes? or so. This feature is subject to change.
  • New ModWorld methods
    • void PreDrawInterface(SpriteBatch spriteBatch) - called before interface is drawn
    • bool PreHitWire(int x, int y) - called when HitWire() is called. Return true to execute normal hitwire function, false otherwise.
  • Improvements to the multiplayer mod transferring feature. More tests need to be done, but it definitely works better than before.

v0.22.1Edit

  • Fixed bug related to saving/loading global mod data
  • Fixed text input issue

v0.22.0Edit

  • Fixed crashing bug related to drawing the player's item?


Release 11 (v0.21)Edit

v0.21.9Edit

  • World file names will have invalid characters replaced with an underscore.
  • Fixed issues with saving version number of mods for player saves
  • Fixed unloaded items
  • Added 'drawPretendType' to INI files for Items and Projectiles. Affects the sprite drawn and possibly some other things.

v0.21.8Edit

  • ???

v0.21.7Edit

  • Actually fixed saving issues related to float values

v0.21.6Edit

  • Added some drawing methods. I tried to make this as flexible as possible, so that's why there's two methods, for before and after the regular drawing process.
    • For projectiles, NPCs
      • bool PreDraw(SpriteBatch spriteBatch) - Called before the default drawing code; return true to execute the regular drawing code, otherwise return false.
      • void PostDraw(SpriteBatch spriteBatch) - Called after the default drawing code
    • ModWorld class
      • void PostDraw(SpriteBatch spriteBatch) - Called every tick, after the default drawing method

Example usage of drawing (draws "Hello World" underneath the player's health) (in Global\World.cs)

public static void PostDraw(SpriteBatch spriteBatch) {
	string text="Hello World!";
	SpriteFont font = Main.fontMouseText;
	Vector2 v1 = new Vector2(628f - Main.fontMouseText.MeasureString(text).X * 0.5f + (float)(Main.screenWidth - 800), 84f);
	Color color = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor);
	float f1 = 0f;
	Vector2 origin = default(Vector2);
	spriteBatch.DrawString(font, text, v1, color, f1, origin, 1f, SpriteEffects.None, 0f);
}

v0.21.5Edit

  • Save files are now extracted/created in memory (no temporary files necessary)
  • Might have fixed the button for starting a server in the menu. Haven't tested it.
  • Made some changes that might fix lag issues with custom tiles. However, beware that lag will most probably occur if you have many instances of a custom tile with a .cs file. It is recommended that you write methods in ModWorld class and check the tile type and handle the code there if code is needed for a tile that will exist in large quantities.
  • Added ModPlayer method "PreUpdatePlayer" which is simply called before the effects from items and buffs are applied.

v0.21.4Edit

WARNING: This update introduces a new world save format! It will automatically backup your save files in "wldbackups" within the save directory, but you should still be wary!

  • Implementation of new save format for worlds. Old save files are loaded and updated appropriately.
  • The world selection menu has been updated so that more than 5 worlds are possible.
  • The save files for worlds are named after the world name. No longer will you be confused about which world your save file is for!
  • Added the game launcher to the installer
  • Added 'aiPretendType' attribute to NPCs.
  • Added 'UpdateWorld()' method to the ModWorld class
  • Fixed problem with the installer causing files to not be overwritten (the modpack builder and the server)
  • Updated ModPlayer and ModWorld Initialize() method to be called right before the load method (meaning, when the world is loaded or when the player is loaded). Before it was being called when the mods were loaded.
  • Fixed (maybe): Global mod save data not being maintained if the mod is disabled
  • Updated world load error message to be more helpful. If a mod tile or wall isn't loaded, it will tell you what mod you need to load. Also, the game no longer automatically tries to use the .bak file, although it will continue to create a .bak file. This is done since most of the time now people are going to fail to load a world because of which mods they have on, and not because the world is corrupted.

v0.21.3Edit

  • Added a new internal feature: Tested some awesome code that automatically updates the version number on the wiki, and also handles some other things.

v0.21.2Edit

  • Added 'parent' attribute for INI files. Specify the name of another INI file in the same folder, and it will use the attributes in that file, except for ones that have already been defined. It does not make use of the parent's recipe data.
  • Changed where 'CreatePlayer()' gets called from. Should fix issue with copper tools getting added after the method is called.
  • Changed (internal): RunMethod() for global methods works the same as it does for regular methods.
  • New Installer should actually work now. It might require administrator privileges, but I think that's the only potential issue. Also, the option to update old save files (pre-0.18.3) isn't included in this. If anyone needs old save files to be updated, let me know and I'll release a program just for doing that.

v0.21.1Edit

  • Minor improvements to the installer
  • The "new" installer didn't work out, but I might work on it again at some point. I need it to compute a hash of a file, and I was attempting to accomplish this through loading an external DLL file.

v0.21.0Edit

  • Fixed bug related to NPC Save() and Load() methods (used in networking)
  • Updated ModPlayer (Player.cs) class to have the following method calls:
    • void DamageNPC(Player myPlayer,NPC npc, ref int damage, ref float knockback)
    • void DealtNPC(Player myPlayer, NPC npc, double damage)
    • void DealtPlayer(Player myPlayer, double damage, NPC npc)
    • void DamagePVP(Player myPlayer, ref int damage, Player enemyPlayer)
    • void DealtPVP(Player myPlayer, int damage, Player enemyPlayer)
    • void OnSpawn(Player player, int id)
    • void UpdatePlayer(Player player) - Called every 'tick'
    • void CreatePlayer(Player player) - Called when a Player instance is created. This is where it sets the player's default starting items.
  • Updated ModWorld (World.cs) class to have access to all tile method calls
  • Tile methods
    • method update (added playerID): void PlaceTile(int x, int y, int playerID) - playerID is -1 if it isn't done by a player.
    • void KillTile(int x, int y, Player player) - Similar to DestroyTile() but it is handled differently. It gets called for built-in tiles as well. 'player' is null if a player didn't destroy it.
  • Item method:
    • void PlayerGrab(Player player, int playerID, int itemIndex) - Called when the item collides with the player. This is where health or mana crystals give the player health/mana, and normal items go into the player's inventory. Defining this method will override the default behavior for normal items. The itemIndex is the index into the Main.item[] array.
  • Example (work-in-progress) mod that makes use of the ModPlayer class: Stats mod

Release 10 (v0.20)Edit

v0.20.9Edit

  • Fixed bug related to opening chests in multiplayer

v0.20.8Edit

  • Updated deletion of player/world to delete the tConfig files
  • Fixed bug causing ModifyWorld() to not get called.
  • May have fixed bug related to the drawHair option

v0.20.7Edit

  • New classes can be defined for storing global data.
    • ModWorld class - in 'Global\World.cs' - Define Save() and Load() methods to save data associated with the world. This class is accessible by any of the code files in the same mod.
    • ModPlayer class - in 'Global\Player.cs' - Define Save() and Load() methods, handle data associated with the player. This class is also accessible by any of the code files in the same mod.
  • Fixed bug related to global method calls in Item.cs (and possibly others).
  • Examples mod updated to include a very simple (overpowered) example in which your damage goes up every time you hit something.

Player.cs

public static int melee=0;
public static int ranged=0;
public static int magic=0;
public static void Save(BinaryWriter writer) {
	writer.Write(melee);
}
public static void Load(BinaryReader reader, int version) {
	melee=reader.ReadInt32();
}

Item.cs

public void DamageNPC(Player myPlayer,NPC npc, ref int damage, ref float knockback) {
	if(item.damage>0) {
		damage+=ModPlayer.melee;
		ModPlayer.melee++;
		item.toolTip3 = "Melee skill adds "+ModPlayer.melee+" damage";
	}
}

v0.20.6Edit

  • Added new attribute for Tile INI: Set "spawn=True" to make a custom spawn point tile.
  • Use this code (roughly) for a custom bed:
public static void UseTile(Player player,int x , int y)
{
	while(Main.tile[x,y].frameX>0) x--;
	while(Main.tile[x,y].frameY>0) y--;
	if (Player.CheckSpawn(x, y+1))
	{
		player.ChangeSpawn(x,y+1);
		Main.NewText("Spawn point set!", 255, 240, 20);
	}
}
  • Also, be sure to set 'furniture=chair' since the bed is considered a comfort furniture.
  • Updated/fixed class renaming so items with a dash will compile now
  • Updated Examples mod to include a Red Bed example

v0.20.5Edit

  • Updated Load() methods for Items, Tiles, and Buffs, to take a version integer as an optional parameter. Also, you can now specify a version number for your mod in "Config.ini" in the root of the mod folder (i.e. ModPacks\ModName\Config.ini), like this:
[Settings]
version=1
  • This is mostly useful for advanced mods that save and load data - if you update your mod to save more data or less data, then you need to check the version number to be sure you load it correctly. The version number passed in to the Load() methods is the version of the mod when the data was saved. If the method is called for networking purposes, it should pass in the current version of the mod as specified in the INI file.
  • Changed how Tile code works - each tile has its own object instance now. Added SaveGlobal() and LoadGlobal() methods, for saving and loading static variables.
  • Added Tile methods:
    • void Update(int x, int y) - Called every tick
    • static bool CanPlace(int x, int y) - Called when the player attempts to place it somewhere. Gives you more control over how it can be placed - example may be a plant that can only be placed on dirt. This is a work-in-progress not-tested method, I may change it.
    • static void SaveGlobal(BinaryWriter writer)
    • static void LoadGlobal(BinaryReader reader, int version)
  • You can now create things like plants, but I'm still working on how to make it so you can only place it on dirt or a vase.
  • Fixed bug causing mods with DLLs to fail to load
  • Updated the Examples mod and the Portal Mod

v0.20.4Edit

  • Changed some private variables to public in the Player class
  • Added new method: void OnSpawn(Player player, int id) - for armor/accessories and buffs, called when the player respawns.
  • Updated installer - re-added in the option to update saves from before 0.18.3.

v0.20.3Edit

  • Fixed bug related to 'code' INI attribute
  • Fixed some other stuff

v0.20.2Edit

  • ???

v0.20.1Edit

  • Updated Tile lighting method: void AddLight(int x, int y, ref float red, ref float green, ref float blue) - Modify the red/green/blue values to your desire. Make sure your Tile INI file has "Lighted=True".
  • Item Method: void UseStyleHitBox(Player player, ref Rectangle rectangle) - Modify the rectangle's attributes to affect the collision detection with your item.
  • Disabled ability to place custom armor on Mannequins.
  • Fixed bug related to custom hold styles
  • Added ability to create custom Use Styles - place .cs files in Item\UseStyle\, and add "useStyleName" attribute to your Item INI file. Use Styles also require these methods:
    • void SetStyle(Player player, Item item) - Alter the location and/or rotation of the item
    • void SetFrame(Player player, Item item) - Set the bodyFrame player variable - The vanilla code sets player.bodyFrame.Y
    • Rectangle UpdateHitBox(Player player, Item item, Rectangle rectangle) - Return the updated rectangle used for collision detection.
  • Added two new attributes to Projectile INI files: frameOffsetX, and frameOffsetY

v0.20.0Edit

  • Made some changes to the Installer that should help some people having issues.
  • Fixed chest-destruction crash bug for real this time.
  • Updated the projectile AI() to allow the programmer to call the original AI() method (similar to the NPC AI) by calling projectile.AI(true)
  • New methods:
    • ​Tile:
      • void AddLight(int x, int y) - In theory you can add light to your tile here, but I haven't looked at how it works yet.
    • Item:
      • void UseStyle(Player player) - Alter how the item appears, it's location and rotation when it is used.
      • void HoldStyle(Player player) - Alter how/whether the item is visible when held. Called after the normal or custom hold style code has run.
  • Ability to define new Hold Styles, in .cs files located in Item\HoldStyle\ - the methods required are:
    • void SetStyle(Player player, Item item) - Alter the location and/or rotation of the item
    • void SetFrame(Player player, Item item) - Set the bodyFrame player variable - The vanilla code sets player.bodyFrame.Y
  • To set a custom holdStyle on an item, set the 'holdStyleName' value.
  • Added 'frameCount' attribute to Projectiles INI, so you can have projectiles with multiple frames.
  • Updated modpack builder to compile everything into a single assembly. In theory, static variables should work as static variables should now. Need to test this...

Release 9 (v0.19)Edit

v0.19.8Edit

  • Made attempt to fix the somewhat common error with loading built-in items
  • Made changes to the interface stuff. Wasn't exactly finished messing with it, but essentially there's now an Interface called Interfaceable which must be inherited by a class. You pass along an Interfaceable object to the InterfaceObj() class now. The interface requires these methods:
    • bool DropSlot(int slotNum);
    • void ButtonClicked(int buttonNum);
    • bool CanPlaceSlot(int slotNum, Item mouseItem);
    • void PlaceSlot(int slotNum);
  • Examples to come.. at some point.
  • May have fixed bug causing the destruction of a chest to crash the game

v0.19.7Edit

  • Modpack builder has been updated to automatically generate an installer. I'll probably make it optional in the future.
  • An interface can be defined/brought up when a tile is clicked on. It works the same way as the NPC interface, but you have to set a vector to the location of the tile. I'll write up some more details about the InterfaceObj class at some point...
public void UseTile(Player player, int x, int y) {
	while(Main.tile[x,y].frameX>0) x--;
	while(Main.tile[x,y].frameY>0) y--;
	//Setup the interface...
	InterfaceObj inter = new InterfaceObj(this, 3, 3); //Pass along this code instance, and the # of item slots you want to use
	inter.SetLocation(new Vector2((float)x,(float)y)); //This needs to be set for tiles in particular.
		//When the player walks too far away, the interface will close
	inter.AddItemSlot(150,250);
	inter.AddItemSlot(230,250);
	inter.AddItemSlot(190,300);
	inter.AddText("Enchant:", 130, 230, false, 0.9f);
	inter.AddText("Rune:", 225, 230, false, 0.9f);
	inter.AddText("Result:", 140, 310, false,0.9f);
	Config.tileInterface = inter;
	Main.playerInventory = true;
}

v0.19.6Edit

  • Updated the InterfaceObj class to be capable of drawing text and text buttons.
  • Made some changes that will enable you to create custom chests.
  • New Tile Method: bool CanDestroyTile(int x, int y) - Return true if the tile can be destroyed, false otherwise. Useful for a chest, if you want it to be indestructible while it contains items.
  • Changes to the Installer
    • Removed feature for upgrading save files from before 0.18.3. It will mostly just serve to confuse people. If you have outdated save files, you're out of luck. (Maybe I'll make a separate tool for updating them, but... let me know if that's necessary)
    • It will automatically copy over vanilla save files if the tConfig save folders are empty. Too many people got confused when presented with a question, hit no, and then didn't see any save files in tConfig.
  • Created an auto-extractor generator tool for modders. It will take all of the .obj files that are in the same folder and create "tConfig Mod Installer.exe" - when you run this installer, it will copy the .obj files to the ModPacks folder. Hopefully this makes things a bit easier for some people.
  • Code to make a tile usable as a chest (included in the Examples pack):
public void PlaceTile(int x, int y) {
	while(Main.tile[x,y].frameX>0) x--;
	while(Main.tile[x,y].frameY>0) y--;
	int ID = Chest.CreateChest(x, y);
}
public void UseTile(Player player, int x, int y) {
	while(Main.tile[x,y].frameX>0) x--; // && Main.tile[x-1,y].type==type
	while(Main.tile[x,y].frameY>0) y--; // && Main.tile[x,y-1].type==type
	Main.chestText = "Chest";
	int ID= Chest.FindChest(x, y);
	Main.player[Main.myPlayer].chest = ID;
	Main.playerInventory = true;
    Main.PlaySound(12, -1, -1, 1);
    Main.player[Main.myPlayer].chestX = x;
    Main.player[Main.myPlayer].chestY = y;
}
public bool CanDestroyTile(int x, int y) {
	while(Main.tile[x,y].frameX>0) x--;
	while(Main.tile[x,y].frameY>0) y--;
	int ID= Chest.FindChest(x, y);
	if(ID==-1) return true;
	for(int i=0;i<Chest.maxItems;i++) {
		if(Main.chest[ID].item[i].type > 0) return false;
	}
	return true; //If there are no items in the chest, then let it be destroyed
}
public void DestroyTile(int x, int y) {
	while(Main.tile[x,y].frameX>0) x--;
	while(Main.tile[x,y].frameY>0) y--;
	Chest.DestroyChest(x, y);
}
  • Fixed volume menu

v0.19.5Edit

  • Fixed bug related to custom projectiles in multiplayer (and possibly buffs too)
  • Updated the installer:
    • It offers to copy over vanilla files if the tConfig save folders are empty
    • It will ask you if you have any save files from before version 0.18.3. All it really does is modify the 'release' number in the files.
    • It now includes the Game Launcher made by Eikester. The Game Launcher installer will be run if TerrariaOriginalBackup.exe isn't found.
  • New option in Config Mod.ini: in the Config section, set ignoreErrors to False if you want the game to crash/display error messages. This may be useful for modders. By default this value is True.

v0.19.4Edit

  • Fixed issue with slimes and possible other NPCs not being defined properly. Also updated the Defaults pack.
  • Ability to define an interface that can be brought up through an NPC. Essentially you set the locations of item slots, and define methods that get called for placing items in them and such.
  • NPC Interface methods:
    • string ChatFuncName() - Return the text you click on to call the ChatFunc().
    • void ChatFunc() - Perform some action when the text is clicked on. You can define an interface here, or maybe turn the NPC into Skeletron.
    • bool CanPlaceSlot(int slot, Item mouseItem) - return true if you want to let the player place / pick up an item in the specified slot. mouseItem is the item currently held by the mouse.
    • void PlaceSlot(int slot) - Perform some action after an item has been placed or taken from the specified slot
    • bool DropSlot(int slot) - Called when the interface is closed - return true if you want the item in the slot to be dropped, false otherwise.
  • The InterfaceObj class is the class you will use to define an interface. Currently it only supports adding item slots, but I intend to update it so that you can draw text and text buttons.
  • Example code (for an NPC) (Screenshots: http://imgur.com/a/Dop19 ):
int upgradeCost=0;
public static string ChatFuncName() {
	return "Enchant";
}
public void ChatFunc() {
	//Called when "Enchant" is clicked on
	//Setup the interface...
	Config.npcInterface = new InterfaceObj(this.npc, 3); //Pass along this code instance, and the # of item slots you want to use
	Config.npcInterface.AddItemSlot(150,250);
	Config.npcInterface.AddItemSlot(200,250);
	Config.npcInterface.AddItemSlot(175,300);
	Main.npcChatText = "";
	Main.playerInventory = true;
	//By defining the npcInterface, it will be displayed appropriately...
}

public bool CanPlaceSlot(int slot, Item mouseItem) {
	//The user shouldn't be able to place things in the output slot
	if(slot==2 && mouseItem.type!=0 && Config.npcInterface.itemSlots[2].type!=0) return false;
	return true;
}

public void PlaceSlot(int slot) {
	//This is called after an item is placed into the slot, or taken 
		//(both happen on left-click)
	//Slot 0: Weapon/equipment to upgrade
	//Slot 1: Items used for upgrading
	//Slot 2: Result of upgrading
	Item[] itemSlots = Config.npcInterface.itemSlots;
	if(itemSlots[0] != null && itemSlots[1]!=null) {
		if(slot==2 && upgradeCost>0) {
			itemSlots[0]=new Item();
			itemSlots[1].stack-=upgradeCost;
			upgradeCost=0;
			return;
		}
		//Create a complete copy of the item, then call its upgrade() method
		itemSlots[2] = new Item();
		MemoryStream mstream = new MemoryStream();
		BinaryWriter writer = new BinaryWriter(mstream);
		Codable.SaveCustomData(itemSlots[0], writer);
		mstream.Position=0;
		itemSlots[2].SetDefaults(itemSlots[0].name);
		Codable.LoadCustomData(itemSlots[2], new BinaryReader(mstream));
		
		if(itemSlots[2].RunMethod("Upgrade", itemSlots[1])) {
			//Method ran, now let's get the return value
			int amtUsed = (int)Codable.customMethodReturn;
			if(amtUsed==0) itemSlots[2]=new Item();
			else upgradeCost=amtUsed;
		}
		else {
			upgradeCost=0;
			itemSlots[2]=new Item();
		}
	}
	else upgradeCost=0;
}

public bool DropSlot(int slot) {
	//Called when the interface is closed.
	//Return true to drop the item, false otherwise
	if(slot==2) return false;
	return true;
}
  • Notice how it calls a custom item method, "Upgrade" - int Upgrade(Item item) - return the stack amount of the item that the upgrade will use up. Return zero if the item can't be used for upgrading. This method is not used in tConfig.
  • The weapon that can be upgraded has this code (Wood used for testing purposes):
int dmgBonus=0;
public void Initialize() {
	dmgBonus=0;
	this.item.toolTip2="Damage Level "+dmgBonus;
}
public void Save(BinaryWriter writer) {
	writer.Write(dmgBonus);
}
public void Load(BinaryReader reader) {
	dmgBonus=reader.ReadInt32();
	this.item.damage+=(dmgBonus*5);
	this.item.toolTip2="Damage Level "+dmgBonus;
}
public int Upgrade(Item item) {
	if(item.name=="Wood") {
		dmgBonus+=1;
		this.item.damage+=(dmgBonus*5);
		this.item.toolTip2="Damage Level "+dmgBonus;
		return 1;
	}
	return 0;
}

v0.19.3Edit

  • NPC Save() and Load() methods for networking purposes. You can use these to store your own variables instead of using the ai[] array.
  • You can now make items that use existing item types. However, prefixes seem to be glitchy with these, and won't be saved if the mod for the item is not loaded.
  • Prefixes are actually saved for unloaded items (except as noted above)
  • Fixed issues with mod transfers. It was off by one byte.

v0.19.2Edit

  • Major change to saving and loading. All tConfig-related data is stored in separate files.
  • Unloaded items will now have their prefixes saved.
  • Fixed bug: Unloaded items should work in multiplayer again.
  • Internal change to some interface code related to displaying chest contents

v0.19.1Edit

  • Fixed mod-pack builder bug related to compiling projectile and buff code
  • Added method for Items: bool CanUse(Player player, int playerID)
    • Return True if the item can be used, false otherwise. This opens up more possibilities, and is needed for things like boomerangs that have a limit to the amount that can be thrown. Example for boomerangs:
public bool CanUse(Player player, int pID) {
	bool use=true;
	//This code is used by boomerangs to limit the amount of boomerang projectiles that can be thrown.
	for (int m = 0; m < 1000; m++)
	{
		if (Main.projectile[m].active && Main.projectile[m].owner == Main.myPlayer && Main.projectile[m].type == this.item.shoot)
		{
			use = false;
			break;
		}
	}
	return use;
}
  • For Items (head armor) - Set "drawHair=2" to make hair be drawn underneath head gear
  • Example code that adds custom items to chests randomly during world generation - was made utilizing Omnir's Weapons mod
​public void ModifyWorld() {
	int chestType=1; //1=gold, 2=locked gold, 3=shadow, 4=locked shadow, 5=barrel?, 6=trash can 
	int numAdded=0;
	for(int i=0;i<1000;i++) {
		Main.statusText = "Added "+numAdded+" weapons to chests... ("+(i/1000)+"%)";
		Chest chest = Main.chest[i];
		if(chest!=null) {
			int x = chest.x;
			int y = chest.y;
			if(Main.tile[x,y]!=null && Main.tile[x,y].active && Main.tile[x,y].frameX >= 36 * chestType && Main.tile[x,y].frameX <= 18+ 36 * chestType) {
				//It's a gold chest
				//Place an item in it!
				string[] items={"Claw", "Dai Katana", "Falcion", "Flail Mace", "Great Warhammer", "Mace", "Ninjato", "Nodachi", "Nunchaku", "Pole War Axe", "Rapier", "Scythe", "Sickle", "War Axe", "Whip", "Zweihander"};
				string[] grade={"Copper", "Iron","Silver", "Gold", "Shadow", "Cobalt", "Mithril", "Adamantite", "Fiery", "Hallowed"};
				int itemType = WorldGen.genRand.Next(items.Length);
				int gradeType=WorldGen.genRand.Next(grade.Length);
				for(int j=0;j<Chest.maxItems;j++) {
					if(chest.item[j]==null || chest.item[j].type==0) {
						chest.item[j] = new Item();
						chest.item[j].SetDefaults(grade[gradeType]+" "+items[itemType]);
						numAdded++;
						break;
					}
				}
			}
		}
	}
}

v0.19.0Edit

  • You can now define a method called 'ModifyWorld' in Tile.cs. This is called after the world generation process, so you can modify the world however you like. This may require some more advanced programming to accomplish what you want. I'll come up with a simple example at some point.
  • Updated WorldGen class to have all public variables.
  • Fixed bug related to loading tile data
  • Fixed bug related to loading items when 'items.ini' is missing
  • Added some simple code to backup the additional save files

Release 8 (v0.18)Edit

v0.18.9Edit

  • Updated installer to automatically update settings so that tConfig save files are updated. It also prints a message about it.

v0.18.8Edit

  • Fixed problem with multiplayer transfer attempting to transfer 'Built-In' mod

v0.18.7Edit

  • Fixed error with DamageNPC() method for Items.
  • DamageNPC() now gets called for armor/accessories and buffs.

v0.18.6Edit

  • Updated Defaults pack
  • Game will (optionally) load resources from Defaults .obj files instead of internal resources, might help with an error some people are getting. Extract the Defaults pack to your ModPacks folder for this to work.

v0.18.5Edit

  • Updated mod-pack builder with improved error checking
  • 'special' attribute for tiles - set to True to make a 1x1 tile be handled like the other ones (droptables are not working with these yet)
  • Methods for Tiles. Note that there is only one instance of your code for a tile type. This is done because making every tile potentially have its own custom code and data would increase the RAM usage by a lot.
    • void Initialize() - Called when the first tile of this type is placed. I'll also make it so this is called when the world is loaded.
    • void PlaceTile(int x, int y) - called when a tile is placed.
    • void DestroyTile(int x, int y) - called when a tile is destroyed.
    • void UseTile(Player player, int x, int y) - called when a player clicks on a tile
    • void Save(BinaryWriter writer) - Called when the world is saved. Saves to a separate file.
    • void Load(BinaryReader reader) - Called when the world is loaded.
    • void hitWire(int x, int y) - called when a tile is activated by a wire
  • Added new attribute for all INI files: 'code' - set to the name of another custom item and it will use its .cs file instead. This is useful when you want multiple items to use the same code but don't want to copy it redundantly into multiple files.

v0.18.3Edit

Backup your save files in case something goes wrong!

  • Added new PVP methods for Projectiles:
    • void DamagePVP(ref int damage, Player enemyPlayer)
    • void DealtPVP(double damage, Player enemyPlayer)
  • Fixed bug with UseItem method not getting called for Potions.
  • 1.1.2 changes merged
    • Items can't have foreign names or tooltips right now, it screws up stuff.
  • Updated saving/loading methods. Player files have an associated INI file storing names and IDs of items.
  • Save files need to be updated - to do this, add the following to Config Mod.ini. This is only necessary for tConfig save files. Set this, then go in and load/save whatever tConfig players/worlds you have. Then you can remove this from the INI file if you want to be able to import vanilla worlds or players.
[Save]
update=True
  • Created a built-in mod which handles any items from unloaded mods.
  • Mods need to be re-built for various reasons

v0.18.2Edit

  • Added support for specifying drops for Tiles
  • Fixed bug with "material" tag not working again
  • Overloaded internal methods that take names for items, NPCs, or projectiles to spawn them, and simplify programming a bit.
    • public static int NewNPC(int X, int Y, string name, int Start = 0)
    • public static int NewItem(int X, int Y, int Width, int Height, string name, int Stack = 1, bool noBroadcast = false, int pfix = 0)
    • public static int NewProjectile(float X, float Y, float SpeedX, float SpeedY, string name, int Damage, float KnockBack, int Owner = 255)
  • Added support for Walls. They have only four attributes: id, House, Blend, and DropName
  • Updated Defaults pack

v0.18.1Edit

I just had to add this feature xD.

  • Added ability to create new active/inactive tiles. Set the attribute 'mechToggle' to the name of a tile to switch to when wiring acts on your tile. Generally you'll create two tiles, each which toggles to the other.
  • Updated the Examples mod to include Active/Inactive Cobalt Brick. Craft the brick with 1 Wood (for now).

v0.18.0Edit

Warning: Back up your save files before using custom tiles! The feature has not been extensively tested!

  • Added new method for items
    • bool UseAmmo(Player p) - return true if you want it to use ammo, false otherwise. You could easily make a weapon not use ammo 33% of the time or not use ammo under certain conditions.
  • New Global method for changing spawn rates and various things. Goes into the NPC global code, "NPC.cs", and is called periodically. You can access variables such as NPC.spawnRate and NPC.maxSpawns.
    • void UpdateSpawn()
  • Updated the saving and loading process, and multiplayer data transfers for custom item data
  • Fixed some bugs with modified vanilla items not loading in multiplayer
  • Fixed issue with hardcore/mediumcore chars dropping items
  • Ability to modify & create tiles (partially finished). Implemented stuff:
    • ​Custom crafting stations
    • 'PretendType' attribute
    • 'createTileName' attribute for items
    • 'DropName' attribute for specifying the item to drop when the tile is destroyed
    • 'furniture' attribute - set to 'chair' or 'table', more options may be added later (like 'torch' or 'door')
    • Saving and Loading tile data appropriately (not extensively tested)
    • attributes 'pick', 'axe', 'hammer' - floating point numbers that affect how long it takes to destroy the tile. The item's value is multiplied by these, so setting 'pick=0.2' would make it take 80% longer for a pickaxe to destroy it. By default, pick=1, axe=0, hammer=0. You can also set these to -1 for it to be ignored, useful mainly for modifying existing tiles.
    • attributes 'minPick', 'minAxe', 'minHammer' - Integers which specify the minimum required item value in order to destroy the tile. For instance, a pickaxe's 'pick' value must be greater than or equal to the tile's 'minPick' value. All are zero by default.
    • attributes 'Width' and 'Height' - Both are one by default. If making something like a piece of furniture, you'll need to change these.
  • Modpack builder - updated to wait for input before closing after the 'fatal' error message
  • Updated internal AI() function to take a boolean parameter to specify whether to execute custom code. It is false by default - set it to true to ignore custom code. This allows modders to write an AI() method for their NPC which calls the original AI() function. Warning: If you call AI() or AI(false) you will cause an infinite loop.
  • Updated the Defaults pack

Release 7 (v0.17)Edit

v0.17.2Edit

  • May have very possibly fixed the multiplayer NPC AI bug

v0.17.1Edit

  • Method for adding more items to existing NPC shops (as opposed to making the shop from scratch)
    • ​UpdateShop(Chest chest, int index) - The index is the first empty slot in the chest.
  • Added new method for when an NPC is hit - void HitEffect(int hitDirection, double damage)
    • Used primarily for visual (dust) effects and gore when the NPC is hit or killed.
  • You can now add custom gore images, which go into the "Gore" folder. You can spawn the gore in code through AI(), HitEffect(), or maybe NPCLoot(). I created an overloaded method to make it easy to go by name. The Type is there as a way of telling it to spawn with settings of other gore types - it might be useful.
Gore.NewGore(Vector2 Position, Vector2 Velocity, string name, float Scale = 1f, int Type=-1)
  • If you want to have more control over the gore attributes, you can easily just modify them after calling this method - it returns an integer index into Main.gore[].
  • Added new option for armor pieces: Add "drawHair=1" to the INI file to draw hair on top of the head texture. I may introduce other options if necessary (which is why it's a number).
  • NPCs that fail to load are spawned with zero health. I realize that this feature of keeping unloaded NPCs is actually an annoyance.

v0.17.0Edit

  • Added more toolTip variables to Items, it now goes up to toolTip7. Thought it might be useful to display more information for some mods.
  • Mod transfer now only occurs if the client doesn't have the right mods loaded.
  • New methods:
    • (Melee) Weapons, Armor, & Buffs
      • DamagePVP(Player myPlayer, ref int damage, Player enemyPlayer) - allows you to intercept the damage taken and modify it in some way.
      • DealtPVP(Player myPlayer, int damage, Player enemyPlayer) - Allows you to react to the total damage dealt to the enemy player.
  • Methods for items and buffs will always take a Player as the first parameter. This means DamageNPC is updated to be: DamageNPC(Player p, NPC npc, ref int damage, ref float knockBack)
  • Sounds go in the "Sound" folder and must be PCM 16-bit .wav files.
  • Attributes for specifying sound names. Items have "useSoundName", NPCs have "soundHitName" and "soundKilledName".

Release 6 (v0.16)Edit

v0.16.9Edit

  • Created a new way of handling custom code internally. Mods will need to be rebuilt.
  • Slight change to NPC drops: specifying drops or defining NPCLoot() will not prevent vanilla drops from occurring. I might make an option to change this if there is demand for it.
  • You can now create a Visual Studio project and write code for your items in it. How to get started:
    • Create a Visual Studio project. Right click on References -> Add Reference -> Browse to your Terraria folder, and select tConfig.exe, and all of the XNA DLL files.
    • Create a class named after your item. The naming convention replaces spaces with underscores and removes apostrophes. It also needs the type of object in the name. Example: Item name is "Red Hero's Outfit" -> Class name is "Red_Heros_Outfit_Item"
    • You can inherit from some classes I created (CustomItem, CustomNPC, CustomProjectile), but all they really do is have a constructor that takes an item. This constructor is required for your code to work properly.
    • Example file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Terraria
{
    public class Flame_Beam_Item : CustomItem
    {
        public Flame_Beam_Item(Item item) : base(item) {
            //This constructor is required.
        }
        public void DamageNPC(NPC npc, ref int damage, ref float knockback)
        {
            if (Main.rand.Next(2) == 0)
            { //50% chance to occur
                npc.AddBuff(24, 360, false); //Light 'em on fire! 
                //24 is for onFire buff, 20 is for poisoned buff
            }
        }
        public void UseItemEffect(Player player, Rectangle rectangle)
        {
            Color color = new Color();
            //This is the same general effect done with the Fiery Greatsword
            int dust = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 6, (player.velocity.X * 0.2f) + (player.direction * 3), player.velocity.Y * 0.2f, 100, color, 1.9f);
           Main.dust[dust].noGravity = true;
       }
   }
}
    • Make it output a "code.dll" file to your modpack folder by going to Project -> Properties -> Build and changing the Output Path. For me, it likes to copy tConfig.exe for some reason, but that doesn't matter.
    • The old method is still supported, and it will use .cs files for items instead of code.dll when they are there.
  • Global code is handled differently now. All methods (except for buff methods) can be handled in global code - global code is simply called for every item, NPC, or projectile.
    • In a Visual Studio project, name the class "Global_Item", "Global_NPC" or "Global_Projectile"
    • Every mod's global code is executed. If I turn on a Durability mod, items will have durability. If I also turn on a difficulty mod, the game should be harder and items will still have durability. There may be certain types of mods that combine to form strange behavior, but in general this should work well.
    • Here's a work-in-progress durability mod, which currently reduces a weapon's damage after every hit. It needs some more work, like checks for whether or not the item is a melee weapon.
float durability;
int normalDamage;
public void Initialize() {
   durability=1f; //100% power
   normalDamage=this.item.damage;
   this.item.toolTip2 = "Durability: "+durability;
}
public void DamageNPC(NPC npc, ref int damage, ref float knockback) {
   durability-=.01f; //-1% power
   this.item.damage = (int)(normalDamage*durability);
   this.item.toolTip2 = "Durability: "+durability;
}
public void Save(BinaryWriter writer) {
   writer.Write(durability);
}
public void Load(BinaryReader reader) {
   durability=reader.ReadSingle();
   normalDamage=this.item.damage;
   this.item.toolTip2 = "Durability: "+durability;
}
    • Keep in mind that unloading a mod containing 'global' code will likely screw up item save data. I plan on working on a way to ensure that no data is lost.

v0.16.8Edit

  • Fixed bug with vanilla item prefixes

v0.16.7Edit

  • Added new feature to allow custom items to have prefixes and be reforged. Make the attribute 'prefixType' equal to the ID value of an existing item, and it will be able to have the same prefixes as that item.

v0.16.6Edit

  • Updated modpack builder to check INI filenames in a case-sensitive manner.

v0.16.5Edit

  • New methods:
    • NPC
      • public void DamagePlayer(Player player, ref int damage) - Modify damage done to the player
    • Armor/Accessories, and Buffs
      • public void DamagePlayer(Player player, ref int damage, NPC npc) - Use this to modify damage the player takes
  • Some changes that might fix the multiplayer NPC AI bug. Needs more testing.

v0.16.4Edit

  • Fixed modpack builder bug causing mods without an Item folder to be broken
  • Changed the mod transfer feature so that it doesn't write out the file if the client already has it.
  • Fixed mod transfer problem with player disconnecting and reconnecting to server (I think)

v0.16.3Edit

  • Fixed issue with same custom town NPC spawning multiple times
  • Fixed issue with overlapping flags in the housing interface
  • Updated for the Santa bug-fix

v0.16.1Edit

  • Fixed the mod being saved in the wrong location after being downloaded from the server

v0.16Edit

  • Improved multiplayer mod pack download feature to allow for more than 1MB worth of mod data
  • Mod Builder: Validates input (somewhat)

Release 5 (v0.15)Edit

v0.15.8Edit

  • More bug fixes
  • Modpack builder will now quit building if it encounters a formatting error, such as when you input a string for a parameter that is supposed to be an integer.
  • tConfig will automatically disable any mods that it fails to load.
  • Hopefully Bob the Useless Town NPC doesn't spawn randomly anymore

v0.15.7Edit

  • Fixed modpack builder bug

v0.15.6Edit

  • More descriptive error messages regarding custom code - it now tells you the item class and name
  • Fixed 'useAmmoName' to be checked as an Item, not a Projectile.
  • Updated modpack builder so that it doesn't exit after compiling one mod.

v0.15.5Edit

  • Fixed problem with projectileID and buffID accessors
  • Game will close when an error occurs in custom code.

v0.15.4Edit

  • Added some accessor variables for better compatibility with old C# code. projectileID, buffID, and Main.itemName were updated.
  • WorldGen class is public again
  • Created overloaded SpawnOnPlayer method that takes an NPC name instead of an ID.
SpawnOnPlayer(int plr, string name)

v0.15.3Edit

  • Fixed an error in the modpack builder related to checking the 'createTile' and 'createWall' attributes in items.

v0.15.2Edit

  • New method call, Initialize(), for Items, NPCs, and Projectiles. Called when the item is created, and is also accessible in the global code.
  • Fixed problems with global code and changed some modpack building stuff - you'll need to re-build your mods after this update, sorry!
  • More method calls:
    • NPC Methods
      • DealtNPC(double damage, Player player) - Called after the NPC takes damage (from a Player or a Projectile)
    • Item Methods
      • DealtPlayer(Player player, double damage, NPC npc) - Called after the player takes damage from an NPC
    • Buff Methods
      • DealtPlayer(Player player, double damage, NPC npc) - Called after the player takes damage from an NPC

v0.15.1Edit

  • Automatic transfer of mod files from the server - It works! However, there are some caveats and I'll probably have to change how it works. I've had to increase the buffer sizes in order to transfer the mods, but if you have to many mods on the server, it will fail to transfer - it can't be altogether more than 1MB in size
  • Custom town NPCs now appear in the housing interface in multiplayer, although their name doesn't show up.

v0.15.0Edit

  • Modify & Create NPCs with INI files
  • DealtNPC() method takes a Player as a parameter now. Might not work as expected with projectiles...
    • void DealtNPC(NPC npc, double dmg, Player player)
  • NPCs now have 'animationType' attribute to use animation code of existing NPCs.
  • NPC method calls:
    • void FindFrame(int frame) - handle custom animations here
    • bool SpawnNPC(int x, int y, int playerID) - return true if you want the NPC to spawn.
    • bool TownSpawn() - return true if you want the NPC to spawn as a Town NPC
    • void SetupShop(Chest chest) - Handle shop items for your Town NPC
    • string Chat() - Return the line of text you want the NPC to say
    • void AI() - Handle AI
    • void NPCLoot() - Handle death events and drop items
    • string SetName() - Required method to set the name of your Town NPC to something different than its original name.
  • Fixed Ivy Whip
  • You can specify drops in the INI files. If NPCLoot() is defined, it uses that instead.
  • Fixed: There were about 20 default items that weren't being loaded.
  • Fixed: More issues with NPCs
  • Fixed: Changing volume
  • Item save data is now stored directly in the world and player save files. When an item can't be loaded because a mod is turned off, it will have the image of an angel statue and won't do anything. Turning the mod back on again will result in the item's state being restored, including any save data it had.
  • The name you set for your NPC will be saved to the world.
  • When an NPC can't be loaded, it will be replaced with an NPC who basically looks like the Guide and has a question mark for his head image. This is necessary because otherwise, the world would fail to load with the additional NPC name data being stored... Also, this NPC can be killed, just in case you do want to get rid of him or you're not planning on reloading the mod.
  • Due to changes to save data, save files are officially incompatible with vanilla Terraria.
  • Custom town NPCs should only spawn once.
  • Added in some 'safety' to the Item Load() process, so it doesn't screw up loading the entire world/player if it throws an error. This is inevitable if you add more save data to an item.
  • Default NPC files now included in the Default INI download


Release 4 (v0.14)Edit

v0.14.3Edit

  • Fixed worm NPCs, possibly other things as well
  • New method call for weapons (and projectiles), called after you hit an enemy, it gives you the amount of damage you dealt to the enemy. If you wanted to give the player health based on damage dealt, then something like this should work:
public void DealtNPC(NPC npc, double dmg) {
   Main.player[this.item.owner].life+=(int) (dmg*.15);
}

v0.14.2Edit

  • Fixed NPCs being dead when spawned
  • Made progress towards custom NPC support, but not finished yet!

v0.14.1Edit

  • Fixed problem with buffs
  • Fixed problem with modpacks not building correctly
  • Anyone know what the heck NPC with ID 146 is? It doesn't exist!

v0.14.0Edit

  • Added 'pretendType', 'aiPretendType', and 'killPretendType' attributes for projectiles. They all have corresponding ones for specifying names, i.e 'pretendName', 'aiPretendName', 'killPretendName' for those who don't want to look up ID values. 'pretendType' affects what goes on in the Update() method, 'aiPretendType' affects the AI, and 'killPretendType' affects how the projectile dies (explosions!). You set these to the ID of the projectile you want yours to act like.
  • Updated modpack builder to check for more errors
  • Added buffs support, and the same method calls as before, as well as Save() and Load() methods.
    • Refer to the TConfig Classes page for more info on each of the methods that you can create.
    • Also created an overloaded method for AddBuff to take a name instead of an ID. Now you can do something like this:
public void DamageNPC(NPC npc, ref int damage, ref float knockback) {
	npc.AddBuff("Slow", 360); //Slow them down!
}
  • Fixed bugs with armor not displaying, and the set bonus string not displaying
  • 'hasHands' attribute for armor should be set to True if your armor sprite has hands in it - and then the game won't draw the default player hands over top of yours. This seems to make more sense to me, so that's how it works now. The default value is False.

Release 3 (v0.12)Edit

v0.13Edit

  • Updated for Terraria 1.1.1
  • Updated networking code to pass around data for custom items that have Save() and Load() methods. Also may have fixed some problems with saving item data.
    • Make sure you write your Save() and Load() methods properly if you want Multiplayer to work... and if you want the data to save and load properly.
  • Added 'pretendType' and 'pretendName' attributes to Items - affects behavior such as lighting effects for torches or glowsticks.
    • This feature hasn't been tested yet.

v0.12.4Edit

  • Fixed bug with recipe item stack value not being set correctly

v0.12.3Edit

  • When you try to load a mod pack made with a different version of the mod builder, it will display a message at the main menu notifying you that it is disabled and needs to be re-built.
  • Added Save() and Load() methods for items. In this example, the weapon increases in damage each time you hit an enemy. It saves this data accordingly.
int bonusDamage=0;
public void DamageNPC(NPC npc, ref int damage, ref float knockback) {

	this.item.damage += (int) (npc.life*0.2);
	this.bonusDamage += (int) (npc.life*0.2);
}
public void Save(BinaryWriter writer) {
	writer.Write(this.bonusDamage);
}
public void Load(BinaryReader reader) {
	bonusDamage=reader.ReadInt32();
	this.item.damage += bonusDamage;
}
  • Now loads a sort of 'global' code file for methods that get called for all items. You place this code in Item\Item.cs. This introduces some new possibilities such as making all weapons do more damage, or making item damage be different based on other factors. All the methods are implemented except for Load & Save, and they are the same except they also take an Item as a parameter. Also, all methods should be boolean and return true if you want it to to continue with executing the item's code, false otherwise. This way, you can choose whether to completely override code for an item. Example (for testing purposes xD):
public static bool DamageNPC(Item item, NPC npc, ref int damage, ref float knockback) {
	damage+=100;
	return true; //Return true if you still want the item's code to execute, otherwise return false
}
  • Added AI() and Kill() method calls for Projectiles. Also, the global code is loaded from Projectile\Projectile.cs.
  • Internal change to the way Recipe items are created
  • There is a known issue with custom save/load methods on the Server.
  • Installer will now optionally place shortcuts on the desktop to the modpack builder and the server binary.

v0.12.1Edit

  • Updated the way the code is referenced. tConfigServer and ModPack Builder both require tConfig.exe now. This also fixes a problem with compiled code running on the server.
  • The server and the builder are both included in the installer and are placed in the Terraria directory automatically. I wonder if I should make it create desktop shortcuts to them?
  • Fixed issue with items not getting marked as material and being able to give them to the guide
  • All Items now have a "subclass" object which is an instance of your code. This means you can now program in a truly object-oriented manner. When your class is instantiated, it is passed the Item object it is associated with. Now, you could, for instance, change your item's damage by having code like the following:
public void DamageNPC(NPC npc, ref int damage, ref float knockback) {
 this.item.damage += 10;
}

v0.12.0Edit

  • Removed "StatusNPC" method call, created "DamageNPC" method which can take damage & knockback as references and modify them.
    • public void DamageNPC(NPC npc, ref int damage, ref float knockback)
    • Example: You could make a sword that does more damage against zombies
public void DamageNPC(NPC npc, ref int damage, ref float knockback) {
 if(npc.name=="Zombie") damage += 10;
}
  • Added support for Projectiles - this includes the attributes 'projectile', 'useAmmoName' and 'ammoName'
  • Projectiles also have a DamageNPC() method, it works the same way as it does for items.
  • Projectile code has access to the projectile object, and it is called 'projectile'
  • The game will check the version that was used to make a mod pack - if it isn't the same as the version of tConfig, then it will not load it.
  • Code is now compiled into assembly when placed into the object file
  • There may be some bugs related to custom code when playing multiplayer.
  • The game has a few projectiles with the same name, so you won't be able to access all of those - I'll need to figure out how to resolve this at some point.
  • Default projectiles added to Downloads page.
  • All the folder names will be consistent in the sense that they are not in plural form. In other words, the folder names should be: Item, Projectile, NPC, Tile, Wall, Buff, etc.


Release 2 (v0.11)Edit

v0.11.1Edit

  • Fixed issues with equipping/unequipping custom armor & accessories

v0.11.0Edit

  • ModPack Builder
    • Now checks for existence of items that are specified for Recipes. For example, if you put "Stone" as a requirement (a common mistake), it will complain!
    • Version number is placed in the object file to enable backwards compatibility checks
    • It compiles the .cs files to ensure there are no errors, but unfortunately I couldn't figure out how to save the resulting compiled data. So, the code is saved in the mod file and tConfig will re-compile it every time it loads. I'll change this if I figure out how to.
    • Backwards compatibility for INI files has been implemented
    • All Recipe parameters are now optional (except for Items)
    • You will need to re-build your mods this time around.
  • Installer
    • Updated error message to say that you should have Game Launcher installed
  • Game
    • Fixed bug where "deposit all" on a chest would duplicate items - may have fixed other undiscovered bugs
      • This also fixes the Trash duplication bug
    • Ability to create armor
      • New feature: Create "armorname Female Body.png" to add a female texture.
      • New Attribute: "hasHands" - a boolean value that determines whether it draws the player's hands. Default is True.
    • Method calls for Items (UseItem, StatusNPC, UseItemEffect)
    • Set Bonuses for armor & method calls (SetBonus, PlayerFrame, Effects)
    • See the Items section of this page for more details on the method calls: http://tconfig.wikia.com/wiki/Custom_Methods#Item

Release 1 (v0.10.0)Edit

The initial release is intended to be really simple. We need to test out this new mod-pack packaging idea, and try to make sure that everything is bug-free before I move on to the next release.

Finished:

  • Save files are stored in a separate folder
  • Default Items are loaded from an object file
  • Began work on a tool to package mod packs into a zip file
  • Ability to load mod packs made with the tool
  • Ability to modify & create Items
  • Multiplayer and automated installer (as before)
  • Menu for enabling mod packs (as before)

Part of the idea is to better ensure multiplayer stability, so test the heck out of it!

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.