#💻・modding-dev
1 messages · Page 42 of 1
I think there's an offset parameter which is often set to be negative (moving it up)
I am porting my old 0.9.8 code over to 1.0.0. Anybody have a basic mod that just adds jokers a challenges and a testing deck that I could use for reference
Finally, the mod is out
https://discord.com/channels/1116389027176787968/1257660889520144446
Does anyone know where Boss Blind tooltips in the collection are generated?
huge thanks to all you people
Congrats on the release!
anyone know if theres documentation for adding custom unlock requirements for jokers and vouchers and adding your own hands (secret ones) along with planet cards that only show up once youve played the hand?
for unlocks, there's a check_for_unlock function you can put on your objects that gets passed the arguments from the game's check_for_unlock global function, you should read up on that one in the game's source to see how it works - you just need to return true in your method to unlock the card
It might be create_UIBox_your_collection_blinds
ill go digging in the source code then
thank you
Actually it calls create_UIBox_blind_popup
Poker hand API is still missing docs, you can look at the source code for that one. Use visible = false to make a hand secret
for planet cards, the corresponding property is softlock = true
thank you lots
one thing im not too keen on in balatro is that when youre going for big scoring runs theres basically 2 builds you can go for
or flush house w trib ig
so i wanna try and make it so you can build around different hands
@frosty dock can I add a new tooltip directly to a Joker's info_queue?
Like, nested G.UI.R objects or whatever
wdym by "directly"?
that sounds like a use for a generate_ui function
I think it's a bit too niche
do you think itd be better if it was a hand of three of the same rank?
i liked 7 cos of the jackpot thing
but any rank would work ig
The wiki doesn't say much
i just want you to be able to build around more hands in endless
The default implementation of this function acts as a wrapper of loc_vars. For advanced UI implementations, define this function directly.
Definitely
cool
generate_ui is passed full_UI_table, which you could insert UI elements into directly - tooltips live in full_UI_table.info
ill get that changed
do note that this will happen before anything in info_queue is processed
Good to know, I was hooking info_tips_from_rows to create Credits directly
Although I'm asking because I'm adding a Blind tooltip to a Joker
each entry into info_queue causes a subordinate call of generate_card_ui, surely you could patch that function to allow passing through a UI element directly if it needs to be in order
local info_tip_from_rows_ref = info_tip_from_rows
function info_tip_from_rows(desc_nodes, name)
if name == "cr_vic_credits" then
local t = {}
for k, v in ipairs(desc_nodes) do
t[#t+1] = {n=G.UIT.R, config={align = "cm"}, nodes=v}
end
return {n=G.UIT.R, config={align = "cm", colour = darken(G.C.GREY, 0.15), r = 0.1}, nodes={
{n=G.UIT.R, config={align = "tm", minh = 0.36, padding = 0.03}, nodes={{n=G.UIT.T, config={text = localize('k_vic_credits'), scale = 0.32, colour = G.C.UI.TEXT_LIGHT}}}},
{n=G.UIT.R, config={align = "cm", minw = 1.5, minh = 0.4, r = 0.1, padding = 0.05, colour = lighten(G.C.GREY, 0.15), emboss = 0.05}, nodes={{n=G.UIT.R, config={align = "cm", padding = 0.03}, nodes=t}}}
}}
else
return info_tip_from_rows_ref(desc_nodes, name)
end
end
so three of a kind gives over x27 mult?
oh
seems broken
make it like idol
where its a specific rank maybe?
yeah ill make it specific card and suit
to balance
Feels very niche
i want to make all hands viable for endless
my quick (and probably wrong) maths says that its about on par with 5 cards each x2
Maybe do probability to fit the theme. Something like If played hand is 3 of a kind each card has 1 in 3 chance to give 3 mult
sorry X3 mult
Bloodstone does troll sometimes
You could do a scaling joker that has probability. Something like X1 mult 1 in 3 chance to increase by x0.5 when a three of a kind is played
So you always hit x mult but gotta scale it early
thats not really viable for endless tho
Ohhh I see
i think making it a specific card from your deck, and having it as a rare is fairly balanced
and then you can play 3 of a kind for high scores
cook it up
or the new hand i wanna add, flush 3 💀
^^
tryna make it so you can play whatever hand you like and still go big endless
I thought of a nice idea
yea
that would be cool
So its similar to mime but for pairs and stacks with it
cheers
i think im gonna make a post in the modding bit about this
for the pairs retriggering
do you think having it only retrigger 2s would work?
i dont think you should be able to use it with baron
prefer the idea of it being separate
Well the whole idea is its mime again, which is uncommon BUT there is a condition making it only work when a pair is played. I think this alone is good enough to set them apart. If you make it only 2s then you are limiting yourself for it being used only for a wee joker steel deck
But its up to you
i reckon youre right
just a bit concerned cos there would be no real reason to pick it over baron + mime
cos you can hold 1 more card
maybe it could trigger card held in hands effects that are on the pair you play
like you play 2 steel cards and they each give 1.5
then the steel in your hand gives 1.5 too
okay you have 1 less card because your playing a pair BUT you are retrigging all your other cards held in hand. Of course mime is objectively better but your joker would be common making it more likely to show up
its essentially a debuffed mime
or nerfed i should say
thats true but then youd pivot to high card for endless
instead of sticking with pairs
maybe have it trigger gold and steel effects on the pair you play
but not baron
so if i play 2 steel kings
i get the steel bonus
alright alright I got ANOTHER idea then scrap the old one
So right now you want all hands to be viable yes
yea
The main issue with endless is you end up limited by your handsize
yea
This card may be broken but i think its a sick idea and may code it myself or some variation of it
every 9 consecutive pairs played in a row increase handsize by +1 permanately
you can adjust the number of consecutive pairs accordingly
that is pretty strong
maybe it should increment every time you do it
so 9 pairs, 12 pairs, 15 pairs
good idea
What makes it balanced is the fact it needs to be consecutive. Could get screwed with a bad draw or discards not hiting or just player the blind with no discards
Or the blind with no consecutive hand types
yeah
its def an interesting idea
i might try implement both ideas
and play around a bit and see what its like
But fuck it make a broken joker. Id rather have a broken joker than an underpowered joker so people would use it
hell yeah
endless scales too quick lol
so far ive got a joker that retriggers aces and one that gives 9 mult for every square rank card played
ace 4 and 9
actually im gonna make a post about this in the modding thing
cos i feel bad for filling up this chat w stuff
may be a good idea
If played hand is Three of a Kind, X32 Mult
Which is very excessive
X6 Mult if played hand is High Card containing a scoring Ace of Spades
was too much in thunk's opinion
Or maybe it was X13, I forget
I mean, following this logic you want to balance it with 3OAK Idol, which is X8
And The Trio is X3 IIRC
i want it to be as strong as flush five idol so its viable in endless
cos you can only play 3 cards the mult needs to be higher to match 5 cards of x2
How do I hook functions if the hook is inside a file called with NFS.load?
It worked when I called the file directly but apparently what I'm doing right now doesn't
for _, hook in ipairs(hook_list) do
local init, error = NFS.load(SMODS.current_mod.path .. "hooks/" .. hook ..".lua")
if error then sendErrorMessage("VictinsCollection :: Failed to load "..hook.." with error "..error) else
local data = init()
sendDebugMessage("VictinsCollection :: Loaded hook: " .. hook)
end
end
Wait nevermind only a specific hook failed and it threw an error
Is this spaghetti code?
local reroll_boss_ref = G.FUNCS.reroll_boss
G.FUNCS.reroll_boss = function(e)
--[[…]]
local previous_force_boss = G.FORCE_BOSS
local changed_force_boss = true
--[[…]]
local get_new_boss_ref = get_new_boss
get_new_boss = function()
local get_new_boss_val = get_new_boss_ref()
if changed_force_boss then
G.FORCE_BOSS = previous_force_boss
end
get_new_boss = get_new_boss_ref
return get_new_boss_val
end
local reroll_boss_val = reroll_boss_ref(e)
return reroll_boss_val
end
the {V:1} thing gives me an error
i can send a ss of it
thats the top bit
idk why it doesnt like it
Does it work
you're not giving it a color variable
in the localization thing thats what idol does
tbh idk what it means
i kinda assumed C was for colour
but idk why its v
that's just not how variables work in this engine
G.C.SUITS[suit]
for vanilla suits, it's one of "Hearts", "Diamonds", "Spades", "Clubs"
high contrast is accounted for
the V arg is for color variables, which you have to pass in through loc_vars, while C is for static, predefined coloring
ohh
i havent bothered doing anything with loc_vars for any of my jokers
is that bad?
loc_vars is what you should be using for anything stateful in terms of descriptions instead of inlining it into the description
#n# for any number n will be replaced by the variable passed in at index n
It totally won't go wrong when multiple rerolls happen in sequence 
Not quite
The forced boss is affecting the next reroll but not the first reroll
So it's delayed
so its not hardcoded
if that piece of code is where I think it is, I don't see how that would even begin to function with any amount of state involved
I thought this would adress it because I thought the issue was that get_new_boss was called inside an event
exactly
@frosty dock any help with forcing a specific Boss?
I actually had an injection that worked, but I figured I should use a hook if a hook works
use an injection
or use a hook but don't make the hook temporary, but its condition instead
even then it won't stack unless the condition is numeric
Actually it is a conditional hook. The temporary hook is just to revert G.FORCE_BOSS to whatever it was before I used it
I couldn't find an example of G.FORCE_BOSS being used. I reckon it's an artifact of the demo which was always Verdant Green
have you tried if anything breaks if you ignore G.FORCE_BOSS's changed value?
No. Since I don't think it's used, I only foresee my own mod or other mods breaking
I'd need to clear G.FORCE_BOSS elsewhere, I think that's the only change I'd need to make
for self-compatibility
What’s line 177/178?
I don't know if 1 = … is Lua syntax
oh
You can just list the values without keys
all my knowledge of lua is just reading the game source code and other peoples mods
cool
or do ```lua
[1]
but doesnt the index start at 0?
Not in lua
ofc it doesnt
Also not in Lua
[1] is
hmm
mfw [tonumber([[[[1]]]])]
Ah wait I think I understand the issue
When add_to_deck is called, the Joker isn't in the deck yet (?)
That's why find_card doesn't find it
does {V: take a hex value?
oh also there's another issue with this - color vars are their own thing
oh
it needs to be a field inside vars
you don't need explicit indices for numeric arrays
i mean in the description
yeah
I think some colors are variables
Like
Castle or something
there's some Joker that uses Suit colors as variables
colors are only displayed after injection, so in theory it shouldn't matter
cool
i didnt realise how dark the clubs suit is by default
so i thought it wasnt working
time to see if the card really does change every round or my pc explodes
no way
its actually different from idol and rebate and whatnot
is jackpot_card a global var?
no
then where does it come from?
After 3 hours finally ported to 1.0.0 for like 400 lines of code. I feel weak
WHAT
oh so it's just an upvalue??
a what?
yes
yep
its still the same card
oh, sorry, reload the game
what if you close the game and re-enter the run
(yeah the upvalue would be the same. including across different profiles)
set a variable G.GAME.XXX
so its always same card first round
do what other cards of this kind do, use a field in G.GAME
um
as for resetting values, you can define a function SMODS.current_mod.reset_game_globals() that will be called whenever necessary
G.GAME.xxxx_jackpot_card = whatever with xxxx being some prefix to ensure there's no collision if another mod would happen to have a jackpot_card too
how do i get it to reset and save and stuff tho
it just works
just shove that and your code for generating a new random suit and rank into reset_game_globals
applied to that field, of course
is reset_game_globals smth i do in my own mod then
just make a function
sorry ive acc got no clue about this stuff
function SMODS.current_mod.reset_game_globals()
-- code goes in here
end
thank you so much
i completely missed this message somehow
sorry
is there a set_globals thing too
there's actually an argument to the function that tells you whether or not it's being called at the start of a run
but either way it does get called there
im tryna hover over it in the collection and its telling me im tryna index a nil value
so i wondered if i need to set it when the game boots
Actually there's another issue
When one card is added to the deck, it's not still in the deck so the check before the reroll doesn't see it
Which means it can be overridden by the older one
right, you might just need to add your default value in Game:init_game_object(), there doesn't seem to be anything else that other cards like castle do to make this work
Pretty sure they just have a default value if the global one is nil
can i literally just append it?
oh it does return right at the top
yeah i got no clue how to do this ngl
gonna grab some cereal and ponder
Sorry, @frosty dock, how am I supposed to use Joker.generate_ui again?
Recently ported over my 0.9.8 jokers to steamodded 1.0.0 and everything shows up fine with description sprites whatever. No crashes whatsover but No matter what my calculate function never triggers EVER. Has anybody ever had this problem?
what does your calculate looks like
if context.joker_main and G.GAME.current_round.hands_played == 0 then
return {
message = localize{type = 'variable', key = 'a_xmult', vars = {card.ability.extra}},
Xmult_mod = card.ability.extra
}
end
end,```
Very basic x3 mult on first hand
For all my jokers this is just a simple case
😦
Yup they all work perfectly now
4 year degree in computer science.... For what?
what do you reeeeeally want to implement?
it's a challenge where you start with 1 less discard and have to play pairs
or else your hand doesnt score
plus, you can play up to 6 cards at a time
oh, and i want to implement the hand type "three pair"
30 chips x 2 mult base
uhhhh
hmmmm
did u install lovely?
the latest version of it?
iirc theres "hand of six" which does this but im not sure if its updated
also havent seen the mod author around here
im not sure
o nice
yay!!
i just didnt want to clutter up the chat with unnecessary stuff
the problem was a bad version of lovely
thank you all so much
bro let me tell you, the fact that youre developing something in your free time makes you better than 99% of comp sci students
keep it up
can someone help me out rq
ive got a joker i added that gives a bonus to a certain card
like idol
and it changes every round
atm i have this
which is fine except
if i look in the collection before starting a run
i cant hover over the joker because it crashes
i need to set G.GAME.vanexp_jackpot_card on startup
but i dont know how to
is there like an SMODS.current_mod.start or smth similar?
you can create a fallback variable for your loc_vars
instead of creating a variable on game startup
yea you can do if G.GAME.vanexp_jackpot_card then your code
yea an or works too
up to you
thank you so much
np
ive been struggling over this for so long lol
i was struggling over a similar issue in one of my mods too lol
didnt think of defaults for like 2 hours
sometimes the solutions are just too simple
does anyone know off the top of their heads what happens if you have 0 hand size
is it even possible to get to 0 hand size or does it floor out at 1
0 hand size kills you
aw dang it
if #G.hand.cards < 1 and #G.deck.cards < 1 and #G.play.cards < 1 then
end_round()
end```
i genuinely cant tell, is this what kills you if your hand size is 0?
if i set hand size to 0, wouldnt deck still have cards
yknow im just gonna test it myself instead of askin
this is running out of cards
this isnt when you play/discard all your deck?
oh i found the part that kills you
theres a lot of different 'kill you' methods
as in two
The smol joker has some serious birth defects
i think he looks cute
its just smth about his eyes
the makeup around the eyes does kinda not look like make up
agree
Make cubed joker
if my lovely pattern hits no matches, it doesnt show in the logs right
Pyramid joker
If you look in fan art there was a whole process
Someone put Jimbo on a ball in blender and rotated it then someone else pixelized it
Is their a function I can call on context.other_card to check its enhanced ability
cant find one in the source code
it does, check in the first lines
alternatively, you can open Mods/lovely/dump/targetfile.lua and check yourself if the change happened
context.other_card.ability.effect == "Mult Card"
Thanks. I noticed get_id also gives a negative value for stone cards so I was like fuck it and just checked if that was negative lol
i found my issue, i forgot to put functions/ in front of state_events.lua hee hee
it happens even to the best of us
this was... surprisingly hard?
so much of the game kinda just assumes you have cards when you play a hand
which makes sense
i hope this mod doesnt explode compatibility
why do you get a single chip lol
i usually just do placeholder values when im still developing
makes sense
ive got an unlock for a joker
but when you unlock it and exit to menu it crashes cos it cant draw an unlock box
i have no idea what any of this means
What's the error?
I do think it should be a single chip
I'm looking at a mod that defines generate_ui (D6 Jokers) but I'm still not sure how to make a tooltip out of it
whenever i exit to menu it gives me this
i tried removing all my mods and reinstalling
but its still there
INFO - [G] 2024-07-08 22:59:00 :: ERROR :: StackTrace :: Oops! The game crashed
main.lua:4117: assertion failed!
I got this error after updating to the latset version. How can I fix it?
Update: It's Codex Arcanum making this error.
is there a way to check if the current context is one of the contexts in a set array
i want to make a randomized joker with a random context, but i want to filter it
So you have a list of contexts and you want to see if only one is present? Or if a set one is present?
Does Steamodded support using enhancement_gate?
if any one of them is present, it triggers the effect
To the people who emoted 👍 , so I just pass enhancement_gate = enhancement_key to the Joker constructor?
Would that not then lead to triggering multiple times per calculation?
It could remember if it has been triggered during a run of evaluate_play
There’s not many conditional contexts either
wait no, i meant if a specific one is present it triggers the effect
i dont even know how i said it this wrong
I'm hoping to try and make some simple mods of my own, but I have no idea where to start on figuring out formatting other than just copy pasting other people's code formatting and hoping it works when I edit it. Is that really the best thing for me to do, or are there other resources out there where I could learn how to make balatro mods?
I mean, that's how I started, so I don't see any shame with that approach. You start by looking at solution, then try to solve it on your own.
Steamodded 1.0.0 docs are not complete yet, but there's some info https://github.com/Steamopollys/Steamodded/wiki
There's also example mods in steamodded that help you understand how API works https://github.com/Steamopollys/Steamodded/tree/main/example_mods/Mods
Okay, thank you!
You're welcome
You should definitely unzip Balatro.exe with 7zip and look through source code to see how jokers and such are calculated. There's also a helpful resource for joker calculation contexts https://discord.com/channels/1116389027176787968/1247703015222149120, which might help once you get the hang of the API basics (but I personally found checking calculate_jokers function or just searching 'Joker Name' in source code much better to look for examples)
Also, keep in mind that some modded jokers might use lovely patches, which are injections directly to the game's source code (they're always in .toml files) for features not covered by the API. So just copying lua stuff might not always work. But you don't have to learn that right away
I tried to make a very simple joker based off the formatting in another mod, but I got an error code saying [string (my code)] attempt to call field 'Joker' (a table value). Any idea what I did wrong here?
that's a version mismatch, your code is for steamodded 1.0, but you have 0.9.8 or below installed
When I go to the releases page, it says the latest release is 0.9.8. How do I get to 1.0?
You have to follow the git instructions
That's what I'm looking at, but it says to download steammodded from the release page, and the page it links to only has 0.9.8 and below
you get 1.0 via the source code on the main branch
Specifically these instructions here: https://github.com/Steamopollys/Steamodded/wiki/01.-Getting-started#using-the-command-line-requires-git
If you prefer a direct download, you could also just use this, but it's harder to update that way: https://github.com/Steamopollys/Steamodded/archive/refs/heads/main.zip
I found the source code download in the README on github. Is that the one that's harder to update, or will it be fine?
What is it that makes it harder to update? Is it like the old version where instead of just sitting in the mods folder where you can easily remove it, you need to verify your files on steam to clear it?
You would need to replace the download. Whereas if you use git you just pull in the command line and it updates it
No need to manually replace files
Okay, that'll probably be fine, since I'd be worried about messing something up if I tried to update it that way, since I'm not sure what that means. Plus, it's not too much hassle to swap out files every so often, so I'll just do it with the direct download
Is the folder that I need to add just the entire unzipped steammodded-main, or is there a folder inside of that I'm supposed to take out?
Because the instructions say to use the folder Steamodded-1.x.x, but I don't see any folders with a similar name
the unzipped files should be directly under the balatro/mods/steamodded (or whatever it's called), no nested folders (though it might still work with them nested?)
should look something like this
okay, so it is the folder that holds all of those. I guess the instructions just assumed it would have a different name than the version I downloaded did, which is why I was confused
That's one of the differences when dowloading the zip as opposed to git. I do think you chose the easier option though, to be fair
Is there still supposed to be a mods tab next to collection like in the old version?
Because I just opened the game and it's not there
did you download lovely?
Ah, no, I didn't. I'll do that, and hopefully it should work then
Ah. Yeah make sure to read through all the instructions on the getting started with steamodded page.
Yeah, I had read through that before, but then got focused on the steammodded part and just forgot about the injector
You just put the injector here, right?
No
In balatro's install folder
Put it in the game’s files
should be here
Found it, thanks
It seems to be working now, but now when I open the game it also opens a second window with this. (I would show the full window, but the last line shows my steam id, which feels like something I shouldn't publicise)
Is it supposed to just stay open the entire time? I tried to close it and it closed balatro itself too
yes, it's directly connected with the balatro instance
I think you can hide it if you want, see here #1217867725532041369 message
but if you're planning on making mods yourself I'd suggest not doing that, balatro's built-in error screen is not as good as the console's, in my experience
Okay, thanks
built-in debug? 👀
Yeah in Steamodded’s debug folder
Now that the test mod I was trying to make works, how do I tell the game how to access an asset?
You create an Atlas object, then pass the key to the Joker
k, I saw other mods using atlases, but the ones I was looking at were using sprite sheets, so I thought it might just be for those. I'll try and recreate the ones I've seen and see if that will work
Oh, neat. Thanks! Is there any reason why that one isn't .pyw btw?
I think windows describes it pretty well
Python File (no console)
I just got the error "Failed to collect file data for Atlas bala_test". Any idea what I did wrong?
The image I made is saved as TestingJoker.png inside an assets folder that is in the mod folder
Missing mod prefix
You can add one to the header but the automatic one is the first four letters of your mod’s name
Your mod’s name begins with “Bala” I presume, hence it tries to find the atlas indexed by bala_test
oh, so the joker and atlas should both have the key bala_test instead of test?
Or only one of them?
No
oh, it automatically adds bala_ to the atlas key, so I need the joker key to be bala_test? Is that it?
Actually wait
Or is it because Bala would be used for what's already in the game, so it breaks something?
Put the error message here
Ah wait, what does your asset folder look like
You need two folders inside it, 1x and 2x
Put the image in 1x and make a double-sized copy to put in 2x
Is there a simple way to create the double-sized copy?
The art program you used to make the original artwork might
Unfortunately no real tool to do so, no
you'll have to do so manually
Got it to work, thanks!
Do you know if there's a mod that lets you access a console or something similar, because I'd like to be able to find it quickly so I can see if it works in game
There's debug mode (https://discord.com/channels/1116389027176787968/1209857245316255744 or https://discord.com/channels/1116389027176787968/1228149931257237664), which can spawn jokers in from the collection screen
i use paint.net and you can do it in 1x and then resize the image to 200% using nearest neighbor sampling
I wish I had checked back earlier, because I just finished a full plasma deck run where I found it in the small blind shop in ante 8, only to realize it doesn't actually work
Luckily I have 2 bulls and over $400, so I have plenty of time to test with it
hah, nice
I am very confused though, on how to make the jokers effects
No, how would I do that
if you go to where balatro is installed on steam
you can go to local files
you make a copy of the exe somewhere
then you can extract using winrar or 7zip
or similar
Would it work to just look through a bunch of other mods to see the way they do it, or is it going to be better to look through balatro itself?
i would say def look through balatro itself
but some other mods might help
but the source code has like very basics and stuff
may I suggest you https://discord.com/channels/1116389027176787968/1257660889520144446?
I think I'm going to try without it, just because it doesn't display anything, which could make it confusing to see whether it's working with more complex jokers, but if I'm still lost after looking through the game, then maybe I'll try it. Thanks for showing me though!
If I just extract directly from where steam opens to when I hit browse, will it break things, or is that fine?
You could. Any direct file edits will also go to a temporary file. Don't move any files in or out of the compressed exe though, or you'll need to reverify 🙃
i wouldnt do that
but yeah, you probably shouldnt
easier just to make a copy of the exe somewhere
you think having debug messages would be good?
I'm referring to how, in the video of you showing off the joker that does x10 chips on each played card, that is calculated at the same time that the plus chips from the actual card is, instead of being a seperate trigger after, which makes it harder to tell whether things trigger
oh now I updated it, that problem isn't a thing anymore
I've tried a few times now, but everything has been crashing. How should I format the config and the mult in calculate?
problem is in config
config = {extra = {mult = 100}},
and then card.ability.extra.mult to get it
I think I tried that and it didn't work, but I'll try again and see if it does
Yeah, it's still giving the same error
I've tried both mult_mod = card.ability.extra.mult and just card.ability.extra.mult on its own, and neither worked. Should there be something else in that line, or is it a different issue?
Here's the error I got
Do you have that as text instead of image? Kinda hard to copy-paste from an image
Give me a sec to crash it again so I can grab it from the console instead of the screen
I meant your code, not the error
your config is missing the extra here
INFO - [G] 2024-07-08 17:25:38 :: ERROR :: StackTrace :: Oops! The game crashed
[SMODS BalatroTesting1357 "BalatroTesting.lua"]:38: attempt to index field 'extra' (a nil value)
Stack Traceback
(1) Lua local 'handler' at file 'main.lua:1900'
Local variables:
msg = string: "[SMODS BalatroTesting1357 "BalatroTesting.lua"]:38: attempt to index field 'extra' (a nil value)"
(*temporary) = Lua function '?' (defined at line 6476 of chunk main.lua)
(*temporary) = string: "Oops! The game crashed
"
(2) Love2D metamethod at file 'boot.lua:352'
Local variables:
errhand = Lua function '?' (defined at line 1897 of chunk main.lua)
handler = Lua function '?' (defined at line 1897 of chunk main.lua)
(3) Lua method 'calculate' at file 'BalatroTesting.lua:38' (from mod with id BalatroTesting1357)
Local variables:
self = table: 0x22e87658 {alerted:true, _saved_d_u:true, original_key:test, loc_txt:table: 0x22e88190 (more...)}
card = table: 0x23548350 {under_overlay:false, sort_id:593, click_offset:table: 0x22f05200, STATIONARY:false (more...)}
context = table: 0x23149fe8 {poker_hands:table: 0x2371d910, scoring_name:High Card, scoring_hand:table: 0x236e4238 (more...)}
(*temporary) = table: 0x232369f8 {}
(*temporary) = nil
(*temporary) = string: "attempt to index field 'extra' (a nil value)"
(4) Lua method 'calculate_joker' at file 'card.lua:2379'
Local variables:
self = table: 0x23548350 {under_overlay:false, sort_id:593, click_offset:table: 0x22f05200, STATIONARY:false (more...)}
context = table: 0x23149fe8 {poker_hands:table: 0x2371d910, scoring_name:High Card, scoring_hand:table: 0x236e4238 (more...)}
obj = table: 0x22e87658 {alerted:true, _saved_d_u:true, original_key:test, loc_txt:table: 0x22e88190 (more...)}
I added that already, and it didn't fix anything
the code, not the error
Ah, my bad
key = 'test',
loc_txt = {
name = "Test Joker", --name used by the joker
text = {
"{C:mult}+100{} mult", --description text
"{C:attention}THIS IS A TEST{}" --more than 5 lines look odd
}
},
config = {extra = {mult = 100}},
rarity = 1,
pos = { x = 0, y = 0 },
atlas = 'test',
cost = 4,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
soul_pos = nil,
calculate = function(self, card, context)
if context.joker_main then
return {
card.ability.extra.mult,
card = self,
colour = G.C.MULT,
message = {"+100"},
}
end
end
}```
SMODS.Joker {
key = 'test',
loc_txt = {
name = "Test Joker", --name used by the joker
text = {
"{C:mult}+100{} mult", --description text
"{C:attention}THIS IS A TEST{}" --more than 5 lines look odd
}
},
config = {extra = {mult = 100}},
rarity = 1,
pos = { x = 0, y = 0 },
atlas = 'test',
cost = 4,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
soul_pos = nil,
calculate = function(self, card, context)
if context.joker_main then
return {
card.ability.extra.mult,
card = self,
colour = G.C.MULT,
message = {"+100"},
}
end
end
}
please format like this
it's easier
How do I make it format that way?
^ using
```lua
code
```
maybe it's because atlas key and joker key are the same?
oh wait
probably not one gets a "j_" appended the other doesn't
card.ability.extra.mult without anything before?
I've also had mult = card.ability.extra.mult, and that didn't work either
I think it's probably that line, but I'm not sure what to do to fix it
try mult_mod = card.ability.extra.mult
Also tried that
and delete the card = self
Just tried that, same crash
Once I play a hand
Is there any chance I don't need extra because the joker only uses one variable, because jokers like the default +4 don't have extra in the config
I got it to stop crashing again, but now it doesn't do anything
It now has config = {mult = 100}, and mult_mod = card.ability.mult,
My game didn't crash when I played the hand, but it didn't actually add mult, it just gave the +mult message
This is what it looked like
can you try changing the return to
return {
mult_mod = card.ability.extra.mult,
card = card,
colour = G.C.MULT,
message = {"+100"},
}
@mental wind
I did mult_mod = card.ability.mult, because otherwise my game will crash, but I tried the card = card and it didn't work
It works for me. This is my full code (I removed the atlas cuz I don't have the png, obviously)
SMODS.Joker {
key = 'test',
loc_txt = {
name = "Test Joker", --name used by the joker
text = {
"{C:mult}+100{} mult", --description text
"{C:attention}THIS IS A TEST{}" --more than 5 lines look odd
}
},
config = {extra = {mult = 100}},
rarity = 1,
pos = { x = 0, y = 0 },
cost = 4,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
soul_pos = nil,
calculate = function(self, card, context)
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
card = card,
colour = G.C.MULT,
message = {"+100"},
}
end
end
}
inside the Joker's calculate i got some functions that create a table in card.EzSc. The problem I'm encountering is that EzSc_calculate_joker is called on the next context that is calculated.
Like when you play a hand, the game does calculate_joker with these contexts:
- context.before
- context.repetition on first scored card
- context.individual on first scored card
- context.repetition on second scored card
- context.individual on second scored card
- etc.
The problem is that with this code, theEzSctable I got withcontext.individualon first scored card is being used on the next context, which iscontext.repetitionon second scored card
does this look joker enough?
this problem only happens when context.individual is involved
it's like self.EzSc doesn't get the current state of self, but the starting one
I just did the exact same thing and it crashes my game. It says it's because it tries to index extra, which for some reason is nil
Weird. You don't have any other code surrounding it?
confirmed, the problem I have is that v:calculate(self, context) creates the card.EzSc table, but it isn't detected later in if self.EzSc then
Have you started a new run for testing, or used the same run?
Same run, but whenever I reload it does work differently, so I don’t think that matters
I think it matters for things like changing scope, since you have mult in .extra now rather than just config, it's probably why it's nil, the run needs to be reset for it to exist, I'd say at least give it a shot, but, yeah, might do absolutely nothing.
i hate K
why are you redrawing the joker text?
Is this one the portion that runs the jokers calculate functions?
can't you use the basic one?
NICE
unfortuantly, to do pretty much any kind of fancier text editing stuff, I'll have to write my own text renderer
or find a lib I can steal
the music really improves it a lot
arg parsing
wait this actually goes so fucking hard for archipelago
Ok I am working on paring steamodded logs, and was thinking, would you rather I just kept the logs as is, but add colour (the first two examples), or to shrink them down a bit as well (the second two examples)?
latter looks cleaner
looks like you'd lose the logging level?
or will you do something like [Level, Logger]?
The colour is based off logging level
Thinking Blue for info, yellow for warn, red for error/fatal, and haven't decided yet for trace or debug (might keep them both info blue)
Ahhhh, I see
I'm personally not sure if it's a good idea to make the level that implicit
it also kind of depends on whether you want this to be a replacement for the logs or a more of a different view
I mean I'm not replacing the logs totally (especially since this view doesn't render always [like when the game is loading or crashes]) and mods can probably screw with it, but it's kind you don't need the logs 90% of the time you use it
Oh also if you haven't seen it has a fade effect thing for live log reading (so something like this could make it more glanceable)
I'd say not have the time and date show up, it's generally not useful info for live viewing.
I like the colors and removal of clutter (especially date lol), I'm just not sure about removing the logging level
seems like something someone could easily misunderstand when looking at it for the first time
could be like
[ExampleLogger] [W] Example
[ExampleLogger] [I] Example
[ExampleLogger] [D] Example
Yeah maybe some variation of that would be good
What's ExampleLogger
either that or
[ExampleLogger | W] Example
[ExampleLogger | I] Example
[ExampleLogger | D] Example
Well my log experience most came from, well, modded Minecraft
It has similar log screen
Just that it's not covered over the whole game
Yeah I prefer single character ones
Which of these do you all think looks best?
[ExampleLogger] [W] Example
[W] [ExampleLogger] Example
[ExampleLogger | W] Example
[W | ExampleLogger] Example
[ExampleLogger :: W] Example
[W :: ExampleLogger] Example
W should be at the end I think
Yeah I kinda took inspiration from the Minecraft chat box, although Minecraft does have an actual log it uses for development, which this is designed to more closely resemble
modded minecraft's logging is the messiest thing i've ever seen actually
< only plays modpacks
I think the character should come in front of everything, it would look tidier
Since ExampleLogger will very if I am understanding it correctly
Oh also thoughts on maybe hiding debug level logs by defsult, and an option to turn them on (so mod devs can use them without spamming the console)
Yeah example logger can have arbitrary length
I imagine this if sorted by freq is I≈D>W>F>E
single letter + colour would be nice
yeah color makes it easier to tell importance
ideally there should be near zero debug but in practice that'd be right
*in release build
Yeah maybe I leave it on
Then I>>D>W>E>F?
fatal and error are presumably the other way around btw
Though I think I keep debug logs off by default, and then devs can leave these logs for debugging and users can run a command to change the log level
as for colours i'd go
info: white
debug: blue
warning: yellow
error + fatal: red
but you probably wouldn't see fatal(?)
Yeah I figured fatal won't be seen so ill just match error
There's also trace but tbh idk when it's supposed to be used
trace is for a full stack trace so it'd probably be under debug
I was kinding thinking info would be blue but maybe it should just be white
info and debug can be swapped tbh
RN its the same blue as the fps display
boy have I got a SO post for you https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
I don't know what to think about info, they are mostly just bunch of numbers
yellow / red are really the only defined colours
Oh also any log that doesnt go through steamodded (or probably an api I'll eventually make) defaults to info
that's fair enough
For developers maybe all of them are important, but for most ppl they might think it's too much. For me I am amongst the latter
Oh by a bunch of numbers do you mean the LONG DT messages?
I use debug plus mainly for debug panel feature, and a toggle to default the unimportant logs to not appear would be greatly appreciated
yes I think so
Yeah I just disabled that in the dev branch
It's a built in thing but I don't think anyone uses it
It's just a sign of lag, which is noticeable
Yeah, it's probably useful if your debugging performance, but not much else
Once I build a proper log level system, then I can just demote it to a debug log
btw wilson I feel like you'd know, shouldn't inject_class run before inject on a custom Center class?
Uhh idk I just make dev tools, not actually make new content
...it does
right, that was my assumption too
The inject_class function is what handles inject so if you redefine it and have the super/GameObject inject_class go after that's automatically before inject
yeah I super
this is what I have
SMODS.Sleeve = SMODS.Center:extend {
class_prefix = "sleeve",
discovered = false,
unlocked = true,
set = "Sleeve",
atlas = "sleeve_atlas",
pos = {x = 0, y = 0}, -- within `atlas`
required_params = {"key", "atlas", "pos"},
inject_class = function(self)
G.P_CENTER_POOLS[self.set] = {}
G.P_SLEEVES = {}
SMODS.Sleeve.super.inject_class(self)
end
}
but it errors when I try to create a custom object using the class
like this
SMODS.Sleeve{
key = "none",
name = "No Sleeve",
config = {},
loc_txt = {
name = "No Sleeve",
text = {""}
},
atlas = "jokers",
pos = {x=0, y=9}
}
What error is it exactly?
do you want the full error?
yea
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@rough furnace going to ask this ahead of time, is it okay if we bundle the new logger into Balatro Archipelago (and modify it a tad) to allow communication between games
I'm not sure my inject_class is even getting called
yeah I dont think it's being called
If you put a debug message there is it printing anything?
no
(that's what I did and why I'm assuming it's not running 🙃)
do I need to initiate it somehow?
you mean something like this?
SMODS.Sleeve = SMODS.Center:extend {
class_prefix = "sleeve",
discovered = false,
unlocked = true,
set = "Sleeve",
atlas = "sleeve_atlas",
pos = {x = 0, y = 0}, -- within `atlas`
required_params = {"key", "atlas", "pos"},
inject_class = function(self)
G.P_CENTER_POOLS[self.set] = {}
G.P_SLEEVES = {}
sendDebugMessage("G.P_CENTER_POOLS[self.set] = " .. G.P_CENTER_POOLS[self.set], "CardSleeves")
SMODS.Sleeve.super.inject_class(self)
end,
inject = function(self)
SMODS.insert_pool(G.P_CENTER_POOLS[self.set], self)
G.P_SLEEVES[self.key] = self
end
}
cuz doing that doesn't seem to change the error
weirdly, I did try extending GameObject instead of Center, and that didnt have this issue
ohhhh
does that... explain something?
What if you specifically call SMODS.GameObject.inject_class instead of SMODS.Sleeve.super?
Lemme try and recreate it rq
just to confirm,
SMODS.Sleeve.super.inject_class(self) ->
SMODS.GameObject.inject_class(self)?
cuz that doesn't seem to fix it
Wait wtf is going on then
also, if inject_class isn't running in the first place I doubt changing any of the code in it would help...
Wait maybe it is the issue
Someone fucked up
This doesn't crash the game
I don't think this is supposed to be intended behaviour
As Steamodded API is set up so functions can be append function from classes by subclasses
I'm gonna be honest I don't know what you meant by that last sentence
Lemme double check with Steamodded API
uhm, I think I found it?
I think I had a zero-width space before the function name?
HOLY SHIT
ohmygod you can see it in my copypastes in the channel too
@edgy reef
Unfortunately I'm also not getting prints from inject_class
Although it is really funny that this is occurring
how do you even get a zwsp in there anyway
Huh. Me neither. Weird.
I might have accidentally copied it from a github page? I should probably get a better editor that warns me of this shit 🤣
also apparently U+200E is the "left-to-right mark" (aka an indicator of the direction of text when using e.g. both latin and arabic)
imagine I would've used an actual good editor, would've saved me an hour of my life
If you wanna talk about bad editors, I was using replit, but then I realized I can just edit the file directly through notepad without having to reexport every time, so I've been using notepad as my editor. I'm sure there's no way that could possibly be annoying or hinder me in the future
It's nice, because I just have the .lua file that's already in the mods folder open in notepad, and if I need to try something, all I have to do is close the game, make the edit, hit ctrl+s, then reopen and it's implemented
... that's exactly what I do. With a proper editor (since literally 20min ago)
Ah. Thing is, before that I was using replit, so I had to download all the files as a zip, extract the actual code, drop that into the mods folder replacing the old code, then reopen the game
And today is the first day I've started actually working on this, so maybe I will get an actual editor in the future, but at this point notepad hasn't been too annoying to deal with yet, so I may very well end up just sticking with it.
is replit like an online editor or something?
Yeah, it's what my class used for AP Computer Science A, so that's the only editor I'm familiar with. I know there's also IntelliJ, but I think that's java specific, and it requires a bunch of other setup that I have no idea how to do
VSC is also good. Has some built-in features for GitHub too which is neat (not sure if notepad++ does as well).
there's also all of the terminal based editors if you want to go down that path
I wouldn't
also, this probably shouldn't exist but here we are https://github.com/vinsworldcom/nppGitSCM
Editing in notepad is WILD
HELL NAH
Hmm, any solutions or insight for why inject_class isn't working? Right now I've got this horrendous jank, since inject does seem to work for me
local sleeve_class_is_injected = false
SMODS.Sleeve = SMODS.Center:extend {
...
inject_class = function(self)
if sleeve_class_is_injected == false then
sleeve_class_is_injected = true
G.P_CENTER_POOLS[self.set] = {}
G.P_SLEEVES = {}
local old_inject = SMODS.Sleeve.inject
SMODS.Sleeve.inject = function() end
SMODS.Sleeve.super.inject_class(self)
SMODS.Sleeve.inject = old_inject
end
end,
inject = function(self)
if sleeve_class_is_injected == false then self:inject_class() end
G.P_SLEEVES[self.key] = self
SMODS.insert_pool(G.P_CENTER_POOLS[self.set], self)
end
}
the juicebox is still a bit simple, but I like the straw
it's supposed to be simple and thanks
Can I not reliably use SMODS.current_mod in function SMODS.current_mod.process_loc_text()? Its contents seems to change to other installed mods'
You can save it as a variable for later use
It is
it is, maybe we should pass it self?
Are mods considered objects?
if it's done OOP well, everything is an object
yes, they are not GameObjects though
I see
That would be better, but it still is a change-up. I assume there's a reason SMODS.current_mod gets changed?
SMODS.current_mod is only valid during the load stage, i.e. while each mod file is being executed
google docs is built in version control, if you think really think about it
well, creating this was pain in the ass without any seal examples for 1.0.0 😭
Is there custom Seal calculation logic for 1.0?
hm no I just had a lot of issues with tooltips
well I dont know actually about calculation logic
I just couldn't find any relevant examples
had to debug a lot to figure out why it was broken
also had to change calculate a bit to be consistent with other game objects
I was creating something for cryptid tho, this seal is just an example I added in steamodded for whoever needs an example
i forgot how to make a loop
how to change my card area's position
iirc there's just extra parameters in the cardarea's contructor
btw that's a lot of slots
first 2 are x and y coords? I'm pretty sure
thanks
something from my mod that i remember works
this works but I wonder why X and Y of vanilla areas are 0
probably changed somewhere
I don't really want people redistributing the console because then it would be incompatible with DebugPlus, as there are two consoles, and things get messy.
Once i get proper command stuff working, I am going to make public api's for adding commands and having full control over logged messages.
If you do get to the point where you need to add commands, and I haven't added the api's yet, then you can distribute the console code, but make sure you follow the license.
sure can wait
and a command to send messages isn't unheard of either
good position 🤔
I don’t know but I do know that some positions are relative to the cards in them. For example, the View Deck UI is relative to the topmost card in the deck. Recently I had a bug where the play area shifted to the right despite me never directly changing it. I suspect it’s because of its contents being moved in an awkward state
Any mods that have implemented Blind behaviour beyond what’s found in the base game? Just curious what’s out there
I think Bunco interacted with the Shop
As did MystBlinds
Though I personally was thinking having the Blind do something when defeated, but Blind:defeat isn’t quite working
MystBlinds doesn't interact with anything apart from normal blind functions
Wasn’t there a Blind that made things cost more?
That was just increasing a base game variable
LoboCorp also had multi-phase Blinds IIRC
It’s not about complexity
It’s just about the idea
I have perhaps a few ideas that would benefit from knowing if a hand beat the Blind or not before it does
The main one destroys the winning hand
But it doesn’t seem to be tracking the cards correctly
The way I had tried to print it (recursively) led to a stack overflow error ^^’
and i didn't mention lobcorp for a reason c:
Why not?
I mean, I hadn’t mentioned it because I didn’t want to go on and on since I was asking
how do I change the display size to 34*34 like tags
Probably like Wee Joker et al. do it?
you need a couple lovely patches iirc
it gets overwritten back to the card size pretty often
here?
pretty sure, yea
i remember autumn talking about it a while back
while they were working on oddities
this too
ok thanks
I don’t think so
I’m pretty sure I had made it without any patches
yea you dont need patches, just some hooks
But I don’t have access to the code right now
I think I used Card:set_ability, and maybe something in the draw function
just some good ol' overwriting values after base game sets them
Maybe it was a patch in the draw function
But set_ability works because it’s called whenever the object is created
😀
lil' guy
Make a 71x95 sprite with it in the middle 🙃
Could someone explain the process Smeared Joker goes through? Found the is_suit() function in the source code, but, can't piece together how it works at all.
Wanting to make a joker that makes only hearts count as hearts and clubs.
Where’s balatrotalegaming when we need them
is_suit just compares a card's suit to the suit passed to the function
if you have smeared joker (next(find_joker('Smeared Joker)))
oops i hit enter
Ah, completely makes sense now, I was missing the fact it's self.base.suit compared to just suit. Though, still unsure how it gets spades/clubs.
yea im honestly kinda confused on how it works with spade and clubs too lmfao
this is the first time ive seen is_suit
if i had to guess, it probably handles spades and clubs somewhere else
I thought it handled Spades and Clubs by exclusion
Therefore any non-Hearts, non-Diamonds suit is also Spades and/or Clubs
But I don’t know
Yes that’s how it works
By design though it will handle all custom suits as equivalent
I've wanted to fix this for a while but haven't really gotten to it
it's not a huge thing but it should be done right and be extensible
Code for it is:
if next(find_joker('Smeared Joker')) and (self.base.suit == 'Hearts' or self.base.suit == 'Diamonds') == (suit == 'Hearts' or suit == 'Diamonds') then
return true
end
return self.base.suit == suit
Wouldn't it just move down to the return base.suit == suit, if it's not Hearts or Diamonds?
No
It equates things that aren’t those as false, and checks the suit its checking too
So both would be false
Therefore it enters the if block
Ah, I see, neat.
As with almost everything I’ve looked at in this game, it has virtually no support for extension
thats my goat 
do i need messages for consumables
There was a 0.9.8 API to fix it
In an extensible way
By balatrotalegaming
I forget the name of the API
BlackboardAPI, I think
Yes
i remember that
You could create a table of tables, where the internal tables contain suits that are to be considered the same, and iterate through it
But you could have different groups of suits with intersections
Anyways I think BlackboardAPI was feature complete
But when the world needed them the most, the creator vanished
You’d just add another table
anybody know how i can change the icon for the unlock notifications? what do i set _atlas in create_UIBox_notify_alert to so it looks for the SMODS atlas thingy?
Alright, back again - Made a lovely patch, it's being applied correctly in the dumped .lua.
Doesn't crash, which is both good and bad - No crashes means it's not a stupid grammar mistake, but, I have absolutely no idea how to test for things with a lovely.toml, so I have no idea what steps to take to figure this issue out.
If anyone wants to help, or point me in the right direction, here's the joker code, and the .toml.
SMODS.Joker{
key = 'carousel',
loc_txt = {
name = 'Carousel',
text = {
"Spades count as Hearts",
"Hearts count as Clubs",
"Clubs count as Diamonds",
"Diamonds count as Spades"
}
},
rarity = 3,
atlas = 'virtues',
pos = {x = 4, y = 1},
cost = 6
}
Stinky drink
a REAL invis joker
Just the emplace function being bad
oh
Does steamodded have any sort of live reloading or do I need to restart the game every time to see new changes?
you can hold M to reload mods
What’s not working?
Simply not applying - Doesn't get affected by the suit jokers, or register as a flush.
Best guess is that it's possibly not finding the joker through the same next(find_joker('') that smeared uses, but, I took a look at it, don't know why it'd be an issue, it uses self.ability.name to find the name.
Man I would have loved to learn that sooner 😭
This is from the dumped .lua. It appears a second time, under the else as well for when it's not flush_calc, but, didn't show it just because it'd be even more of basically same text.
Perhaps it’s not finding the joker correctly, I don’t remember off the top of my head how to set it up. You could throw a debug message in there to see if you’re getting inside the block or not
That was my thought as well, but, I don't know how to send a debug message through a lovely injection, unless the sendDebugMessage() from Steamodded will work?
Edit - It infact does.
I'm also unsure what the alternative way to find the joker would be, maybe I can try salvaging something from the find_joker() code.
you should generally use SMODS.find_card instead of find_joker, which takes a key instead of the name
but they should work exactly the same way if your joker has a name
I've been assuming that lovely injections can't use Steamodded API, is that completely wrong?
I don’t see why they couldn’t
I have no idea how Lua works, apparently one can use a reference to a function before defining it, unless I misunderstood something
lovely injections can't use steamodded if it isn't present, but there's no issue with using it as long as your mod depends on steamodded anyways
you can use a reference to a function f1 within another function f2 even if f1 isn't defined at that time because it bases things off the value the reference holds when f2 is called
Is there a way to use a package from luarocks in your mod?
Alternatively, if there’s a native way to parse a JSON response body from an HTTP call
New to LUA 🙂
you can have a package as a file included with your mod and use it by loading it with NFS, or you can use a module patch with lovely and require it using the module name you assigned to it (this is what is done in Steamodded for including NativeFS as well as lua-reload)
I now have Carousel working, thanks for all the help and explanations.
Will give this a shot. Thank you
why it isn't displayed
Why do I keep getting messages that lovely is a trojan? Windows keeps removing the version.dll file from my Balatro directory.
I've been downloading it from the official repository on Github
And it won't let me redownload it. It deletes it before I even get a chance to look at it
Weird. I get the warning when downloading it from the first image, but not from the Assets section in the second image
because it is functionally a trojan
You'd think it would be written somewhere on the repo that messages like that might occur and to ignore them
it wasnt getting flagged until recently
also writing that honestly makes it even more sus
Happened to me today
Tried to load up balatro and mods were gone. Windows removed the injector
finally managed to figure it out how to add custom hands
by god you have to rewrite a lot
and SMOD register adds the prefix, where most poker hands arent even prefixed and just string keys
can you send a picture of your code or smth??
ive been tryna figure it out but im so helpless
hello modding-dev, looks like people are having trouble with poker hands? First get Bunco. I'm open to DM
what are peoples' opinion on prefixes in general / prefixes on Poker Hands?
best i can do is send the whole code:
basically i overwrite a function in Game which is used to determine the information of the poker hand, and also have a rewrite which is used to add your own poker hand evals. I plan to see if i can edit the SMODS.PokerHand to include an eval function, and code it from that
thank you
Is there a way to access the current context outside of a function that provides the context as a parameter? I guess context isn't a global value?
you could override the function and set a local to be equal to context?
local last_context = nil
local cal_joker = Card.calculate_joker
function Card:calculate_joker(context)
last_context = context
return cal_joker(self, context)
end
Hmm, I didn't think of that. I'll try it, thanks
Although, I don't think calculate_joker will be called at the time my function is called, so the context will be incorrect, whatever it is
when do you plan on getting the context?
While in a round. I'm not even sure if it's context that I'm looking for. I'm just trying to check if the user has pressed the Play Hand button and is now in the scoring phase
I guess I need to find where calculate_joker's context parameter is passed in, and see where that is stored
Oh I see, the calculate_joker function creates the contexts at the function call
Thoughts chat?