Eldrazi
Eater of Worlds
Allright, so one thing you can do is create your whole own 'placement style'.Yeah so the item will be 4x4 in style.
This is the code so far,
Code:using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; using Microsoft.Xna.Framework; namespace DarkArmorReforged.Tiles { public class LongTable : ModTile { public override void SetDefaults() { Main.tileSolidTop[Type] = false; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); (I put this as 3x3 as it was the max without getting an error) TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16}; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.addTile(Type); AddMapEntry(new Color(255, 255, 255), "LongTable"); adjTiles = new int[] { TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("LongTable")); } } }
Lemme give you an example (with comments, of course):
This code:
Code:
TileObjectData.newTile.Width = 4; // Set the width of the tile, 4 in this case.
TileObjectData.newTile.Height = 4; // Set the height of the tile, 4 in this case.
// Set the origin of this tile. This is used when displaying the tile preview.
// Since all Terraria objects are placed from their botom left perspective, we set the Y parameter of the Point to 3.
TileObjectData.newTile.Origin = new Point16(0, 3);
// The following will only allow this tile to be placed on a solid surface all along the way of this tile.
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.UsesCustomCanPlace = true; // We do use a custom can place.
TileObjectData.newTile.LavaDeath = true; // Optional, guess that speaks for itself.
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; // Since our tile is 4 pieces high, we need to define 4 values here.
TileObjectData.newTile.CoordinateWidth = 16; // The width of each of the tile pieces (default is 16).
TileObjectData.newTile.CoordinatePadding = 2; // The padding of each tile piece on the tilesheet.
TileObjectData.addTile(Type);
Basically replaces this code you already have (in the SetDefaults function):
Code:
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); (I put this as 3x3 as it was the max without getting an error)
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16};
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.addTile(Type);