#💻・modding-dev
1 messages · Page 400 of 1
where do i find that?
?
do you not
have it with your file loading
something like this (it's mod_path here but it should be fine)
Is cookierun_teams declared in the main file before you run this? If not, it might just be an issue of the files being loaded out-of-order, where the file using the table is loading before the one declaring it
that too
yeah, it is just that
mod_dir = ''..SMODS.current_mod.path
ok cool
so yeah try breeze's thing because the code itself looks fine?
order is important
It's also good practice to name global variables with an Uppercase first letter for clarity
nope, it's in the other file that i am trying to load
You might need to rethink how you're structuring your mod and code, then
you could also maybe turn your file load into a folder load function? just to make things easier in the long run
this is what the other file looks like. i don't want those arrays to fill too much space in the main file, hence i put them in a different file
I am working on making a joker that's a combination of Invisible Joker and Ectoplasm (minus the hand size reduction), how is this so far?
Idk how to fix the error also, I don't have much lua experience
It has to be COOKIE_TEAMS = {
That should be COOKIE_TEAMS = {, but is otherwise fine, whichever system of organisation makes the most sense to you is okay. You just need to make sure that you're loading it before anything tries to use it.
where is the =
the triple is crazy
bump :p
where is the locvars
invis NEEDS that
What is locvars?
there's a function for that?
you set it up yourself
just put what you have already within a function
example
What do I do?
oh, i already do that
firstly wiki answer
loc_vars is just your localization variables (go figure). you use it instead of loc_txt, in which you'll need a separate localization file
I am confused ngl
ok so
fyi files will load in different orders on different platforms with this approach
i think for the main platforms (mac/windows) the only differences are with case sensitivity
-# are they trying to load different files from their mod?
-# if so, I may know a method to ensure they laod in the same order always
tbh smods should have a load folder function that loads everything in the same order on every platform
the method is to order the load_files in the correct order
say i had this
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
that "vars" bit is connected to the values you put in your config table
in this case
config = { extra = { mult = 4 }, },
Good morning, how can I start modifying balatro?
please just make and use a local array
why
https://discord.com/channels/1116389027176787968/1349064230825103441
good place to start
there's literally no difference when ctrl c ctrl v exists
Thanks handsome
np
In any case, you can do both approaches.
And files will be loaded in the same order every time.
also I eat for loops for lunch every day
So what do I do?
im not putting dependencies in an array and iterating over them just to import them why would i do that
what about
fnui
umm.. DRY? have asl prepend src/ to the path then ill be happy
invis joker's loc_vars is different from the simple, as it uses both ipairs and main_end iirc
N' did you do vr invis yet or nah
like invisible joker?
yeah
yes all jokers are done
crash again...
for i = 1, #COOKIE_TEAMS{brave_team} do
if #COOKIE_TEAMS{brave_team}[i] == context.other_joker then
return {
xmult = card.ability.extra.xmult
}
end
end
end```
what a weird brackets
they're combining invis with ectoplasm
It should be . not {}
it should actually be .
i was about to say
or a string inside the brackets
so either #COOKIE_TEAMS.brave_team or #COOKIE_TEAMS{"brave_team"}?
#COOKIE_TEAMS["brave_team"]
How do I fix the error?
Nvm
I just had to delete the brackets
Aside from the brackets, how does it look?
there's an un
ed version of invis joker linked here. you shouldnt need the draw unless you're giving it invis' shader? nor the unlock check as that is in fact for invis
loc_vars is a function
loc_vars = function(self, info_queue, card)
--stuff
end
ok, so the third part isn't really working. it is supposed to give x0.2 mult when a card in that list scores
does it crash
nope, it just ignores the third part
is the list a list of keys?
i have no clue what im doing 😭 this infinitely makes the sound of enhancing a card (softlock)
oh also post_joker doesn't have other_joker?
yeah, a list of joker keys that would give them x0.2 mult when those score
i would change that post_joker for other_joker and then you need to check context.other_joker.config.center.original_key
i think its original_key
post_joker is for after scoring
while other_joker is probably what you're looking for
I think you're not quite understanding tables yet, might want to brush up on a Lua tutorial.
#COOKIE_TEAMS gives the number of elements in the table.
You're counting up from 1 to #COOKIE_TEAMS.brave_team and want to check if each element of COOKIE_TEAMS.brave_team is the other joker, so try
if COOKIE_TEAMS.brave_team[i] == context.other_joker then
that too yeah
i forgot to go back and look at that
the wording confused me a bit
ic
Which to what numbered line should I copy for the invis joker?
i want the xmult to happen when the other joker scores
bump
thats post_trigger
post_trigger th- yeah
you'll need the config, that entire loc_vars and entire calculate function
the former for initializing, the latter for the actual effect
you wont need the draw function or the unlock check
So from 4367 to 4416 minus the draw stuff?
jarvis why do so many of my ideas make me implement new card areas
Thx
ok yeah, the third part is straight up ignored, even with fixes
so how am i supposed to check if the ante is at least 3 if doing G.GAME.round_resets_ante >= 3 crashes it
well is it fixed
the effect is straight up not triggering
What’s it look like
this works for any domain cards, yet i cant get a use button on todo, is it because hes a joker and CANT?
I want to test my joker, but hovering above it in collection and pressing 3 does not spawn it for some reason?
oh my god I put an underscore instead of a period
are you sure it doesn't spawn it, or are you not seeing it cus it doesn't have a sprite
Wait yeah that's the issue lmao
thanks
lol np
this is why we use placeholders 
hi! is there a way to get all the base game jokers 'calculate function', in a joker calculate - so for example: a joker that has the effect of other random joker every hand played
this might be set_ability shenanigans
i just notice that the joker calculates weirdly
No, but that effect is mostly possible.
bump
how? if not through the joker calculate
You need to create a "fake" joker to run the calculate from.
Try return nil, true instead of return {}?
what does the ,true part do 
It tells the game that it has triggered.
no change from what i showed
does anyone have a joker with a use button i could peek at in their mod?
it's definitely something with event manager
i was only able to get this to reproduce properly after setting up the events like that
which suggests that the events are displacing the retrigger message
Try putting the whole thing in a func in the return?
if context.destroy_card and context.destroy_card:is_suit("Hearts") then return {remove = true} end
okk
btw the destroyed cards are the played ones
that fixes it
although i run into this while trying to implement the fix on one of my affected jokers 
actually, why am i doing that in the func
i can just do it before it
nvm, pebkac
how do i check how many cards have been discarded in a blind?
You would have to count manually I think.
how about cards played or drawn in total in that round?
these dont show up in the shop, any ideas?
do you guys know how to check if the game is currently in the shop? this isn't anything joker related
if G.STATE == G.STATES.SHOP?
You need to do pools = { ["Joker"] = true },
how would I "get rid of" a vanilla suit? part of the mod i'm making replaces the 4 vanilla suits with 6 of my own
i know it has something to do with taking control of it, maybe?
i want it to not show up at all here
SMODS.Suits["Hearts"].in_pool = function() return false end
ah, thank you!
can someone explain why this doesnt work
youre ending the func early, so lines 30-38 dont run
G.shop_jokers and G.pack_cards don't exist when the deck is applied.
ohhh
how do i then do it
What is the goal?
all jokers in the shop are negative
Make everything eternal and negative by the looks of it
yeah
Only jokers? Or everything?
i was starting with just jokers, but i do want everything yes
the negative playing cards do work
is there a way to get a joker's price in shop?
You need something like this in your file: ```lua
local oldcardareainit = CardArea.init
function CardArea:init(X, Y, W, H, config)
local r = oldcardareainit(self, X, Y, W, H, config)
if not config.temporary and not config.collection then
mod.all_card_areas = mod.all_card_areas or {}
table.insert(mod.all_card_areas, self)
end
return r
end
card.cost
thanks
my god
okay
Then hook update and check for the deck and put this in there: ```lua
for k, v in pairs(mod.all_card_areas) do
if (type(v) == "table" and v.cards and type(v.cards) == "table") then
for k, v in pairs(v.cards) do
if not (v.edition and v.edition.negative) then
v:set_edition("e_negative", true, true)
end
end
end
end
Puts all the card areas in a table so you can make every card negative.
ohhhhh
is there a context for discarding?
so this goes in the event?
and the first code before the event?
context.discard for individual cards and context.pre_discard for once before the discard.
No, that goes in an update hook.
The first code you just put in your main file outside everything.
so also outside of the smods.back{
how would I do the same for a rank? it crashes if i try
SMODS.Ranks["Ace"].in_pool = function() return false end
hell yeah
how do i check what poker hand was discarded?
like this?
refer to how burnt joker does it
No, decks don't have update
i forgot what the functions called but theres one that calculates poker hands contained in a set of cards
edit the discard function to run an evaluate_poker_hand call
G.FUNCS.get_poker_hand_info(context.full_hand)
local oldupdate = Card.update
function Card:update(dt)
for k, v in pairs(mod.all_card_areas) do
if (type(v) == "table" and v.cards and type(v.cards) == "table") then
for k, v in pairs(v.cards) do
if not (v.edition and v.edition.negative) then
v:set_edition("e_negative", true, true)
end
end
end
end
return oldupdate(self, dt)
end
it says this now
oa6
i forgot oops existed, smth
oops is goated
No, it needs to be outside of everything.
so idk what i did
but retriggers dont happen anymore
not from base game cards, not from cards from other mods, and i dont even have any that do that
retriggers have been removed from my copy of balala
chad doesnt work
its a base game card
HOW
attempt to index a mod (nil value)
thats impressive
it doesnt make any sense
You need to do mod = SMODS.current_mod
how the hell did i manage to break a base game card
If you disable your mod does it become normal?
local mod or just mod
wtf
local mod
what the fuck
okay thanks
can jokers debuff your playing cards?
yes
look at cryptid's mask joker
so i figured out what happened
well
whats causing it
not why
next problem lol
Whats the card size again for 1x and 2x?
local scie = SMODS.calculate_individual_effect
function SMODS.calculate_individual_effect(effect, scored_card, key, amount, from_edition)
local ret = scie(effect, scored_card, key, amount, from_edition)
if
(
key == "x_mult"
or key == "xmult"
or key == "Xmult"
or key == "x_mult_mod"
or key == "xmult_mod"
or key == "Xmult_mod"
)
and amount ~= 1
and mult
then
if next(SMODS.find_card("j_CGN_RedJoker", false))then
for i,v in ipairs(SMODS.find_card("j_CGN_RedJoker", false)) do
v.ability.extra.mult = v.ability.extra.mult + v.ability.extra.scaling
SMODS.calculate_effect({message="+"..v.ability.extra.scaling.." Mult",colour = G.C.MULT}, v)
end
end
end
end
somehow this managed to turn off hanging chad and all retriggering of playing cards
71 * 95
Code?
and for 2x its just double that
Aight
could anyone help me figure out why this causes retriggers to disappear from existing?
You're not returning ret
so at the end of everything just put
return ret
Yes.
local oldupdate = Card.update
function Card:update(dt)
if mod.all_card_areas then
for k, v in pairs(mod.all_card_areas) do
if (type(v) == "table" and v.cards and type(v.cards) == "table") then
for k, v in pairs(v.cards) do
if not (v.edition and v.edition.negative) then
v:set_edition("e_negative", true, true)
end
end
end
end
end
return oldupdate(self, dt)
end
can jokers have debuff funcs like blinds?
theres an undocumented debuff_card context
im looking at debuff_hand atm
but idk what to use to calculate the debuff since i cant use context
yeah like what psychic does
im tryna debuff anything that doesnt contain a flush
it works. one problem, it works for all decks
yeah you can use that
patterns should always be one line in patches right
no there can be multiple lines
You need to check for your deck.
'''
pattern
'''
what var would i use to check for hand containing a flush, would it be hand?
wdym
so like payload
local oldupdate = Card.update
function Card:update(dt)
if mod.all_card_areas and G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_prefix_key" then
for k, v in pairs(mod.all_card_areas) do
if (type(v) == "table" and v.cards and type(v.cards) == "table") then
for k, v in pairs(v.cards) do
if not (v.edition and v.edition.negative) then
v:set_edition("e_negative", true, true)
end
end
end
end
end
return oldupdate(self, dt)
end
you can combine an entire file into one line, you just cant split one line across multiple lines alot of times
context.poker_hands["Flush"]
ohhhh
lemme check if this works
context isnt passed in **
what does this mean
is this a joker or a blind
jonker
you dont technically need to have multiple lines in a file
you could just put it all on a single line
you just have to be really good with figuring out the syntax
this is the only one on the wiki abt debuffing and this is what matador uses right? not for debuffing
but what does that have to do with their question
like i said, its undocumented
this fixes on quitting to menu and loading the run again, but when invisible joker creates a custom joker, it switches to the default atlas and not the custom joker's?
is this a known thing with the current steamodded build or
idk why but i thought that they said smth else
so now my payload is acting up?
no wait
im using multiline formatting
that's a single line
no wait cause
huh
im writing a library mod currently, how can i easily get the mod thats calling my function without passing the mod as an argument
i cant find it in better_calc.toml..
doesnt work, no crashed but the jokers arent neg.
playing cards are but thats because of the other code i think
overrides.lua
why does this one go red? (above patch for reference)
You need to change b_prefix_key
you're using the same type of quotes in the pattern you need to escape them \'
oh im stupid
where does that go
instead of the ' inside the pattern
oh ok
i would try inspecting the local variables with the debug thing but im not sure what to look for
'''
if the pattern uses \'quotes\' you escape them
'''
in the reference pattern im putting \ behind each qu-yeahhh
i think thats the problem at least
and that's only a multiline issue right
cause the above patch has those but it's single line
it's an issue of using the same type of quote around the pattern and inside the pattern
this no worky
with a single line you might need to escape ' or " too
return { debuff = true }
ok well
uhhh can you copy it here
which is the key
ofc
[[patches]]
[patches.pattern]
match_indent = true
times = 1
target = "card.lua"
pattern = '''
if self.ability.name == \'Ectoplasm\' or self.ability.name == \'Hex\' or pseudorandom(\'wheel_of_fortune\') < G.GAME.probabilities.normal/self.ability.extra then
G.E_MANAGER:add_event(Event({trigger = \'after\', delay = 0.4, func = function()
'"
position = "after"
payload = '''
G.GAME.chudhit = G.GAME.chudhit + 1
'''
also i lied you dont need to escape them lol
You need to change prefix to your mod prefix.
i mean i figured since the first patch works fine lmao
but im just trying stuff
is that the mod id or do i need to add a line for prefix
sorry to bother anyone but can someone teach (tell) me how to make my joker have X-2 mult
you can probably just return { xmult = -2 } but idk
question: the game doesnt keep track of hands contained in hands played, right?
this is the code so far
try copying normal jimbo in vanilla remade and changing the return to xmult = -2
ok
question, is the function in a joker return table evaluated before calculate_seal()?
It seems to come after.
the function comes after? or calculate_seal
thanks so much man, it works
why is it red
cause its evil

What is the file called?
It should be lua not json
ok
calculate_seal comes before.
how do i do that
You change .json to .lua
i just changed it to main.lua and now this is it
You need to turn file extensions on.
Change it within vscode
i know that but like what do i do to change it
Right click > Rename...
Are you right clicking on the file on the side?
suit symbols are showing up correctly in View Deck but not on hover?
any obvious mistakes?
can someone help me understand this code? its from cryptid (specifically the old blueprint joker), and im trying to use it as reference for a blueprint-like joker im making, but i dont understand how context.blueprint and context.blueprint_card work:
context.blueprint = (context.blueprint and (context.blueprint + 1)) or 1
context.blueprint_card = context.blueprint_card or card
if context.blueprint > #G.jokers.cards + 1 then
return
end
Just use SMODS.blueprint_effect
ok. what does that do, and how do i use it?
It gives you the return of the joker you're copying and SMODS.blueprint_effect(copier, copied_card, context)
is there a way I can just straight up access the amount of chips and mult currently in my score?
like context.current_chips or something like that
hand_chips and mult
this should set every hand's base chips to 1, right? it doesnt seem to be doing anything though
card.ability.extra.savedchips[i] is to save the number of chips to be restored later
hmmm, it seems like the ipairs just isnt running at all
nvm solved
is this a context? or a field of G.GAME
I see, thanks
does Debug-Plus have a command that levels up hands?
or do I need to do it manually with cards
how do i get a jokers key?
joker.config.center_key
you can use eval to directly run lua code
it wont change from .json
Why are you putting jokers in a metadata file
I think so
Why?????
I believe he saved his main file as a json instead of lua
ok but theres literally metadata in it
oh yeah look at that
yeah i uh
so yeah you need two separate files
i opened the wrong file 😭
your metadata should be a json with all the metadata stuff, your main file should be a lua file with all your mod code
anyone know how to count seconds spent in an Ante?
and then at some point you should probably also make a localization file, but let's take this one step at a time
just a regular old time function?
l_chips and l_mult are per-level bonuses, whilst s_mult & s_chips are base values. .chips and .mult are total values as calculated by adding the two, with former being multiplied for every level.
What is the json file necessary for?
it makes sure smods recognizes your mod files, yeah
stores all the information about your mod and so smods can re—yeah
and loads all the correct data associated with your mod, like the version and creator and all that stuff
yes, but they strongly encourage the json file method
How come?
excellent question, I don't know but I trust programmers to have valid reasons for things
the smods folks kinda know what they're doing
someone help idk what it wants
JSON is portable and standard in lots of web software, so it's easier to maintain since it's more about library calls than custom code. Dunno what format the legacy stuff is in, but it seems to be custom. Might be wrong though.
oops wron file
Lol
The less code one is responsible for and has to maintain (while still keeping the same functionality), the better the code is.
Did you close the bracket after smods.joker
yes
you need a comma after the bracket that closes the loc_txt
oh and you need it after the key and path in your atlas too
(you have a typo in your loc_txt too, it should be X:mult with an l instead of a k)
calculate = function(self, card, context)
if context.end_of_round and not context.game_over and G.GAME.last_blind and G.GAME.last_blind.boss then
card.ability.extra.time = os.clock()
return {
message = localize("k_reset"),
colour = "G.C.BLUE"
}
end
local seconds = math.floor(os.clock() - card.ability.extra.time)
card.ability.extra.chips = math.max(0, math.floor(card.ability.extra.chips - seconds * card.ability.extra.subtract))
if context.joker_main then
return {
chips = card.ability.extra.chips
}
end
end
supposed to count seconds (with I thought I accounted for with the math.floor) but I think its counting nanoseconds since the value is always 0
i need help, my game is crashing and i dont know what to do
is there a way to print G.GAME.probabilities in the console
https://discord.com/channels/1116389027176787968/1369861558556950579
you could try asking the dev maybe, i have no idea what's going on here
or just open the console and type eval G.GAME.probabilities
the section lovely mods has missing dependencies under each mod that's causing an issue, you need to install those missing mods
ok, thx
but how i do that
the same way you installed the other 17 mods
i didnt even see the dependency error
this is also the developer channel, you should be asking in #⚙・modding-general
oh well now it seems obvious
is this balanced
pretty sure that's jimbo but ok
make sure it can't go below 0, but yeah I'd say so
its food joker
pairs super well with vagabond
delicious jimbo (havent made texture yet)
How should I go about inserting the ectoplasm code into this joker I am trying to make?
The joker is a combination of Invis and Ectoplasm btw, you sell it after 3 rounds to give a random editionless joker negative
it's a bit convoluted
of which console are you talking about?
go to #⚙・modding-general for questions about installing mods
#💻・modding-dev is for making mods
what do you want it to do?
This
is there a way to change the tag color of the thing that says "Free Diddy"? (its the display name for the mod not just a badge)
yes
Are we just not gonna talk about the name?
which one
Understandable
that was placeholder
Btw
or should i keep it like that?
No
I have the code to create a random editionless joker in my mod, I'll grab the link in a sec. You would just put that in your calculate function in the selling context (don't remember off the top of my head)
no i think they want it to act like ectoplasm when you sell the joker (i.e. it gives negative to a random editionless joker you already own)
Yes
ah I see
why am i receiving a nil value error?
info_queue[#info_queue+1] = { set = "Other", key = "brave_effect" }
info_queue[#info_queue+1] = { set = "Other", key = "element_earth" }
local xmult_count = 0
local count = 0
if G.jokers then
for i = 1, #G.jokers.cards do
if (G.jokers.cards[i].config.center.rarity == "CRB_common") and (G.jokers.cards[i] ~= card) then
count = count + 1
end
for j = 1, #COOKIE_TEAMS.brave_team do
if (string.find(G.jokers.cards[i].label, COOKIE_TEAMS.brave_team[j]) ~= 0) and (G.jokers.cards[i] ~= card) then
xmult_count = xmult_count + 0.2
end
end
end
end
return { vars = { card.ability.extra.mult, card.ability.extra.mult + (card.ability.extra.bonus * count), card.ability.extra.xmult + xmult_count }}
end,
}```
From which to what lines?
from the start of SMODS.Joker{ to the closing bracket for the same thing
should be line 136 onward
HEX("50C878")
what
How much of ectoplasm do I copy and paste?
not ectoplasm
your joker
ecto is freely available on vanillaremade
🙏
you wrote it wrong, replace it with what i wrote
try G.TIMERS.REAL for your time value
it worked 
you definitely messed up something with the code, check again
how does it increment? just want to know to make sure the calcs are done correctly
you don't need HEX for the badge_colour
no clue
Btw the dark edition text color doesn't work, so let me know if you figure out what's wrong
do u still ned parenthesees
oh, it's in a different format i'm not used to, my bad
ur good
replace
local jokers = {}
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] ~= card then
jokers[#jokers + 1] = G.jokers.cards[i]
end
end
if #jokers > 0 then
if #G.jokers.cards <= G.jokers.config.card_limit then
local chosen_joker = pseudorandom_element(jokers, pseudoseed('vremade_productgoo'))
local copied_joker = copy_card(chosen_joker, nil, nil, nil,
chosen_joker.edition and chosen_joker.edition.negative)
copied_joker:add_to_deck()
G.jokers:emplace(copied_joker)
return { message = localize('k_duplicated_ex') }
else
return { message = localize('k_no_room_ex') }
end
else
return { message = localize('k_no_other_jokers') }
end
with (may have to fix indentation)
local editionless_jokers = SMODS.Edition:get_edition_cards(G.jokers, true)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
local eligible_card = pseudorandom_element(editionless_jokers, pseudoseed('ectoplasm'))
eligible_card:set_edition({ negative = true })
G.GAME.ecto_minus = G.GAME.ecto_minus or 1
G.hand:change_size(-G.GAME.ecto_minus)
G.GAME.ecto_minus = G.GAME.ecto_minus + 1
card:juice_up(0.3, 0.5)
return true
end
no, but it's colour not color
yeah it should be {C:dark_edition}
are we fr
balatro is british unfortunately 😢
anyone could help me with this?
Lmaaoo
show us the rest of the error
also what line number is the start of loc_vars?
for the things that you're adding to the info_queue, do their descriptions have #1# in them?
anyone know what the mod is called for spawning in jokers or blinds when u need
G.TIMERS.REAL seems to increment based on events executed, whenever the queue is size 1, the joker's chips don't change, but whenever an event occurs it decreases
DebugPlus
ty
i think info_queue needs the modprefix
yes, but one of them is in an external description
How does this look?
indent lines 172 through 180
that looks like a joker description, so you probably shouldn't have set = "Other" in what you're adding to info_queue
try using set = "Joker" instead
I did two indents each
one more time i mean
where do i put that?
lines 27 and 28
So one or three times total?
three times total
highlight those lines and press tab lol
now ability is the nil value now
are they both joker descriptions?
nope, those are in "other" descriptions in localization file
Also, how do I do the currently number/number text that some jokers have? Like Yorick or Loyalty Card?
loc_vars
where do those descriptions show up usually? Where do they usually get their #1# and #2# vars from?
oh wait, i think i found the problem
i dont think G.GAME.chudhit is real
you dont say
say nomore
this is what i am trying to do, the third vars is supposed to be for the external description
tried it and saw (it didnt work) 
what r u trying to do with this joker
gains x mult if you score a probability
any probabilty?
so don't do #3#, that doesn't do what you think it does. Do #1# and then add a vars section to the info_queue lines, so something like this:
info_queue[#info_queue + 1] = {set = "Other", key = "brave_effect", vars = { whatever_value_you_want } }
right now it's the three consumables
there is no builtin support for this
or more accurately there is no way to track down every probability check in the game
fym three
if i can tie an unlock condition to failing on the wheel of fortune, what's stopping me
i can only think of one probability consumable
regardless if its limited you could just take ownership of each consumable
and check for the joker in question when failing the roll
if you're targeting a specific card that's fine, but if you want an effect that triggers any time any probability effect succeeds, you cannot do that in a way that is compatible with other mods
guys can someone help me understand whats wrong with this code so far
SMODS.Atlas{
key = 'JimboFather',
path = 'JimboFather.png',
px = 71,
py = 95
}
SMODS.Joker{
key = "jimbofather",
loc_txt = {
name = 'Jimbos Father',
text = {
'{X:mult,C:white}X#-2#{} Mult'
}
},
atlas = 'JimboFather',
pos = {x = 0, y = 0},
config = {
extra = {
Xmult = -2
}
},
loc_vars = function(self,info_queue,center)
return {vars = {center.ability.extra.Xmult}}
end,
calculate = function(self,card,context)
if context.joker_main then
return {
card = card,
Xmult_mod = card.ability.extra.Xmult,
message = 'X' .. card.ability.extra.Xmult,
coulour = G.C.MULT
}
end
if context.setting_blind then
local new_card = create_card('Joker', G.jokers, nil,nil,nil,nil, 'j_joker')
new_Card:add_to_deck()
G.jokers:emplace(new_card)
end
end
}
oops didnt mean to send it like that
You should send the error
its not an error my joker says Xnil
can you describe what's wrong or post a crash log
replace #-2# in the description with #1#
"X#-2#{} Mult"
the #-2# isn't the actual number it shows its what index in loc_vars it looks at
^^^
By putting -2 there it's looking for the -2nd variable in the loc list (which doesn't exist)
Why negative Xmult tho?
oh thats what you meant
no ik that already
fatherless
this happened when i hit play
change center to card
ok
that won't fix the error though
it wouldve been an issue later
Oh
oh

how so?
😔
too british that time
Honestly you could just make your return table this and it'd do the exact same thing:
return {
x_mult = card.ability.extra.Xmult
}```
a joker returning center.ability.extra.xmult
what do you mean global 
this part?
change the center field in your loc_vars function to card
yes
center is just a variable name, you could call it frumpus and lua would understand as long as you're consistent
I think you should read through the smods wiki and the VanillaRemade examples
You could but in terms of standards it's painful
no I completely agree, I just wanted to correct the misunderstanding
gotcha
now it says this
it's not working
what if you sent the code again but formatted
ok
like what you have now
how do i do that again
```lua
NOT IN THE CODE 😭
key = 'JimboFather',
path = 'JimboFather.png',
px = 71,
py = 95
}
SMODS.Joker{
key = "jimbofather",
loc_txt = {
name = 'Jimbos Father',
text = {
'{X:mult,C:white}X#1#{} Mult'
}
},
atlas = 'JimboFather',
pos = {x = 0, y = 0},
config = {
extra = {
Xmult = -2
}
},
loc_vars = function(self,info_queue,card)
return {vars = {card.ability.extra.Xmult}}
end,
calculate = function(self,card,context)
if context.joker_main then
return {
x_mult = card.ability.extra.Xmult
}
end
if context.setting_blind then
local new_card = create_card('Joker', G.jokers, nil,nil,nil,nil, 'j_joker')
new_Card:add_to_deck()
G.jokers:emplace(new_card)
end
end
}```
did it work
yes
enough
yay
show current code
what do yall think about this joker
are they really
yes
wait, i think now it works
change x_mult to Xmult
lmao
all of these work
you can undo the illusion by using your fingers to block out the rest of the image
they are indeed the same
gee wizz whats wrong with it doc
i know i just flipped the sentence around 😭
the original illusion worked because the letters were the same color, and this isn't getting the same effect
theyre also the same color
I am genuinely confused as to why this isn't working
doctor what happened
like youre not continuing from the same run are you
true
no
ok good
also i just tested, negative mult works
its new_card not new_Card
It wasn't
wouldnt explain the index error
are you serious
yes 😭
.mkv
error reporting sucks sometimes
not the mkv file,,
can someone helperino here? just a hint maybe? #1367354388540297246 message
remux recordings in obs to mp4
uh... it's not supposed to say X0 mult
COOKIE RUN KINGDOM
gingerbright is not in crk
fake fan
witchberry
Oooo an Isaac mod
bro reset the playing card
it resets every card for some reason
so probably the line xmult_count = xmult_count + 1 is not being reached
the chips part worked as intended
oh
its not supposed to reset every card
i was goofin
if G.GAME.blind and G.GAME.blind.boss and context.end_of_round and not context.game_over then
card.ability.extra.cards_played = 0
card.ability.extra.chips = 300
return {
message = localize("k_reset"),
colour = G.C.BLUE
}
end
reset code
What does your end_of_round check look like?
Ope lol
i think it looks like that astra
I think you're right
why do they spawn with an edition when this is my create_card
local card = SMODS.create_card({
set = 'Joker',
area = G.jokers,
key = 'j_para_bonnie',
no_edition = true,
stickers = {"eternal"}
})
(only sometimes)
Can someone help me out with this crash? Only thing I did was add some stuff for a spectral.
anyways you need to specify and not context.individual and not context.repetition in that check
and context.cardarea == G.Jokers
That also works
oh or that
why not both
well that would just be silly
From memory isn't context.main_eval equivalent to this or did I misunderstand it again
bro contexts are so cursed
probably misunderstood
i fixed it
(even tho they alr were)
but i made them the same color as in the image
Wdym 😭
now it works. previous version was barely visible
thanks dog
What I mean is I have no idea what that question you're asking means 😭
why do they spawn with an edition sometimes when this is my create_card
local card = SMODS.create_card({
set = 'Joker',
area = G.jokers,
key = 'j_para_bonnie',
no_edition = true,
stickers = {"eternal"}
})
maybe they're spawning in their own way
yeah if anyone ever has ideas for TBOI jokers, let me know (preferably passive items, gonna work on implementing an active item function later on)
what does that mean
they're my joker btw they do nothing with editions
oh lmao nvm
oh wait
just set edition to the base i think
cause no_edition is for random
would that be edition = base?
i can't test because editions arent that common
how do you put a code block without it starting a new line
for k, v in pairs(G.GAME.probabilities) do
G.GAME.probabilities[k] = v (do whatever math you wanna do to v here)
end
wdym
you mean like this?
yes like that
one backtick
how does this work exactly?
do i do 'G.GAME.probabilities[k] = v 50/50'?
50/50 is 1
if you want it to be halved probability
you want v/2
think of v as 1 here
alright so if i want a 50/50 chance i do
for k, v in pairs(G.GAME.probabilities) do
G.GAME.probabilities[k] = v/2
end
just like that?
Back
well no you want to use pseudorandom in that case
what's the key for base edition
and where would i put that
???
e_base i would assume
iirc yea
local card = SMODS.create_card({
set = 'Joker',
area = G.jokers,
key = 'j_para_bonnie',
edition = e_base,
stickers = {"eternal"}
})
``` this also does not stop bonnie from spawning with an edition
ok, wtf, why is it calculating differently when the other cards are not gingerbrave?
I’m still requesting Milky Way cookie and strawberry shortcake cookie
the one will all braves starts with first triggering their own base mult, then trigger +2 mult for each card BEFORE moving to next card
the one with 4 brights starts the same, but the +2 mult triggers each time AFTER the other joker completes their skill
@pure salmon here's how i did it, pretty simple patch that involves a card modifier (but can be easily changed to any variable that you can set on a card)
i'm assuming you're doing it for blinds
but i want you to know that my mod has a line that has a column 40132
modding takes time
but also, here's how i did it for challenges just in case @pure salmon
it's for a joker, prevents face-down draws and force-flipping cards
Yo, i have tried everything to my knowledge but i cant seem to make a card that has a 1 in 10 chance to go extinct and give you 200$. I would show what i got so far but i kinda crashed out and deleted the mod file so i had remake everything, anyone know how to make it?
how would i stop a joker from spawning with an edition (using SMODS.create_card)
setting the edition to base manually and no_edition = true both don't work
you could substitute and not (LR_UTIL.has_marking(card) == "fmod_ink_mark") to and not SMODS.find_card("j_joker_key_here")
who needs obfuscation
pseudorandom('seed name', 1, 2)
just do this
is that also why you send every message on its own line while people are trying to solve problems
?
idk how you guys can read lua code without be lost
thats just how i type in discord
Anyone able to help me with this?
bump
cavendish has all the ingredients for what you're doing except the $200, so start with that code and once you get it working add in the functionality for money
and also thats why discord doesnt show the big header of your username if you do multiple messages in sucession
so you can say multiple lines
Alright, thanks
without filling up the channel
Ill try it
wtf is the point of no_edition if it doesn't stop a joker from having an edition
this is a bad take
its not like im spamming on purpose
adding on to this how do i stop a joker from spawning with an edition
i just say stuff on several lines
because its easier to read without trying to compress an entire paragraph into one line
shift + enter
actually far better way, and it goes in whatever context you want it to trigger in
if pseudorandom('yourseed') < G.GAME.probabilities.normal / card.ability.extra.odds
in this case you'll set your locvar odds to 2
like if this was gros michel
if pseudorandom('vremade_gros_michel') < G.GAME.probabilities.normal / card.ability.extra.odds then
--code that kills gros michel
else
--code that does safe message
end
which gets across the same thing
that's a good question, I've gotten weird results with some of the fields in create_card. Have you tried manually setting the edition to be editionless after creating the joker?
also its because i hate people who are going
@keen totem is typing...
for 17 hours
why is thunk chat removed?
idk
how would i do that?
I got around to testing my joker
How do I fix the nil?
Can someone help me with this crash?
loc_vars
he felt like it was forced
gotta provide the code
Here's what it looks like rn
description?
this script is not working as intended. this is what i'm trying to do
- +4 mult when it scores
- +2 mult when each eligible joker scores (triggers before the other jokers start scoring if the other jokers are the same as itself)
- x0.1 mult when each eligible joker scores (doesn't trigger at all)
your total and goo rounds are swapped in terms of config but idk if that's the issue
i drew some jokers and i have no idea what to do with them
any ideas for these guys?
post them in #🎨・fan-art methinks
anyone knows why it's not working as intended?
where did they not
What do I do?
flipping the order of the total and joker rounds?
yeah
Gonna try that
can someone link the SMODS.rarity page?
is this balanced
hey, im making a joker that when sold halves the number of chips required by the boss blind, is there a variable i can access or way i can change the visible chips required? i've got the joker functioning fine, but i'd like to give a more clear visual cue for the player
seems very weak considering its cost tbh
like declaring a custom rarity
did you mean link
oh yeah mb
ok but *remove the embed
how
how about now
My custom rarity does not appear to be cooperating
Seems good lol, I like my Jokers insanely broken
Still nil
when does context.post_joker occurs?
youre never gonna believe this
Idk, but I moved it
like deleted it or
like... after each joker or after all jokers?
At the end
i mean it does say it's used for triggering editions so probably in that same level of priority
y,, you didnt close off your calculate before?
i tried using it and it did nothing
what's all the main_end stuff?
I think so, that was an accident, but the nils are gone now
guess i'll go the boring part and just... return the total value instead of triggering it one by one
so it gives +3 mult per card triggered, but only for 50 triggers? (or 100 in the revised version)
bump
It works now
yup
essentially the sin jokers for everything, but for a limited time only
you're increasing the xmult in an event, so it's going to get run after all the calculate code has finished
seems reasonable, I think 50 would be fine, just playtest and see how you like it I guess
i updated the code to be this but now there's no mult increase or decrease
I’m suggesting Someone to please do a antonblast face and suit skin for balatro
hearts because of red
Poker chips and heart beets = heart symbol on the cards
anton (Up = Normal ~ Down = Oni) annie (Up = Normal ~ Down = Oni) Danton (Up = Danton ~ Down = Annalyn) Nina (Up = Nina ~ Down = Brulo) = king
Brawlbuster Tallbuster Maulbuster Smallbuster = Queen
satan (Up = Normal ~ Down = Giga) jewel ghoul (Up = Jewel Ghoul ~ Down = Jewel Girl) freako dragon (Up = Freako Dragon ~ Down = Lil Freak) Ring-a-Ding (Up = Normal ~ Down = Biblical Angel) = Jack
So you're setting samehand to false, then in context.before you set it to true if it was the same hand. But then the calculate function ends without running the context.joker_main code, because it's not joker_main yet.
Then later, context.joker_main happens, and samehand is set to false, but the context.before code doesn't get run, because it's not context.before anymore, it's context.joker_main now. And then your context.joker_main code gets run with samehand equalling false
so basically wherever you check that it's the same hand being played, that's where you need to increase your xmult
why is this not triggering at all?
bump 
because you have a return statement in your for loop. Probably what's happening is that return statement is being reached before the other one, causing the function to end before the other statment is ever reached
do you have a localization entry?
I wasn't entirely sure where but I did put this in
thank you so much you beautiful soul
replace vremade with your mods prefix
oh
I think the key for both should be k_requiem, if I'm reading the docs correctly
I think no mods prefix but the docs are unclear
that makes a lot more sense I thought it was like a keyword
show the rarity declaration?
this?
hm
yeah idk, I would expect either k_requiem or k_prefix_requiem to work
you put the k_ before both the dictionary and the label versions, right?
surely it can't be how it's declared in the Joker file because the colour and everything else is still there
yeah that looks fine to me
the second part isn't working at all
it has to just be an issue with the localization entry
with and without the mod prefix
I have no clue, I would try to find other mods that implement custom rarity and mimic what they do
i was basing it off of how VanillaRemade does it
one last thing, where is the misc = located?
it's possible that context.post_trigger isn't true when context.other_joker exists
yuuuuuup
it's in descriptions
it shouldn't be
it's time for me to explode
that's what confuses me about the context
they seriously need to make it so you can collapse code on github i am so sad
can you describe the goal of your joker?
I know you put it up there somewhere but I forgot
- +4 mult
- +2 mult for each common joker when those score
I would try just getting rid of the post_trigger check
I think context.other_joker does what you want
is this balanced


