Standalone [1.3] tModLoader - A Modding API

Browse Mods on the main menu locks up my computer now. Was fine yesterday, no idea what changed. Reinstalled both the game and tmod but no go.
 
When I click on the mod browser, the game freezes. It worked yesterday, but not today. It doesn't even give me an error message.
 
Also atleast some modded consumables that give loot(like the Mini Meterites from imkSushi's mod and the Jewel Casket and Black Jewel Casket from Legend of Terraria 3) don't get consumed when used. I know for sure that the Mini Meteorite got consumed before 1.3.3.

The music boxes don't work properly. They eighter turn into another music box item that goes back into my inventory or it turn into a banner(that also goes into my inventory).
 
Last edited:
I'm not sue if this is the right place to ask (I'm using the TmodLoader opensource dev tool to modofy the game,so...), but is there a simple solution to this or do I have to rewrite the entire static void Smashaltar if I want to:

Make the oretierx's both values if possible, so smashing an altar generates both types of hardmode ore.

This is the original code:
Code:
public static void SmashAltar(int i, int j)
        {
            if (Main.netMode == 1)
            {
                return;
            }
            if (!Main.hardMode)
            {
                return;
            }
            if (WorldGen.noTileActions)
            {
                return;
            }
            if (WorldGen.gen)
            {
                return;
            }
            int num = WorldGen.altarCount % 3;
            int num2 = WorldGen.altarCount / 3 + 1;
            float num3 = (float)(Main.maxTilesX / 4200);
            int num4 = 1 - num;
            num3 = num3 * 310f - (float)(85 * num);
            num3 *= 0.85f;
            num3 /= (float)num2;
            if (num == 0)
            {
                if (WorldGen.oreTier1 == -1)
                {
                    WorldGen.oreTier1 = 107;
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.oreTier1 = 221;
                    }
                }
                int num5 = 12;
                if (WorldGen.oreTier1 == 221)
                {
                    num5 += 9;
                    num3 *= 0.9f;
                }
                if (Main.netMode == 0)
                {
                    Main.NewText(Lang.misc[num5], 50, 255, 130, false);
                }
                else if (Main.netMode == 2)
                {
                    NetMessage.SendData(25, -1, -1, Lang.misc[num5], 255, 50f, 255f, 130f, 0, 0, 0);
                }
                num = WorldGen.oreTier1;
                num3 *= 1.05f;
            }
            else if (num == 1)
            {
                if (WorldGen.oreTier2 == -1)
                {
                    WorldGen.oreTier2 = 108;
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.oreTier2 = 222;
                    }
                }
                int num6 = 13;
                if (WorldGen.oreTier2 == 222)
                {
                    num6 += 9;
                    num3 *= 0.9f;
                }
                if (Main.netMode == 0)
                {
                    Main.NewText(Lang.misc[num6], 50, 255, 130, false);
                }
                else if (Main.netMode == 2)
                {
                    NetMessage.SendData(25, -1, -1, Lang.misc[num6], 255, 50f, 255f, 130f, 0, 0, 0);
                }
                num = WorldGen.oreTier2;
            }
            else
            {
                if (WorldGen.oreTier3 == -1)
                {
                    WorldGen.oreTier3 = 111;
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.oreTier3 = 223;
                    }
                }
                int num7 = 14;
                if (WorldGen.oreTier3 == 223)
                {
                    num7 += 9;
                    num3 *= 0.9f;
                }
                if (Main.netMode == 0)
                {
                    Main.NewText(Lang.misc[num7], 50, 255, 130, false);
                }
                else if (Main.netMode == 2)
                {
                    NetMessage.SendData(25, -1, -1, Lang.misc[num7], 255, 50f, 255f, 130f, 0, 0, 0);
                }
                num = WorldGen.oreTier3;
            }
            int num8 = 0;
            while ((float)num8 < num3)
            {
                int i2 = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
                double num9 = Main.worldSurface;
                if (num == 108 || num == 222)
                {
                    num9 = Main.rockLayer;
                }
                if (num == 111 || num == 223)
                {
                    num9 = (Main.rockLayer + Main.rockLayer + (double)Main.maxTilesY) / 3.0;
                }
                int j2 = WorldGen.genRand.Next((int)num9, Main.maxTilesY - 150);
                WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(5, 9 + num4), WorldGen.genRand.Next(5, 9 + num4), (ushort)num);
                num8++;
            }
            int num10 = WorldGen.genRand.Next(3);
            int num11 = 0;
            while (num10 != 2 && num11++ < 1000)
            {
                int num12 = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
                int num13 = WorldGen.genRand.Next((int)Main.rockLayer + 50, Main.maxTilesY - 300);
                if (Main.tile[num12, num13].active() && Main.tile[num12, num13].type == 1)
                {
                    if (num10 == 0)
                    {
                        if (WorldGen.crimson)
                        {
                            Main.tile[num12, num13].type = 203;
                        }
                        else
                        {
                            Main.tile[num12, num13].type = 25;
                        }
                    }
                    else
                    {
                        Main.tile[num12, num13].type = 117;
                    }
                    if (Main.netMode == 2)
                    {
                        NetMessage.SendTileSquare(-1, num12, num13, 1);
                        break;
                    }
                    break;
                }
            }
            if (Main.netMode != 1)
            {
                int num14 = Main.rand.Next(2) + 1;
                for (int k = 0; k < num14; k++)
                {
                    NPC.SpawnOnPlayer((int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16), 82);
                }
            }
            WorldGen.altarCount++;
            AchievementsHelper.NotifyProgressionEvent(6);
        }

And this is what I attempted to do (with next to no programming experience):

Code:
public static void SmashAltar(int i, int j)
        {
            if (Main.netMode == 1)
            {
                return;
            }
            if (!Main.hardMode)
            {
                return;
            }
            if (WorldGen.noTileActions)
            {
                return;
            }
            if (WorldGen.gen)
            {
                return;
            }
            int num = WorldGen.altarCount % 3;
            int num2 = WorldGen.altarCount / 3 + 1;
            float num3 = (float)(Main.maxTilesX / 4200);
            int num4 = 1 - num;
            num3 = num3 * 310f - (float)(85 * num);
            num3 *= 0.85f;
            num3 /= (float)num2;
            if (num == 0)
            {
                if (WorldGen.oreTier1 == -1)
                {
                    WorldGen.oreTier1 = 107 && 221;
                }
                int num5 = 12;
                if (WorldGen.oreTier1 == 221 && 107)
                {
                    num5 += 9;
                    num3 *= 0.9f;
                }
                if (Main.netMode == 0)
                {
                    Main.NewText(Lang.misc[num5], 50, 255, 130, false);
                }
                else if (Main.netMode == 2)
                {
                    NetMessage.SendData(25, -1, -1, Lang.misc[num5], 255, 50f, 255f, 130f, 0, 0, 0);
                }
                num = WorldGen.oreTier1;
                num3 *= 1.05f;
            }
            else if (num == 1)
            {
                if (WorldGen.oreTier2 == -1)
                {
                    WorldGen.oreTier2 = 108 && 222;
                }
                int num6 = 13;
                if (WorldGen.oreTier2 == 222 && 108)
                {
                    num6 += 9;
                    num3 *= 0.9f;
                }
                if (Main.netMode == 0)
                {
                    Main.NewText(Lang.misc[num6], 50, 255, 130, false);
                }
                else if (Main.netMode == 2)
                {
                    NetMessage.SendData(25, -1, -1, Lang.misc[num6], 255, 50f, 255f, 130f, 0, 0, 0);
                }
                num = WorldGen.oreTier2;
            }
            else
            {
                if (WorldGen.oreTier3 == -1)
                {
                    WorldGen.oreTier3 = 111 && 223;
                }
                int num7 = 14;
                if (WorldGen.oreTier3 == 223 && 111)
                {
                    num7 += 9;
                    num3 *= 0.9f;
                }
                if (Main.netMode == 0)
                {
                    Main.NewText(Lang.misc[num7], 50, 255, 130, false);
                }
                else if (Main.netMode == 2)
                {
                    NetMessage.SendData(25, -1, -1, Lang.misc[num7], 255, 50f, 255f, 130f, 0, 0, 0);
                }
                num = WorldGen.oreTier3;
            }
            int num8 = 0;
            while ((float)num8 < num3)
            {
                int i2 = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
                double num9 = Main.worldSurface;
                if (num == 108 && 222)
                {
                    num9 = Main.rockLayer;
                }
                if (num == 111 && 223)
                {
                    num9 = (Main.rockLayer + Main.rockLayer + (double)Main.maxTilesY) / 3.0;
                }
                int j2 = WorldGen.genRand.Next((int)num9, Main.maxTilesY - 150);
                WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(5, 9 + num4), WorldGen.genRand.Next(5, 9 + num4), (ushort)num);
                num8++;
            }
            int num10 = WorldGen.genRand.Next(3);
            int num11 = 0;
            while (num10 != 2 && num11++ < 1000)
            {
                int num12 = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
                int num13 = WorldGen.genRand.Next((int)Main.rockLayer + 50, Main.maxTilesY - 300);
                if (Main.tile[num12, num13].active() && Main.tile[num12, num13].type == 1)
                {
                    if (num10 == 0)
                    {
                        if (WorldGen.crimson)
                        {
                            Main.tile[num12, num13].type = 203;
                        }
                        else
                        {
                            Main.tile[num12, num13].type = 25;
                        }
                    }
                    else
                    {
                        Main.tile[num12, num13].type = 117;
                    }
                    if (Main.netMode == 2)
                    {
                        NetMessage.SendTileSquare(-1, num12, num13, 1);
                        break;
                    }
                    break;
                }
            }
            if (Main.netMode != 1)
            {
                int num14 = Main.rand.Next(2) + 1;
                for (int k = 0; k < num14; k++)
                {
                    NPC.SpawnOnPlayer((int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16), 82);
                }
            }
            WorldGen.altarCount++;
            AchievementsHelper.NotifyProgressionEvent(6);
        }

Apparently, a bool or int can't be two values, and I'm trying to work around that. I'm thinking that (I may sound like an utter moron to experienced programmers here, as I'm guessing) if I change it from int/bool to something that CAN have more than one value it may work, but that may not exist altogether...

Again, not asking you guys to rewrite the entire thing for me. If the solution is simple I'd appreciate it (and learn from it), but if it's more complex just tell me and I'll study it myself or ask on an actual programming forum.
 
This came up in a blue box right as Settling Liquids hit 100% in game
Method not found: 'System.String Terraria.Lang.deathMsg(Int32, Int32, Int32, Int32)'.
at LiquidsPlus.MPlayer.PreUpdate()
at Terraria.ModLoader.PlayerHooks.PreUpdate(Player player)
at Terraria.Player.Update(Int32 i)
at Terraria.WorldGen.do_playWorldCallBack(Object threadContext)
at Terraria.WorldGen.playWorldCallBack(Object threadContext)
 
This came up in a blue box right as Settling Liquids hit 100% in game
Method not found: 'System.String Terraria.Lang.deathMsg(Int32, Int32, Int32, Int32)'.
at LiquidsPlus.MPlayer.PreUpdate()
at Terraria.ModLoader.PlayerHooks.PreUpdate(Player player)
at Terraria.Player.Update(Int32 i)
at Terraria.WorldGen.do_playWorldCallBack(Object threadContext)
at Terraria.WorldGen.playWorldCallBack(Object threadContext)
That mod needs an update it looks like.
[doublepost=1473972514,1473972471][/doublepost]
The mod browser won't work for me and I'm not sure why.
It's busy since: new tmodloader, new updates. Try back later or see if the mod is hosted on it's respective thread.
 
I get it as well at times, just wait for a while and it should come back up for you.
If not there is other games you have to fall back on I take it.
Cause for me I have a few games I play, like Minecraft and Starbound.
 
It takes about 5 minutes but it will come up. I've tested it a few times now, however downloads don't seem to be working for me, specifically updates, anyone else having this issue?
 
Is it possible to run from one side of the map to the other on a server? I know it may sound like a silly question, but it may help with solving your problem.
Yes, I can
[doublepost=1473988396,1473988003][/doublepost]Oh wait. I fixed it somehow. Thanks, though!
 
as a suggestion having a in-game or in-menu mod recompile or reload button would be nice

and is there a way to make a weapon fire a progectile that has a circular hit area (for my shield)
 
Is this a bug or something I have missed...

Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace NewMod.NPCs
{
    class ModGlobalNPC : GlobalNPC
    {
        public override void NPCLoot(NPC npc)
        {
            if (npc.type == NPCID.GreenSlime)
            {
                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AwesomeItem"));
            }
        }
    }
}

This should drop the AwesomeItem 100% of the time off the mobs I choose, but anytime I use a NPCID that is negative (like GreenSlime is '-3') it will not drop off that npc but will drop off any positive NPCID mob such as BlueSlime (which is '1').
 
Is this a bug or something I have missed...

Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace NewMod.NPCs
{
    class ModGlobalNPC : GlobalNPC
    {
        public override void NPCLoot(NPC npc)
        {
            if (npc.type == NPCID.GreenSlime)
            {
                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AwesomeItem"));
            }
        }
    }
}

This should drop the AwesomeItem 100% of the time off the mobs I choose, but anytime I use a NPCID that is negative (like GreenSlime is '-3') it will not drop off that npc but will drop off any positive NPCID mob such as BlueSlime (which is '1').
Yep, negative npcids aren't "real". In this case, you can check "if(npc.netID == NPCID.GreenSlime)" and it should work.

(Technically Green Slime and Blue Slime share the same npcid)
 
Yep, negative npcids aren't "real". In this case, you can check "if(npc.netID == NPCID.GreenSlime)" and it should work.
Awesome, that worked, thanks jopojelly.

Just as another note of weirdness
Code:
if (npc.type == NPCID.GreenSlime || npc.type == NPCID.BlueSlime)

Then it will drop off both...
 
Back
Top Bottom