#💻・modding-dev
1 messages · Page 451 of 1
not unpack
what is the goal here, in the code you sent you can just put all your code inside one if instead of making two separate ones
I want to know which was the winning hand
I was trying to store the last hand to see if it was a high card, then I want to apply things to it, but I cannot find the winning hand currently
here don't wrap SMODS.localize_box around {}
dont use 2 checks of the same thing in a context
I wonder how many times srock will say that tonight
i keep making the same mistake 😭
Ho you are right I did not see it
good thing i can just wrap this in a module when im done so i cant make it a mistake
Dumb question, where are editions for played cards evaluated in SMOD?
why does it appear here
is there a way to double the cash you earn at the end of a round?
how do i change the default color
how come my custom context here doesnt work? ive got this hook for destroying a joker and -1 and 0 print but 1 doesnt and i dont know why
local _card_remove = Card.remove
function Card.remove(self)
print('-1')
if self.added_to_deck and self.ability.set == 'Joker' and not G.CONTROLLER.locks.selling_card then
print('0')
SMODS.calculate_context({
osquo_ext = {
destroy_joker = true,
destroyed_joker = self
}
})
end
return _card_remove(self)
end
calculate = function(self,card,context)
if context.osquo_ext then
print('1')
if context.osquo_ext.destroy_joker then
print('2')
if context.osquo_ext.destroyed_joker == card then
print('3')
i know its weird but is it possible to move a joker over to the consumable hand
Yes.
.................
.....................................
.........................................................................
how
mr poly bridge i hope you encounter 
G.jokers:remove_card(card)
G.consumeables:emplace(card)
``` Perhaps?
alright lets try
how can i get the current selected joker
G.jokers.highlighted[1]
How do I change a joker effect and description if another specific joker is held?
you can check if a specific joker is held by doing if next(SMODS.find_card('j_prefix_key'))
it worked
you can change the description of a joker depending on that by returning { key = 'some localization key' } in loc_vars
is it possible to change the moved jokers negative to a consumable negative
Yes, but it requires patching.
difficult patching?
I'll test that thank you
also ill have to patch for situations like this
i think the blueprint patch is the easiest rn
just check if hes in jokers or consumables
and do his behavior in that area instead
uhh
You just change G.jokers to self.area
in that for loop?
Yes.
does anyone know how i can fix this? i added a event thingy but now it doesnt show at all after the round ends
at
whats this mean again
it will put your payload at the same indentation as the target line
it will make your dump easier to read when you're debugging
ok, I have been up and down the SMOD source and Balatro's source, and I can't find where editions of the cards are used in calculating the card's effect. Can someone signpost me? I need to hook into it
So what would I do if I wanted a card to have a 50/50 chance to do 2 things
1 makes ×mult go up and 1 makes ×mult go down
Its hurting my brain
use pseudorandom_element, it's a vanilla balatro function
you'll want to provide a seed for reproducibility
How do I use that
Which joker uses it so I can check the code
I can just base it off that
There should also be bananas in there that use it
Okok thank you
is there a way to get a localized name for an object (poker hand in my current case) from a mod
ive tried using localize{} but that doesnt seem to work for mods that define their loc_txt in the poker hand directly, is there a way to get it from there?
the stuff in loc_txt is put into the localization table tho
so you should be able to get it with localize
for a hand it should be localize('key', 'poker_hands')
Wait so how do I get that to produce the thing I want tho
tried that though but it doesnt return anything
local handname = localize{type = 'poker_hands', key = G.GAME.current_round.osquo_ext_throwawayline_hand} is nil
That is just picking a random consumable I want it to pick either option 1 or 2 of actions on thr joker either positive × or negative ×
cus that's not how you do it
oh
this is how
can someone tell me how to make calculate context for this one?
i thought theyd be the same
pseudorandom("some string seed", 1, 2) will generate a random number, either 1 or 2
it'd make sense yeah, but 
And then I just give 1 an action and 2 an action
localize{G.GAME.current_round.osquo_ext_throwawayline_hand, 'poker_hands'} still returns nil
i have a fallback that just returns the key instead so i know the key is correct
not {}, use ()
context.joker_main is probably the best time for that.
isnt working
aaaah that did it thanks lad
if pseudorandom("stuff", 1, 2) == 1 then
-- stuff for 1
else
-- stuff for 2
end
Why do the enhancements trigger multiple times?
how can i get the highlight of any nonowned card
like a card from a tarot pack or spectral pack
or just any card in shop
G.pack_cards.highlighted[1]
G.shop_jokers.highlighted[1]
Im seeing red after doing that
On 'then' and 'else'
I dont have discord on the device but ill take a photo
Idk i did the same thing he said
yes you did put it in the wrong place, you removed the function entirely
Wait what
calculate = function(self, card, context)
-- stuff here
end
if i make an atlas larger than 71x95 and use it for a consumable does it get downscaled to normal size or is it just large
can u make the example of the code?
Oh yeah forgot to add that
It will be normal size but it will not be downscaled.
larger
The card will not change size but the sprite will be the size you told it to be.
you will have to downscale manually
oh good
i dont want to downscale them i want them to be larger than normal cards intentionally
like wee joker
oh you can just upscale then
look at how wee joker does it
SMODS has a feature for this
well the sprites are already larger than 71x95
bump
ive found out my context does trigger when i try to destroy it with debugplus but not if it gets destroyed by dagger or madness, still no idea why
awesome
if context.joker_main and #G.jokers.cards >= G.jokers.config.card_limit then
return { Xchips_mod = 2 }
end
but it does work with ankh
even though there shouldnt be a difference
you're missing an end right before the closing }
how do i get to a consumable's name via G.P_CENTERS.c_<my consumable key>?
once you've done that I recommend ctrl + shift + i to let vscode format your code
localize { type = 'name_text', set = 'Tarot', key = 'c_death' } for example
Okay that made things worse
Nevermind fixed it
how would i check for an unscored card?
how can i tell which is highlighted
Hmmmm
i might be a lil stupid chat
What do you want to do exactly
everything in that array is highlighted
context.cardarea == "unscored"
thank you !!
i was going crazy trying to find anything similar in vanilla lmao
Okay well it crashes when it wants to be used
Can someone explain to me what an 'individual' context is supposed to me?
individual card scored
It means when playing cards are scoring.
ok, so this is stuff that comes from the cards themselves
like chips, edition effects, red seal?
gold seal?
No.
ok, then what is being referenced here?
nothing used by vanilla? just hooks for mods?
yes
That is not chips, editions or a red seal.
Doesn’t context.individual references to every card and joker individually but you’ll need to limit it by cardarea =G.play so its only played cards ?
oh yeah
No, it's only every playing card.
I need help with this someone tell me what's wrong here
So no jokers
i've tried this one and it crashed my game
Does that include full deck ?
Causes crashs coz extra isn't defined
Yes, because it's just xchips
is it? my b
should i use xchips_mod?
No, it's xchips
so individual is a context that is used by other cards looking at the card that is being scored?
Someone help idk what I'm doing wrongggg
bruh what is your config doing 😭
why is it commented out?
dont define your configs in an if
Idk
that wont work
Why not
when do you want the card to randomize its mult
When its triggered
It's for cards that activate on playing cards.
then that needs to be put in calculate
like walkie talkie?
Yes.
How and where
you need to put the if statement into calculate
what should i do?
Actually I just checked Xchips_mod should also work
xchips = 2
if (key == 'x_chips' or key == 'xchips' or key == 'Xchip_mod') and amount ~= 1 then
oh
Xchip_mod
My head hurts
just some of the things ive noticed
my game still crashed when i scored a hand
#G.jokers.cards >=
Would help a lot if you showed the error?
then return xmult = that variable
Si
I made some changes anyway and after moving it i got no errors just hoping no crash
dont rely on your text editor to tell you errors, rely on the actual game to tell you ewrrors
Yeah extra still is nil
because you cant define it like that
copy and pase your code here
ill show you what i mean
k
The problem seems to be something here:
Also I did change 1 or 3 things I I feel I made it worse
How do I make it send as code and not as text
ohh wait
wrap it in ```
the key to the left of the 1 key
SMODS.Joker{
key = "joker6",
loc_vars = {
name = 'gambling fever',
text = {
'by the power of the gods',
'you have 50/50 chance to gain',
'{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
}
},
atlas = "joker",
pos = {
x = 4,
y = 0,
},
rarity = 4,
cost = 20,
blueprint_compat = true,
calculate = function (self, card, context)
if context.joker_main then
Calculate = pseudorandom("12345",1,2) if 1 then
config = {extra = { Xmult = 50 } }
else
config = {extra = { Xmult = -50 } }
end
end
return {
card.ability.extra.Xmult,
}
end
```
good
Yes, it's G.jokers.cards not G.joker_cards
if context.joker_main and #G.joker_cards >= G.jokers.config.card_limit then
its gunna be painful everything thats wrong with mine
G.joker.cards, not joker_cards
if i wanted to have a calculation that does probability independently from oops all sixes, how would i go about that
specifically like, 1 in 2 chance to do this and else it does something else kinda thing
i've changed it but still the err tell the same thing
Use 1 instead of G.GAME.probabilities.normal
Oh I typed joker instead of jokers
ohhh its that simple awesome
my bad
It's G.jokers.cards not G.joker.cards
what is the G.jokers.cards do?
is it rlly that bad that its taking this long to get all the problems
It's the jokers that you currently have.
do u like my high card chat
ewwwww how u do that
High cards
im making a new smods pr :3
@drowsy heath ```
SMODS.Joker{
key = "joker6",
loc_vars = {
name = 'gambling fever',
text = {
'by the power of the gods',
'you have 50/50 chance to gain',
'{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
}
},
atlas = "joker",
pos = {
x = 4,
y = 0,
},
rarity = 4,
cost = 20,
blueprint_compat = true,
calculate = function (self, card, context)
local mult = nil
if context.joker_main then
if pseudorandom("gamble_odds") < (1 / 2) then
mult = 50
else
mult = -50
end
return {
xmult = mult
}
end
end
}```
that should work
thank you sm
i hope at least
ima run it now and see
study it and figure out what you did wrong so you can learn too
ah okay thank u again
The only thing I have here is a mod with a joker that returns all enhancements and a patch to use my function instead of card:set_ability
yeah that worked i js dk why the text wont show up
what text
stuff like this?
It works without the patch for some reason.
'by the power of the gods',
'you have 50/50 chance to gain',
'{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
} ```
oh the cards description?
oh wait to you mean the
bottom aprt
where it tells you what you can or cant get
yeah
can u help me with this one?
right here add a line that defines your config as
config = { extra = { highmult = 50, lowmult = -50 } }
I tried this, and I couldn't figure it out either, so unfortunately, no.
still blank
oh okay, no problem
and below that line add a loc_var that shows text like so
return { vars = { card.ability.extra.highmult, card.ability.extra.lowmult } }
end,```
also make sure you add a comma after the config line
well its still blank.....
key = "joker6",
loc_vars = {
name = 'gambling fever',
text = {
'by the power of the gods',
'you have 50/50 chance to gain',
'{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
}
},
config = { extra = { highmult = 50, lowmult = -50 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.highmult, card.ability.extra.lowmult } }
end, ```
weird...
uhhh
did you make sure to save and reload?
is there something like SMODS.has_enhancement for editions on jokers
yeah
what is it
yeah
im getting a yellow error in the software
what does it say, maybe its a clue
duplicate index
card.edition and card.edition.key == "e_modprefix_key"
whats parts is it highlighting specifically
the loc_vars for your added code and my loc_vars for the text
OH
I SEE IT
the loc_vars with the text needs to be loc_txt
not loc_vars
missed that
ima run it then
ok does anyone know why display size and pixel size are just doing nothing
ive tried this with multiple different numbers and its made no change
welp my mamas dead, lets see what is line 18- wait thats not your mod
huh
oh but i mean abt line 18
at the top
it says line 182
but
thats not ur mod
thats smods
so
something messed up internally
oh fgs
nvm it uses h and w not x and y
send your whole code again ima do another scan
just in case we are doing something wrong
beautiful art
what is on line 154
@mossy minnow
loc_txt
yippee
it is loc_txt = { right
loc_txt = function
i didnt it was that when u had loc_vars
if G.jokers.cards[i].edition and card.edition.key == "e_negative" then joker_count = joker_count + 1
this code no work
oh
Show full code.
it all works now
if context.joker_main then local joker_count = 0 for i = 1, #G.jokers.cards do if G.jokers.cards[i].edition and card.edition.key == "e_negative" then joker_count = joker_count + 1 end end return { xmult = card.ability.xmult * joker_count } end
nice
WHAT IS THIS HIGHLIGHTING 😭
idk
how do i add small text to it so i can credit you for the code
G.jokers.cards[i].edition.key not card.edition.key
wrap it in ```
nah no need to credit
i'm getting this error:
Code?
around here:
i gotta its mostly your script i cant say its mine
its your script except i just rearranged stuff around
with reference to:
I think you have to write it manually because it hasn't been loaded yet.
mm, unfortunate
Card Sleeves is able to do that, i'm assuming because it's using the vanilla decks
id rather be credited for something really big like this config ui lol, your small joker thing is fine to ahve as your own, since after all it was YOUR idea
so i'll change that, cheers
ig but if you help again ill make a card based on your help "coders kindness" "+15 chips for every krada card you have "
looks great btw
lol
first ui btw
ive made a patch to allow certain cards to ignore getting_sliced (allowing a joker to have an effect when it itself is destroyed)
problem now is that it triggers that effect when its destroyed by any means, including with debugplus and even when attempting to exit to the main menu (the latter of which causing a crash since the effect is to create a duplicate of itself)
is there a check i can do to prevent that while still letting it bypass getting_sliced
it not a bad idea tbf
only had 2 headaches
guys i need help wiith one joker lol
key = 'BONOISEMOD_music_onsight',
path = 'onsight.ogg',
volume = 0.7,
pitch = 1.0,
select_music_track = function(self)
if not G or not G.jokers or not G.jokers.cards then return 0 end
for _, joker in ipairs(G.jokers.cards) do
if joker.ability and joker.ability.name == 'onsight' and joker.area == G.jokers then
print("[BONOISEMOD] ON SIGHT en ranura activa - música activada")
return 100
end
end
return 0
end
}:register()```
this is my patch payload (into Card:can_calculate)
if (not self.debuff or ignore_debuff) and (self.ability.extra and self.ability.extra.osquo_ext_sliced_bypass == true) then is_available = true end
return false not return 0
ok ill try (im making a music joke r)
Yeah you can't refer to other items in the same table. CardSleeves can only do it because it's referencing vanilla localizations which are loaded before any modded localizations
(though technically localization files are lua code and you could do some janky self-referencing stuff)
okay so just an idea but a joker that works as a bank where you store your money in it and gain better interest than you would from a round ending
hmm, this doesn't seem to be working properly
i have no idea where to ask about this LMFAO so I'll ask it here
I'm trying to port balatro to wiiu and it's freezing on LOADING: localization
what do y;all think could be the issue lmao
the "yay!" is being printed
You need to return {key = key}
ah gotcha ^^;
like the most goated econ joker ever
plus nice defence for wrath
It's against the rules to discuss non-pc modding, I'm sorry to say
I mean technically I'm not exactly modding the game
...wait yes I am nevermind
alright then I shall figure it out myself
even then it's against the rules to talk about porting too
so erm the bank joker idea gud or nah
hi ice
mm, why's this happening? same code as before but with the issue before fixed
i could prolly think about this myself but im overstimulated rn and need some nudges, i wanna make this consumable able to "steal" items from shops or packs and put them in the players inventory (jokers, consumables, or deck)
Stealing a deck from the shop?
the deck as an inventory
like a playing card pops up in shop or pack
steal that and put in deck
oh i know what i did, nvm ^^;
also i want stealing an item from a pack to not trigger the pack to close as the player hasnt taken or used a card for themselves, but i think this behavior can be made by simply not checking for it
G.shop_jokers.highlighted[1] or G.shop_vouchers.highlighted[1] or G.shop_booster.highlighted[1] and you would do the thing I showed you before along with card:add_to_deck()
Along with the areas you already have.
the emplace stuff?
Yes.
having trouble searching for the message
what exactly does emplace do
is it like an add to area?
for consumables and jokers
so remove_card is removing it from that category/area and emplace is putting it in that area
Yes.
for the life of me i cant find any help on how to add custom decks to my mod
its all different stuff
so it would be
actually wait shop_jokers
cant consumables show there too
ill have to account for that wont i
No.
i havent added one to mine but you can try chekcing wiki
You would do card.area:remove_card(card)
its referred as SMODS.Back
What color is this text?
day old bump?
attention
none of these help me add a joker to hand for the deck asif it was a challange but i just want it to be a standard deck
or is that not possible
what do you mean by this 🤔
config = {jokers = {"j_modprefix_key"}}
and i just input the key of the joker i wish to use yeah ?
So guys I have this code
for i, v in ipairs(vanilla_jokers) do
SMODS.Joker:take_ownership(v, {in_pool = function(self,args) return false end}, true)
end```
The only jokers left are my modded jokers but the base joker still shows up. Is there a way to remedy this?
Yes.
So, I'm trying to get the tarot to target a table/set of jokers (currently 7 jokers) and replace them with a random joker of the same table/set
joker by default is the joker the game turns to when theres no other valid common joker to spawn
which, should ignore whether its in pool or not
i have no idea how thats related to localize
If I take ownership and modify it that'd solve the probelm right? Or would it spawn another base joker
oh,
my deck still wont show up
did you aupply atlas and key
oh wait nvm i feel stupid now
its not in j_joker code, if im not wrong
No.
its 2am for me i cant blame myself
so you want to patch somewhere
what resolution are the blind tokens?
I was trying to do a wheel of fortune type tarot
34x34 per frame?
my balala looks a lil funny
changed my approach to just hooking Card:remove but im still stuck at the game crashing when i try to go to the menu since it cant properly destroy the joker
any way to just check whether im currently exiting a run? or some other out-of-run condition so the game can remove it without crashing?
then you want to use pseudorandom for the probability and pseudorandom_element for getting a random joker part
i feel dumb where do i put the atlas in the deck code and what not
another roblox mod has hit the tower
also i should note i only started learning lua like 24 hours ag o
i can do basic jokers like x mult and + mult and art and all that
this one is peak wdmy
What is the goal?
just couple bits i get lost
how can i check if selection is a joker palying card or consumable
im trying to make a joker that duplicates itself when its destroyed
problem: cards are often given getting_sliced when getting destroyed which stops them from calculating
i can bypass that but that causes problem 2: the game crashes whenever i try to exit the run since the game physically cannot remove the joker because it keeps duplicating
if selection.ability.set == "Joker", if selection.playing_card, if selection.ability.consumeable
the fact that its selection.playing_card and not selection.ability.playing_card.....
Couldn't you get away with hooking Card:start_dissolve() instead?
thats a good shout ill try that
If I want to select a joker, should I go SMODS.Joker:get_joker? or something like that?
how do i check if the player is in the shop
is there an easier way to make boss blind tokens
I don't want to recreate the shine effect manually
no
Yes.
I see references of "back" all over the source code and in this community. Could someone help me understand what objects "back" and "center" are?
that doesn't exist, what are you trying to do?
🙏
back is a deck, center is an "empty" class used for making new object types ingame
End_of_round ?
like G.blind.in_blind but for shop
A type of wheel of fortune esque selection system that destroys a specific set of cards and replaces it with another specific card from that set
G.shop.in_shop this is a joke
ohhhhhh, thank you so much
real?
No
fake?
Yes
so its rela
you might want G.P_CENTER_POOLS.Joker or G.P_CENTER_POOLS.objecttypekey
Its laer
Just check for G.shop?
G.STATE == G.STATES.SHOP?
kinda like this, but add the set after?
i don't understand what you mean
that wroeke
guys whats the optimal play here
Full house
credit card in the booster pack
(using vremade as basis) in the parenthesis do I put like set = 'JMBOWHO_Doctors'
that's like a very specific function just for editions i wouldnt use that as basis for anything
ah
guys should i buy or sell my owned joker
Buy and crash the game
Yeah buy it again
if you want a random joker from the pool you can do pseudorandom_element(G.P_CENTER_POOLS.JMBOWHO_Doctors, "seed") or something like that
ok i bought it
is there a list of centers for editions and enhancements
so replace the local with that?
i cant find it because im Silly in the brain
okay i tried everything and i cant get my custom deck to work
Yes.
idk what im doingggg wronggggggg
Read the wiki
Is there a way to add this marker to a button
i found it without your help 
this funny little error made me think of an even better effect for my card
Oh no
oh if you're just using add_card you don't need the pseudorandom_element thing at all
When bugs turn into features
oh
should it be like this then?
indentation makes it a bit hard to read but it looks ok to me
cool
wait no
oh
the card you're destroying is the consumable
you probably want to destroy a joker or something
is it the card.T.r part?
you're also juicing up the card after it's destroyer
LMAO
all the parts where you use card it's the consumable
how do you add a card to the deck properly; simply emplacing it isnt making it shown in the deckview, nor is it increasing the amount of cards in deck
what should I change them to then? and is that all the cards?
table.insert(G.playing_cards, card)
check how SMODS.add_card does it
all the cards refer to the consumable yes
idk what you want to destroy, a random joker? a selected one?
pretty wrong
You still need to emplace it.
random joker of this set
that's a bit more complicated
oagh,
oh boy.
you need to iterate through G.jokers.cards and check if the card.pools has the objecttype
and then do a pseudorandom_element on that
and also do that in can_use
oki
how does one make an xchips card work
i have no idea tried to base it on xmult but ofc that doesnt work
Do return {xchips = number}
Man what the hell
like under calculate
Straight up looking like those paint chips at paint shops
so I do need to do local then?
yummy
Where do I put that tho
In calculate
Okay so its still not triggering it
Code?
key = "joker7",
loc_txt = {
name = 'puntoo',
text = {
'i dont know what this',
'even is but have {X:chips,c:white}X#1# {} chips'
}
},
atlas = "joker",
pos = {
x = 5,
y = 0,
},
rarity = 3,
cost = 10,
blueprint_compat = true,
config = { extra = { Xchips = 5 } },
loc_vars = function (self, info_queue, card)
return {vars = { card.ability.extra.Xchips}}
end,
calculate = function (self, card, context)
if context.joker_main then
return{
Xchips = 5
}
end
end
}```
idk what ive done but this is what i ended up with
x_chips
just from your calculate
my new idea for the card is use the card to bring a shop item into consumables where you can "save" the card to buy it later, dunno if this is possible
Still no trigger
what did you change
The Xchips in calculate to X_chips
case sensitive
Thank you it works now
it only takes strictly xchips or x_chips
nothing else
there's Xchip_mod but that does without message
But the rest of them dont matter? They are Xchips and the card works
it's not that it won't matter, it's that nothing will happen
see this line in steamodded that implements xchips
https://github.com/Steamodded/smods/blob/005335db2aa7566ff7e069bc3cae2323905fe6f3/src/utils.lua#L1283
it looks specifically for any of those three strings
prolly not possible
It is.
i've seen a mod do something like that
That sounds fairly possible
You can practically make anything, it's just the matter of how hard it is
Saw some guy put a playable Super Mario Bros game into a Joker sometime ago
without extensive patches
Cryptid made a Joker where it gives bonuses based on the number of members on their discord server didn't they
I don't think they update that
Ogh I thought it was a live count
I made multi-rank cards (joker-effect wise) a bit ago
idk, but yahi made a joker based on the game resolution, lower the res, the more xmult
it's supposed to be live (i don't think it's properly maintained) and manually updated as fallback
there is an http module thats supposed to live update it
this is extremely tame, you just never see it because it's funny but not practical
yeagh,
I'm seeing how you're wording this, but I am not wrapping my head around how to do this im sorry
How many jokers does cryptid add?
too many.
The wiki says 203, aij just hit 200
ratmilk since its your code i used on gambling joker could you help me figure out how to reuse it to have 3 different outcomes 1 being xmult 1 being xchips and 1 being dollars
Is there an easy way to get all of my modded jokers?
trying to make a booster pack with all of them
Yes.
how?
local jokers = {}
for k, v in pairs(G.P_CENTERS) do
if v.set == "Joker" and v.mod and v.mod.id == "yourmodid" then
table.insert(jokers, v.key)
end
end
Is there a way to not load a lovely file based on a conditional?
well can someone help i have some code that grants either 25x or -25x mult and i want to reuse it to give 10x mult or 10x chips or 10 dollars
is that like posible
global if statement
What is the goal?
this
since that one is conditional to only xmult idk how to change it to all 3
local chance = pseudorandom("seed", 1, 3)
if chance == 1 then
return {xmult = 10}
elseif chance == 2 then
return {xchips = 10}
else
return {dollars = 10}
end
Does G.jokers.config.card_limit store the player's current number of joker slots? And does it consider negatives? I'm trying to get # of slots available but unsure where this is represented
Yes.
it's a bit hard yeah sadly im not on my pc to write it down
I'll probably wait until you're able to and work on another card
cause my stank brain isn't a prolific coder
in game the chips and mult is coming as nil
and idk how to fix it when i dont know how exactly the code works
hello ?
So the state G.GAME.max_jokers threw me off. That's the current number of jokers the player has? Seems like a strange naming convention
okay erm so why is the values on my joker saying nil but still working
your loc_vars is wrong?
oh i dont have that i only have loc_txt thats why
is there a function i can hook that runs whenever a consumable is used
Yes.
....that is?
Card:use_consumeable
or something like that
you need to start actually saying what the answer is when someone asks a yes/no question thats obviously implying theyre asking for the answer to it as well
thank you
isn't there uhh
calculate-context
i'm not adding it inside of a joker or consumable
no like the hook
its a permanent effect thats applied by a consumable and then the consumable is gone
you can hook calculate_context and use the using consumable context yes
that's a function you can hook to
a real man never speaks ill of mr poly bridge
oh that's what i wanted to work on today but i forgot
a calculate function for mods
good thing i am a woman and also dont care
it was a joke chill
it is a little annoying when i ask for something but i phrase it slightly differently than is 100% clear so all i get is a "Yes."
then you ask how and they react 🤷♂️

key = "joker8",
loc_txt = {
name = 'clueless',
text = {
'i dont know if you should get',
'{X:mult,c:white}X#1# {10} mult',
'{Xchips,c:white}X#1# {10} chips',
'or +10 dollars'
}
},
config = { extra = { xmult = 10, xchips = 10, } },
loc_vars = function (self, info_queue, card)
return { vars = { card.ability.extra.xmult, card.ability.extra.x_chips } }
end,
atlas = "joker",
pos = {
x = 7 ,
y = 0
},
cost = 20,
blueprint_compat = true,
rarity = 4,
calculate = function (self, card, context)
local chance = pseudorandom("94738", 1, 3)
if context.joker_main then
if chance == 1 then
return {xmult = 10 }
elseif chance == 2 then
return {x_chips = 10 }
else
return {dollars = 10 }
end
end
end
}``` can someone explain why this is causing my game to crash when i hover over th joker
hovering crash means it's an issue with loc_vars
Can someone link the art resources thread? Discord sucks at searching for threads.
but whats wrong with it
send the error
you dont have x_chips in extra
this has likely been asked at least a 100 times by now but is it easy to get into balatro modding if you don't have much experience with Lua or with Love2d?
depends on what you want to do and how easy you learn new concepts
i recommend reading the pinned thread on #⚙・modding-general
ive coded before in a different engine but using a different language (c)
and it was very basic shit
so im not totally raw meat coding-wise but it's definitely a lot to take in at once
lua is easy if you know another language, but it has its quirks
line 226
atm im in the process of understanding Love2d but it is definitely very daunting
atm planning on doing a large-scale mod for a friendgroup with a Lot of mechanics
so definitely a larger scale than im used to
you mostly dont need to know love2d for balatro modding
would it be better to learn for navigation? or do you just need to have a grasp of Lua
just lua, you will mostly be using a lot of balatro's own functions
you only need love2d if you do something very low level
love2d is very bare bones engine so most of stuff has to be preprogrammed
define low level if you could
gotta say, i fucking hate how thunk did his ui, we should kill him
remake it then
hell no
would be fun
id die
i mean tbf its not like we're implementing the most insane shit ever I think really the largest deviation we had in mind was like. two rarities and a card that tracks IRL inactivity
why its just a bit of art
mostly very specific graphics stuff or controller stuff that's not handled by balatro's own graphics and controller system
id basically be remaking balatro
yeah thats fair
ok that makes sense
atm im pretty much almost fully versed in basic Lua so
it's just a matter of understanding how Steammodded works
yeah
well anyway ratmilk erm its still 226 causing me problems why is that
i trust your brain
ill prolly be taking a visit or two to this chat on occasion since like I said im practically raw meat
im always happy to help when im around
are you sure you reloaded the brain
'preciate it
yeah
im gonna try to understand steammodded
reloaded the brain?? am i high??
i recommend my own vanillaremade that has a lot of vanilla objects remade in steamodded :3
someone really needs to give smods docs a redo
i think i'm running in the right direction but if something goes wrong then i'll be here
i learned smods just from chatting here tbh
i think the docs are fine, just incomplete
my idea for learning balatro modding on a whole
i dont want people to tutorialize the docs
theres secret variables they dont tell you about in the main, only tell you about them through subtexts
which is REALLY annoying for some things
like what
like some contexts are hidden in the calculate subtexts
uhh theres return values hidden in message subtexts
the context page is incomplete yeah
also my suggestion is there should be a page called like idk "your first mod" and it is a short tutorial on how to set up a project, import atlases, sounds, and at least 1 of every type of preprogrammed moddable objects (jokers, consumable, decks, etc)
and goes into detail on what everything does
and how it works
like when i first started out
i thought config was a fancy way of storing data
so i used local variable
until i found out config SAVES the values PER CARD
i agree but i dont think that's should be "giving the docs a redo"
that just means we need more tutorials
but tutorials are not the goal of documentation
which is something that might not be appearant to new modders
not part of the redo, jsut saying, new modders need one
i agree, i dont think it's the fault of the docs which is what i was arguing
yes yes we do
coming from a clueless individual
i mean maybe i could try to learn all moddable objects then make a mod thats heavily commented
i was you like 3 days ago
there is one
oh damn
drago made it let me find it
will it help me with my problem
oh yeah your problem uhh
send screenshot of code (discords indenting sucks)
also worst part about me starting out clueless, my mod uses no spritesheets, no localiztion, and no multifiles, because im too deep in the mod to swap it all out
oh mine is just 1 .lua file with all my jokers in it and atm i have no art
whats wrong with them
what do you think #1# represents
you could say i have something similar going on
damn 😭
mine was once just a single lua file as well, i encourage you to aplit it up sooner rather than alter lmfao
i also encourage you to make a localization file
yeah this is getting unbearbale
i dont even know localization because im too deep
so what that for coz i got no clue
i didnt start splitting mine until i had like 50 jokers, several consumables, and etc
and it was a menace
my head hurt looking at that but give it when im more awake ill understand it and fix all my mod files
but rn i want to make everything i have work, i have a joker that crashes my game when my cursor is on it and i have a deck that just wont work at all
send your new joker code
its not so bad dont worry lmao
its just moving all of your loc_txts basically to one file where others can make translations if necessary later on instead of your descs being within your jokers
also please practice code formatting
if youre in vscode you can auto format it
and make sure you have the lua extension
how do i format the code i use visual studio
key = "joker8",
loc_txt = {
name = 'clueless',
text = {
'i dont know if you should get',
'{X:mult,c:white}X#1# {} mult',
'{Xchips,c:white}X#2# {} chips',
'or +10 dollars'
}
},
config = { extra = { xmult = 10, xchips = 10, } },
loc_vars = function (self, info_queue, card)
return { vars = { card.ability.extra.xmult, card.ability.extra.xchips } }
end,
atlas = "joker",
pos = {
x = 7 ,
y = 0
},
cost = 20,
blueprint_compat = true,
rarity = 4,
calculate = function (self, card, context)
local chance = pseudorandom("94738", 1, 3)
if context.joker_main then
if chance == 1 then
return {xmult = 10 }
elseif chance == 2 then
return {x_chips = 10 }
else
return {dollars = 10 }
end
end
end
} ```
anyway thats the joker code i dk why it wont work tho i dont get it
what the fuck is a localization, said the if language == "en-us" then
you should be able to do shift+alt+f i think?
otherwise just do ctrl+a, right click, then hit format selection
i use notepad++ should i switch?
i recommend vscode personally yea
shift alt f worked
then i settled on vscode
screenshot with linew numbers visible
i cant remember.... hold on
those are just release notes dont worry about em lmao
how do i open my project
but for your mod you can just make a workspace and add your mod into it and all that
226 extra a nil value
😵💫
226 is rarity
did you make sure you sved your code before reloading?
pro tipif you dont know: while in crash screen, press r to reload, while ingame, press alt f5 to reload
217 nil
i saved then formated it
how do imake a "workspace"
okay out of curiosity is there a variable for counting the amount of cards in your hand? my method works for now, but it doesn't account for stuff that puts you over the hand limit like DNA
Go to file and open folder, then use your balatro mods folder in %appdatq%
Thats what i did
ok i think i did it?
Yeah thats ur files
any way to move these menus around?
Oh I got no clue
these placement make me uncomfortable
Ik its rlly annoying but it grows on you when u get too annoyed to find out how to change it
honestly i like it as is, everything in one place and readily accessible
i want my explorer to be on the right side
Try dragging the top of it over to the right side.
oh dayum
whats the auto format key?
key = "BordBorn",
path = "borblinds.png",
px = 34,
py = 34
}
SMODS.Blind {
key = "Physik",
loc_txt = {
name = 'The Physician',
text = {
"Can't play more than 4 cards"
}
},
atlas = "BordBorn",
dollars = 5,
mult = 2,
debuff = {h_size_le = 4},
pos = { x = 0, y = 1 },
boss = { min = 2 },
boss_colour = HEX("813cef")
}```
this crashes the game when I try to view my blind
HOW DO I FIX TEH YELLOW
just ignore it
😭
if ur code worked then its fine
true but
You put SMODS and the lovely dump in your workspace.
the whole right side is yellow
uhh, how
guys my toe has dislocated erm im in pain
why did you do that
i dont want to smash it back in its gunna hurt
File > Add Folder To Workspace
uhhh wheres file
ok its all gud now im ok
MORE YELLOW
Try opening the Mods folder directly.
why does this code make my game crash
Log?
UHHH
No, File > Open Folder
ill be real i leave my shit yellow cause it does not impact me very much lmfao
but adding them to your workspace is a good idea
everythings gone
No, open the Mods folder.
With File > Open Folder
i just checked and adding it like that does in fact clear your workspace if you already established one
in the workspace youd want to select all 3 folders in the workspace instead of just your mod
i have a yellow here
I THINK I FIXED IT
no
im going to either cry or give up and just make the text just say it normally
no stick to loc vars
its useful
I sent the log
That's not fixable.
you can have decks or other cards edit how much mult that card gives
you really need to set up localization
lets set up localization together
i mean im fine with how it is and its legendary sooooo rarely gunna be used
im setting this up rn
how idek what im doingggggg
still
neither do i
we gonna find out
i think how it is is just
then you guys should make everything talisman compatible and then make it cryptid compatible and then make it everything else compatible
smiley face
so just make a file for all the different types of things
what about a folder and each thing has its own file to keep things organised
so jokers have a lua file each in a joker folder
some people do one file per joker, others just throw in a joker.lua in a jokers folder
just a preference thing
personally im just jokers.lua in a modules folder
hey guys look at my atlases
per lua is better for management though and i only have like 9 rn
WHY SO MANY IN ONE PLACE
I DONT UNDERSTAND
i dont use spritesheets 😭
the ctrl+f in question negates the management concern
or just scrolling
i mean like being able to configurate a specific joker without having to search through a big code file
my joker file is 5k lines long, i aint scrollin that lmfao
i just find its name
You don't put colours in localization?
idfk man
how do you set up colors
like im doing?
Are you referring to using them in joker descriptions or similar?
why cant I apply an atlas to my blind
It needs to be a ANIMATION_ATLAS atlas.
both idk
okay so they all have their own file what else do i need to do
we need to load them
mr poly bridge will tell us how
i think its SMODS.load_file(path)
SMODS.load_file("pathfromroot")()
why the extra () lol
Because it returns a function.
To execute as function.
You would need to put it in loc_colours then.
can i get like copilot or something to do this lol
what
load the files
main.lua is the only file running, in main.lua we gotta tell smods to laod the other files
Perhaps.
If you don't want to repeat SMODS.load_file(path) over and over, you could do a loop instead.
for _, file in ipairs{'file1.lua', 'file2.lua', 'other/file1.lua'} do
SMODS.load_file(file)
end
this ai is ass
color for my ui
oh fair enough
Missing the .lua extensions, but that would technically be correct.
why the code/ before it
Probably assumes the files are stored in the code subfolder.
...if you have a code folder with all of those, then yeah.
oh hell yeah they have this feature
multiselect
hold and and select to make anaother cursor
whats after that tho somet about atlas isnt it