Skip to content

Modding changes in Repentance+

Author(s): benevolus
Tags:

Work in progress!

This article is a work in progress! Some sections may be incomplete or need revising.

With the addition of the Repentance+ DLC, there have been a few updates to the modding API compared to Repentance. This article will list all of the additions and changes that have been made in the process.

Entity⚓︎

The following functions now have an additional argument: IgnoreBosses. When set to true, the status effect will ignore the boss status effect cooldown that normally prevents bosses from gaining more status effects:

There is one new addition to the Entity class:

EntityPlayer⚓︎

  • EntityPlayer:AddCollectible has an additional argument: ItemPoolType. This allows you to manually define what item pool the item came from.

Font⚓︎

  • Three new fonts were added under gfx/font/teammeatex/: teammeatex10, teammeatex12, and teammeatex16.

Below is an example render of each size of font, first rendered with their regular version, followed by their EX version:

Team Meat fonts with EX versions

Below are 5 different examples of text being rendered in different locations under different font settings:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local TestMod = RegisterMod("Font Render Test", 1)

local font = Font("font/teammeatex/teammeatex10.fnt")

--Enables Auto Wrap with a box width of 100. If a string's width reaches past the box width, the string will be cut before the width limit with the remainder of the string being put on a new line.
--The placement of the new line and previous lines is determined by the current alignment.
--Auto Wrap is disabled by default.
local fontSettings1 = FontRenderSettings()
fontSettings1:EnableAutoWrap(100)

--Enables Auto Wrap with a box width of 100 with a MIDDLE_CENTER alignment. Text will be centered at the render point and lines will be pushed upwards with each new line.
--Default alignment is DrawStringAlignment.TOP_LEFT (0).
local fontSettings2 = FontRenderSettings()
fontSettings2:SetAlignment(DrawStringAlignment.MIDDLE_CENTER)
fontSettings2:EnableAutoWrap(100)

--Enables truncation with a box width of 100. If a string's width reeaches past the box width, the string will be cut before the width limit and append a "..." at the end.
--Truncation is disabled by default. Has no effect if Auto Wrap is enabled.
local fontSettings3 = FontRenderSettings()
fontSettings3:EnableTruncation(100)

--Sets a maximum amount of characters that can be rendered on the string to 18. If a string's width reaches past the box width, the remaining characters will not be rendered.
--Default character limit is 65535.
local fontSettings4 = FontRenderSettings()
fontSettings4:SetMaxCharacters(18)

--Enables Auto Wrap with a box width of 100 with a Line Height modifier of 0.5. The distance between lines can be made smaller or larger.
--Default line height is 1.0. Has no effect if Auto Wrap isn't enabled.
local fontSettings5 = FontRenderSettings()
fontSettings5:EnableAutoWrap(100)
fontSettings5:SetLineHeightModifier(0.5)

function TestMod:OnRender()
    local centerPos = Vector(Isaac.GetScreenWidth() / 2, Isaac.GetScreenHeight() / 2)
    font:DrawString("1. I have an auto wrap of limit of 100!", centerPos.X - 180, centerPos.Y, 1, 1, KColor(1,1,1,1), fontSettings1)
    font:DrawString("2. I'm centered in the middle with multiple lines!", centerPos.X, centerPos.Y, 1, 1, KColor(1,1,1,1), fontSettings2)
    font:DrawString("3. Supercalifragilisticexpialidocious", centerPos.X + 100, centerPos.Y, 1, 1, KColor(1,1,1,1), fontSettings3)
    font:DrawString("4. Character limit stops most of this from rendering...", centerPos.X, centerPos.Y + 50, 1, 1, KColor(1,1,1,1), fontSettings4)
    font:DrawString("5. So many lines bunched up together. I feel cramped in here!", centerPos.X, centerPos.Y - 100, 1, 1, KColor(1,1,1,1), fontSettings5)
end

TestMod:AddCallback(ModCallbacks.MC_POST_RENDER, TestMod.OnRender)

Font examples

Game⚓︎

  • Game:Fadein has two new arguments: ShowIcon and KColor. ShowIcon appears to be non-functional. KColor will change the color of the screen as it fades back into the view of the game.

Demonstration using Game():Fadein(0.025, true, KColor(0.5, 0.5, 0.5, 1)):

Fadein example

  • Game:Fadeout has one new argument: KColor. It will change the color of the screen that it will fade out into.

Demonstration using Game():Fadeout(0.025, 2, KColor(0.5, 0.5, 0.5, 1)):

Fadeout example

GridEntity⚓︎

HUD⚓︎

A new argument has been added to both overrides of HUD:ShowItemText: ClearStack. In Repentance+, HUD item text now stacks, showing one HUD text below the last one if it's still on screen. The argument is true by default, which will resort to the behaviour of Repentance HUD text of removing all existing HUD text on screen before displaying the new one.

Example:

Repeating the following function 3 times will only show it once:

1
Game():GetHUD():ShowItemText("foo", "bar", false)

ShowItemText ClearStack left empty or true

Doing the same thing again, but passing ClearStack as false, will show all three messages:

1
Game():GetHUD():ShowItemText("foo", "bar", false, false)

ShowItemText ClearStack set to false

ItemPool⚓︎

ItemPool:GetCollectible has an additional argument: BackupPoolType. Accepts an ItemPoolType such that if the regular pool in PoolType is empty and DefaultItem is set to CollectibleType.COLLECTIBLE_NULL, it will draw from BackupPoolType instead of ItemPoolType.POOL_TREASURE.

Not available with REPENTOGON

This addition was added in a later update to Repentance+ after v1.9.7.12, so it is not available to REPENTOGON users.

Example:

After draining the library pool, this would normally return a treasure room item:

1
Game():GetItemPool():GetCollectible(ItemPoolType.POOL_LIBRARY, true)

However, defining BackupPoolType with ItemPoolType.POOL_DEVIL will return an item from the devil item pool instead:

1
Game():GetItemPool():GetCollectible(ItemPoolType.POOL_LIBRARY, true, nil, nil, ItemPoolType.POOL_DEVIL)

Room⚓︎

Sprite⚓︎

  • Sprite:ReplaceSpritesheet now returns a boolean instead of nil. It will return true if the spritesheet at the given layer id was successfully replaced and if the new spritesheet is not the same as the old one, otherwise returns false. It does not confirm whether the new spritesheet actually exists or not, so a non-existent spritesheet can still return true.

Options⚓︎

Enums⚓︎

The following new enums have been added:

The following enums have been updated with new entries:

  • BackdropType: New additions are DEATHMATCH and LIL_PORTAL. NUM_BACKDROPS has been updated to reflect this.
  • ButtonAction: Many pre-existing enumerations have been switched around with new values. New additions are ACTION_JOINMULTIPLAYER, ACTION_MENUX, and ACTION_EMOTES.
  • EffectVariant: BULLET_POOF_STATIC and UMBILICAL_CORD_HELPER were added, but were existing Repentance entities previously without enumerations. New additions are MEGA_BEAN_EXPLOSION, SPAWN_PENTAGRAM, and PLAYER_CREEP_YELLOW.
  • GameStateFlag: New additions are STATE_MEGA_SATAN_DOOR_OPENED, STATE_URIEL_KILLED, STATE_GABRIEL_KILLED, and STATE_MOTHER_HEART_DOOR_OPENED. NUM_STATE_FLAGS has been updated to reflect this.
  • GridRooms: New additions are ROOM_DEATHMATCH_IDX and ROOM_LIL_PORTAL_IDX. NUM_OFF_GRID_ROOMS has been updated to reflect this.
  • Music: The one new addition is MUSIC_DEATHMATCH. NUM_MUSIC has been updated to reflect this.
  • RoomType: The one new addition is ROOM_DEATHMATCH. NUM_ROOMTYPES has been updated to reflect this.
  • SoundEffect: Has a large quantity of new sound effects.