All content addition related APIs now expose a DeleteData hook (listed below), which is triggered on save file deletion
- Modded Burdens!
Burdens.RegisterBurdens.GetTypeBurdens.SaveDataBurdens.DeleteDataBurdens.LoadDataBurdens.LoadContentBurdens.ModifyDataBurdens.ExtendTypeArray
- Modded Soul Shop upgrades!
SoulShop.RegisterSoulShop.GetTypeSoulShop.SaveDataSoulShop.LoadDataSoulShop.LoadContentSoulShop.DeleteDataSoulShop.ModifyDataSoulShop.ModifyEntryArraySoulShop.ModifyObjSoulShop.OnOpenSoulShop.OnClose
Player.HeirGeneration.ModifyCharacterData.Event_v2- Provides index of the Heir instead of
lockedClassandlockedSpellbooleans
- Provides index of the Heir instead of
Relics.DeleteDataRelics.SetSeen- Triggered when setting a Relic's seen status
Traits.DeleteData
- RL2.API now attempts to load the mod's PDB (Portable DeBugging) file if present
- This allows modders to use a debugger to set breakpoints in their mods, greatly enhancing their debugging capabilities
- All API endpoints are now accessed via
(Container/s).(Name).Event- Example
Player.Ability.ModifyData->Player.Ability.ModifyData.Event
- Example
- Modded Relics!
Relics.RegisterRelics.GetTypeRelics.SaveDataRelics.LoadDataRelics.LoadContentRelics.ModifyDataRelics.ExtendTypeArrayRelics.ApplyEffectRelics.StopEffect
- Modded Traits!
Traits.RegisterTraits.GetTypeTraits.SaveDataTraits.LoadDataTraits.LoadContentTraits.ModifyDataTraits.ModifyTraitObjTraits.ExtendTypeArrayTraits.ApplyEffectTraits.StopEffect
Scars.ModifySummonRulesScars.RegisterCustomRule
Player.(StatName)endpoints.- For stat modification use
Player.PostUpdateStats.Event - We are aware this disallows modifying Strength and Intelligence, but we are working on readding access to modifying those
- Health can be modified via Vitality
- For stat modification use
- Enemy.ModifyBehaviour now allows for completly replacing the values of
aiScriptandlogicController_SO
- Bad method signature in register content hook
- RL2.API now requires RL2.ModLoader v1.0.3
- This is due to the fact that v1.0.3 introduced proper IDs for its Hook objects
Mod.ModManifestproperty- Holds the
ModManifestobject related to the mod
- Holds the
RL2API.GetModInstance(string modName)method- Returns an instance of a mod with
modNameset as its name in its manifest, ornullif not found
- Returns an instance of a mod with
- Mods can now specify which classes implementing
IRegistrablebelong to which mod- This is important in case one assembly contains multiple mods
- Instead of subclassing ModX and GlobalX classes, modders should now create their own classes implementing the
IRegistrableinterface. - Inside the
IRegistrable.Register()method of their classes, they should subscribe to events such asPlayer.OnKillwhere their code will be executed
-
Player related APIs
-
ModPlayer.OnSpawnoverride changed toPlayer.OnSpawn += (PlayerController player) => { }
-
ModPlayer.PreKilloverride changed toPlayer.PreKill += (PlayerController player, GameObject killer) => { return (bool)IfPlayerShouldDie; }
-
ModPlayer.OnKilloverride changed toPlayer.OnKill += (PlayerController player, GameObject killer) => { }
-
Player stat modification procedurue changed. Instead of changing Player.StatBonuses.{StatName}, modders should use
Player.Stats.{StatName}Flat += (ref int/float additive) => { }
for additive bonuses, and
Player.Stats.{StatName}Multiplier += (ref float multiplier) => { }
for stat scaling bonuses. Modify the passed in parameters to grant these bonuses
-
ModSystem.ModifyGeneratedCharacterDataoverride changed toPlayer.HeirGeneration.ModifyCharacterData += (CharacterData data, bool classLocked, bool spellLocked) => { }
-
ModSystem.ModifyGeneratedCharacterLookoverride changed toPlayer.HeirGeneration.ModifyCharacterLook += (PlayerLookController lookData, CharacterData data) => { }
-
ModSystem.ModifyCharacterRandomizationoverride changed toPlayer.HeirGeneration.ModifyCharacterRandomization += (CharacterData data) => { }
-
ModSystem.ModifyAbilityDataoverride changed toPlayer.Ability.ModifyData += (AbilityType type, AbilityData data) => { }
-
-
Enemy related APIs
-
GlobalEnemy.OnSpawnoverride changed toEnemy.OnSpawn += (EnemyController enemy) => { }
-
GlobalEnemy.PreKilloverride changed toEnemy.PreKill += (EnemyController enemy, GameObject killer) => { return (bool)IfEnemyShouldDie; }
-
GlobalEnemy.OnKilloverride changed toEnemy.OnKill += (EnemyController enemy, GameObject killer) => { }
-
ModSystem.ModifyEnemyDataoverride changed toEnemy.ModifyData += (EnemyType type, EnemyRank rank, EnemyData data) => { }
-
ModSystem.ModifyenemyBehaviouroverride changed toEnemy.ModifyBehaviour += (EnemyType type, EnemyRank rank, BaseAIScript aiScript, LogicController_SO logicController_SO) => { }
-
-
Map related APIs
ModSystem.ModifyRoomIconoverride changed toWorld.Map.ModifyRoomIcon += (GridPointManager roomToCheck, bool getUsed, bool isMergeRoom) => { }
- ModClassData
- Awaits new implemenataion, doesn't work at the moment
- StatBonuses.(Strength|StrengthMultiplier|Intelligence|IntelligenceMultilplier) no longer apply to enemies
- RL2.API no longer tries to load mods that don't specify being loaded after it
new-modcommand is now called viarl2.api:new-mod
- ModSystem.ModifyAbilityData:
- Allows modifying AbilityData depending on the provided AbilityType
- ModSystem.ModifyEnemyData:
- Allows modifying EnemyData depending on the provided EnemyType and EnemyRank
- ModSystem.ModifyEnemyBehaviour:
- Allows modifying the enemy AI script and logic controller depending on the provided EnemyType and EnemyRank (needs detailed documentation)