Change Log
This page lists the changes to the IsaacScript framework.
May 13th, 2023
- Added REPENTOGON support. Since this hack changes vanilla classes, you must install a separate package if you want to use it called
isaac-typescript-definitions-repentogon. Since using REPENTOGON functionality will cause run-time errors on vanilla, you should very carefully gate your mod behind a REPENTOGON check with a clear error message. (Thanks 4Grabs) - Added the following helper functions:
isRepentogon
January 8th, 2023
- Added the following helper functions:
isNormalPillColor
- Added the following enums:
ModCallbackRepentogon(Thanks 4Grabs)
- Added the following helper types:
ObjectValues
- Added the following custom command:
goldenPill
- Added the following lint rules:
isaacscript/no-unnecessary-assignment
January 1st, 2023
- Added the following custom commands:
megaSatan
- Renamed the following helper functions:
validateInterfaceMatchesEnum-->interfaceSatisfiesEnum
December 17th, 2023
isaacscript-commonnow provides JavaScript files alongside Lua files. (isaac-typescript-definitionsalready does this.)isaac-lua-polyfillsnow provides more polyfills such that you can importisaacscript-commonin JavaScript code without any run-time errors.- Added the following helper functions:
getMainCharacter
- Changed the following helper functions:
eRange- The reverse functionality has been removed.iRange- The reverse functionality has been removed.
- Renamed the following helper functions:
characterCanHaveRedHearts-->canCharacterHaveRedHeartscharacterCanHaveSoulHearts-->canCharacterHaveSoulHeartscharacterCanTakeFreeDevilDeals-->canCharacterTakeFreeDevilDealscharacterGetsBlackHeartFromEternalHeart-->doesCharacterGetBlackHeartFromEternalHeartcharacterStartsWithActiveItem-->doesCharacterStartWithActiveItem
December 10th, 2023
- Added the following helper functions:
getAllBossesgetAllNonStoryBossesgetArrayDuplicateElementsgetBossIDsForStagegetBossIDsForStageIDgetBossStageIDsgetEdenStartingActiveCollectiblegetEdenStartingPassiveCollectiblegetEdenStartingCollectiblesisArrayElementsUnique
- Added the following types:
ReadonlyRecord
- Added the following lint rules:
prefer-readonly-parameter-typesstrict-void-functionsstrict-undefined-functionsno-undefined-return-type
- Deleted the following helper functions:
getBossSetgetAllBossesSet
- Added the following custom commands:
horse
December 1st, 2023
- Most of the functions from
isaacscript-commonthat return arrays now return read-only versions of those arrays. - Added the following helper functions:
isValidCardTypeisValidPillEffectisValidTrinketTypeparseIntSafe
- Removed the following constants:
FIRST_ROOM_TYPEFIRST_STAGELAST_ROOM_TYPELAST_STAGE
- Added the following lint rules:
no-mutable-return
November 17th, 2023
- Added the following helper functions:
getChestsis2x1RoomShapeobjectKeysToSetobjectKeysToReadonlySetobjectToMapobjectToReadonlyMapobjectValuesToSetobjectValuesToReadonlySetremoveAllChestsuncapitalizeFirstLetter
- Renamed the following helper functions:
stageTypeToLetter-->getStageTypeSuffix
- Removed the following helper functions:
goToStage(usesetStageinstead)isRoomDangerous(useRoom.IsClearinstead, since it is more performant)
- Added the following enums:
AngelicBabySubType(Thanks popjam)DarkEsauSubType(Thanks popjam)DeepGaperSubType(Thanks popjam)DragonFlySubType(Thanks popjam)LeperSubType(Thanks popjam)MazeRoamerSubType(Thanks popjam)MomsHeartSubType(Thanks popjam)MotherBallSubType(Thanks popjam)MorningStarSubType(Thanks popjam)QuakeGrimaceSubType(Thanks popjam)RottenGaperSubType(Thanks popjam)
- Added the following types:
StoryBossID
November 10th, 2023
- The location of the plugins in the "isaacscript" package have changed. See the new "tsconfig.json" template.
- Scripts in new mods no longer use Bash and are now native TypeScript scripts.
- The
isaacscript-common-nodelibrary is released, which contains helper functions for Bash-like scripts. - The
canRunUnlockAchievementshelper function must now be activated withISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION. - The following enums are no longer const enums and have to be explicitly imported:
EncyclopediaItemPoolTypeModConfigMenuOptionTypeStageAPILayoutButtonVariantStageAPILayoutCornyPoopSubtypeStageAPILayoutGridTypeStageAPILayoutPitfallVariantStageAPILayoutPoopSubtypeStageAPILayoutRockSubtypeStageAPILayoutSpikesOnOffVariant
- CI in new mods now runs build and lint in a separate jobs so that they run faster.
- Added the following helper functions:
getAdjustedPricegetRoomClearRenderFramehasCardshouldWhoreOfBabylonBeActive
- Changed the following helper functions:
spawnCollectible(is now pure)preventCollectibleRotation(is now pure)
- Functions from
ISCFeature.MODDED_ELEMENT_SETSnow return arrays instead of sets. - Removed the following helper functions:
spawnCollectibleUnsafe(use thespawnCollectiblefunction instead)
- Added the following enums:
NPCID(Thanks popjam)
November 2nd, 2023
- Helper functions that deal with randomness now require you to pass the seed. If you want unseeded behavior, then you must explicitly pass
undefined. - Added the following helper functions:
asRoomTypecrc32getDefaultCollectibleTypesInItemPoolgetDefaultItemPoolsForCollectibleTypegetItemPoolNameinGridisActiveEnemyisCollectibleTypeInDefaultItemPoollogItemPoolTypes
- Added the following enums:
ConquestStateFamineStatePestilenceStateUltraGreedStateUltraGreedierStateWarStateWarWithoutHorseState
- Removed the following helper types:
Expand
October 18th, 2023
- Added the following helper functions:
getChallengeCollectibleTypesgetChallengeTrinketTypeisFamiliarCollectibleisRoomDangerousparseSemanticVersionsplitNumber
October 9th, 2023
- IsaacScript now requires that TypeScript and other development-related dependencies are placed in the "devDependencies" array in the "package.json" file (instead of the "dependencies" array). This is to prevent TypeScript-related functions from sneaking into VSCode's auto-complete list.
- Added the following helper functions:
assertNotNullclearChallengegetBossNamegetChallengeBossgetChallengeCharactergetElapsedGameFramesSincegetElapsedRenderFramesSincegetElapsedRoomFramesSincegetElapsedTimeSincegetGridEntityANM2PathgetRockPNGPathgetSurroundingGridIndexesgetVanillaCollectibleTypesOfQualitygetVanillaPillEffectsOfTypehasHominginBigRoomisAfterGameFrameisAfterRenderFrameisAfterRoomFrameisBeforeGameFrameisBeforeRenderFrameisBeforeRoomFrameisBigRoomisBigRoomShapeisGridIndexAdjacentToDoorisStoryBossIDonAnyChallengeonChallengeonGameFrameonOrAfterGameFrameonOrAfterRenderFrameonOrAfterRoomFrameonOrBeforeGameFrameonOrBeforeRenderFrameonOrBeforeRoomFrameonRenderFrameonRoomFramerunNextRunsetChallengesetRunSeed
- Renamed the following helper functions:
removeCollectibleFromItemTracker-->rebirthItemTrackerRemoveCollectiblegetMoveActions-->getMoveButtonActionsgetShootActions-->getShootButtonActions
- Removed the following helper functions:
isGreedMode(useGame.IsGreedModeinstead)
- Added the following constants:
MAX_QUALITY
- Renamed the following constants:
MOVEMENT_ACTIONS-->MOVEMENT_BUTTON_ACTIONSMOVEMENT_ACTIONS_SET-->MOVEMENT_BUTTON_ACTIONS_SETSHOOTING_ACTIONS-->SHOOTING_BUTTON_ACTIONSSHOOTING_ACTIONS_SET-->SHOOTING_BUTTON_ACTIONS_SET
- Added the following enums:
CarpetSubType
- Added the following helper types:
WidenLiteral
- Added the following custom commands:
xl(alias for "labyrinth")
October 2nd, 2023
- Added the following helper functions:
anyEasterEggEnabled(alias foranySeedEffectEnabled)anySeedEffectEnabledgetCharacterStartingTrinketTypegetBatteryNamegetBombNamegetBossIDgetBossIDFromEntityTypeVariantgetBossNamePNGFilePathgetBossPortraitPNGFilePathgetBossRushDoorgetCharacterNamePNGFilePathgetCharacterPortraitPNGFilePathgetCharacterSpritePNGFilePathgetChestNamegetCoinNamegetCollectibleTypesOfQualitygetEntityTypeVariantFromBossIDgetEnumNamesgetHeartNamegetKeyNamegetNormalTrinketTypegetPlayerCollectiblesOfQualitygetPlayerTrinketsgetSackNamegetSeedEffectsgetSlotNamegetVanillaWallGridIndexSetForRoomShapeinCrawlSpaceWithBlackMarketEntranceinDogmaRoomisBossRushDoorisCrawlSpaceWithBlackMarketEntranceisDogmaRoomisRepentanceBossonVictoryLapsetGridEntityType
- Changed the following helper functions:
arrayRemoveInPlacenow returns the removed elements.arrayRemoveIndexInPlacenow returns the removed elements.getAllBossesSetnow returns a set ofBossIDand does not include the four ultra horsemen.getBossSetnow returns a set ofBossIDand does not include the four ultra horsemen.getCombinedBossSetnow returns a set ofBossIDand does not include the four ultra horsemen.
- Renamed the following helper functions:
getEnglishLevelName-->getLevelNamegetPlayerInventory-->getPlayerCollectibleTypesgetPlayerLastPassiveCollectible-->getPlayerLastPassiveCollectibleTypegetCharacterStartingCollectibles-->getCharacterStartingCollectibleTypesisPassiveCollectible-->isPassiveOrFamiliarCollectible
- Added the following constants:
CHEST_PICKUP_VARIANTSCHEST_PICKUP_VARIANTS_SETCOLLECTIBLE_NAME_TO_TYPE_MAPTRINKET_NAME_TO_TYPE_MAPQUALITIES
- Added the following helper types:
CompositionTypeSatisfiesEnum
- Renamed the following features:
ISCFeature.PLAYER_INVENTORY-->ISCFeature.PLAYER_COLLECTIBLE_TRACKINGISCFeature.EDEN_STARTING_STATS-->ISCFeature.EDEN_STARTING_STATS_HEALTH
September 25th, 2023
- Added the following helper functions:
getPillEffectsgetPillEffectsSetanyPlayerHasCollectibleEffectanyPlayerHasTrinketEffectanyPlayerHasNullEffectgetObjectPartialMatchgetMegaSatanDoorgetModdedPillEffectsgetModdedPillEffectsSetgetVoidDoorinRedKeyRoomisGridEntityXMLType(for thePRE_ROOM_ENTITY_SPAWNcallback)isMainCharacterisMegaSatanDoorisVoidDoor
- Renamed the following helper functions:
isPoopGridEntityType-->isPoopGridEntityXMLTypegetCardArray-->getCardTypesgetCardSet-->getCardTypesSetgetCollectibleArray-->getCollectibleTypesgetCollectibleSet-->getCollectibleTypesSetgetCollectiblesForTransformation-->getCollectibleTypesForTransformationgetCollectiblesWithCacheFlag-->getCollectibleTypesWithCacheFlaggetCollectiblesWithTag-->getCollectibleTypesWithTaggetEdenActiveCollectibles-->getEdenActiveCollectibleTypesgetEdenPassiveCollectibles-->getEdenPassiveCollectibleTypesgetFlyingCollectibles-->getFlyingCollectibleTypesgetFlyingTrinkets-->getFlyingTrinketTypesgetModdedCardArray-->getModdedCardTypesgetModdedCardSet-->getModdedCardTypesSetgetModdedCollectibleArray-->getModdedCollectibleTypesgetModdedCollectibleSet-->getModdedCollectibleTypesSetgetModdedTrinketArray-->getModdedTrinketTypesgetModdedTrinketSet-->getModdedTrinketTypesSetgetRandomEdenActiveCollectible-->getRandomEdenActiveCollectibleTypegetRandomEdenPassiveCollectible-->getRandomEdenPassiveCollectibleTypegetTrinketArray-->getTrinketTypesgetTrinketSet-->getTrinketTypesSetgetTrinketsWithCacheFlag-->getTrinketsTypesWithCacheFlag
- Removed the following helper functions:
getAllCardTypes(usegetCardTypesinstead)getAllDimensions(use theDIMENSIONSconstant instead)getAllPillEffects(usegetPillEffectsinstead)getVanillaCardArray(use theVANILLA_CARD_TYPESconstant instead)getVanillaCardSet(use theVANILLA_CARD_TYPES_SETconstant instead)getVanillaCollectibleArray(use theVANILLA_COLLECTIBLE_TYPESconstant instead)getVanillaCollectibleTypeRange(use theVANILLA_COLLECTIBLE_TYPE_RANGEconstant instead)getVanillaCollectibleSet(use theVANILLA_COLLECTIBLE_TYPES_SETconstant instead)getVanillaPillEffects(use theVANILLA_PILL_EFFECTSconstant instead)getVanillaTrinketArray(use theVANILLA_TRINKET_TYPESconstant instead)getVanillaTrinketTypeRange(use theVANILLA_TRINKET_TYPE_RANGEconstant instead)getVanillaTrinketSet(use theVANILLA_TRINKET_TYPES_SETconstant instead)
- Added the following constants:
DIMENSIONSFLYING_CHARACTERSMAIN_CHARACTERSNUM_VANILLA_CHALLENGESVANILLA_CARD_TYPE_RANGEVANILLA_CARD_TYPESVANILLA_CARD_TYPES_SETVANILLA_COLLECTIBLE_TYPE_RANGEVANILLA_COLLECTIBLE_TYPESVANILLA_COLLECTIBLE_TYPES_SETVANILLA_PILL_EFFECT_RANGEVANILLA_PILL_EFFECTSVANILLA_PILL_EFFECTS_SETVANILLA_TRINKET_TYPE_RANGEVANILLA_TRINKET_TYPESVANILLA_TRINKET_TYPES_SET
- Changed the following constants:
NUM_PILLS_IN_POOL-->NUM_PILL_COLORS_IN_POOL
- Added the following helper types:
ERangeTupleKeys
- Renamed the following helper types:
Range-->IRange
September 18th, 2023
- Added the following helper functions:
asFloatasIntgetLowestEnumValue
- Removed the following helper functions:
getLastElement(TSTL supports theArray.atmethod now)
- Added the following custom commands:
collectible(alias for thespawnCollectiblecommand)goldTrinket(alias for thespawnGoldenTrinketcommand)goldenTrinket(alias for thespawnGoldenTrinketcommand)spawnCollectibleAtspawnTrinketAtspawnGoldTrinket(alias for thespawnGoldenTrinketcommand)spawnGoldenTrinketAttrinket(alias for thespawnTrinketcommand)
September 11th, 2023
- The save data manager now supports rewinding a
persistentobject if__rewindWithGlowingHourGlassis specified. - The "Extra Console Commands" feature will now work properly if two or more mods have it enabled.
- Added the following helper functions:
getHighestArrayElementgetLevelBossIDsgetLowestArrayElementhasAnyTrinkethasPiercinghasSpectralhasTrinketinRoomShapeisMissedTearisPoopGridEntityTypeisRoomShapelevelHasBossIDrebirthItemTrackerWriteToFileremoveAllConsoleCommandsuseCardTemp
- Renamed the following helper functions:
addStat-->addPlayerStat
- Added the following enums:
DebugCommandPortalTeleportSubType
September 4th, 2023
- Added the following helper functions:
getMoveActionsgetShootActionsisChestVariantisFinalFloorisIntegerisRedHeartSubTypeisStageWithNaturalDevilRoomisStageWithRandomBossCollectibleisStageWithSecretExitToDownpourisStageWithSecretExitToMausoleumisStageWithSecretExitToMinesisStageWithShovelTrapdoorsisStageWithStoryBossonStageWithStoryBoss
- Added the following constants:
MOVEMENT_ACTIONS_SETSHOOTING_ACTIONS_SET
- Renamed the following helper functions:
onStageWithShovelWorking-->onStageWithShovelTrapdoors
August 27th, 2023
- Added the following helper function:
assertDefined(for more concise type-narrowing)isEnumValuerenderTextOnEntityrenderScaledTextOnEntity
- Added the following constants:
MODIFIER_KEYSMOVEMENT_ACTIONSSHOOTING_ACTIONS
August 20th, 2023
- Added the following helper types:
TupleWithLengthBetween
August 10th, 2023
- Added the following helper functions:
filterMapis2x1RoomisBeastRoomisBossRoomOfisCrawlSpaceisDeathCertificateAreaisDevilsCrownTreasureRoomisDoubleTroubleisGenesisRoomisHomeClosetisLRoomisMegaSatanRoomisMinibossRoomOfisMirrorRoomisRoomTypeisSecretExitisSecretShop
- Renamed the following helper functions:
initArray-->newArrayisLRoom-->isLRoomShape
- Changed the following helper functions:
newRoom- AddedensureDeadEndandcustomRoomDataoptional arguments.getNewRoomCandidate- AddedensureDeadEndoptional argument.getNewRoomCandidatesForLevel- AddedensureDeadEndoptional argument.getNewRoomCandidatesBesideRoom- AddedensureDeadEndoptional argument.
August 3rd, 2023
eslint-config-isaacscriptis rewritten from scratch. It no longer relies on any upstream configs and is now documented officially on the website.
June 30th, 2023
- Added the following helper functions:
defaultMapGetNPCdefaultMapSetNPCmapDeleteNPCmapGetNPCmapHasNPCmapSetNPCsetAddNPCsetDeleteNPCsetHasNPC
June 5th, 2023
- Added the following helper functions:
pocketItemsEqualsgetPillColorFromEffectlogTableShallow
April 24th, 2023
- Added the following helper functions:
doesGridEntityExistgetPlayerStatsgetEdenStartingStatgetEdenStartingStats
- Added the following custom console commands:
spikes(spawns a spikes grid entity next to the player)
March 28th, 2023
- Added the following helper functions:
areInputsEnabled
- Added the following custom console commands:
poop(spawns a poop grid entity next to the player)
March 21st, 2023
- Added the following helper functions:
newSprite
March 13th, 2023
- Added the following helper functions:
getUsableActiveItemSlotslogDisplayFlagsgetClosestVectorTovectorToRoomGridIndex
- Renamed the following helper functions:
roomGridIndexToXY-->roomGridIndexToVector
- Changed the following helper functions:
getCustomGridEntities(returns an array of objects instead of tuples)getStageHistory(returns an array of objects instead of tuples)getNewRoomCandidatesBesideRoom(returns an array of objects instead of tuples)getNewRoomCandidatesForLevel(returns an array of objects instead of tuples)getNewRoomCandidate(returns an array of objects instead of tuples)anyPlayerHasCollectible(now takes an optional param ofignoreModifiers)anyPlayerHasTrinket(now takes an optional param ofignoreModifiers)
- Added the following custom callbacks:
POST_TEAR_KILL(Thanks 4Grabs)POST_PROJECTILE_KILL(Thanks 4Grabs)
- Added the following constants:
STARTING_ROOM_GRID_INDEX
March 6th, 2023
- Added the following helper functions:
onStageOrHigheronStageOrLowergetFirstCardgetFirstPillmapDeletePlayerhasDoorType
- Changed the following helper functions:
spawnPersistentEntity- Now returns an object instead of a tuple.
- Removed the following helper functions:
getCollectibleIndex(usegetPickupIndexinstead)
- Added the following custom callbacks:
POST_USE_PILL_FILTER(which also passes the pill color)POST_GAME_END_FILTER
- Removed the following custom callbacks:
POST_COLLECTIBLE_INIT_FIRST(usePOST_PICKUP_INIT_FIRSTinstead)
- The
pillscommand will now spawn horse pills in addition to normal pills.
February 24th, 2023
- Added the following helper functions:
removeCollectiblegetCharacterStartingCollectibleshasCollectibleInActiveSlotgetScreenBottomYgetScreenRightXremoveCollectibleFromPoolsremoveTrinketFromPoolsisMultiplayergetRoomDescriptorsForTypelevelHasRoomTypeinFirstRoomdeleteLastRoomDescriptionstableSorthideRoomOnMinimapisSecretRoomTypeonStageonStageTypeonEffectiveStageonStageWithSecretExitToDownpouronStageWithSecretExitToMinesonStageWithSecretExitToMausoleumonStageWithShovelWorkingonStageWithRandomBossCollectiblesetHas
- Renamed the following helper functions:
playerAddCollectible-->addCollectibleplayerHasCollectible-->hasCollectibleplayerHasForm-->hasFormgetActiveItemSlot-->getActiveItemSlotsgetLastEnumValue-->getHighestEnumValueasNpcState-->asNPCState
- Changed the following helper functions:
getFlyingCollectibles- The argument is changed frompruneConditionalItemstoincludeConditionalItems.
- Many logging helper functions now take an optional
nameargument. - Renamed the following enums:
NpcState-->NPCState
- Added the following constants:
RESOLUTION_FULL_SCREENRESOLUTION_1600_900TIME_GAME_OPENEDMAPPING_COLLECTIBLES
- Added the following custom callbacks:
POST_ENTITY_KILL_FILTERPOST_FAMILIAR_INIT_FILTERPOST_FAMILIAR_UPDATE_FILTERPOST_FAMILIAR_RENDER_FILTERPRE_FAMILIAR_COLLISION_FILTERPOST_EFFECT_INIT_FILTERPOST_EFFECT_UPDATE_FILTERPOST_EFFECT_RENDER_FILTERPOST_LASER_INIT_FILTERPOST_LASER_UPDATE_FILTERPOST_LASER_RENDER_FILTERPOST_KNIFE_INIT_FILTERPOST_KNIFE_UPDATE_FILTERPOST_KNIFE_RENDER_FILTERPRE_KNIFE_COLLISION_FILTERPOST_TEAR_INIT_FILTERPOST_TEAR_UPDATE_FILTERPOST_TEAR_RENDER_FILTERPRE_TEAR_COLLISION_FILTERPOST_PROJECTILE_INIT_FILTERPOST_PROJECTILE_UPDATE_FILTERPOST_PROJECTILE_RENDER_FILTERPRE_PROJECTILE_COLLISION_FILTERPOST_BOMB_INIT_FILTERPOST_BOMB_UPDATE_FILTERPOST_BOMB_RENDER_FILTERPRE_BOMB_COLLISION_FILTER
- Changed the following custom callbacks:
POST_GAME_STARTED_REORDEREDandPOST_GAME_STARTED_REORDERED_LASTnow require a third argument ofisContinued: boolean | undefined. (This is mandatory in order to prevent users from shooting themselves in the foot with respect to logic unexpectedly being executed on continued runs.)POST_NEW_ROOM_EARLY- ProvidesroomTypeas the first argument. Can now filter byRoomType.POST_NEW_ROOM_REORDERED- ProvidesroomTypeas the first argument. Can now filter byRoomType.POST_NEW_LEVEL_REORDERED- Providesstageas the first argument andstageTypeas the second argument. Can now filter byLevelStageandStageType.
- Added the following helper types:
RangeNaturalNumbersLessThanNaturalNumbersEqualToOrLessThanTupleTupleWithMaxLengthIncrementDecrement
- Added the following custom commands:
flies(to get max blue flies)
- Added the following lint rules for IsaacScript mods:
require-v-registration- Checks forvconstants that are not registered with the save data manager.
- Disabled the following lint rules for IsaacScript mods:
class-methods-use-this(since it is idiomatic to havevoutside of the class)
February 17th, 2023
- Functions that return
Vector,Color, andKColorwill now return read-only versions. - The "toggleDisplay" helper functions now accept an optional "force" argument.
- Added the following helper functions:
sortObjectArrayByKeygetStageIDgetRandomItemPoolsetAllDisplayFlagsclearRoomDisplayFlags
- Renamed the following helper functions:
twoDimensionalSort-->sortTwoDimensionalArraysetDisplayFlags-->setFloorDisplayFlags
- Added the following method to the
ModUpgradedclass:AddPriorityCallbackCustom- Works in the same way thatAddPriorityCallbackdoes.
- Renamed the following types:
ModUpgradedBase-->ModUpgradedModUpgraded-->ModUpgradedWithFeatures
- Added the following custom callbacks:
POST_KEYBOARD_PRESSED
- The
require-capital-read-onlylint rule will now work with objects. - Added the following lint rules:
@typescript-eslint/no-confusing-void-expressionn/file-extension-in-import(TypeScript projects only)
February 7th, 2023
package.json
IsaacScript mods now require that "isaacscript-tsconfig" is listed as a dependency in your "package.json" file. In other words, type one of the following commands:
# If you use npm:
npm install --save isaacscript-tsconfig
# If you use Yarn:
yarn add isaacscript-tsconfig
# If you use pnpm:
pnpm add isaacscript-tsconfig
Other
- Added a GitHub action for uploading mods to the Steam Workshop.
isaacscripthas new commands:checkwill check your template files (for an IsaacScript mod) to see if they are up to date.init-tswill bootstrap a TypeScript project.publish-tswill publish a TypeScript project.check-tswill check your template files (for an TypeScript project) to see if they are up to date.
- The
cspell-check-unused-wordstool can now be used to check for unused words in your "cspell.jsonc" file. - Removed support for
steamcmdfrom thepublishcommand. - Added the following helper functions:
isFoundSoul
January 31st, 2023
- The custom stages feature now accepts
musicas an option in thetsconfig.jsonfile. - Collectible helper functions that take an argument of
CollectibleTypenow also accept the collectible itself. - Added the following helper functions:
getMusicForStagesetCollectiblePedestalTypedoesAnyEntityExistnewReadonlyVectornewReadonlyColornewReadonlyKColorgetReversedMap
- Removed the following helper types:
HasAllEnumKeys(useRecordinstead)
- Added the following helper constructors:
ReadonlyMapReadonlySet
- Added the following custom console commands:
music
January 22nd, 2023
- The functions from
ISCFeature.RUN_IN_N_FRAMESnow take an optional parameter to cancel the function if a new room is loaded. - The
logfunctions no longer take aselfargument, so they can be used more easily while debugging. - The
logfunction now takes an optional parameter to disable the function prefix. - Added the following helper functions:
isSlotMachinelogAndPrintsetSpriteOpacitysetEntityOpacityisMoveActionPressedisMoveActionTriggeredisShootActionPressedisShootActionTriggeredisTSTLClassinitModFeaturesdoesVectorHaveLengthgetNumRoomsVisitedgetMysteriousPaperEffectForFrame
- Removed the following helper functions:
printConsole(useprintinstead)isUserDefinedTSTLClass
- Added the following enums:
LarryJrSubTypeHollowSubTypeMonstroSubTypeChubSubTypeCarrionQueenSubTypeGurdySubTypeMonstro2SubTypeMomSubTypePinSubTypeFrailSubTypeFamineSubTypePestilenceSubTypeWarSubTypeDeathSubTypeDukeOfFliesSubTypeHuskSubTypePeepSubTypeBloatSubTypeFistulaSubTypeGeminiSubTypeGurdyJrSubTypeWidowSubTypeGurglingSubTypeHauntSubTypeDingleSubTypeMegaMawSubTypeGateSubTypeMegaFattySubTypeCageSubTypePolycephalusSubTypeStainSubTypeBrownieSubTypeForsakenSubTypeLittleHornSubTypeRagManSubType
- Renamed the following enums:
DukeVariant-->DukeOfFliesVariant
- Added
isaacscript-common-ts, a library that has several helper functions and can be consumed by TypeScript projects. (isaacscript-commonis compiled to Lua, so it cannot be used for this purpose.) - Added the following linting rules:
require-capital-read-only
- Some linting rules have been renamed:
require-const-assertions-->require-capital-const-assertions
- Some linting rules have been changed:
require-capital-const-assertions- Now applies to arrays.
January 13th, 2023
- Added the following helper functions:
playerHasFormdirectionToMoveActiondirectionToShootActiononStageWithNaturalDevilRoom
- Changed the following helper functions:
getClosestEntityTonow takes an optionalfilterFuncargument.
- Added the following constants:
GAME_FRAMES_PER_MINUTERENDER_FRAMES_PER_MINUTE
- Added the following custom callbacks:
ENTITY_TAKE_DMG_PLAYERINPUT_ACTION_FILTERINPUT_ACTION_PLAYERPOST_PICKUP_INIT_FILTERPOST_PICKUP_UPDATE_FILTERPOST_PICKUP_RENDER_FILTERPOST_PICKUP_SELECTION_FILTERPRE_ENTITY_SPAWN_FILTERPRE_ROOM_ENTITY_SPAWN_FILTER
- Added the following lint rules:
import/no-default-exportisaacscript/no-empty-line-commentsisaacscript/no-throwjsdoc/require-param(with specific context)
- Changed the following lint rules:
isaacscript/no-implicit-map-set-loops-->isaacscript/no-explicit-map-set-loops- The
complete-sentences-jsdocandcomplete-sentences-line-commentslint rules will now catch sentences that end with a double period.
January 6th, 2023
- The
ModFeatureclass now has ashouldCallbackMethodsFireproperty that you can override if you want to have all of your callback methods run conditionally. spawnand all of the related helper functions will now accept a grid index in place of a position vector.- Added the following helper functions:
dequeueItemisActionPressedisActionTriggeredinRange
December 26th, 2022
- Added the following helper functions:
getEnglishLevelName
December 17th, 2022
- Persistent entities will now no longer respawn when they are removed.
- Added the following custom commands:
secretShop(to warp to the Secret Shop)
December 8th, 2022
- The IsaacScript framework now includes all of the features from the latest vanilla patches.
- Several card functions have been moved to the
ModdedElementSetsfeature, sinceItemConfigCardTypeno longer has to be hard-coded. - Added the following helper functions:
isPaused(part ofPause)
- Added the following constants:
ITEM_CONFIG_CARD_TYPES_FOR_CARDS
November 15th, 2022
- The
upgradeModfunction now takes an optional parameter containing the custom callbacks that you will be subscribing to in the future (for the purposes of early initializing them). - Added the following helper functions:
pressInputremoveCollectibleFromAllPlayers
- Renamed the following helper functions:
getVanillaTrinketTypes-->getVanillaTrinketTypeRange
November 6th, 2022
- Added the following helper functions:
getGridEntitiesInRadius(Thanks NFrost)getGridEntityCollisionPoints(Thanks NFrost)getConstituentsFromEntityIDgetConstituentsFromGridEntityIDspawnEntityIDinRoomType
- Added the following custom callbacks:
POST_NPC_INIT_FILTERPOST_NPC_UPDATE_FILTERENTITY_TAKE_DMG_FILTER(Thanks 4Grabs)PRE_NPC_UPDATE_FILTER(Thanks 4Grabs)POST_NPC_RENDER_FILTER(Thanks 4Grabs)POST_NPC_DEATH_FILTER(Thanks 4Grabs)PRE_NPC_COLLISION_FILTER(Thanks 4Grabs)
- Added the following types:
EntityIDGridEntityID
October 10th, 2022
isaacscript-commonhas been rewritten to only enable the custom features that you are actually using (rather than all of them). The idea here is to keep the library blazing fast and allow it to scale well into the future as more features are added.- Breaking:
- All of the extra feature functions in
isaacscript-commonare now attached to theModUpgradedobject (instead of being normal functions that you import). The idea here is to eliminate run-time errors from non-upgraded mods. See the website for more details.
- All of the extra feature functions in
- Added the following helper functions:
removeUrnRewardsremoveEntitiesSpawnedFromGridEntityspawnRockAltRewardUrnspawnRockAltRewardMushroomspawnRockAltRewardSkullspawnRockAltRewardPolypspawnRockAltRewardBucketDownpourspawnRockAltRewardBucketDrossgetPlayerCollectiblesWithTaggetPlayerCollectiblesForTransformationgetEdenActiveCollectiblesgetRandomEdenActiveCollectiblespawnCollectibleUnsafeisPlayerAbleToAim
- Renamed the following helper functions:
hasSirenStolenFamiliar-->isFamiliarStolenBySirengetCollectiblesForCacheFlag-->getCollectibleTypesWithCacheFlaggetTrinketsForCacheFlag-->getTrinketsWithCacheFlaggetPlayerCollectiblesForCacheFlag-->getPlayerCollectiblesWithCacheFlaggetPlayerTrinketsForCacheFlag-->getPlayerTrinketsWithCacheFlaggetCollectibleTypesWithTag-->getCollectiblesWithTaggetCollectibleTypesForTransformation-->getCollectiblesForTransformationgetEdenPassives-->getEdenPassiveCollectiblesgetRandomEdenPassive-->getRandomEdenPassiveCollectible
- Removed the following helper functions:
isIsaacScriptCommonClassisVanillaTSTLClassgetPlayerNumCollectiblesWithTag(usegetPlayerCollectiblesWithTaginstead)getPlayerNumCollectiblesForTransformation(usegetPlayerCollectiblesForTransformationinstead)enableDevFeatures
- Added the following helper types:
AnyClassHasFunctionTupleToUnionTupleToIntersectionWritable
September 30th, 2022
- Added the
@Callbackand@CustomCallbackmethod decorators, which automatically subscribe the decorated method to the corresponding callback. This unlocks a new style of Isaac mods where you do not have to manage adding callbacks directly. In order for this to work properly, your mod features should be represented by classes that extend from theModFeatureclass. - Added the following helper functions:
isGreedModevalidateInterfaceMatchesEnumnewObjectWithEnumKeysgetPlayerFromPtrsaveDataManagerRemovegetTSTLClassConstructorisTableEmptylogTableKeysgetRandomIndexFromWeightedArraymerge
- The helper functions relating to charge now have an
activeSlotparameter that defaults toActiveSlot.PRIMARY. - Added the following helper types:
HasAllEnumKeysUnionToIntersectionAllButFirstAllButLastLowercaseKeysUppercaseKeysStartsWithLowercaseStartsWithUppercaseAnyFunction
September 22th, 2022
- The save data manager will now restore any data on a
runorlevelobject when the Glowing Hourglass is used to what it was when the room was entered. - The custom door feature of the standard library is removed. (It may be reimplemented in the future if needed.)
- Added the following helper functions:
isTearFromPlayerisTearFromFamiliarsetEntityDamageFlashhasArmordefaultMapGetHashdefaultMapSetHash(just an alias formapSetHash)mapSetHashsetAddisVanillaWallGridIndexinHomeClosetgetGridIndexesBetweensetConditionalHotkeyunsetConditionalHotkeypreventGridEntityRespawngetTimesetTracebackFunctionsGlobal(for easier debugging)getParentFunctionDescriptionspawnCollectibleFromPoolgetAmbushType
- Renamed the following helper functions:
getPlayerFromTear-->getPlayerFromEntityregisterHotkey-->setHotkeyirange-->iRangeerange-->eRange
- Changed the following helper functions:
iRangeandeRangenow take an optionalincrementargument.
- Added the following enums:
LadderSubTypeCustom
- Renamed the following enums:
LadderSubType-->TallLadderSubType
- Added the following custom commands:
transformationplayerForm(alias fortransformation)getCharge
- The
damage,tears, andspeedcustom commands now take optional arguments to set the player's stat to the specific amount.
September 13th, 2022
- Added the following helper functions:
getWeightedRandom(Thanks popjam)hasUnusedDoorSlot
September 4th, 2022
isaac-typescript-definitionsandisaacscript-commoncan now be imported by Lua mods. See the documentation.isaacscript initnow has a--devflag for setting up a mod that will be testing out a development version ofisaacscript-common. For more information, see the README.isaacscript.jsonnow has a schema file.- IsaacScript now provides the
isaac-lua-polyfillpackage, which assists in unit testing your mods using e.g. Jest. Thanks to Aleksander Ciesielski for this. - Added the following helper functions:
removeAllNonAlphanumericCharactersaddRoomDisplayFlagsetRoomVisiblecanPickEternalHeartsgetCollectibleChargeType
- Added the following enums:
CollectibleSpriteLayer
- Added the following constants:
K_COLORS(a collection of pre-definedKColorobjects)
- Added the following custom callbacks:
PRE_PICKUP_COLLISION(Thanks popjam)
- Added the following custom commands:
hush(to warp to the Blue Womb Boss Room)spawnCollectible(to spawn a collectible by name)spawnTrinket(to spawn a collectible by name)
August 25th, 2022
- TSTL plugins are now compiled and located inside of the
isaacscriptpackage. See the newtsconfig.jsontemplate for more information. This means that you no longer need to have to have a "plugins" directory in your mod. You can also remove your dependencies of@types/nodeandts-nodein the "package.json" file. - Added the following helper functions:
logCollectibleTypesonFirstFloorgetTeleportersremoveAllTeleportersspawnTeleporterspawnTeleporterWithVariantinSecretExitisBlueWombDoorgetBlueWombDoorgetEntityFromPtrHashlogPtrHashlogPtrHashesisDyingDumpgetPlayersWithControllerIndexgetPlayersOnKeyboard
- Added the following enums:
GridEntityFireplaceVariant
- Added the following constants:
TELEPORTER_ACTIVATION_DISTANCE
- Added the following custom commands:
dadsNote(to warp to the Mausoleum 2 Boss Room with Dad's Note in it)reloadRoomdarkness(for permanent Curse of Darkness)labyrinth(for permanent Curse of the Labyrinth)lost(for permanent Curse of the Lost)unknown(for permanent Curse of the Unknown)cursed(for permanent Curse of the Cursed)maze(for permanent Curse of the Maze)blind(for permanent Curse of the Blind)giant(for permanent Curse of the Giant)
- Removed the following custom commands:
eh(useeternalHeartsinstead)bh(useblackHeartsinstead)
August 18th, 2022
- The
Cardenum is now renamed toCardTypein order to be more consistent with theCollectibleTypeand theTrinketTypeenums. Many helper functions have also changed accordingly, likeisVanillaCard-->isVanillaCardType. - Added the following helper functions:
removeAllActiveItemsremoveAllPlayerTrinketsgetPartialMatchisVanillaCardTypeisVanillaCollectibleTypeisModdedCollectibleTypeisVanillaTrinketTypeisModdedTrinketTypeisVanillaPillEffectisModdedPillEffectgetTrinketGfxFilenamenewCollectibleSpritenewTrinketSpritegetCurseIDByNameremoveAllTrapdoorsremoveAllCrawlSpacesspawnTrapdoorspawnTrapdoorWithVariantspawnCrawlspacespawnCrawlspaceWithVariant
- Renamed the following helper functions:
isGoldenTrinket-->isGoldenTrinketType
- Changed the following helper functions:
getAllBossesnow takes an optionalincludeStoryBossesparameter.
- Added the following constant-related helper functions:
getFirstModdedCollectibleTypegetLastCollectibleTypegetNumCollectibleTypesgetNumModdedCollectibleTypesgetFirstModdedTrinketTypegetLastTrinketTypegetNumTrinketTypesgetNumModdedTrinketTypesgetFirstModdedCardTypegetLastCardTypegetNumCardsgetNumModdedCardsgetFirstModdedPillEffectgetLastPillEffectgetNumPillEffectsgetNumModdedPillEffects
- The constants relating to the aforementioned helper functions have been deleted, since they must be retrieved at run-time after at least one callback has been fired.
- Added the following custom commands:
getChallenge
August 11th, 2022
- Added the following helper functions:
spawnCustomTrapdoorToVanillagetAdjacentExistingRoomGridIndexesgetAdjacentNonExistingRoomGridIndexeswouldDamageTaintedMagdaleneNonTemporaryHeartContainersremoveCharactersBeforegetModdedTrinketArraygetModdedTrinketSetgetTrinketArraygetVanillaTrinketArraygetVanillaTrinketSetgetDoorSlotEnterPositiondisableInputscanRunUnlockAchievements
- Renamed the following helper functions:
removeAllGridExcept-->removeAllGridEntitiesExcept
- Changed the following helper functions:
getRoomShapeNeighborGridIndexDeltas-->getRoomShapeAdjacentGridIndexDeltasgetRoomShapeNeighborGridIndexes-->getRoomShapeAdjacentGridIndexesgetRoomNeighbors-->getRoomAdjacentGridIndexesgetRoomShapeNeighborGridIndexDeltas-->getRoomShapeAdjacentGridIndexDeltas
- Added the following custom callbacks:
POST_SLOT_COLLISION
- Added the following custom commands:
bossNextRoom(to go to the room next to the boss)
August 4rd, 2022
- IsaacScript now supports custom stages.
- The save data manager now supports serializing/deserializing
BitSet128objects. - The save data manager will now throw a custom compiler error if you try to register variables that are not serializable.
- Added the following helper functions:
isCollectibleInItemPoolgetAdjacentRoomGridIndexesisDeadEndgetRoomShapeNeighborGridIndexesgetNewRoomCandidatesBesideRoomgetNewRoomCandidatesForLevelgetNewRoomCandidatehasCursenewRoomsetRoomDatagetRoomDataForTypeVariantsetBackdropreloadRoomgetPlayerStatasNumberasStringasCollectibleTypeasTrinketTypeasCardasPillColorasPillEffectasPlayerTypeenableDevFeaturesisCustomGridEntitygetCustomGridEntityTypedoorSlotFlagsToDoorSlots
- Renamed the following helper functions:
isRoomInsideMap-->isRoomInsideGridgetRoomsInGrid-->getRoomsInsideGridgetDoorSlotFlags-->doorSlotsToDoorSlotFlags
- Changed the following helper functions:
spawnCustomGridEntitynow supports using any vanilla grid entity type and variant as a base.keyboardToStringnow requires an argument ofuppercase.todonow supports a variadic amount of arguments.
- Added the following constants:
ALL_DISPLAY_FLAGS
- Added the following enums:
StatType
- Added the following interfaces:
StatTypeType
- Added the following types:
Immutable(used for recursively immutable objects/arrays/maps/sets)PossibleStatType
- Added the following custom callbacks:
POST_PLAYER_CHANGE_STATPOST_GRID_ENTITY_CUSTOM_INITPOST_GRID_ENTITY_CUSTOM_REMOVEPOST_GRID_ENTITY_CUSTOM_STATE_CHANGED
- Changed the following custom callbacks:
POST_PLAYER_CHANGE_HEALTHnow passes the old value and the new value (in addition to the difference).
July 27th, 2022
- A new version of TSTL has been released that speeds up compilation by a factor of 2. Make sure to upgrade!
- Added the following helper functions:
getCharacterDamageMultipliergetOtherPlayersisEntityisBombisEffectisFamiliarisKnifeisLaserisNPCisPickupisPlayerisProjectileisTearisGridEntityisDoorisPitisPoopisPressurePlateisRockisSpikesisTNTgetRoomHistorygetPreviousRoomDescriptiongetLatestRoomDescriptiongetPickupIndexonAscentsumMapsumSetgetRandomVectorgetRandomColorgetRandomKColorsmeltTrinketsserializeIsaacAPIClassfireProjectilesInCirclespawnRockAltRewardisDaddyLongLegsChildStompEntity
- Renamed the following helper functions:
spawnCustomGrid-->spawnCustomGridEntityremoveCustomGrid-->removeCustomGridEntityisBomb-->isBombPickupisPoop-->isPoopPickuplogEffects-->logPlayerEffects
- Changed the following helper functions:
fireProjectilesnow accepts an undefined NPC for the cases where you do not want the projectiles to come from anything in particular.
- Added the following enums:
UrnVariantMushroomVariantSkullVariantPolypVariantBucketVariant
- Added the following custom callbacks:
POST_PLAYER_INIT_FIRST(use this for e.g. custom character initialization)POST_GRID_ENTITY_CUSTOM_UPDATEPOST_GRID_ENTITY_CUSTOM_RENDERPOST_GRID_ENTITY_CUSTOM_COLLISIONPOST_GRID_ENTITY_CUSTOM_BROKEN
- Removed the following custom callbacks:
POST_PLAYER_INIT_REORDERED(usePOST_PLAYER_INIT_FIRSTorPOST_GAME_STARTED_REORDEREDinstead)
- Changed the following custom callbacks:
POST_FLIPandPOST_FIRST_FLIPnow pass the old player object in addition to the new one.
- Added the following custom commands:
angelRoom(alias forangel)bossRoom(alias forboss)devilRoom(alias fordevil)errorRoom(alias forerror)iAmErrorRoom(alias foriAmError)sacrificeRoom(alias forsacrifice)secretRoom(alias forsecret)superSecretRoom(alias forsuperSecret)startRoom(alias forfool)startingRoom(alias forfool)treasureRoom(alias fortreasure)ultraSecretRoom(alias forultraSecret)tests(alias forrunTests)
- Removed the following custom commands:
hmhrhsh
July 20th, 2022
- The shader crash fix will now be automatically be applied to any upgraded mods. (The method was originally discovered by AgentCucco.)
- Breaking:
- The
removeAllNPCsfunction now takes "entityType", "variant", and "subType" parameters, which moves the location of the "cap" parameter.
- The
- Added the following helper functions:
getRoomShapeDoorSlotgetJSONRoomDoorSlotFlagsgetGotoCommandgetPlayerFamiliarsmovePlayersToCenterrunNextRoomreorderedCallbacksSetStageisNarrowRoomgetRoomShapeCornerspauseunpausegetEntityIDFromConstituentsgetGridEntityIDFromConstituentsgetScreenTopCenterPosgetScreenBottomCenterPosgetRockAltTypesetUnseededgetBombPickupsremoveAllBombPickupsspawnBombPickupspawnBombPickupWithSeedremoveAllRedHeartsremoveGridEntitiesremoveAllPitsremoveAllPoopsremoveAllPressurePlatesremoveAllRocksremoveAllSpikesremoveAllTNTspawnDoorspawnPitspawnPoopspawnPressurePlatespawnRockspawnSpikesspawnTNTlogEntitieslogEntitylogGridEntitieslogGridEntityrestartNextRenderFrame
- Renamed the following helper functions:
removeGrid-->removeGridEntityspawnGrid-->spawnGridEntityspawnGridWithVariant-->spawnGridEntityWithVariantlogEntities-->logAllEntitieslogGridEntities-->logAllGridEntities
- Removed the following helper functions:
getGotoCommandPrefix(usegetGotoCommandinstead)getDefaultColor(useColorDefault)getDefaultKColor(useKColorDefaultinstead)
- Changed the following helper functions:
- All of the
getgrid entity helper functions now take a variant parameter. - The JSON helper functions now use a custom JSON parser, which is 11.8 times faster than the vanilla parser.
- All of the
- Added the following constants:
NEW_RUN_PLAYER_STARTING_POSITIONNEW_FLOOR_STARTING_POSITION_NORMAL_MODENEW_FLOOR_STARTING_POSITION_GREED_MODEColorDefaultKColorDefaultfonts(which contains all 7 pre-loaded vanilla fonts)
- Added the following custom console commands:
flightunseedgridCostsrunTests
- The
gridandgrid2custom console commands have been switched. - The
no-unsafe-plusplus,prefer-plusplus, andprefer-postfix-plusplusESLint rules have been added to the standard linting configuration.
July 12th, 2022
- Breaking:
addRoomClearChargenow has an argument ofbigRoomDoubleCharge(instead of the old argument ofignoreBigRoomDoubleCharge), so you will need to invert the boolean.arrayRemovewill now only remove the first matching element (instead of every matching element). UsearrayRemoveAllfor that behavior instead.- Renamed
ISAAC_FRAMES_PER_SECOND-->RENDER_FRAMES_PER_SECOND - Renamed
getDoorEnterPositionOffset-->getDoorSlotEnterPositionOffset
- Added the following helper functions:
playerHasHealthLeftclearFloorDisplayFlagsisRoomShapeDoubleChargegetRoomShapeChargesgetRoomShapeDoorSlotCoordinatesgetGridEntitiesExceptspawnCustomGridremoveCustomGridaddChargearrayRemoveAllarrayRemoveAllInPlace
- Changed the following helper functions:
- All of the
spawnhelper functions now have the option to pass an RNG object instead of a seed. addRoomClearChargeandaddRoomClearChargeToSlotnow take an optional argument ofplaySoundEffect.registerHotkeynow will accept a function that returns aKeyboardin addition to aKeyboard.
- All of the
- Added the following custom callbacks:
POST_COLLECTIBLE_EMPTY
July 5th, 2022
- Breaking changes:
- The values of
ChallengeRoomSubType.NORMALandChallengeRoomSubType.BOSSchanged, since they were bugged.
- The values of
- Added the following helper functions:
validateEnumContiguousgetMatchingGridEntitiesgetTrapdoorsgetCrawlSpacesgetRoomClearGameFramegetRoomClearRoomFrameanyPlayerUsingPonygetStageHistoryhasVisitedStagecalculateStageTypecalculateStageTypeRepentancegetRoomsInGridgetRoomDisplayFlagssetRoomDisplayFlagsgetFloorDisplayFlagssetFloorDisplayFlagssetDisplayFlagssetStageisVanillaConsoleCommandregisterHotkeyunregisterHotkeygetGotoCommandPrefixconvertBinaryToDecimalconvertDecimalToBinarydoorSlotToDoorSlotFlagswapArrayElementsarrayToBitFlagssetToBitFlagsgetDoorSlotFlagsgetArrayCombinationsgetSetCombinationsswapArrayElementsarrayToBitFlagssetToBitFlagssetIntervalGameFramessetIntervalRenderFrames
- Renamed the following helper functions:
isPonyActive-->isPlayerUsingPonyinCrawlspace-->inCrawlSpacepickingUpItemIsNull-->isPickingUpItemNullpickingUpItemIsCollectible-->isPickingUpItemCollectiblepickingUpItemIsTrinket-->isPickingUpItemTrinket
- Added the following custom commands:
mana
- Removed the following helper functions:
getCollectibleTypeRange(usegetCollectibleArrayinstead)
June 28th, 2022
- The change log is now located on the official website.
- IsaacScript now requires a dependency of "@types/node", "typescript", and "ts-node" in your "package.json" file. (This is so that TSTL can properly use plugins.) If any dependencies are missing when you run the tool, it will helpfully tell you the appropriate command to run to fix the problem.
- The IsaacScript watcher icon now turns green when the mod is compiling.
- Breaking changes:
- Any callback definition with
voidinside of a union has been renamed toundefinedin order to have more consistent code and satisfy the TypeScript ESLint rules. This means that you may need to addreturn undefined;to some of your callback functions is order to satisfy the compiler. (Doing so explicitly acknowledges that this is the type of callback that expects a return value.) - The
removeAllGridExceptandremoveAllMatchingGridEntitiesfunctions now return an array of the grid entities that are removed. - The
consistent-returnESLint rule has been turned off in favor of thenoImplicitReturnscompiler flag. (The latter is type-aware, which results in a more comprehensive check.) - The
default-caseESLint rule has been turned off in favor of theswitch-exhaustiveness-checkESLint rule. Subsequently, theensureAllCaseshelper function has been removed, since it is no longer needed. You can clean up all of the boilerplate default cases from your switches, as TypeScript + ESLint will now automatically be able to derive if you did not handle a switch case. - The
strictconfigure from@typescript-eslinthas been enabled.
- Any callback definition with
- Added the following helper functions:
getBombRadiusFromDamagegetPlayerFromTearisDamageFromPlayerplayerConvertBlackHeartsToSoulHeartsplayerConvertSoulHeartsToBlackHeartsdoesEntityExistspawnPersistentEntity(for creating pickup-like entities)removePersistentEntity(for removing entities spawned withspawnPersistentEntity)getPHDPillEffectgetFalsePHDPillEffectdoesPlayerHaveAllSoulHeartsdoesPlayerHaveAllBlackHeartsgetEntityFieldslogTableDifferencesisCloseEnoughToTriggerDiceFloorsetCollectibleGlitchedstartAmbushisTableisUserdataisBooleanisNumberisStringisFunctionnewPlayerHealthgetCollectibleArraygetVanillaCollectibleArraygetModdedCollectibleArray
- Renamed the following helper functions:
getCurrentRoomDescriptorReadOnly-->getRoomDescriptorReadOnlygetCurrentDimension-->getDimensioniterateTableDeterministically-->iterateTableInOrder
- Removed the following helper functions:
ensureAllCases- This is no longer needed with the new linting rules. See the above explanation.
- Added the following constants:
NUM_PILLS_IN_POOLMIN_PLAYER_SPEED_STATMIN_PLAYER_SHOT_SPEED_STAT
- Added the following enums:
DiceFloorSubType
- Added the following custom callbacks:
POST_PICKUP_INIT_FIRSTPOST_PLAYER_COLLECTIBLE_ADDEDPOST_PLAYER_COLLECTIBLE_REMOVEDPOST_AMBUSH_STARTEDPOST_AMBUSH_FINISHEDPOST_BOMB_EXPLODED
- The inventory feature now uses the
POST_PLAYER_COLLECTIBLE_ADDEDcallback, so it will now properly account for items given via the console and via code. - The inventory feature now uses the
POST_PLAYER_COLLECTIBLE_REMOVEDcallback, so it will now properly account for items that are removed.
June 21st, 2022
- Breaking changes:
DefaultMapnow takes the default value/function as the first argument and the initializer array as the second argument.- The
removeEntitiesandremoveAllXfunctions now return an array of the entities that are removed.
- Added the following helper functions:
isPrimitivegetTSTLClassNameisTSTLMapisTSTLSetisDefaultMaptwoDimensionalSortiterateTableDeterministicallygetOppositeDoorSlotangleToDirection
- Renamed the following helper functions:
getIsaacAPIClassType-->getIsaacAPIClassName
- Added the following lint rules:
no-invalid-default-map
isaacscript initno longer creates abundleEntry.tsfile. If you use thenoImplicitGlobalVariablescompiler flag, then this is unnecessary. For more information, see the newtsconfig.jsontemplate file.
June 4th, 2022
- IsaacScript now supports pnpm. (Thanks KatTheFox)
Color.Defaultis now deprecated and will cause compiler errors. Use theColorDefaultconstant from the standard library instead, which is guaranteed to be safe. (Alternatively, you can create your own constant that is local to your mod.)
May 28th, 2022
package.json
IsaacScript mods now require that "typescript-to-lua" is listed as a dependency in your "package.json" file. In other words, type one of the following commands:
# If you use npm:
npm install --save typescript-to-lua
# If you use Yarn:
yarn add typescript-to-lua
# If you use pnpm:
pnpm add typescript-to-lua
Other
- All of the IsaacScript packages are now contained in a monorepo. The other various repositories have been deleted.
- The linting meta-package now uses
eslint-plugin-isaacscript, which contains a bunch of new rules that will make your code safer. - IsaacScript now supports the Yarn package manager. It will use Yarn by default if it detects that you have it installed.
- IsaacScript now shows how many seconds it took to compile the mod.
- Added the following helper functions:
saveDataManagerReset(to force the save data manager to reset a specific set of variables)isHiddenCollectiblegetEdenPassivesgetRandomEdenPassivemapHasPlayer
- Renamed the following helper functions:
preventCollectibleRotate-->preventCollectibleRotation
- Added the following custom console commands:
gridEntities- Spawns every kind of grid entity. Useful for debugging.
- Added the following enums:
PitState
- Fixed the Encyclopedia definitions. (Thanks 4Grabs)
May 21st, 2022
- All functions that take a specific kind of type (e.g.
EntityType,PlayerVariant, etc.) are now no longer in a union withint. This makes the API much more type-safe than before. The flip side of this is that you must change any self-defined enums likeCollectibleTypeCustomto an object instead. See the docs for more details. Vector.ZeroandVector.Oneare now deprecated and will cause compiler errors. Use theVectorZeroandVectorOneconstants from the standard library instead, which are guaranteed to be safe. (Alternatively, you can create your own constants that are local to your mod.)DefaultMapno longer passes the key to the factory function. This means you can clean up the unused_keyargument in all of your default maps. In the rare case that you are actually using the key in the factory, you can pass it explicitly as a normal argument.- Added the following helper functions:
fillLevelWithRedRoomsgetAllDimensionsgetAllCardsgetModdedCardsgetVanillaCardsgetAllPillEffectsgetModdedPillEffectsgetVanillaPillEffectsgetAllPillColorsgetNormalPillColorsgetHorsePillColorsgetCollectibleTypeRangegetVanillaCollectibleTypeRangegetModdedCollectibleTypesgetTrinketTypesgetVanillaTrinketTypesgetModdedTrinketTypesgetDoorEnterPositiongetDoorEnterPositionOffsetgetNormalPillColorFromHorsegetPitsgetPlayersWithTrinketgetPoopsgetPressurePlatesgetRandomEnumValuegetRocksgetRoomNeighborsgetRoomShapeNeighborGridIndexDeltasgetSpikesgetTNTinMineShaftisHeartisCoinisKeyisBombisPoopisSackisPillisBatteryisCollectibleisCardPickupisTrinketisValidCollectibleTypepickingUpItemIsCollectiblepickingUpItemIsTrinketroomGridIndexToXY
- Added a
Zeroconstant for every flag enum. (e.g.EntityFlagZero,TearFlagZero, and so on.) - The "max" constants are changed, with many new ones added:
- Collectibles:
FIRST_COLLECTIBLE_TYPELAST_COLLECTIBLE_TYPELAST_VANILLA_COLLECTIBLE_TYPEFIRST_MODDED_COLLECTIBLE_TYPENUM_VANILLA_COLLECTIBLE_TYPESNUM_MODDED_COLLECTIBLE_TYPESNUM_COLLECTIBLE_TYPES
- Trinkets:
NUM_TRINKET_TYPESNUM_VANILLA_TRINKET_TYPESNUM_MODDED_TRINKET_TYPESFIRST_TRINKET_TYPELAST_TRINKET_TYPELAST_VANILLA_TRINKET_TYPEFIRST_MODDED_TRINKET_TYPE
- Cards:
NUM_CARDSNUM_VANILLA_CARDSNUM_MODDED_CARDSFIRST_CARDLAST_CARDLAST_VANILLA_CARDFIRST_MODDED_CARD
- Pill effects:
NUM_PILL_EFFECTSNUM_VANILLA_PILL_EFFECTSNUM_MODDED_PILL_EFFECTSFIRST_PILL_EFFECTLAST_PILL_EFFECTLAST_VANILLA_PILL_EFFECTFIRST_MODDED_PILL_EFFECT
- Pill colors:
FIRST_PILL_COLORLAST_NORMAL_PILL_COLORFIRST_HORSE_PILL_COLORLAST_HORSE_PILL_COLORNUM_NORMAL_PILL_COLORS
- Players:
FIRST_CHARACTERLAST_VANILLA_CHARACTERFIRST_MODDED_CHARACTER
- Other:
FIRST_STAGELAST_STAGEFIRST_ROOM_TYPELAST_ROOM_TYPE
- Collectibles:
- Added the appropriate
HORSE_enum values to thePillColorenum. - Added the following custom callbacks:
POST_GRID_ENTITY_RENDERPOST_DOOR_RENDERPOST_DOOR_UPDATEPOST_PIT_RENDERPOST_PIT_UPDATEPOST_POOP_RENDERPOST_POOP_UPDATEPOST_PRESSURE_PLATE_RENDERPOST_PRESSURE_PLATE_UPDATEPOST_ROCK_RENDERPOST_ROCK_UPDATEPOST_SPIKES_RENDERPOST_SPIKES_UPDATEPOST_TNT_RENDERPOST_TNT_UPDATE
- You can now register several player-based custom callbacks using
PlayerVariantandPlayerTypeas optional 2nd and 3rd arguments, respectively (e.g.PRE_BERSERK_DEATH). - You can now register all custom grid entity callbacks using an optional 3rd argument of grid entity variant.
- Added the following custom console commands:
map- Reveals the entire map, including Ultra Secret Rooms.doorDisplay- Show debugging information next to every door.pitDisplay- Show debugging information next to every pit.poopDisplay- Show debugging information next to every poop.pressurePlateDisplay- Show debugging information next to every pressure plate.rockDisplay- Show debugging information next to every rock.spikesDisplay- Show debugging information next to every spikes.tntDisplay- Show debugging information next to every TNT.
May 14th, 2022
IsaacScript has now reached version 2! We've come a long way with many features, and there's more yet to come. Version 2 comes with breaking changes, but as always, upgrading your mod is optional.
Breaking Changes
- All enums are now local instead of global. The global declarations have been removed, which forces you to use the local ones. Doing this has several advantages, at the small cost of having to auto-import more things. See the docs for more info.
- Bit flags are now represented as a
BitFlagstype. This means that the Isaac API now has real type safety for all bit flags! See the docs for more info. - Renamed the following helper functions:
range-->irange
- Renamed the following enums:
PillEffectClass-->ItemConfigPillEffectClassPillEffectType-->ItemConfigPillEffectType
- Removed the following enums:
CardType(since it was almost the same thing asItemConfigCardType)
- When registering the
POST_PEFFECT_UPDATE_REORDEREDcallback, the second argument is now aPlayerVariantinstead of aPlayerType. It now takes aPlayerTypeas a third argument.
Non-Breaking Changes
isaac-typescript-definitionsnow ships with an official Isaac word dictionary that can be imported into CSpell. See the new template for more information.- Added the following helper constants since the corollary enum values were purged:
NUM_CARDS/MAX_CARD/NUM_VANILLA_CARDS/MAX_VANILLA_CARDNUM_COLLECTIBLE_TYPES/MAX_COLLECTIBLE_TYPE/NUM_VANILLA_COLLECTIBLE_TYPES/MAX_VANILLA_COLLECTIBLE_TYPENUM_PILL_EFFECTS/MAX_PILL_EFFECT/NUM_VANILLA_PILL_EFFECTS/MAX_VANILLA_PILL_EFFECTNUM_TRINKET_TYPES/MAX_TRINKET_TYPE/NUM_VANILLA_TRINKET_TYPES/MAX_VANILLA_TRINKET_TYPE
- Added the following helper functions:
doorSlotFlagToDoorSloterange(for exclusive ranges)getArrayIndexesgetEnumEntriesgetGridEntityIDgetRoomTypeNameisModdedPlayerisVanillaPlayerlogLevelStateFlagsremoveAllCharactersremoveSubstring
- Added the following enums:
DoorSlotFlag
- Added the following custom callbacks:
POST_GREED_MODE_WAVEPOST_HOLY_MANTLE_REMOVED
April 28th, 2022
- Added many new custom console commands, including
playerDisplay,npcDisplay, and so on for rendering custom text on top of an entity for debugging purposes. See theisaacscript-commondocumentation for the full list. - Added the following helper functions:
defaultMapSetPlayertodoprintEnabled
- Renamed the following helper functions:
getPlayerNumTransformationCollectibles-->getPlayerNumCollectiblesForTransformation
- Added custom callbacks:
POST_FAMILIAR_STATE_CHANGEDPOST_PICKUP_STATE_CHANGEDPOST_EFFECT_STATE_CHANGEDPOST_NPC_STATE_CHANGEDPOST_ITEM_DISCHARGE
April 21st, 2022
- Added the following helper functions:
getBossSet(for getting the set of vanilla bosses)getCombinedBossSet(for getting the set of vanilla bosses)getAllBossesSetspawnBossspawnBossWithSeedgetUnusedDoorSlotsgetRoomsOfDimensionregisterCharacterHealthConversion(for making custom characters like Blue Baby or Tainted Judas)getCollectibleTagsgetPlayerCollectibleCountgetCollectibleTypesWithTaggetPlayerNumCollectiblesWithTag
ItemConfigTagis no longer a constant enum and must be imported. You can now iterate over this enum in your code.
April 14th, 2022
- Added the following helper functions:
playerHasCollectibleplayerAddCollectiblearrayRemoveIndexarrayRemoveIndexInPlace
April 2nd, 2022
- Added the
--yesflag toisaacscript init. - Added the following helper functions:
vectorToStringspawnspawnWithSeedgetCoinValue
- Added the helper functions of
spawnPickup,spawnPickupWithSeed, and so on for every specific type of entity. - Added the helper functions of
removeAllPickups, and so on for every specific type of entity. - Added every easing function from easings.net.
- Added the
VectorZeroandVectorOneconstants. (These are safer to use than the vanillaVector.ZeroandVector.Oneconstants.)
March 26th, 2022
- Added the changes for vanilla patch 1.7.8a. Several values missing from the vanilla enums are added a well.
- The API's
Randomfunction should never be used directly. Use thegetRandomSeedhelper function instead to prevent crashes. - If you have
ghinstalled (i.e. the GitHub CLI), IsaacScript will now prompt you to automatically create a new GitHub repository when initializing a new mod. - The IsaacScript save data manager will now automatically serialize the
RNGclass. Thus, you can now useRNGobjects instead of seeds in your data structures. This is more convenient than using seeds because thegetRandomseries of functions will automatically "next" the seed. Also, it is slightly safer because you avoid initializing a seed to 0. - The IsaacScript save data manager will now automatically serialize the
Colorclass and theKColorclass. - Added the following helper functions:
enableFastReset(useful for debugging)disableFastReset(useful for debugging)removeFadeIn(useful for debugging)restoreFadeIn(useful for debugging)getDefaultPlayerStatregisterCharacterStats(for the new character stats management feature)getEnumKeysgetActiveItemSlotisFirstSlotPocketActiveItemgetPlayerHeartsgetRedHeartsisRedHeartgetCoinsgetKeyscharacterStartsWithActiveItemgetDirectionNamevalidateCustomEnumaddStatlogErrorgetRandomSeedisUserdataObjectisRNGcopyRNGisColorgetDoorSlotsForRoomShapeisDoorSlotInRoomShapegetRoomAllowedDoorscopyValuesToTablegetNumbersFromTablegetStringsFromTablegetBooleansFromTablesetSeedsetAllRNGToSeedsetAllRNGToStartSeedisSingetGridIndexDeltalogUserdataisCharactertexelEqualsspriteEqualscollectibleSpriteEqualscopySerializableIsaacAPIClassisSerializedIsaacAPIClasscolorEqualskColorEqualsrngEqualsvectorEqualsroomExistsgetRoomShapeisDoorSlotValidAtGridIndexisDoorSlotValidAtGridIndexForRedRoomdirectionToDegreesgetRoomShapeBottomRightPositiongetRoomShapeTopLeftPositiongetRoomShapeBoundsgetRoomShapeLayoutSizegetRoomShapeVolumenewChargeBarSpritesrenderChargeBarisLRoomgridIndexToGridPositionisValidGridPositiongetRoomShapeWidthbenchmark
- Renamed the following helper functions:
getLastHeart-->getPlayerLastHeartgetSoulHearts-->getPlayerSoulHeartsgetBlackHearts-->getPlayerBlackHeartsinitRNG-->newRNGgridToPos-->gridCoordinatesToWorldPosition
- Added the
getRandomFromSeedseries of functions. You can use these if you don't want to convert your data structures to useRNGobjects. - Deleted the
getRandomFromRNGseries of functions. ThegetRandomseries of functions now takeRNGobjects. - Added the following constants:
TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGEMAX_TAINTED_SAMSON_BERSERK_CHARGELEVEL_GRID_ROW_LENGTHLEVEL_GRID_COLUMN_HEIGHT
- Added the following enums:
BloodExplosionSubTypeCurseRoomSubType
- Added
PICKUP_MISSING_SHOVELto thePickupVariantenum. (It is missing in the vanilla enum.) - Added the following custom callbacks:
POST_COLLECTIBLE_INIT_FIRST
March 19th, 2022
- The standard library now comes with many helpful console commands. Activate them by calling
enableExtraConsoleCommands. You can also useaddConsoleCommandto add your own commands andremoveConsoleCommandto remove ones that overlap with your own commands. See the documentation for the specific list of commands. - Added the following helper functions:
getMapPartialMatchrestartlogSoundslogEntitieslogGridEntitiesaddPlayerHealthTypegetPlayerHealthTypegetCharacterNamegetPlayerInventory(to get a list of all of the player's collectibles)addCollectibleisActiveSlotDoubleChargedisActiveSlotEmptydoorSlotToDirectioninitCustomDoorspawnCustomDoorgetTaintedLazarusSubPlayersetTrinketSpritecapitalizeFirstLetterisActiveCollectiblegetCollectibleIndex
- Added the following constants:
CARD_MAPCHARACTER_MAPPILL_EFFECT_MAPMAX_SPEED_STATROOM_TYPE_MAPROOM_TYPE_NAME_MAPCHARACTER_NAME_MAPDIRECTION_NAMES
- Added the following custom callbacks:
POST_SLOT_ANIMATION_CHANGEDPOST_CUSTOM_DOOR_ENTERROOM_CLEAR_CHANGED
March 12th, 2022
- Added
game,itemConfig,musicManager, andsfxManagercached classes to the standard library. You can use these instead of invoking the constructor yourself for a miniscule performance increase. - Added the following helper functions:
isEdenlogPlayerHealthenableAllSounddisableAllSoundgetTaintedMagdaleneNonTemporaryMaxHeartsdefaultMapGetPlayer(to make it easier to work with maps that usePlayerIndexas an index)mapGetPlayer(to make it easier to work with maps that usePlayerIndexas an index)mapSetPlayer(to make it easier to work with maps that usePlayerIndexas an index)setAddPlayer(to make it easier to work with sets that usePlayerIndexas an index)setDeletePlayer(to make it easier to work with sets that usePlayerIndexas an index)setHasPlayer(to make it easier to work with sets that usePlayerIndexas an index)mapGetNextSeed(to make it easier to work with maps that haveSeedvalues)defaultMapGetNextSeed(to make it easier to work with maps that haveSeedvalues)canPlayerCrushRocks
- Removed
TRINKET_GOLDEN_FLAGandTRINKET_ID_MASKfrom theTrinketTypeenum. They are now exposed as constants. - Removed
PILL_GIANT_FLAGandPILL_COLOR_MASKfrom thePillColorenum. These are now exposed as constants. - Added
USE_ECHO_CHAMBERto theUseFlagenum. (This is missing in the vanilla enum.)
March 5th, 2022
- Added the following helper functions:
willReviveFromHeartbreakisPonyActiveinSecretShoplogRoomcountSetBitsgetSoulHearts(this is different from the vanilla function)getBlackHearts(this is different from the vanilla function)getHeartsinMegaSatanRoomcountEntitiesgetSortedSetValuesgetRandomSetElementgetCardTypegetMaxCardsgetMaxPillEffectsisCardTypeisTarotCardisSuitCardisSpecialCardisTarotReverseCardisModdedCardgetRandomCardTypegetEntityIDclearCollectibleSpritegetCollectiblePedestalType
- Renamed the following helper functions:
combineArray-->combineArrays
- Removed the following helper functions:
getRandomHeartSubType
- Added the following constants:
CARD_TYPE_MAP
- Added the following enums:
ShopSubTypeTreasureRoomSubTypeChallengeRoomSubTypeLibrarySubTypeDungeonSubTypeIsaacsRoomSubTypeSecretExitSubTypeDownpourRoomSubTypeMinesRoomSubTypeCollectiblePedestalType
- Renamed the following enums:
BackwardsPathRoomSubType-->BackwardsRoomSubType
- The signature for the
POST_PURCHASEcustom callback has changed to the following:
function postPurchase(player: EntityPlayer, pickup: EntityPickup): void {}
February 26th, 2022
- The
Isaac.GetPlayermethod will no longer return undefined. (You can now delete any undefined-related checks.) - Added the
EntitySubPlayerclass to prevent bugs withRNG. (EntityPlayer.GetSubPlayeris defined as returning this.) - Added the
DefaultMapclass. Use this instead of aMapif you need a data structure that will automatically instantiate default values. See the documentation for more information. - Added the following helper functions:
checkFamiliarcheckFamiliarFromCollectiblesisShootActionisMoveActionremoveDoorremoveDoorsremoveAllDoorsgetDoorsToRoomIndexrepeatgetEffectsListisGridEntityBreakableByExplosionisGridEntityBrokengetAllPlayersgetGridEntitiesMapremoveAllSlots
- Renamed the following helper functions:
tableClear-->clearTable- Various array functions to be more consistent with map/set functions.
- The disable inputs feature now supports multiple mod features at once. The functions now require a key that matches the name of the calling mod feature.
- The
getPlayerIndexfunction now takes adifferentiateForgottenAndSoulargument, which is false by default. - Added the following constants:
NUM_DIMENSIONSCHEST_PICKUP_VARIANTS
- Added the following enums:
LostSoulStatePoopStateSpiderWebStateSpikesOnOffStateLockStateTNTStatePoopStateStairsState
- Added the following custom callbacks:
POST_BONE_SWINGPOST_GRID_ENTITY_CHANGE_STATEPOST_GRID_ENTITY_BROKEN
- The signature of the
POST_PLAYER_CHANGE_TYPEcustom callback has changed to:
function postPlayerChangeType(
player: EntityPlayer,
oldCharacter: PlayerType | int,
newCharacter: PlayerType | int,
) {}
February 19th, 2022
isaacscriptnow requires a Git version of at least 2.30.isaacscriptnow supports a--verboseflag for additional output.- Added the following helper functions:
setCollectiblesRerolledForItemTracker(Thanks Gamonymous)getRandomArrayElementAndRemoverangesaveDataManagerLoadisTaintedtrimPrefixgetPlayerNamestringContainsisVanillaCharacterisModdedCharactergetPillEffectClassgetPillEffectTypecollectibleHasCacheFlaggetCollectiblesForCacheFlaggetPlayerCollectiblesForCacheFlagisCircleIntersectingRectangleinRectanglegetCollidingEntitiesWithGridEntitydeleteSetsFromSetgetFlyingCollectiblesisTransformationFlyinghasFlyingTransformationtrinketHasCacheFlaggetTrinketsForCacheFlaggetFlyingTrinketsgetPlayerTrinketsForCacheFlagisFlyingCharacterrunNextRenderFramerunInNRenderFramesstopAllSoundEffects
- Renamed the following helper functions:
runNextFrame-->runNextGameFramerunInNFrames-->runInNGameFrames
- Refactored transformation related helper functions to be more private, to be lazy initialized, and to use sets instead of arrays.
- Added the following constants:
SECOND_IN_MILLISECONDSMINUTE_IN_MILLISECONDSPILL_EFFECT_CLASS_MAPPILL_EFFECT_TYPE_MAPDEFAULT_PILL_EFFECT_CLASSDEFAULT_PILL_EFFECT_TYPE
- Added the following enums:
PillEffectTypePillEffectClassMotherSubTypePickupNullSubType
- Added the following custom callbacks:
POST_GRID_ENTITY_COLLISION
February 12th, 2022
- TSTL has been upgraded such that the lualib does not create any global variables.
- Added the following helper functions:
getCollectibleQualitygetCharacterscombineSetsgetDefaultGlobalsgetNewGlobalslogNewGlobalsaddSetsToSetuseActiveItemTemp
- Renamed the following helper functions:
getPlayerNumAllHearts-->getPlayerNumHitsRemaining
February 5th, 2022
- Added the
canTakeFreeDevilDealshelper function. - Added the
CHARACTERS_WITH_FREE_DEVIL_DEALSconstant. - Added the
BloodClotSubTypeenum. (Thanks KatTheFox)
January 29th, 2022
- Added the
STORY_BOSSESconstant. - Added the
isStoryBosshelper function.
January 22nd, 2022
- Added the
isRepentanceStagehelper function.
January 14th, 2022
- Added the following helper functions:
isDamageToPlayerFatalgetHeartRowLength
- Added the following custom callbacks:
PRE_BERSERK_DEATH
January 7th, 2022
- Added the
MAX_VANILLA_CHARACTERconstant.
December 31st, 2021
- Updated the
TrapdoorVariantenum. - Added the
spawnVoidPortalhelper function.
December 26th, 2021
- Updated TSTL to version 1.3.0.
- The
Level.ChangeRoommethod will now throw a compiler error, since it does not update thefxlayerscorrectly. (Game.ChangeRoomshould be used instead.) - Added the following helper functions:
openDoorFastcloseDoorFast
- The
changeRoomandteleporthelper functions now check to see if the room exists first to prevent crashes. - Added the following enums:
BrokenWatchState
December 19th, 2021
- New projects created with
isaacscript initwill now automatically include XML linting in thelint.shscript + CI. (This linter found bugs in the production versions of Babies Mod & Forgotten Fables, so it seems useful.) - New projects created with
isaacscript initwill now automatically includepull.rebase=truein the ".gitattributes" file. (This prevents merge commits by default.) isaacscript publishwill now use the Nicalis mod uploader tool when it detects thatsteamcmdis not available. (Previously, it would error and do nothing.)- Added the following helper functions:
logAllSeedEffectslogTemporaryEffectsgetFilteredEntities(Thanks KatTheFox)fireProjectiles(Thanks KatTheFox)rerollEnemy(Thanks KatTheFox)characterGetsBlackHeartFromEternalHeart
- Added the following constants:
CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART
- Added the
AnyEntitytype, which is the composition ofEntity,EntityBomb,EntityPickup, and so on.
December 12th, 2021
Prettier
eslint-plugin-prettier is no longer used in favor of using Prettier directly. Doing this has pros and cons, but has more pros than cons.
As a result of the change, you will no longer see linting errors in VSCode for formatting-related issues. (Of course, all of the formatting-related issues will still be fixed automatically upon saving the file, same as it was before.)
If you decide to upgrade isaacscript-lint in your existing projects, you should also perform the following steps to keep Prettier working:
-
Install the Prettier VSCode extension.
-
Add the Prettier VSCode extension to
extensions.json:
"esbenp.prettier-vscode", // The TypeScript formatter
- Add the following lines to the
"[javascript]"and"[typescript]"sections of thesettings.jsonfile:
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
- Add the following to the
lint.shfile:
# Use Prettier to check formatting
npx prettier --log-level=warn --check .
Other
- The
isaacscripttool now uses a different prompt library, which fixes the bug where prompts would be repeated in a Git Bash shell. - The
isaacscripttool will now automatically initialize a Git repository for new projects. Having the GitHub CLI installed is recommended, since it helps the tool guess what your GitHub username is. - Rewrote & simplified the "Getting Started" page.
- Added the following helper functions:
temporarilyRemoveTrinket(which removes all trinkets)smeltTrinketgetTransformationNamegetCurrentRoomDescReadOnlyisRedKeyRoomarrayCombinearrayCopygetChallengeName
- Renamed the following helper functions:
temporarilyRemoveTrinkets-->temporarilyRemoveTrinket(because it only removes a single trinket)
- The
getEntitiesand related helper functions now return a boolean, indicating if they removed one or more entities. - The
clearSpritehelper function now clears all layers by default. - The
getDoorshelper function is now variadic. - Added the following constants:
TRANSFORMATION_NAME_MAPCHALLENGE_NAME_MAP
- Added the following custom callbacks:
POST_TRINKET_BREAKPOST_PEFFECT_UPDATE_REORDERED
December 5th, 2021
- Updated the TypeScript definitions for vanilla patch 1.7.7.
- Fixed the bug where the monkey patch was not working on TSTL v1.2.0.
- The
upgradeModfunction will now monkey-patch theerrorfunction to provide tracebacks if the--luadebugflag is turned on. - The
upgradeModfunction will now monkey-patch theprintfunction to work like it normally does if the--luadebugflag is turned on. - Added the following helper functions:
isSingleUseCollectiblesetCollectibleEmptyclearSpritegetRoomListIndexgetTopLeftWallgetTopLeftWallGridIndexisRoomInsideMaplockDoorinMinibossRoomOfgetAllRoomGridIndexesisAllRoomsClearisLuaDebugEnabledgoToStagestageTypeToLettergetRoomscopyMapgetStartSeedStringgetStagegetStageTypegetPlayerAvailableHeartSlotsgetCharacterMaxHeartContainersgetPlayerMaxHeartContainersisFamiliarThatShootsPlayerTearsisEntityMoving
- Renamed the
getRoomIndexhelper function togetRoomSafeGridIndex. This should no longer be used as an index for data structures that store data per room because it does not work properly between dimensions;getRoomListIndexshould be used instead. - Added optional
variant,subType, andcaparguments to all of the remove entity helper functions. - The
pngPathto thesetCollectibleSpritehelper function is now optional; if not specified, it will remove the item graphic from the pedestal. - The
anyPlayerIshelper function is now variadic. - Added the following constants:
COLORSFINAL_STAGEBLIND_ITEM_PNG_PATHEMPTY_PNG_PATHFAMILIARS_THAT_SHOOT_PLAYER_TEARS
- Added the following enums:
MinibossIDSkinColor(from vanilla patch 1.7.7)CrawlspaceVariant(alias forStairsVariant)
- Added the following custom callbacks:
POST_NEW_ROOM_EARLYPRE_NEW_LEVELPOST_TEAR_INIT_VERY_LATE
- The save data manager now uses the
POST_NEW_ROOM_EARLYcallback instead of thePOST_NEW_ROOMcallback, which means that you can use it in situations where you previously would not be able to.
November 28th, 2021
isaacscript publishnow accepts a--dry-runflag that will skip committing to GitHub and invokingsteamcmd.isaacscript publishwill now print out the standard output of the pre-publish script and the post-publish script, if any.isaacscript publishnow accepts an--only-uploadflag that will only upload the mod to the Steam Workshop without doing anything else.- Added the following helper functions:
isGoldenTrinketprintConsolefindFreePositionisPassiveCollectibleisTaintedLazaruslogVectorgetRoomItemPoolTypeinBossRoomOfgetCollectibleItemPoolTypecloseAllDoorsspawnCollectiblesetGridEntityInvisiblepreventCollectibleRotateremoveCollectiblePickupDelayisDevilsCrownTreasureRoomgetCollectibleDescriptiongetTrinketDescriptiongetCardDescriptiongetEntityPositionssetEntityPositionsgetEntityVelocitiessetEntityVelocitiesroomUpdateSafesetActiveItemgetFirstCardOrPillgetCollectibleGfxFilenamecharacterCanHaveRedHeartscharacterCanHaveSoulHearts
- Added the following helper functions related to the new JSON rooms feature:
deployJSONRoomdeployRandomJSONRoomemptyRoomsetRoomClearedsetRoomUnclearedconvertXMLGridEntityTypegetJSONRoomOfVariantgetJSONRoomsOfSubTypegetRandomJSONRoom
- Renamed the following helper functions:
changeCollectibleSubType-->setCollectibleSubTypeisNotCardOrRune-->isPocketItemObject
- The following helper functions are now variadic:
arrayRemovearrayRemoveInPlace
- The following helper functions now accept an optional
exceptionsargument:getRandomArrayElementgetRandomHeartSubTypegetRandomCardgetRandomRune
- Removed the following helper functions:
inBlueBabyRoominLambRoominItLivesRoom
- Added the following constants:
CHARACTERS_WITH_AN_ACTIVE_ITEMDEFAULT_ITEM_POOL_TYPEROOM_TYPE_TO_ITEM_POOL_TYPE_MAPGENESIS_ROOM_SUB_TYPECOLLECTIBLE_DESCRIPTION_MAPTRINKET_DESCRIPTION_MAPCARD_DESCRIPTION_MAPLOST_STYLE_PLAYER_TYPESCARDSCARD_SETRUNESRUNE_SETPOCKET_ITEM_OBJECTSPOCKET_ITEM_OBJECT_SET
- Added the following enums:
PoofSubType
- Renamed the following enums:
BossIDs-->BossID
- Added the
slotfield to thePocketItemDescriptionenum.
November 21st, 2021
- The TypeScript definitions show now reflect the API for vanilla patch v1.7.6. (Thanks KatTheFox)
- Added function definitions for the global functions provided by the Racing+ sandbox.
- Added the following helper functions:
removeGridEntityremoveAllMatchingGridEntitiesgetLanguageNamegetBombsgetEffectsgetFamiliarsgetKnivesgetLasersgetPickupsgetProjectilesgetTearsremoveAllBombsremoveAllEffectsremoveAllFamiliarsremoveAllKnivesremoveAllLasersremoveAllNPCsremoveAllPickupsremoveAllProjectilesremoveAllTearsremoveAllGridEntitiesExceptForaddRoomClearChargesaddRoomClearChargeaddRoomClearChargeToSlotplayChargeSoundEffectcopyColorcopyKColorcopyVectorgetDefaultColorgetDefaultKColorgetOneVector(using this is safer than using theVector.Onevariable because the variable can be overwritten or modified)getZeroVector(using this is safer than using theVector.Zerovariable because the variable can be overwritten or modified)isPostBossVoidPortalisSelfDamageremoveAllCollectiblesgetHeartsUIWidthgetCollectibleDevilHeartPricegetCollectibleItemTypeaddCollectibleCostumeaddTrinketCostumesetLogFunctionsGlobal(for easier debugging)setEntityRandomColorgetRandomHeartSubTypegetRandomCardisCardisNotCardOrRuneisRunegetRandomRuneisAllPressurePlatesPushedisAliveExceptionNPCisRaglingDeathPatchisBethanygetCollectiblesgetEntitiesgetTrinketsgetSlotsgetAzazelBrimstoneDistanceisMoveActionPressedOnAnyInputisMoveActionTriggeredOnAnyInputisShootActionPressedOnAnyInputisShootActionTriggeredOnAnyInputisDyingEggyWithNoSpidersLeft
- Renamed the following helper functions:
removeCostumeCollectible-->removeCollectibleCostumeremoveCostumeTrinket-->removeTrinketCostume
- Removed the
getLanguagehelper function. (You should now useOptions.Languageinstead, which returns the language abbreviation / resource suffix.) - The
getHUDOffsetVectorhelper function will now use the vanillaHUDOffsetsetting (instead of the ModConfigMenu setting). - The
getAliveBossesandgetAliveNPCshelper functions will now use an internal blacklist to exclude certain entities, such as Death's scythes or Big Horn holes. - The
getNPCshelper function now accepts optional arguments to match entity type, variant, and sub-type. It also accepts an optional argument to exclude friendly NPCs. - Added the following constants:
BOMB_EXPLODE_FRAMEUI_HEART_WIDTHMAX_NUM_FAMILIARSAZAZEL_DEFAULT_BRIMSTONE_DISTANCEEGGY_STATE_FRAME_OF_FINAL_SPIDER
- Added the following enums:
RenderModeRoomDescriptorDisplayType(to match the vanilla counterpart)RoomDescriptorFlag(to match the vanilla counterpart)LanguageAbbreviation(which corresponds to the string returned inOptions.Language)
- Added
POOL_ULTRA_SECRETto theItemPoolTypeenum. - Added the following custom callbacks:
POST_SLOT_DESTROYED
POST_GRID_ENTITY_INITandPOST_GRID_ENTITY_REMOVEnow will fire on either thePOST_UPDATEframe or thePOST_RENDERframe, whichever happens first (instead of just thePOST_UPDATEframe). (This allows grid entities to be removed before any sprite shows up on the screen.)
November 14th, 2021
- Added the updates from vanilla patch v1.7.5.
- The
TemporaryEffects.RemoveCollectibleEffect,TemporaryEffects.RemoveNullEffect, andTemporaryEffects.RemoveTrinketEffectmethods will now throw compiler errors since they are broken in patch v1.7.5. ItemConfigItem.Name,ItemConfigCard.Name, andItemConfigPillEffect.Namewill only work for modded items, so it is recommended to use the helper functions ofgetCollectibleName,getTrinketName,getCardName, andgetPillEffectNameuntil the next patch.Isaac.CountEntitiesis now a legal method.- Added the following helper functions:
getPlayerHealthsetPlayerHealthsetFamiliarNoSirenSteal(Thanks KatTheFox)hasSirenStolenFamiliar(Thanks KatTheFox)getFinalPlayergetClosestEntityTogetCardNamegetPillEffectNameremoveAllPlayerHealthgetLanguage
- Renamed the following helper functions:
removeItemFromItemTracker-->removeCollectibleFromItemTracker
- The
getItemNamehelper function has been split up intogetCollectibleNameandgetTrinketName. - Added the following constants:
COLLECTIBLE_NAME_MAPTRINKET_NAME_MAPCARD_NAME_MAPPILL_EFFECT_NAME_MAPMAX_PLAYER_HEART_CONTAINERS
- Added the following enums:
PoopEntityVariantPoopSpellType(from vanilla)LaserSubType(from vanilla)
- Renamed the following enums:
PoopVariant-->PoopGridEntityVariant
- Added more entries to the
LaserVariantenum. - Added
COLLECTIBLE_GLASS_EYE,COLLECTIBLE_STYE, andCOLLECTIBLE_MOMS_RINGto the vanillaCollectibleTypeenum. - Added the following custom callbacks:
POST_BOMB_INIT_LATEPOST_EFFECT_INIT_LATEPOST_FAMILIAR_INIT_LATEPOST_KNIFE_INIT_LATEPOST_NPC_INIT_LATEPOST_PROJECTILE_INIT_LATEPOST_TEAR_INIT_LATE
November 7th, 2021
IsaacScript will now insert the following at the beginning of every transpiled "main.lua" file so that people reading the code will be less confused:
--[[
This Isaac mod was created with the IsaacScript tool.
The Lua code in this file is not actually the source code for the program. Rather, it was
automatically generated from higher-level TypeScript code, and might be hard to read. If you want to
understand how the code in this mod works, you should read the actual TypeScript source code
directly instead of trying to read this file. Usually, the link to the source code can be found in
the mod's description on the Steam Workshop. If not, you can ask the mod author directly if the
source code is publicly available.
IsaacScript provides a lot of advantages over using raw Lua. For more information about the tool,
see the official website: https://isaacscript.github.io/
--]]
- IsaacScript will now correctly handle symlinks and alternate versions of VSCode. (Thanks KatTheFox)
- Added the following helper functions:
getRandomArrayIndexarrayRemoveInPlacegetMaxTrinketIDgetTrinketSetspawnGiantPoopspawnGridEntityspawnGridEntityWithVariantgetAliveNPCsdirectionToVector(Thanks KatTheFox)removeCostumeCollectibleremoveCostumeTrinketarrayShufflearrayShuffleInPlace
- Renamed the following helper functions:
initArray-->arrayInit(to be more consistent with the other array functions)
- The
seedargument forgetRandomFloat,getRandomInt,initRNG,getRandomArrayElement, andgetRandomArrayIndexfunctions are now optional and will useRandom()if no seed is specified. - Added the following enums:
RockStatePokyVariantGaperVariantGusherVariantPooterVariantClottyVariantMulliganVariantShopkeeperVariantLarryJrVariantHiveVariantChargerVariantGlobinVariantBoomFlyVariantMawVariantHostVariantChubVariantHopperVariantBoilVariantSpittyVariantLeaperVariantMrMawVariantBabyVariantGutsVariantKnightVariantStoneHeadVariantMonstro2VariantSlothVariantLustVariantWrathVariantGluttonyVariantGreedVariantEnvyVariantPrideVariantDopleVariantLeechVariantMemBrainVariantParaBiteVariantEyeVariantSuckerVariantWarVariantDukeVariantLokiVariantFistulaVariantMomsHeartVariantGurgleVariantWalkingBoilVariantHeartVariantMaskVariantWidowVariantDaddyLongLegsVariantConstantStoneShooterVariantBabyLongLegsVariantCrazyLongLegsVariantFattyVariantSwingerVariantDipVariantSquirtVariantSkinnyVariantBonyVariantHomunculusVariantTumorVariantNerveEndingVariantGurglingVariantGrubVariantWallCreepVariantRageCreepVariantRoundWormVariantConjoinedFattyVariantPolycephalusVariantMegaSatanVariantMoveableTNTVariantUltraCoinVariantStoneyVariantPortalVariantLeperVariantMrMineVariantRagManVariantUltraGreedVariantRagMegaVariantBloodPuppyVariantSubHorfVariantPoltyVariantPreyVariantRockSpiderVariantFlyBombVariantDannyVariantGyroVariantFacelessVariantMoleVariantBigBonyVariantGuttyFattyVariantExorcistVariantWhipperVariantPeeperFattyVariantRevenantVariantCanaryVariantGaper2VariantCharger2VariantEvisVariantDumpVariantNeedleVariantCultistVariantVisFattyVariantGoatVariantVisageVariantSirenVariantScourgeVariantChimeraVariantSingeVariantRaglichVariantClutchVariantGenericPropVariantConstantStoneShooterSubType
- Added the following constants:
ONE_BY_ONE_ROOM_GRID_SIZE
October 31st, 2021
- IsaacScript will now warn you if your mods directory is a symlink.
- Added the following helper functions:
logTablenextSeed
getGridEntitiesnow accepts a variadic amount of arguments (instead of just one).- Swapped the order of the arguments of
runInNFramesso that it matches the ordering of thesetTimeoutfunction.
October 24th, 2021
- Added several parts of the
isaacscript-commonlibrary to the docs that were previously undocumented, including constants and features. - Renamed the
getScreenhelper functions to have aPossuffix so that they match the naming convention of the vanilla functions. - Added the following enums:
RockVariantPitVariant
- Added a
GRID_ENTITY_XML_MAPconstant (for converting betweenGridEntityXMLTypeandGridEntityType/ variant).
October 17th, 2021
- The IsaacScript watcher emoji eyes have been changed to the TypeScript logo.
isaacscript.jsonnow has two new optional options:customTargetModDirectoryName- By default, the target mod directory name will be the same as the project directory name. This setting allows you to customize it.enableIsaacScriptWatcherAutoRestart- When your code is recompiled, IsaacScript watcher can restart the game to ensure that any run-related variables are properly reset. This is set to true by default.
- The StageAPI definitions and the MinimapAPI definitions are now more complete. (Thanks KatTheFox)
CardConfigList.Getwill now cause a compiler error, since it returns useless userdata.- Added the following helper functions:
getLastHeart(Thanks KatTheFox)getCircleDiscretizedPoints
October 10th, 2021
- Added the following helper functions:
getKBitOfNgetNumBitsOfNgetRoomNamesetBlindfold
- Added the following constants:
ISAAC_FRAMES_PER_SECONDGAME_FRAMES_PER_SECOND
- Added TypeScript definitions for the socket library.
October 3rd, 2021
- Added the following helper functions:
logColorlogKColor
September 26th, 2021
- Added the
hexToKColorhelper function.
September 14th, 2021
- IsaacScript will now monkey patch your Lua code (after it is copied) to fix the
Map/Setblowing-away issue.- This means that if you were disabling luaBundle for production builds, you can stop doing that.
- And you can also un-namespace your mod directory if you did that as well.
- I will remove the monkey patch code once TSTL fixes the bug upstream.
- There is a regression in the latest version of TSTL. If your
main.luafile is no longer created inside of the mod directory, the fix is to do this: https://github.com/IsaacScript/isaacscript/commit/d3dc85b8cdacb58b108641669fdb670492a296be - A particular bug that the monkey patch won't fix is that implicitly iterating over a
Map(instead ofMap.entries()), or iterating over aSet(instead ofSet.values()) won't work anymore. Thus, you should change all of your code to be explicit. isaacscript-lintnow contains a rule that warns on implicitMaporSetiteration. It comes with an auto-fixer so that all you have to do is save the file to fix the code.- The save data manager now supports TSTL classes.
- Added a new linter rule to disallow void return types on unexported functions.
- Added the following helper functions:
logMaplogSetlogArraychangeCollectibleSubTypeinStartingRoom
- The
getRoomIndexesForTypehelper function now returns aSet(instead of an array). - The
getDoorshelper function now takes an optional argument ofroomType. - The
getGridEntitieshelper function now takes an optional argument ofgridEntityTypeto narrow the returned array. - Added the following enums:
DeathsHeadVariantRaglingVariantVisVariantDeathVariantPeepVariantBegottenVariantMamaGurdyVariantBigHornVariantLittleHornVariantChargerVariant
September 7th, 2021
bundleEntry.ts
- Before,
isaacscript initset your bundle entry point in thetsconfig.jsonfile to be./src/main.ts. - Now,
isaacscript initsets your bundle entry point tobundleEntry.ts, which in turn runsmain.ts.
The reason for this is that any functions and variables that you declare in a TSTL bundle entry point will automatically become global variables. And you should (almost) never be creating any global variables. So, if you declare any functions or variables in your main.ts file, you can "fix" it by performing the following steps:
- In
tsconfig.json, set"luaBundleEntry": "./src/bundleEntry.ts" - Create
./src/bundleEntry.tsand paste in the contents of this file. - Put everything in your
main.tsfile into aexport default function main()function
luaBundle
I found an issue where if multiple IsaacScript mods are turned on at the same time, and they use maps, an issue with TSTL can cause map-related run-time errors to occur. Eventually, this bug should be fixed upstream, we just have to wait for them to fix it.
In the meantime, if you experience any map related errors with your production mod, the solution is to 1) turn luaBundle off in tsconfig.json, and 2) rename bundleEntry.ts to main.ts (see below).
Note that you don't want to do this in development, because having your mod split up into separate files will prevent isaacscript-watcher from hot-reloading your mod. Just change it before pushing out a production build.
That's all you technically need to do, but there is an additional gotcha. In Lua land, there is no concept of relative paths, which means that if you happen to have a file that is named exactly the same as someone else's file (like "globals.ts" or "util.ts"), it can cause conflicts. (This isn't just a problem for IsaacScript mods, it applies to everyone making Isaac mods. It doesn't normally apply to IsaacScript mods though because everything is usually packed into a singe main.lua.)
So as an additional measure, you can namespace your entire mod into a subdirectory with the name of your mod:
forgotten-fables/
└── src/ (TypeScript source code)
├── main.ts (with 1 line that just imports and runs "forgotten-fables/main")
└── forgotten-fables/
├── main.ts (exporting a function to run)
└── the rest of the code
This way, ./mod1/util.lua won't "match" ./mod2/util.lua, for example. Depending on how long it takes for TSTL to fix the bug, I can create tooling to automate most of this.
null --> undefined
In the TypeScript definitions, all instances of null are now replaced with undefined.
Initially, I used null to represent nil, but this was an incorrect way to model the API because null is supposed to be an instantiated value that "exists" (even though it is transpiled to the same thing). In the future, TypeScriptToLua might transpile null to a real value, so I want to do this change now before that happens.
If you are upgrading to the latest version, this might be a breaking change, because code like the following:
const player2 = Isaac.GetPlayer(1); // player2 type is "EntityPlayer | null"
if (player2 === null) {
return;
}
player2.AddHearts(1); // player2 type is "EntityPlayer"
Needs to be changed to:
const player2 = Isaac.GetPlayer(1); // player2 type is "EntityPlayer | undefined"
if (player2 === undefined) {
return;
}
player2.AddHearts(1); // player2 type is "EntityPlayer"
You can still use null in your own variables, but make sure that it is for variables that you want to model as having an actual null-type defined value.
Other
- Added the following helper functions:
addTearsStatgetPlayerFromIndexgetVisibleHeartsgetTotalChargeisLostgetDeathAnimationNamegetRoomIndexesForTypekeyboardToStringcontrollerToStringinItLivesRoominBlueBabyRoominLambRoomroundsetCollectibleBlindsetCollectibleSpriteisChestinDimension
- Removed the following helper functions:
getPlayerFromEntityPtr(sinceEntityPtris not serializable,PlayerIndexshould be used instead)
- Renamed the following helper functions:
isQuestItem-->isQuestCollectible
- Added the following constants:
SINGLE_USE_ACTIVE_COLLECTIBLE_TYPESMAX_ROOM_INDEX
- Added the following enums:
DaddyLongLegsStateReapCreepStateBigHornStateDeathStateTrapdoorVariantStairsVariantPitfallVariant
- Added the following custom callbacks:
POST_SLOT_INITPOST_SLOT_UPDATEPOST_SLOT_RENDER
- Added MinimapAPI definitions.
August 31st, 2021
- Added the following helper functions:
hasLostCursegetPlayerCollectibleMapgetCollectibleListtemporarilyRemoveTrinketsgiveTrinketsBackvectorToDirection(Thanks KatTheFox)teleport(use this instead ofGame.StartRoomTransitionso that you don't forget to setLevel.LeaveDoor)forgottenSwitch(requires an upgraded mod)getClosestPlayerenableAllInputsdisableAllInputsenableAllInputsExceptFordisableAllInputsExceptFordisableMovementInputsdisableShootingInputsgetBossesarrayInArraygetAliveBossesisKeeperhasOpenActiveItemSlotgetTransformationsForItemremoveItemFromItemTrackergetPlayerFromEntityPtrgetPlayersOfTypegetNewestPlayergetCollectibleInitChargesgetCollectibleMaxChargesisKeyboardPressedrunNextFramerunInNFrameslogEntity
- Renamed the following helper functions:
getCollectibleList-->getCollectibleSet(it now returns aSetinstead of an array)getRoomNPCs-->getNPCs
- Added the following constants:
GOLDEN_TRINKET_SHIFTTRANSFORMATION_TO_TAG_MAPTRANSFORMATION_TO_ITEMS_MAPITEM_TO_TRANSFORMATION_MAP
- Added the following enums:
PurgatorySubType(Thanks KatTheFox)DisplayFlagHeavenLightDoorSubTypeIsaacVariant(Thanks KatTheFox)
- Added the following custom callbacks:
PRE_CUSTOM_REVIVEPOST_CUSTOM_REVIVEPOST_PLAYER_RENDER_REORDEREDPOST_PURCHASE
- The save data manager will now properly handle TypeScriptToLua Sets.
- The save data manager now supports maps within maps.
- The save data manager now merges by iterating over the new table instead of the old object. This is necessary to capture values with a data type of
something | null. - The
addFlag,removeFlag, andhasFlagfunctions are now variadic, meaning that you can pass N flags to them at a time.
August 24th, 2021
- Added the following helper functions:
isQuestItemin2x1RoominLRoomanyEntityCloserThanremoveAllEntitiesremoveAllMatchingEntitiesgetSurroundingGridEntitiesgetRepentanceDoorisRepentanceDoorisDoorToDownpourisDoorToMinesisDoorToMausoleumisDoorToMausoleumAscentisDoorToMomsHeartgetCurrentDimensiongetEffectiveStageisDevilRoomDoorisAngelRoomDoorgetDevilRoomDoorgetAngelRoomDoorgetDevilOrAngelRoomDoorlogAllGameStateFlagsgetRoomDatagetRoomDataTypegetRoomVariantgetRoomStageIDgetRoomSubTypeinGenesisRoomisChildPlayerremoveDeadEyeMultiplierwillPlayerRevive(the vanillaEntityPlayer.WillPlayerRevivefunction is broken and that you should use this helper function instead)willMysteriousPaperRevivegetFinalFrameOfAnimationwillReviveFromSpiritShacklesisJacobOrEsauinBeastRoom
- Added the following constants:
DISTANCE_OF_GRID_SQUAREDOOR_HITBOX_DISTANCEMAX_PLAYER_SPEED_IN_UNITSCHARACTERS_WITH_NO_RED_HEARTSGENESIS_ROOM_VARIANTGRID_INDEX_CENTER_OF_1X1_ROOMMAX_PLAYER_POCKET_ITEM_SLOTSMAX_PLAYER_TRINKET_SLOTS
- Renamed the following constants:
DISTANCE_OF_GRID_SQUARE-->DISTANCE_OF_GRID_TILE(since that is the terminology that the game uses)
- Added the following enums:
LadderSubTypePinVariantDarkEsauVariantPlayerItemAnimationCollectibleAnimationPocketItemSlotTrinketSlotControllerIndex
- Added the following custom callbacks:
POST_PICKUP_INIT_LATEPOST_PICKUP_COLLECTPOST_PLAYER_CHANGE_HEALTHPOST_PLAYER_FATAL_DAMAGEPOST_LASER_INIT_LATEPOST_PLAYER_INIT_LATE
GridEntity.Descis added back to the definitions, but only for the purposes of throwing a compiler error. (It is assigned anevertype.) As per the developers, modders should always useGridEntity.GetSaveStateinstead of accessingGridEntity.Descdirectly.GetPtrHashnow accepts aRoomDescriptoror aRoomDescriptorReadOnly.- The
getRandomArrayElementhelper function now throws an error if you provide it an array with 0 elements. - You can now pass an optional 2nd argument to the
upgradeModfunction to enable verbose logging at the beginning and end of every callback that fires. This can be useful to troubleshoot code that is causing the game to crash. - Changed the return type of the
GetPtrHashfunction from anintto aPtrHash, which is simply a branded number for better type safety and code clarity. - The Save Data Manager will now automatically handle the special case where you are using number keys for a TSTL Map.
- Without any special handling, the JSON serializer will interpret it as an array and insert N null elements for each skipped entry. This can lead to hundreds of thousands of null elements, which can crash the game.
- The manager converts all number keys to strings when serializing, and then converts them back when deserializing.
- Changed the type of
RoomDescriptor.DatafromRoomConfigtoRoomConfig | null, since it doesn't exist for some rooms until you enter them. You can also set it to null to delete an already-initialized room in certain circumstances. - The
getEnumValueshelper function will now automatically sort the returned array.
August 17th, 2021
- Added the following helper functions:
isArrayisEvenisOddgetPlayerIndexVanillaisFirstPlayergetMaxCollectibleIDcollectibleHasTagtableClearinitTransformationTrackinggetPlayerNumTransformationCollectiblesisGlitchedCollectibleinAngelShopisVectoronFinalFloorgetPlayerCloserThangetPocketItemshasOpenTrinketSlothasOpenPocketItemSlotarrayToStringarraySumisSecretRoomDoorisHiddenSecretRoomDoor
- Added the following constants:
BEAST_ROOM_SUB_TYPEFIRST_TMTRAINER_COLLECTIBLE_TYPEMAX_NUM_DOORSMAX_NUM_INPUTSMAX_VANILLA_COLLECTIBLE_TYPE
- Renamed the following constants:
FIRST_TMTRAINER_COLLECTIBLE_TYPE-->FIRST_GLITCHED_COLLECTIBLE_TYPE
- Added the following custom callbacks:
POST_PLAYER_INIT_REORDEREDPOST_PLAYER_UPDATE_REORDERED
- Added the following enums:
DevilRoomSubTypeAngelRoomSubTypeBackwardsPathRoomSubTypeHomeRoomSubTypeTeleporterStateSatanVariant
- The save data manager now supports maps:
- Maps will automatically be converted to
LuaTableupon saving to disk, and then automatically converted back when loading from disk. - Use
Mapinstead ofLuaTableto prevent the manager from thinking that a data structure is "old" and shouldn't be merged.
- Maps will automatically be converted to
- The save data manager will now accept Vectors (and it will serialize/deserialize them properly).
- The
TemporaryEffects.AddCollectibleEffectmethod now throws a compiler error, since it reliably causes the game to crash. - Using
Level.GetCurrentRoomDescnow throws a compiler error. (Level.GetRoomByIdxshould always be used instead.)
August 10th, 2021
- Added many more helper functions to
isaacscript-common, sorted by subcategory:- Array:
arrayEqualsarrayRemovegetRandomArrayElementinitArrayarrayEmpty
- Entity:
getRoomNPCs
- Flag:
addFlaghasFlagremoveFlag
- Grid Entity:
getDoorsgetGridEntitiesopenAllDoors
- Input:
isActionPressedOnAnyInputisActionTriggeredOnAnyInput
- JSON:
jsonEncodejsonDecode
- Log:
loglogAllEntityFlagslogAllDamageFlagslogAllFlagslogAllProjectileFlagslogAllUseFlags
- Math:
signtanh
- Player:
anyPlayerCloserThananyPlayerHasCollectibleanyPlayerHasTrinketanyPlayerIsgetOpenTrinketSlotgetPlayerIndexgetPlayergetTotalPlayerCollectiblesgetPlayerNumAllHearts
- Random:
getRandomgetRandomFloatgetRandomInt
- Stage:
onChestonDarkRoomonRepentanceStageonCathedralonSheol
- Tears:
getFireDelaygetTearsStat
- UI:
getHUDOffsetVectorgetScreenBottomLeftgetScreenBottomRightgetScreenCentergetScreenTopLeftgetScreenTopRight
- Util:
changeRoomdeepCopyensureAllCasesgetAngleDifferencegetEnumValuesgetItemNamegetRoomIndexgridToPosinCrawlspaceinitRNGlerplerpAngleDegreesonSetSeed
- Array:
- All of the functions are automatically documented online using the TypeDoc generator.
- Added a Save Data Manager system that you can automatically use in your IsaacScript mods.
- The manager does two things:
- Resets variables at appropriate times.
- Automatically saves/loads from the "save#.dat" file to make everything persistent.
- Using the manager is great because it keeps all your variables locally & properly scoped and abstracts away all the complexity of having to use JSON.
- You can force the save data manager to write to disk with the
saveDataManagerSavefunction. - You can use the
saveDataManagerSetGlobalfunction to put all of the save data variables on a global variable "g" for debugging purposes.
- The manager does two things:
- Added
REPENTANCEdefinition. (Thanks Siramok) - Added some more Mod Config Menu definitions. (Thanks Siramok)
- Added new custom callbacks that you can use in your mods:
POST_GAME_STARTED_REORDEREDPOST_NEW_LEVEL_REORDEREDPOST_NEW_ROOM_REORDEREDPRE_ITEM_PICKUPPOST_ITEM_PICKUPPOST_PLAYER_CHANGE_TYPEPOST_FLIPPOST_FIRST_FLIPPOST_ESAU_JRPOST_FIRST_ESAU_JRPOST_TRANSFORMATIONPOST_GRID_ENTITY_INITPOST_GRID_ENTITY_UPDATEPOST_GRID_ENTITY_REMOVEPOST_SACRIFICEPOST_CURSED_TELEPORT
- The custom callbacks are documented here.
- Added the
GridPathenums.
August 3rd, 2021
- Released the
isaacscript-commonpackage, which includes helper functions that you can use in your IsaacScript mods. Right now there are not that many functions, but I plan to increase this in the future. They are documented here. - Breaking changes:
- The
isaacscriptpackage is no longer a meta-package that provides everything else. (It was getting too big and hard to handle.) - This means that instead of having 1 dependency of just
isaacscript, new IsaacScript mods created withinitare initialized with 4 dependencies:isaacscript- The monitoring program.isaacscript-lint- The linting config.isaacscript-common- Optional helper functions that you can use in your mods.isaac-typescript-definitions- Provides the types for all the Isaac API classes, likeEntityPlayerand so forth.
- If you are upgrading your existing mod to the latest version of IsaacScript, simply add the 3 extra dependencies to your "package.json" file, and everything should work the way it did before.
- Remember that you can use
npx isaacscript updateto update all of your dependencies at once.
- The
- Added Algolia search to the IsaacScript website.
- Added the following enums:
DogmaVariantPressurePlateVariantPressurePlateStateStatueVariant
- Added definitions for
ModConfigMenu. - The ESLint config no longer complains about
@categoryin JSDoc. - Added a new ESLint rule:
eslint-plugin-no-template-curly-in-string-fix
July 27th, 2021
- Fixed the wrong type in the
INPUT_ACTIONcallback. (Thanks to KatTheFox) - Fixed some bugs in the
RoomConfigclass. (Thanks Somdudewillson) - Added definitions for External Item Descriptions. (Thanks Somdudewillson)
- Added definitions for Music Mod Callback. (Thanks KatTheFox)
- Added definitions for StageAPI. (Thanks Somdudewillson)
- Added the following enums:
RotgutVariantMotherVariantHauntVariantAngelVariantFallenVariantDingleVariantLambVariantBeastVariantMomVariant
- Turned off the following ESLint rules:
jsdoc/require-paramjsdoc/require-returnsjsdoc/require-param-typejsdoc/require-returns-type
- The
isaacscript.jsonfile no longer contains aprojectNamefield. Instead, IsaacScript will always read the project name from the current working directory.- (You should remove the
projectNamefield from theisaacscript.jsonfile in your current projects when you upgrade your dependencies.)
- (You should remove the
- The
isaacscript.jsonfile now contains only per-user settings. Thus, it should not be committed to a repository. If noisaacscript.jsonfile exists, IsaacScript will create one upon the first invocation in a new directory. (Previously, it would throw an error and exit.) - The
isaacscript.jsonfile is now automatically added to the.gitignorefile for new projects.- (You should add it to the
.gitignorein your current projects when you upgrade your dependencies.)
- (You should add it to the
- The
monitorcommand will now output the mod target directory upon first invocation. - Changed the type of EntityPtr.Ref from
Readonly<Entity>toEntity | null. - The linter meta-package now includes
cspellso that you can spell check from command-line and/or CI. isaacscript initwill now create the following additional files:ci.yml- for GitHub Actionsprettier.config.mjs- to ensure trailing commas and LF line endingsbuild.sh- helper script to compile the project (used in CI)lint.sh- helper script to lint and spell check the project (used in CI)publish.sh- helper script to runnpx isaacscript publishrun.sh- helper script to runnpx isaacscriptupdate.sh- helper script to automatically update project dependenciesnuke.sh- helper script to automatically reinstall project dependencies
July 20th, 2021
- Added JSDoc lint rules from the recommended config.
July 3rd, 2021
- Added a linting rule that catches the following bug:
myArray.push() - Added a new linting plugin that changes all ESLint rules to warnings, so that you can more-easily disambiguate them from TypeScript compiler errors.
- For vectors, the methods of
__add,__sub, and so forth have been deprecated in favor ofadd,sub, and so on. The former can cause the game to crash in Repentance.
June 26th, 2021
- The
Isaac.GetPlayermethod now returnsEntityPlayerinstead ofEntityPlayer | null. This means that you can remove type narrowing and/or non-null assertions from your code. - Added
KnifeVariantenum. - The
USE_ITEMandPRE_USE_ITEMcallbacks can now return void. - Changed several callbacks to use
voidinstead ofnullin order to simplify the signatures and have less friction for new users. This might be a breaking change for some users if you are using these callbacks in exported functions, but the fix is simple: just changenulltovoid.
May 15th, 2021
- The framework was updated to work properly with Repentance.
October 20th, 2020
- The first version of IsaacScript is released (for Afterbirth+).