• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

tAPI Gretarria mod - The past being rewritten

Boffin

Brain of Cthulhu
Gretarria is a mod that starts mainly after hardmode, including lots of ores, tools, a custom biome and small structures underground. If you want to look at some of the things that sort of work, click the spoiler button:

If anyone knows how to get the background to change when I'm in the biome, please let me know! :D (Also, this biome is currently disabled due to the fact it keeps covering the dungeon xD)

Exciting! Also, there are currently four new ores: Rerrurium (mouthful amirite?), Lirica, Vintium and Dantium. Images in that order:



Only spawns in hell!

Only spawns on the left side of the world (Will only spawn in the Hallow in future)

Only spawns on the right side of the world (Will only spawn in underground crimson or corruption in future)

Also, there's the introduction of the "Ancient Forge", which can be found in small underground structures that look like this:



There is also currently a boss, called the "Ancient Burrower", but she's a 'lil glitchy at the moment, as her bottom half occasionally doesn't spawn (she's a worm), so yeah. Won't show her off just yet.

TO DO:

- Finish the "Past" biome and add custom enemies to it.
- Finish tool and weapon sets for all the ores (only currently finished rerrurium)
- Fix the ancient minions' tails so that they aren't half the size of the worm's body and head (though the image is the same size, the scale is the same size, this still doesn't work :( )
- Add more stuff to this list...

The theme of this mod is mainly black and white, to show the past, but it makes spriting much easier, thankfully ^.^

This mod is obviously WIP and is still quite buggy. I finally overcame the horrible bug which meant that if the boss despawned, the game would crash.
 

Attachments

Last edited:

Boffin

Brain of Cthulhu
hey dude it looks a cool mod but you know a way to spawn a ore in a biome?
Not in a specific biome no, gotta learn that myself yet. Best way I can think is to check if the tile that the ore is going to be spawned on is (for example, if you wanted underground snow) snow, or ice etc.
 

VictorLes

The Destroyer
Not in a specific biome no, gotta learn that myself yet. Best way I can think is to check if the tile that the ore is going to be spawned on is (for example, if you wanted underground snow) snow, or ice etc.
sorry to be asking but can pass some of dat code i want make a ore spawns in underground snow
 

Boffin

Brain of Cthulhu
I tried it on one of my ores, but I can't get it to work... I'll message you if I do, because I want my ores to biome-specific also.
 

VictorLes

The Destroyer
I tried it on one of my ores, but I can't get it to work... I'll message you if I do, because I want my ores to biome-specific also.
there is avalon source code for tapi i cant remember where is the site it shows how to make biomes spread and make a custom background
 

Boffin

Brain of Cthulhu
The avalon source code is really scary lol

I'm not that good xD

Anyway, I figured it out:


Code:
public void AddCustomOre()
        {
            int LowX = 200;  //How far left it's generated
            int HighX = Main.maxTilesX - 200;  //How far right it's generated
            int LowY = 200; //Height in the world (uppermost)
            int HighY = Main.maxTilesY - 200;  //Height in the world (lowermost)

            int X = WorldGen.genRand.Next(LowX, HighX); //No Touchy
            int Y = WorldGen.genRand.Next(LowY, HighY); //No Touchy

            int OreMinimumSpread = 4; //Minimum spreadth
            int OreMaximumSpread = 6; //Maximum spreadth            #Size of vein 

            int OreMinimumFrequency = 8; //Minimum density          #Stretched the vein is (length in blocks maybe?)
            int OreMaximumFrequency = 15; //Maximum density

            int OreSpread = WorldGen.genRand.Next(OreMinimumSpread, OreMaximumSpread + 1); //No Touchy
            int OreFrequency = WorldGen.genRand.Next(OreMinimumFrequency, OreMaximumFrequency + 1); //No Touchy

            if (Main.tile[X, Y].type == 147 || Main.tile[X,Y].type == 161) //Types 147 and 161 are snow and ice respectively
            {
                WorldGen.OreRunner(X, Y, (double)OreSpread, OreFrequency, TileDef.byName["ModName:CustomOre"]);  //Ore Tile name here
            }
            else
            {
                AddCustomOre();
            }
        }
However, I would only call this at the beginning of world generation, because if someone places the block that your looking for then you're going to have some problems.

Also, be careful, because if it doesn't find any of the parameters you're looking for (say for example, the mistake I made, which was I made the LowY value to big, so it didn't find any snow or ice, so it crashed the game because it made an infinite loop)
 

VictorLes

The Destroyer
The avalon source code is really scary lol

I'm not that good xD

Anyway, I figured it out:


Code:
public void AddCustomOre()
        {
            int LowX = 200;  //How far left it's generated
            int HighX = Main.maxTilesX - 200;  //How far right it's generated
            int LowY = 200; //Height in the world (uppermost)
            int HighY = Main.maxTilesY - 200;  //Height in the world (lowermost)

            int X = WorldGen.genRand.Next(LowX, HighX); //No Touchy
            int Y = WorldGen.genRand.Next(LowY, HighY); //No Touchy

            int OreMinimumSpread = 4; //Minimum spreadth
            int OreMaximumSpread = 6; //Maximum spreadth            #Size of vein

            int OreMinimumFrequency = 8; //Minimum density          #Stretched the vein is (length in blocks maybe?)
            int OreMaximumFrequency = 15; //Maximum density

            int OreSpread = WorldGen.genRand.Next(OreMinimumSpread, OreMaximumSpread + 1); //No Touchy
            int OreFrequency = WorldGen.genRand.Next(OreMinimumFrequency, OreMaximumFrequency + 1); //No Touchy

            if (Main.tile[X, Y].type == 147 || Main.tile[X,Y].type == 161) //Types 147 and 161 are snow and ice respectively
            {
                WorldGen.OreRunner(X, Y, (double)OreSpread, OreFrequency, TileDef.byName["ModName:CustomOre"]);  //Ore Tile name here
            }
            else
            {
                AddCustomOre();
            }
        }
However, I would only call this at the beginning of world generation, because if someone places the block that your looking for then you're going to have some problems.

Also, be careful, because if it doesn't find any of the parameters you're looking for (say for example, the mistake I made, which was I made the LowY value to big, so it didn't find any snow or ice, so it crashed the game because it made an infinite loop)
do you use visual studio? just a random question '-'
 

Boffin

Brain of Cthulhu
Thanks man!

The way I did it is kind of simple. First, It picks a random x,y coordinate in the world between the hell layer and the stone layer. Then, it checks if all the corners are blocks (to make sure there aren't any floating in the air). Then, I just use a load of for loops running WorldGen.PlaceTile(); The code is large, but here it is:


Code:
public void AddAncientForges()
        {
            Main.statusText = "Building ancient forges...";

            int HX = Main.maxTilesX - 1200;
            int LX = 1200;                                                                                   
            int HY = Main.maxTilesY - 200;
            int LY = Main.maxTilesY - 700;

            x = WorldGen.genRand.Next(LX, HX + 1);
            y = WorldGen.genRand.Next(LY, HY + 1);

            if (!WorldGen.EmptyTileCheck(x, x, y, y) && !WorldGen.EmptyTileCheck(x + 7, x + 7, y, y) && !WorldGen.EmptyTileCheck(x, x, y - 6, y - 6 ) && !WorldGen.EmptyTileCheck(x + 7, x + 7, y - 6, y - 6))
            {
                //Kill all the tiles
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y, false, false, true);
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y - 1, false, false, true);
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y - 2, false, false, true);
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y - 3, false, false, true);
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y - 4, false, false, true);
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y - 5, false, false, true);
                for (int i = 0; i < 8; i++) WorldGen.KillTile(x + i, y - 6, false, false, true);

                //Kill all the walls

                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y);
                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y - 1);
                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y - 2);
                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y - 3);
                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y - 4);
                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y - 5);
                for (int i = 0; i < 8; i++) WorldGen.KillWall(x + i, y - 6);

                //Generate tiles surrounding the sword forge

                //FLOOR
                for (int i = 0; i < 8; i++) WorldGen.PlaceTile(x + i, y, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
                //LEFT AND RIGHT WALLS
                WorldGen.PlaceTile(x, y - 4, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
                WorldGen.PlaceTile(x, y - 5, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
                WorldGen.PlaceTile(x + 7, y - 4, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
                WorldGen.PlaceTile(x + 7, y - 5, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
                //CEILING
                for (int i = 0; i < 8; i++) WorldGen.PlaceTile(x + i, y - 6, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
                //WALLS
                int x1 = x + 1;
                for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 1, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
                for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 2, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
                for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 3, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
                for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 4, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
                for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 5, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
                //SWORD FORGE
                WorldGen.PlaceTile(x + 3, y - 1, TileDef.byName["Gretarria:AncientForge"], true, true);
            }
            else
            {
                AddAncientForges();
            }
}
There are better ways, but I'm still learning myself so this'll do.
 

Luna_Steambath

Skeletron
Is it really that simple? Thank you so much!
Bad that the worm does not work. This happens in all mods, when the worm is summoned without a body. :(
 

Boffin

Brain of Cthulhu
Is it really that simple? Thank you so much!
Bad that the worm does not work. This happens in all mods, when the worm is summoned without a body. :(
Yeah... Still gonna continue working on her, she has minions and stuff now too. She also works like EoW, where she splits off. She's working at this point, just the occasional no tail or only head thing. Meh, nothing a restart can't fix.
 
Top Bottom