The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

StatAPI 2.0
62 kommentarer
zohnannor 4. okt. 2023 kl. 15:09 
fixed?
Zekava 10. feb. 2022 kl. 9:10 
sadge
『Sora』  [ophavsmand] 28. maj 2021 kl. 20:08 
Yeah it breaks everything rn, just don't use it DX
Clover 28. maj 2021 kl. 11:36 
Breaks kidney stone. Tears are locked to 5.0 until the effect ends.
『Sora』  [ophavsmand] 25. maj 2021 kl. 17:39 
This entire thing needs completely rewritten to work with repentance and from some details I've learned, might not even work at all now! Kilburn knows about it though, and might implement something officially in the modding tools in the future.
KeinNiemand 25. maj 2021 kl. 11:53 
repentance update when?
『Sora』  [ophavsmand] 16. maj 2021 kl. 16:16 
Uhhhh. Well, we currently still can't inject our stats anywhere else in the modding process so it's still sorta necessary to make items balanced the same way they are in the base game. Yknow how some items can reduce below the tear cap and others cant? We have no way to be able to make modded items that work like that correctly otherwise.
Weedybird<3 15. maj 2021 kl. 21:53 
i dont know anything about modding but is this mod still necessary/useful?
『Sora』  [ophavsmand] 26. mar. 2019 kl. 16:00 
doubt ill do it very soon lol sorry
JSJosh 24. mar. 2019 kl. 14:03 
Are you planning on updating any time soon? I'd love this to work better with the current version of Isaac :)
『Sora』  [ophavsmand] 24. mar. 2019 kl. 12:33 
There's been a bunch of bugs in it still, and I haven't updated it for any newer versions of Isaac so there may be a conflict there. Sorry for that!
Sartre's right eye 24. mar. 2019 kl. 11:42 
So it seems my game crashes every time i try to start a run with Lilith. JSYK
『Sora』  [ophavsmand] 8. mar. 2019 kl. 15:55 
Use the new callback function to replace the EVALUATE_CACHE base callback, and then check that the CacheFlag is Firedelay and the Stage is StatStage.BASE, then apply your stat changes.

Be warned about base tears though - whatever change you apply needs to be multiplied by 1000. So if you want to change base tears by +0.7 (like sad onion) then you need to do player.MaxFireDelay += 700

If you need more help let me know and I can provide an example.
popofufu 7. mar. 2019 kl. 19:47 
How do I raise base tears
『Sora』  [ophavsmand] 7. mar. 2019 kl. 17:55 
Unfortunately, at the end of each cache callback speed is set to 2, so it cannot handle another mod that modifies the speed lower than the cap after the fact. Theoretically though, all mods using stat api will be able to affect eachother independantly of the cap, so one mod item that reduces speed by 0.5 flat can be increased by another stat api item which buffs it, but not by base speed changes. I looked into fixing that a while ago, but because of the cap it just wasn't feasible.
popofufu 7. mar. 2019 kl. 8:29 
Does this handle Pony setting speed to 1.5 if it is lower?
『Sora』  [ophavsmand] 26. jan. 2019 kl. 8:40 
I'll have to look into it. Thanks for the heads up!
Enderskape 25. jan. 2019 kl. 14:57 
I seem to have found a bug. Whenever I attempt to pcall reference the api, even with an otherwise blank Lua document (with the exception of my registermod line), my base tears stat becomes 10,000 and my damage becomes .05 ingame.

The log.txt outputs infinite repetitions of:

"[INFO] - [Stats API 2.0] Error in "PostEvaluateItems" call: ...f Isaac Afterbirth+ Mods/statapi 2.0_1431542487/main.lua:119: attempt to call a nil value (field 'Func')"

...and I can't for the life of me figure out why.
Jorres 1. jan. 2019 kl. 23:21 
Sorry, statistics are not visible
『Sora』  [ophavsmand] 11. aug. 2018 kl. 16:56 
Nice! There is a bug with dead eye I made a patch for - gave it to my alpha build of apocrypha and it seems to be running fine so i will probably update this with that.

The old version I just copied code from 1.0 which because of a change in structure was causing deadeye to either just not work or to crash the game. This patch should fix that :P
Piber 11. aug. 2018 kl. 3:42 
Just want to say this has been working pretty well, I've been making use of it in some of my in-development mods and I have yet to experience any further issues.
『Sora』  [ophavsmand] 20. juli 2018 kl. 16:53 
Updated - make sure you change all requires for statAPI to pcall(require,"statAPI") instead to avoid errors and mod crashing.
『Sora』  [ophavsmand] 20. juli 2018 kl. 16:46 
Yeah - I had it setup like that initially for a minute before it crashed the whole script and i was confused and reverted the change. Now that I know how it works ill add an addendum to the description and re-patch that version.
Piber 20. juli 2018 kl. 16:22 
I request you set it up in a way so that it errors at the end of the script so the game doesn't think require was able to load it. This would make me a lot less nervous about potentially getting people stuck at an older version should I not be able to update my mod.
『Sora』  [ophavsmand] 18. juli 2018 kl. 16:37 
Glad to help lol
... 18. juli 2018 kl. 16:17 
Thanks you! (i was way off lol)
『Sora』  [ophavsmand] 18. juli 2018 kl. 16:08 
Steam comments don't like spacing but you probably can get the idea. Base tears upgrades are slightly odder than others because i multiplied the stat by 1000 to fit it inside of an integer MaxFireDelay.
『Sora』  [ophavsmand] 18. juli 2018 kl. 16:06 
function mod:TearsUp(player)
player.MaxFireDelay = player.MaxFireDelay + 0.7*1000
end

stats:AddCache(mod.TearsUp, CacheFlag.CACHE_FIREDELAY, StatStage.BASE)

That's the simplest way to do it. If you want to have more than one stat upgrade in the same function though, you gotta make a small change.

function mod:StatsUp(player, cacheFlag, stage)
if cacheFlag == CacheFlag.CACHE_FIREDELAY then
if stage == StatStage.BASE then
player.MaxFireDelay = player.MaxFireDelay + 0.7*1000
end
elseif cacheFlag == CacheFlag.CACHE_DAMAGE then
if stage == StatStage.MULTI then
player.Damage = player.Damage*2
end
end
end

stats:AddCache(mod.StatsUp)
... 18. juli 2018 kl. 15:57 
This might be dumb but could you post an example of how to code a basic tears up (like Wire Coat Hanger)?
『Sora』  [ophavsmand] 17. juli 2018 kl. 15:43 
Basically tho, stats.GenerateSave() at the beginning of your save data string, and use data
= stats.LoadSave(data) at the beginning of your load file.
『Sora』  [ophavsmand] 17. juli 2018 kl. 15:42 
Yeah - i made functions for that!
Check the description above.
Sartre's right eye 17. juli 2018 kl. 15:41 
So I reentered from the savefile, and everything was back to normal. But upon further inspection it seemed like something was wrong with my own mod as well. When I inspected further, I discovered we both save our gamedata in the same file (save1.dat). So what I think is going on is that we just override each others data....
...So I might need to put your 'savedata' in my table with datavalues before saving and before loading. Idk
『Sora』  [ophavsmand] 17. juli 2018 kl. 15:29 
My tearrate is displaying as 6 with the same items you have, instead of the value you got. Lemme know if theres any errors or anything else I should know about!
『Sora』  [ophavsmand] 17. juli 2018 kl. 15:27 
Nah i prefer to get bug reports - is there any errors in the log? That looks like the stats value before its converted from base to breakmulti, so i figure something has gone wrong lol
Sartre's right eye 17. juli 2018 kl. 14:18 
Srry to keep bothering you, but it seems like I've found another bug:
https://imgur.com/a/Iw6Efku
I took a tears up pill, torn photo and tech x. And after I tried to pick the halo, I find myself unable to shoot...
Sartre's right eye 15. juli 2018 kl. 2:56 
The madman...He did it
Awesome! :D
『Sora』  [ophavsmand] 14. juli 2018 kl. 17:15 
Patched!
『Sora』  [ophavsmand] 14. juli 2018 kl. 11:29 
If you set it up as base it should be checking - might be a bug! There are a few bugs im working to patch up right now honestly (Polyphemus/mutant spider/inner eye multiplier isnt applying correctly, ect) so I will look into it!
Sartre's right eye 14. juli 2018 kl. 7:21 
So about the tears stat: I noticed that there's no implementation to check whether the tears stat may go under the tears cap of 5 or not. I brought in my own implementation and it works on it's own, but if I pick up another 'tears up' item that should have a cap on 5, it goes under that...
Srry to be so picky, but could you make something like a 'banlist' for collectibles or what not that checks whether the whole list stays above the cap of 5?

Good mod though, it solves what was missing before (a decent way to make accurate stat changing items) :happymeat:
『Sora』  [ophavsmand] 12. juli 2018 kl. 17:02 
Yeah no problem! Glad to help, and glad that other people are finding this as useful as I am :P
Honestly its easier to add stat items with stat api 2.0 imo, cuz you can specify stuff like cacheflag or whatever right in the addcache so its a win/win for me
Sartre's right eye 12. juli 2018 kl. 12:44 
Ah yea, I didn't put the 'statsAPI.lua' file in my mod, nor did I require it
That should probably fix my problems, thx for the quick response!
『Sora』  [ophavsmand] 12. juli 2018 kl. 11:33 
Don't worry too much about the version either honestly - if you require the file in your lua and then add that stats api is necessary for the mod, any fixes i do to stat api will be auto fixed for the local copy :P
alternatively, any other mods that use a more updated version will override your old version if played with them so
『Sora』  [ophavsmand] 12. juli 2018 kl. 11:28 
What kind of setup do you have with it? Did you just download the mod and are using it that way or are you requiring the file in your mod aswell or what?

Likely what im guessing is either you didnt add the file to your own mod files and require it, or you did but you didnt require it at the top of your lua. You CAN run the mod without requiring the actual file in your mod - but then you have to check for stats before you can use it, and if your mod loads before stats, then you have to add the cache callbacks to it from like PostGameStarted instead - so its a little hassle. That is why I designed it to allow you to just copy statsAPI.lua from the mod folders to your mod and just have you require it :P
Sartre's right eye 12. juli 2018 kl. 10:25 
(A pic with the mentioned error in it: https://imgur.com/a/weRl3mw)
Sartre's right eye 12. juli 2018 kl. 10:16 
So I was messing around since this seems like a really nice thing that people should use, but it seems that my mod only works after I reload it at least once...
https://imgur.com/a/FNl6p1U
(my mod is supposed to keep upping the damage every time you use book of belial, for bossrush and what not)
Maybe I did something wrong here, but it seems from looking at the errors the console spews back at me that the 'stats' keyword isn't available before I reload my mod?
『Sora』  [ophavsmand] 11. juli 2018 kl. 23:13 
ab+ only - its built to fix issues with the modding api for ab+ after all
montain 11. juli 2018 kl. 19:09 
does the mod work for afterbirth only?
Yaoi friend 10. juli 2018 kl. 10:37 
is ok
『Sora』  [ophavsmand] 8. juli 2018 kl. 11:37 
Thanks!
NotRealFrog 7. juli 2018 kl. 11:41 
There is also a page with large letters AB+ need it about that mod
btw nice mod