WorldGen Class
Comments17this wiki
| The information in this article is for Terraria v1.0.6.1. |
|
This class is responsible for creating the world when a new one is created, and more. There aren't a lot of methods you can interact with, and it's very extensive as you can imagine, since it creates all the wonderful worlds for you to explore! This page will need a lot more information on it, particularly for what we can call when playing, or if we can alter any worldgen parameters. can be messed with to create your own biomes! (check the making custom biomes-page for more information) For quick reference, here is the size of a world:
| ||||
|
|
Properties
Edit
| Name | Type | Description |
|---|---|---|
| None | N/A | N/A |
Static Properties
Edit
| Name | Type | Description |
|---|---|---|
| bestX | int | |
| bestY | int | |
| canSpawn | bool | |
| dEnteranceX | int | The X co-ordinate of the Dungeon entrance. |
| destroyObject | bool | |
| dRoomSize | int[] | The size of every Dungeon Room. |
| dRoomX | int[] | The X co-ordinate of every Dungeon Room. |
| dRoomY | int[] | The Y co-ordinate of every Dungeon Room. |
| dSurface | bool | Dungeon surface level? |
| dungeonX | int | The Dungeons X co-ordinate. |
| dungeonY | int | The Dungeons Y co-ordinate. |
| gen | bool | if the world is generating (set to true in the generateWorld() ) |
| genRand | Random | The Random used by the World Generator. |
| hiScore | int | |
| houseTile | bool[] | True if the tile is a valid house tile, False if the tile isn't a valid house tile. |
| lastDungeonHall | Vector2 | Lowest dungeon room? |
| lavaLine | int | Maximum height that lave may be generated at Worldgen |
| loadBackup | bool | |
| loadFailed | bool | |
| loadSuccess | bool | |
| maxDRooms | int | The maximum amount of Dungeon Rooms. |
| maxRoomTiles | int | Maximum tiles in a room? |
| noLiquidCheck | bool | |
| noTileActions | bool | |
| numDRooms | int | How many Dungeon Rooms in a dungeon. |
| numRoomTiles | int | |
| roomX | int[] | |
| roomX1 | int | |
| roomX2 | int | |
| roomY | int[] | |
| roomY1 | int | |
| roomY2 | int | |
| saveLock | bool | |
| shadowOrbCount | int | Amount of Shadow Orbs generated on Worldgen |
| shadowOrbSmashed | bool | Check if a Shadow Orb was smashed. |
| spawnDelay | int | |
| spawnEye | bool | Spawn the Eye of Ctulhu? |
| spawnMeteor | bool | True to spawn a Meteor |
| spawnNPC | int | spawn wich npc? |
| statusText | string | Used in most title screens, the big centred text. |
| waterLine | int | Maximum height that water may be genned (Ocean line?) |
| worldBackup | bool | |
| worldCleared | bool |
Methods
Edit
| Method Name | Description |
|---|---|
| None | N/A |
Static Methods A-M
Edit
| Method Name | Description |
|---|---|
| AddBuriedChest() |
public static bool AddBuriedChest(
int i,
int j,
[int contain = 0],
[bool notNearOtherChests = false],
[int Style = -1]
)
{
}
Generate a chest in the rock layer?
|
| AddHellHouses() |
public static void AddHellHouses()
{
}
Hellhouse Generation
|
| AddLifeCrystal() |
public static bool AddLifeCrystal(int i, int j)
{
}
Life Crystal Generation
|
| AddPlants() |
public static void AddPlants()
{
}
Plant Generation
|
| AddShadowOrb() |
public static void AddShadowOrb(int x, int y)
{
}
Creates a shadow orb at the specified location
|
| AddTrees() |
public static void AddTrees()
{
}
Tree Generation
|
| CactusFrame() |
public static void CactusFrame(int i, int j)
{
}
Wich cactus frame to use? (on pearl/ebonsand?)
|
| CaveOpenater() |
public static void CaveOpenater(int i, int j)
{
}
Generate Caves?
|
| Cavinator() |
public static void Cavinator(int i, int j, int steps)
{
}
Generate Caves? (more likely then CaveOpenator() )
|
| ChasmRunner() |
public static void ChasmRunner(
int i,
int j,
int steps,
[bool makeOrb = false]
)
{
}
Corruption Chasm Generation (Vertical)
|
| ChasmRunnerSideways() |
public static void ChasmRunnerSideways(
int i,
int j,
int direction,
int steps
)
{
}
Corruption Chasm Generation (Horizontal)
|
| Check1x2() |
public static void Check1x2(int x, int j, byte type)
{
}
Description goes here
|
| Check1x2Top() |
public static void Check1x2Top(int x, int j, byte type)
{
}
Description goes here
|
| Check1xX() |
public static void Check1xX(int x, int j, byte type)
{
}
Description goes here
|
| Check2x1() |
public static void Check2x1(int i, int y, byte type)
{
}
Description goes here
|
| Check2x2() |
public static void Check2x2(int i, int j, int type)
{
}
Description goes here
|
| Check2xX() |
public static void Check2xX(int i, int j, byte type)
{
}
Description goes here
|
| Check3x2() |
public static void Check3x2(int i, int j, int type)
{
}
Description goes here
|
| Check3x3() |
public static void Check3x3(int i, int j, int type)
{
}
Description goes here
|
| Check3x4() |
public static void Check3x4(int i, int j, int type)
{
}
Description goes here
|
| Check4x2() |
public static void Check4x2(int i, int j, int type)
{
}
Description goes here
|
| CheckAlch() |
public static void CheckAlch(int x, int y)
{
}
Checks if the x/y tiles are valid alchemy stations?
|
| CheckBanner() |
public static void CheckBanner(int x, int j, byte type)
{
}
Description goes here
|
| CheckCactus() |
public static bool CheckCactus(int i, int j)
{
}
Cactus image to check? (pearl/ebonsand?)
|
| CheckChest() |
public static void CheckChest(int i, int j, int type)
{
}
Description goes here
|
| CheckOnTable1x1() |
public static void CheckOnTable1x1(int x, int y, int type)
{
}
Description goes here
|
| CheckPot() |
public static void CheckPot(int i, int j, [int type = 28])
{
}
Description goes here
|
| CheckRoom() |
public static void CheckRoom(int x, int y)
{
}
Check if room is suitable for housing?
|
| CheckSign() |
public static void CheckSign(int x, int y, int type)
{
}
Check Sign Data at specified location?
|
| CheckSunflower() |
public static void CheckSunflower(int i, int j, [int type = 27])
{
}
Check if there's a sunflower at the specified location?
|
| clearWorld() |
public static void clearWorld()
{
}
Delete every item/NPC/Projectile, to save the world.
|
| CloseDoor() |
public static bool CloseDoor(int i, int j, [bool forced = false])
{
}
Close a door at the specified location
|
| CreateNewWorld() |
public static void CreateNewWorld()
{
}
Creation of a new world.
|
| dropMeteor() |
public static void dropMeteor()
{
}
Causes a meteor to spawn in a random location. May not work if there are too many meteor tiles already in the world.
|
| DungeonEnt() |
public static void DungeonEnt(
int i,
int j,
int tileType,
int wallType
)
{
}
Dungeon Entrance Generation
|
| DungeonHalls() |
public static void DungeonHalls(
int i,
int j,
int tileType,
int wallType,
[bool forceX = false])
{
}
Dungeon Hall Generation
|
| DungeonRoom() |
public static void DungeonRoom(
int i,
int j,
int tileType,
int wallType
)
{
}
Dungeon Room Generation
|
| DungeonStairs() |
public static void DungeonStairs(
int i,
int j,
int tileType,
int wallType
)
{
}
Dungeon Stairs Generation (at entrance, where the duneon guardian spawn when you try to enter the dungeon without defeating Skeletron)
|
| EmptyTileCheck() |
public static bool EmptyTileCheck(
int startX,
int endX,
int startY,
int endY,
[int ignoreStyle = -1]
)
{
}
Description goes here
|
| EveryTileFrame() |
public static void EveryTileFrame()
{
}
Description goes here
|
| FloatingIsland() |
public static void FloatingIsland(int i, int j)
{
}
Generate Floating Islands?
|
| generateWorld() |
public static void generateWorld([int seed = -1])
{
}
World Generation Code, called with CreateNewWorldCallBack(), Calls every other world generation-related method.
|
| GrowAlch() |
public static void GrowAlch(int x, int y)
{
}
Grows an alchemical herb at the specified location
|
| GrowCactus() |
public static void GrowCactus(int i, int j)
{
}
Generate a Cactus at the specified location?
|
| GrowEpicTree() |
public static bool GrowEpicTree(int i, int y)
{
}
Big Tree Generation at the specified location (~30 tiles height?)
|
| GrowShroom() |
public static void GrowShroom(int i, int y)
{
}
Generate Mushrooms at the specified location
|
| GrowTree() |
public static void GrowTree(int i, int y)
{
}
Generate a Tree at the specified location
|
| HellHouse() |
public static void HellHouse(
int i,
int j,
[byte type = 76],
[byte wall = 13]
)
{
}
Generate Hellhouses, specified location + tile & wall type
|
| HellRoom() |
public static void HellRoom(
int i,
int j,
int width,
int height,
[byte type = 76],
[byte wall = 13]
)
{
}
Generate Hellhouses, specified location + tile & wall type, copy of HellHouse()?
|
| IslandHouse() |
public static void IslandHouse(int i, int j)
{
}
Generate Floating Island Houses
|
| JungleRunner() |
public static void JungleRunner(int i, int j)
{
}
Jungle generator (sets position of jungle)
|
| KillTile() |
public static void KillTile(
int i,
int j,
[bool fail = false],
[bool effectOnly = false],
[bool noItem = false]
)
{
}
Delete a tile?
|
| KillWall() |
public static void KillWall(int i, int j, [bool fail = false])
{
}
Delete a wall?
|
| Lakinater() |
public static void Lakinater(int i, int j)
{
}
Generate Lakes
|
| loadWorld() |
public static void loadWorld()
{
}
Open a world
|
| MakeDungeon() |
public static void MakeDungeon(
int x,
int y,
[int tileType = 41],
[int wallType = 7]
)
{
}
Method that calls every other Dungeon Generation-related method, at the specified location and with the specified tile & wall types
|
| meteor() |
public static bool meteor(int i, int j)
{
}
Called by DropMeteor()
|
| Mountinater() |
public static void Mountinater(int i, int j)
{
}
Generate Mountains
|
| MudWallRunner() |
public static void MudWallRunner(int i, int j)
{
}
Generate Mud Walls (jungle)
|
Static Methods N-Z
Edit
| Method Name | Description |
|---|---|
| OpenDoor() |
public static bool OpenDoor(int i, int j, int direction)
{
}
Open a door at the specified location & direction
|
| Place1x2() |
public static void Place1x2(int x, int y, int type, int style)
{
}
Description goes here
|
| Place1x2Top() |
public static void Place1x2Top(int x, int y, int type)
{
}
Description goes here
|
| Place1xX() |
public static void Place1xX(
int x,
int y,
int type,
[int style = 0]
)
{
}
Description goes here
|
| Place2x1() |
public static void Place2x1(int x, int y, int type)
{
}
Description goes here
|
| Place2x2() |
public static void Place2x2(int x, int superY, int type)
{
}
Description goes here
|
| Place2xX() |
public static void Place2xX(
int x,
int y,
int type,
[int style = 0]
)
{
}
Description goes here
|
| Place3x2() |
public static void Place3x2(int x, int y, int type)
{
}
Description goes here
|
| Place3x3() |
public static void Place3x3(int x, int y, int type)
{
}
Description goes here
|
| Place3x4() |
public static void Place3x4(int x, int y, int type)
{
}
Description goes here
|
| Place4x2() |
public static void Place4x2(
int x,
int y,
int type,
[int direction = -1]
)
{
}
Description goes here
|
| PlaceAlch() |
public static bool PlaceAlch(int x, int y, int style)
{
}
Description goes here
|
public static void PlaceBanner(
int x,
int y,
int type,
[int style = 0]
)
{
}
Description goes here
| |
| PlaceChest() |
public static int PlaceChest(
int x,
int y,
[int type = 21],
[bool notNearOtherChests = false],
[int style = 0]
)
{
}
Create a chest by placing one?
|
| PlaceDoor() |
public static bool PlaceDoor(int i, int j, int type)
{
}
Description goes here
|
| PlaceOnTable1x1() |
public static void PlaceOnTable1x1(
int x,
int y,
int type,
[int style = 0]
)
{
}
Description goes here
|
| PlacePot() |
public static bool PlacePot(int x, int y, [int type = 28])
{
}
place a pot at the specified location?
|
| PlaceSign() |
public static bool PlaceSign(int x, int y, int type)
{
}
place a sign at the specified location (tile?)
|
| PlaceSunflower() |
public static void PlaceSunflower(
int x,
int y,
[int type = 27]
)
{
}
place a sunflower at the specifed location?
|
| PlaceTile() |
public static bool PlaceTile(
int i,
int j,
int type,
[bool mute = false],
[bool forced = false],
[int plr = -1],
[int style = 0]
)
{
}
Place a tile
|
| PlaceWall() |
public static void PlaceWall(
int i,
int j,
int type,
[bool mute = false]
)
{
}
Place a wall
|
| PlantAlch() |
public static void PlantAlch()
{
}
Description goes here
|
| PlantCactus() |
public static void PlantCactus(int i, int j)
{
}
Generate Cacti
|
| PlantCheck() |
public static void PlantCheck(int i, int j)
{
}
Description goes here
|
| PlayerLOS() |
public static bool PlayerLOS(int x, int y)
{
}
Description goes here
|
| playWorld() |
public static void playWorld()
{
}
play a world, calls playWorldCallBack()
|
| playWorldCallBack() |
public static void playWorldCallBack(object threadContext)
{
}
what-to-do if play a world is called
|
| QuickFindHome() |
public static void QuickFindHome(int npc)
{
}
Lets Town NPC's find homes by themselves
|
| RangeFrame() |
public static void RangeFrame(
int startX,
int startY,
int endX,
int endY
)
{
}
Description goes here
|
| RoomNeeds() |
public static bool RoomNeeds(int npcType)
{
}
Is every condition met for the house to be suitable?
|
| saveAndPlay() |
public static void saveAndPlay()
{
}
save the world and play it, calls saveAndPlayCallBack()
|
| saveAndPlayCallBack() |
public static void saveAndPlayCallBack(object threadContext)
{
}
what to do if saveAndPlay() is called.
|
| SaveAndQuit() |
public static void SaveAndQuit()
{
}
Called when you stop playing (single player), calls SaveAndQuitCallBack() .
|
| SaveAndQuitCallBack() |
public static void SaveAndQuitCallBack(object threadContext)
{
}
what to do if SaveAndQuit() is called.
|
| saveToonWhilePlaying() |
public static void saveToonWhilePlaying()
{
}
auto player save? calls saveToonWhilePlayingCallBack().
|
| saveToonWhilePlayingCallBack() |
public static void saveToonWhilePlayingCallBack(
object threadContext
)
{
}
what to do if saveToonWhilePlaying() is called.
|
| saveWorld() |
public static void saveWorld([bool resetTime = false])
{
}
Description goes here
|
| ScoreRoom() |
public static void ScoreRoom([int ignoreNPC = -1])
{
}
Description goes here
|
| SectionTileFrame() |
public static void SectionTileFrame(
int startX,
int startY,
int endX,
int endY
)
{
}
Description goes here
|
| serverLoadWorld() |
public static void serverLoadWorld()
{
}
Let the world be loaded by a server, calls serverLoadWorldCallBack()
|
| serverLoadWorldCallBack() |
public static void serverLoadWorldCallBack(
object threadContext
)
{
}
what to do if serverLoadWorld() is called
|
| setWorldSize() |
public static void setWorldSize()
{
}
set the world size
|
| ShroomPatch() |
public static void ShroomPatch(int i, int j)
{
}
Generate mushroom patches
|
| SpawnNPC() |
public static void SpawnNPC(int x, int y)
{
}
spawn a NPC at the specified location ( NOT the NPC.SpawnNPC() bool)
|
| SpreadGrass() |
public static void SpreadGrass(
int i,
int j,
[int dirt = 0],
[int grass = 2],
[bool repeat = true]
)
{
}
Generate grass at the specified location
|
| SquareTileFrame() |
public static void SquareTileFrame(
int i,
int j,
[bool resetFrame = true]
)
{
}
Description goes here
|
| SquareWallFrame() |
public static void SquareWallFrame(
int i,
int j,
[bool resetFrame = true]
)
{
}
Description goes here
|
| StartRoomCheck() |
public static bool StartRoomCheck(int x, int y)
{
}
Calls every other housing-checking method.
|
| TileFrame() |
public static void TileFrame(
int i,
int j,
[bool resetFrame = false],
[bool noBreak = false]
)
{
}
Description goes here
|
| TileRunner() |
public static void TileRunner(
int i,
int j,
double strength,
int steps,
int type,
[bool addTile = false],
[float speedX = 0f],
[float speedX = 0f],
[float speedY = 0f],
[bool overRide = true]
)
{
}
Lets the tile be generated (world generation only)
|
| UpdateWorld() |
public static void UpdateWorld()
{
}
Description goes here
|
| WallFrame() |
public static void WallFrame(
int i,
int j,
[bool resetFrame = false]
)
{
}
Description goes here
|
| WaterCheck() |
public static void WaterCheck()
{
}
Description goes here
|
| worldGenCallBack() |
public static void worldGenCallBack(object threadContext)
{
}
what to do if generateWorld() is called (save it and spawn the player)
|
Notes
Edit
None yet
| Classes in Terraria |
|---|
|
Chest | Cloud | Collision | Dust | Gore | Item | Lighting | Liquid | Main | NPC | Player | Projectile | Recipe | Sign | Star | WorldGen |

Added by