#💻・modding-dev
1 messages · Page 369 of 1
how, uhm, how does one do talisman compat stuff? lol
I'm trying to make a bull-esuque joker and it's crashing from the whole "money is a table now" thing 💀
First thing you've gotta do is add this function to your code
to_big = to_big or function(num)
return num
end
ok, that part is now done!
Really quick can I see the code?
code of the joker I assume?
kaboom
Ok now I'm confused because usually crashes like yours happen due to a comparison, but I assume it's happening with math.max???
now i need to do this for… every other tribe
idk, lol, hehe, here's the crash if that helps any
and THEN, i need to make sure that every joker that’s a part of a specific tribe gets a badge saying what tribe it’s a part of
i mean, math.max does use comparison, even if its not specifically what caused the error it would still cause an error when its run
Does anyone know how to make the auto completions work for VS code?
also…
Ooooooh I know what the probem is now. Since you're multiplying a number with a bignum, you're returning a bignum and the game can't calculate your chip gain from that
I use the Lua extension by sumneko
try wrapping your chip calculation in a to_number() wrapper
I'm curious, where is wee joker here? I could see it being charming, heartful, or slippery (I know nothing about yokai watch, lol, going purely off vibes here)
Hi, so I'm trying to make a joker that has the possibility of changing playing cards enhancements, ranks and editions, currently the editions part is fine, but I have no idea of how to do the others hahaha, this is my crash report and my current code
which part of it?
has someone made a list of every variable that has to be wrapped for talisman?
In your return table, everything after chips =
Pfft I wish
dang
okey, I'll try it like this, then 👍
to_number
okey!
slippery tribe members are usually serpentine like, so that’s a no-go.
wee joker is charming because regular joker is charming
decided to change snartle just a teeny weeny bit
so i changed the ability.Xmult value for glass cards, and it properly reflects that change in the description, but it still gives 2x mult even when not set to 2x
it works now, thank you! :>
Huh, that's a weird one
Jimbonyan
yea i looked through every occurrence of m_glass and Xmult and i have no idea why its happened
What's the timing of you changing the Xmult?
on creation
so the various tribe themed buffoon packs will have, well, jokers from those specific tribes.
try self.ability.x_mult = 1.5
kinda like cryptid’s meme packs
huhh.. Xmult is used for the description, and x_mult is used for scoring
Yep lmfao
weird
blame Thunk 
Is it possible to have the extra.mult value also affect a pseudorandom outcome?
how could i make this joker's status message pop up right when the card is added, rather than when the hand is scored?
Sure. You can run the check with any basic math comparison
Gnarly
(as in, have "Copied!" show up when the card is added to the played hand, not when the hand is scored and other jokers add mult)
Wicked, even
Move your card_eval_status_text to the end of the conditional and wrap everything else that handles the card creation in an Event Manager
sick, okay
I will say your code would very much benefit from some SMODS util functions
hey all, im having trouble translating my joker ability to code. the ability is when the sum of cards played equal 14, lose 10 dollars, but gain 14 chips, and i would like to keep the chips on the joker, similar to wee joker. also here's an image of what i have so far.
like what? something like SMODS.add_card? i had figured that wouldn't work on playing cards
That and SMODS.calculate_effect as a replacement for card_eval_status_text
what would be passed to SMODS.add_card()?
i figured that was just for creating a card from scratch and also adding it to an area
So I'm trying to make a planet that upgrades two hand types, it exists, but when I try to discover it the game crashes
so copying wouldn't work there
event manager wrapping gives the desired effect but results in ghost carding after the hand is put back into the deck
yeah fair lol
i could hook the smods function that handles glass cards breaking, buuuut just setting the chance to 1 in 9x10^37 is a lot funnier
forgot this part
I would emplace the new card somewhere that isn't G.play because clearly things can get fucky when you do that mid-hand lol
it's already emplaced into G.play weirdly enough
so that must not be the issue
oh i misread
my bad
I was boutta say 😭
lol
now i gotta think of where to put it
maybe put it into the hand then immediately discard it
G.discard is also not a bad option if you're gonna discard it anyways
true, but it might be nice to show the player that specifically the leftmost was indeed copied
emplacing into G.discard just doesn't show the card at all (given that it's offscreen ofc)
Could maybe add a delay in your code that emplaces it in G.play at first and then emplaces it into G.discard
yeah, that's what i'm thinking
@compact girder replying to your question in #⚙・modding-general , I highly recommend reading the documentation for Jokers on the steamodded wiki on their GitHub. It has a list of attributes (including rarity, which is a number for base game rarities)
this should be only chaning the spades to gold enhancement and does everything in hand instead I have a feeling its the full hand i use in the for loop is there something better to use to have it turn cards that are only spades?
Don't use a loop here. just apply the changes to context.other_card
The context loops through each card already. No need to write your own loop
Or if you want every card to change at the same time, do it in context.before
ah that makes sense thanks guys
it does a card snake that I intentionally build shown in pic so it is meant to do individually
Nice
Ooh I didn't know that was a thing! I was able to figure it out by looking through past messages in the server but where can I find it for future mods?
sidebar has the table of contents
SMODS.Joker for Jokers, but there's documentation for most other things you'd want to make
I'm trying to learn modding, and the first thing I'm trying is just renaming some of the stuff from the base game. I have this in the file localization/en-us.lua. Could somebody tell me why it isn't working?
return {
descriptions = {
Joker = {
j_balatro_joker = {
name = "Jimbo",
}
}
}
}
For vanilla objects you don’t need a mod prefix
so it would just be j_joker?
Yep!
yep
thanks
hey i know you!
lol :3
havent done this in a bit but here's all the heartful tribe jokers
so far assigning all of the jokers to a specific tribe is, well, easy.
the hard part will be, well, making a badge appear for each joker in the tribe.
might have to hijack the ui code for that
still playing around with it, im thinking i need to make a calculate sum of hand played but unsure how to go about it since steam modded wiki seems to only show per card or im potentially misunderstanding.
woah thats cool
you probably want to use the before context and sum all the cards' nominals (I think) using a for loop
do you have the base game's code?
also just a design suggestion, making the player pay $10 to upgrade their joker is kinda brutal, especially for only +14 chips. I'd recommend removing that and just making the requirement be cards sum to 14
ah gotcha
its silly basically context is, one of my friends talks a lot about ff14 and thats her game, which resulted in another friend saying every time you mention the game were gonna tax you 10 dollars (jokingly ofc)
nice
also this is my first time trying to code anything so thoroughly confused
still need to do shady, eerie, and slippery
So, for the fuck of it, I asked ai (gpt o3) what it knew about balatro modding again. Most of it is hialousoly wrong, and tbh this isn't any exception, but it's weirdly spot-on with the formatting of a joker definition. Just things are named wrong
local M = {}
M.joker = {
slug = 'lucky_rabbit',
rarity = 2,
cost = 7,
blueprint_compat = true,
loc = {
name = 'Lucky Rabbit',
text = {'+3× if hand contains', 'exactly one ♠ Ace'}
},
sprite = 'lucky_rabbit.png',
}
function M.joker.effect(self, ctx)
if ctx.stage == 'before_score'
and ctx.hand.count == 5
and ctx.hand:contains_exact('A', 'S', 1) then
return {mult = +3, message = '+3× Lucky Rabbit'}
end
end
register_joker(M.joker)```
wicked will be cryptid-compat exclusive
and yes, they totally made up lucky rabbit, lol
weird coincidence
and yes, slug isn't of key /was/ a thing in the early days. idk why though
yes, there will be compats for different mods.
specifically with more vanilla-like mods such as ortalab and bunco
all of the luas for those will be stored in a “mod-compat” folder
also idk how this format would work for more than one jokers? it seems like an object's subtable
i had trouble looking for the before context and nominals on the steam modded wiki will this be something i need to find in the lua handbook?
how would i check if a played hand has a specific amount of scoring 9's?
this is all Balatro stuff
loop through context.scoring_hand?
iterate through it and count em
oh my job its triangle
i thought there would be a way that didnt involve looping tbh but i dont have a problem with it
if anyone was looking forward to polterworx compatablity, you’d be sorely mistaken.
they're trying to figure out if the cards all sum to a number, which all has to be done at once
alr so, this might be a bit complicated
the first gap,, the (_____), is essentially supposed to detect that a card with a certain sticker is in the hand. i assume this ends with "in area==G.hand" or something similar, idk what the acual code here ahould be
the second thing, the [variable], is supposed to have something that says how many of the sticker are in the hand so that gets used. i also dont know what would be put here
balatro-kai will NEVER be compatable with polterworx.
there’s too many hoops i would have to jump through to make it compatable with it
and even then i’m iffy on cryptid compatability
think of cryptid compatability as a “maybe”, and not a “definitely”
Nominals are probably documented in SMODS.Rank while the contexts can be found in Calculate Functions
and of course, balatro-kai watch won’t be compatable with EVERY mod.
well, specifically the tribe system.
is there a yo-kai that makes you work on balatro mods for extended periods of time
i mean, there’s wydeawake and allnyta that keep you up at night but that’s not specifically balatro related
tryna figure out delay stuff but this seems to run the start and end prints at the same time?
got the alt versions working for when the joker is negative
WHAT
delay just adds an event to the event queue. the code around it all runs at once. the correct way to use delay:
no comely material morning, sad.
G.E_MANAGER:add_event(Event { func = function() print("start") return true end })
delay(5)
G.E_MANAGER:add_event(Event { func = function() print("end") return true end })
is that meant to be add_event
yes
okay this is what i have now, im trying to figure which equation i need for the context.
i would like to make a small suggestion
i think using the actual horse win sound effect from hrt would make this joker just a smidgeon better
also thanks for the help so far i forgot to say thank you to you all
you can hear it in this upload
https://youtu.be/S14WPb3w10U?si=VPQYrAPEiKlge1eM
Artist: lexycat (https://soundcloud.com/1lexycat)
Released: 2025
Genre: Soundtrack
upload for archival purposes.
i own nothing in this video.
thats.... what i did?
comely's theme is too quiet in the mod though i'll fix that
no like, the horse neigh sfx
oh
the niegh sfx is a random one i found on youtube that i though seemed similar
i used this https://www.youtube.com/watch?v=VCML7FBPkGA video to get each of the horses' themes
you may use this for your whatevers
all jingles except for legacy made by lexycat
stem extracted means ai was used to separate music from other noise
#hrt #hrtthrt #horseracetests
made this because someone from the discord server asked for a video like this
i however do not remember who was the person in question
00:00 Legacy
00:06 Resolute Min...
decided to extract it myself
no need to credit me because its not even my sound effect, lol
i just gave it to you so you wouldn’t have to extract it yourself
anyways i probably should get back to working on my mod
gl with that
you can probably only get the nightmare horses from the negative version of the card
mysterious figure, garbage bin, nighttime knifemare
wait, do multiple copies of the joker make their victory themes overlap
no they take turns
ah
it does make you wait 5 seconds for each of them to play their own theme but thats on you for racking up so many hrt jokers
i dont know if cryptid is compatible with my mod yet
chameleon joker:
i love it
this is giving me flashbacks to the fnaf sb chaos mod
yea!
i <3 SMODS.restart_game()
our table!
for shits and giggles considering the context of the original sound effect, this should also destroy all glass cards in the deck when used
some themes are longer than 5 seconds but 5 seconds is enough
thats amazing
no mysterious figure or knifemare…
whats causing the ticking in these
im also using their tournament sprite
BLAME YAHIAMICE I DONT KNOW
it's ticking me off
it's the yahimod doing something
is there a way to "boost" editions and enhancements values by a certain value without taking ownership of them (i want this to be mod compatible)
idk what its doing
it's in the video
oh, there they are
evil intimidating green horse
scary ao oni horse
now i need 16 different separate effects for each horse
....that's a lot for an rng joker
oh yeah to fix the ticking
did the yahimod recently update
go to items/jokers.lua, search for Game:update, then comment out the first play_sound
it'll be in the next update
i was looking for that
but i wouldn't expect it to be in the fucking jokers lua file
i bet on losing horses…
but in balatro, every horse is a winner
i like how the music comically lowers in pitch and stops to make room for the horse theme
there was this idea of making the horses winning weighted
idk how to actually do that but
lmao
i made a small patch that hooks up the music pitch/speed to a variable i can instantly change whenever and the music will automatically lerp (due to the game's built in code) to that speed
the game music was getting in the way of the horse themes and i didn't just want to make the themes louder
this is fucking crazy
what do they all do
nothing right now
but im about to come up with all 16 individual effects
each horse does something special so im gonna have to get around that
also have to take into account that horses change after every blind
each horse is a table so i can just give each table its own function that the joker will use
okay i think im figuring out just messing with, when i tried to open the game i got this message and unsure what it means
love it
Can you tell me how to increase the probability of a certain rarity appearing when I have j1 in my hand?
lines 9-13
,
Missing comma on line 11
I would suggest installing the Lua extension so that vscode will automatically highlight syntax errors like that
wait there's an extension for that?
oh woah thats cool
Yes.
You wouldn't happen to know how to do that, would you?
Increase the probability of a rarity appearing when j1 is in hand?
I've not dealt with rarities, sorry
wait what is it called
where can i find the lua extension
Lua
On the left sidebar there's an icon with 4 squares that says extensions when you hover over it. Click that and then search for lua
okie dokie its downloading
assuming it will automatically flag for errors with extension
may have to reload the code first?
Second day I can't customize the joker and no one knows, buzz😀
how do you do probabilities and randomness like for gros michel or glass cards
if pseudorandom('seed') < G.GAME.probabilities.normal / odds
lua extension working now thanks everybody
well now my whole thing is lined with yellow underlines lmao
Yes, thats normal.
thats how it be
thanks, i really can't find the right documentation for this (steammodded's documentation is rather limited)
you gave ipairs a string instead of a table?
im not for sure what that is im sorry
ipairs is used in for loops
How did this crash occur?
How can rarity be influenced through the joker?
i just opened my game
you probably fed a function a string instead of a table
ipairs takes a table and returns the keys and values separately
i figured i could get by without having to use a nominal, since i had trouble still finding it on steammodded wiki, so i thought i could do it this way
calculate?
whats calculate doing there
Atlas?
atlas is correct right
i thought i needed calculate since the wiki said i needed it
No, it's atlas
oh nvm
for atlas you do need your mod prefix before the atlas key
is that the header
Change Atlas to atlas in your joker and remove calculate in loc_txt
took out calculate and it still did it
oh i see
does the last atlas in green need to be upper case or lower case
Lowercase.
alrighty
Aaaaaaaaaaaa
How can rarity be influenced through the joker?
Code?
Change atlas to Atlas on the top one.
Why is there a random ; in there?
Remove the spaces in the atlas key.
your text in loc_vars should be a list
example:
like this
No.
Put { and } around it.
put { after text = and put } after the second string in your description
No.
text = {
'if scoring_hand = 14',
'gain {C:chips}+14{}',
}
text not test
this?
Remove that first comma.
The one after the {
oh okay
am i going about the wrong way to learn it, i just started messing with using videos and such
and steammodded wiki
thanks everyone game finally launched
guys how can i get the total amount of chips scored in context.final_scoring_step
Just hand_chips
ok cool
Is there any way to affect default_weight via joker?
I highly recommend taking a look at other mods’ code as reference. Scrolling through chat I saw a ton of things where they really shouldn’t be
alrighty sounds good
would cryptid be a good one to look at since there is a lot of jokers in that one
In some cases yeah. The more complicated features I would not, as since you’re a lot less experienced with Lua you’d most likely just get lost in some of those massive blocks of code
There’s also some example mods provided by Steamodded that are heavily commented to convey what’s going on. Lemme see if I can find those rq
ooh they sound nice
There they are https://github.com/Steamodded/examples
Cryptid is one of the worst to reference imo
thanks!
It uses its own conventions that over complicate things and it’s written by multiple different people who have varying levels of knowledge
Of course
This is very much why I said “in some cases” lmao
It also has a lot of “if it works, it works” coding style
I’d recommend looking at N’s vanilla remade (I don’t have a link handy) which implement vanilla effects in the smods style, or something like ortalab
how do you test for multiple conditions (like if and elseif) in a calculate function?
if condition1 and condition2 then?
Having contributed to VanillaRemade myself, I would also recommend it. We’re trying hard to give people a good look into vanilla functionality without the speghetti
not really, i meant as like you test a condition and you test another one aside but for another calculation
as in "if this is true then do that" "or if this is true then do this"
am i stupid this isnt scoring anything
if condition1 then
-- code
end
if condition2 then
-- code
end
```?
Here we are https://github.com/nh6574/VanillaRemade
hype
Resources aplenty 
that kinda works, thanks
G.playing_cards doesnt consider the new suits and therefore cards i've added... how do i go about adding the new cards to G.playing_cards? nvm it does i just screwed up another part
there's only 5 slippery tribe vanilla jokers so...
Perhaps someone could help me with text inputs?
They seem to uh... not like to work at all.
how would you gain money like the golden joker does but without using calc_dollar_bonus?
ease_dollars(number)?
You mean context.end_of_round and context.main_eval + ^^?
can i access a joker's config values outside the joker from another function?
joker.ability.configvalues
tysm
anyone?
guess I'll go ask the cryptid guy
How does one prevent this but coming from a fake card?
if next(SMODS.find_card('j_mxfj_dungeon_jester')) then
multiplier = SMODS.find_card('j_mxfj_dungeon_jester').ability.extra * 100
``` like so?
No.
SMODS.find_card returns a table.
shady and eerie
ah, what do i do then
You iterate over it?
so, now that i have every joker assigned to a tribe
time to impliment the badge
like this
any clue why this happens?
How do you bring that menu? Or you are making that menu
I am making it.
That's pretty cool
i really don’t know how to implement this though.
DebugPlusPlus, or balatro mod menu, or megahack v1
Kind of need that to be a text input
okay tried using the runner 2 code from steam modded examples to set up storing and gaining extra chips but then told me it had an error on line 38, when before that line was fine
you need to return a table of key-value pairs
DebugPlusPlus sounds funneh
Maybe go with that
The other two names are just for shit and jiggles
i know it has something to do with ui
how would i do that though?
i’ve never really done something of this caliber before (a whole entire new gimmick)
all i’ve really done is create seperate object types for each of the tribes.
the whole “having a badge that shows off the tribe the joker is in” thing is a bit far-off for me but i want to make it happen god damn it
where do i download the EnhancedEnhancements resource pack
so. i need some launching off point for this. how would i make it so jokers part of a specific object type display a badge corresponding to their object type
i dont think this is how i use hand_chips how do i get that
also is there anywhere i can see all of the variables i can access from here
like theres hand_chips and such (i think?) but where can i see them
it has to do with, something ui related for sure
idk, i’m tired.
hi, is card:get_edition called everytime a hand is played?
im trying to modify effects of editions and hooked into that function as it is used in eval_card()
but it seems to not work upon a hand being played
It's not called ever.
-- Modifies Edition Values
local base_get_edition = Card.get_edition
function Card.get_edition(self)
local ret = base_get_edition(self)
if not ret then return end
if next(SMODS.find_card('j_mxfj_dungeon_jester')) then
multiplier = 1.5
print(multiplier)
else
multiplier = 1
end
-- Mult
if ret.x_mult then ret.x_mult = ret.x_mult * multiplier end
if ret.h_mult then ret.h_mult = ret.h_mult * multiplier end
if ret.mult then ret.mult = ret.mult * multiplier end
-- Message overrides
if ret.x_mult_mod then
ret.x_mult = ret.x_mult_mod * multiplier
ret.Xmult_mod = 0
ret.message = nil
end
if ret.mult_mod then
ret.mult = ret.mult_mod * multiplier
ret.mult_mod = 0
ret.message = nil
end
-- Chips
if ret.chips then ret.chips = ret.chips * multiplier end
-- Message overrides
if ret.chip_mod then
ret.chips = ret.chip_mod * multiplier
ret.chip_mod = 0
ret.message = nil
end
print(ret)
return ret
end
oh
You are looking in the source code, not the lovely dump.
That's replaced with local edition = card:calculate_edition(context)
i see
I kind of fixed this but now it doesn't move when you drag it.
question: where does the game store in what ante you are in?
G.GAME.round_resets.ante?
i'm still getting the rancid ipairs problem even though i am returning a key-value pair
if I'm trying to make a copy effect joker, how could I check if the (vanilla/modded) joker it's trying to copy is blueprint compatible?
card.config.center.blueprint_compat
brainstorm does G.jokers.cards[1].config.center.blueprint_compat
in vanilla balatro?
I'm searching through balatro's base code and can't find that, is it in the card.lua or somewhere else?
yeah
Trying to figure out how to find the value for the played cards chip value, incl. hiker/bonus/foil, and then add it to it's own counter
tried
calculate = function(self, card, context)
if context.destroy_card and not context.blueprint then
if #context.full_hand == 1 and context.destroy_card == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
card.ability.extra.chips = card.ability.extra.chips + card.base.nominal
return{
remove = true,
message = 'Sacrificed!',
}
end
end
end
but unfortunately, the card is destroyed but no chips are added.
Tried
calculate = function(self, card, context)
if context.destroy_card and not context.blueprint then
if #context.full_hand == 1 and context.destroy_card == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
card.abilitry.extra.chips = card.ability.extra.chips + context.other_card:get_id()
return{
remove = true,
message = 'Sacrificed!',
}
end
end
end
but when a card is played, I get the following error
the card id won't do what i want exactly, but at least adds the value to the card
It's context.destroy_card and you should use context.destroy_card:get_chip_bonus()
yeah, this worked. thanks :)
replaced if context.destroy_card and not context.blueprint then with if context.destroy_card:get_chip_bonus() and not context.blueprint then, game loads but if i start a round with the card equipped i get the error attempt to index field 'destroy_card' [a nil value]
Tried
calculate = function(self, card, context)
if context.destroy_card and not context.blueprint then
if #context.full_hand == 1 and context.destroy_card:get_chip_bonus() == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
return{
chips = card.ability.extra.chips,
remove = true,
message = 'Sacrificed!',
}
end
end
end
and the game loads, but the effect no longer resolves
No, I meant you should use context.destroy_card:get_chip_bonus() for getting the chips.
oh... i see. Working now, tyvm
(quick bump cause that's still not working)
What is that line in misc_functions.lua in the lovely dump?
What does your loc_txt look like?
The text field needs to be a table.
did someone react to my message from like 2-3 weeks ago?? 😭
im actually flabbergasted
the message in question
i am so confused right now
what do you mean line 652 is on top of everything??
That happens sometimes.
Is there a context for ante changing (Going up/down)
No.
Ty
how am i even indexing game here?
It's G.GAME.probabilities.normal?
this always gives the money and i cannot for the life of me figure out why
it's meant to only proc when you play at least three 7s
well that explans it, thank you
Help, how to affect default_weight via joker?
im confused
why does the input box not show any text, and the Inventory text doesnt appear when the ui is first opened?
like, its only when the ui is first opened too
am i doing something wrong??
creating a text input in balatro
or maybe it's bad because he barely uses it
true...
do i just not add any searching function and let players scroll through like 50 pages of items then
❤️
you need to figure it out so i can later steal it for my graveyard sorting
wha
i want to add a search to the gy in my mod too
what does this mean? here's the code for reference:
return {SMODS.blueprint_effect(card,right_joker,context), SMODS.blueprint_effect(card,left_joker,context)}
That is not how you copy multiple jokers at the same time.
you're trying to return no repetitions in a repetition context
well how do i do it then? ive tried calculating effect, ive tried a million home made solutions
im stumped :[
no, blueprint_effect returns nil and calculate_effect expects a value
it doesnt return anything
...did I not link you my multi-copying thing earlier?
local ret = SMODS.blueprint_effect(...)
if ret then SMODS.calculate_effect(...) end
You would probably to do something like ```lua
local effects_table = {}
effects_table[1] = blueprinteffect
effects_table[2] = blueprinteffect
return functionthatdoesrecursiveextras(effects_table)
okay let me try this
This would let you copy everything that gets returned.
im gonna look at what ali did too, i forgot about it because as I mentioned, it was late, and i was more focued on going to sleep
Instead of just what SMODS.calculate_effect supports.
is there something calculate_effect doesn't support
Retriggers.
makes sense
okay, now ive got this
is this correct, or does the return line go in the if statement
🤔 actually, does create_text_input even use callback??
that's correct
HOLLY FUCKING SHIT IT WORKS
FINALLY
okay, now how do i change the color to green
🤔
ret.colour = G.C.GREEN
thanks
fuck you even doing
^ whats going on rn
text input in general is fucking wack
like, why the hell does it even make DynaText not appear??? 😭
hwo does it even affect this
i might need to create my own text_input function at this point
bad fix but i have the text input box auto-selected when the ui is opened, so i guess thats problem solved?
-# tbf its a shit fix but at least i dont have to try and fix the whole function
actually, never mind
all it needed was a :recalculate when the ui loads
minecraft in balatro? 😭
how do you set money to zero?
You can see how Wraith and The Ox does it.
ease_dollars(-[your total interest]), where I forgot the variable name for [your total interest].
You get the idea.
i have no idea what is happening but this is very cool
thank you
So, I have a voucher with the unlock condition labelled "Have your full deck consist of only one suit", but in reality it just counts how many card of your full deck is with each suit and unlocks the voucher if any suit counter equals the size of your full deck.
How do I rephrase it better?
enhanced anvil reminds me of that golden anvil you would find in holocure
🤔 so if i get your message right, having 5 heart cards and 5 club cards should still unlock that?
or wait
hm
"Collab" feature is on my to-do list, that's for sure.
if the suit number needs to be equal to the size of your full deck, then doesnt that mean the full deck only has one suit?
unless you somehow got 53/52 cards, idk
Bouquet sounds familiar 👀
is that benson's suit from regular show
No, what I means is, for example, if your full deck consists of only Heart cards except one wild Club, it still counts as meeting the unlock condition.
Have your full deck consist of only one suit. (Wild cards are excluded)? id probably try to specify that wild cards will still allow that to be unlocked, somehow
"Have all cards in your full deck be able to be considered one single suit." is a candidate.
Have all cards in full deck count as only one suit.?
"Have all cards in your full deck be with one same suit." is shorter, but doesn't feel enough.
The "all hearts except one wild club" example would still count as all (four for most of the time) suits.
Have all cards in full deck able to be counted as only one suit.??
oh actually i realized that does sound similar to the one you sent above
"Have at least one suit being with all cards in your full deck"
Except we usually say "card with suit" and almost never "suit with card".
that phrase doesn't make sense to me
"Have all cards in your full deck count as the same suit" is good enough I think
"Have only one suit of cards in your full deck" is good enough and easily understandable imo, even if it's ambiguous about wild
local base_calculate_enhancement = Card.calculate_enhancement
function Card.calculate_enhancement(self, context)
local ret = base_calculate_enhancement(self, context)
if not ret then return end
print(ret)
why doesnt this print anything when i play a Bonus card?
By the way, the reason I give Bouquet X1.1 is because 1.1^5 (5 from the size of a Flush hand) is already bigger than Observatory's X1.5.
or any enhancement for that matter
what are you trying to do
im trying to multiply the effect of enhancements
but i need to see what the return object is of "calculate_enhancement"
but when i do print(ret) in that code, i get nothing in the console
have you tried
local base_calculate_enhancement = Card.calculate_enhancement
function Card.calculate_enhancement(self, context)
local ret = base_calculate_enhancement(self, context)
print(ret)
return ret
? i dont really think the nil check there is necessary
and thats assuming the enhancements do use that function for their calculate
:p
i found it in lovely dump folder
and its used in eval card
function
So this is what I end up decided with.
Honestly just saying "Have all cards belong to one suit in your full deck"
should do it
mmm try my approach then, see if anything prints
a whole bunch of nils
oh wait
literally my entire screen filled with "nil"
i think i might see why
yeah?
i mean, the og function doesnt use self
yeah but im using "." not ":"
🤔
so i need to use self right?
not sure if thats the issue, try replacing . with :
okay
Do they also have these?
what would be the most efficient context for checking how many of X cards are in the deck?
what are you trying to do x2
I usually just count them on the spot.
So whenever you wanna scale the Xmult, then.
A risky option is to do it in update=function(self,card,dt).
🤔 is it like
"Increase XMult by (x) for each spade face cards in deck (Currently X(y) Mult)"?
yeah excactly that
never put anything in update unless you're doing like an effect joker
thought abt that but thats just so ineffecient and my game would lag sm
well, performance-wise speaking, use context.playing_card_added and context.remove_playing_card, as well as setting the XMult to a number when its first added
that should make it so XMult is only recalculated when a playing card is added/removed, but if you want it to be more precise, add the count in calculate without any context wraps
my issue with that is what if someone uses a tarot to change suit mid blind?
this shouldnt lag as much as update, as it will only run when a context happens
and it will be pretty accurate too
Maybe just... not using context?
store the number of spades in your card.ability.extra and compare it whenever calculate is called?
the update logic here doesn't make sense
just calculate it in joker_main and loc_vars
but also, i think another approach is:
in loc_vars, run the count in there
and have a count function in context.joker_main
same braincell
yeah that does make more sense lmao tysm guys!!
No, I have experience that this will have bugs.
(The loc_vars part)
🤔 how so
huh?
the only "bug" is that the tooltip won't update in real time but it's a non-issue
if you mean that the loc_vars can crash if theres no G.playing_cards to check, just add a nil check there, or G.playing_cards or {} in the ipairs
is there a function that plays after cards are scored in boss blinds
Wait a sec, I'll post the chat history.
i guess i coul d. make an event
use a boss blind calculate function lmao
Here. A joker of mine was unable to scale before you look at it.
yeah you don't do side effects in loc_vars
if you need to pick a rank you do it in calculate
Yeah, I fixed it after that.
what do you mean
wh ...
undocumented, i think :3
Or you can also use context.after and G.GAME.facing_blind and G.GAME.blind:get_type()=='Boss Blind'
G.GAME.blind.boss is shorter
bump please I really need help with this
get_type also doesn't account for modded non boss blinds btw
oh, that might be what i just encountered earlier
so the alternate small and big blinds from ortalab for example would return true to that
oh my god
how fix?
can send code so I can steal copy it?
:3 sure, one sec
colon three!
In the meantime: I made this, if anyone finds it useful: https://discord.com/channels/1116389027176787968/1372508275794513962
-# (...don't cheat with it... or use it only for shits and giggles...)
use the new text_input function instead of create_text_input, btw
yummers
exactly, what function should I call to make the thing happen?
And more importantly, how does sh*t work?
basically, the text input only loads properly after :recalculate, so all i did was adding func = ... to ensure that it loads the moment the ui is created
a
so instead of using create_text_input, use the new function
it functions exactly the same as how you would use create_text_input, with the only difference being it loads :p
The difference: It doesn't fuck itself up
so true
It actually works lmao
That's the difference
Me when the text input actually works:
its a coincidence that i worked on text input today too lol
Is this effect possible?: ```
All poker hands can be made with 2 cards
thanks a lot, my guy
Certainly not unless you elaborate how you planned it, right here right now.
coding wise i dont think it would be hard at least for vanilla hands, but i dont know what two cards can count for each hand
should i suggest create_text_input to be patched with that for smods, actually
Are you telling me that a hand of 7 and 8 will be a Straight, and two heart cards is enough for a Flush?
Yes.
But what about the oaks, Two Pair, and Full House?
If you can't answer that, maybe just word it like Four Fingers, "Flush and Straight can be made with 2 cards", because that's certainly not all poker hands.
-- Modifies Enhancement Values
local base_calculate_enhancement = Card.calculate_enhancement
function Card:calculate_enhancement(context)
local ret = base_calculate_enhancement(context)
print(ret)
return ret
end
like this?
4oak, 3oak, Two Pair and Pair wouldn't be playable and Full House would just be 2 cards that aren't a straight or a flush I think, also the whole thing is Four Fingers but extemely overpowered.
4oak,3oak,Two PairandPairwouldn't be playable
As I've said, that's certainly not all poker hands.
Workable, but you'll need to rephrase your effect.
ret should still have self
Now, is there a way to prevent it from imploding if I add more than one of them?
that crashes though
🤔 how though, thats how i usually hook
wha
that happens?
Ye
nvm doesnt crash, but prints all nil
I suspect it is because the function is like, only ran in one node and thus the other one makes everything go haywire.
Just need a way to detect it being unclicked or something.
oh wait i think i see why
probably shouldnt use G.GAME
since thats used by all the text_input
how fix
try saving to somewhere that only the ui can check
i stoopid
Also, that is already taken.
🤔 an idea is to check from e instead
yo im just looking to change the sound effects of balatro how would i do that?
sorry to but in lol
Put the function inside G.GAME?
You can't put a table as a key.
It is hardcoded to be inside G.FUNCS
Haven't checked the code, but I am almost certain it will look something like G.FUNCS[func]
this it is indeed, hardcoded
I am going to have lunch.
Try to figure it out, will ya'?
ty
SMODS.Sound({
key = 'key',
path = 'newpath.ogg',
replace = 'keytoreplace',
})
:3 im so cooked
weird
if card.ability.set == 'Enhanced' then
local enhancement = card:calculate_enhancement(context)
if enhancement then
ret.enhancement = enhancement
end
end
``` is this actually being used in enhancement calculation because its literally just printing nils
What else would extremely overpowered four fingers be then if not this?
What object is running this code?
all flushes and straights can be made with 3 cards /j
eval_card
question, is this somehow related to yggdrasil
No.
I was working on a mod that added jokers, then I stopped developing it, because I made seals on everything, now I'm working on developing it again.
What effect are you trying to achieve?
i want to see what the return table contains so i can multiply the values
end goal is to buff enhancements by 50%
What about this?: ```
All joker slots count as empty
i dont think thats possible
does this allow you to pick up unlimited jokers
since most stuff check #G.jokers.cards
I never thought about it that way but probably yes.
so unless you plan on patching every line that uses #G.jokers.cards, its impossible
interesting lol you could probably get away with just making all jokers you have negative then
negative would become the worst edition you can get in that case, actually
why
since theres no need for +joker slots anymore
the only reason you get + joker slots is to collect non negative jokers
negative jokers still have their own use case
yeah but if all joker slots count as empty, then you technically have inf joker slots, no?
yeah thats the point i suppose?
thats my point, it kind of defeats the whole point of negative
What if I made the amount of joker slots always the same as double the current jokers but told it to display elsewise?
wouldnt make sense, if you have 1 joker then you only have 2 slots?
what they meant is that the text would still show the correct joker slot amount
but functionally you wouldnt, that would mess up how the logic works
its a more convulated, if not worse, negative
pretty sure lua is cursed enough and lets you overide the length operator
Yeah I have the first one
I mean math.max(#G.jokers.cards, numberofjokerslotspreviously) maybe?
oh
i think so?
This is for overpowered joker stencil by the way.
anyway bump
where are enhancements calculated
what is the function to set the hands and discards amount?
Is there any way to get a rank by id? Like, for example, jacks have an id of 11
:get_id()
try checking the code of jokers that change hands/discards
🤔 have you tried with modded enhancements
im currently not at my pc, but my theory is that vanilla enhancements probably dont use calculate, idk
interesting
okay let me try modded stuff
yeah didnt work
still a bunch of nils
hmmmmm
This is false, and yes, this is actually false.
-# actually?
do they just use this then
i got this to work
^like modifying editions
i just didnt get enhancements to work
which looks like the same function but apparently doesnt work
how do i choose the set from which a booster pack selects from?
is that what pools is for?
if you're making a booster pack you do it in create_card
oh i just saw that
Whatever I’ll just loop over SMODS.Ranks manually
create_card = function(self,card,i)?
and then make sure said function returns a card?
im still away from my pc rn, i will be back in a few minutes
ok
yeah
if context.destroy_card and card.ability.extra.uses_left == 0 and context.cardarea ~= G.hand then
G.E_MANAGER:add_event(Event({
func = function()
card:start_dissolve({G.C.BLACK, G.C.RED, G.C.RED}, true, 5)
return true
end,
blocking = true
}))
return {
message = 'Dragged!',
remove = true
}
end
when i do this to destroy a card thats enhanced, it removes every card in deck as well
context.destroy_card runs through every card
since you only excluded it from checking G.hand, it will go through G.play, G.deck
so i should prevent those areas as well right, how do i destroy that particular card though? (the one that is enhanced) which is played
and context.cardarea == G.play
then check if context.destroy_card has any enhancement
gotcha ty
it doesnt crash for me
watefuk
you prob did something wrong on your end
can help me fix?
sure, take a ss of the code rn
mayhaps in a VC, screenshare at least?
a
I can send over stuff anyways
ok
yeah thatd be nice
discord is stoopid
DPP stands for my mod stuff
DPP_create_text_input{
ref_table = DPP.test_b,
ref_value = "test",
max_length = 8,
w = 1.8,
h = 0.2
}
calling the function like that
Right now I made this jpeg shader for balatro I have no idea if I translated it correctly.
something new
if context.destroy_card and card.ability.extra.uses_left == 0 and context.destroy_card == card and context.cardarea ~= G.hand then
return {
message = 'Dragged!',
remove = true
}
end
this was a much easier fix actually
dont know if this helps you in the future
thought id share
What do you guys think?
is this an enhancement's code?
yeah
-# got anything?
nope
-# i am so stoopid
card refers to the joker, so it shouldnt work
if context.destroy_card and context.destroy_card == context.scoring_hand[1] and card.ability.extra.destroy and not context.blueprint then
card.ability.extra.destroy = false
return {
message = 'Destroyed!',
remove = true
}
end
not card
but you can specify which card by indexing the scoring hand
or that, yeah
but i assumed you wanted to destroy all scored enhanced cards
fair enough
i'm trying to check to see if the player has a specific joker with another joker. how exactly would i go about doing that?
i dont see anything wrong here
now how do I add an edition?
and honestly, the code shouldnt cause any crash now that i read it again
It doesn't crash. It just... fucks the UI
hm?
my old implementation was that it uses G.GAME to check for something, but i forgot i already replaced that
???
Acts the same as when I was clicking it, but now it fucks itself up when releasing.
ok idk, try adding a delay into the event in DPP_load_text_input probably?
currently using this and nothing seems to be happening
ok
it should be G.jokers.cards[i].config.center.key == "j_(mod prefix)_rufus"
ooohhh thank you
no worky
I'll take your code snippet and add it withot modifications
to see if i fucked up anything by accident
no worky wtf
weird
darn it.
maybe try removing blockable?
I tried to run the game with the shader added but it gave me this rror
trying...
this is the shader code I currently have I don't know why the % symbol is the issue.
nopeb
ok idk, i guess its how your ui is constructed at this point
still weird that it breaks when there r more than 2 text input boxes though
it shouldnt do that
oops
whats DPP.reload_lists() btw
It reloads some list I have for seals, enhancements, etc
a sec
lemme give you a bit more context
🤔 what runs DPP.main_menu()?
So uhh... anyone can help me on this shader?
All these cycles things are controlled by lists, that contain well, ranks, suits, etc
sadly very few people here know about shaders
reload_lists just empties and fills them again
ohh, i see
It shouldn't cause any problems, tho
Yeah, I mean honestly I want to also learn shaders but somehow it feels complex to me.
what about this
SMODS.Keybind({
key_pressed = "tab",
event = "pressed",
action = function()
G.FUNCS.DPP_main_menu()
end
})
it is complex
now balatro's shader code is the next level now.
the main problem is that you dont have a G.C.ROOT, i think
function G.FUNCS.DPP_reload_lists()
DPP.reload_lists()
G.FUNCS.DPP_main_menu()
end
wild.
possibly, but uh... now how tf do I implement that
Do I just create a wrapper root node?
can you tell me who were the people that knows shaders?
thats probably why the alignment all fucked up
aside from Bear
id say eremel is your best bet
hmmmmmm
though, please dont annoy them by dming them too much when they dont respond :p
I didn't mean to anoy them though I might have said too much
I don't know if he would take a look but my impatence was just well...
I try to control myself from being impatient
but yeah.
I don't know cause he haven't responded to me
even though I was new at the time.
I didn'T dm them a lot
just once
Am I able to put Eternal sticker on playing cards?
except
i understand, not having your code (or just basically anything) working can be quite annoying, but its not a good habit to put that impatience on others :p
I only sent him a waving as a dm but yeah.
I understand.
and also the point
yes, but they wont work i think
you will still have to code the functionalities yourself, i think #1355819401198178455 did that
cause honestly I've been asking help a lot when I had an issue about trying to get the joker to like copy the played card.
So yeah.
honestly the fuiquent amount of users here haven't taken noticed on other helps or issues
or maybe guidence to new members
I mean a tutorial would help
but yeah.
the problem is also just people not knowing about your issue, I've noticed it but idk what the problem is
shaders are like, some of the most complicated stuff you can work on for a balatro mod
so there arent many people that can read shader's code, let alone troubleshoot lol
yeah i hate shaders
Yeah, I mean I wish I could've rephrased it better mostly
but yeah.
mostly that.
i figured out the fix to the text_input thing, in case u havent noticed it yet
-# and when im typing this, i realized you probably already read that, but leaving the conversation with "also N'" is weird, so
But I'm thankful for a few people to notice mostly but yeah. I don't understand mostly why it's easily ignored.
I mean would've used pings
but that might not work
I don't think
i forwarded your code to myself for later :3
:3 damn
dismantling the whole UI to get it working again, help
G.C.CLEAR
inside my root node or huh?
color = G.C.CLEAR in the roots config
^
oko
i need to come up with more material/crafting recipes/relics ideas later
updated, i think?
It still fucks itself 😭
