Tool TerraCustom for 1.3

Already asked about it in the Tmodloader thread as an extra, but I feel it's better placed here, since you, the dev, is answering: Do you happen to have any idea as to how I could modify the exe so it ALWAYS spawns exactly three pyramids?

I've found this:

Code:
{
            WorldGen.numPyramids = WorldGen.numPyramids + 1;
            ushort num = 151;
            int num1 = j - WorldGen.genRand.Next(0, 7);
            int num2 = WorldGen.genRand.Next(9, 13);
            int num3 = 1;
            int num4 = j + WorldGen.genRand.Next(75, 125);
            for (int i1 = num1; i1 < num4; i1++)
            {
                for (int j1 = i - num3; j1 < i + num3 - 1; j1++)
                {
                    Main.tile[j1, i1].type = num;
                    Main.tile[j1, i1].active(true);
                    Main.tile[j1, i1].halfBrick(false);
                    Main.tile[j1, i1].slope(0);
                }
                num3++;
            }
            for (int k = i - num3 - 5; k <= i + num3 + 5; k++)
            {
                for (int l = j - 1; l <= num4 + 1; l++)
                {
                    bool flag = true;
                    for (int m = k - 1; m <= k + 1; m++)
                    {
                        for (int n = l - 1; n <= l + 1; n++)
                        {
                            if (Main.tile[m, n].type != num)
                            {
                                flag = false;
                            }
                        }
                    }
                    if (flag)
                    {
                        Main.tile[k, l].wall = 34;
                        WorldGen.SquareWallFrame(k, l, true);
                    }
                }
            }
            int num5 = 1;
            if (WorldGen.genRand.Next(2) == 0)
            {
                num5 = -1;
            }
            int num6 = i - num2 * num5;
            int num7 = j + num2;
            int num8 = WorldGen.genRand.Next(5, 8);
            bool flag1 = true;
            int num9 = WorldGen.genRand.Next(20, 30);
            while (flag1)
            {
                flag1 = false;
                bool flag2 = false;
                for (int o = num7; o <= num7 + num8; o++)
                {
                    int num10 = num6;
                    if (Main.tile[num10, o - 1].type == 53)
                    {
                        flag2 = true;
                    }
                    if (Main.tile[num10, o].type == num)
                    {
                        Main.tile[num10, o + 1].wall = 34;
                        Main.tile[num10 + num5, o].wall = 34;
                        Main.tile[num10, o].active(false);
                        flag1 = true;
                    }
                    if (flag2)
                    {
                        Main.tile[num10, o].type = 53;
                        Main.tile[num10, o].active(true);
                        Main.tile[num10, o].halfBrick(false);
                        Main.tile[num10, o].slope(0);
                    }
                }
                num6 = num6 - num5;
            }
            num6 = i - num2 * num5;
            bool flag3 = true;
            bool flag4 = false;
            flag1 = true;
            while (flag1)
            {
                for (int p = num7; p <= num7 + num8; p++)
                {
                    Main.tile[num6, p].active(false);
                }
                num6 = num6 + num5;
                num7++;
                num9--;
                if (num7 >= num4 - num8 * 2)
                {
                    num9 = 10;
                }
                if (num9 <= 0)
                {
                    bool flag5 = false;
                    if (!flag3 && !flag4)
                    {
                        flag4 = true;
                        flag5 = true;
                        int num11 = WorldGen.genRand.Next(7, 13);
                        int num12 = WorldGen.genRand.Next(23, 28);
                        int num13 = num12;
                        int num14 = num6;
                        while (num12 > 0)
                        {
                            for (int q = num7 - num11 + num8; q <= num7 + num8; q++)
                            {
                                if (num12 == num13 || num12 == 1)
                                {
                                    if (q >= num7 - num11 + num8 + 2)
                                    {
                                        Main.tile[num6, q].active(false);
                                    }
                                }
                                else if (num12 != num13 - 1 && num12 != 2 && num12 != num13 - 2 && num12 != 3)
                                {
                                    Main.tile[num6, q].active(false);
                                }
                                else if (q >= num7 - num11 + num8 + 1)
                                {
                                    Main.tile[num6, q].active(false);
                                }
                            }
                            num12--;
                            num6 = num6 + num5;
                        }
                        int num15 = num6 - num5;
                        int num16 = num15;
                        int num17 = num14;
                        if (num15 > num14)
                        {
                            num16 = num14;
                            num17 = num15;
                        }
                        int num18 = WorldGen.genRand.Next(3);
                        if (num18 == 0)
                        {
                            num18 = 857;
                        }
                        else if (num18 == 1)
                        {
                            num18 = 848;
                        }
                        else if (num18 == 2)
                        {
                            num18 = 934;
                        }
                        WorldGen.AddBuriedChest((num16 + num17) / 2, num7, num18, false, 1);
                        int num19 = WorldGen.genRand.Next(1, 10);
                        for (int r = 0; r < num19; r++)
                        {
                            int num20 = WorldGen.genRand.Next(num16, num17);
                            int num21 = num7 + num8;
                            WorldGen.PlaceSmallPile(num20, num21, WorldGen.genRand.Next(16, 19), 1, 185);
                        }
                        WorldGen.PlaceTile(num16 + 2, num7 - num11 + num8 + 1, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        WorldGen.PlaceTile(num16 + 3, num7 - num11 + num8, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        WorldGen.PlaceTile(num17 - 2, num7 - num11 + num8 + 1, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        WorldGen.PlaceTile(num17 - 3, num7 - num11 + num8, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        for (int s = num16; s <= num17; s++)
                        {
                            WorldGen.PlacePot(s, num7 + num8, 28, WorldGen.genRand.Next(25, 28));
                        }
                    }
                    if (flag3)
                    {
                        flag3 = false;
                        num5 = num5 * -1;
                        num9 = WorldGen.genRand.Next(15, 20);
                    }
                    else if (!flag5)
                    {
                        num5 = num5 * -1;
                        num9 = WorldGen.genRand.Next(20, 40);
                    }
                    else
                    {
                        num9 = WorldGen.genRand.Next(10, 15);
                    }
                }
                if (num7 < num4 - num8)
                {
                    continue;
                }
                flag1 = false;
            }
            int num22 = WorldGen.genRand.Next(100, 200);
            int num23 = WorldGen.genRand.Next(500, 800);
            flag1 = true;
            int num24 = num8;
            num9 = WorldGen.genRand.Next(10, 50);
            if (num5 == 1)
            {
                num6 = num6 - num24;
            }
            int num25 = WorldGen.genRand.Next(5, 10);
            while (flag1)
            {
                num22--;
                num23--;
                num9--;
                for (int t = num6 - num25 - WorldGen.genRand.Next(0, 2); t <= num6 + num24 + num25 + WorldGen.genRand.Next(0, 2); t++)
                {
                    int num26 = num7;
                    if (t < num6 || t > num6 + num24)
                    {
                        Main.tile[t, num26].type = num;
                        Main.tile[t, num26].active(true);
                        Main.tile[t, num26].halfBrick(false);
                        Main.tile[t, num26].slope(0);
                    }
                    else
                    {
                        Main.tile[t, num26].active(false);
                    }
                    if (t >= num6 - 1 && t <= num6 + 1 + num24)
                    {
                        Main.tile[t, num26].wall = 34;
                    }
                }
                num7++;
                num6 = num6 + num5;
                if (num22 <= 0)
                {
                    flag1 = false;
                    for (int u = num6 + 1; u <= num6 + num24 - 1; u++)
                    {
                        if (Main.tile[u, num7].active())
                        {
                            flag1 = true;
                        }
                    }
                }
                if (num9 < 0)
                {
                    num9 = WorldGen.genRand.Next(10, 50);
                    num5 = num5 * -1;
                }
                if (num23 > 0)
                {
                    continue;
                }
                flag1 = false;
            }
            return true;
        }

in WorldGen but I have no idea what to do with it, since I don't have any coding experience :/
 
Already asked about it in the Tmodloader thread as an extra, but I feel it's better placed here, since you, the dev, is answering: Do you happen to have any idea as to how I could modify the exe so it ALWAYS spawns exactly three pyramids?

I've found this:

Code:
{
            WorldGen.numPyramids = WorldGen.numPyramids + 1;
            ushort num = 151;
            int num1 = j - WorldGen.genRand.Next(0, 7);
            int num2 = WorldGen.genRand.Next(9, 13);
            int num3 = 1;
            int num4 = j + WorldGen.genRand.Next(75, 125);
            for (int i1 = num1; i1 < num4; i1++)
            {
                for (int j1 = i - num3; j1 < i + num3 - 1; j1++)
                {
                    Main.tile[j1, i1].type = num;
                    Main.tile[j1, i1].active(true);
                    Main.tile[j1, i1].halfBrick(false);
                    Main.tile[j1, i1].slope(0);
                }
                num3++;
            }
            for (int k = i - num3 - 5; k <= i + num3 + 5; k++)
            {
                for (int l = j - 1; l <= num4 + 1; l++)
                {
                    bool flag = true;
                    for (int m = k - 1; m <= k + 1; m++)
                    {
                        for (int n = l - 1; n <= l + 1; n++)
                        {
                            if (Main.tile[m, n].type != num)
                            {
                                flag = false;
                            }
                        }
                    }
                    if (flag)
                    {
                        Main.tile[k, l].wall = 34;
                        WorldGen.SquareWallFrame(k, l, true);
                    }
                }
            }
            int num5 = 1;
            if (WorldGen.genRand.Next(2) == 0)
            {
                num5 = -1;
            }
            int num6 = i - num2 * num5;
            int num7 = j + num2;
            int num8 = WorldGen.genRand.Next(5, 8);
            bool flag1 = true;
            int num9 = WorldGen.genRand.Next(20, 30);
            while (flag1)
            {
                flag1 = false;
                bool flag2 = false;
                for (int o = num7; o <= num7 + num8; o++)
                {
                    int num10 = num6;
                    if (Main.tile[num10, o - 1].type == 53)
                    {
                        flag2 = true;
                    }
                    if (Main.tile[num10, o].type == num)
                    {
                        Main.tile[num10, o + 1].wall = 34;
                        Main.tile[num10 + num5, o].wall = 34;
                        Main.tile[num10, o].active(false);
                        flag1 = true;
                    }
                    if (flag2)
                    {
                        Main.tile[num10, o].type = 53;
                        Main.tile[num10, o].active(true);
                        Main.tile[num10, o].halfBrick(false);
                        Main.tile[num10, o].slope(0);
                    }
                }
                num6 = num6 - num5;
            }
            num6 = i - num2 * num5;
            bool flag3 = true;
            bool flag4 = false;
            flag1 = true;
            while (flag1)
            {
                for (int p = num7; p <= num7 + num8; p++)
                {
                    Main.tile[num6, p].active(false);
                }
                num6 = num6 + num5;
                num7++;
                num9--;
                if (num7 >= num4 - num8 * 2)
                {
                    num9 = 10;
                }
                if (num9 <= 0)
                {
                    bool flag5 = false;
                    if (!flag3 && !flag4)
                    {
                        flag4 = true;
                        flag5 = true;
                        int num11 = WorldGen.genRand.Next(7, 13);
                        int num12 = WorldGen.genRand.Next(23, 28);
                        int num13 = num12;
                        int num14 = num6;
                        while (num12 > 0)
                        {
                            for (int q = num7 - num11 + num8; q <= num7 + num8; q++)
                            {
                                if (num12 == num13 || num12 == 1)
                                {
                                    if (q >= num7 - num11 + num8 + 2)
                                    {
                                        Main.tile[num6, q].active(false);
                                    }
                                }
                                else if (num12 != num13 - 1 && num12 != 2 && num12 != num13 - 2 && num12 != 3)
                                {
                                    Main.tile[num6, q].active(false);
                                }
                                else if (q >= num7 - num11 + num8 + 1)
                                {
                                    Main.tile[num6, q].active(false);
                                }
                            }
                            num12--;
                            num6 = num6 + num5;
                        }
                        int num15 = num6 - num5;
                        int num16 = num15;
                        int num17 = num14;
                        if (num15 > num14)
                        {
                            num16 = num14;
                            num17 = num15;
                        }
                        int num18 = WorldGen.genRand.Next(3);
                        if (num18 == 0)
                        {
                            num18 = 857;
                        }
                        else if (num18 == 1)
                        {
                            num18 = 848;
                        }
                        else if (num18 == 2)
                        {
                            num18 = 934;
                        }
                        WorldGen.AddBuriedChest((num16 + num17) / 2, num7, num18, false, 1);
                        int num19 = WorldGen.genRand.Next(1, 10);
                        for (int r = 0; r < num19; r++)
                        {
                            int num20 = WorldGen.genRand.Next(num16, num17);
                            int num21 = num7 + num8;
                            WorldGen.PlaceSmallPile(num20, num21, WorldGen.genRand.Next(16, 19), 1, 185);
                        }
                        WorldGen.PlaceTile(num16 + 2, num7 - num11 + num8 + 1, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        WorldGen.PlaceTile(num16 + 3, num7 - num11 + num8, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        WorldGen.PlaceTile(num17 - 2, num7 - num11 + num8 + 1, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        WorldGen.PlaceTile(num17 - 3, num7 - num11 + num8, 91, true, false, -1, WorldGen.genRand.Next(4, 7));
                        for (int s = num16; s <= num17; s++)
                        {
                            WorldGen.PlacePot(s, num7 + num8, 28, WorldGen.genRand.Next(25, 28));
                        }
                    }
                    if (flag3)
                    {
                        flag3 = false;
                        num5 = num5 * -1;
                        num9 = WorldGen.genRand.Next(15, 20);
                    }
                    else if (!flag5)
                    {
                        num5 = num5 * -1;
                        num9 = WorldGen.genRand.Next(20, 40);
                    }
                    else
                    {
                        num9 = WorldGen.genRand.Next(10, 15);
                    }
                }
                if (num7 < num4 - num8)
                {
                    continue;
                }
                flag1 = false;
            }
            int num22 = WorldGen.genRand.Next(100, 200);
            int num23 = WorldGen.genRand.Next(500, 800);
            flag1 = true;
            int num24 = num8;
            num9 = WorldGen.genRand.Next(10, 50);
            if (num5 == 1)
            {
                num6 = num6 - num24;
            }
            int num25 = WorldGen.genRand.Next(5, 10);
            while (flag1)
            {
                num22--;
                num23--;
                num9--;
                for (int t = num6 - num25 - WorldGen.genRand.Next(0, 2); t <= num6 + num24 + num25 + WorldGen.genRand.Next(0, 2); t++)
                {
                    int num26 = num7;
                    if (t < num6 || t > num6 + num24)
                    {
                        Main.tile[t, num26].type = num;
                        Main.tile[t, num26].active(true);
                        Main.tile[t, num26].halfBrick(false);
                        Main.tile[t, num26].slope(0);
                    }
                    else
                    {
                        Main.tile[t, num26].active(false);
                    }
                    if (t >= num6 - 1 && t <= num6 + 1 + num24)
                    {
                        Main.tile[t, num26].wall = 34;
                    }
                }
                num7++;
                num6 = num6 + num5;
                if (num22 <= 0)
                {
                    flag1 = false;
                    for (int u = num6 + 1; u <= num6 + num24 - 1; u++)
                    {
                        if (Main.tile[u, num7].active())
                        {
                            flag1 = true;
                        }
                    }
                }
                if (num9 < 0)
                {
                    num9 = WorldGen.genRand.Next(10, 50);
                    num5 = num5 * -1;
                }
                if (num23 > 0)
                {
                    continue;
                }
                flag1 = false;
            }
            return true;
        }

in WorldGen but I have no idea what to do with it, since I don't have any coding experience :/
I'll be honest, there are a few different places where pyramid code happens, and I haven't been able to make sense of it yet. It's been a goal of mine to make sense of it, but I haven't been able to yet.
 
That's... unusual.

crimson corruption.png


crimson corruption 2.png

I guess, I should pick separate sides...
 
I'll be honest, there are a few different places where pyramid code happens, and I haven't been able to make sense of it yet. It's been a goal of mine to make sense of it, but I haven't been able to yet.

Oh, okay then, no prob. I was gonna try :red: with it myself, but if the guy who updated an .exe mod can't do it... I wont figure it out in a thousand years! I'll probably regen the world to make it as good as possible and just wait until I get about 3 pyramids then spill all three pyramid items in them.
 
I just tried to do this on my Mac, but my computer can't find the folder. I'm running OS X Yosemite. Also, not to be a hater, but I'm having trouble understanding your instructions. What do you mean, re-name the 'Terraria.exe'? And do I replace it with the mod or just put them both in?
 
I just tried to do this on my Mac, but my computer can't find the folder. I'm running OS X Yosemite. Also, not to be a hater, but I'm having trouble understanding your instructions. What do you mean, re-name the 'Terraria.exe'? And do I replace it with the mod or just put them both in?
That would be like, rename Terraria.exe to TerrariaVanilla.exe, then copy in the TerrariaCustom.exe from the TerraCustom download and rename it to be Terraria.exe.
 
I checked the console, as it still doesn't work. I'm no computer genius, so can you tell me what this means?
8/31/16 8:14:42.066 PM Terraria.bin.osx[24237]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.5 instead of 10.10.5. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
Call location:
 
Hey, will this be compatible with mods?
Edit: Oh Im just trying this it seems like it is compatible
 
Last edited:
@jopojelly, I think there might be a bug in v0.3.5. The Old Man isn't spawning at the Dungeon. The dungeon generation parameters are normal (100%), though I've forced generating a blue dungeon. No bosses are pre-killed. The other parameters I've modified are generating Crimson with Corruption chasms (1 each) and spawning both ores (including hardmode ores).

I've tried the same parameters in v0.3.2 and the Old Man spawned as expected. Old Man also spawns as expected when generating a world through Terraria itself. No mods or other tools installed or used.

Edit: No bug. I derped.
 
Last edited:
@jopojelly, I think there might be a bug in v0.3.5. The Old Man isn't spawning at the Dungeon. The dungeon generation parameters are normal (100%), though I've forced generating a blue dungeon. No bosses are pre-killed. The other parameters I've modified are generating Crimson with Corruption chasms (1 each) and spawning both ores (including hardmode ores).

I've tried the same parameters in v0.3.2 and the Old Man spawned as expected. Old Man also spawns as expected when generating a world through Terraria itself. No mods or other tools installed or used.
I just tried and it was fine. Maybe try again. If not, I'll see if there is any way those other parameters might cause problems.
 
I just tried and it was fine. Maybe try again. If not, I'll see if there is any way those other parameters might cause problems.
It's happened on every world I've generated and been to the Dungeon. (There's been a lot of them - I've been trying to generate a perfect world.)
Edit: No bug. I derped.

Is there a config file that I can upload that would allow you to load the same parameters I use?
 
Last edited:
Jst out of curiosity, does this together with large world enabler remove a suupposed 1000 chest limit? Tedit won't let me edit and save a world with more than 1000 chests, yet I can play them just fine inside Terraria, even lets me place down more chests...

Curious if there is a sort of not-obvious problem with playing a world with more than 1000 chests. Because i can't seem to notice any.
 
It's happened on every world I've generated and been to the Dungeon. (There's been a lot of them - I've been trying to generate a perfect world.)

Is there a config file that I can upload that would allow you to load the same parameters I use?
Documents\My Games\Terraria\TerraCustom\setting1.xml should be the saved preferences if you saved them.

Jst out of curiosity, does this together with large world enabler remove a suupposed 1000 chest limit? Tedit won't let me edit and save a world with more than 1000 chests, yet I can play them just fine inside Terraria, even lets me place down more chests...

Curious if there is a sort of not-obvious problem with playing a world with more than 1000 chests. Because i can't seem to notice any.
No, the 1000 chest limit is hardcoded into the file format for vanilla wld files. I'm not sure what happens in game, but I assume that if you put 1001 separate items in each of 1001 chests, 1 of them would not have the item in it when you loaded the world again.
 
Hi. I've no idea if anyone else has reported this or if you're able to fix it but there's an odd bug where if I generate a world, no matter the settings if they're default or completely mental, most of the trees are all generated at the lowest height possible.
These are some of the rare normal trees that gen.
2.png

These are what most of the trees look like.
1.png

I have no clue what's causing this to happen but it's weird.
 
I just tried and it was fine. Maybe try again. If not, I'll see if there is any way those other parameters might cause problems.
Well... this is embarrassing. Turns out a number of bosses were marked as defeated, including Skeletron. I don't remember setting them to be defeated... but I guess I must have and forgotten about it. Then every subsequent load restored those settings.

Hi. I've no idea if anyone else has reported this or if you're able to fix it but there's an odd bug where if I generate a world, no matter the settings if they're default or completely mental, most of the trees are all generated at the lowest height possible.
On one of the pages (possibly Terrain - can't check right now), there are two sliders "Tree Minimum Height" and "Tree Maximum Height". These control how tall the pregenerated trees are. It looks like the tree maximum height is set very low. For reference, the Terraria defaults are min: 5 and max: 32.
 
On one of the pages (possibly Terrain - can't check right now), there are two sliders "Tree Minimum Height" and "Tree Maximum Height". These control how tall the pregenerated trees are. It looks like the tree maximum height is set very low. For reference, the Terraria defaults are min: 5 and max: 32.
Huh. Weird. See I'd just assumed the height values for trees was set to default because there were trees of normal size on the same world, which is where the two pictures are taken from. Hmph. Well, I still wonder, what could be causing some trees to go past the height limit if it's set to be the same as the minimum?
 
Well, I still wonder, what could be causing some trees to go past the height limit if it's set to be the same as the minimum?
Player-planted trees have their own heights (5-16 if I remember correctly) that is separate from the world generated trees.

Beyond that, I don't know for sure, sorry. Maybe some trees (e.g. Palm Trees) are exempt from the height limits. Maybe some trees are generated separately and aren't affected by the height limits (e.g. ensuring there are some big trees near the spawn point so the player has enough wood to get started). Hopefully someone can confirm for sure. :)
 
Back
Top Bottom