Huzbubber Tim
Ice Queen
CoolI might also add a proper thing that will allow to do proper hell detection (instead of Main.MaxTileY - 200, wich is dirty...).
CoolI might also add a proper thing that will allow to do proper hell detection (instead of Main.MaxTileY - 200, wich is dirty...).
Oh, dimlibs is another thing completly xD Basically did you had modReference = BiomeLibrary in your build.txt? After if you are using VS, add this dll in your reference.can you also provide how should the mod folder be please? I didn't understand what is "ModName".Dimensions and i don't know why it does say that DimLibs and BiomeLibrary need a using directory
Post the code you currently have, I'll try to help from there ^^so what i should write?
ModWorld:using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using BiomeLibrary;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameContent.Generation;
using Terraria.World;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.World.Generation;
using Terraria.ID;
namespace DestinyMod
{
public class World : ModWorld
{
public override void Load(TagCompound tag)
{
var downed = tag.GetList<string>("downed");
}
public override void LoadLegacy(BinaryReader reader)
{
int loadVersion = reader.ReadInt32();
if(loadVersion == 0)
{
BitsByte flags = reader.ReadByte();
}
}
public override void NetSend(BinaryWriter writer)
{
BitsByte flags = new BitsByte();
writer.Write(flags);
}
public override void NetReceive(BinaryReader reader)
{
BitsByte flags = reader.ReadByte();
}
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
if(ShiniesIndex != -1)
{
tasks.Insert(ShiniesIndex + 1, new PassLegacy("Tutorial Mod Ores", delegate (GenerationProgress progress)
{
progress.Message = "Generating Destiny Mod Ore Veins";
for(int i = 0; i < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); i++)
{
WorldGen.TileRunner(
WorldGen.genRand.Next(0, Main.maxTilesX), // X Coord of the tile
WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), // Y Coord of the tile
(double)WorldGen.genRand.Next(6, 12), // Strength (High = more)
WorldGen.genRand.Next(2, 6), // Steps
mod.TileType("StormiliteOreTile"), // The tile type that will be spawned
false, // Add Tile ???
0f, // Speed X ???
0f, // Speed Y ???
false, // noYChange ???
true); // Overrides existing tiles
WorldGen.TileRunner(
WorldGen.genRand.Next(0, Main.maxTilesX), // X Coord of the tile
WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), // Y Coord of the tile
(double)WorldGen.genRand.Next(6, 12), // Strength (High = more)
WorldGen.genRand.Next(2, 6), // Steps
mod.TileType("LithiumOreTile"), // The tile type that will be spawned
false, // Add Tile ???
0f, // Speed X ???
0f, // Speed Y ???
false, // noYChange ???
true); // Overrides existing tiles
WorldGen.TileRunner(
WorldGen.genRand.Next(0, Main.maxTilesX), // X Coord of the tile
WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), // Y Coord of the tile
(double)WorldGen.genRand.Next(6, 12), // Strength (High = more)
WorldGen.genRand.Next(2, 6), // Steps
mod.TileType("CyaniteTile"), // The tile type that will be spawned
false, // Add Tile ???
0f, // Speed X ???
0f, // Speed Y ???
false, // noYChange ???
true); // Overrides existing tiles
}
}));
}
}
public override void Initialize()
{
BiomeLibs.RegisterNewBiome("Wasteland", 50, mod);
}
private void RegisterWasteland()
{
Func<bool> c = () => downedPlantboss;
BiomeLibs.RegisterNewBiome("Wasteland", 50, mod);
BiomeLibs.AddBlockInBiome("Wasteland", new String[] { "WasteStone", "WasteSand", "GreenIce" });
BiomeLibs.addHallowAltBiome("Wasteland", "A Nuclear Bomb stroke the ground.");
BiomeLibs.SetCondition("Wasteland", c);
}
}
}
build.txt:author = alexb2810
version = 0.1.1.9
displayName = Destiny Mod
modReferences = BiomeLibrary
public override void Initialize()
{
RegisterWasteland();
}
well, you'll have to write the code for that, biomelibs doesn't generate biome apart from hallow. What I could potentially add in future is a Func<void> where you put your biome generation code there and it will spawn when condition are methow do i get my biome to spawn when i kill plantera?
it is, the source is at the bottom of the threadIt's not open source
I keep getting an "Index was outside the bounds of array" error whenever I try to create a new world
public override void Initialize()
{
RegisterHaven();
}
private void RegisterHaven()
{
Func<bool> c = () => Main.hardMode;
BiomeLibs.RegisterNewBiome("Haven", 50, mod);
BiomeLibs.AddBlockInBiome("Haven", new String[] { "havenstone", "havengrass" });
BiomeLibs.addHallowAltBiome("Haven", "The endless cycle of death and rebirth has begun anew...");
}
And I do have "modReferences = BiomeLibrary" in build.txt
That sounds great and really worth the effort! Does this auto update in tmodloader? Also if I make a biome does it update the code?So as 0.4 is coming here is the changelog so far:
- All the current method are removed
- Now you can extends from ModBiome, I might look into making it ModCall only like I did with AchievementLibs but I doubt it will happen
- ModBiome are autoloaded, you only need to extends from ModBiome and the mod do the rest!
- Rewrote partially the hallow/biome alt generator to allow more option
-- Currently only hallow alt are supported, but this new system will allow more alt support like : Snow Alt/Jungle Alt/Hell Alt/Big desert Alt and more if any of you have suggestion (evil alt might not come anytime soon)
-- You can now bound alt to specific evil
-- You can now use a generator you made by yourself or use the default one
Do note that I rewrote pretty much everything, so I might have forgot something
if you are 0.3 and under, everything will need to be updated (tough it will be in 1 class). Tml sadly doesn't have auto download yet.That sounds great and really worth the effort! Does this auto update in tmodloader? Also if I make a biome does it update the code?
Show the entire error pls
Edit: Also I'm rewriting a big part of the mod, which then might make into tML and also the next version will have a lot more powerful API than it have right now (since I learned a lot)
Sound like a problem on your end there since I don't touch this hook at all.sorry for the super late reply, had some personal stuff to deal with.
Here is the entire error
Index was outside the bounds of the array.
at HavenMod.MWorld.PostWorldGen()
at Terraria.ModLoader.WorldHooks.PostWorldGen()
at Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject)
at Terraria.WorldGen.do_worldGenCallBack(Object threadContext)
at Terraria.WorldGen.worldGenCallBack(Object threadContext)
At PostWorldGen() we are adding modded items to surface chests (if that helps at all)
You're right I messed up when troubleshooting. Appreciate the help though.Sound like a problem on your end there since I don't touch this hook at all.