Standalone [1.3] tModLoader - A Modding API

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);
                }
            };
        }));
    }
}}

If I were to hazard a guess, you're trying to create too much Enderium Ore. Try lowering the arguments in WorldGen.genRand.Next that say 20.

Also, if both parameters of a Random.Next function are the same value, it will return that value. Not much point in using Random.Next in such a case.
 
The only issue is is that i cannot find my ore now
[DOUBLEPOST=1457478547,1457478272][/DOUBLEPOST]Wrong question: how do I make it so only one pickaxe can mine it (modded)?
 
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);
                }
            };
        }));
    }
}}
Ok, I forgot about that too. for now, after "Micro Biomes" should work.
 
ok so i have been using this to play the tremor mod remastered and it was working fine until my computer forced me to update to windows 10 and now it always crashes when i load my large worlds with this error:

Exception of type 'System.OutOfMemoryException' was thrown.
at Terraria.UI.Chat.ChatLine..ctor()
at Terraria.Main.DrawMenu(GameTime gameTime)
at Terraria.Main.do_Draw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)

Edit: forgot to mention that it only crashes when its a large world and it crashes when i try to create large worlds too but i can play on my small worlds just fine
 
I've been playing the Thorium mod with a friend, and chests seem to not register when you use the loot all button. Not that big of an issue, but can still be troublesome.

Edit: Deposit all does a similar glitch, but it gets rid of all the items instead. Learned that the hard way :(
 
Last edited:
So how would I go about making an NPC say something special the first time you talk to them? Like how the bound NPC's work? Would I need to make a bool variable to be triggered to false when talking to the npc to disallow further access to that dialogue? Would that variable stay false even after reloading the world?
 
So how would I go about making an NPC say something special the first time you talk to them? Like how the bound NPC's work? Would I need to make a bool variable to be triggered to false when talking to the npc to disallow further access to that dialogue? Would that variable stay false even after reloading the world?
Vanilla npc have separate choices if they are homeless, so just check npc.homeless in GetChat to return the "you saved me" dialogue.
[DOUBLEPOST=1457497193,1457497174][/DOUBLEPOST]
I've been playing the Thorium mod with a friend, and chests seem to not register when you use the loot all button. Not that big of an issue, but can still be troublesome.

Edit: Deposit all does a similar glitch, but it gets rid of all the items instead. Learned that the hard way :(
We know, it's fixed in the next release.
[DOUBLEPOST=1457497556][/DOUBLEPOST]
Also... This isnt really a question, but do you ever plan to make a tutorial on segmented NPCS?
Maybe I could.
Wrong question: how do I make it so only one pickaxe can mine it (modded)?
I'm not sure you can. You can try CanKillTile and check the inventory of the player to see if they are using the item

https://github.com/bluemagic123/tMo...-cankilltileint-i-int-j-ref-bool-blockdamaged
 
Alright thanks so much!
[DOUBLEPOST=1457522760,1457522225][/DOUBLEPOST]Is there a way to make a new "class', so it doesnt say throwing damage or whatever but "custom name" damage?
 
For what endershot is asking is this it here
public virtual bool CanKillTile(int i, int j, ref bool blockDamaged)
and how can i use this to set a pickaxe power.
 
Back
Top Bottom