The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

80 betyg
!!~ Better CurseAPI
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Filstorlek
Lades upp
Uppdaterades
87.462 KB
13 jan, 2024 @ 20:01
4 mar @ 13:22
4 ändringsnotiser ( visa )
Du behöver DLC för att kunna använda denna artikel.

Abonnera för att ladda ner
!!~ Better CurseAPI

Beskrivning
Requires MiniMAPI

Found a bug? Want to contribute? Check out Better CurseAPI's GitHub repository![github.com]

I was unsatisfied with CurseAPI, so I made my own better version.

Here's a list of the improvements over CurseAPI
- Uses the stage seed instead of math.random
- Compatible with MiniMAPI
- Doesn't override the game's actual curse chance
- Allows custom functions to determine if a curse is allowed to spawn on a given floor
- Allows differently weighted curses
- Allows generating multiple curses on a floor (That's off by default, don't worry)
- Uses Game():GetLevel():CanStageHaveCurseOfLabyrinth() instead of trying to compute it manually
- Puts itself at the top of the mod list so you don't have to add ~ before your mod name to get the right load order

How to use Better CurseAPI
(If you need an example for any of these steps, download the Example Curse mod[github.com] from GitHub and look at the code)
1. Add your curse to content/curses.xml

2. Call BetterCurseAPI:registerCurse(curse_name, curse_weight, is_allowed_function, curse_icon) and store the return value in a local variable. That's your curse id. You'll need it later.
curse_name is the same name you used in curses.xml
curse_weight is the relative chance for a curse to appear, it is either a number or a function that returns a number. If unsure, make this value 1.0
is_allowed_function is either a boolean value, or a function that returns true if your curse is allowed on this floor and false if it isn't. If unsure, make it true.
curse_icon is either nil, or a table in the order of { sprite, animation name, animation frame }. If nil, your curse will not have an icon (This is not recommended).

3. Your curse is now registered. Use BetterCurseAPI:isCurseActive(curse_id) with the curse id from step 2 to check if your curse is currently active.

4. (Technically optional, but recommended) Add your curse to the Better CurseAPI mod config menu page. Be sure to check if mod config menu is installed first. You are responsible for saving and loading the user configuration for any custom curses you add. Better CurseAPI will not store it for you.

The easiest way is to use BetterCurseAPI:addCurseConfig(curse_id, paramsTable).
curse_id is the curse id from step 2.

paramsTable is a table with the following keys.
enabled_current_setting is a function that returns true if the curse is currently enabled, and false if it is disabled.
on_change_enabled is a function that takes 1 parameter, which is true if the curse is being enabled, and false if it is being disabled.
default_enabled is either true or false, indicating whether the curse is enabled by default.
on_weight_change is a function that takes 1 parameter, which is a number equal to the new weight value being set.
default_weight is a number equal to the default weight value.
text is an optional parameter to display text below a curse's name. I recommend something like "Added by 'MOD_NAME' (Version 1.0)".
26 kommentarer
Kitty McTophat  [skapare] 18 aug @ 11:23 
Ah, thank you for asking!
Feel free to include it in your mod, I don't mind at all
Black_L4mb 18 aug @ 11:16 
Hey there, I'm the developer of the Absolution series of mods.
I will be using your API in the full overhaul that will be releasing soon, and I was wondering if I could include this mod directly in my files rather than have it as a separate dependency. The intent is to make it so end users don't have to subscribe to multiple mods, and I will ensure you are properly credited.

If you'd prefer to keep it separate, I will direct users to subscribe to this in conjunction with my mods, just let me know!
aylooisastupid 7 aug @ 16:51 
does this work with rep+?
Kattack 4 mar @ 15:56 
That would be hype, even if rgon doesn't implement such a thing it would still be very helpful if you could find some other way to have it work without minimapi (perhaps optionally)
Kitty McTophat  [skapare] 4 mar @ 12:58 
Ah, I wasn't aware of Repentogon having its own minimap system. I'll look into that and try to make an update
fraZ0R 2 mar @ 14:13 
MiniMapAPI is extremely laggy due to completely reimplementing the minimap system and redrawing it every tick, doesn't Repentogon offer its own way of doing minimap stuff without it? Would there be a way to make this API not depend on mmapi?
Kattack 11 dec, 2024 @ 8:21 
Yo you got the debug text enabled on the release version !!! can you turn it off it is spammy pls thx
lil gaggle 17 nov, 2024 @ 15:55 
im I reading enchantment table what does this mean
PhotoFinn 30 jul, 2024 @ 14:47 
Hello there! Me again, I don't know if you guys are still working on this mod, but if you are, I've just released an update to Accursed that includes several new callbacks that you guys can use to make your mod compatible with ours
Busybody64 4 maj, 2024 @ 11:01 
Repentogon?