Skip to content

Class "Room"⚓︎

Functions⚓︎

Check·Line ()⚓︎

boolean CheckLine ( Vector Pos1, Vector Pos2, LinecheckMode Mode, int GridPathThreshold, boolean IgnoreWalls, boolean IgnoreCrushable )⚓︎

returns true if there is a direct line of sight between Pos1 and Pos2 returns false if the line is obstructed

Notes

Linecheck Modes:

0 : makes the line check collide with anything that impedes ground movement

1 : is a cheaper version of 0, but is not as reliable

2 : is used for explosions, it only collides with walls and indestructible blocks

3 : is a line check that only collides with obstacles that can block projectiles


Damage·Grid ()⚓︎

boolean DamageGrid ( int Index, int Damage )⚓︎

Damage Grid Entities currently this concerns GridEntityPoop and GridEntity_Fire returns true if damageable entity was found (and possibly damaged) return false if not used by tears, bombs, some NPCs, etc


Destroy·Grid ()⚓︎

boolean DestroyGrid ( int Index, boolean Immediate )⚓︎

calls DamageGrid internally to damage Poop/Fire removes rocks and opens secret doors returns true if something was destroyed returns false if not used for explosions mostly


Emit·Blood·From·Walls ()⚓︎

void EmitBloodFromWalls ( int Duration, int Count )⚓︎


Find·Free·Pickup·Spawn·Position ()⚓︎

Vector FindFreePickupSpawnPosition ( Vector Pos, float InitialStep, boolean AvoidActiveEntities )⚓︎

Starting from Pos, will try to find a free spawn position where a newly spawned pickup item will not collide with already spawned pickup items, or solid grid elements such as rocks, or pits The returned position will be aligned to the grid. If no free position is found, the original position (aligned to the grid) is returned.


Find·Free·Tile·Position ()⚓︎

Vector FindFreeTilePosition ( Vector Pos, float DistanceThreshold )⚓︎

Finds the nearest free tile based on position Stops immediately if the tile sampled has a squared distance less than DistanceThresholdSQ


Get·Alive·Bosses·Count ()⚓︎

int GetAliveBossesCount ( )⚓︎


Get·Alive·Enemies·Count ()⚓︎

int GetAliveEnemiesCount ( )⚓︎


Get·Award·Seed ()⚓︎

int GetAwardSeed ( )⚓︎


Get·Backdrop·Type ()⚓︎

int GetBackdropType ( )⚓︎

Returns the BackdropType (Background) of the current room.

BackdropTypes (corresponds to ids in backdrops.xml)
ID Backdrop
1 Basement
2 Cellar
3 Burning Basement
4 Caves
5 Catacombs
6 Drowned Caves
7 Depths
8 Necropolis
9 Dank Depths
10 Womb
11 Utero
12 Scarred Womb
13 Blue Womb (Hush)
14 Sheol
15 Cathedral
16 Dark Room
17 Chest
18 Mega Satan
19 Library
20 Shop
21 Isaacs Room
22 Barren Room
23 Secret Room
24 Dice Room
25 Arcade
26 Error Room
27 Blue Secret
28 Ultra Greed Shop

Get·Boss·ID ()⚓︎

BossId GetBossID ( )⚓︎

This will return the subtype of the current room, since this value is used to determine the boss-portrait to display when entering.


Get·Bottom·Right·Pos ()⚓︎

Vector GetBottomRightPos ( )⚓︎

returns bottom right position inside of walls


Get·Broken·Watch·State ()⚓︎

int GetBrokenWatchState ( )⚓︎


Get·Center·Pos ()⚓︎

Vector GetCenterPos ( )⚓︎

returns the room center position


Get·Clamped·Grid·Index ()⚓︎

int GetClampedGridIndex ( Vector Position )⚓︎

converts float position (x,y) to grid index (similar to ingrid) clamps the values if out of bounds


Get·Clamped·Position ()⚓︎

Vector GetClampedPosition ( Vector Pos, float Margin )⚓︎

returns Pos clamped to room borders inside of walls


Get·Decoration·Seed ()⚓︎

int GetDecorationSeed ( )⚓︎


Get·Delirium·Distance ()⚓︎

int GetDeliriumDistance ( )⚓︎


Get·Devil·Room·Chance ()⚓︎

float GetDevilRoomChance ( )⚓︎


Get·Door ()⚓︎

GridEntityDoor GetDoor ( DoorSlot Slot )⚓︎

Returns the GridEntityDoor at the given DoorSlot position. Returns nil if no Door is located there.


Get·Door·Slot·Position ()⚓︎

Vector GetDoorSlotPosition ( DoorSlot Slot )⚓︎


Get·Dungeon·Rock·Idx ()⚓︎

int GetDungeonRockIdx ( )⚓︎


Get·Entities ()⚓︎

EntityList GetEntities ( )⚓︎


Get·Frame·Count ()⚓︎

int GetFrameCount ( )⚓︎


Get·Grid·Collision ()⚓︎

GridCollisionClass GetGridCollision ( int GridIndex )⚓︎

Returns the GridCollisionClass of the grid entity at this grid index.


Get·Grid·Collision·At·Pos ()⚓︎

GridCollisionClass GetGridCollisionAtPos ( Vector Pos )⚓︎

Returns the GridCollisionClass of the grid entity at this position in the room.


Get·Grid·Entity ()⚓︎

GridEntity GetGridEntity ( int Index )⚓︎

Returns the GridEntity at this grid index. Returns nil, when no GridEntity is found.


Get·Grid·Entity·From·Pos ()⚓︎

GridEntity GetGridEntityFromPos ( Vector Position )⚓︎

Returns the GridEntity at this position in the room. Returns nil, when no GridEntity is found.


Get·Grid·Height ()⚓︎

int GetGridHeight ( )⚓︎


Get·Grid·Index ()⚓︎

int GetGridIndex ( Vector Position )⚓︎

converts float position (x,y) to grid index returns -1 for invalid index


Get·Grid·Path ()⚓︎

int GetGridPath ( int Index )⚓︎


Get·Grid·Path·From·Pos ()⚓︎

int GetGridPathFromPos ( int Index )⚓︎


Get·Grid·Position ()⚓︎

Vector GetGridPosition ( int GridIndex )⚓︎

converts grid index to float (x,y) position undefined behaviour for invalid index


Get·Grid·Size ()⚓︎

int GetGridSize ( )⚓︎


Get·Grid·Width ()⚓︎

int GetGridWidth ( )⚓︎


Get·Laser·Target ()⚓︎

Vector GetLaserTarget ( Vector Pos, Vector Dir )⚓︎

returns the hit position for a laser beam (Technology, Robo-Baby) usually, the first poop, fire, rock, TNT, or wall encountered on a straight line


Get·Lighting·Alpha ()⚓︎

float GetLightingAlpha ( )⚓︎


Get·LRoom·Area·Desc ()⚓︎

LRoomAreaDesc GetLRoomAreaDesc ( )⚓︎


Get·LRoom·Tile·Desc ()⚓︎

LRoomTileDesc GetLRoomTileDesc ( )⚓︎


Get·Next·Shockwave·Id ()⚓︎

int GetNextShockwaveId ( )⚓︎


Get·Random·Position ()⚓︎

Vector GetRandomPosition ( float Margin )⚓︎

returns random non tile aligned position


Get·Random·Tile·Index ()⚓︎

int GetRandomTileIndex ( int Seed )⚓︎


Get·Red·Heart·Damage ()⚓︎

boolean GetRedHeartDamage ( )⚓︎


Get·Render·Scroll·Offset ()⚓︎

const Vector GetRenderScrollOffset ( )⚓︎

The camera scroll offset and screen shake offsets are both represented here.


Get·Render·Surface·Top·Left ()⚓︎

const Vector GetRenderSurfaceTopLeft ( )⚓︎

The position the floor and wall textures will be rendered at.


Get·Room·Config·Stage ()⚓︎

int GetRoomConfigStage ( )⚓︎

Returns the stage the room was designed for.

Stage IDs (corresponds to ids in stages.xml)
ID Backdrop Notes
0 Special Rooms
1 Basement
2 Cellar
3 Burning Basement
4 Caves
5 Catacombs
6 Drowned Caves
7 Depths
8 Necropolis
9 Dank Depths
10 Womb
11 Utero
12 Scarred Womb
13 Blue Womb (Hush)
14 Sheol
15 Cathedral
16 Dark Room
17 Chest
18 Special Rooms (Greed Mode)
19 Basement (Greed Mode) Normally inaccessible. In greed mode, the main room is based off of the Special Rooms (Greed Mode) file.
20 Caves (Greed Mode) Normally inaccessible unless in the first variant of unused stage 13. In greed mode, the main room is based off of the Special Rooms (Greed Mode) file.
21 Depths (Greed Mode) Normally inaccessible unless in the second variant of unused stage 13. In greed mode, the main room is based off of the Special Rooms (Greed Mode) file.
22 Womb (Greed Mode) Normally inaccessible unless in the third variant of unused stage 13. In greed mode, the main room is based off of the Special Rooms (Greed Mode) file.
23 Sheol (Greed Mode) Normally inaccessible. In greed mode, the main room is based off of the Special Rooms (Greed Mode) file.
24 The Shop (Greed Mode) Normally inaccessible. In greed mode, the main room is based off of the Special Rooms (Greed Mode) file.
25 Ultra Greed (Greed Mode)
26 The Void Normally inaccessible. This stage uses rooms from other stages, and will return their respective values.

Get·Room·Shape ()⚓︎

RoomShape GetRoomShape ( )⚓︎


Get·Second·Boss·ID ()⚓︎

BossId GetSecondBossID ( )⚓︎


Get·Seeded·Collectible ()⚓︎

CollectibleType GetSeededCollectible ( int Seed )⚓︎


Get·Shop·Level ()⚓︎

int GetShopLevel ( )⚓︎


Get·Spawn·Seed ()⚓︎

int GetSpawnSeed ( )⚓︎


Get·Tinted·Rock·Idx ()⚓︎

int GetTintedRockIdx ( )⚓︎


Get·Top·Left·Pos ()⚓︎

Vector GetTopLeftPos ( )⚓︎

returns top left position inside of walls


Get·Type ()⚓︎

RoomType GetType ( )⚓︎


Has·Slow·Down ()⚓︎

boolean HasSlowDown ( )⚓︎


Has·Trigger·Pressure·Plates ()⚓︎

boolean HasTriggerPressurePlates ( )⚓︎


Has·Water ()⚓︎

boolean HasWater ( )⚓︎


Has·Water·Pits ()⚓︎

boolean HasWaterPits ( )⚓︎


Is·Ambush·Active ()⚓︎

boolean IsAmbushActive ( )⚓︎


Is·Ambush·Done ()⚓︎

boolean IsAmbushDone ( )⚓︎


Is·Clear ()⚓︎

boolean IsClear ( )⚓︎


Is·Current·Room·Last·Boss ()⚓︎

boolean IsCurrentRoomLastBoss ( )⚓︎


Is·Door·Slot·Allowed ()⚓︎

boolean IsDoorSlotAllowed ( DoorSlot Slot )⚓︎

Returns whether this room design may have a door at a given position, disregarding whether those doors exist.


Is·First·Enemy·Dead ()⚓︎

boolean IsFirstEnemyDead ( )⚓︎


Is·First·Visit ()⚓︎

boolean IsFirstVisit ( )⚓︎


Is·Initialized ()⚓︎

boolean IsInitialized ( )⚓︎


Is·LShaped·Room ()⚓︎

boolean IsLShapedRoom ( )⚓︎


Is·Position·In·Room ()⚓︎

boolean IsPositionInRoom ( Vector Pos, float Margin )⚓︎


Is·Sacrifice·Done ()⚓︎

boolean IsSacrificeDone ( )⚓︎


Keep·Doors·Closed ()⚓︎

void KeepDoorsClosed ( )⚓︎


Mama·Mega·Explossion ()⚓︎

void MamaMegaExplossion ( )⚓︎


Play·Music ()⚓︎

void PlayMusic ( )⚓︎


Remove·Door ()⚓︎

void RemoveDoor ( DoorSlot Slot )⚓︎


Remove·Grid·Entity ()⚓︎

void RemoveGridEntity ( int GridIndex, int PathTrail, boolean KeepDecoration )⚓︎


Render ()⚓︎

void Render ( )⚓︎


Respawn·Enemies ()⚓︎

void RespawnEnemies ( )⚓︎

for D7 collectible


Screen·Wrap·Position ()⚓︎

Vector ScreenWrapPosition ( Vector Pos, float Margin )⚓︎

Returns Pos, screen-wrapped (if it is just outside the room on the right it will be moved to the left side of the room, etc)

Notes

This only wraps the point once, so if it has crossed multiple wrapping planes it will only wrap on the one it's closest to. For wrapping a position that has crossed two planes (outside a room in the top left for instance) call this function iteratively.


Set·Ambush·Done ()⚓︎

void SetAmbushDone ( boolean Value )⚓︎


Set·Broken·Watch·State ()⚓︎

void SetBrokenWatchState ( int State )⚓︎


Set·Card·Against·Humanity ()⚓︎

void SetCardAgainstHumanity ( )⚓︎


Set·Clear ()⚓︎

void SetClear ( boolean Clear )⚓︎

Needed for angel room, so the clear flag can be set to false when the angel spawns


Set·First·Enemy·Dead ()⚓︎

void SetFirstEnemyDead ( boolean Value )⚓︎


Set·Floor·Color ()⚓︎

void SetFloorColor ( Color FloorColor )⚓︎

Allows you to apply a color modifier to the floor texture of the current room.

Example Code

This code changes the floorcolor to red.

1
Game():GetRoom():SetFloorColor(Color(1,1,1,1,255,0,0))


Set·Grid·Path ()⚓︎

boolean SetGridPath ( int Index, int Value )⚓︎


Set·Red·Heart·Damage ()⚓︎

void SetRedHeartDamage ( )⚓︎


Set·Sacrifice·Done ()⚓︎

void SetSacrificeDone ( boolean Done )⚓︎


Set·Shockwave·Param ()⚓︎

void SetShockwaveParam ( int ShockwaveId, ShockwaveParams Params )⚓︎


Set·Slow·Down ()⚓︎

void SetSlowDown ( int Duration )⚓︎


Set·Wall·Color ()⚓︎

void SetWallColor ( Color WallColor )⚓︎

Allows you to apply a color modifier to the wall texture of the current room.

Example Code

This code changes the wallcolor to red.

1
Game():GetRoom():SetWallColor(Color(1,1,1,1,255,0,0))


Shop·Reshuffle ()⚓︎

void ShopReshuffle ( boolean KeepCollectibleIdx, boolean ReselectSaleItem )⚓︎


Shop·Restock·Full ()⚓︎

void ShopRestockFull ( )⚓︎


Shop·Restock·Partial ()⚓︎

void ShopRestockPartial ( )⚓︎


Spawn·Clear·Award ()⚓︎

void SpawnClearAward ( )⚓︎


Spawn·Grid·Entity ()⚓︎

boolean SpawnGridEntity ( int GridIndex, GridEntityType Type, int Variant, int Seed, int VarData )⚓︎


Try·Make·Bridge ()⚓︎

boolean TryMakeBridge ( GridEntity pit )⚓︎


Try·Place·Ladder ()⚓︎

void TryPlaceLadder ( Vector PlayerPos, Vector PlayerVelocity, Entity Ladder )⚓︎


Try·Spawn·Blue·Womb·Door ()⚓︎

boolean TrySpawnBlueWombDoor ( boolean FirstTime, boolean IgnoreTime )⚓︎


Try·Spawn·Boss·Rush·Door ()⚓︎

boolean TrySpawnBossRushDoor ( boolean IgnoreTime )⚓︎


Try·Spawn·Devil·Room·Door ()⚓︎

boolean TrySpawnDevilRoomDoor ( boolean Animate )⚓︎


Try·Spawn·Mega·Satan·Room·Door ()⚓︎

boolean TrySpawnMegaSatanRoomDoor ( )⚓︎


Try·Spawn·The·Void·Door ()⚓︎

boolean TrySpawnTheVoidDoor ( )⚓︎


Turn·Gold ()⚓︎

void TurnGold ( )⚓︎


Update ()⚓︎

void Update ( )⚓︎

Updates the current room.

Notes

Calling this function is NOT needed to apply changes! This function is pretty useless


World·To·Screen·Position ()⚓︎

Vector WorldToScreenPosition ( Vector WorldPos )⚓︎

Converts an entity position to one that can be used to render to the screen.



Last update: June 9, 2021