Standalone [1.3] tModLoader - A Modding API

I actually did contact a dev (yoraiz0r) recently concerning the whole issue. He said he is aware of it but it's not an easy task to make new mannequins and safely convert all the old ones into new ones. He said he would do it once he has the time and the power.

But let's be honest: Terraria is basically a finished game. Sure, every once in a while we still get small updates, but obviously they aren't frantically working on the game anymore and mostly focus on other projects. Which is totally fine and understandable, but that combined with the fact that the Mannequin/Weaponrack issue is probably not exactly super high up their priority list makes it unlikely that we will see a change until very long down the road, if ever.

I honestly had made my peace with it once i found the workaround, which made things acceptable for me, so you will understand that i was pretty bummed out to see that just a week later, it suddenly gets changed with a new tmodloader version. I just wish there was a way to make seperate modded mannequins that just work with modded armor or something of that sort, but since this idea has been denied multiple times, i don't see any hope for this issue to be resolved in the foreseeable future.
Yorai is in dev chat with us, we know for months it's on the to-do list. Also:
"Sure, every once in a while we still get small updates, but obviously they aren't frantically working on the game anymore and mostly focus on other projects"
This is very untrue. They work on Terraria almost every day, and 1.3.5 is being worked on as we speak. Terraria is far from 'a finished game', depending on what your definition of 'finished' is. The load order bugfix was needed because it fixes lots of other issues, which outweigh the importance of your mannequin/weapon rack 'fix'.
 
There is this glitch where it is allowing me to install and properly put the programs into the Terraria files as shown in many different videos and guides online and i've tried but it wont work correctly. I dont know if its because i'm on a Macbook air or if its something else but i would like to at least know how to do it correctly since i'm clearly not doing it right. Thank you
 
There is this glitch where it is allowing me to install and properly put the programs into the Terraria files as shown in many different videos and guides online and i've tried but it wont work correctly. I dont know if its because i'm on a Macbook air or if its something else but i would like to at least know how to do it correctly since i'm clearly not doing it right. Thank you
Download the MAC .zip release, unzip it, do a manual install: copy the unzipped files and folders to your Terraria directory. Can you explain what 'doesn't work correctly' ? Is it launching normal terraria? Make sure you rename tModLoader.exe to Terraria.exe and overwrite when asked (if it's called tModLoader.exe)
 
External component has thrown an exception.
at Microsoft.Xna.Framework.Media.WmpProxyThread.RunInRightApartment(WmpProxyFunction proxyFunction)
at Microsoft.Xna.Framework.Media.UnsafeNativeMethods.DecodeStreamToTexture(Void* pDevice, UInt32 stream, Int32* targetWidth, Int32* targetHeight, XnaImageOperation operation, Int32 maxAspectRatio, Void** pTexture)
at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Stream stream, Int32 width, Int32 height, XnaImageOperation operation)
at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice graphicsDevice, Stream stream)
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I keep getting this on random mods, sometimes one, sometimes five. It's very annoying because I have to keep reloading over and over.
 
External component has thrown an exception.
at Microsoft.Xna.Framework.Media.WmpProxyThread.RunInRightApartment(WmpProxyFunction proxyFunction)
at Microsoft.Xna.Framework.Media.UnsafeNativeMethods.DecodeStreamToTexture(Void* pDevice, UInt32 stream, Int32* targetWidth, Int32* targetHeight, XnaImageOperation operation, Int32 maxAspectRatio, Void** pTexture)
at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Stream stream, Int32 width, Int32 height, XnaImageOperation operation)
at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice graphicsDevice, Stream stream)
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I keep getting this on random mods, sometimes one, sometimes five. It's very annoying because I have to keep reloading over and over.
This is an exception I've never seen... o_O It seems to be XNA related. I'm calling @jopojelly / @Yoraiz0r (never seen it, possibly something vanilla?)
 
does anyone know how to make this NPC spawn in the HM snow and Only the HM snow?
Code:
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Trelamium.Projectiles;

namespace Trelamium.NPCs.IceEye
{
    public class FrozenThing : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "Frozen Thing";
            npc.displayName = "Frozen Thing";
            npc.npcSlots = 0.1f;
            npc.aiStyle = -1;
            aiType = -1;
            npc.damage = 0;
            npc.width = 56;
            npc.height = 48;
            npc.defense = 0;
            npc.lifeMax = 1800;
            npc.knockBackResist = 0f;
            Main.npcFrameCount[npc.type] = 4;
            npc.value = Item.buyPrice(0, 0, 0, 0);
            npc.noGravity = true;
            npc.chaseable = false;
            npc.HitSound = SoundID.NPCHit1;
            npc.rarity = 2;
        }
       
        public override void FindFrame(int frameHeight)
        {
            npc.frameCounter += 0.15f;
            npc.frameCounter %= Main.npcFrameCount[npc.type];
            int frame = (int)npc.frameCounter;
            npc.frame.Y = frame * frameHeight;
        }

        public override float CanSpawn(NPCSpawnInfo spawnInfo)
        {
            return spawnInfo.player.ZoneSnow &&
                !spawnInfo.player.ZoneTowerStardust &&
                !spawnInfo.player.ZoneTowerSolar &&
                !spawnInfo.player.ZoneTowerVortex &&
                !spawnInfo.player.ZoneTowerNebula &&
                !NPC.AnyNPCs(mod.NPCType("FrozenThing")) &&
                !NPC.AnyNPCs(mod.NPCType("Glacier")) &&
                !NPC.AnyNPCs(mod.NPCType("GlacierRun1")) &&
                !Main.snowMoon && !Main.pumpkinMoon && NPC.downedMechBossAny ? 0f : 0.140f;
        }
       
        public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
        {
            npc.lifeMax = 1800;
            npc.damage = 0;
        }
       
        public override void HitEffect(int hitDirection, double damage)
        {
            for (int k = 0; k < 5; k++)
            {
                Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f);
            }
            if (npc.life <= 0)
            {
                for (int k = 0; k < 20; k++)
                {
                    Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f);
                }
                Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f);
                NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("Glacier"));
            }
        }
    }
}
 
Guys, is there a way to make a weapon do something different for a specific mob (extra damage, knockback/ knockback override)?

I'm looking into making a mod where a one weapon is good against the Dungeon Guardian, but isn't overpowered against normal mobs.
 
Guys, is there a way to make a weapon do something different for a specific mob (extra damage, knockback/ knockback override)?

I'm looking into making a mod where a one weapon is good against the Dungeon Guardian, but isn't overpowered against normal mobs.
Assuming that you are using a prijectile, use the ModifyHitNPC hook for your Projectile or Item to change how much damage is done to a specific NPC.
 
Got a question regarding ModTileEntity.

Background:
My understanding of how tile entities are meant to work in client/server is the client (netmode == 1) sends a TileEntityPlacement packet which prompts the server to make a tile entity. The server (netmode == 2) is meant to send back a TileEntitySharing with the details of the created tile entity.

I can see by putting a debugger on the server (with decompiled tmodloader) that the server is trying to send this TileEntitySharing packet, and it even ends up in TcpSocket.AsyncSend (which I'm presuming is what actually sends the packet on the wire). For modded tile entities, this packet never seems to show up in MessageBuffer (I stuck a breakpoint on the code that's meant to process the packet). This means that the client never gets the tile entity and can't do anything with it. Placing, for example, an Item Frame does result in a packet on the client side.

Question:
Is this the intended behaviour? Am I meant to be doing something else to sync a tile entity with the client? If so, what?
 
im getting errors while compiling a mod i tried example mod and other mods i have made but im still getting the error

specs:

2.13 ghz

1.72 usable space

error is:
error CS1703: same'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
 
Last edited:
Are the multiplayer servers not working or something? Yesterday it was fine b ut now all my friends are just stuck on "Connecting to (IP)"
Not sure what you mean, when you connect to someone, you connect to them, not some intermediary server. If it worked yesterday, but doesn't today, it might be a broken mod of just networking problems on your end. Open the server directly to view errors if they are happening.
 
Not sure what you mean, when you connect to someone, you connect to them, not some intermediary server. If it worked yesterday, but doesn't today, it might be a broken mod of just networking problems on your end. Open the server directly to view errors if they are happening.
What do you mean directly? I just open it through the TmodlaoderServer.exe

Coudl reseting my router work?
 
Also: This is very untrue. They work on Terraria almost every day, and 1.3.5 is being worked on as we speak. Terraria is far from 'a finished game', depending on what your definition of 'finished' is. The load order bugfix was needed because it fixes lots of other issues, which outweigh the importance of your mannequin/weapon rack 'fix'.

I am well aware that 1.3.5 is on the horizon. And we already know what it contains: A couple of furniture items. I'm not saying that isn't cool or anything, but that hardly disproves my statement. I never claimed that Terraria is completely abandoned, but it's obvious that the main focus now lies on other projects, while Terraria is getting some fairly minor stuff every now and then.
 
What do you mean directly? I just open it through the TmodlaoderServer.exe

Coudl reseting my router work?
to play online with terrariamodloader you need to host & play then connect via steam

Too i want to say,it seem that i have a lot of FPS drop when playing online then while playing offline,i don't know why anyone have an idea why? i wonder if it's because of the Steam servers trying to send too much information or anything,i need to try if it lags too on a local server
 
Back
Top Bottom