Global Class "Isaac"⚓︎
Modified Functions⚓︎
FindByType ()⚓︎
Entity[] FindByType ( EntityType Type, int Variant = -1, int SubType = -1, boolean Cache = false, boolean IgnoreFriendly = false )⚓︎
Same as vanilla, but much faster.
FindInRadius ()⚓︎
Entity[] FindInRadius ( Vector Position, float Radius, int Partitions = 0xFFFFFFFF )⚓︎
Same as in vanilla, but much faster and with fixed search for effects.
GetRoomEntities ()⚓︎
Entity[] GetRoomEntities ( )⚓︎
Same as vanilla, but much faster.
Functions⚓︎
AllMarksFilled ()⚓︎
int AllMarksFilled ( PlayerType Character)⚓︎
Checks if a given character has completed all marks and returns an integer representing the highest difficulty it was accomplished in.
Note
The difficulties are as follows:
0
- None1
- Normal2
- Hard
AllTaintedCompletion ()⚓︎
int AllTaintedCompletion ( PlayerType Character, TaintedMarksGroup Group)⚓︎
Checks if a given character has completed all the tainted unlock-related marks and returns an integer representing the highest difficulty it was accomplished in.
Note
The difficulties are as follows:
0
- None1
- Normal2
- Hard
CanStartTrueCoop ()⚓︎
boolean CanStartTrueCoop ( )⚓︎
CenterCursor ()⚓︎
void CenterCursor ( )⚓︎
Moves the windows mouse cursor to the center of the game's window. This is incredibly niche but useful if you want to use cursor controls for anything fancy and have full control over it. It wont move the cursor if Isaac.exe becomes out of focus.
Note
Take in mind the screen center is NOT the center of the room necessarily, it's just the center of the game's window(center of the actual screen if you are on fullscreen).
ClearBossHazards ()⚓︎
void ClearBossHazards ( boolean IgnoreNPCs = false )⚓︎
Kills all projectiles. Kills all non-friendly NPCs capable of keeping doors closed as well if IgnoreNPCs
is false.
ClearChallenge ()⚓︎
void ClearChallenge ( int challengeid)⚓︎
Sets the challenge of the corresponding challengeid
to completed.
ClearCompletionMarks ()⚓︎
void ClearCompletionMarks ( PlayerType Character)⚓︎
Deletes all completion marks for a given character.
CreateTimer ()⚓︎
EntityEffect CreateTimer ( function Function, int Interval, int Times, boolean Persistent )⚓︎
Spawns a timer EntityEffect. This entity will starting running Function
function after Interval
frames, and will repeat it Times
amount of times. Persistent
controls whether or not this timer "dies" in the current room, or persists across rooms.
Timer behavior
This timer is called every game update. This means the timer only takes into consideration frames in which the game is actively running, not paused, and uses update frames for its Delay parameter (30 frames per second).
If your use case requires that a timer takes paused time into account, stick with a custom timer running on a RENDER callback.
CreateWeapon ()⚓︎
Weapon CreateWeapon ( WeaponType Type, Entity Owner )⚓︎
Creates and returns a Weapon object. It is not automatically useable by owner
and Isaac.SetWeaponType
must be used in tandem.
DestroyWeapon ()⚓︎
void DestroyWeapon ( Weapon Weapon )⚓︎
Destroys the provided Weapon object.
DrawLine ()⚓︎
void DrawLine ( Vector StartPos, Vector EndPos, KColor StartColor, KColor EndColor, int Thickness )⚓︎
Draws a line between the two given positions this render frame.
DrawQuad ()⚓︎
void DrawQuad ( Vector TopLeftPos, Vector TopRightPos, Vector BottomLeftPos, Vector BottomRightPos, KColor Color, int Thickness )⚓︎
Draws a line between the two given positions this render frame. Internally the game uses its own struct for this, DestinationQuad, but I haven't gotten to adding that to Lua yet
FillCompletionMarks ()⚓︎
void FillCompletionMarks ( PlayerType Character)⚓︎
Completes all completion marks for a given character.
FindInCapsule ()⚓︎
Entity[] FindInCapsule ( Capsule Capsule, EntityPartitions Partitions = -1 )⚓︎
Return entities inside of given capsule, filtered by partitions mask.
FindTargetPit ()⚓︎
int FindTargetPit ( Vector Position, Vector TargetPosition, int PitIndex = -1 )⚓︎
GetAchievementIdByName ()⚓︎
int GetAchievementIdByName ( string Name )⚓︎
Gets the Achievement ID By Name.
GetAxisAlignedUnitVectorFromDir ()⚓︎
Vector GetAxisAlignedUnitVectorFromDir ( Direction Direction = -1 )⚓︎
GetBackdropIdByName ()⚓︎
int GetBackdropIdByName ( string BackdropName )⚓︎
GetBossColorIdxByName ()⚓︎
int GetBossColorIdxByName ( string Name )⚓︎
Gets the boss color idx By Name, the idx is usually the subtype the boss needs to become the desired color. Granted, you actually need to give your color entry a name on the xml for this to work (suffix wont work usually, since its not mandatory).
GetClipboard ()⚓︎
string GetClipboard ( )⚓︎
Gets the contents of the clipboard as long as they are in text form, otherwise it will just return nil.
GetCollectibleSpawnPosition ()⚓︎
Vector GetCollectibleSpawnPosition ( Vector Position )⚓︎
GetCompletionMark ()⚓︎
int GetCompletionMark ( PlayerType Character, CompletionType Mark)⚓︎
Gets a completion mark value for a specific character, value from 0
to 2
(0 = not accomplished, 1 = normal, 2 = hard).
GetCompletionMarks ()⚓︎
table GetCompletionMarks ( PlayerType Character)⚓︎
Returns a table containing all the marks for the character.
Table structure & usage
- The table has the following fields:
- PlayerType: containing the PlayerType associated to the marks
- MomsHeart: value of Difficulty 0-2 indicating the completion
- Isaac: value of Difficulty 0-2 indicating the completion
- Satan: value of Difficulty 0-2 indicating the completion
- BossRush: value of Difficulty 0-2 indicating the completion
- BlueBaby: value of Difficulty 0-2 indicating the completion
- Lamb: value of Difficulty 0-2 indicating the completion
- MegaSatan: value of Difficulty 0-2 indicating the completion
- UltraGreed: value of Difficulty 0-2 indicating the completion
- Hush: value of Difficulty 0-2 indicating the completion
- UltraGreedier: Mostly redundant with UltraGreed when it has a value of 2, no need to set it
- Delirium: value of Difficulty 0-2 indicating the completion
- Mother: value of Difficulty 0-2 indicating the completion
- Beast: value of Difficulty 0-2 indicating the completion
1 2 3 4 5 6 7 8 9 10
local marks = Isaac.GetCompletionMarks(0) if (marks.MomsHeart > 0) then print("got mom") end if (marks.Lamb >= 2) then print("GOATED ON H4RD") end if (Isaac.GetCompletionMarks(0).Delirium > 0) then --doing it the lazy way, fitting deliriums theme print("Got Deli") end
GetCurrentStageConfigId ()⚓︎
StbType GetCurrentStageConfigId ( )⚓︎
Gets the current stageconfigId/stbType, or whatever you wanna call the id of the stages.xml, for the current stage.
GetCursorSprite ()⚓︎
Sprite GetCursorSprite ( )⚓︎
Returns the cursor sprite that is rendered when Options.MouseControl
is set to true.
GetCutsceneIdByName ()⚓︎
table GetCutsceneIdByName ( string Name )⚓︎
Gets the Cutscene ID By Name.
GetDwmWindowAttribute ()⚓︎
DwmWindowAttribute GetDwmWindowAttribute ( )⚓︎
GetEntitySubTypeByName ()⚓︎
int GetEntitySubTypeByName ( string Name )⚓︎
Gets the entity SubType by entity name.
GetGiantBookIdByName ()⚓︎
int GetGiantBookIdByName ( string Name )⚓︎
Gets a GiantBook Id by name. For vanilla giantbooks, the png filename, from the gfx xml attribute, is used as the giantbook name.
GetLoadedModules ()⚓︎
table GetLoadedModules ( )⚓︎
Returns a key - value table containing all loaded script files, where the key is the name or path of a given script file, and the value the return value of that file after loading. (In most cases its true or a table)
GetLocalizedString ()⚓︎
string GetLocalizedString ( string Category, string Key, int Language )⚓︎
string GetLocalizedString ( string Category, string Key, string LanguageCode )⚓︎
Returns the translation string associated with the given key in the given category. The translation is given in the language ID/language code given as parameter.
GetModChallengeClearCount ()⚓︎
int GetModChallengeClearCount ( int challengeid )⚓︎
Returns the number of times a custom challenge was cleared. It resets if its ever set as not Done.
GetNullItemIdByName ()⚓︎
int GetNullItemIdByName ( string NullItemName )⚓︎
GetPersistentGameData ()⚓︎
PersistentGameData GetPersistentGameData ( )⚓︎
GetPoolIdByName ()⚓︎
ItemPoolType GetPoolIdByName ( string PoolName )⚓︎
Returns the ID of a given custom pool. Returns -1
if the pool is not found.
GetRenderPosition ()⚓︎
Vector GetRenderPosition ( Vector Position, boolean Scale = true )⚓︎
GetString ()⚓︎
string GetString ( string Category, string Key )⚓︎
Returns the translation string associated with the given key in the given category. The translation is given in the currently selected language.
GetWindowTitle ()⚓︎
string GetWindowTitle ( )⚓︎
Returns the appended text on the game's window title.
IsChallengeDone ()⚓︎
boolean IsChallengeDone ( int challengeid )⚓︎
Returns true
if the challenge of the corresponding challengeid is completed.
IsInGame ()⚓︎
boolean IsInGame ( )⚓︎
Returns true
if Game
is non-nil and the current state is correct.
LevelGeneratorEntry ()⚓︎
LevelGeneratorEntry LevelGeneratorEntry ( )⚓︎
Creates a new blank LevelGeneratorEntry object.
MarkChallengeAsNotDone ()⚓︎
void MarkChallengeAsNotDone ( int challengeid )⚓︎
Sets the challenge as not done.
PlayCutscene ()⚓︎
int PlayCutscene ( int ID, boolean ClearGameState = false )⚓︎
Plays the Cutscene of the provided ID. Use Isaac.GetCutsceneIdByName to get the IDs, or the enum for the vanilla ones if you prefer.
SetClipboard ()⚓︎
boolean SetClipboard ( string ClipboardData )⚓︎
Sets the contents of the clipboard to the provided string.
SetCompletionMark ()⚓︎
void SetCompletionMark ( PlayerType Character, CompletionType Mark, int Value)⚓︎
Sets a completion mark of a character to match a specific value from 0
to 2
(0 = not accomplished, 1 = normal, 2 = hard).
SetCompletionMarks ()⚓︎
void SetCompletionMarks ( table Marks )⚓︎
Sets the completion marks of a character to match an input table. Requires a table containing all the marks for the character, getting it from GetCompletionMarks is advised for convenience.
Table structure & usage
- The table needs the following fields:
- PlayerType: containing the PlayerType asociated to the marks
- MomsHeart: value of Difficulty 0-2 indicating the completion
- Isaac: value of Difficulty 0-2 indicating the completion
- Satan: value of Difficulty 0-2 indicating the completion
- BossRush: value of Difficulty 0-2 indicating the completion
- BlueBaby: value of Difficulty 0-2 indicating the completion
- Lamb: value of Difficulty 0-2 indicating the completion
- MegaSatan: value of Difficulty 0-2 indicating the completion
- UltraGreed: value of Difficulty 0-2 indicating the completion
- Hush: value of Difficulty 0-2 indicating the completion
- UltraGreedier: Mostly redundant with UltraGreed when it has a value of 2, no need to set it
- Delirium: value of Difficulty 0-2 indicating the completion
- Mother: value of Difficulty 0-2 indicating the completion
- Beast: value of Difficulty 0-2 indicating the completion
1 2 3 4 5
local marks = Isaac.GetCompletionMarks(0) --getting the current table marks.MomsHeart = 2 --Isaac now will have the hard mark on MHeart marks.Satan = 1 --Isaac will now have the normal mark on Satan marks.BlueBaby = 0 --Removes the BlueBaby Mark if its present Isaac.SetCompletionMarks(marks) --Impacts the changes on the player
SetCurrentFloorBackdrop ()⚓︎
void SetCurrentFloorBackdrop ( int BackdropId )⚓︎
Changes the default room backdrop for the current floor to match the input id. This change wont persists on save/continue so make sure to account for that.
SetCurrentFloorMusic ()⚓︎
void SetCurrentFloorMusic ( int MusicId )⚓︎
Changes the music track for the current floor to match the input id. This change wont persists on save/continue so make sure to account for that.
SetCurrentFloorName ()⚓︎
void SetCurrentFloorName ( string Name )⚓︎
Changes the display name for the current floor to match the input id. This change wont persists on save/continue so make sure to account for that.
SetDwmWindowAttribute ()⚓︎
void SetDwmWindowAttribute ( DwmWindowAttribute Attribute )⚓︎
SetIcon ()⚓︎
void SetIcon ( int IsaacIcon OR string IconPath, boolean BypassSize)⚓︎
Sets the 16x16 icon located on the game window. Does not update the icon elsewhere, such as the task bar.
IsaacIcon
is 0
for the normal icon, 1
for the Tainted icon.
IconPath
accepts a path to a .ico file.
BypassSize
bypasses the 16x16 resolution cap.
SetWindowTitle ()⚓︎
void SetWindowTitle ( string Title )⚓︎
Sets the appended text on the game's window title.
ShowErrorDialog ()⚓︎
DialogReturn ShowErrorDialog ( string Title, string Text, DialogIcons Icon = DialogIcons.ERROR, DialogButtons Buttons = DialogButtons.OK )⚓︎
Displays a Win32 message box. Can be controlled with the icon
and buttons
parameters. Returns a DialogReturn
value that indicates the button pressed.
Note
Take in mind that gamepad wont work for this popup, you'll need to use mouse/keyboard or touchscreen, and the window title wont show up on some enviroments like the steam deck, so dont rely on it too much.
StartNewGame ()⚓︎
void StartNewGame ( PlayerType Character, Challenge Challenge = ChallengeType.CHALLENGE_NULL, Difficulty Mode = Difficulty.DIFFICULTY_NORMAL, int Seed = Random )⚓︎
Starts a new game using the specified arguments. Can be used from the main menu.
TriggerWindowResize ()⚓︎
void TriggerWindowResize ( )⚓︎
Simulates a window resize, useful to refresh some option changes like MaxRenderScale
.
WorldToMenuPosition ()⚓︎
Vector WorldToMenuPosition ( MainMenu MenuId, Vector Position )⚓︎
Converts the World position from input to a pinned main menu position that varies depending on the enum selected. It's important to reconvert this every frame, in a similar fashion to WorldToRender, in order to properly render when menus are changed or the window is resized.