#💻・modding-dev
1 messages · Page 413 of 1
okay, so you know G.hand.highlighted? is there a way to do that for jokers?
i can't imagine that G.jokers.highlighted is a thing
it is

am i doing this right?
trying to make text update as time goes on like misprint
hi! there are some things that im having some trouble finding the localization stuff for
image 1: the consumable type name in the collection screen
image 2: the part that's supposed to say "X pack" at the bottom of the pack screen
anyone know how to make engulf not crash my game when entering a shop other than just disabling it?
Bump
How could I reset all this for every new run? I'm trying to make a chellenge deck that starts with one random card each time.
local function set_start_card()
split_suit = pseudorandom_element({"S", "H", "C", "D"}, pseudoseed(("willatro_split")))
local _rank = math.random(2, 14)
if _rank < 10 then
split_rank = _rank
elseif _rank == 10 then
split_rank = 'T'
elseif _rank == 11 then
split_rank = 'J'
elseif _rank == 12 then
split_rank = 'Q'
elseif _rank == 13 then
split_rank = 'K'
elseif _rank == 14 then
split_rank = 'A'
end
end
honestly props to all the guys that are basically always in this channel idk how they do it
like without going insane
updated function, shows correct numbers and letters in game before the description
however it still doesnt update the description
im asorry fro asking this but can someone help me with a joker
i didnt want to give up and ask someone else to make ti but ve been siting here for hours
need a quick sanity check:
var = 'test'
type(var) == 'string'
this is a thing i can do, right? do i have something wrong here
or would type() have a different return in this case
type(var) should return 'string' in that case, yeah.
For problem 1, you need a loc_txt in the SMODS.ConsumableObject (works the same as one in a joker)
Dunno ‘bout two. Haven’t gotten that far myself. Sorry
is it possible to turn a joker into a joker that isn't present? like for example, say i had a joker cardarea that just contained the base joker and i wanted to turn it into a completely different joker.
like say i wanna do the sequence flip joker face-down, change it into... idk, half joker, flip it face-up again.
is that a thing that's doable

getPosition is there
yeah, seems like getPosition is what you want, no underscore, camel case
i guess the simple implementation here could be to
flip the joker,
then create the joker i want but not in a way that actually emplaces it into the card area - but instead set the joker as that joker, but face-down,
then flip the joker face-up again

Hello, im starting with modding and I want to do a Joker with the ability to reactivate all the played cards but only when all the five cards played are diamonds, this with a chance of 1/4, I only need it to verify that all the cards played are diamonds
Any idea?
1/4 to retrigger all scoring cards if 5 Diamond cards are played?
Or individual 1/4 chances?
All scoring cards in the played hand
...does each Diamond card have the 1/4 chance to be retriggered or is the 1/4 chance for the entire scoring hand to be retriggered?
Oh
how do I go by disabling a joker, and then re-enabling it after defeating a boss blind
look into SMODS.debuff_card https://github.com/Steamodded/smods/wiki/Utility
Its for the entire scoring hand
Wait...
imo the best way would be to first do a thing in context.before that starts with setting a boolean in the extra table to true, loops through the hand checking if the cards are not diamonds. if it finds a non-diamond card, it sets the boolean false and breaks the loop
then outside of the context.before you do a check on that boolean with a context.individual and context.cardarea == G.play check, in which you just return { repetitions = 1 }
lemme see if i can't whip something up that you could toy with
-# Was writing similiar text all this time, too slow- 😂
My wall of text be like:
In context.before, iterate over context.full_hand to check :is_suit('Diamonds')... if all are Diamonds, set a card variable (card.ability.extra.alldiamonds, for example) to true to reference later.
Alongside context.cardarea == G.play and context.repetition and not context.repetition_only, you also do and card.ability.extra.alldiamonds that we set earlier.
Then, after hand is played, with context.after, card.ability.extra.alldiamonds should be reset to false or nil.
disagree on the implementation. i don't think the context.after stuff is needed either since the context.before stuff will always handle what state the bool should be, so it seems redundant
¯_(ツ)_/¯
is this the right string??
calculate = function(self, card, context)
if context.before and context.main_eval then
card.ability.extra.retrig_dia = pseudorandom('resonant') < G.GAME.probabilities.normal/4
if card.ability.extra.retrig_dia then
for i = 1, #context.full_hand do
if not context.full_hand[i]:is_suit('Diamonds') then
card.ability.extra.retrig_dia = false
break
end
end
end
end
if context.individual and context.main_eval and card.ability.extra.retrig_dia then
return { repetitions = card.ability.extra.repetitions }
end
end
...i think this is all you need?
oh whoops, the 1 in 4 
was too focused on making the repetition work that i forgot about the condition
there you go
I see
I dont know too much about Lua and the functions
But thank you anyway
Oh, thanks thanks
what you pass into the debuff arg should be the boolean state of whether you want the debuff or not, true being the card debuffed and false being undebuffed
the source arg should be a string that you make up that is associated with your joker.
you make two calls, one with debuff being true when you want to debuff your joker and one with debuff being false when you want to remove the debuff. the source should be the same string each time. what it says about reset is just a string that can be passed in to force remove all debuffs that have been applied by that function
me neither
bump
card:set_ability("j_key")
it's THAT easy?!
yes
question -
myFunnyFunction = function()
return { myFunnyVar = 'myFunnyString' }
end
local getMyFunnyVar = myFunnyFunction().myFunnyVar
is that a thing i can do
or do i have to call the function and get its return table into a variable first
Probably.
Ok! So! I found out how much of an idiot I am for not knowing exactly what Moveables and Nodes are. Now my problem is that these functions are not going off for some reason and I really do not know why 😭
some quick cursory shenanigans say yes
This is basically exactly how Card objects handle it so idk what gives
tip: use debug prints
yeah, would need more information on the initialisation and structure of G.SPLASH_MAXIMUS_LOGO to understand the nature of the issue 
it could be that when you're setting up the moveable, something isn't going as you expect
G.SPLASH_MAXIMUS_LOGO is a Sprite object (which is an extension of Moveable, which is ALSO an extension of Node which houses these functions)

in which case yes, you need to drill deeper with debug prints and evals
because that doesn't make sense to me why those functions aren't firing
No kidding lmao
My current theory is that for whatever reason, the Controller object (my mouse) cannot target it for some reason, but I have no clue why 😭
thunk issue
how should I make the debuff true cause my mind is not wrapping around how to make it true
for instance, if i wanted to debuff the leftmost joker, i would do SMODS.debuff_card(G.jokers.cards[1], true, 'mySourceStringHere')
and then to remove the debuff later SMODS.debuff_card(G.jokers.cards[1], false, 'mySourceStringHere')
whats the thing in the G.UIT.T's config that rotates the text again
what are you trying to do here
when a gold card is played, debuff the joker until the boss blind is beaten
the problem with that, if you got it working, is that you need to undebuff the joker externally because calculate won't be called on a debuffed joker
so the joker would debuff but never be removed
i recently wrote a joker that debuffs itself based on a condition
isnt the third arg supposed to be a string
yes
what i ended up doing was just designating an "auto end of round undebuff" source and hooking SMODS.calculate_context to go through each joker at the end of round and debuff any jokers debuffed by it
anyway, as far as getting debuffing itself working
your condition isn't entering because playing_card isn't a thing.
ohhh
instead of having that check in the if statement, loop through context.full_hand similar to what i wrote here and in that loop you wanna be looking for SMODS.has_enhancement(context.full_hand[i], 'm_gold')
then debuff the joker once that gives you the hit you're looking for.
but as i said, writing a condition to remove the debuff in the joker itself won't work
i wonder why people use for i = 1, #context.full_hand do instead of for i,v in ipairs(context.full_hand) do
well, either works
the latter's probably better. i guess the more manual integer loop is habit
fair
so itd be like this
no 
morning
so this is purple seal code
SMODS.Seal {
key = 'Purple',
pos = { x = 4, y = 4 },
badge_colour = G.C.PURPLE,
calculate = function(self, card, context)
if context.discard and context.other_card == card and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = function()
SMODS.add_card({ set = 'Tarot' })
G.GAME.consumeable_buffer = 0
return true
end
}))
return { message = localize('k_plus_tarot'), colour = G.C.PURPLE }
end
end
}
how do i make it when played instead of when discarded?
@daring fern
well you're gonna have to change the if context.discard to something else
I think it's gonna be if context.cardarea == G.play and context.main_scoring
if you check the wiki, there's a good chance it'll be there 👍
im new to coding lua so
same
have it open 24/7
checking it every line
solid
man how i wish for a partner to work on my project 😩
gonna be so much help
got a repo?
whats wrong with the spectral code, when i use it game crashes?
repo?
like a git repository to share your mod with other people
how new are you to programming in general? Genuine question
so i used to code in C# and C++
also learned java for a while
forced to know paython for uni
so coding in general i have a good basis
but never learned lua
what's the error?
generally, if you hover over the squiggly lines it'll let you know what's going on that's wrong
but since it's yellow and not red, I doubt they're crash-worthy bugs.
Do you mind sending your crash report?
ah ok.
well, I recommend looking up github and getting used to it because it's a really useful tool for sharing and saving your code
is there a VSC Balatro library plugin ?
i have github account
set seal is breaking
ah, so you just didn't recognize the abbreviation for repository
alright
We have to drill it into our minds lol
you probably have to change this part to s_modprefix_Blank or something
maybe, will try it
what's your mod prefix
s_Seals_Blank?
yeah
weird prefix tho
nope
show?
bad at naming, dont judge lol
no, I mean the name of the seal
They're applying a seal
there you go
I'm being stupid lol
show?
oh
s_Seals_Blank
i can stream if u are to a VC...
would be the full name
tried that
hm ok
and with c_
can we see the Seal registering
localiztion?
all of it
including the seal definition
bruh
ok well I see the issue lol
i dont lol
You have Seals in the key lmao
change key = "Seals_Blank" to key = "Blank"
or that
and then the s_Seals_Blank should work
preferably do that
yep
no s_
oh, interesting
is there a wiki page about type prefixes?
j_ for jokers, c_ for consumables, b_ for decks, bl_ for blinds, v_ for vouchers........ uhh
decks being called "backs" is still funny to me
yeah because card back
the s:2.0 isn't scaling the text properly, and I've searched through SMODS wiki trying to find out why
look youll have to tussle with thunk for that if you want it changed
do not put spaces in any styling brackets
I prefer to stay living
That actually fixed it.
Thanks
still no
when people make a type of blueprint joker, do they retrigger the card or inherit the card cause i cant really figure out how one would inherit the card
here's VanillaRemade's code for blueprint
ok great thanks
Kinda niche question but would it be possible to have a gif as a custom joker asset without having to modify anything major?
You cannot use a GIF but you can animate a joker.
I thought you said "Is it possible to ..."
what are the three variations of the return for xchips
x_chips, xchips, Xchip_mod
thanks
regular chips and mult only have one return variation right? or are chips_mod and mult_mod also valid returns and would need to be accounted for?
There is mult, h_mult, mult_mod also for chips.
interesting
but isn't h_mult for mult held in hand?
or is it the same regardless
No, it's for vanilla support.
what does that mean
mult is the exact same as h_mult in returns.
what context do i need to use to see if a joker is getting destroyed? the joker im making needs to do stuff when it gets destroyed but i cant figure out the right way to go about it
does that mean i need to account for it in a hook or no
What are you trying to do?
hooking the effect return of jokers (which i already have the major code for, i just need to make sure all my bases are covered in terms of the ways that chips, mult, xchips, and xmult are expressed in the code. i already have xmult (and now xchips), i just need mult and chips).
banan
banan
like you have to grab the blind chip to see how much potassium you have
how would you go about telling if the blind chip was moved
Just another unjunkify idea: replace all custom indicators as numbers and display what there numbers means on hover, so you have much more space for displaying all of them
what is this?
how do i get the text inside here? (would be nice to figure out why the box isnt semi-transparent too)
- Set id for element with text
- Use object
Also, exist function adjust_alpha(color, new_alpha)
a crash
I probably set this up wrong, but how do I get a joker to basically give +^1 during the main scoring of a hand, and then at the very end the emult is applied to the mult?
(I have talisman)
Remove the card.ability.extra.emult = 0
oh, that's it?
does everything else work as intended at this point?
it does not
I need that emut reset back lol
if context.before then card.ability.extra.emult = 1 end
actually I think it needs to be 1
since ^1 does nothing
fixed it on my version, but I appreciate the help 🫡
mm thanks
i want to start modding the game and i already have a few ideas in mind, but i dont know how to (i tried following a guide but i didnt understand it), can someone help me?
How do you check if a certain joker exists in your joker area?
if next(SMODS.find_card("j_modprefix_key"))
thank you
can I use that to transform a card into a Stone Card ? if yes, what am I supposed to put as arguments ?
"m_stone"
m, stone, delicous
it worked thanks ✨
is it possible to make some consumables spawn more than others in boosters ?
(custom booster)
<@&1133519078540185692>
🔫
epic, thank you :3
Is there a quick way of getting a blind's key from its name? G.GAME.last_blind only has the name, for example, but I'd prefer to handle keys
my consumable is not working , keep crashing the game when used
actually, nevermind
it somehow worked on its own
Im watching you
G.GAME.blind.config.blind.key
started a joke mod with some friends yesterday
nice ty
How do I do the (Currently +[Number] [whatever]) thing?
i want this to add tarots or planets
for now its just tarots
how do i do -- or planet--
iirc Tarot_Planet is a set
does anyone have a website dedicated to their mod? I'd love to take a look for inspo
yes, but uppercase P
No, set = "Tarot_Planet"
How do you modify stuff like UI?
That feels pretty broad, what about ui are you trying to modify
dont know if im unlucky or is it just not working, but im only getting tarots
i think its not working
are there any mods that modify it? (the blind ui)
area = G.consumeables
many, yggdrasil, paya's, grim, polterworx iirc
{set = "Tarot_Planet", area = G.consumeables}
You're just checking if the buffer is less than the limit.
i should add if its above limit do nothing?
You need to do (#G.consumeables.cards + G.GAME.consumeable_buffer) < G.consumeables.config.card_limit
where do i add that?
It replaces G.GAME.consumeable_buffer < G.consumeables.config.card_limit
what does the localize do in the end?
message = localize .......
it grabs the text from the localization with the specified key
i see
ok so i made same code for spectral seal, but i want to add 1/3 chance to trigger
and 1/6 chance for destroy
how do i add that?
what do I need to put here to access the cards in the played hand ?
context.full_hand
*scored cards my bad
context.scoring_hand
thanks !
that make me crash :c
Code?
You need a context check.
How do I make a +hand and/or +discard be for the rest of the run?
(that's an enhancement btw, not a joker)
context.before
fixed ! thaanks !
these should not be happening, right? it's supposed to say (Currently [symbol][number] [Chips or Mult])
What does your loc_vars look like?
...loc_vars?
what's your config and loc_txt too
hi dilly
(the card's based on one of my characters and it's rare that's why it might be kinda OP)
does anyone know how you would display a random hand in the joker description (and maybe random rank if i havent figured it out yet) thanks
that's not how you add variables, you'd do {C:inactive}(Currently +#1# Chips) where the #1# corresponds to the 1st value sent to the vars list in your loc_vars function
Okay
what program is this?
Visual Studio, the non-comm version
I just made it blue with a theme
wait, that should start at one.
(different Joker)
oh it's just displaying the wrong one
whoopsie
im using notepad++ right now and that just ooks a lot cleaner
or it might just be my code lmao
so if I want a joker to affect hands at the start of a round, rather than current hands, what do I do?
Also the actual scoring thing doesn't seem to do anything. The variables are working but the jokers don't score anything.
what's your calculate function
genuinely i have no clue what's going on here I just used jokerforge
ive never personally used g.jokers in my ifs
also you don't need to put extra{} in your return since that should already be defined earlier in the joker code
no, that's fine
the extra is for giving multiple effects in one return
so it will give chips first, then mult, then x mult
oh then ignore me, i didn't know that lmfao
once you have it working i recommend you use mult instead of mult_mod which automatically creates the message for you, so you can remove message too and make it more readable and easier to understand for you
same with chip_mod and chips and Xmult_mod with x_mult
how do you know all the functions and stuff for balatro?
So one of them has this
How do I make that until you get rid of the Joker rather than current round
JokerForge and Kristal modding, mostly
The rest I'm either asking here or improvising.
what is jokerforge
do you have a link to those?
I see, it's probably a bit outdated if it's making this kind of code but if it works it works ig
From what I've read from this server, it's a WIP
woah joker forge makes this 100% easier
It still isn't doing it.
this @daring fern
what does it look like now
your entire joker if possible
I've got
return {
chip_mod = card.ability.extra.chips,
message = localize{type='variable',key='a_chips',vars={card.ability.extra.chips}},
colour = G.C.CHIPS
}
end
end
}```
and
``` if context.joker_main then
return {
chip_mod = card.ability.extra.chips,
message = localize{type='variable',key='a_chips',vars={card.ability.extra.chips}},
extra = {
mult_mod = card.ability.extra.mult,
message = localize{type='variable',key='a_mult',vars={card.ability.extra.mult}},
colour = G.C.MULT,
extra = {
Xmult_mod = card.ability.extra.Xmult,
message = localize{type='variable',key='a_xmult',vars={card.ability.extra.Xmult}},
colour = G.C.XMULT
}
},
colour = G.C.CHIPS
}
end
end
}```
for the two jokers' scoring
for the first one can you try return { chips = card.ability.extra.chips }
Well it's still not doing anything
what steamodded version do you have
are you starting a new run
,,,,I was about to ask if I should be
you should if you ever change your joker's config
yes you have to respawn the joker, in my experience
if you just reload the same run its the old version
like this? because this didnt work for me
what do i change to make this work?
if context.joker_main then
return { Xmult = card.ability.extra.Xmult }
end```
pretty sure its Xmult_mod
,,,nope, apparently not
thats what i use for mine, did you start a new run and respawn the joker?
Yes, I did
oh, also make sure you add card = card, pretty sure you have to specify where the effect takes place in the return
card = card isn't required. xmult works unless you have something else that is not letting the variable through.
Here's the entire scoring part
if context.cardarea == G.jokers and context.joker_main then
-- Check conditions for this rule
if check_count_eq_5_played(context) then
-- Pre-return code execution
card.ability.extra.MultAdd = (card.ability.extra.MultAdd or 0) + 50
return {
message = "+"..tostring(50),
colour = G.C.MULT
}
end
end
-- Main scoring time for jokers
if context.cardarea == G.jokers and context.joker_main then
-- Check conditions for this rule
if check_count_eq_1_played(context) then
-- Pre-return code execution
card.ability.extra.MultX = (card.ability.extra.MultX or 0) * 2
return {
message = "x"..tostring(2),
colour = G.C.MULT
}
end
end
-- Main scoring time for jokers
if context.cardarea == G.jokers and context.joker_main then
-- Check conditions for this rule
if check_count_eq_3_played(context) then
-- Pre-return code execution
card.ability.extra.ChipsAddO = (card.ability.extra.ChipsAddO or 0) + 100
return {
message = "+"..tostring(100),
colour = G.C.CHIPS
}
end
end
-- Main scoring time for jokers
if context.joker_main then
return { chips = card.ability.extra.chips }
end
if context.joker_main then
return { mult = card.ability.extra.mult }
end
if context.joker_main then
return { Xmult_mod = card.ability.extra.Xmult }
end```
-# code partially made by jokerforge and partially put together with help from here
naily pfp
Merge the tables of joker_main if you want all 3 effects.
return { chips = card.ability.extra.chips, mult = card.ability.extra.mult, xmult = card.ability.extra.Xmult }
yeah you can't have multiple returns under the same context, cuz once it hits a return, anything under that that could've triggered won't execute
Okay, thank you!
What would happen if a given Xmult is negative? Would the score get subtracted with the negative hand score?
what all did you change from that posted code block
i replaced the last 3 if context.joker_main etc with
if context.joker_main then
return { chips = card.ability.extra.chips, mult = card.ability.extra.mult, xmult = card.ability.extra.Xmult }
end```
its likely all of the returns that only return text, you can still have those function without returning by using SMODS.calculate_effect
if context.cardarea == G.jokers and context.joker_main then goes off first.
card = card,
message = "SAFE!",
colour = G.C.MULT
})
return {
card = card,
message = "X".. card.ability.extra.Xmult .. " Mult",
Xmult_mod = card.ability.extra.Xmult,
colour = G.C.MULT
}```
...so currently it'd only apply on hands of 4 or 2 cards?
heres an example from a working joker of mine
i use SMODS.calculate_effect to display text i want, then i just do a single return for the values i need
cuz again, once a joker returns, it won't execute any code after that point
No, it would do nothing.
So uh
-- Check conditions for this rule
if check_count_eq_5_played(context) then
-- Pre-return code execution
card.ability.extra.MultAdd = (card.ability.extra.MultAdd or 0) + 50
SMODS.calculate_effect({
card = card,
message = "+"..tostring(50),
colour = G.C.MULT
})
end
end
-- Main scoring time for jokers
if context.cardarea == G.jokers and context.joker_main then
-- Check conditions for this rule
if check_count_eq_1_played(context) then
-- Pre-return code execution
card.ability.extra.MultX = (card.ability.extra.MultX or 0) * 2
SMODS.calculate_effect({
card = card,
message = "x"..tostring(2),
colour = G.C.MULT
})
end
end
-- Main scoring time for jokers
if context.cardarea == G.jokers and context.joker_main then
-- Check conditions for this rule
if check_count_eq_3_played(context) then
-- Pre-return code execution
card.ability.extra.ChipsAddO = (card.ability.extra.ChipsAddO or 0) + 100
SMODS.calculate_effect({
card = card,
message = "+"..tostring(50),
colour = G.C.CHIPS
})
end
end
-- Main scoring time for jokers
if context.joker_main then
return { chips = card.ability.extra.chips, mult = card.ability.extra.mult, xmult = card.ability.extra.Xmult }
end```
Would this work? Or do the other ones NEED returns?
well you could reduce redundancy by having all of those conditionals under a single if, but as long as your if statements work i think it would yeah
Also do I need to reopen the game every time or can I just like. start a new run
reopen
it gets tedious, i know
i appear offline on steam so i don't constantly pop up for friends lmao
i'm trying to make a consumable but idk what the context would be for using it
the idea is that the consumable will transform a selected joker (this doesn't work with all jokers unfortunately) into a quote-unquote "parallel counterpart"
ohh
so you use "use" instead of "calculate"
okay so it still doesn't apply
-- Check conditions for this rule
if check_count_eq_5_played(context) then
-- Pre-return code execution
card.ability.extra.MultAdd = (card.ability.extra.MultAdd or 0) + 50
SMODS.calculate_effect({
card = card,
message = "+"..tostring(50),
colour = G.C.MULT
})
end
if check_count_eq_1_played(context) then
-- Pre-return code execution
card.ability.extra.MultX = (card.ability.extra.MultX or 0) * 2
SMODS.calculate_effect({
card = card,
message = "x"..tostring(2),
colour = G.C.MULT
})
end
if check_count_eq_3_played(context) then
-- Pre-return code execution
card.ability.extra.ChipsAddO = (card.ability.extra.ChipsAddO or 0) + 100
SMODS.calculate_effect({
card = card,
message = "+"..tostring(50),
colour = G.C.CHIPS
})
end
return { chips = card.ability.extra.chips, mult = card.ability.extra.mult, Xmult_mod = card.ability.extra.Xmult }
end
end
}```
It adds the things, but doesn't apply
so by adds the things, like its hitting the card.ability.extra modifications under each check_count?
Yeah.
are the calculate_effects working too? it should be popping messages under the joker itself if it is
Yes it is
And it's updating the card description (checking by repeatedly doing high cards)
i've never wrote a return without specifying a card variable personally, i would try that too even though someone else had said it wasn't necessary
cuz the calculate_effects are working with it
what do i change here to make it say whatever i want it to say?
Trying specifying card = card.
yes, that should tell the game to trigger the calculation messages under the joker itself, as the calculate_effect's do
...card = card didn't make it work. should it be outside the return??
no should be inside, might be something wrong with your chips mult and Xmult variables then
when are you updating chips, mult, and Xmult in the calculate function? looks to me like they're always 0, 1 and 0 from the original declaration in extra
They start as that
the actual addition/multiplication to the variables work
yes, but in the calculate function you're updating MultAdd, MultX, and ChipsAddO, which are never returned
,,,oh.
switch the updates to the variables you return and it should work
Okay, let's try that
card = card doesn’t do anything
i was told to try that just to be sure
In your config you're setting some to nil
What’s the problem?
You can't refer to other values in the config like that
I don’t have time to read back 😂
he had two sets of 3 variables, was updating one set but returning another without updating the returned set essentially
It's not applying the effects to the mult or chip count. The variable changes work, but not the application.
is there any way to identify a specific joker that is currently selected?
This should fix that, right? I'm updating the right ones now... I think.
Those values you're returning are nil
Because those are not the ones updated
OHHH okay
Also don’t use xmult_mod
I've learned some from Kristal modding
It's still not applying the stuff in the return.
-- Check conditions for this rule
if check_count_eq_5_played(context) then
-- Pre-return code execution
card.ability.extra.mult = (card.ability.extra.mult or 0) + 50
SMODS.calculate_effect({
card = card,
message = "+"..tostring(50),
colour = G.C.MULT
})
end
if check_count_eq_1_played(context) then
-- Pre-return code execution
card.ability.extra.Xmult = (card.ability.extra.Xmult or 0) * 2
SMODS.calculate_effect({
card = card,
message = "x"..tostring(2),
colour = G.C.MULT
})
end
if check_count_eq_3_played(context) then
-- Pre-return code execution
card.ability.extra.chips = (card.ability.extra.chips or 0) + 100
SMODS.calculate_effect({
card = card,
message = "+"..tostring(50),
colour = G.C.CHIPS
})
end
return { chips = card.ability.extra.chips, mult = card.ability.extra.mult, Xmult_mod = card.ability.extra.Xmult }
end
end
}```
main issue i saw was that the variables in each conditional didn't match the variable in the return, so you're updating MultAdd in a condition and then returning a separate mult variable, which means the update doesn't carry over
so essentially card.ability.extra.chips, mult, and Xmult just stay 0, 1, and 0 from your initial declaration
this might not be the exact effect you had in mind, but i at least wanna get it scoring so that the logic kinda works
ok so would G.Jokers.Highlighted target the joker currently selected?
G.jokers.highlighted is a list of all highlighted jokers in the order they were selected
You can only highlight one tho, so it's always the first one
so that's a yes?
That's a no
G.jokers.highlighted[1] is the selected joker
Make sure to check if there even is a highlighted one to begin with
so if G.jokers.highlighted == 1 then works?
alright
now to make sure it only works with specific jokers
nop
No, it would be #G.jokers.highlighted == 1
Hi bepis
oh okay
what does the # do?
It gets the length of the table.
i see
does anyone know how to check for a random card? Like random (rank) of (suit)
You can get a random card in the deck and use that card's rank and suit if they have one
ok now to check specific jokers
because some jokers do not work with this consumeable
wait why not
you can use it if you wanna specify a custom message, but if you're just gonna replicate the xmult message just use xmult
tho I believe you can also override xmult message with xmult_message
im trying to make "if hand contains a (RANDOM HAND) and (RANK) of (SUIT), earn 30 dollars and ive been trying to do this for like an hour
wait i could borrow some code from idol and maybe put a hand onto it??
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua code for the idol starts on line 3,970
i know i have vanila remade
yeah you can
the onyl thing that i dont like about vanilla remade is that they dont have the descriptions for the jokers so i have no idea how to format those
those are in the localisation file
if there's a vanilla joker with a behaviour you're looking for 100% just rip it from vremade
yo thank you so much that helps a lot
np
im still gonna have to find out about the random hand mechanic but that should be pretty easy (I hope)
that behaviour is in to-do list
would G.jokers.highlighted[1].name get the name of the highlighted joker?
oh yeah i forgot
Does anyone know if there is a context for choosing the boss blind?
should be context.settingblind and context.blind.boss
one checks for when a blind is chosen
the other checks if it is the boss blind
put em' together and it selects the boss blind
Thanks a lot
No.
No.
context.setting_blind and context.blind.boss
how would you go about zeroing out the round score? i have gotten a joker to zero out a scoring hand, but i was thinking the best way would be to somehow get the current round score and set the scoring hand to subtract that much, if thats possible
i'm looking at VanillaRemade and that appears to be the case
sorry for spreading misinfo
okay
so how would i identify a selected joker
by name or id or whatever
.config.center.key
...now it's doing x0 multi I think
whats the joker meant to do, i might try workshopping it from scratch and see if i can get it
No.
what do you mean by activated
like when its added to the joker slots
that's not a context but that ^
It's meant to
do this ("to card" being itself)
and then every time you play a hand, it applies what's been added to itself
A different function in your joker def
I want a joker that does the same thing as the negative edition basically
you'd have to modify G.jokers.config.card_limit iirc
yeah I see that from looking at card.lua I just don't know where to put it
lemme just say this is gonna take a while to write considering the number of Jokers i want to make this apply to
is there any way to run through a list or two to check?
probably is tbh
Yes.
You would do for example jokerconversions = {j_jolly = "j_sly"}
+2 joker slots is what I want
Then you would do jokerconversions[key] to get it.
how could this happen to me...
in the function that something sent
and make sure to undo the effect in remove_from_deck
could you clarify a little more?
in card.lua its on self.added_to_deck
No?
line 412 of card.lua
No, it's on card:add_to_deck()
because you only put in one conversion
how would i futher go about this?
because this is also meant to be reversible
halp me sound no woekjr
Make a table where the keys are joker keys and the values are what that joker turns into
Does your file work when you just play it outside of balatro
i'm not the best with lua so idk what exactly to do-
This but add more keys @obtuse silo
the actual sound
What if you remove volume
Also your file is in assets right
yea
assets/sounds
i have another sound there that works fine
removing the volume param didn't do anything
no idea
tried to import it into audacity and it doesnt recognize the filetype so maybe the file is just borked
local parallels = {j_jolly = "j_sly", j_zany = "j_wily", }
so something like this?
i see
i was thinking about this a different way where we have two tables each containing one half of the conversion
you can always add the reverse ones programatically after
e.g. one with jolly, zany, etc.
and the other with sly, wily, etc.
true...
You can then
Either way works fine
might be more concise to work inversely too
and about that
since it contains some of my mod's jokers
would i reference them with the mod's prefix or with just j_jokernamehere
j_prefix_key
hello guys, ive been trying to figure this out for like 4 hours can someone jusst give me some sample code to add a simple joker becuase when i do it it doesn't appear in the collection, thanks
so for instance
j_MintConditionCards_gun would reference the modded joker that is deadass just a gun
if that's your prefix yeah, tho maybe they get lowercased
calculate = function(self, card, context)
if context.card_added and not context.blueprint then
if self then
G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.slots
end
end```
this isn't working
You don't use calculate for this
is there a function that calculates enhancements triggering?
The add_to_deck is a separate function
No, but there is card.lucky_trigger and card.glass_trigger
hmm okay ty
and one more thing
is there a reference for the game's joker keys?
cuz i'm seeing that j_jolly goes to Jolly Joker so i'm wondering about the rest
game.lua in the source code.
thank you
I put {C:green}#1# in #3#{} chance this", in my joker's description, but instead of 1 it displays "table: " followed by some numbers, any idea why that is?
what did you pass in loc_vars
You're inputting a table into loc_vars
return { vars = { G.GAME, (G.GAME.probabilities.normal or 1), card.ability.extra.odds } }
end,```
You are passing in G.GAME which is a table.
And you're also asking for G.GAME
where are those check_count functions defined? i don't have it on my end
just crashes when i call it
Here's the file
Just came in to say I figured out how to do the thing I was asking about yesterday and I never want to touch Moveable/Node code ever again 
amazing
How did you manage to do it
The clickable part
The biggest problem I came across is that since I was drawing it with shaders, the actual sprite was never getting drawn and therefore not calling Controller functions, so I had to forgo a :draw() function and directly add the sprite to the draw hash so it would work without another sprite getting overlayed on top of the animated stuff 😭
balajamestro
how would one go about using other joker's triggers
like a joker that gets +1 mult each time bloodstone is triggered for example
context.post_trigger it's an optional feature
add_to_deck = function(self, card, from_debuff)
if from_debuff == false then
G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.slots
end
end,
remove_from_deck = function(self, card, from_debuff)
if from_debuff == false then
G.jokers.config.card_limit = G.jokers.config.card_limit - card.ability.extra.slots
end
end``` am I in the wrong scope or something here
okay that worked thanks
awesome
yahoo
What if I ate it then what would you do
nice
it was just me not using SMODS.DrawStep lmao
Partially the thing I said above as well as making its collidable state true and adding these functions to it
ok and how can i make it specific to the joker i need
ecpesially if it's a vanilla joker
other_card has the joker triggered, other_context has the context it's triggered under, other_ret has the return from that joker
you would use that to check if the card is bloodstone and it returned mult
im trying to make the description of this joker update over time like misprint does
right now it shows the correct numbers but doesnt update them
try string = {ref_table = card.ability.extra, ref_value="mult"}
Uh, working with sprites so annoying, especially on cards
uhhhh try string = {{ref_table = card.ability.extra, ref_value="mult"}}
yw
are there any other variations of chip return and mult return i should take into account in these
Not sure if this works at all because I can't find any info on how to do it properly so I'm just using imagination
trying to do reverse stone card, getting an "unexpected symbol near 'for' "
Using VanillaRemade as ref
mult_mod and chip_mod
thanks
this is very wrong
what do you want to accomplish
Take a look at SMODS.calculation_keys just in case
Print it with debugplus or in the source code
the opposite of a stone card.
I imagine it's very wrong I've got no idea, tried to check in the smods. docs but couldn't find something that would work similarly
It registers as all ranks?
opposite of a stone card means it's valid as all ranks, all suits and as a face card
but it has low value
we don't have multi rank in smods unfortunately
ok, this is not possible with heavy game modifications I don't recommend doing
one of my mods somehow has the same modicon as another despite the former not having the asset OR code for the modicon of the latter mod
you mean without
Heh
im quitting balatro modding
o7
how about multi suit? would that be similar to smeared?
for that there's the any_suit parameter
Suits are fine yeah, wild cards are all suits after all
can anyone help me figure out what black magic is going on here
the idea was making a joker playable card that looks like the Spanish playing cards' joker
that counts as a wildcard for everything
my optimistic guess is that multi rank will be possible within 6 months
Did you change the prefix and id?
All because of straights right?
perchance not
how would i do that
More like straights hates all of us
Should I work towards animation skip, or just play some gold stake?

Open the console and type eval SMODS.calculation_keys for DebugPlus
if i make a joker's rarity legendary does it automatically get added to the soul (the spectral card) pool?
I want to display a joker's values which depend on its position, is there like a context for moving a joker's position to update the variables there or smth else better than repeating the same function as when scoring in loc_vars ?
Yes.
ok thanks
repeating the same function is the best option
How would I hide a suit until the player uses a joker
Aw it looks wrong but it is what it is, ty ty
is there a way to decrease the resolution of a background colour in localisation text so that the corners of the background are more rounded like in blueprint's/brainstorm's compatibility thingy
not without patching localize
but I would recommend just recreating the UI yourself
with main_end
oh thats new
You've got a week, happy trails
would something like this work?
if context.other_ret and context.other_ret.mult then
card.ability.extra.Xmult = card.ability.extra.Xmult + 0.5
card_eval_status_text(card, 'extra', nil, nil, nil, { message = "+0.5 XMult" })
end
end```
i love trails, my favorite is trails to azure
No.
It would be context.other_card.config.center.key == 'j_bloodstone'
Also bloodstone doesn't return mult
can someone helop me?
you have a syntax error in jokers.lua file
do you use vscode
notepad++
also consider using vscode
oh yeah it should be Xmult?
is it better?
a LOT better yeah
No, it should be x_mult
ok ty!
where can i find this syntax
should i use the blue visual studio or the purple one
beyond any syntax errors you might have, you're mixing stuff up
blue is vscode, so that one
-# me just out here using notepad++
how do I make next(context.poker_hands['High Card']) strict (ie returns false when you play anything that isn't just a high card)
there's nothing wrong with using notepad++
as long as you know the syntax of the language
youre not alone
if context.scoring_name == "High Card"
so visual studio is basically training wheels
and notepad++ is a nomral bikle
is that within next or just a condition unto itself
ehh, i'd say it's more than that, I mean I am still using it while knowing
It is it's own condition.
i meant like is there some documentation i can read
an IDE (what vscode is) is a very good tool to have when coding stuff, notepad++ (beyond any plugins it might have available) is just a text editor
IT WORKS!!\
worked, thanks
thank you visual studio
how would i check if an user is hovering over a certain object? not a card or joker, like, an object generated with love.draw with a bounding box i made.
Visual studio (purple) is a bloated IDE for programming C#, C++, and some other languages. Last I checked, it’s missing basic features that every modern text editor for programming has. Vscode (blue) is a far lighter text editor that can be made to have most of the IDE features you need to program using plugins. Vscode is preferable for Balatro programming and most uses in general
VS is "standardized" programming with the languages, VSCode is more flexible with plugins and what not.
edit: it did not work
the title and stuff works but the rank suit and hand soes not cahnmge
\"
gotcha
i thought this was balatro
Or just use singlequore for string
Failing at patching DebugPlus. Anyone able to see my problem with this target?
No not found errors in console, so my pattern isnt the problem. Supposedly.
[[patches]]
[patches.pattern]
target = '=[SMODS DebugPlus "core.lua"]'
pattern = '''_card:remove()'''
position = "after"
payload = '''if _card.config and _card.config.tag then
_card:remove_from_game()
end'''
match_indent = false```
mmm maybe, but it has the metadata for a smods mod
yeah but it loads the modules through a lovely file
Ill try targetting main then
i think there's a setting for lovely to tell you all the targets it finds
but i dont remember how
¯_(ツ)_/¯
*for core its not main, its engine/controller.lua...
How do I change seals texture?
patches.regex instead of [patches.module]?
... its a regex patch

not a module
you arent using a lick or regex there
lmao
[patches.pattern]
you're missing the and?
it was solved. Squid was looking at cryptids code, not the dump 🙂
interesting
--dump-all?
i am very not dumbnt
thank you mr. lovely
n!p
n not p
Uhhhh for some reason this one doesn't work idk what should I do... (I'm not a coder)
anyone know why i get this stack overflow?
modlist: 3x Credits, Balatest, Banner, Better Vouchers This Run UI, Blueprint, DebugPlus, Galdur, Handy, Hold For Final Hand Score, JokerDisplay, JokerSellValue, Malverk, sortatro, SoulEverything, Talisman, Too Many Jokers, Unjankify
happens when i select any playing card
here's the full log file in case it helps...
and now i remember why i didn't use talisman :(
i just wanna quit it all and go outside or something idk
The text in loc_txt is appearing black when I made it white, the text is: {X:mult,C:white}X#2# {} mult how do I fix this
do you have the full loc_txt just to see how it's coded ?
for some reason the image is loading in just fine
but the name and description won't appear
someone needs to make a tutorial for this stuff. im trying to make a deck spawn jokers but it isnt working
it's loc_txt and not loctxt
ahhh thanks
Also it's can_use
my joker is not giving me the mult, can someone tell me whats going on?
rarity = 2,
atlas = 'Jokers', --atlas' key
cost = 6,
unlocked = true, --whether it is unlocked or not
discovered = true, --whether or not it starts discovered
blueprint_compat = true, --can it be blueprinted/brainstormed/other
eternal_compat = false, --can it be eternal
perishable_compat = false,
calculate = function(self,card,context)
if context.before and context.cardarea == G.jokers and not context.blueprint then
if G.play.cards then
local hasTen, hasNine = false, false
for _, played_card in ipairs(G.play.cards) do
if played_card:get_id() == 10 then
hasTen = true
elseif played_card:get_id() == 9 then
hasNine = true
end
end
if hasTen and hasNine then
mult = card.ability.extra.mult
return {
message = "You Stupid",
play_sound("twentyjuan_youstupid"),
}
end
end
end
end
}```
Put the mult = ... in the return.
mult= in the return
oh ok thanks
like the line goes below
bump :(
It's jokers and you put all the keys in config.
Also you need your mod prefix.
i dont know how to help this one but i think cryptid has that one deck with legendary spawns? try checking the code on that
i already tried stealing from cryptid lmao
mod prefixes would be good Somethingcom515 is wayyy more experienced
instead of _j or before _j
After j_
sorry i wish there was a tutorial on this stuff
So it would be config = {jokers = {"j_modprefix_guess_who", "j_modprefix_jester", "j_modprefix_blue_card"}}
im trying to get these updating text to be put onto a localised variable
i dont really know what im doing tbh so im just trying random stuff and hoping it works
you can't
you need to build the UI for the text yourself
ah
i tried to do that before but idk how to add lines and also the inactive color just set the color to white instead
so you couldnt see it
(Cryptid.safe_get(G.PROFILES, G.SETTINGS.profile, "deck_usage", "b_cry_spooky", "wins", 8) or 0)
~= 0
or skip
then
G.GAME.modifiers.cry_spooky = true
G.GAME.modifiers.cry_curse_rate = 0
if Cryptid.enabled("j_cry_chocolate_dice") == true then
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_cry_chocolate_dice")
card:add_to_deck()
card:start_materialize()
G.jokers:emplace(card)
return true
end
end,
}))
end
end```
entirely different code
triple "`" above and below makes it a codeblock
"```lua" adds syntax highlighting
bump again
what's the code
i was tryuing to make a joker and i decided to make a deck to make debugging the joker easier and as it turns out the deck is harder to make than the joker
i think i found the correct color idk for sure though
i see G.C.GREY from searching through console
?? just use debugplus
name = "Debug Deck",
key = "debug",
atlas = 'decks',
pos = { x = 8, y = 6 },
config = { jokers = 'j_yip_guess_who','j_yip_jester','j_yip_blue_card'},
loc_txt = {
name = "Debug Deck",
text ={
"Start with the last five",
"jokers in the yippee's stuff catalouge"
},
},
loc_vars = function(self, info_queue, back)
return {
vars = { localize { type = 'name_text', key = self.config.jokers, set = 'Jokers' },
}
}
end
}
yeah the "b_cry" the cry part thats the prefix
when should you ever use self vs card?
G.C.UI.TEXT_INACTIVE iirc
If you are trying to get something from the center.
the error was from the text above this message
debugplus could solve this since you could just ctrl+c
over the joker
in the collection
the list of jokers needs to be a table
looks correct, thanks .,.,
@stiff turret why the question marks? do you want like explanations
icl ts thats not what i woulda done
try removing the spaces
what would you've did instead of debugplus? /genq
i don't know
lmao
how do i add lines with this?
i was planning to makea deck whihc just gave you when yoyu loaded in
you mean line breaks?
you need to use C and R nodes
https://discord.com/channels/1116389027176787968/1228149931257237664
this lets you spawn any joker you want
the humble box node
still needs rows tho
i already had debug plus i just didnt know it could od that
isn't B for spacing
is there a wiki or smth that says how to do stuff like this
yes, the UI guide on the smods wiki
ok thank,.
lowercase x
whoops, forgot that you also need a collection variable
No, uppercase X is fine.
upper didn't work for me when I was first making jokers
when i try ubnsterutb a tabke uit give s me like 20 warning
how do you all know all this stuff theres no way to learn baaltro coding
how do i get the card texture in a shader?
how do youi know about all the variables and stuff
yes
i was hoping i could keep my description entirely within the loc_txt and didn't want to have to build a main_end for every little thing, especially something as minor as this
well thats how thunk designed the localization system
crazy
HIOW KDP I OSXDNH ITBAT
WG)WA sc
practice and keep an open mind that we've been doing this for a while
Put {} around it.
I've been doing Balatro modding for over a year
please write normally if you actually want me to help you
jokers = { "key1", "key2", "key3" }
why isnt this centered and how do i center it
align = "cm" in the configs
tah nk you
this doesnt seem to work (intended effect, add chips to joker when jokers that give chips are triggered)
homestuc menion
my whole mod is homestuck
i was actually planning on making zodiac legendaries
and the colors would be the hemosprecturn
i went in a far diff direction (making the actual characters into jokers)
Is there a context for jokers getting deleted from ankh or hex?
what are all of the calculate function keys that can be +chips?
and same for +mult as well
is that just for jokers or is that ANY chips or mult
Anything that goes through SMODS.calculate_effect
So yes, most likely.
isnt there cases where chips is bonus or something
Yes, for enhancements.
so should i include that too?
No.
I meant like card.ability.bonus is where chips go sometimes.
would enhancements trigger this or not?
They would.
use this
what about getting deleted from foods expiring or whatever
nope
fuuuuuck
there's no context for joker destruction, you need to make it yourself
update smods
still doesnt work
this is a completely different hook than what i was originally told would work
what does SMODS.find_card even do here
why is that a requirement
why would it not do anything otherwise
youre not telling me why the code works or helping me understand you're just pointing to the code and going "well thats just how that works"
and then question mark reacting me when i (a beginner) am confused by code that you are refusing to explain
yey!! it works
but i wanna make the card flip before it swaps
What is confusing you?
why are we not looking at return functions here? why does it need to be this and not some variant of what i was already given?
hooking is already quite confusing to me and you giving me something completely different and not explaining why it's different isn't helping anything
You mean returning a message instead of using SMODS.calculate_effect?
I'm not very good at explaining things.
find_card gives you a list of all the jokers, consumables and vouchers that match that id
you shouldnt hook calc effect to do this
uhhh not to be that guy but isnt post_trigger the context you need
should i re-explain what im trying to do here
please
im trying to make a joker that gains (effect, since i have four joker variants of it) whenever a joker of (same effect) triggers
so like it does something with chips if a joker gives chips?
yeah the chips one has chip gain whenever a joker triggers that gives +chips
oh then yeah context.post_trigger is for that
context.other_ret contains the effect the other joker returned
how would i write that out
what exactly is G.ROOM
never used it before so i might be wrong but
if context.post_trigger and (context.other_ret.chips or context.other_ret.h_chips or context.other_ret.chip_mod) then
keep in mind this is an optional feature you have to enable (i dont remember the syntax for that rn)
is the id of stone cards 1?
hmm so to check for if a card is stone i should just look at its center thingy right
You can just pull if its m_stone I think yea
SMODS.has_enhancement(card, "m_stone")
:3
i can do something like this "and SMODS.has_enhancement(context.other_card, "m_stone")" yeah?
yes
How would i make it so a sound play's every time a joker is activated/scores something?
In return { }, add a sound = prefix_key.
Thanks
is context.other_ret also an optional feature?
How would I make cards flip over
like they're getting enhanced
cuz that's the effect i want to use for Parallel
No.
then it still isnt working
Code?
