Standalone [1.3] tModLoader - A Modding API

Im going to attempt to create a projectile which can be summonable and used with my custom weapons, then ill move onto looking into that and trying to add it to the boss as a minion.
So you want to create a summonable minion, right?
Still, fleshing out what exactly the projectile is going to do is step one. After that, you'll really need some programming knowledge to piece a good AI together.
 
Yes sorry, like those.
The following code is how you animate an item:
Code:
public override DrawAnimation GetAnimation()
{
    return new DrawAnimationVertical(5, 8);
}
The first parameter (5) determines the speed at which the item animates (higher value = slower animation) and the second parameter (8) is the total amount of animation frames in your spritesheet.
 
What would i need to do if i wanted to add an item to 2 crafting stations / 2 tiles.
This is for one, recipe.AddTile(null, "Furnace");
How would i go about this ?
 
What would i need to do if i wanted to add an item to 2 crafting stations / 2 tiles.
This is for one, recipe.AddTile(null, "Furnace");
How would i go about this ?
Just call that function twice, but with the different tiles:
Code:
recipe.AddTile(null, "MyFurnace");
recipe.AddTile(null, "MyOtherThingYouNeedForThisRecipe");
 
The problem im having is with the custom 4x4. I need a 4w x 3h and because of the type of tile it is because it is modified to be 4 x 3 it wont be placed and it wont craft items if its 4x4.
 
The problem im having is with the custom 4x4. I need a 4w x 3h and because of the type of tile it is because it is modified to be 4 x 3 it wont be placed and it wont craft items if its 4x4.
Hang on, whut? The tile won't place? You want it to be 4x3? Then you'll just need to change/remove some values there.
Could you show me your modified code to fit the 4x3?
 
I probably have missed something,

Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
using Microsoft.Xna.Framework;
using Terraria.Enums;
using Terraria.DataStructures;

namespace DarkArmorReforged.Tiles
{
    public class FurnaceMod : ModTile
    {
        public override void SetDefaults()
        {
            Main.tileSolidTop[Type] = false;
            Main.tileFrameImportant[Type] = true;
            Main.tileNoAttach[Type] = true;
            Main.tileLavaDeath[Type] = true;
            TileObjectData.newTile.Width = 4; // Set the width of the tile, 4 in this case.
            TileObjectData.newTile.Height = 3; // 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 }; // 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);
            AddMapEntry(new Color(255, 255, 255), "FurnaceMod");
            adjTiles = new int[] { TileID.Anvils };
            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("FurnaceMod"));
        }
    }
}
 
I probably have missed something,

Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
using Microsoft.Xna.Framework;
using Terraria.Enums;
using Terraria.DataStructures;

namespace DarkArmorReforged.Tiles
{
    public class FurnaceMod : ModTile
    {
        public override void SetDefaults()
        {
            Main.tileSolidTop[Type] = false;
            Main.tileFrameImportant[Type] = true;
            Main.tileNoAttach[Type] = true;
            Main.tileLavaDeath[Type] = true;
            TileObjectData.newTile.Width = 4; // Set the width of the tile, 4 in this case.
            TileObjectData.newTile.Height = 3; // 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 }; // 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);
            AddMapEntry(new Color(255, 255, 255), "FurnaceMod");
            adjTiles = new int[] { TileID.Anvils };
            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("FurnaceMod"));
        }
    }
}
Hmm, only things I see is the origin. That should be
Code:
TileObjectData.newTile.Origin = new Point16(0, 2); // Since the height has been changed.
And you may want to change your KillMultiTile function:
Code:
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
    Item.NewItem(i * 16, j * 16, 64, 48, mod.ItemType("FurnaceMod"));
}
 
So basically i can place both furnaces now. Although when they are both down near each other i can craft the bars i want. But when there away from each other or theres only one of them. I cant craft. I want to be able to craft at the two different stations in different areas and craft some of the same items.
 
So basically i can place both furnaces now. Although when they are both down near each other i can craft the bars i want. But when there away from each other or theres only one of them. I cant craft. I want to be able to craft at the two different stations in different areas and craft some of the same items.
So basically i can place both furnaces now. Although when they are both down near each other i can craft the bars i want. But when there away from each other or theres only one of them. I cant craft. I want to be able to craft at the two different stations in different areas and craft some of the same items.
You probably want to separate the two required tiles into two different recipes because you probably have the recipe require both tiles.
 
So, hello modders, i am in no place to ask this, but i've tried some modded gameplay, and the current server support seems.... non-existent to say the least.

Is it supposed to only be hostable, but not joinable? (It literally just crashes as soon as someone joins via Steam. Even without mods)

Other than that, hey, this is working great so far! The only problems i ever found were generation bugs, which, even though rare, still happen in Vanilla game. Sorry to put a random "ETA on server" like comment, but i assumed that "some" server support meant someone could join.

Cheers @bluemagic123, and modders, your work makes this game not only last much longer on our hearts, but also makes our free time greatly more enjoyable!
 
The :red:

Index was outside the bounds of the array.
at Terraria.World.Generation.StructureMap.CanPlace(Rectangle area, Boolean[] validTiles, Int32 padding)
at Terraria.GameContent.Biomes.CorruptionPitBiome.Place(Point origin, StructureMap structures)
at Terraria.WorldGen.<>c__DisplayClass93.<generateWorld>b__5e(GenerationProgress progress)
at Terraria.GameContent.Generation.PassLegacy.Apply(GenerationProgress progress)
at Terraria.World.Generation.WorldGenerator.GenerateWorld(GenerationProgress progress)
at Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject)
at Terraria.WorldGen.do_worldGenCallBack(Object threadContext)
at Terraria.WorldGen.worldGenCallBack(Object threadContext)

Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Collections.Generic;
using Terraria.World.Generation;
using Terraria.GameContent.Generation;

namespace Enderuim.Tiles   
    {
        public class EnderuimOreGen : ModWorld
        {
            public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
        {
            int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Buried Chests"));

            tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", delegate (GenerationProgress progress){;
            {
                progress.Message = "Growing Enderuim Crystals...";

                for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++)
                {
                    WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), (double)WorldGen.genRand.Next(20, 20), WorldGen.genRand.Next(20, 20), mod.TileType("EnderuimOre"), false, 0f, 0f, false, true);
                }
            };
        }));
    }
}}
 
Back
Top Bottom