#💻・modding-dev
1 messages · Page 433 of 1
What does your config table look like?
config = { max_highlighted = 1, extra = { enhancement = 'joker-poker_invis' } },
Your enhancement key is wrong, it should be something like m_modprefix_keyyoudefined
got it, thanks
hi everyone :D
how do i prevent a card enhancement from appearing in booster packs?
couldnt find anything in the wiki
gonna see if anyone has any idea what the issue is one last time before i sleep,
Expected Behavior: Kings/Jacks score, flip to show the back, become queens, flip to show front and are discarded
Actual Behavior: King/Jacks flip to show back, score, become queens, flip to show front and are discarded
the scoring and becoming queens might be swapped, but there isnt a functional difference either way
fixed
any way to make chances get affected by cards like oops all 6s
You need to use the uh probabilities thing in your pseudorandom code (search for the word probabilities in the discord to find what it's called)
did that but now the joker is triggering all the time, either im getting really lucky or something not working
What's your probability
should be 1 in 100
SMODS.Joker { -- Money Smaro Joker
key = "moneysmaro",
loc_txt = {
name = "Money Smaro",
text = {
"{C:green}#2# in 100{} chance to",
"gain {C:money}$#1#{} on round end"
}
},
config = { extra = { money = 100, odds = 100 } },
rarity = 1,
atlas = "moneysmaro",
pos = { x = 0, y = 0 },
cost = 6,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.money, (G.GAME.probabilities.normal or 1)} }
end,
calc_dollar_bonus = function(self, card)
local normal = G.GAME.probabilities.normal or 1
local odds = card.ability.extra.odds or 1
if pseudorandom("moneysmaro") < normal/odds then
return card.ability.extra.money
end
end
}
its not a long joker
How would i check for cards previously played this ante in a joker, similar to the pillar
so like cards previously played this ante give +10 mult
look in vanillaremade
https://github.com/nh6574/VanillaRemade/blob/main/src/blinds.lua
i checked
hmmm
could i replace debuff card with other card
so whats the problem?
probably
card:set_base(G.P_CARDS['C_A'])
?
that sets the card (in this case ace of clubs)
still confused
any news on this?
Bump
(Also me when I lie, I'm not going to bed for a while lol)
@willow plinth so
figured it out
I'm trying to have a card score, then flip, become a different card and then flip back and discard
But it's doing something else
See the message being replied to
hmmmmmmm
so my guess is that your event starts to soon? like what if your first event is also trigger="after"?
also your second event has trigger=after but i think it should be trigger="after"
Well technically is for me too
But like
Really early morning lol
And I haven't slept
How would one make a joker compatible with blueprint?
blueprint_compat = true
And where would you put that?
With your eternal/perishable compat bools
I think you also need to include a blueprint context in your joker’s code for it to actually be compatible though
is there a way to check if a card is being retriggered?
This is just for the visual indicator fyi
how can i check if the last played card is an Ace?
pardon
but how do you check if you already defeated a boss blind?
@faint yacht like this then?
That's for generally checking boss blinds... if you want current blind being a Boss one, G.GAME.blind.boss.
soooo
how do you detect that you defeated them?
context.end_of_round?
ye.
how can i make another currency?
carefully
jokes aside: that's not a straightforward question, it's a whole project
do they not have example for consumables?
what are you trying to make
a consumable
thank you
a few of them atleast
what types
WELL I MEAN LIKE YOU KNOW
tarot like
like every mods has their own
codes, torats, silly
thanks
at the top it shows you how to make your own consumable type
dark_edition
noted
holy jesus thats complicated
tyvm
im sticking to jokers for now
how do you check for a specific boss blind?
like for example, this joker only triggers at The Goad
iirc
G.GAME.blind.config.blind.key == "b_key"
where do you check the boss blind keys
for reference
the localization files
alternatively game.lua
estrogen
was money used for the gold color too?
i'm willing to bet y'all can guess what im tryna do
i just havent coded in a bit
like this?
==
is there a way to make a joker trigger when a played card is retriggered?
hey how do i change the mod icon?
SMODS.Atlas{key = "modicon", path = "iconfile.png", px = 32, py = 32}
thanks
do i just like
but that in the metadata and reference it
icon = key goes here
...you just initialize the "atlas" for the mod icon and that's it.
Should be picked up automatically during initialization.
Maybe I should add a retriggered flag for playing cards
I’ve seen a lot of people asking how to check it
its that easy?
Something along the lines of context.other_card.first_score?
is there a way to change stats for the current round?
for example
2x hands
or 2x discards
or 2x chips production
using consumables
ease_discard(G.GAME.current_round.discards_left)?
would that only change for the current round?
Yes.
that’s surprisingly simple
for hands i’d assume i just replace “discard” with “hand”?
No, it would be ease_hands_played(G.GAME.current_round.hands_left)
No.
how’d you learn it?
You look at the code
i’m too used to in-depth documentation bruh this is to complicated 😢
There are a lot of useful functions like that in the vanilla source code that you just need to find
Is anyone here who running Balatro on linux?
The functions that smods provides have some documentation on the wiki and the lsp definitions in the smods folder
But unless you find someone willing to document the vanilla game, you’ll just have to find them yourself or ask questions to learn from other people
oh thanks
That'd be useful
Hey folks! I might be dumb
but I'm having trouble locating any kind of guides/documentation for modding Balatro. I was thinking about seeing if it would be possible to make a mod that removes the rumble sound effect because it's really bass-heavy and sometimes when playing Cryptid it gets locked on for all eternity and it hurts my ears 
the what
The rumble sound that plays when you're about to score over the blind's target, and the flames come up
oh the flame noise?
how can i create another currency??
Yeah that
i am kinda new to modding,to add a consumeable, do i need to specify the key and the area?
SMODS.add_card
it says in the api docummentation that defining a gradient to a rarity color is deprecated, is this true? and if so is there any other way of doing it?
SMODS.add_card({ key = "spritz"}) gives
unable to index center a nil value
the card i'm trying to add is a consumeable
it shows on collection
"c_[modprefix]_spritz"
yes i know i do have a gradient, but is it possible to assign the gradient to a rarity color?
yes
I'm trying to create a gradient but it's all white when I load the game
where are you using the gradient
in a rarity
can i see the code
SMODS.Gradient {
key = 'testrar',
colours = {
HEX("131c5c"),
HEX("000000"),},
cycle = 5,
interpolation = 'trig',
}
SMODS.Rarity ({
key = 'test',
loc_txt = { name = 'Testing',},
badge_colour = G.C.speedx_testrar,
default_weight = 100,
pools = {["Joker"] = true},
get_weight = function(self,weight,object_type)
return weight
end,
})
do you define G.C.speedx_testrar somewhere
thank you!
in badge_colour
G.ARGS.LOC_COLOURS.speedx_testrar should exist
Should I use that instead?
yes
consumeable = {
use = function(self, card, area, copier)
return {
message = "+200 Mult!",
mult = 200,
card = card
}
end
}
i might be stupid,how can i add mult directly from a tarot
returns like that don't do anything outside calculate
it's not very straightforward to add mult outside scoring
makes sense
It says it isn't defined
oh yeah it's not defined at the beginning
G.GAME.current_round.mult = G.GAME.current_round.mult + 200;
can this work
ok one more, try SMODS.Gradients.speedx_testrar
idk
it works, thanks a lot
got my mod and joker to appear :D
ok now how do i unlock the joker for myself
nvm got it
SMODS.Joker{
key = "Albert",
loc_txt = {
name = "Albert Cosme",
text = {
"This Joker retriggers",
"all {C:red}scoring {C:blue}stone cards"
"and transforms any {C:red}non-scoring cards"
"into {C:blue}stone cards"
}
},
atlas = "Albert",
soul_pos = {x = 0, y = 1},
rarity = 4,
pos = { x = 0, y = 0},
cost = 10,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_comat = true,
perishable_compat = true,
config = { extra = { repetitions = 1 } },
loc_vars = function(self,info_queue,center)
info_queue[#info_queue+1] = G.P_CENTERS.m_stone
end,
calculate = function(self, card, context)
if context.cardarea == G.play and context.repetition and not context.repetition_only then
if context.other_card.config.center.key == 'm_stone' then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
end
end
end
calculate = function(self, card, context)
if context.before and not card.debuff then
card.ability.extra.AddChips = 0
for i=1, #context.full_hand do
local card_is_scoring = false
for j=1, #context.scoring_hand do
if context.full_hand[i] == context.scoring_hand[j] then
card_is_scoring = true
end
end
if card_is_scoring == false and not context.full_hand[i].debuff and not context.full_hand[i].clown_destroying then
context.full_hand[i]:flip();
```
context.full_hand[i]:set_ability(G.P_CENTERS.m_stone);
context.full_hand[i]:flip();
end
end
end
}
help
it crashes
haven't got nitro i need to make multiple messages sorry
iget these crashes evry time and i don't tget why
Is that the only code in the file?
with the atlases and metadata yeah
is there any way i can spawn a joker in a run?
DebugPlus or UlraHand is needed for that
Is there a reason why when I try to use quantum enhancements it lags the game extremely and fills the event queue?
Got to it in the collection and hit "3"
then in your collection get your cursor on a joer and press 3
it should spawn
was editing my sprites for some jokers and i started to have this visual bug where theres a 1px from another joker on the soulpos and idk why it happens as the code is correct as well as the image for it
its very subtle but still
i don't see it
its like a line on the right of the 1st joker
oh
yeah in the image doesnt show properly but ingame is very worse
soul_pos = {x = 0, y = 1},
pos = { x = 0, y = 0},```
should be like that to work
or restart the game
put the 1 in y not x
I think you have one less pixel in the width of your spritesheet
also yes
Its supposed to be a 71x N
N being the number of jokers you have
All jokers are separated by 2 pixels
or like 71*190 for leg if you have one sprite for each joker
Wide and height
ik ik but the sprite is also correct every square in here is 71px wide and diesnt have any pixel from the other
Couple things. You've got two calculate functions. Need a comma after the end of the first one. Also may need another end after the second one, or that might be the discord two messages. May also need some additional commas in your loc_text['text'] But also, why two calculate functions?
Basically shift every joker one pixel to the right if you have the right width
i tried firstly with only one, and after with another one, and i forgot to get rid of the second one
Except the first one ofc
ok yeah i might be stupid LOL ty now it works
😭
i didnt notice the sprite was wrong
:P
I appreciate you asking this. I had the same issue and have just been shrinking the sprite by a pixel each
but what do you mean abt loc_text['text'] ?
how do i add my own calculate to an object? 🤔
-# or is it already added
oh sorry, haven't read it right
i still have an error on another line
anyone know why my booster pack is crashing when i open it?
You need class prefix and mod prefix.
where
if context.full_hand[i] == context.scoring_hand[j] then
card_is_scoring = true
end
end
In your SMODS.ObjectType
Can you send the file or SS with line numbers? from just this snip, there is an extra end but I'm assuming thats from something above.
oh nevermind its already added
thats useful
What are you trying to do?
This might overlap with smth I'm planning to do
adding a method for people to add their own relics calculate and stuff
uhhh what did i do wrong here
im literally hard coding my relics rn
i am following a tutorial on youtube
wait in the booster pack code or the actual SMODS.ObjectType code?
you need an end
Hiiii
calculate = function(self,card,context)
end,
I remember looking at the code and seeing this
And thinking "okay if I'm doing this I'm adding a calculate function"
hi carrot
All your logic with context needs to be within the calculate function
In the SMODS.ObjectType code.
ok
Quite literally you're missing an end to mark the end of the function, you should probably learn LUA syntax if you haven't already
yeah no currently my relics work by hooking to SMODS.calculate_context
and its extremely janky imo, so i will change how it works
-# which might take a couple of days for me to figure out the optimal approach (and because im lazy)
💀 good idea
So real
I'm gonna lock in on my mod tonight to get a stable release out 🔥🔥🔥
mmmhhhhh
quantum enhancements are barely documented, and not many people use it so i kinda doubt anyone knows how to properly use them asides from eremel, aure and other people 🤔
like this?
i think eremel would be happy to help you out
-# then i will ask you about it later :3
Does your key of your joker have _joker at the end?
no
Then remove it and put j_ at the start.
The Joker specifically doesn't crash on mine like this.
and keep the mod id?
this is where i suggest that you download lua extension
No, it should be the mod prefix not the mod id.
:3
what do you mean ?
oh
i have it (i think)
really? it should tell you if you are missing a syntax, end or whatever
did you download the one by sumneko
Even if I did use them correctly, do they allow multiple of the same enhancement?
^+1 Your issues have been language syntax.
I'm gonna work on my mod todah
it's still crashing
idk, i don't think so and i can't find it T-T
🤔 i think it shouldnt affect anything, the calculate of the main enhancement should be different from the calculate of enhancements added by quantum enhancements i think
No, what I mean is, does it allows multiple of the same enhancement to be added by quantum enhancements?
i searched it and didn't find ima try to find it
oh
Meaning I fixed the syntax in the joker object in the file I sent back. Testing it with my game, the joker object did not crash.
Are you using the right visual studio? Visual studio code and not just visual studio?
yeah i copied it thank you so much, i was about to crahs out it drove me insane
yeah
i re-searched for it and found it stf
wtf*
I see everyone using VS Code. Am I just a masochist for using Notepad++?
after checking how SMODS.get_enhancements and SMODS.calculate_quantum_enhancements works, i think it doesnt. if multiple context.check_enhancement tries to give a card the same enhancement then it will still only have that enhancement once
-# i didnt ctrl + Z enough, dont mind that "use"
quick question how do i make the "cards into" not in C:attention ?
"This Joker retriggers",
"all scoring {C:attention}stone cards",
"and transforms any",
"{C:attention}non-scoring cards into {C:attention}stone cards"```
you can use {} to stop {C:attention}
"{C:attention}non-scoring{} cards into {C:attention}stone cards{}"
i got it like this, but it's still crashing
i didn't know thanks
So if I wanted that, would I have to copy that function and make some adjustments?
how do I create a joker of a custom rarity?
SMODS.add_card({rarity = "modprefix_raritykey"})
yeah, primarily how SMODS.get_enhancements read and store the enhancements and how SMODS.calculate_quantum_enhancements read from it
So I applied both changes but now the problem is that the joker upgrades even when the played cards are not faces.
(Sorry for the late response)
What does your code look like?
you are making it so its always upgraded even when you dont play any face cards, yes
does anybody know why this is crashing😭
sharing the error would be helpful
for some reason this error appears when it's supposed to create the joker
also this might be a stupid question but is it possible to have conditional lovely patches?
like i can control whether a patch activates from elsewhere
oh true lol, imma change the if not passed condition
not that i know any way to do that, no
😔
guess im going to have to write robust code in my patch instead
Not 100% sure on why that would be, my initial thoughts are that the deck cardarea is enabled so it’s checking every card in every context, could try adding some area restrictions to see if that improves (I think the problem is worse for wild cards fwiw because they effect poker hand evaluation, but I’d need to do some proper testing)
for some reason, now it doesn't upgrade when 2 different face cards scored.
(By different I mean they can have the same suit but different rank or same rank but different suit)
The deck card area is not enabled and I changed it to steel and it was the same.
local new_card = Card(G.hand.T.x, G.hand.T.y - 6, G.CARD_W, G.CARD_H, {[suit value], [rank value]}, enhancement)
I want to create a new card through my Joker with a random enhancement, but what values should I put in [suit value] and [rank value] if I just want a random suit and rank?
If I do something like this:
local suit = pseudorandom_element(SMODS.Suit.obj_buffer, pseudoseed('suit'))
local rank = pseudorandom_element(SMODS.Rank.obj_buffer, pseudoseed('rank'))
local new_card = Card(G.hand.T.x, G.hand.T.y - 5, G.CARD_W, G.CARD_H, {suit=suit, value=rank}, enhancement)
Then if I reload the game with the debug tool by pressing L, the suit and rank will visually disappear
I am using SMODS.add_card() to add a joker of a custom rarity, but it gives me this error when it's supposed to create the joker
did you try adding type = "Joker" in there too?
it gives me the same error, I don't know if I'm doing something wrong
mm, can you show me the code?
@daring fern do you know how can I fix this?
...i mean, thats how you coded it, no?
yeah
(By different I mean they can have the same suit but different rank or same rank but different suit)
I changed a few things, it gives me another error, though
if G.GAME.blind.boss then
SMODS.add_card(type = "Joker",{rarity = "speedx_exalted"}),
end
end
Don't tell me I have to use an event
local faces = {}
local passed = false
for i,v in ipairs(context.scoring_hand) do
if #context.scoring_hand >= 2 then
if v:is_face() then
if i >= 2 and not faces[v:get_id()] then passed = true; break end
if not faces[v:get_id()] then faces[v:get_id()] = true end
end
end
end
oh wait, its set not type, sorry
and also, set = "Joker" should be inside that table too
unfotunatly did not worl :/
Hai everyone, still havent figured out this from last night
try changing the context to context.after instead, since it seems you want the animations to happen after the scoring
oh, and also, trigger = "after", not trigger = after
How do you check if a playing card (card in hand, not a Joker) has a sticker
Where exactly do I add context.after?
replace this with context.after
Is it possible to save the amount of lost run's as variable? and if so how?
Remove the blocking and block able stuff too
adding blockable false was the only way i got it to do both flips :/
there was no change when adding context.after, and the only change after removing the blockable text is that it triggers during discard again
oh my god IT WORKS NOW THANK YOU!
do you mind explaining me how it actually works?
just for curiosity and wanting to learn more about the balatro lua commands.
if not it's ok.
v:get_id() returns the id of the card
J is 11, Q is 12, K is 13, A is 14 for instance
just checked and it doesn't matter what event has the blockable = false, it functions the same ethier way
I don't know why its ignoring context
How do I add an effect immediately when a blind starts
calculate = function(self, card, context)
-- At the start of each blind, apply Catatonic to a random card
if context.setting_blind then
-- Find eligible cards (not already Catatonic)
local eligible = {}
for _, handCard in ipairs(G.hand.cards) do
if not handCard.ability.fm_catatonic then
table.insert(eligible, handCard)
end
end
if #eligible > 0 then
local target = eligible[math.random(#eligible)]
SMODS.calculate_effect({
message = "Decimated!",
sound = "fm_resonance_fragment",
colour = G.C.BLACK
}, target)
G.E_MANAGER:add_event(Event({
func = function()
target:juice_up()
SMODS.Stickers.fm_catatonic:apply(target, true)
return true
end
}))
end
end
...
Even with setting_blind, currently I have to play a hand before this custom sticker gets applied, I want to make it so that the sticker is applied immediately when the blind begins
since it should only be able to trigger after the scoring
What currently happens?
This video doesn’t work on mobile
ah
the kings/jacks get played, flip, get scored, flip to show queens and then discard
it should be play, score, flip, flip, discard
weird, context.after shouldnt make the animation play before the scoring
without the blockable false however they flip while being discarded
yeah, and its only one of them so I think making it not blockable somehow lets it ignore context?
setting blockable to false would make it run regardless of other events that should be run before it
Have you tried removing all the blocking things?
You generally don’t need them at all
^
^
i did remove the redundant blocking ones
Can you remove them and show the new code?
after needs to be a string not a variable
this though, makes the card flips happen while they are discarded
And you need delay = 0.5 in both
Still need some insights here
I also think your ordering is probably not what you intend, this will flip the first card, change it, then flip it back, then repeat for each other card
just update smods
ok so it half functions properly now, they have stopped showing the back of the card
so they just flip over to show a queen
whitch is the behavior when it was missing the second card flip event
thats odd, context.setting_blind should run at the beginning of the blind
can you try removing the event?
🤔
and also, i would use pseudorandom_element instead of math.random
unless you want your players to be able to reenter the run until that effect hits the card they want
What isn’t working?
the cards should be doing score, flip to show back, flip to show queen. Its actually doing score, flip to show queen
it should show the back like death/strength do
current code
They just instantly flip back over, right?
how would i create the text effect that Misprint has for something with an existing loc_txt?
yes, just checked on game speed 1 and they do flip to show the back
its just super fast
How I can add a seal label from a localization file?
It’s because you queue the events to flip then unflip, rather than flip all then unflip all
Or increase the delay in the second event
Ive managed to fix it by just increasing the delay for event 2
just need to find the spot where its not too slow now
thanks for all the help!
oh wait, just tested it some times and it works but not when the played hands have the same rank but different suit.
is there a way to make the if conditions to check also that if two or more cards have the same rank but different suits?
forgot to add to the comment the second requirement
local faces = {}
local suits = {}
local passed = false
for i,v in ipairs(context.scoring_hand) do
if #context.scoring_hand >= 2 then
if v:is_face() then
if i >= 2 and not faces[v:get_id()] then passed = true; break end
if not faces[v:get_id()] then faces[v:get_id()] = true end
if i >= 2 then
local unique_suit = true
for suit,_ in pairs(suits) do
if v:is_suit(suit) then unique_suit = false; break end
end
if unique_suit then passed = true; break end
end
if not suits[v.base.suit] then suits[v.base.suit] = true end
end
end
end
probably this?
-# i apologize for the indentation, i typed it on discord lol
hey can anyone tell me where i can find all of the "codes" (idk what to call them) like the default joker is j_joker
The var label goes into the localization file?
Vainilla remade has the joker's key if you want a refer
what's wrong in here?
ah yeah i have the mod already thanks
Do you need more help?
it works pretty well now, thank you so much!!!
Was that enough?
if i discard 1 face card, it adds 5, if i discard 2, it adds 20, instead of 10, if i discard 1 face card an 1 number card, it adds 10
mmm maybe is validating if atleast one is a face card and then add the number of discarted cards time 5
that is the entire calc function?
not my mod but how would i make this be able to also copy negative edition?
Delete the bit about editions
then how do i fix my error?
what effect do you want it to do?
Context.full_hand
Is incorrect
You need the context for discard cards I believe
Nope thats selected cards
yeah, but ill discard selected cards
Check castle’s code
also it only bugs if i discard a face card
ok
Change the test for suit to face cards and it should work
ok it works thanks
Hello, does anyone know how to stop the sound if it is still playing in the function (if context.end_of_round)
dw
No idea
You need to add a trigger for stop i believe
hmm, this seems to only copy the first 5 joker slots, and not grow exponentially as it should
mhhh i tried G.SOUND:stop() not work i look into SMODs github sound there no explained how to stop the sound
until the sound duration runs out on its own
I have no idea honestly i didnt add custom sounds before
i see
is this the chat for developing mods and community help about them?
somehow
and modding chat is for talking abt your results or talking abt any other mod in general
uhh how do you set the edition of a card? Im just starting out at modding
card:set_edition('editionkey')
is editionkey like m_stone?
like it is in other parts of the code?
oh oops i meant modification sorry
how do
Thats enhancement
How could I create tags based on their position in the collection? Trying to kind of make ace equilibrium from cryptid for tags.
an enhancement would be card:set_ability('key')
oh, thank you.
wait nvm
uhh it crashed and returned "attempted to index local 'center' [a nil value]
i used it like card:set_ability(gold)
it is supposed to be ('gold') ?
You'll want to use'm_gold'
thanks.
how can i add myself chips without going through scoring process?
change G.GAME.chips
ok
AHHHHHHHHHHHH
did you know, when you replace a joker's enhancement, it just turns into that card?
news to me
that card
?
i mean
Hi
where are the values for the 'poll_edition' variables stored?
did you remmember that "black market" i wanted to add? now im in trouble with it :when i click on next in shop it goes to select blind and do nothing
how would I make a joker name that would randomly switch between a set of names?
out of interest where did you find the "Lovely.Hooks" stuff
not sure if i can help btw
i was searching on internet i dont rememmber where was it
Sure! im searching for it
ah... i asked where is Lovely.Hooks.on from gpt but it said:it not used officially in anywhere!
bump
does anyone know?
why does this loop after each round and not based off number of jokers?
for some damn reason context.individual fails to work here
like wtf
it's not even printing anything
hey i'm quite new at lua, how do variables work? i can see that 'self' is used when adressing an item but I dont really know how to use them. i want to turn self.ability.name into a list...
take a look at smods API
ok
also why would you want self.ability.name to be a list
it stores the object name (or key if not specified) for convenient use in English when you want to refer to it, although it's not recommended
good day good people!
How exactly do you make a starting deck? I couldn't find info about it in the API documentation that wasn't outdated
doesn't look outdated to me
you can still take a look at it, as well as some other mods that add decks
thank you guys!
is this a joker?
can you elaborate?
yea, gain +4 chips every card scored, that's it
I want it to increase by 1 hand size for each joker that has anime = true in config and yet it retriggers each round and increases at the end of each round instead of just when a new joker is addes with that config
how can i add mult when a consumeable is used?
context.cardarea instead of area
a tarot has the calculate() function but it doesn't add the mult
💀
well modify_hand is called each hand
I love it when my brain cells confuse context.cardarea with context.area
what is the code
can you explain this
do you want to add mult on use or add mult on keeping it in consumable slot
like what is the goal
then what should I use to make it only when jokers where anime = true are added?
context.card_added
Good schmorning chat
hii
How's my goat N
😷
that sounds scary
A cure can sometimes be scary..but necessary
Is it possible to create a joker, and then destroy that same joker at the end of the round without using perishable debuffs?
by using the consumeable the current mult increases by 100
key = 'spritz',
set = 'Tarot',
loc_txt = {
name = 'Spritz',
text = {
"Add {C:mult}+100{} Mult to your score"
}
},
rarity = 1,
cost = 10,
atlas = 'spritzAtlas',
pos = { x = 0, y = 0 },
consumeable = true,
use = function (self, card, area, copier)
--add 100 mult to current hand
end,
can_use = function(self, card)
return true
end
}```
yeah
Can you add shaders to a deck?
idk if it is possible
yep, use SMODS.DrawStep
Hi dilly!!!
does the game have a var for mult that i can change?
workin' on blinds, packing for a flight
Denver
hell yea, colorado is suppose to be very pretty
girlfriend in Denverish so Im going to visit for a couple weeks
hell yea
i hope its a wonderful time
how can i change a cards soul_pos value? i did this but it isnt updating unless i leave the run lua if card.ability.extra.mult > 0 and card.ability.extra.mult <= 15 then card.config.center.soul_pos = {x = 1, y = 2} end
hey so, just to make sure, this is how I would do if I wanted my deck to start with a joker right?
thanks in advance
The label must be defined in the localization file?
does anyone know how I could do this?? I want the name of the joker to randomly switch between a set of like 5 different names over time kinda like how misprint's description does but with names
isn't that in the mod.json? I'm no expert tho
you would need to edit the name UI using generate_ui
j_modprefix_key but yes
inside the jokers brackets?
yes
alright, thank you!
wooooo!
wait, I kinda wanna make the joker eternal, any way I could do that?
look at blasphemous deck morefluff
is that from a mod? Which one?
morefluff
ah
How do I remove the space between NkY?
it's a vanilla bug, it should be fixed in latest smods
What can I all do with add_tag? Anything besides just giving a tag based on its key?
what syntax error have i made ?! why is it marked as red
show the full calculate()
calculate = function(self,card,context)
if context.before and #context.scoring_hand == 3 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex')
}
end
if context.joker_main then
return {
card = card,
Xmult_mod = card.ability.extra.xmult,
message = "X" .. card.ability.extra.xmult,
colour = G.C.MULT,
}
end
end
if card_is_scoring == false and not context.full_hand[i].debuff and not context.full_hand[i].clown_destroying then
context.full_hand[i]:flip();
context.full_hand[i]:set_ability(G.P_CENTERS.m_stone);
context.full_hand[i]:flip();
in_pool = function(self,wawa,wawa2)
return true
end```
how do i use generate_ui?
So I'm trying to replace the chips text with a different dynatext object, but for some reason it hangs up here until I select something
How can I force it it to update/recalculate the first time?
Nvm I got it. I'm very smart
🧠
you're still here ?
sᴏʀʀʏ ɪғ ɪᴛ ᴀɴɴᴏʏs ʏᴏᴜ ᴛᴏ ʙᴇ ᴘɪɴɢᴇᴅ
it's a function that is called when the description tooltip is generated, it's kinda advanced so it's hard to explain how to use it without an example
hold on i think i figured it out
i need to test tho
How can I have a joker give the tags in order, two at a time when the blind is selected?
how can i update the art for a joker? I want to change its soul_pos in calculation but it only upates after going to the main menu
wdym ?
I can't seem to trace what you're trying to do starting from if card_is_scoring == false
therefore can't suggest a way to fix all syntax errors
like the grug that i am, i have a joker that transforms non-scoring cards into stone cards, which i wanted too on this joker, and copied it checked to see if it was ok and i can't seem to find the rror here
if the joker has mult between 0 and 15 i want it to replace its soul_pos with another lua if card.ability.extra.mult > 0 and card.ability.extra.mult <= 15 then card.config.center.soul_pos = {x = 1, y = 2} -- previously soul_pos = nil end
card.children.floating_sprite:set_sprite_pos({x = 1, y = 2})
How would I go about making a window pop up on screen above everything else when the game starts?
thanks!
got this crash with that, was i supposed to replace that with something?
you don't have to check for unscored cards manually
smods already provided a way to do so, you just have to include:
SMODS.current_mod.optional_features = {
cardareas = {
unscored = true,
},
}
in your main file
and switch context.cardarea check to "unscored" where applicable
i don't think it answers my question
That implies there is no floating "soul" sprite... did you try spawning in a fresh one?
the horses are plentiful
how can i make a joker add +1 joker slot while you have it? It's not an edition, just a joker
it's not an optional feature anymore
i was trying to make a Tarot that added mult to your score and ended up making a consumeable that when used, it stores 100 mult on a custom joker.
The mult is consumed when an hand is played.
is it now unnecessary to declare it inside SMODS.current_mod.optional_features
yes
nice
someone help me how do i give parameters to the :draw_shader()?
if im using G.FUNCS.overlay_menu, how can i either queue multiple menus or detect when one has been closed? do i need to hook G.FUNCS.exit_overlay_menu or is there a better way
its set as nil at the begining, changing that would fix right?
bump
config = { extra = {jokerslots = 1}},
loc_vars = function(self, info_queue, center)
add_to_deck = function(self, card, from_debuff)
G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.jokerslots
end,
remove_from_deck = function(self, card, from_debuff)
G.jokers.config.card_limit = G.jokers.config.card_limit - card.ability.extra.jokerslots
end,```
i think
ok thanks
what config do I need to set all everything negative?
bump
wait why's my game hard crashing?
screen of the crash please ? i wan maybe help
it's a hard crash
oh sorry
there's no screen
read it wrong
How can I add tags based on their position in the collection?
it happens when i try to unlock using debugger my 2 newest added cards
add end, below loc_vars?
oops
i changed the position of the if, and added an end, it doesn't crash anymore :)
quick question, can't I get the name to be bigger ?
thx
Safe to check for it if is exists first.
i think it might not be possible without a patch
did not work 😢
fuck i wanted the whole name :(
maybe split it into multiple lines?
now what's the error
infinite loop
wait where?
ima try
you will need the very latest smods if you don't have it
i have it ofc
ill see
it did ot register the second half but i find it somechat funnier
does fountain reference kris
i added it and it worked, thanks for the help!
does anybody know why my booster pack is crashing when openning it?
do you guys know if its possible to make a joker that makes all chips turn to mult
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.xmult}}
end,
calculate = function(self,card,context)
if context.before and #context.scoring_hand == 1 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex')
}
end
if context.joker_main then
return {
card = card,
Xmult_mod = card.ability.extra.xmult,
message = "X" .. card.ability.extra.xmult,
colour = G.C.MULT
}
end
if card_is_scoring == false and not context.full_hand[i].debuff and not context.full_hand[i].clown_destroying then
context.full_hand[i]:flip();
context.full_hand[i]:set_ability(G.P_CENTERS.m_stone);
context.full_hand[i]:flip();
}
end
end
}```
in VSC wiht my lua extension, my very last "}" is marked as red and i don't know how to fix it
i know it's possible but i honestly don't know how to do it x)
hehe
alright
nvm i got it
How do I access metadata from a mod's json file
SMODS.Mods["modid"] I think.
so I would just do like
SMODS.Mods["modid"].name for example?
How do i have text get updated when oops! all sixes is present? Like with vanila jokers that have chances
I think so.
okii
thanks :3
Put G.GAME.probabilities.normal into loc_vars
i need help, my card is supposed to turn non-scoring cards into stone card, but it doesn't (andit also get x0.2 every time a hand contains one card but that's not the subject this part works just fine)
config = { extra = {
xmult = 1,
xmult_gain = 0.2
}
},
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.xmult}}
end,
calculate = function(self,card,context)
if context.before and #context.scoring_hand == 1 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex')
}
end
if context.joker_main then
return {
card = card,
Xmult_mod = card.ability.extra.xmult,
message = "X" .. card.ability.extra.xmult,
colour = G.C.MULT
}
end
if context.before and not card.debuff then
card.ability.extra.AddChips = 0
for i=1, #context.full_hand do
local card_is_scoring = false
for j=1, #context.scoring_hand do
if context.full_hand[i] == context.scoring_hand[j] then
card_is_scoring = true
end
end
if card_is_scoring == false and not context.full_hand[i].debuff and not context.full_hand[i].clown_destroying then
context.full_hand[i]:flip();
context.full_hand[i]:set_ability(G.P_CENTERS.m_stone);
context.full_hand[i]:flip();
end
end
end
end```
Can someone help me format a lovely patch to replace things? I think I did it wrong and midunderstood the instructions
The example of using loc_vars is a bit unclear, at least how i read it, how does it determine what variable its assinging value too?
If you want to replace a specific thing and not a specific line, you need to use regex patches I think.
what are you trying to accomplish? your pattern patches are pretty thick so I would recommend a different approach
regex being one of them, or making your changes at runtime in lua instead of as a patch
I'm pretty sure they're specific lines being replaced, I'm trying to make the Hidden Aces mod a lovely file instead of an exe replacer
are you using smods?
I have smods and lovely?
but are you using smods to develop your mod?
I'm using notepad ++ and winging it
DLASKFHLSADKHF thats the hard way???
if you're committed to doing everything with lovely then do what I recommended
either switch over to regex, find some other way to simplify your patterns / patches, or change the necessary values at runtime
I mean I don't know what your mod is about but it would probably be easier with smods
pure lovely is a lot more difficult in terms of complexity and also compat with other mods
It's just changing base values of cards/packs/tarots/etc\
and you'll be having a lot of compatibility issues with the amount of "at" patches you have
bump
ok if i understand properly, it just asigns each variable a value in descending order, so #1# just is given the first entry in loc_vars
if context.individual and context.cardarea == "unscored" then
context.other_card:set_ability("m_stone")
end
```?
Yes.
it deosn't work
Code?
config = { extra = {
xmult = 1,
xmult_gain = 0.2
}
},
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.xmult}}
end,
calculate = function(self,card,context)
if context.before and #context.scoring_hand == 1 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex')
}
end
if context.joker_main then
return {
card = card,
Xmult_mod = card.ability.extra.xmult,
message = "X" .. card.ability.extra.xmult,
colour = G.C.MULT
}
end
if context.before and not card.debuff then
card.ability.extra.AddChips = 0
for i=1, #context.full_hand do
local card_is_scoring = false
for j=1, #context.scoring_hand do
if context.full_hand[i] == context.scoring_hand[j] then
card_is_scoring = true
end
end
if context.individual and context.cardarea == "unscored" then
context.other_card:set_ability("m_stone")
end
end
end
end
}
SMODS.current_mod.optional_features = {
cardareas = {
unscored = true,
},
}```
Ok, last thing and then my joker is fully functional, how do i make it actually not compatible with blueprint?
and not context.blueprint
Move it out of the context.before check.
at the end of my calculate stuff? or somewhere else
Where you don't want blueprint to do anything.
ah ok
like this ?
Yes, but please fix that formatting.
i know, i know, im used to it x)
now it works but doesn't do the flip animation
Do you want the stone cards to be stone in scoring?
no only to turn into stone cards
ima try something
if it doesn't work i'll keep your solution, thanks for it !
How do I get the localised Edition for my Description?
-# For Context: The Edition Changes every round
G.localization.descriptions.Edition[card.ability.extra.edition.key].name
so ikept your solution but it doesn't flip it gets turnd into stone before being in the played card area
but i'll see if i can fix it tomorrow ima go eepy sleepy now
Thank you!! You are truly the greatest 🙏
How does one change what the suit says on a playing card?
For example Ace of Hearts/Spades/Clubs?
How would I get a random value tied to the run's random state?
if it exists
if not dw
What do you mean?
You're trying to get a random value without changing future random values?
moreso trying to get predictable random values tied to the seed of the run
I don't want to roll my own random implementation just for what im trying to do
I don't think that is possible, but I have seen things in mods where you can see inside a booster pack I think.
I know that the ISAT/"In Stars and Time" Mod changed the Names via loc-file,
you could also try to edit/add stuff to G.P_CARDS ("self.P_CARDS" in game.lua).
Otherwise I'm clueless 
Well, seperate question, how would I create_card using a custom pool where all elements of the pool have omit = true
every method I've tried has resulted in the default value 
SMODS.ObjectType {
key="FishingRods",
rarities={
{
key='Common',
rate=0.7,
},
{
key='Uncommon',
rate=0.4,
},
{
key='Rare',
rate=0.05,
},
{
key='Legendary',
rate=0.0005,
},
},
}
FishingMod.FishingRod = SMODS.Joker:extend{
omit = true,
can_sell = true,
pools = { ["FishingRods"] = true, FishingPack=true, Joker=false},
...
when using create_card("FishingRods", ...) it always results in the default value

wdym? (sry for late answ, i was eating)
Does anyone have any idea how I could have this still change in the collection?
update = function(self, card, dt)
-- Store animation state in self
self._counter = self._counter or 0
self._timer = (self._timer or 0) + dt
-- Update animation every 0.05 seconds
if self._timer >= 0.5 then
self._timer = self._timer - 0.5
self._counter = (self._counter + 1) % 8
self.pos.x = self._counter -- Update self's position directly
end
end
}
You mean the required score?
You have to hook Game:update(dt)
if thats what its called yea
i always forget, how do you hook to that?
G.GAME.blind.chips = G.GAME.blind.chips / 2
thanks man
local oldgameupdate = Game.update
function Game:update(dt)
local g = oldgameupdate(self, dt)
return g
end
does the fountain joker also have kris in the info_queue
no it's the opposite
oh ok
oh it works now
G.GAME.blind.chips = G.GAME.blind.chips/2 when in blind.
Just to be sure, does G have to be returned or is that just an example?
Probably not but I always do that to make sure.
okay, just wanted to check, thanks
how can i make a joker unsellable?
should i be ingnoring these errors?
Did you put this in the joker?
Hook G.FUNCS.can_sell_card
I had it replace the update function in the joker
No, you need to put it outside the joker.
oh, oops
i still dont know how to hook something 😔 i dont understand how it works
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
sorry for all the questions, how do i now have this like, adapted for my code?"
-- Store animation state in self
self._counter = self._counter or 0
self._timer = (self._timer or 0) + dt
-- Update animation every 0.05 seconds
if self._timer >= 0.5 then
self._timer = self._timer - 0.5
self._counter = (self._counter + 1) % 8
self.pos.x = self._counter -- Update self's position directly
end
end
ive got the hook in my code, outside of the jokers but dont know what to do with them
Perhaps look at this for reference https://discord.com/channels/1116389027176787968/1341041293119459449 ?
Ill look into it, thanks
can't i just replace the game's sprites
I mean yes, but it's not recommended
and you can't redistribute your changes
so use malverk
Double Checking, if im calling for my own joker, would i call for j_prefix_key?
I think so.
Thank you
shiiit ok
not even by verifying gamefiles?
no like you can't share your changes with other people
ok so how do i hook that specific thing? like i get it but idk how to make it work
you can uninstall it by verifying your game files
My mistake I meant hook Card:can_sell_card(context)
local oldcansellcard = Card.can_sell_card
function Card:can_sell_card(context)
local g = oldcansellcard(self, context)
if (G.play and #G.play.cards > 0) or
(G.CONTROLLER.locked) or
(G.GAME.STOP_USE and G.GAME.STOP_USE > 0)
then return false end
if self.config.center.key == "j_modprefix_key" then return false end
return g
end
o h
i think i now understand how hooking works
ty
im trying to make a joker that makes cards played this ante give +10 mult when scored, but for some reason it triggeres on every card
if i have a list, how would i check if a specific item is in it? would this work?
i = 1,100
list = {'item', 'item', 'item'}
variable1 = list[i]
if variable2 == variable1 then
do the thing
end
You need to define a table.contains function.
i use ts idk if it works (well yeah it does then)
function table.contains(table, element)
if table and type(table) == "table" then
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
end```
thank you both!
Also no, because you're checking 1100 times and not the length of the table.
thank somethingcom, he gave me that code lmao
why does fmult not trigger?
You need to do fmult = number
SMODS.calculate_effect is just a return function but it doesn't return.
Also you should just do return {fmult = number}
what context do i use if i want something to happen when i play hand?
When you press play or before hand scores or before cards score?
context.press_play
ok
How do I add another tab in collections?
how can i change the titles texture using a mod
In the Other tab or directly in the collection?
other its ok
You make an atlas with the key balatro and set raw_key = true
balatro key is the key used for the title?
Yes.
any chance you know the pixel dimensions of the texture
333x216
thanks
one final question, where can i find the raw texture for the title
so i can edit it
resources/textures in the source code.
thanks
im trying to make a new collection tab, it crashes when selecting collection > other
How would i do this better? Im trying to change each card that was discarded individually
calculate = function(self, card, context)
if context.pre_discard then
print("Test")
full_hand = G.hand.highlighted
for i in #full_hand do
local other_card = full_hand[i]
print(other_card)
end
end
end,
crash log btw
Could someone help me out with this joker? I'm trying to (kind of) make ace equilibrium for cryptid, except it creates tags on blind selection and gets destroyed after the last one. Trying to implement cryptid code is a nightmare though, and I've got this, which does nothing. Anyone smarter than me willing to help?
Change context.pre_discard to context.discard and change G.hand.highlighted to context.full_hand and change other_card to context.other_card and change for i in #full_hand do to for i=1, #context.full_hand do
Thank you
the game freezes when I discard 5 cards, how could i prevent this?
nvm
bump
Experiencing a bit of a weird crash messing with UI stuff
(Image 1 is the error, images 2 and 3 are the code snippet)
It's only my second time trying to do UI stuff so I probably messed something up somewhere but the error is particularly unhelpful it seems
can you send more of the error
I think func should be a string of the G.FUNCS[functionname] not a function.
oh
How would i change the cards Edition?
if context.discard then
print("Test")
full_hand = context.full_hand
for i=1, #context.full_hand do
context.other_card = full_hand[i]
other_card = context.other_card
other_card.edition = poll_edition('aura', nil, true, true)
end
end
so I would just define like
G.FUNCS.outcome_a or something?
other_card:set_edition(poll_edition('aura', nil, true, true))
ohh
oki
lemme try that
How would I have a joker always sell for 0, but still cost 2?
Hook Card:set_cost()
How do i do hooks?
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
to change the suit, is it card.suit = "Spades"
SMODS.change_base
No, it's SMODS.change_base(card, "Spades")
now i just have to figure out how to actually space things like a human being
oh
wha
nothing is even called there
How do i set a cards enhacement?
card:set_ability()
ohh
calculate = function(self, card, context)
if context.discard then
print("Test")
full_hand = context.full_hand
for i=1, #context.full_hand do
context.other_card = full_hand[i]
other_card = context.other_card
other_card:set_edition(poll_edition('Jevil', nil, true, true))
other_card:set_seal(SMODS.poll_seal('Jevil', nil, true, true))
other_card:set_ability(SMODS.poll_enhancement('Jevil', nil, true, true))
SMODS.change_base(other_card, "Spades")
end
end
end,
It doesnt crash every time but only occasionally
SMODS.poll_enhancement takes a table.
Aswell as SMODS.poll_seal
wait sorry, what should i be giving it, in the wiki it says it defaults to all avalible enhacments and seals
Yes, you need to give it a table.
hey quick q. to set a generated tarot to wheel of fortune do i need to do _card:set_ability('t_wheel_of_fortune')?
No, it would be card:set_ability("c_wheel_of_fortune")
so wait, would i just slap in {} for it then?
other_card:set_ability(SMODS.poll_enhancement({'Jevil', nil, true, true}))
No, it would be SMODS.poll_enhancement({key = "Jevil", guaranteed = true})
Anyone know the code name for the hierophant I'm getting this error
INFO - [G] Error: Center not found for c_hierophant
i think the original has a typo i'd recommend ctrl+f-ing the localization files
It's c_heirophant
ok thx
Is there a way to stop rescoring from causing an infinite loop?
So chat
I used draw step to draw shaders on all my cards and now i wanna remove them
How
add an if condition to the step
i have this one that only draws a shader when it meets a condition and stops if not
https://github.com/nh6574/JoyousSpring/blob/865079026d0307f8a3cad869349a7c701b0cd03d/src/others/Shaders.lua#L12
what config do I need to set everything negative?
I ask because there are 2 seals that cause a stack overflow when together.
Try adding an extra break condition to the seals
They are not my seals.
O
what config do I need to set all jokers to negative?
You mean like Cryptids negative deck?
yes
What Cryptid does is it modifies create_card
so it just constantly creates cards that have negative not just force applying negative to cards?
No, it changes create_card so that when a card is created it becomes negative.
oh
How would I make a joker add a joker with a sticker and edition?
SMODS.add_card({set = "Joker", stickers = {"modprefix_key"}, edition = "e_modprefix_key"})
Something like: ```lua
local oldcreatecard = create_card
function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
local g = oldcreatecard(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
g:set_edition("e_negative", true, true)
return g
end
thank you
if context.setting_blind then
card_params = {
key = "j_artb_mitosis",
set = "Joker",
area = G.jokers,
edition = "e_negative"
}
SMODS.create_card(card_params)
end
what am i doing wrong here
its creating the card but its
not doing anything
its not activating
replace create_card by add_card
interesting lol
add_card uses create_card itself so maybe thats why
i use create_card sometimes for UI stuff
game just crashes
isn't fake_card a thing?
like no crash log
just "not responding"
if context.setting_blind then
card_params = {
key = "j_artb_mitosis",
set = "Joker",
area = G.jokers,
edition = "e_negative"
}
SMODS.add_card(card_params)
end
is it adding itself
yes
well,
yes
just add a flag to the card
that wouldnt help right, because those new jokers would still run it
if context.setting_blind then
if not card.added_by_mitosis then
local other_card = SMODS.add_card(...)
other_card.added_by_mitosis = true
end
card.added_by_mitosis = nil
end
like that i mean
I have solved this issue by doing multiple seals a different way, I still do not know what was causing this.
@pure salmon this doesnt work with blueprint why
unsure, haven't tested all my jokers with blueprint
I'm trying to create a collections tab but it crashes, I have no idea what's wrong
You have a nil node
little bit embarrassing lmao but how would i make a deck give mult during main eval
Decks can have calculate too.
is there any template for collection ui?

