#Talisman - A mod to enhance high-scoring runs
1 messages · Page 2 of 1
I guess I'll still wait
im on another pc and my old one had talisman
i havent opened balatro yet
will i encounter some problems with talisman?
should i reinstall my mods?
as expected
you can probably use other profile just fine without mods
eh, im gonna get some mods anyways
ait
should i send save.jkr or nah
it isn't really useful
runs with talisman are not compatible with vanilla
Because all numbers are stored in a different way
talisman settings from previous version are not compatible with latest because value for bignum thingy changed from boolean to string
not that big of a deal but in case anyone experiences a crash after updating talisman via git, make sure to reset settings file to fix it
Does OmegaNum have a ceil() function, or is it exclusive to BigNum?
Got a compat crash from another mod that uses it and it seems like it's missing from OmegaNum.
Also, not sure that save related crash got fixed.
I was just rerolling the shop and it poped up.
since when are error screens blue
ah
Not getting it anymore, I guess it resolved itself?
Got it again from grabbing a D6 Joker from a booster pack.
Other one also had a D6 Joker spawning from the shop
I don't like the implication of this
Probably not correlated (mostly because h o w) but it might not be that rare.
Plan is to port BigNum funcs to OmegaNum and vice versa
And it happened again (I was moving an Impure - Gutless Die that then debuffed a joker split second before the crash).
What’s at game.lua:2810? Might help with patching
This, at the bottom of the Game:update() function.
I override save manager so could be an issue with that
and maybe it not loading properly?
Like from a corrupt settings file?
Ok this is seriously getting annoying.
Can't bugfix a joker cause opening the poker hands tab is just gonna produce this crash.
can you tell me what setting of talisman you have and how to reproduce it
i'll try and fix
Unfortunately I don't think you can, after it happened I can't reproduce it.
I still have a save from a different time, lemme see
cooking something
kinda surprised money and other UI stuff wasn't formatted in vanilla game
probably because who would ever get this amount of money
Is it possible to just have a "...and X more" entry at the bottom of the list if it would go offscreen
commas in ui is a godsend
also i think we gotta have a rounding error visual fix
like only show idk 2 or 3 digits after the dot
wym
for like hands/discards?
like idk if its exactly a rounding error but that first image
for everything
you used compound interest
had like 17 digits after the dot
yea in 2nd screenshot
we dont need that imo
you can see that it's gone
ye it should format hands discards money ante
I think
I know money for sure
not 100% sure on other stuff
and all numbers in tooltips will be formatted as well
I know xmult cards can end up with like "×2.07999999999999"
Everything I wanted to add should be finished
- number formatting should be used (probably) for all UI numbers
- off-screen cashout is hidden
that should be fixed
krusty the crown is very susceptible to this
lmk if you run into any issues
I tested it but maybe I missed something
and I'll create PR now
not entirely sure if my changes should be in talisman, but
1 - I dont like idea of a mod that's just this small qol, and dont know if it fits with cartomancer
2 - I dont want to add another patch to make this qol talisman-compatible 
wait, one thing I forgot to test is hand chips /mult
tho tbh maybe it does fit in cartomancer if I look at it as game optimization mod 🤔
Yeaa so I decided to include this in #1258438028800692224 instead, will push a release some time today.
@main arch I still created a PR for talisman, but it's only on your number_format function override, it should be pretty harmless without cartomancer, but if you don't want that compat to be there it's fine
ngl this is the sort of thing you might want merged with Steamodded, too
Because it’s a big QoL improvement in general for crazy modded runs
Hmm, maybe
There are a lot of UI changes people want to make in Steamodded, like Emerel’s pitch for a whole new Decks menu.
I could imagine this could be added.
btw Math, what do you think of hand values switching to scientific notation at 1 million? makes the tab slightly cleaner 
Looks good
uh, also if I were to PR the scientific notation stuff to steamodded, do you mind if I also include the lovely patch that makes hand values use number formatting?
from talisman
Sure
I'm all for adding it to steamodded
made a PR
Btw Math, what's the reason the talisman dir has to be named Talisman exactly?
Is it only the nativefs.read/nativefs.loads in Talisman itself or other stuff too?
Its because it is a lovely mod and lovely doesn't provide a way to get your own path, so you either need go do some complex stuff to try and figure out where your mod folder is (which might not even work), of just assume some sane default.
ye
yes I assumed as much, I was just asking whether that's used anywhere outside of nativefs.read or nativefs.load
I mean the same restriction happens no matter how you try reading the files
I think it's planned to have dir path accessible with lovely soon™️?
Lovely wa supposed to be updated to add if but then meth went on vacation and noone else seems to understand lovely enough to contribute to it
Yeah and I believe this change needs a restucture of the code which I'm not smart enough to do
TBH it seems odd to me to do something like DLL injection in rust
otherwise it would probably be something like C/C++, no?
Yeah
I mean DLL injection interfaces with c apis and requires unsafe rust to do
Maybe it's just a case of meth knew rust betger
steamodded does get its own path, and I just isolated that functionality
it could be reused as a workaround
How does it work?
Also you're already scanning the entire mod foldsr so it's not that much more work
previously it was integrated into the mod loading routine, but I decided to load core files through NFS instead of using lovely for improved readability
it's a lot more lazy though, it scans directories looking for a specific file name, and if it finds one it confirms the first line
Yeah I figured something like that
there's no top-level files to go off of, so it backs out to the parent directory, but that's easy to change
But then everyone copoes that and then you have 2 mods with the same file name and then shit breaks.
hence the check for the first line
Oh I guess that helps
But someone is going to just copy paste it exactly if we're recommending it
And then chaos
Oh also you need to include NFS in every lovely mod then too
yeah nfs is already the norm
Yeah but I'm not the norm
fair enough I just thought lua would support getting the cwd
nfs should just be loaded automatically with lovely 
Well the issue is lovely just loads the code as a buffer, and that's only if you have a module.
Otherwise your code is injected into the games code and the cwd is known but not useful
righto
Also because of that, rewuire doesn't work for modules in your local path
yeah I noticed that too
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "ease_chips(0)"
position = "at"
payload = "ease_chips(to_big(0))"
match_indent = true
overwrite = true
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "chips = 0,"
position = "at"
payload = "chips = to_big(0),"
match_indent = true
overwrite = true
``` @main arch please add
Make a PR :)
idk where to put them in hte lovely file
Anywhere
okay
When I try to add Mr. Bones (Or Perhaps any "Prevent death if score is x% of required score" joker) into my joker slots, the game crashes and gives me this error message:
Any help to fix/mitigate this issue?
This might be a JokerDisplay compat issue?
Actually lmk see what’s at line 250 of your mod where the crash is reported
G.GAME.chips / G.GAME.blind.chips >= 0.8
--[[line 248]] calc_function = function(card)
--[[line 249]] card.joker_display_values.active = (G.GAME and G.GAME.chips and G.GAME.blind.chips and
--[[line 250]] G.GAME.chips / G.GAME.blind.chips >= 0.8) and localize("k_active_ex") or "Inactive"
--[[line 251]] end
Alright so what you can do is somewhere in your code do
if not to_big then function to_big(x) return x end end
And wrap both sides of the comparison in to_big()
And it should work
That is a jokerdisplay compat issue, I don't know why your file is the one throwing the error. Are you overwriting the vanilla jokers?
I got it sorted out, thanks.
question: do i have to worry about to_big being nil or not amymore when using it in the current version?
if you have talisman as a dependency, no
oh ok
So, if I cast this to bignumber it seems to think that decimal numbers are smaller than 0 (because e0 > e-1). Is this intended or am I doing something wrong?
that sounds like a bug
Am I missing something or is Talisman a bit useless if you pay with a ton of nodded jokers from various sources like I do? It seems from the readme like any mod that doesn't specially support talisman will have the scoring be incorrect once reaching the normal limit. Is really rather brave my run be forced to end and start a new one than have scoring go wonky and inconsistent like that. Am I missing something?
Just disable mods with no talisman compat ig.
So yeah not for me. Fair enough :3 Everyone plays the game differently
most mods don't need to change anything to be compatible
only very specific effects
That kinds makes it worse. I tend to prefer kinds esoteric jokers, lol. So the jokers I build my run upon having a chance of randomly breaking down is... non ideal
no like it's really really specific
i think most mods either don't have incompat in the first place or have it already implemented
only ones are ones that haven't been updated recently
maybe i'm missing something hmm
The Readme for talisman makes it seem a lot more widespread so idk
In any case these are the boys I use
Slightly updated since I took this screenshot, but I'm not at my computer rn
Oh from the top of my head Boredom slayer from JankJonklers and a lot of the things in Mika's (the things that trigger based on blind score) is gonna be incompatible
Everything else i think shouldn't cause issues
How do I get the 2.0.0 beta version
this should probably override math.abs
is it normal that cards doesn't count, just counting the hand itself?
Can we make talisman works on joker abilities, money, hands or discards ?
Yes theoretically but I haven’t been adding that because of mod compat worries
We’re patching all the scaling jokers because of Scalea but there would be many crashes from putting big numbers in joker values
Ye
When we have inf money, the "inf" isn't inf, is a nil value. This makes a run completely unplayable.
it works so long as you don't exit and load back into the run
is that even worth it at that point
i feel like that might be more trouble than it's worth now
" G.GAME.dollars = G.GAME.dollars + n " crashes the game if G.GAME.dollars is a nil value.
Buying or selling any items crash the game if you have inf money
eh does it?
from what I've tried it only becomes nil after reloading?
I only ever crashed with bull and inf chips
also seeing if it's possible to modify luajit to allow those comparisons
attempt to compare number with table, part 2
inb4 attempt to compare number with number errors start dropping.
@main arch you used “chips” in some of your evaluate_play patches instead of “hand_chips”. I made a PR for it
merged :)
k ty
also blame jenwalter /j
will do /j
talisman is crashing me on startup and i have no idea why
Was normal before ?
before it was normal yes
Did you update Tal?
i did
maybe also update your steamodded
just updated steamodded and talisman, talisman is the only mod rn
changed profiles, still broken
Check that it’s in Mods/Talisman exactly
i
no fucking wonder
i didnt realize it had to be named talisman specifically 💀
i've just been leaving it as Talisman-main all this time
m
turns out cards counting doesn't work on omegaNum
works on bigNum though
crypid doesn't seem to be working? even tho i have talisman installed?
i got the 1.0.2 ver rn
oh
you need talisman 2.0.0-beta3
u got a link by any chance?
pr for hand chips
hi i just had an idea
FUCK i thought i posted it already
@main arch what if u could mark a profile as "mods only" (and/or even with the signature gold seal visually) so that scores can save to it?
i could maybe make an option for that
Honestly it wouldn't be that hard to make a save file in the profile called like talisman meta or smth and save your data there and then when the game doenst gave tailsman it just loads the normal onr and goes on its way
that's a good idea
yeah, I also had this idea earlier today, but it's better if it's in a standardised folder, otherwise the more mods you have, the more setting files there will be
I mean, steamodded does that already, so
m
I mean the profile is a standardized location
is it normal that the game crashes if I use this seal but not if I disable the animations?
SMODS.Seal {
name = 'dark_seal',
key = 'dark',
badge_colour = HEX('202124'),
config = {exp = 1.1},
loc_txt = {
label = 'Dark Seal',
name = 'Dark Seal',
text = {'{X:purple,C:white}^#1#{} Mult'}
},
loc_vars = function(self, info_queue)
return {vars = {self.config.exp}}
end,
atlas = 'Seals',
pos = {x = 0, y = 0},
calculate = function(self, card, context)
if not context.repetition_only and context.cardarea == G.play then
if not to_big then
function to_big(x)
return x
end
end
return {
x_mult = to_big(mult) ^ to_big(self.config.exp - 1)
}
end
end
}
the crash happens inside card_eval_status_text() at the line if amt > 0 or amt < 0 then
the game crashes when animations are not disabled
that might just be a bug with the seal's status text though
since talisman literally disables that
maybe that's because amt is in BigNum and 0 isn't?
btw SMODS.get_blind_amount is added even without steamodded
so that causes an instant crash
new PR
Hello everyone, I'm trying to install the Talisman mod, to then install the Cryptid mod but I keep getting this crash. I tried every version of the Talisman mod but it keeps crashing. On the shown video I'm using the direct link posted by "Assertion failed" (11/08/2024).
Remove "-main" suffix
The folder name should be exactly "Talisman"
You're the man ! No more crash at start, hope it stays that way
On my way to remove all "-main" on my mods Ahah
How the hell do you increase the score limit to 10##1000 when C# can barely handle 2^1024?!?
Not surprising, but still! WTF does the code look like for that?! [DM me with that BTW].
you can look at the code
Standing on the shoulders of giants
Was told to change the settings for Talisman to Omeganum, but I cant even get past the mainscreen cause of a crash, is there a config file I can set in the game files?
Found it in the settings, i was using latest release rather than talisman-main
its working perfectly fine now
What is the most stable talisman + steammodded versions ? Gonna try doing a super high ante run vanilla-ish
btw you don't rly need steamodded for talisman, there is a crash without steamodded rn but it's fixed in my PR
ik but wanted to debunk this aswell
talisman should add config_tab if smods is present
For e and m, the number is m*10^e in BigNum
For array and sign, look here - https://naruyoko.github.io/OmegaNum.js/index.html
thanks ❤️
yw
I made a pr math
i've merged it
ok thanks
what changes now?
SMODS mod page has settings now
Can someone tell me if I have the Extended Hyper-E notation pattern for e10##1000 right?
Example: 10##1000 = 10#10#10#...#10#10#10 (1000 10s)
Pattern: Reduce the last number by 1 (E10#10#10#...#10#10#9 [999 10s]), then replace the last two numbers in the original expression with the new one (E10#10#10#...#10#10#(E10#10#10#...#10#10#9) [998 10s in the first part, 999 10s in the second]).
That sounds right
I just think of it as (approximately) arrow notation with 1 extra arrow
@main arch, can you confirm if I have this notation correct or not?
Looks correct
Hoooo, boy.... Trying to figure how large E10##1000 is gonna be a massive pain!
incalculably
It is approximately 10^...^10 with 1001 arrows, and the difference is negligible compared to the scale
I managed to figure out a pattern. It winds up being E10#10#10#…(E10#(E10#10)), with 4,495,500 10s. They start out with 9 iterations of 999 “10#”s, the next is 9 iterations of 998 “10#”s, then 997, 996, and so on. Still incomprehensively large when finally calculated, but it’s a start.
How are you going to calculate it?
y
m
does the mod feature a to_int(BigNum) function that converts the number if it is in the lua integer range?
I need to print a value in the loc_vars but it is in bigNum notation
Big:to_number()
I don't think SMODS detection works
It doesn’t
It definitely won’t if it’s in the code that gets added through oatches.copy
Yeah this
Error. How to fix it?
Syntax error: game.lua:4: '=' expected near 'Game'
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: at 0x7ff80aa49a00
[C]: in function 'require'
main.lua:16: in main chunk
[C]: in function 'require'
[[[[[[[[[[[[[[[[C]: in function 'xpcall'''''
[[[[[[[[[[[[[[[[C]: in function 'xpcall'''''
make sure Talisman folder is named Talisman
Folder has the name Talisman, but error remains
Verify game integrity
I think it would make sense if talisman could identify if save file uses vanilla,big num or omeganum
and gave you a warning whenever you load a run that is incompatible with current settings
@main arch
Sorry ment to reply to this
Thanks for the ping
ewww why does talisman override math.max and math.min to only allow two arguments
💀
how do i get the correct version of talisman to work with cryptid 0.5.1
@main arch
i used the one in the folder and it still said it was missing the dependency
why does this even get called in a vanilla run
btw after installing talisman on vanilla run my ante always goes to nil. Even if I don't use bignum/omeganum
not entirely sure what causes it
is there a reason bignum is default and not omeganum
I think it was originally designed like that without thinking 99% of the active users will be from Cryptid
Because without any ^Mult mods, OmegaNum isn’t necessary
Yeah
also bignum used to be exclusive wasn't it?
so when omeganum was added then we would be changing the default
Yeah true
if SMODS and SMODS.Altlas
Hello there. I am getting attempt to compare number with table whenever i try to compare a number with G.GAME.blind.chips with Talisman installed. Does anyone know what could be causing that?
wrap the number in to_big
because of how lua works, it's not possible to override comparison between different types of values, they just throw
so both values need to be bignums first
I see. Thanks!
So wait, if you run a profile with talisman enabled, you can't go back to unmodded? I noticed I wasn't getting achievements while playing
The profiles should be compatible, just not saved runs. There’s also an achievement enabler mod if you want to keep playing with only Talisman
ah, so I assume that any content mods disable achievements then
Steamodded disables acheivments
odd, I had more speeds installed and it still gave achievements
With smods? Because that might just be a lovely mod. I don't recall
The achievement enabler is included in example mods (you have to move it to /mods for it to work)
Did you do that maybe?
.
And yes it's an smods mod. It's also one of the example mods
no, as I initially tried to get mods through r2modman
I didn't do any of the file moving stuff myself
Ah I see
switched to manual install after I learned that 98% of the mods were here on the discord instead of on any mod sites
It still doesn't work. I have tried putting the to_big() function at a whole bunch of positions to no avail, it still gives the error at line 99. Which is weird because the comparison at line 96 works without to_big() 😦
Is there like a to_small or some function that turns the big number back into its original counterpart?
I found putting to_number() helped
Will try that
Works like an absolute beaut now with this godsend function. Thank you, good sir
@main arch 👀?
I must’ve forgotten about this. I’ve been a bit busy so a PR would be great :)
I started a run using talismans high scoring to go past ante 39, but now am at 32 and just scored naneinf. Might be cuz I played on my laptop and PC (that both had talisman with the setting on), but is there still a way to safe the run and get past ante 39?
If you go past e308 on a hand that is above level 1 it instantly goes naneinf
If that naneinf instawins or not depends on the other mods
My workaround was playing a run without using planet cards
If you want to salvage ur run check what hands you have leveled up and try scoring with the hands that are level 1 (three of a kinds, pairs idk)
yeah or with crytpid if the one joker that scales scaling jokers if there values hit e309 they become inf
It caps at e300 now
oh good
was thinking could talisman just convert inf to e309 or whatever
For saves, it definitely should
yeah just in to_big
And also “local inf = e308” in the savefile header
So I didn't really expect to be able to continue my run, but unless I just missed it you should probably still at a dosclaimer to the number- size setting that of wipes any current run ro change
Is there anything stopping talisman storing its config in the steamodded config folder like Trance does now?
Mostly just the process of migrating it I think
here's an idea:
if at all possible, move score calculation to a love.thread.newThread, so it doesn't block the main thread and your game doesn't crash - maybe adding a Calculating... thing, which could be cancellable by exiting to the main menu
also i wonder if i could get ExpantaNum ported over to lua
although that is in alpha right now
Considering how hardcoded everything is, possibly very difficult
don't
this has brrn suggested so many times
yeah it would require breaking compatibility with a lot
but there truly is no point
ah, fair enough :P
but but but nyumber need go bigger.. ,,
I don’t think this would help much because memory issues are larger
even still
Is there a way to easily enable and disable the scoring animations during a run, if at all?
Menu > Mods > Talisman > Config
There's no quicker way as far as I know
And it doesn't change until the scoring hand if you do it in the middle of a played hand
Thank you
you might like what was just added to Talisman...
Wait you were able to do that?
Hmm not familiar with corutines
Does this have side effects with the event queue?
event queue is unaffected
not me, cg did it
all scoring happens before the event queue events
so it runs scoring in a coroutine with active memory management basically
i wonder if it's feasible to multithread omeganum, ive never personally done any multithreaded work but considering that's the bulk of the time spent for some jokers it might be worth it if it's possible
i would imagine not since every calculation is reliant on the previous
but who knows
i believe other events are just blocked by an event that doesn't return if scoring is still happening
well, returns false, i had a patch for that
unsure if the patch is the reason for that or not though
i don't exactly remember whether it's necessary but i just left it as a precaution
you ever think about how much faster scoring would be if jokers specified which contexts theyre relevant in and which can be skipped over (specifically context.individual
like you dont even need to do this manually as the modder you can just do something like
forgot to finish that message
but like not v.config.center.calculate or string.find(string.dump(v.config.center.calculate), "individual")
obviously this is slower than just calling a blank function but you only need to do this once as opposed to 400000 times
..yeah? it only works on functions
that's like the entire point of string.dump
regardless, this has some issues (such as if a card for whatever reason called some external function to handle it's calculation) where it could cause problems
and im not in favor of adding something obscure like this that could potentially lead to an issue that would probably never get diagnosed
the more significant thing to note is that with a lot of joker retriggers the bulk of the cpu load sometimes comes from hundreds of thousands of unnecessary function calls that could be avoided if there was a way for calc to know whether to bother calculating the joker
Ok I just never knew string.dump existed lmao
ya it's not that useful
one thing it's useful for is passing functions between threads (although I don't actually know if that works or not)
Maybe we could just add a bunch of “yes” contexts and “no” contexts
and if those tables exist for optimizing it, then it would run if some combo of the “yes” contexts are satisfied and none of the “no” contexts
You’d need the modders to oblige but this is something that could be done for vanilla and Cryptid at least
Joker/retrigger stacking could also work, I know Jen has discussed the possibility of adding the former to Incantation
retrigger stacking would be nice, just won't happen anytime soon
would be very breaking
it might be worth it to put a good chunk of effort into rewriting calculation entirely (speaking of, what's that dead "better-calc" smods branch about?)
Someone’s attempt at that…
clearly we should just make better-better-calc
I think it was trying to make calculation check a table of cardareas so if you made a new one and wanted it to handle calculate functions that in vanilla didn't, you ould just add it.
I think
I haven't looked at it in a couple months.
sounds pointless
Retrigger API was that, in some ways
Jokers like Wario wouldn’t be possible otherwise
doesn't wario just give $3 when a joker triggers during joker_main?
ah
And it has to actually trigger, not be a dud
so whenever it returns a message
or what
(id look myself but im pacing around right now
Also I kinda want to think about a general ETA calculation for the scoring
I know you had some ideas, would be cool to get it working even if it’s just a percentage or something that’s very rough
Could give people an idea of if their hand will EVER score
lmao yeah
I was working on that earlier
messed up something somewhere and gave up
I will try again though
fresh eyes
I’m curious your logic behind it, might help me think about how to add it as well
Ok better idea, and this part could even be merged with Steamodded
Function that returns true if the Joker should be calculated. Always calculates if it doesn’t exist
just write a program to check if any given hand will terminate or continue forever. wait...
"bulk of calculations come from unnecessary function calls"
"add an extra function call!"

If you’re wrapping an if statement into a function is that bad per se?
To save a lot of the work, especially in joker retriggers
it'd definitely be better than what we have now
essentially you count up number of card retriggers (which you can only do for the first card, since calc only asks jokers for repetitions on a card after the previous card has already been scored through. so you just count up the first card and multiply by however many cards there are, that's the best you get) and multiply that by the number of joker retriggers for each individual joker, and then sum all that up
and then add the number of triggers for each individual joker that'd happen during joker_main
and that gives you a rough estimate
main issue is of course if you aren't retriggering each card equally
wtf
why did half my message die
m
Now that I think about it, the only “good” way would be to run a pass before scoring that just calculates how many triggers you have to do
But even that is tough, many jokers have functions within them that will screw things up too
Like giving money when calculated
to be fair, that's already done with the sole exception of per-card scoring
it'd be pretty simple to simply patch in to check repetitions for every card first and then remember that
why didn't i do that? i just really didn't feel like writing lovely patches 3 hours ago

Getting it done tonight would be nice, if possible. It’d be a cool feature for 2.0 release
ill see what i can do
Ty
wait huh
why in gods name does retrigger api go through every single joker and calculate it for joker retriggers every single time a joker is calculated
so much for unnecessary function calls i think that just might be the bulk of the calculation
so much for this 
might be fine?
🫠
I'm curious would be doing an if statment to check if a card does run be more efficent than a function call where it tghen just does an if statment and does nothing?
cleaned up the UI for this
🔥
lol I forgot about this tbh, it's mostly irrelevant though since the gc is only called when necessary now anyways
It’s important when draw frames are slow
But I think 30 FPS is a better compromise where the game is still decently smooth
I don’t know if you have implemented that feature already but could you add a animation skip for the space joker
As of my latest memory, I still have to sit through the clicking sounds etc.
And with my old hand level record being over 40k and my new one being much higher some day, I would really appreciate not having to sit through tens of thousands of clicking sounds
Also, they take forever to finish
I just saw it is an open issue
Nevermind then
nopeus works for this
issue is nopeus requires steamodded, and that crashes his run for some reason
I can try doing this tmrw though, shouldn't be too hard
oh I see
cryptid
guh
does this have a calculation screen?? or is that cryptid
ohhhh
solution to being bored while calculating:
NFS.remove(tocopy)
NFS.createDirectory(tocopy)
local exename
local main = love.filesystem.getSourceBaseDirectory().."/"
for i, v in pairs(NFS.getDirectoryItems(main)) do
if v ~= "version.dll" then -- mac should launch as default Balatro i think
if NFS.read(main..v) then
NFS.write(tocopy..v, NFS.read(main..v))
if string.sub(v, 1, 7) == "Balatro" then --as opposed to v == "Balatro.exe", for mac compat
exename = v
end
end
end
end
love.thread.newThread([[
os.execute(({...})[1])
do end
]]):start(tocopy..exename)```

you can get the executable from a built in thing
I forgor what it's called rn
arg[-2] iirc
take a look at SMODS.restart_game
i would imagine SMODS just defines it as arg = {...}
going off of the love documentation
okay yeah
i guess the SMODS function must just, not work? idk
ah, it is a lua thing
The three dots (...) in the parameter list indicate that the function has a variable number of arguments. When this function is called, all its arguments are collected in a single table, which the function accesses as a hidden parameter named arg. Besides those arguments, the arg table has an extra field, n, with the actual number of arguments collected.
no wonder {...} is wonky and needs to be wrapped in an expression
add an option in the config menu to launch a subgame of balatro during balatro
https://github.com/cg-223/scoring-coroutine-tal/commit/4f0fed2294661b60e88146930814718a2f43b22e
this works and saves like a ridiculous amount of time on scoring
well
not sure on time
definitely on calcs
went from 2.5 million to 100 thousand
the catch here is that it:
only works (in terms of the performance increase) on modded jokers
only checks the contexts inside that specific joker
and it of course is not refined
this was a test
explanation of what that does btw
for every joker, it dumps its calculate function and puts every string in the function in a table (such that if it has ANY reference to a context, itll be in that table, aside from a few contexts which are practically everywhere and arent helpful in determining whether a joker should be called)
so lets say i have a joker like this:
calculate = function(self, card, context)
if context.individual then
--blah blah
end
end
when this gets dumped, itll be more like
(RANDOM GIBBERISH)individual(MORE GIBBERISH)
it just so happens that that there is NEVER surrounded by an alphabetical character/underscore
so you can just match that with a [a-z_]+ regex search and put every such string in a table
and so, it'll see every string, but most importantly the contexts relevant to that joker
and all of these are applied to the individual jokers (but it really should be applied to the centers)
the important thing is that when a joker is being calculated, if the game sees that none of the contexts are even mentioned in the jokers calculate function at all, it just skips over that joker since it clearly does not care about whatever the game is asking it for right now
anyways, now its worth mentioning the downsides of that improvement:
if a joker calls an outside function to do all its calculations, this will improperly skip it every time
if a joker intends to do something whenever it is calculated, this will improperly skip it every time
if another mod hooks into calculate_joker before talisman does (this would not be an issue if this hook was at the very tail end right before the main games cj function, but idk if talismans is), and it needs to do something every time, this will improperly skip that (since this returns early)
all in all im not sure the downsides are worth the performance improvement. if anyone has any ideas on reducing/solving some of these problems then please do share, otherwise im against implementing this
its a bandaid solution for the bigger issue that is calculations being lumped all into one function
oh wait i accidentally left in a profiling thing
whoops
ok, rough estimate for time saved is 20%, but it can be higher and lower depending on the jokers in question
i wonder how much adderall it would take me to rewrite scoring
oh wait yeah
I forgot that I discovered about 30 minutes ago that scoring is slow because of omeganum math
so rewriting scoring would do a grand total of barely anything
tbh it mihht be fine to provide some kind of table for SMODS to just tell it what contexts we want
for jokers with one context it would save them writing an if statment
but then it would save on performance
and wouldn't break (default could be just all)
I've thought of that as a possible suggestion on Talisman's end but that would require mod devs to add that compat.
If it was handled on SMODS end that would be easier to suggest others to use and by extension let Talisman optimize scoring further around it.
This just isn't really useful outside of Talisman
To be honest it could help for programmers getting into modding
One function for can_calculate that’s just the necessary conditions and one function that does the calculations
It also… might be fine in Talisman? Considering a lot of mods have it as a dependency and it wouldn’t be a required thing to do just to use Talisman
Also, if the bulk of the time spent is in OmegaNum calculation, is it possible to make a “hybrid” notation? Which automatically switches based on size
im not sure, i believe omeganum math is already fastish at smaller numbers anyways (you'd definitely know more than me though). i imagine an improvement can be made in places where you're doing xmult operations thousands of times, where you can wait and multiply say 100 of those together before multiplying that number with the main, larger number to have to do that burden of large-number math less. idk whether this would actually improve performance though
Tbh at that point, I’d rather code something like trigger stacking where you can do 1,000,000 of the same calculation in one step (eg. Baron Mime action, or a lot of Canvas retriggering one joker)
That would be tough to do though, but would be a massive improvement
(Like probably >100X)
jen did something similar with bulk using consumables iirc
anyways i think one of the hardest things there is still playing the normal vanilla scoring animations properly when you're stacking the retriggers
Don’t stack with anims on
true
is there any mod dependency for talisman (except for lovely i have that)? i have omega num turned on but i just go to naneinf if i go over e308.
It’s a known bug with poker hand upgrades
can confirm my suspicion about this bug was correct
(ignore the weird formatting, I changed it so I could detect talisman numbers)
m
i knew about this in June, why did I not find this brain-dead fix until now
anyway i now have to patch planet card UI to deal with it
finally, they can all be m
well this doesn't look right
fixed that too
i want e's to be replaced with m's from now on

When I leave a run (main menu/close game/crash) and resume, all my base hand scores become small. I've found that this only happens when both Talisman and Jimbo's Pack are active. Any idea what interaction could be causing this?
In notations, the differing capitalization of balatro.lua file and the filepath used to load it causes it to break on case sensitive file systems
I had a run go to ante 33 where I got "attempt to compare nil with number" every time I tried to play a hand.
Helpful folks in #general sent me to this mod - it does enable me to keep playing but I see "nil" as my ante number, can I fix this? It should be 33 (on mac if that matters)
Inifinity is less than 8.8e212? ;-;
After main menu then going back I now see this... I am confusion, so the score internally WAS e308 but I still didn't win the round?
Try doing a new run and ensure you’re on Talisman 2.0.2
Talisman doesn’t play nicely with vanilla saves
Oh no :( I've been working on this vanilla run for 2 days, I'm kinda attached, is there any risk of actual data damage if I keep playing it with Talisman or will all harm be cosmetic (like weird UI but no crashes)? Bc I can handle cosmetic
And yes version is 2.0.2
I’d recommend making a backup, but I don’t believe there’s any profile damage from using Talisman
Only thing is Talisman savefiles don’t work with vanilla, so your runs wouldn’t carry over from there. However the stats should save fine
Is there any way to "convert" a vanilla save into a talisman save? Even if it's manually filling out a json? I'm pretty attached to this run lol I'd like it to go the distance if possible
Not yet but I can probably add in the near future
Or just make vanilla saves work with it
Hey alexa how easy is it to learn Lua just enough for a pull request
easy enough that when i noticed fusion jokers had a bug i had it fixed in like an hour
(and then the pr never got accepted because the mod creator has been inactive for months. rip)
fork time
I think the easiest way to do this would be to convert all the hand level stuff from whatever it is to big numbers whenever you load a save (which is what Talisman does when starting a run)
@main arch does the talisman stuff for calling values like Xchips Emult Echips Ect not work with SMODS.eval_this?
because i cant get these to work
it doesn't work with that
you can do something like this tho (here is ^Mult)
mult = mod_mult(to_big(mult) ^ card.ability.extra.mult)
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(card, 'jokers', nil, percent, nil, {message = localize{type='variable',key='a_powmult',vars={card.ability.extra.mult}}, powmult_mod = card.ability.extra.mult})
possible feature to add for the future though
i didn't even know eval_this existed to be honest 😭
so put this instead of eval_this?
ye
will it work if i have multiple>
byw how can i do tetratinal mult ^^mult?
mult:arrow(2, x)
one last thing for chips is ti chip or chips
soo
hand_chips = mod_hand_chips(to_big(hand_chips) ^ card.ability.extra.Echips)
update_hand_text({delay = 0}, {hand_chips = hand_chips})
card_eval_status_text(card, 'jokers', nil, percent, nil, {message = localize{type='variable',key='a_powchip',vars={card.ability.extra.Echips}}, powchip_mod = card.ability.extra.Echips})
something like that except it's mod_chips
I also don't think the localize message even worked in the ^Mult example I sent you so that'll probably need more tweaking later
is it also powchips or powchip like i did
there's like no ^Chips in cryptid so it might be neither (for the key='a_powchip')
you might have to add your own localization key for that
it also might be Echip_mod, maybe that's why it wasn't working for me earlier
oh ok
found it tis chips
someone planned ahead with "a_powmultchips_minus" 💀
damnit it did not work
text worked fine but didnt do anything
so change my config thing?
funnything is the mult worked
where it says powchips_mod = .......
try some variations of that I don't remember what is supposed to be used
ok
probably Echip_mod
i tried them all i think its something to do with hand_chips
nvm i changed it to chips and it set it to 0
"chips" is just +chips
i know the hand_chips stuff is correct
the function has to be mod_chips tho
? all 4 of them
just that one
oh the others are chips? onlt the main one is hand_chips?
okay so
mod_chips is the name of the function
hand_chips is the name of the variable that stores the chips
so you're only changing mod_hand_chips to mod_chips, everything else uses hand_chips
ok yeah id di that and it no work BRuh
this bull shitary is making me upset i have to go to bed though sooo
do you mind if tomorrow i try to add suport to eval_this into talisman pr?
not at all!
i'd prefer if it had eval_this support tbh, i just learned about that function today
not sure if you can just call the function again in talisman
this is the function in steamodded
function SMODS.eval_this(_card, effects)
if effects then
local extras = { mult = false, hand_chips = false }
if effects.mult_mod then
mult = mod_mult(mult + effects.mult_mod); extras.mult = true
end
if effects.chip_mod then
hand_chips = mod_chips(hand_chips + effects.chip_mod); extras.hand_chips = true
end
if effects.Xmult_mod then
mult = mod_mult(mult * effects.Xmult_mod); extras.mult = true
end
update_hand_text({ delay = 0 }, { chips = extras.hand_chips and hand_chips, mult = extras.mult and mult })
if effects.message then
card_eval_status_text(_card, 'jokers', nil, nil, nil, effects)
end
end
end
i can probably hook it, or patch into it if I can't hook it nicely
How does hooking work
i can show you but I don't think it would work nicely with this
patching will probably be better, or completely replacing the function with something new
i found the issue
it had to be chips = hand_chips
but yeah we should still make eval this work with the talisman oparators
agree
also where would i put mult:arrow(2, x)
inside mod_mult
Oh ok so like tobig(mult):arrow(2,card.ability.extra.EEmult)?
what if the solution to slow calculation was omeganum C port 
tbh it actually would be faster to make omeganum calls asynchronous and only yield if you actually need the result of the call
no point waiting
just run all the calculations on a separate thread or smth
issue with that being how would you know whether the result of the call is needed
but bleh
just rewrite the entierty of balatro to be multithreaded
or well at leat calculations
the issue with this is that omeganum calculations are all reliant on the results of previous calculations
so one way or another you're always waiting on one thread
tbh if we could rewrite calulation to be smarter with retriggers we could speed up a lot of big calcuations
yea that's the goal of scoring ever gets rewritten
but that would require rewriting vanilal calcualtions and modded suporot
which is a lot of wokr
this https://github.com/cg-223/scoring-coroutine-tal/commit/4f0fed2294661b60e88146930814718a2f43b22e was a silly hack that cut down useless calculations by a massive amount
too silly for main branch unfortunately though
when you start using string.dump to optimize your code something is very wrong
oh btw is joker.calculate being run every frame of calculation still?
if so can we pause it to save some cpu cycles?
wdym
oh joker.update
i have no clue
i think it's better to leave that going tbh, just to avoid potentially breaking stuff
true
it's barely any overhead anyways
I was thinking about maybe making a pr for SMODS to make a lazy_calcuate that is only called
- Right before rendering your ui box
- right before calcuating the joker
- that might be all idk I feel like I forgot smth
cause I know I could save quite a bit of work for my one modded joker and also some vanilla jokers (assumign we rework them)
ya
I'm about to cross the norder and lose my cellular so good luck
my issue is that even if you save a bunch of time on not wasting cycles and whatnot, the bottleneck for high-scoring hands is still omeganum
gl border
wondering on if I should extend Talisman to affect more things that really only matter in Cryptid/modded runs
going to make these polls since if I add these it'll require mods to add more compat
When are emods going to be effected by this?
Like is knockoff swashbuckler going go be affected by the money one
Also what's going to use poker hand levels?
Can't think of anything off the top of my head
it's whenever you have to do comparisons with these values
there's probably a few modded jokers that'd need fixing with $, I'm not sure if any would need that for hand levels tho
maybe something like Aurinko would need changes
c rewrite of omeganum going well
(idc whether this makes it perform better or not, this is just a project im doing for the fun of it)
im not going insane
yes, having poker hands not be capped at 1.9e308 and resetting to 1 chip 1 mult is nice
balatro calculation on FFI would be insane if we could get it working
itd require me writing memory safe code which doesnt happen
to be fair i could just store all the references in lua and add an __gc metamethod to all of them that frees them on the C side
but thats no fun
I understand the annoyance of undefined variable diagnostic warns.
Altho can't you just turn them off in your ide?
probably
ah yeah figured it ourt
its fine though
ill just delete thsoe files before i do anything w the branch
Should Talisman affect poker hand levels?
13
15
1
Yes
1185786257775792219
again
Should Talisman affect $?
13
15
1
Yes
1185786257775792219
again
The people have spoken
am i crazy or would this not just crash
i don't think lua exactly lets you add a string to a table
the only way i see that happening is if it allows you to do that with an __add metamethod but the omeganum one doesnt handle that so
it would try to interpret "Iteration failed to converge" as a number
metamethods work only if both sides have the same metatable
but doesn't .. work?
is that true? i was under the impression that it worked if they had the same metamethod or one didnt have a corresponding metamethod
nah it has to be the same metatable
can't read that
Now print b+a
same thing
ill try empty metatable and conflicting metamethod
empty metatable on b still works
uses the metamethod of whichever component comes first
this isnt luajit though
might be different for that
I don't remember it working that way
but be a luajit thing then or changed in post-5.1
possibly
this command line is 5.1
this one isnt
same behavior as 5.1
just tried the same thing on most recent luajit
same behavior
interesting how conflicting metamethods dont matter but i guess it makes sense
its faster to not check
going to try these with the jen's almanac modpack and see what/how things break
I feel like doing this is going to cause a ton of mod incompats
Yeah that was my biggest worry
I want to roll it out slowly so modders are able to fix these before they happen
Most jokers should be fine though, since very few affect hand levels period and most that affect $ shouldn’t need changing
I’d argue that quantum enhancements broke more
In the sense that more jokers will need to change to work with it
You should make it a branch release only at first, so people who just use release don't get it, then make a beta release, and then finally bundle it with cryptid
Yeah that’s the smartest approach
Didn’t think about the branch thing but I’ll definitely be using that
random thought, what if we made a separate mod that adds better calculation API and implements it for all vanilla jokers
and then also make that compatible with Talisman/Steamodded
this way we can do it without breaking compatibility with the current system while also optimizing it for mods that need it
like Cryptid runs or DrDreamo-type runs
i feel like that'd be kinda hellish
With only 150 jokers I don’t think it’s TOO bad
or do it as a Steamodded feature with some backwards compatibility but that feels more nightmarish
oh also wdym by "calculation api"
because i don't know exactly what that implies, like evaluate_play in its entirety or Card.calculate_joker or what
idk
Definitely at least calculate_joker to start
and then override more things as needed?
would making a separate mod for that really be good though? i feel like we'd be better off making an smods branch and rewriting it there, potentially adding backwards compatibility and then just merging that
i feel like backwards compatibility would be as easy as just making the new calculate function calculate_v2 or something
unless the new approach to contexts and whatnot is entirely different in which case it'd be complicated
true
playing with the jen's almanac mod pack, going to list all mods I've found issues with (updating this as I test):
Betmma Jokers (Piggy Bank)
Cryptid (White Hole, Compound Interest)
Jen's Almanac (safeguards and fractional hand level colors; Phobos)
JenLib (lowhand, hihand)
More Fluff (Spiral Joker)
Talisman 2.1.0 alpha
What's new in this version:
- Cash now uses large numbers
- Hand levels now use large numbers
- Hand level up animations are now skipped
This will break compatibilities with a lot of mods, so it is currently in an alpha state. I will wait until most mods have compatibility with this version before moving it to the main branch, but modders are strongly encouraged to ensure compatibility with 2.1.0 in the coming weeks
Known issues:
- Lines in the cash out screen display naneinf for values over the vanilla limit
🤔 What of including support for accessing the Talisman operations for SMODS.eval_this? Or is that more of on Steamodded side to prepare first, like calling a table that includes functions that may return true for custom chip/mult operations and then Talisman can add its' own into said table?
"omeganum.dll is not a valid win32 application" okay luajit thats ok ill build it for 32bit instead "omeganum.dll is not a valid win32 application" im going to kill you
How does this behave with DebugPlus's money commamd?
i don't think efficiency is necessary without a setting to change the time spent calculating per frame
so if I was to do a calculation rewrite where cards only calculate on the necessary contexts...
how do you optimize that?
i think most of the redundant calculations come from retriggers
but also, oh god...
even in the if statement tower that is Card:calculate_joker, contexts are checked before jokers
if something within the joker center was indexed, that could save a lot of calculations
and then if possible, a "bulk calculate" that works with retriggers...
so, let's say a steel card is triggered 10,000 times; it just does 1.5^10,000
I think stuff like that would help me with my 250 cards, 70 parking and 70 mimes
ok ill just kill myself then
luajit ffi might actually be the thing stopping me from making this
damn
C development except compile at runtime with no preprocessor
okay it seems like the version of luajit that balatro uses just ... doesnt have working ffi?
so uh
so much for that
I got FFI working for Brainstorm
(and relevant code within Lua is in the latest Brainstorm ver)
which branch? master doesnt use ffi anywhere
ah nvm foun dit
odd
its pretty much what im doing
why does visual studio not look in the space it dedicates for header files for header files
i hate that im forced to use this garbage
alright yeah no clue how you got old luajit working
I didn’t even do anything weird, it just works
its not possible that inbetween then and now something broke no?
Was talking with some people on the Cryptid Discord and I think the next step for a possible v3.0 would be retrigger stacking, that feels like the only useful optimization
People still use that Brainstorm release and it works fine on Windows
thats
incredibly odd
im just gonna make sure the actual program still works
okay yeah it builds just fine and does exactly what it should
thats so weird
compiler is clearly doing everything just fine
i have no clue why luajit just refuses to behave
Also making all vanilla jokers use SMODS calculate functions would speed things up
I tried that over in https://discord.com/channels/1116389027176787968/1321937684868104313 and it helped a bit
the world would be so much better if there was a gcc windows binary literally anywhere on the internet
Make it wher you pass the number of retriggers and then it can do math instead of looping
Just make a lua compatible c lib
..what do you think im trying to do
Using lua jit to interface with c
Lua proper can use c
Your c code just needs to be made fir it
i honestly dont feel like rewriting a bunch of stuff because the proper channels dont actually work
not today at least
i can always blame thunk for making us use an archaic luajit version
im certain now btw the dll is perfectly fine ffi just thinks its 64bit when it absolutely isnt
i know this
like i said
i dont feel like rewriting things because the proper way to do it isnt functional right now
i would rather complain over the internet than get things done
Math don't you think there's too many mods that depends on Talisman now it kinda needs to be part of smods?
like wtf
realistically talisman shouldnt be a dependency for any mod
except maybe cryptid
its not hard to work around supporting both talisman and vanilla
yeah no that sounds like a terrible idea
Guilty as charged for deciding to have Talisman as dependency. 😛
i'll bet some are just xchips tbh
then maybe just put some of them in smods
yeah maybe could put the operators?
we can put xchips (and maybe exponents, not sure) into steamodded
but nothing else should be added imo
fair
...it does feel wrong doing this. 😛
... talisman can just hook the function
(me waiting for lovely patches on mod files to no longer be broken)
When such is done, then that "hack" is outta my script.
(don't mind the fact that you don't need to override the function and a simple hook would do)
Do show such hookery to be done instead of this, then.
just put the lines and a call to the original...?
it doesn't need to be in the middle
...afraid I don't follow? 😅
local et = SMODS.eval_this
SMODS.eval_this = function(_card, effects)
if effects then
-- insert code here
end
et(_card, effects)
end
Assuming I just put the additional lines for the extra operations alongside the update_hand_text & if effects.message right there?
no need for the message, but yes
Idea for optimziing calculations. In calculate_joker you can return an object like { talisman_never_calculate_this_context = true } and then talisman caches that info and skips any calcualtions for jokers that indicate they never calculate there
the code would be pretty simple
for jokers with only one calulate: lua if not context.joker_main then return { talisman_never_calculate_this_context = true } end -- do stuff end or with multiple lua if not context.joker_main and context.before then return { talisman_never_calculate_this_context = true } end -- do more if's like normal end
any mods that didn't change just wouldn't get the extra optimization
idk how much this would help
probably for retriggers you could just skip all of them ones on a useless context
us
any way to force skip animations with a hotkey or such? (I know the settings, but started a hand without it and an hour later regret it)
unfortunately when they're already going you can't stop them. the best thing to do is to just back out, go back in, and then play the same hand with anim skip on
Yeah just did that, worked great
But if you are just waiting for one hour to let anim skip finish that trick won‘t work anymore 😅😭
lol yeah
gosh this is why we need to stop pushing limits
previously people were limited to a few seconds of calculation time because of crashing, and it was meh everyone was content
then the talisman calculation screen got merged in and everyone immediately started doing multi-hour hands
balatro players will always thirst for bigger numbers fr
I was like 1/8th of the way through 200 red seal steel kings with 90 negative pluto cards
final result
2 of these exponetia. 5 blueprints copying Chad and 3 brain storms copying the exponetia. with 225 Steel, red seal, kings with 2 barons, mime, ancient joker and 1141 levels on high card.
im tired
But... big number good?
true..
This run only took 4.5 hours before this last hand
worth it tbh. Overall, 7 hours of gameplay and probably like 2 of them being calculations :3
jens almanac players wasting 3 hours of their life so that their 3#352##9999 score can go up to 3#353##9999
That sounds amaizng
Hhehe jokers go big number
and that guy is doing it in vanilla 
2k9 moment
as a jen's almanac player,
i can confirm
You need at least talisman 2.0.2
uhhh
you...
i don't remember it working that way
what was this meant to accomplish again
I think we were thinking we didn't want to match 1.0.0~ to 1.0.0 but idk now
Probably for <1.0.0
so <<1.0.0 wouldn't match beta versions of 1.0.0?
you can just use <<1.0.0~ for that
Yeah but will they know to do that?
Idj your the one programing the versions so I'll let you use your judgment
But if I want like >=1.0.0 << 2.0.0 I don't expect a 2.0.0 beta
i can just move that line down 3 lines and it will do that i think
Maybe we should be more strict for downloading but not just matching
this isn't what we want either
effectively this would prevent (>=1.0.0~a) from matching 1.0.0 because 1.0.0~a can't be less than 1.0.0
so 1.0.0 isn't greater than it, either
i think we just remove the check and live with the fact that you have to add a squiggle to get what you want
fuck it we ball, i just removed the line
wtf package.loadlib is ALSO giving me "omeganum.dll is not a valid win32 application"
so is the fucking visual studio debugger
mf you built it for win32!! you tell me why its not made for win32
at least i know its not an ffi issue now
hi just a reminder that my pr for ante nil fix exists
m
I once spawned 500 8 of hearts with a single play
Math my guy can you remove the "~dev" suffix in the versioning?
should be fine w/ latest steamodded, no?
gemstone is still complaining it
1302a
I am very confused
I thought I'd removed the line yet somehow it's still there
fixed on 1303a 💀
hi! i have a question, can i change from bignum to omeganum without restarting my run, just restarting balatro?
i don't think the two are compatible no
what do you mean? i need to restart my run or just restarting balatro is enough?
you can try restarting balatro but if you get crashes you'll need to restart the run
why do we even still have bignum i wonder
it's kinda useless
i forgot to change it, it's the first time i install this mod, and the first time i get a goddamnit run
xdd
runs started with one are incompatible with the other
fucking finally
all i had to do was just not use vs2022
i can finally get back to like
actually making the thing
oops !
in all seriousness im just checking if my memory management is like working and thats with it . not on
i do wonder how i'm going to do memory management though, obviously i can represent bigs inside a userdata and give that a __gc property but i kinda dont want to have to deal with the lua stack right now
the alternative is forcing you to do memory management in lua which isnt happening
i wish you could give the __gc metamethod to things other than userdata
oh wait
ah nevermind
you cant give cdata metatables
unfortunate
i wonder if luajit has newproxy
ah sick it does
ahh yes shit is finally going my way
local bigmt = {
__gc = function(self)
omeganum.freeOmega(rawget(getmetatable(self), "data"))
end,
__call = function(self, ...)
return rawget(getmetatable(self), "data")
end
}
local function makeSafe(big)
local toRet = newproxy(true)
local mt = getmetatable(toRet)
mt.__gc = bigmt.__gc
mt.__call = bigmt.__call
mt.data = big
return toRet
end
ive just had a thought
nevermind actually that thought sucks
POV: Me whenever I make a mod concept
😭
My only two recent thoughts are a challenge about getting 5 jokers and having to figure out what they are (stupidly easy) and scaling enhancements (who here wants to play a 1/52 deck card 4 times for a Spectral? Not me!).
I swear all I can cook is API and saving files in spreadsheet format
That's it
😭
Anyways kinda suprised that newproxy still exists, didn't lua 5.2 nuke that?
ig LuaJIT is meant for lua 5.1 but still
luajit is 5.1 based
oh
yeah
well it makes sense newproxy is useful
even more so in luajit since youre meant to use ffi instead of the lua libraries
@prisma nexus is there supposed to be a return at the bottom there? js version does
why does Big:add in omeganum use "a" as a global
this is just mean
