Standalone [1.3] tModLoader - A Modding API

Can someone help me out with a crafting station I'm making? it looks like this:
BakeryBench.png
and when I put it into the game its all glitched out.
Here's its code
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace EdgeWood.Tiles
{
    public class BakeryBench : ModTile
    {
        public override void SetDefaults()
        {
            Main.tileSolidTop[Type] = true;
            Main.tileFrameImportant[Type] = true;
            Main.tileNoAttach[Type] = true;
            Main.tileTable[Type] = true;
            Main.tileLavaDeath[Type] = true;
            TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3);
            TileObjectData.newTile.CoordinateHeights = new int[]{ 54 };
            TileObjectData.addTile(Type);
            AddMapEntry(new Color(200, 200, 200), "Bakery Bench");
            disableSmartCursor = true;
            adjTiles = new int[]{ TileID.WorkBenches };
        }

        public override void NumDust(int i, int j, bool fail, ref int num)
        {
            num = fail ? 1 : 3;
        }

        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("BakeryBench"));
        }
    }
}

Some things are off cause I was screwing around with stuff and trying to figure out whats wrong. I'm really confused someone help me out please
 
Can someone help me out with a crafting station I'm making? it looks like this: View attachment 130747 and when I put it into the game its all glitched out.
Here's its code
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace EdgeWood.Tiles
{
    public class BakeryBench : ModTile
    {
        public override void SetDefaults()
        {
            Main.tileSolidTop[Type] = true;
            Main.tileFrameImportant[Type] = true;
            Main.tileNoAttach[Type] = true;
            Main.tileTable[Type] = true;
            Main.tileLavaDeath[Type] = true;
            TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3);
            TileObjectData.newTile.CoordinateHeights = new int[]{ 54 };
            TileObjectData.addTile(Type);
            AddMapEntry(new Color(200, 200, 200), "Bakery Bench");
            disableSmartCursor = true;
            adjTiles = new int[]{ TileID.WorkBenches };
        }

        public override void NumDust(int i, int j, bool fail, ref int num)
        {
            num = fail ? 1 : 3;
        }

        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("BakeryBench"));
        }
    }
}

Some things are off cause I was screwing around with stuff and trying to figure out whats wrong. I'm really confused someone help me out please
TileObjectData.newTile.CoordinateHeights = new int[]{ 54 }; is wrong.
Read the guide in my signature.
 
I'm not sure, but shouldn't it be Style3x3 instead of Style6x3?:
Code:
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);

And CoordinateHeights should be an array the length of the height of the tile and since you are using standard 16 by 16 pixel areas in your image, the array should use 16, not 54:
Code:
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
 
How would you make a boss summoner spawn the boss above you? The method in the ExampleMod just makes the boss spawn in a place randomly around you.
Take the player's position, for example player.position or player.center. Let's say you take player.position. Then add the height of the player to y. Then add the height of your boss to y. The boss is now exactly above the player. (visualise in your mind). You can add any more to y to create more spacing. Remember, adding 16 is one tile.
[doublepost=1469870615,1469870509][/doublepost]
You should have made a backup. If not, rename Terraria.exe to Terraria.bak or delete it, then let Steam resync files. (Google if you don't know how)
 
Take the player's position, for example player.position or player.center. Let's say you take player.position. Then add the height of the player to y. Then add the height of your boss to y. The boss is now exactly above the player. (visualise in your mind). You can add any more to y to create more spacing. Remember, adding 16 is one tile.
That doesn't work, because the method in Example Mod uses (int, int) and referencing the player position is not an int, so, am I missing an argument here?
 
Why would you need to control the x plane if you want to spawn it above the player?
Because then he'll spawn above the place where he would normally spawn, which is not above the player,
[doublepost=1469881406,1469881216][/doublepost]
Why would you need to control the x plane if you want to spawn it above the player?
Also, when using this:
NPC.SpawnOnPlayer((int)P.position.Y + 100, mod.NPCType("BossDude"));
He doesn't appear anywhere at all.
 
How do you un install tmodloader? I want to play vanilla again so I can play on pedguin's server!!! Btw, I am asking for how to do it for Mac OS X on steam. I have my players/worlds folders on my desk top ready to use them as my vanilla players/worlds but idk how to un install tmodloader. Please help me tmodloader develpors!!!
 
I would use if I could but:
Terraria.NPC.NewNPC(int, int, int, int, float, float, float, float, int)
What goes where?
Well why don't you look at the paremeters? I believe, pos x, pos y, type, damage, knockback
From there on I dunno.. but just check the parameters.. lol
 
So, i booted up tmodloader, after closing it when it threw an exception for loading mods
and this happened:
20160730100144_1.jpg

Help
EDIT:Apparently reloading my mods fixed it.
 
Is there any way to make the tmodloader server autosave more often? Keep getting stack overflow crashes and losing some work in game. Works great if I manually save every few minutes but sometimes I forget and it will crash right before the sun comes up(when it normally autosaves) and I'll lose 20 minutes of progress.
 
So, i booted up tmodloader, after closing it when it threw an exception for loading mods
and this happened:
View attachment 130913
Help
EDIT:Apparently reloading my mods fixed it.

I can no longer access my hotbar. I'm going to redownload tModLoader and see if that fixes it.

Not even reloading mods/closing and launching Terraria again fixed it.

EDIT: Fixed it.
 
Last edited:
Back
Top Bottom