The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

StatAPI 2.0
62 条留言
zohnannor 2023 年 10 月 4 日 下午 3:09 
fixed?
Zekava 2022 年 2 月 10 日 上午 9:10 
sadge
『Sora』  [作者] 2021 年 5 月 28 日 下午 8:08 
Yeah it breaks everything rn, just don't use it DX
Clover 2021 年 5 月 28 日 上午 11:36 
Breaks kidney stone. Tears are locked to 5.0 until the effect ends.
『Sora』  [作者] 2021 年 5 月 25 日 下午 5: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 2021 年 5 月 25 日 上午 11:53 
repentance update when?
『Sora』  [作者] 2021 年 5 月 16 日 下午 4: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 2021 年 5 月 15 日 下午 9:53 
i dont know anything about modding but is this mod still necessary/useful?
『Sora』  [作者] 2019 年 3 月 26 日 下午 4:00 
doubt ill do it very soon lol sorry
JSJosh 2019 年 3 月 24 日 下午 2:03 
Are you planning on updating any time soon? I'd love this to work better with the current version of Isaac :)
『Sora』  [作者] 2019 年 3 月 24 日 下午 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 2019 年 3 月 24 日 上午 11:42 
So it seems my game crashes every time i try to start a run with Lilith. JSYK
『Sora』  [作者] 2019 年 3 月 8 日 下午 3: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 2019 年 3 月 7 日 下午 7:47 
How do I raise base tears
『Sora』  [作者] 2019 年 3 月 7 日 下午 5: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 2019 年 3 月 7 日 上午 8:29 
Does this handle Pony setting speed to 1.5 if it is lower?
『Sora』  [作者] 2019 年 1 月 26 日 上午 8:40 
I'll have to look into it. Thanks for the heads up!
Enderskape 2019 年 1 月 25 日 下午 2: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 2019 年 1 月 1 日 下午 11:21 
Sorry, statistics are not visible
『Sora』  [作者] 2018 年 8 月 11 日 下午 4: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 2018 年 8 月 11 日 上午 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』  [作者] 2018 年 7 月 20 日 下午 4:53 
Updated - make sure you change all requires for statAPI to pcall(require,"statAPI") instead to avoid errors and mod crashing.
『Sora』  [作者] 2018 年 7 月 20 日 下午 4: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 2018 年 7 月 20 日 下午 4: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』  [作者] 2018 年 7 月 18 日 下午 4:37 
Glad to help lol
... 2018 年 7 月 18 日 下午 4:17 
Thanks you! (i was way off lol)
『Sora』  [作者] 2018 年 7 月 18 日 下午 4: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』  [作者] 2018 年 7 月 18 日 下午 4: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)
... 2018 年 7 月 18 日 下午 3:57 
This might be dumb but could you post an example of how to code a basic tears up (like Wire Coat Hanger)?
『Sora』  [作者] 2018 年 7 月 17 日 下午 3: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』  [作者] 2018 年 7 月 17 日 下午 3:42 
Yeah - i made functions for that!
Check the description above.
Sartre's right eye 2018 年 7 月 17 日 下午 3: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』  [作者] 2018 年 7 月 17 日 下午 3: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』  [作者] 2018 年 7 月 17 日 下午 3: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 2018 年 7 月 17 日 下午 2: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 2018 年 7 月 15 日 上午 2:56 
The madman...He did it
Awesome! :D
『Sora』  [作者] 2018 年 7 月 14 日 下午 5:15 
Patched!
『Sora』  [作者] 2018 年 7 月 14 日 上午 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 2018 年 7 月 14 日 上午 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』  [作者] 2018 年 7 月 12 日 下午 5: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 2018 年 7 月 12 日 下午 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』  [作者] 2018 年 7 月 12 日 上午 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』  [作者] 2018 年 7 月 12 日 上午 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 2018 年 7 月 12 日 上午 10:25 
(A pic with the mentioned error in it: https://imgur.com/a/weRl3mw)
Sartre's right eye 2018 年 7 月 12 日 上午 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』  [作者] 2018 年 7 月 11 日 下午 11:13 
ab+ only - its built to fix issues with the modding api for ab+ after all
montain 2018 年 7 月 11 日 下午 7:09 
does the mod work for afterbirth only?
Yaoi friend 2018 年 7 月 10 日 上午 10:37 
is ok
『Sora』  [作者] 2018 年 7 月 8 日 上午 11:37 
Thanks!
NotRealFrog 2018 年 7 月 7 日 上午 11:41 
There is also a page with large letters AB+ need it about that mod
btw nice mod