#💻・modding-dev
1 messages · Page 446 of 1
for k, v in pairs(exceptions) do
if key == v then
key = k
end
end
that wasnt directed at you somecom im so sorry 😭
also i completely forgot about regular pairs
Lol thanks XD
talking about how it was a reply to the pickles
i like pickles
Uh well in that case I just got a crash report and it can be seen in the atachment. Anyone know what happened?
try updating smods
where's... the event?
i mean one of these https://github.com/Steamodded/smods/wiki/Guide-‐-Event-Manager
you mean the event manager or
looks inside
oh

oopsies
uhm
just be aware that it works
i cant open it again bc my pc will crash
i have a lot of event thingies
i still don't see an event 😭
i mean putting the G.showhorsedeath stuff in an event instead of using delay
delay works with events
always make space for your fan
I tried adding the code from the orbital tag but the game still crashes when the tag spawns, what am i doing wrong?
i would like to mention, i love the gus figure
you just put a whole function definition in there, that's not at all how you do it
is that gustavo fring
it was a Christmas gift i flick his chin daily (he’s a bobble head)
yes
i think i put it up on my first one
this is how i do it in my mod
https://github.com/nh6574/JoyousSpring/blob/bfe4f9bfc4d38135c652aeed94b0942ad0a1f736/src/utils.lua#L242
who dared to speed react me
oh
Apparently there exists something like SMODS.calculate_repetitions but I'm not sure, do you know whwere I can find it?
I think it's in smods' utils.lua
but why do you need it
it's an internal function so you need to know what you're doing
But how would i apply something like this to my mod?
Creating a joker that retriggers a lucky card until it gets lucky. Did it with score_card, which works but doesn't tkae other jokers in consideration
either copy and use that function or copy the orbital tag part
ah alright
oh ok then you probably need that then
for exapmle lusty joker et cetera
Yeah haha, thanks man!
do i add it to a joker or, do i create a sperate file for it?
idk what you want to do or what you know
what did i do wrong,,,
when a card or joker activates, it shows a little diamond with the effect in it. how to I make it under the triggering joker?
card = card if it isnt doing it automatically i guess??
message_card = card
i forgot "message" i knew it was off,,
oh my god wait the second transformation function
how do you detect someone if they enter a shop
youve gotta be fw me rn
OK SO I ACTUALLY DECIDED TO READ
does lua support else / ifelse statements?
AND FOUND ON N' WAS TALKING ABOUT AN EVENT MANAGER
NOT LIKE
A TICK MANAGER
OOPS
WELP
A rarity
anyways this ended up working so thanks yall ^^
is there any way to have a seal give extra mult?
is there something to view the variables for thing in balatro ? like to see the diferent things i can use to calculate with?
I've been going crazy for way too long
also could I trigger a discard AFTER a hand is played?
like having a joker that has a chance to do that
Wish me luck everyone
yesh!
On an iPad???
why did LocalThunk think making the code to call editions and seals different?
like why did he think this was a good idea?
bumpy bump
There isn't a context for that but you can make a short lovely patch for one [[patches]] [patches.pattern] target = "game.lua" pattern = "G.CONTROLLER:snap_to({node = G.shop:get_UIE_by_ID('next_round_button')})" position = "before" match_indent = true payload = ''' SMODS.calculate_context({ entering_shop = true, }) '''
I think it's starting_shop
I want to change the background colour of my boss blinds without it changing back to the default colour
Must I use Trance for this?
Well I made the sprites on an iPad, but I’m doing the code on a laptop
When did they add that?
at least 6 months ago
They really need to update the wiki
They do, it's not bad but there's so much that was added since it was made
whats the wiki? i shoudl vieweth it
thx
I usual patch them
where to put that
-# hi astraaaaaaaaaaa
this is actually more than I already know Lol! thanks
context.?
-# hi tomaaaaaaaaaaaa
I'm talking for actual Steamodded development
hiii astra
I have no clue what the coding standards for that project are lmfao
hiii nxkoo
i would ask "how's development been for you" but maximus 1.0 is out right now on github.com
We're all a lil dumb here, dw :3
ghhhh
also
whats the context for
if you have this joker
in your slot
Just cuz it's out doesn't mean development stops
if has_joker then```
where is it
Under your skin 
context.starting.shop and has_joker then?

-# IS THAT A [$@*!]ING AD INFINITUM REFERENCE?
I would be such a bad trip sitter lmfao
No its in the function like this if context.starting_shop then local has_joker = next(SMODS.find_card("joker_key")) if has_joker then -- Other junk end end
Or you could have the var outside i'm not sure it matters
i wanna know tho...
how do if chains work in lua? if i just put
if ((thing == thing) then
if ((thing == thing)) then
end
end
it just crashes?? IDK why
ohhhhh
but i got this error tho
the actual code you have may be helpful here
starting_shop not starting.shop
like this?
They just said not starting.shop...
trying to edit some code to make seals work on jokers
if self.ability.name == 'Scary Face' and (
context.other_card:is_face()) then
return {
chips = self.ability.extra,
dollars = self.ability.extra / 10,
card = self
}
if self.seal == 'Red'
#do the thing
end
end
but for some reason the crash error says that the 'if self.seal' line is unended.
clip trade since we're doing newer stuff
this
fucking laptop
oh my
GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD
WHY DIDNT THEY CAPTURE THIS
I don't know if im allowed to show clips of what im working on for AIJ but i coded 30 new jokers yesterday for it.
GRAB ONTO SOMETHING (the one time i did a bug and it was on purpose lmfao)
LOL
it works!!
wait what's stopping me from just recording something rn actually
you said "you'll see", and yet i do not see
the answer is nothing
its because i dont too
-# because its not a reference
oh :<
F A L L
YOU ARE ALONE JESTER
does the wiki not have anything on things like 1 in 6 chance and stuff?
The wiki sadly doesn't have it all
damn
you're not supposed to do that
if you want seals on jokers, I recommend trying out #1355819401198178455
also learn the basics of Lua
The check for destroyed consumables works fine (if not a bit slow to update), but my check for destroyed playing cards doesn't work at all. Can someone lend me a hand?
-- Hook
local card_destroyed = Card.remove
function Card:remove(context)
if self.added_to_deck and not G.CONTROLLER.locks.selling_card then
local destroy_key = "destroying_" .. string.lower(self.ability.set or "")
-- Consumables
if self.ability.consumeable then
SMODS.calculate_context{card = self, sriot = {[destroy_key] = true}}
DRM.Increment()
-- FIX ME
elseif self.ability.remove_playing_cards then
SMODS.calculate_context{card = self, sriot = {[destroy_key] = true}}
DRM.Increment()
end
end
return card_destroyed(self, context)
end
if card.states.hover.is == true then
this exists right
@unkempt thicket i need to know more about the card:click
What do you want to check exactly
just when they click
my plan exactly was it gains mults or chips whenever it got clicked
how would i set up a joker that debuffs certain hands? in the same way as for example, the eye
like it should stop certain hands from being played in the same way that psychic doesnt let you play 5 cards
You can probably just add this in the function then SMODS.calculate_context({ clicked_card = self }) then check if the clicked card is the joker you want if context.clicked_card == card then --Do stuff end
tysmmmm
i have this but it doesnt do anything for some reason
not even the xmult which is very confusing
ok it's doing the xmult now but
what's with the debuff field
it doesn't make sense
im referencing what the psychic does
it does not work with this exact text either so i guess this ones just a blind exclusive
i guess there arent really any jokers that actually do this so it makes sense but
i coulddd just do like, a set mult to 0 after scoring if playing one of these hands but i want it to like not give money or scale things either like the psychic does
hmmm unfortunate taking from the eye also crashes
how does boosters work?
do i use create_card to make cards in the booster or group_name
also how does ease_background_colour work
figured some stuff out, my cards are on crack, how fix???
might need a 'skip_materialize = true,'
Is there an easy way to start out with a specific joker so I can test what I've added
Without having to find it naturally
Or could someone recommend a mod that does this exact thing
install debugplus, hover over a joker and press 3
hold tab in debugplus
how do i change background color in pack
also how do i change the amount thats in the booster
is there a way to create a new type of card modifier?
Yea
how?
oh ncm i see it
where would i find the Key of the vanilla booster packs?
A Lot of lovely patches and stuff, I recommend checking paperback and what they did with paperclips.
found them nvm 🙏
I'm looking at pseudorandom rn and I don't really understand how it works
My code is:
pseudorandom('j_seven', 1, 5) < (G.GAME.probabilities.normal / card.ability.extra_odds) (x/5)
The right side of this equation should always be a fraction less than one. How does the comparison even work then?
Doesn't pseudorandom only return whole numbers?
maybe look at cryptid's ://RUN card
Cabinet Man is now..... complete (mostly)
Should be?
yeah, it is
I'd recommend using x_chips or xchips though unless you have something specific for the message
Hiya! I'm working on a joker mod with a friend of mine and we're having some issues getting our jokers to look the same resolution as all the others. As far as we're aware the pixel measurements are the same, I've lined them up correctly in our spritesheet but they're still weirdly low res despite looking perfectly fine in image form. Would anyone know a cause/fix for this sorta thing? Thanks!
(Kinda hard to tell with this screenshot but pitted next to other jokers they are obviously not as high res lol
How are youu able to dothis!?
can you play mario on this thing?
Are you not putting higher scales ones in the 2x folder?
I assume it might be that your resolution is high enough to default to the 2x version, but if it doesn't actually have increased dimensions, it might look blurry?
Sure, if you provide a Mario rom
I have a config menu that just allows you to flatly play games if you load them into a subfolder
Alright I can provide roms.
But for the purposes of the joker, it's just a reduced little segment of the game
Almost positive we are. He could've accidentally put our 1x sheet for 2x but we made sure to make the two versions
does anyone have an example of loyalty card's text string?
though if I want to ask. does it accept MAME roms?
No, NES only
For the 2x sheet, we just doubled the resolution of the 1x sheet, which is quite big. If thats not how you're supposed to do it that might explain the blurryness
noted.
although thought wold be cool to play some roms of MAME
If I had to guess:
"{C:attention}#1#{} hands played",
"{C:inactive}(#2# remaining){}"```
though only thing is that the NES version of Donkey kong was well squished but yeah.
there's also this verison: https://www.youtube.com/watch?v=dhRoe44Dg54
Apologies for my poor English, and the highly mature scoreboard entries that people typed into the game during the last weekend. :)
A few additions:
Yeah, the game is obviously "tate mode", meaning that you'll have to turn your TV on the side to play it - it's the only way the game could possibly play completely like the original.
I also made a...
i tried #2# and it didn't seem to work
Are you passing in variables to fill it?
i'm pretty sure? but maybe i'm missing something
good morning
this is not working as intended, want to create hermit or temprance
but its only creating hermits
or is used as a backup, it would only return "c_temperance" if "c_hermit" was nil
Shouldn't you be using pseudorandom to pick between 1 and 2 and then create a tarot accordingly
If you want it to be 50/50
I'm guessing that using the or operator here just kind of picks the first one
Because there wouldn't be any situation where hermit isn't available
yes it does
i just used or cause i couldnt think if what to use
my internet was disconnected for a few days and i put this as is andd worked on coding other stuff
quick question, what colors are available with {C:} ?
https://github.com/Steamodded/smods/wiki/Text-Styling the bottom of this has them all
thx
Attention, inactive, chips, mult, blue, red, white
Idk any others off the top of my head
Oh yeah green and money
there is a lot
Most aren't used
yeah
If you want an authentic joker I'd say stick to the main several
Is there a difference between blue and chips
@chrome widget sent you the roms.
There is a slight difference
is there an example i can see about this
I've only started modding last night and I already have a (((mostly))) working joker
Yay
in saturation
Anyways, has anyone have any experience on shaders? since I couldn't get a JPEG shader to work %100
if pseudorandom("randomshit", 0, 1) = 1 then
SMODS.add_card({ key = "c_hermit", edition = "c_negative", area = G.consumables })
else
SMODS.add_card({ key = "c_temperance", edition = "c_negative", area = G.consumables })
I don't really know how if else statements work in lua
The else part
does anyone know where the code is for the dark_edition color ingame
I totally typod that
In case you copy paste
Consumavles...
Btw no guarantee this works lol
I feel like it should though
Can anyone tell me why my joker is properly scaling but not scoring?
(It has a 1 in 5 chance per scored seven to scale +1 mult)
(Said mult is supposed to activate on scored sevens)
i think it will work as is "few typos tho lol"
thx
Np
New to modding balatro, is there something wrong with my Joker Function?
SMODS.Joker {
key = 'Pixow',
blueprint_compat = true,
eternal_compat = false,
atlas = 'Jokers',
cost = 15,
rarity = 3,
pos = { x = 2, y = 0 },
calculate = function(self, card, context)
if context and context.individual and context.cardarea == G.play and context.scoring_hand and context.full_hand then
return {
chips = 1,
mult = 0,
message = "+1 Chip"
}
end
return { chips = 0, mult = 0 }
end,
}
which returns an error from SMOD
Which line brings up the error here
I'm kind of struggling to tell what this joker is supposed to do?
Can you explain
you are returning chips = 0, mult = 0 at the bottom with no context whatsoever
^
remove that
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
return {
chips = 1,
}
end
end,
your calculate should look like this
the other context r unnecessary
alright
ima keep you updated
testing now
it is
I see
Can anyone help with this btw
such a good joker
final plan is to make him score +7 mult per 7 rank card played and +50 for first card played in hand, also +5 mult if another joker is in the player's possesion
im just slight testing
how you set up the probabilities is wrong lol
to then see how I can make this go right
I'm not too skilled in lua
it should be if pseudorandom("j_seven") <= G.GAME.probabilities.normal/5 then
I don't really get that
Im only skilled in luau lol
and Holy it works thanks @manic rune
Shouldn't the right side of the equation be (typically) 1/5?
And pseudorandom returns whole numbers?
G.GAME.probabilities.normal is 1, 2, 4, etc, depending on whether you have oa6 or not
It's 2^(amount of oops held)
pseudorandom() returns a number between 0 to 1
G.GAME.probabilities.normal/5 is 0.2, so the code inside the if block will only go through when pseudorandom() returns a number below or equal to 0.2, which is essentially 1/5
oh, yeah, it doesnt work
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 7 then
return {
mult = card.ability.extra.mult
}
end
Not sure what's wrong with it though
those two if blocks run at the exact same context, and the first one takes priority over the second one
and since you are returning in the first if statement block, the second one wont go through
do you want them both to happen?
Yes
one sec
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 7 then
if not context.blueprint and pseudorandom("j_seven") <= G.GAME.probabilities.normal/5 then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
SMODS.calculate_effect({message = localize("k_upgrade_ex"), colour = G.C.RED, message_card = card}, card)
end
return {
mult = card.ability.extra.mult
}
end
this should work 🤔
all good, theres a bunch of stuff thats not documented anywhere so it will take a bit of time for you to figure out the workarounds :p
How do you make an entire area into comments
--[[
comments are all in here
]]
I'd like to preserve the part I had
you can highlight your code, press [ twice, and add the -- before the first [[
Hey, do you have useful doc pages for me in the SMODS doc that could help me about doing stuff like this? For exemple lets say I want it to trigger for the first card played only where should I look?
I've primarily dealt with websites in javascript so modding and gamedev is a completely new ballpark, but it's been fun to figure out so far
mostly logic stuff, you want to have something like if context.individual and context.cardarea == G.play and context.other_card == context.scoring_hand[1]
the contexts are all in the uhh Calculate section in smods documentation or smt
ohh I used context.full_hand[]
mb
thanks!
so scoring hand is the one played
full_hand is for all of G.play
alr
context.full_hand refers to the played hand, while context.scoring_hand refers to the scoring hand, so it really depends on what you want to use
oh
well
Im trying to get the played hand
well hold up
quick question, how to i get rid of the spaces betwenn each colored letters ?
the scoring hand
that would include cards that aren't part of the poker hand btw
My joker completely works! (except for the picture lol)
so A 10 7 would result in the scoring hand just being A, while full hand is A 10 7
is the one that is played when pressing play hand
right?
ohhhhh
okay
Got it
oh
didnt do anything
perhaps I did it wrong?
whats the code
bump, im specifically looking for the exact hex codes used
it doesnt have a hex code
its a gradient
its color is frequently updated in Game:update
i thought it used multiple though
card refers to the joker, use context.other_card instead
and cycled through them
This checking whether the first scored card is the same card as your joker
in the context.cardarea?
okay
so youre saying dark_edition doesn't have any code that tells it what colors to use?
if context.scoring_hand[1] == context.other_card then
where then?
oh
OH YEAH
Im so blind
lol
this is how dark_edition cycles its color
How do I un-toggle this. Really annoying
I'd like to be able to click in between my characters
I think its a thing near the home button
for me its pressing the button insert on my keyboard
of your keyboard
Idk how I keep toggling it
yeah this one
I see
same for me
I kept toggling it whenever I tried to backspace
thanks :3
I love balala too much to change the tag
im actually grateful
One last question, shouldn't this be taking the image from the 1x folder?
In-game it just appears as a regular jimbo
did you put the atlas in your SMODS.Joker
wait you can do https requests for Balatro with the API??
yes
someone did that for twitch, i think
Like, how
oh peak then
as simple as atlas = "j_seven" in your SMODS.Joker
mhm
Hey sorry again but despite looking in the documentation I can't find where to get the card rank played, do you think you know?
context.other_card:get_id(), this will return a number depending on its rank
2,3,4,5,6,7,8,9,10 -> its rank number
J,Q,K,A -> 11, 12, 13, 14
whats wrong here
seems like a SMODS.add_card gone wrong
it works fine when the the prefix was unchanged
whats the code?
alright thanks!
function Card:resize(mod, force_save)
self:hard_set_T(self.T.x, self.T.y, self.T.w * mod, self.T.h * mod)
remove_all(self.children)
self.children = {}
self.children.shadow = Moveable(0, 0, 0, 0)
self:set_sprites(self.config.center, self.base.id and self.config.card)
end
local mainmenuref2 = Game.main_menu
Game.main_menu = function(change_context)
local ret = mainmenuref2(change_context)
local newcard = SMODS.create_card({key='j_tngnt_you',area = G.title_top})
G.title_top.T.w = G.title_top.T.w * 1.7675
G.title_top.T.x = G.title_top.T.x - 0.8
G.title_top:emplace(newcard)
newcard:start_materialize()
newcard:resize(1.1 * 1.2)
newcard.no_ui = true
return ret
end
it was mvan_ before, but i changed it to tngnt
ignore it
jesus christ, hold on
its very likely that j_tngnt_you is not the correct key
lol
hey so is something like that gonna work?
if context.individual and context.cardarea == G.play and context.full_hand then
if context.scoring_hand[1] == context.other_card then
return {
chips = 50,
}
else if context.other_card:get_id(7) then
return {
mult = 7
}
end
end
end,
}```
remove the and context.full_hand check
alright
and also, elseif, not else if
No it’s not the same
With a space would require an extra end because it’s its own conditional block
I always though it was the same
man im such a dummie lol
for like
5 years?
😭
alright testing my joker now
Is it possible for me to create a new color for {C:} ?
It’s a lua quirk
So I used :GetId() and it score mult for each cards having a higher rank then seven
unless I missed something im not sure its supposed to be like that is it?
how do you make code that checks if your hand is made up of 5 cards of a specific enhancement
do i have to use for loops
experimenting more with smods.gradient, will this work on its own in the context of {C:} or G.C. or do i need something else to make them work like that
oh wait nvm it gives it right after
hm
how can i send a player to shop mid blind
yes
Card:get_id() returns the id of the card, you need to compare it with something otherwise it’s always true
theres a code card in cryptid that does that
ohhhh
okay thanks then!
i looked at it and some stuff inside is just jumbled custom code, is there any way to do it regular?
how do i give a custom consumable set the spectral shader?
No
🤷 idk, i havent checked its code
soooo like that?
if context.individual and context.cardarea == G.play then
if context.scoring_hand[1] == context.other_card then
return {
chips = 50,
}
elseif context.other_card:get_id(ID) then
if ID = 7 then
return {
7
}
end
end
end,
}```
or do I need to make a variable for it
is there any way to end the current blind (win but no money screen if possible) and go to shop, and have the blind not passed
elseif context.other_card:get_id() == 7 then
ive used smods.gradient before but im trying to figure out a solution that would let me use it as if it was a vanilla color/gradient
i believe smods adds the colour to loc colors regardless
you can use it in {C:echips}, i think?
could i patch into this?
-# never used SMODS.Gradient before, so
with your mod prefix
i feel like you can use set_ability instead of patching, not sure though
what if another mod wanted to give a card the booster shader though
try
G.FUNCS.draw_from_hand_to_discard()
G.STATE = G.STATES.SHOP
G.STATE_COMPLETE = false
i just want to draw a shader on my consumables like spectral
Use a draw step
so i was thinking of smt like
set_ability = function(self, card, initial, delay_sprites)
card.children.center:draw_shader('booster', nil, card.ARGS.send_to_shader)
end,
🤔 but maybe draw step is better
doesn't seem so
mm idk then
though
there seems to be a different effect if the key is correct to when its incorrect
if the key is correct it displays as pure black, but if its incorrect it's just balatro black
You need to add it to the colour tables yourself
Oh right it needs two values to change between
Does anybody know how to spawn sprites on the screen? Where would I start if I want to:
- display sprites taken from an atlas
- use conditionals that will change those sprites' textures
- remove those sprites
- consider them a "card" in order to use animations such as
flip()andjuice_up()
how the hell do i math.log10() a table of numbers, like, {100,50} (its 50100, this is for big nums)
:3
hmm no idea, i know if with the cash out ui displayed but not this one
i dont think G.STATE.SHOP exists
actually, i switched the table order around
if context.individual and context.cardarea == G.play and SMODS.has_enhancement(context.other_card, "m_stone") then
local stone_cards = 0
for _, scored_card in ipairs(context.scoring_hand) do
if SMODS.get_enhancements(scored_card) == "m_stone" then
stone_cards = stone_cards + 1
end
end,
if stone_cards >= 5 then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult,
xmult = card.ability.extra.xmult,
card = context.other_card
}
else
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult,
card = context.other_card
}
end
end
would this be correct? (i'm using stone as the specific enhancement here)
and i got this, its a bit inaccurate so im not sure if its the right approach
G.STATES.SHOP does
weird
i might be wrong, but doesnt SMODS.get_enhancements return a table of enhancement keys?
how can i modify the current blinds payout
you want to use SMODS.has_enhancement(scored_card, "m_stone") instead, its cleaner
they likely used SMODS.get_enhancements just to check if the card has an enhancement or not lol
my expected behavior: use consumable, round ends, no payout, straight to shop, after shop, blind hasnt been beaten yet, you need to rebeat the blind
its all in 1 function inside the G.FUNCS.evaluate_round
more details on this? and if i can skip this payout screen entirely
right now i can end the round but ill lose, is there an overwrite for this losing i can enable
idk what the 2nd line does i just included it because i thought it would work
Hey how can I detect if the player as a specific joker?
look at vremade stencil joker
it basically handles all the payouts from interests, blind rewards, etc, called when a round is ended.
imo its hard to modify it, so using G.STATES.SHOP instead of G.STATES.ROUND_EVAL should skip it, which is im trying to do
if its a mod could you link please?
thanks
maybe theres a function for setting game state?
Isnt it trying to see if the player as max joker?
or is it looking for a specific one and im just blind?
it also looks for other stencil jokers
i'm trying to make a joker that (with the certain stone conditions from earlier) gives X1.1 mult per stone card, with a bonus X0.01 mult for each level of high card. is there any better way to do this than just copypasting card.ability.extra.xmult + card.ability.extra.xmult_gain * G.GAME.hands["High Card"].level everywhere?
by setting G.STATE = G.STATES[soemthing] and G.STATE_COMPLETE = false, theres no other way afaik
it looks that that whole line just gives you the plain number of how many jokers there is lol
G.GAME.chips
does it?
aw dang it
like?
joker jokers?
oh
you can set it to G.GAME.blind.chips, which is the minimum chips
it works for me tho shrug
G.FUNCS.draw_from_hand_to_discard()
G.GAME.blind:defeat() --- defeat effect
G.STATE = G.STATES.SHOP
G.STATE_COMPLETE = false
so this should work right?
if context.individual and context.cardarea == G.play and context.scoring_hand and context.other_card then
local is_first_card = context.scoring_hand[1] == context.other_card
local is_seven = context.other_card:get_id() == 7
local result = {}
if is_first_card then
result.chips = 50
end
if is_seven then
result.mult = 7
end
if #SMODS.find_card("darkHazard", true) > 0 then
result.mult = (result.mult or 0) + 5
end
if result.chips or result.mult then
return result
end
end
end,
}```
if #SMODS.find_card("darkHazard", true) > 0 then
result.mult = (result.mult or 0) + 5
end
put in the SAME code you did and it didnt work
maybe since its running from a consumable
lemme try wrapping this in an event
tbh im not familiar with smods
@hidden sable?
BRUNGUS
include mod prefix
apparently there's an "unexpected symbol on line 328 near '='", but i have absolutely no idea what it is
SMODS.Joker {
key = "brown",
loc_txt = {
name = "Brown",
text = {
"{C:attention}-1{} Ante to win,",
"but shop prices are {C:attention}#1#%{} higher"
}
},
config = { extra = { percent = 40 } },
rarity = 3,
atlas = "Jokers",
blueprint_compat = false,
pos = { x = 4, y = 1 },
cost = 7,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.percent } }
end,
add_to_deck = function(self, card, from_debuff)
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.discount_percent = G.GAME.discount_percent - card.ability.extra.percent,
G.GAME.win_ante = G.GAME.win_ante - 1 -- line 328
for _, v in pairs(G.I.CARD) do
if v.set_cost then v:set_cost() end
end
return true
end
}))
end,
remove_from_deck = function(self, card, from_debuff)
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.discount_percent = G.GAME.discount_percent + card.ability.extra.percent,
G.GAME.win_ante = G.GAME.win_ante + 1,
for _, v in pairs(G.I.CARD) do
if v.set_cost then v:set_cost() end
end
return true
end
}))
end
}
(line 328 is marked)
show us the full error
extra comma behind 327
behind 327?
at 327, sorry
end of 327
ah
same down below
I'm trying to make a hologram shader for stickers (not a hologram sprite for a Joker, it's stickers) but for some reason they show up outlined like this? How do I fix it and make it look like the Hologram Joker?
SMODS.Sticker {
key = "operator",
loc_txt = {
name = "Operator",
text = {
"> AWAITING INPUT:",
"> G.PLAY"
}
},
atlas = "Stickers",
pos = {x = 4, y = 0},
default_compat = true,
draw = function(self, card, layer)
G.shared_stickers[self.key].role.draw_major = card
G.shared_stickers[self.key]:draw_shader("hologram", nil, nil, nil, card.children.center)
end
}
Never mind I fixed it, just had to make the sprites a bit more translucent
OK I DONT KNOW HOW BUT I GOT IT TO WORK
nice
only problem is this isnt properly returning
like if i get to the shop normally it works
but if i get to the shop from the card it doesnt
yeah it have some caveats
so ill need a custom return
it can be buggy if skiping instantly to shop
this is my code btw
try removing the draw_from_discard_to_deck
you think thatll fix the inblind?
what does context.repetition do
nope
nope, actually nvm that
i want to add a retrigger, and clearly this is the retrigger, but i'm not sure if it does weird stuff with context.individual
maybe have a bool that checks whether skateboard was used or not and if it was used dont let another use until it gets reset by a hook scanning for context.setting_blind
How would I go about adding a new card type, we got Jokers, consumables, regular playing cards, but I want to add a new one
context.repetition should be used to return number of times ontext.individual is evaluated, they are both different
works hopefully?
hopefully
i dont use smods, so not sure
you what
how to set chances on jokers?
for exemple 1 on 4 chance for the joker to give 5+ mult
it would look something like this for calculation:
if context.cardarea == G.jokers then
if pseudoseed("my_joker") < 0.25 then
local mult = 5
return {
message = localize({ type='variable', key='a_mult', vars={mult} }),
mult_mod = mult
}
end
end
change my_joker with something you want
No.
okay
@daring fern you probably know about this, why do i have to supply 2 images for every atlas
a 1x scale and then a 2x scale
i know it's for pixel smoothing but like
how does it smooth from that
and can't it just make the assets itself
just upscale the 1x
you have a texture scaling option in your settings, and balatro loads which one depending on that option
what do you use
how do i create a seal
I wonder how many mods will fight for that new cardarea's position
loadout?
It's my UI practice thing, it doesn't do anything yet
ah alright
Oh damn, are you making the coveted that part of the screen api?
alot
how do i check for displayed chip and mult under round score?
hand_chips and mult
Right somethingcom515 ?
Nah I copied someone's custom cardarea code
https://gist.github.com/dvrp0/c2581403576c4140e0224e47564e16c5
game crashing when using {V:1}text{}?
Log?
I made this code to duplicate a card with a seal when its destroyed but its not doing anything, whats wrong? lua calculate = function(self,card,context) print("0") if context.remove_playing_cards then print("1") for i = 1, #context.removed do print("2") if context.removed[i].seal and context.removed[i].seal.key == "seal" then for l = 1, 2 do print("3") local copy_card = copy_card(context.removed[i], nil, nil, G.playing_card) copy_card:add_to_deck() end end end end end
There’s no seal key thats named seal
card.seal is the key.
Context.removed[i].seal returns true or false in your case make it ==false or ~=true
No, it returns the key.
oh so its just card.seal == "seal_key"
Yes.
Has_seal ?
No.
Does it even exists
No.
I sent it idk if u saw
Because there are quantum enhancements but not quantum seals.
.
Code?
set_card_type_badge = function(self,card,badges)
local label = localize({ type = "name_text", set = "Enhanced", key = self.key, vars = {} })
badges[#badges+1] = create_badge(label, pg_sand_colour or G.C.WHITE, G.C.WHITE, 1.2)
end
How does this is enough to know with key in localization to get ?
Right now I am only getting "ERROR" with a blank description but i saw other mods that works well even when the name was "enh_mysuperenh"
idk why it linked to your message sorry xD
Did you return the values in loc_txt
j_dark_robloxStudio = {
name = '{V:1}Roblox Studio{}!',
text = {
'{C:attention}1 out of 6{} chances to loose your game every minute',
'will prompt a message before loosing',
'{X:mult,C:white} X10 {} Mult',
},
},
which??
In your code
I did
It still doesnt do anything, not even print the numbers
Show code
You need to return a colour.
In loc_vars
then I missed a step in the documentation
thanks for clarifying
both of you thanks
Your context is wrong i feel like
Code?
They were literally replying to their own code
No, I'm requesting the one with the changes.
Ah, my bad
calculate = function(self,card,context)
print("0")
if context.remove_playing_cards then
print("1")
for i = 1, #context.removed do
print("2")
if context.removed[i].seal == "seal_key" then
for l = 1, 2 do
print("3")
local copy_card = copy_card(context.removed[i], nil, nil, G.playing_card)
copy_card:add_to_deck()
end
end
end
end
end```
You need to change seal_key to modprefix_yoursealkey
But they don’t want that
They want to check if the destroyed card has a seal
Or not
but even if thats the problem it'd print the 1 when any card is destroyed, which is not happening
Not a specific seal
i want to duplicate a card with a seal when its destroyed
this is the entire code lua SMODS.Seal{ key = "shoomimi_seal", loc_txt = { name = "Shoomimi seal", label = "Shomimi seal", text = { "When this card is {C:attention}destroyed{},", "create {C:attention}two{} copies of it"}}, badge_colour = HEX('8CE6BD'), discovered = true, unlocked = true, calculate = function(self,card,context) print("0") if context.remove_playing_cards then print("1") for i = 1, #context.removed do print("2") if context.removed[i].seal == "shoomimi_seal" then for l = 1, 2 do print("3") local copy_card = copy_card(context.removed[i], nil, nil, G.playing_card) copy_card:add_to_deck() end end end end end}
Does anybody know how to spawn sprites on the screen? Where would I start if I want to:
- display sprites taken from an atlas
- use conditionals that will change those sprites' textures
- remove those sprites
- consider them a "card" in order to use animations such as
flip()andjuice_up()
How would I force a player to loose or win his game?
This doesn’t sound correct
Is it even possible to do so?
Yes.
how then?
i did it like this , is it alright?
Yeah
how do i check if played hand contains only a specific rank?
for example only aces or only 4's
key = "deardanielsr", --minda note: fix blueprint not working properly even though it's compatible
loc_txt = {
name = 'Dear Daniel',
text = {"{X:mult,C:white}X4{} Mult if",
"played hand contains",
"a {C:red}King of Hearts{} and",
"a {C:red}Queen of Hearts.{}",
"If {C:red}Hello Kitty{}",
"is in your deck,",
"{X:mult,C:white}X8{} Mult instead,"}
},
pos = { x = 0, y = 0 },
rarity = 2,
atlas = 'sanriocards',
blueprint_compat = true,
cost = 6,
config = { extra = { Xmult = 4, Xmultkitty = 8, Xmultreset = 4 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult, card.ability.extra.Xmultkitty, card.ability.extra.Xmultreset } }
end,
calculate = function(self, card, context)
if next(SMODS.find_card("j_srio_hellokittysr")) and next(SMODS.find_card("j_srio_deardanielsr")) then
card.ability.extra.Xmult = card.ability.extra.Xmultkitty
end
if not next(SMODS.find_card("j_srio_hellokittysr")) and next(SMODS.find_card("j_srio_deardanielsr")) and card.ability.extra.Xmult == 8 then
card.ability.extra.Xmult = card.ability.extra.Xmultreset
end
if context.individual and context.cardarea == G.play then
for i = 1, #context.scoring_hand do
if context.other_card:get_id() == 12 and context.other_card:is_suit("Hearts") then
card.ability.extra.kings = true
elseif context.other_card:get_id() == 13 and context.other_card:is_suit("Hearts") then
card.ability.extra.queens = true
end
end
end
if context.joker_main and card.ability.extra.kings == true and card.ability.extra.queens == true then
card.ability.extra.kings = false
card.ability.extra.queens = false
return {
Xmult = card.ability.extra.Xmult
}
end
end
}```
is there any code in this joker that prevents it from working properly with blueprint?
does context.individual checks only scoring cards, or both scoring and non-scoring cards?
you limit the targets by checking the cardarea
Checks every card if you don’t limit
G.play means the scoring cards get checked, "unscoring" means unscoring gets checked
G.hand means hand gets checked
if a mod enables the deck as a target, the deck gets checked too
to check for scoring
im having a problem with my tracking for jokers , i have 3 jokers and i got the reward but it still shows 2/3 for some reason
what way are you supposed to format the deck type line?
i know this is wrong at least but whatever i try balatro just keeps telling me i need to put } expected near = on 1030
good quesiton, you can basically seperate jokers as single files right?
please tell me there is a better way to do this
(trying to make the calculate function only pass if played hand contains four 4s only)
is there a way to specify what rarity is the card we wish to create through create_card? (i.e. i'm trying to create a legendary joker)
anyone know how to fix this?
how to modify hand size via jokers?
i believe this is what i used to make a rare card
local card = create_card('Joker', G.jokers, nil, 0.99, nil, nil, nil, 'wra')
not sure for legendary though sorry
nevermind there's quite literally an attribute called "legendary" for what i was looking to do
but thanks nonetheless
You reset the kings and queens variables of your Joker the moment it activaes. Therefore, they are both false after your card does its thing once, and any copy attempts can, at most, set one of those flags to true again.
I think to solve this, contain the parts that set your card's extra fields within not context.blueprint checks so they don't have to run more than necessary. And, put the check to reset the kings and queens fields if they're both true, only at the very start of the calculate. So: The main Joker can find out that they're both true, give any Copiers their own turns to give out the mult, and then reset both to false once the original joker gets its next turn to execute.
reason i'm trying to add this deck type code is cuz when i go to play without it, the challenge uses my last used deck instead of the challenge deck
figured it out nevermind
if #G.play.cards ~= 4 then return end
for _, playing_card in ipairs(G.play.cards) do
if playing_card:get_id() ~= 4 or SMODS.has_no_rank(playing_card) then return end
end
-- If code continues to run, it is only because any non-4 IDs were not found. Continue your code from this comment.
thank you
anyone know how to fix this ples?
anyone?
⬆️
thank you
You’re the real kaiba right ?
im yusei
what are you trying to do
basically keep track of how many jokers you get in the ante
its an objective for my joker
and what's the problem
hi N'
hiiii
the problem is the text of the tracking says 2/3 but i have 3 jokers in my joker slots
oh yeah, how do i check if a new run is made? 🤔
like the reward is rewarded but the text is just stuck at 2/3 lol
wouldn't you hook game.start_run?
doesnt that also include resuming an old run
shouldn't you change jokers_amount before setting the objective's text
probably did it wrong
this has a run start argument
https://github.com/Steamodded/smods/wiki/Mod-functions#modreset_game_globalsrun_start
im p sure, yes
Remove the whole (remove from deck function)
so under the calculate function?
i guess i can try that
Remove from deck triggers when joker is sold or destroyed

Oh no N is getting old....
ohhh
what!
did
did you think it was for new runs only
Each time he helps someone he grows one day older
!!
Add to deck , when joker obtained
so I take both of them?
add_to_deck = function(self, card, from_debuff)
G.hand:change_size(card.ability.extra.h_size)
end,
remove_from_deck = function(self, card, from_debuff)
G.hand:change_size(-card.ability.extra.h_size)
end
wtf!
i pray for your restore
You just need G.hand:hand_size()
Thats your hand size
Giving it a number will add that number
is there a way to create a random skip tag?
and when joker is destroyed it sets back to normal?
or manualy do a function to give back the normal hand size?
You need to add remove from deck for that
If yourcontext
Change hand size (store the addition amount in config )
And when you remove from deck
Do G.hand:hand_size(-config variable )
isn't it just G.real_dt
yeah its just G.real_dt
oh, thanks
how can i make a joker not show in a booster pack
Remove it from pool
wouldnt it remove it from the shop as well
yeah
what do I replace with JoyousSpring?
return not args or args.source ~= 'buf' in in_pool
your own global table or just make it a local function
oh ok
I wonder if it's possible to put a cardarea into a UI window
Yes
I found a wizard who did it
The game does it already
Also poker hands
Since a lot of mods fight for that new consumable slot
Also the collection
I figured I could make the "Loadout" button have some use
Is it also possible to make the UI window transparent?
I think the shop is a UI window too
keep in mind any cardarea in an overlay window gets destroyed immediately after so you need more logic for it
I want to create some sort of a dropdown menu
Well damn
check the extra deck in JoyousSpring
i have a button to open a cardarea
Oh damn
Yeah I wanna do something like
Maybe Bunco too
yeah that's not that hard
I think one of bepis’ mods might have something similar
@merry raven I have a suggestion
Don’t use an UI window
Just hide the area offscreen
And move it
Like the hand moves down when you play a card
Sounds easy on paper, but I have never touched on anything related to card areas nor animation
I have this in my mod that does what victin says
https://youtu.be/79484CmfhvU?t=18m19s
you should try this out:
https://github.com/nh6574/JoyousSpring
My Website:
►https://thempireiain.neocities.org/
Patreon:
►https://www.patreon.com/ThempireIain
Twitch:
►https://www.twitch.tv/thempireiain
Ko-fi:
►https://ko-fi.com/thempireiain
TCGplayer Affiliate Link:
►https://tcgplayer.pxf.io/3eO9Ak
Bandcamp:
►https://lunacharskysr...
That extra consumable slot is copied from another mod from a gist
The movement is handled by the game
So you’d just need to look how the Hand moves
Or whatever N’ does
This one?
Oh, is that hidden offscreen?
the extra deck is yes
hmmm
I’m suggesting to just move it because then you don’t need an UI window
And you don’t need to make it transparent
You just need to move the CardArea
Oh another one: Vouchers
What about em
Another example of CardArea inside an UI window
You can look at how the shop is moved off screen, I’m pretty sure it’s always just off the bottom of the screen
Or maybe that’s just when you open packs and redeem vouchers
this is not working
it only shows the mod ones in booster pack
doesnt show the others
I'm making a joker where each played 6 gives +6 chips and +6 mult, and the code works perfectly except the text for the additions seems to happen at the same time, and so do the additions and animations. I don't want this; I want it to happen more like Scholar where the Chips happen first and only once that's done does the Mult happen. All I think I need is a pause, but I don't know how to do this
You can pop the text outside of calculate, let me find an example
Okay so not outside calculate, but before return INSIDE calculate
card_eval_status_text(card, "extra", nil, nil, nil, {message = '+30 Chips', colour = G.C.CHIPS})
You can do this for each message you need seen
I tried that, but it makes the joker say those things and not the card, and the chips and mult are still added simultaneously
Now, how do I load in a single image for a joker?
Bro I can't read 😭 I completely missed the edition part of your message
which desc?
Of the joker
How are you doing it?
calculate = function(self, card, context)
-- Individual card scoring
if context.individual and context.cardarea == G.play then
-- Check conditions for this rule
if (context.other_card:get_id() == 6) then
return {
chips = card.ability.extra.chips,
extra = {
mult = card.ability.extra.mult,
colour = G.C.MULT
}
}
end
end
end
Do you need the extra?
its already like that
yeah bur
though there is a playSound right up
i might be alone in this but the way SMODS handles what things it does automatically and what it doesnt do automatically is quite confusing at times
okay
Basically it adds extra sound every time and it becomes wonky thats why
sure
I might be stupid
no ur not
That worked! Thank you very much ^^
depsite me having some experience in lua im struggling just for balatro mods lol yet you do it better
didnt know mods were that hard to do
Hardest thing is implementing your ideas lol
Check for key typo maybe
message = localize('k_upgrade_ex'),
sound = 'MyMod_UpgradeSound',
}```
yeah perhaps
what about the chips and mult?
inside too?
how can i give a baffon pack ?
Chips = value
Returns the value of additional chips
Same as mult
xchips= return xvalue of chips
so
Return {chips=60}
Adds 60 chips
Make sure its lower case tho
Lmao
Why are you return results.message ?
If you want to display a message you can do
Message=“your message”,
In return
for some reason sometimes doing result.message worked instead of just message
but ima follow ur advices
Config={extra={variable1=variable2=}}
anyone know how i can give a random buffoon pack?
is there a way to make jokers perishable in challenges, tried this but it didn't work
{ id = 'j_stuntman', stickers = {"perishable"} },
also tried
{ id = 'j_stuntman', perishable = true},
but neither one worked
alr ima play test
Add message_card=card so the message displays on joker and not card (optional)
thanks
noted too
didnt know that
how can i make an edition shader?
Oh boy
IT WORKS
FINALLY
How do i tell you
yeah ik it's hard


