#💻・modding-dev
1 messages · Page 203 of 1
ye handname is nil somehow
ptsd
Im working with Malverk but it causes a crash, it mentions ipairs, but i dont see the issue, it works fine when i remove this code
AltTexture({
key = 'Blind', -- the key of the texture
set = 'Blind', -- define the object type that you are retexturing, see wiki for full list of types
path = 'BlindChips.png', -- the filename of your spritesheet, saved in assets/1x AND assets/2x
loc_txt = { -- [NYI] Localization text for tooltips displayed in the texture selection screen - can be added to a localization file under [descriptions][alt_texture]
name = 'Blinds',
text = {''}
}
})
agin
ur supposed to fill out ur text
no... it works if the text is empty
bcuz it has nothing to iterate over
it works, the other ones work just fine
thats what ipairs does
it iterates over a table
if theres nothing to iterate over it will ignore you
sounds like my dad
bro, i am telling you, it works fine if its empty.
he ignored me because i didnt have a table :(
thats because {''} is not a valid table to iterate over
its js a table with no keys and values
it gets better
okay... but why does all the other ones with {''} work
for example?
AltTexture({
key = 'Chips', -- the key of the texture
set = 'Stake', -- define the object type that you are retexturing, see wiki for full list of types
path = 'chips.png', -- the filename of your spritesheet, saved in assets/1x AND assets/2x
loc_txt = { -- [NYI] Localization text for tooltips displayed in the texture selection screen - can be added to a localization file under [descriptions][alt_texture]
name = 'Chips',
text = {''}
}
})
how would get the rank of a destroyed card?
i put text into the text, still crashes
i think :get_id() still works
text normally has 2-3 lines
the text isnt the issue.
u can js also remove text = [''} all together
then what is
i still have yet to see the error logs
what is at line 151
thats malverks mod, not mine
You can still look whats on line 151?
its just the word end.
like this?
Can you show with line numbers? (Like from 145 to 155 or sum)
latest version of malverk, ur atlas might be Broken
got it working.
gg
i needed frames=
Yoo
N'
Could you maybe help me? I get a strange error while copying code from the smods example mod
whats the error
is that something
did someone get pushed down the stairs
SMODS.PokerHand {
key = 'Royal Flush',
chips = 110,
mult = 9,
l_chips = 40,
l_mult = 4,
example = {
{ 'S_A', true },
{ 'S_K', true },
{ 'S_Q', true },
{ 'S_J', true },
{ 'S_T', true },
},
loc_txt = {
['en-us'] = {
name = 'Royal Flush',
description = {
'5 cards in a row (consecutive ranks) with',
'all cards sharing the same suit',
'made of only Aces, tens, and face cards'
}
}
},
evaluate = function(parts, hand)
if next(parts._flush) and next(parts._straight) then
local _strush = SMODS.merge_lists(parts._flush, parts._straight)
local royal = true
for j = 1, #_strush do
local rank = SMODS.Ranks[_strush[j].base.value]
royal = royal and (rank.key == 'Ace' or rank.key == '10' or rank.face)
end
if royal then return {_strush} end
end
end,
}
SMODS.Atlas { key = 'vulcan', path = 'vulcan.png', px = 71, py = 95 }
SMODS.Consumable {
set = 'Planet',
key = 'vulcan',
--! `h_` prefix was removed
config = { hand_type = 'ex_royal_flush_Royal Flush' },
pos = {x = 0, y = 0 },
atlas = 'vulcan',
set_card_type_badge = function(self, card, badges)
badges[1] = create_badge(localize('k_planet_q'), get_type_colour(self or card.config, card), nil, 1.2)
end,
process_loc_text = function(self)
--use another planet's loc txt instead
local target_text = G.localization.descriptions[self.set]['c_mercury'].text
SMODS.Consumable.process_loc_text(self)
G.localization.descriptions[self.set][self.key].text = target_text
end,
generate_ui = 0,
loc_txt = {
['en-us'] = {
name = 'Vulcan'
}
}
}
Error jumpscare
(My code that i copied and the error)
frfr
chat am i cooking
yees
Bro forget jimbo
we need tl;dr joker to be the tutorial guy
Whatss the key for the Sticker for Malverk
when does it crash
nvm
This is beyond cooking.
This is a congradulations.
When I press on run info
but now i need to figure out what the key is for the little stake stickers
works on my machine
Oh my god
latest
Later than mine?
Does destroy_card work on the new version?
yes
How do you get it?
git
i dont think yours is that outdated for it to matter tho the problem might be somewhere else
This better just give like +4 mult or some shit wtf
it gives +4 mult on high card
IT DOES
LMFAOOOOOO
if im not wrong
if hand contains a high card
💔
It no wrok
calculate = function(self, card, context)
if context.individual then
if context.cardarea == G.play then
if context.other_card:get_id() <= 6 then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
end
end
end
if context.joker_main then
if context.destroy_card and context.cardarea == G.play then
if context.other_card:get_id() <= 6 then
return {
remove = true
}
end
end
return {
card = card,
Xmult_mod = card.ability.extra.Xmult,
message = 'X' .. card.ability.extra.Xmult,
colour = G.C.MULT
}
end
end
There has to be an individual and other_card for it to work and increase mult
context.destroy_card doesn't happen at the same time as joker_main, same problem as before
put that if outside of joker_main
I feel like if putting the return outside its gonna delete everything
it's not
Do you maybe know how do fix it
no
I updated smods
idk then, i literally copied the poker hand and it worked
i dont think it's the consumable
Now it says other_hand is a nil
I removed it, still the same error.
it's context.destroying_card
are you booting up the same run
@ eldzey
Yeah
have you tried a new one
Its ok
Its not doing anything
let me try it myself
I wanna put that thing in an individual
Dude
I wish i can just rip the cards apart with my hand
if context.individual then
if context.cardarea g.PlAy ThEn
If CoNtExT.oThEr_CaRd:GeT_iD() <= 6 tHeN
cArD.aBiLiTy.ExTrA.xMuLt = CaRd.AbIlItY.eXtRa.XmUlT + cArD.aBiLiTy.ExTrA.xMuLt_GaIn
EnD
eNd
EnD
iF cOnTeXt.JoKeR_mAiN tHeN
rEtUrN {
cArD = cArD,
xMuLt_MoD = cArD.aBiLiTy.ExTrA.xMuLt,
MeSsAgE = 'x' .. CaRd.AbIlItY.eXtRa.XmUlT,
cOlOuR = g.C.mUlT
}
eNd
If CoNtExT.dEsTrOyInG_cArD aNd CoNtExT.cArDaReA G.play then
if context.other_card:get_id() <= 6 then
return {
remove = true
}
end
end
end```
Smods-main is the file name
do what i posted
top right corner in the main menu
Cant have a break
probably not the issue but you should update smods and balatro
if context.destroy_card and context.cardarea == G.play then
if context.destroying_card:get_id() <= 6 then
return {
remove = true
}
end
end
not my problem, smods might break if you don't
Its not that hard tho
which function do i hook for x chips
isnt xchips already in smods
For me its not about hard but about suggnificense
it is
But sure ill update
no but how do i hook it
like
is there not get_chip_x_mult or something
i guess not
i actually never checked that, sorry 💀
are you sure it's a debug plus problem specifically
ill hook myself then
like did it work without debug plus
IT WORKED
Yes, beacuse it happens when i use 3 or 2 to unlock/spawn a Planet card
THANK YOU
this is a shot in the dark but try removing the other mods you have installed and then unlock/spawn a Planet card in the same way
Now i can create the stupidest joker this community has ever seen
"Dis-honesty"
Joker that kills you
It works
I will show footage when im done making it
then it's another mod conflicting with debug plus causing the issue
shit happens 🤷♀️
there's probably some patch or function in another one of the mods that messes with planet cards in a way unexpected by debug plus
your planet card might be broken
Or even for that matter scroll into the same planet card page
SMODS.Atlas { key = 'vulcan', path = 'vulcan.png', px = 71, py = 95 }
SMODS.Consumable {
set = 'Planet',
key = 'Vulcan',
--! `h_` prefix was removed
config = { hand_type = 'ex_royal_flush_Royal Flush' },
pos = {x = 0, y = 0 },
atlas = 'vulcan',
set_card_type_badge = function(self, card, badges)
badges[1] = create_badge(localize('k_planet_q'), get_type_colour(self or card.config, card), nil, 1.2)
end,
process_loc_text = function(self)
--use another planet's loc txt instead
local target_text = G.localization.descriptions[self.set]['c_mercury'].text
SMODS.Consumable.process_loc_text(self)
G.localization.descriptions[self.set][self.key].text = target_text
end,
generate_ui = 0,
loc_txt = {
['en-us'] = {
name = 'Vulcan'
}
}
}
This is my code
And this is the error
try temporarily removing the badges function?
including the create badge
like just comment it out or cut it
can u pass string in loc vars
I removed this:
set_card_type_badge = function(self, card, badges)
badges[1] = create_badge(localize('k_planet_q'), get_type_colour(self or card.config, card), nil, 1.2)
end,
But still, same crash
it might be this then
yeah i'm not sure if you can
i've only ever done it through calling a localisation file
i am fucking asking because i wanna pass letter to the string
shrug emoji
So how should i fix it
yes you can
so you're making a planet card for royal flushes specifically?
right?
it's hard for me to read the structure i'm on my phone let me pull it up on my computer
Yea, no problem
what's that line in common_events
are you sure it's formatted like config = { hand_type = 'ex_royal_flush_Royal Flush' }
like with the space and all
alright i'll take your word for it then
did you define royal flush earlier in your code
like in the example mod
SMODS.PokerHand {
key = 'Royal Flush',
chips = 110,
mult = 9,
l_chips = 40,
l_mult = 4,
example = {
{ 'S_A', true },
{ 'S_K', true },
{ 'S_Q', true },
{ 'S_J', true },
{ 'S_T', true },
},
loc_txt = {
['en-us'] = {
name = 'Royal Flush',
description = {
'5 cards in a row (consecutive ranks) with',
'all cards sharing the same suit',
'made of only Aces, tens, and face cards'
}
}
},
evaluate = function(parts, hand)
if next(parts._flush) and next(parts._straight) then
local _strush = SMODS.merge_lists(parts._flush, parts._straight)
local royal = true
for j = 1, #_strush do
local rank = SMODS.Ranks[_strush[j].base.value]
royal = royal and (rank.key == 'Ace' or rank.key == '10' or rank.face)
end
if royal then return {_strush} end
end
end,
}
so this is just a straight up copy paste then
Yes
did you grab the assets then as well?
the example mod works for me
like for the textures
i think i got it
change the key from 'Vulcan' to 'vulcan'
keys are case sensitive
i had a similar problem the other day where i didn't notice i capitalised something by mistake so hopefully that's all there is
Still no
same error?
There's a way to make it so a joker can't appear in the shop right
Yes
can you post the code again
honestly just delete the code and re-install the example mod
you do have steammodded installed right 😭
SMODS.PokerHand {
key = 'RoyalFlush',
chips = 110,
mult = 9,
l_chips = 40,
l_mult = 4,
example = {
{ 'S_A', true },
{ 'S_K', true },
{ 'S_Q', true },
{ 'S_J', true },
{ 'S_T', true },
},
loc_txt = {
['en-us'] = {
name = 'Royal Flush',
description = {
'5 cards in a row (consecutive ranks) with',
'all cards sharing the same suit',
'made of only Aces, tens, and face cards'
}
}
},
evaluate = function(parts, hand)
if next(parts._flush) and next(parts._straight) then
local _strush = SMODS.merge_lists(parts._flush, parts._straight)
local royal = true
for j = 1, #_strush do
local rank = SMODS.Ranks[_strush[j].base.value]
royal = royal and (rank.key == 'Ace' or rank.key == '10' or rank.face)
end
if royal then return {_strush} end
end
end,
}
SMODS.Atlas { key = 'vulcan', path = 'vulcan.png', px = 71, py = 95 }
SMODS.Consumable {
set = 'Planet',
key = 'vulcan',
--! `h_` prefix was removed
pos = {x = 0, y = 0 },
atlas = 'vulcan',
process_loc_text = function(self)
--use another planet's loc txt instead
local target_text = G.localization.descriptions[self.set]['c_mercury'].text
SMODS.Consumable.process_loc_text(self)
G.localization.descriptions[self.set][self.key].text = target_text
end,
generate_ui = 0,
loc_txt = {
['en-us'] = {
name = 'Vulcan'
}
}
}
put the config back in
where's the steamodded header?
Up at the top
alright
This is just from my mod, i c&pd it in
Chat is this good?
no
Lol
Nah
Intentional
how do I make a mod that replaces the main theme?
Fck that, imma delete the hand. How do i create a blind
What about both?
maybe get the basics down before diving into making a blind
Like what?
hopping to another thing because you couldn't fix one thing is a surefire way of not learning
the royal flush card is pretty simple to make, so i would actually recommend getting that working
doubt
I re copy and pasted everything
how about you don't copy paste the code and grab the entire lua file itself
just slam it in your project
not in the main.lua, but in its own lua
i mean really the only things i can think of is folder organization problems or the steamodded header being different
yeah and that's going to be a thing no matter what kind of mod you want to make
mhm
just paste the RoyalFlush.lua into the same folder as your main.lua and see if it works
We dont talk about the 10 years old part of the clip
The best of both worlds
hmmm I don't remember how the old header works but maybe the problem is naming it main
i think it need to be the same name as the mod id
No my lua file is called main
oh ok
you can have multiple lua files in the same mod so it really shouldn't matter
It works fine
yeah they can be named whatever
unless you want to point to a specific file from a different file, but it shouldn't matter within the file itself
It works now
yeah it was probably the steamodded header then
because that defined some values that could have been different!
i would recommend learning the json one tho
or or you could have just copy and pasted it wrong 🤷♀️
the different prefix
😭
i remember now all the way up here
it should've been config = { hand_type = 'crjk_Royal Flush' },
Oooooh
god
Now it all makes sense

What mod(s) create custom tarot cards
there's documentation for that on the steamodded wiki
Thanks
Hallo it's me again. Do modded jokers with the legendary rarity behave the same as vanilla legendaries? as in, will it only appear via the soul spectral card
AFAIK yes
Yes
I've personally tested
Ooo okie thanks!
Thanks to everybody who replied to me before this too btw you guys respond so fast and make my modding journey so much easier
i fixed it
does anyone know what the res property on the config of G.UIT.C nodes does?
Something to do with drawing shapes I think
ok I'll just ignore it for now
welp i cant make good ui but i can make functional ui
I hope I can be an exception 😭
only issue rn is its just freezing on setup for some reason when i try putting actual mods in..
You were given a premonition lmfao
balatrodle....
ty
and/or just look in the extracted game files
i cheated
boooooooooooo
i just wanted to test self destructs stickers
check delayed gratification's code
Is that a mod
yes ....
Where is that code for that
in card.lua
card.lua
Oooh, i dont use that
yeah no one does it sucks
to be fair a lot of Balatro mods are named after Balatro objects
fire mod name tbh
I think it's a bad Joker name
mod is 3gb but it includes AI model
Yes, but if the mod is going to be as useful as the joker, the name wont save it...
Just you wait until you become gratified
AI bad
mod is 3gb but it includes 300 pages of Jimbo fanfiction
does anyone know how to pick a random card to add to the main menu? I have a card showing up but it's technically supposed to be random and it's just this one every time
LET'S GO
although there is a chance that I just have horrible luck
how are you doing it
i don't think you return like that
local main_menu_ref = Game.main_menu
Game.main_menu = function(change_context)
local ret = main_menu_ref(change_context)
-- adds a James to the main menu
local newcard = SMODS.create_card({
set = "Joker",
area = G.title_top,
rarity = "fvb_personality"
})
-- recenter the title
G.title_top.T.w = G.title_top.T.w * 1.7675
G.title_top.T.x = G.title_top.T.x - 0.8
newcard:start_materialize({ G.C.WHITE, G.C.SECONDARY_SET.Personality }, true, 2.5)
G.title_top:emplace(newcard)
-- make the card look the same way as the title screen Ace of Spades
newcard.T.w = newcard.T.w * 1.1 * 1.2
newcard.T.h = newcard.T.h * 1.1 * 1.2
-- make the title screen use different background colors
G.SPLASH_BACK:define_draw_steps({ {
shader = 'splash',
send = {
{ name = 'time', ref_table = G.TIMERS, ref_value = 'REAL_SHADER' },
{ name = 'vort_speed', val = 0.4 },
{ name = 'colour_1', ref_table = G.C, ref_value = 'FVB_PR' },
{ name = 'colour_2', ref_table = G.C, ref_value = 'FVB_SC' },
}
} })
newcard.no_ui = true
return ret
end```
stolen from maximus
(hi astra)
You aren't supposed to return that
That entire thing doesn't look right. Instead of calculate you should be doing add_to_deck and remove_from_deck
I thought it looked familiar tee hee
they call me the burglar
they call me the drink
please read the documentation
what is brother calculating on consumables
I'm not sure how it would work here, but I imagine create_card is always using the same seed
bro think he observatory
oh
well, that would make sense
I don't think the usual seed tools would work since you're not in a run
I mean, you could select one randomly manually
See if you can access the real world time
I had tried it before but I failed
I mean the game has a table of timers
G.TIMERS
hi, how do i display a message on my joker while a card is scored during a repetition? Because the message command displays it on the scored card and not the joker
It even has G.TIMERS.REAL
card = card maybe
Okie thanks i'll try that
message_card = card if what victin said doesn't work, athought I think it will anyway
Thank you!
It’s message card yeah
you can check @warm harness the wiki for things like this
why wouldn't card = card work here
finally
a raevyn w
card = card doesn’t do anything
then why do I put it on my jokers 
I should really get rid of the card = card in my calc returns now
Because you’re stuck in old calc land 🙃
-# actually I think most of these are from vanilla
It’ll only ever do something if there isn’t a card the game is using to calculate the effects on, which I don’t think ever happens
Btw Eremel since you're here I wanna know how you made Scenic Route cuz I wanna do some messing with Straight code and I am very lost, even after looking at your hook
Backs?
Flowey wrote scenic route
Ah dammit
Let me look at it though
I believe they’ll default to the top card of the deck
every time I make a card without any assistance I feel like a supergenius
I believe it just increases the straight length when there’s a pair
Basically the tl;dr is I made a similar hook that copies the SMODS get_straight override, added this (along with the initial variable declaration), and nothing else. All 5-card hands calculate as a straight with it 😭
quick question i want to make a joker that buffs itself on Small Blind and Big Blind like Madness but this context doesn't seem to work as it buffs itself on Boss Blinds too, despite and not context.blind_boss being included
you can use G.GAME.blind:get_type() ~= "Boss"
let me test that
interesting font
balatro brain rot
this doesn't work either
what if the deck is empty
let me try spacing it out
I don’t think you want to increase the length in a loop like that, from what I can tell the vals table is just a table of every rank that exists
Oh I see
Then it just uses the area
and not G.GAME.blind.boss 🍞
i found out the problem, it's meant to be spelled context.blind.boss not context.blind_boss
Use not G.GAME.blind.boss
Now I'm even confused as to how get_straight works than before LMAO
I believe it goes through the ranks and looks for matches in your hand but I haven’t really looked into it much
back to the drawing board then (or someone who actually fully knows how it does things)
Aure would know, he wrote the smods implementation
hey thats me
I honestly can't even blame him 😭
I think he meant he wasn't sure the original is the best one
not that he didn't know how it works
in lovely for patch priorities does lower value = higher priority or lower priority
lower loads first
👍
is there any more advanced logging for lovely and/or smods? the game seems to keep freezing indefinitely during the injection phase but im not seeing much info on why
regardless, I didn't get much out of him 
I would ask on the lovely thread
oh where's the thread at
thanks
What
Why
I wanna add discards
hm actually considering its failing here for example maybe i should ask smods
Not mess with decl
I didn't realize it was a consumable. What you actually want is use instead of calculate
and also you don't want to return it
Ooh, but thats how it was in the game code
for the record, add_to/remove_from_deck really just refers to when the card is added to its area
so when jokers enter/leave your held jokers for example
Oooh, that makes more sence, but thanks
Please look here
it was sent earlier but I think you may have missed it
er actually whats the steamodded thread called if there is one
thanks
we love steammodded
Can you create custom decks?
yes
yes
yo dock
Dock
I'm docking your pay
I did, i just took the first one - calculate
This happens to me after launching the game 100s of times
And didnt read the rest...
Ok but SMODS.decks only has the thing for custom friends of jimbo skins
But in my case it looks like a very tiny memory leak that just adds up
it's SMODS.Back
Damn you beat me
self worth
wow!
anyone know how to access hand size
For what purpose?
G.hand.config.card_limit
to add more hand size
oh
then yeah srock's suggestion is what you want
G.hand:change_size(1) to add one to it
thanks!
beat me to it 😒
is this how i do it
I win, what's the prize
weird thing is im just trying to test with basic mod setups. added galdur and it did this once but loaded the next time i launched it. adding bunco now it never seems to get past this
Does removing Bunco just fix it then?
really is this whole thing correct
ok i get it😮💨
you could just do mult = handchips/mult
yeah, although like also trying to load pampa for example freezes at this
hand_chips
yeah what astra/srockw said
-# beat me to it again. the fiends!
it no worky
guh
how do ppl do the small text in discord tf
-#
-# like this
basically it seems this is just kinda happening when i try loading mods in this setup. im wondering if with how ive set this modpack system up theres something going wrong where the mods are expecting a different directory than i actually have them in
-# extremely detailed instructions
it's markdown
-# pwease hewp
-# good morning everyone
i have at least found the steamodded debugger tool though
-# nuh uh
What does your directory structure look like?
good morning bepis
here is the function that still does not work
oh maybe i have to update hand text
😔
i forgot
so basically how im doing this is i execute the balatro exe with an argument lovely has that changes the mod directory, and add a patch that changes the save directory. the mods seem to be detected at least so its partially working
hmm wait hold on let me test a few other things
i might have another idea on how to narrow down this issue
if I want to load files with metadata, structured like the localization files, is the loading process for that the same as it generally is with lua, or is there some love2d/smods stuff I should account for?
how do i make the joker message use the config variables, like in the description
using #3# doesn't work
I have come up with the next batch of Smash Bros Joker ideas.
(I am doing them in order)
This doesnt work
What font is that
the balatro font
How do you get it in vs code
download m6x11plus onto your machine, then change the editor font family in your vscode settings
are these the proper context checks for a DNA-like scenario in which the played card is a singular "x" card? the joker doesn't do anything when the card is played. i referenced DNA for the first few contexts and The Idol for the other.card contexts.
and yes, i know it is a bunch of nested if statements 😭 i will adjust it to ands in post
Uhh
did you download the font
Yes
did you enter it like i did
are you sure you installed it properly
like check fonts
if you did then just restart vsc
what is cm_card
just restart vsc then
What font size do you use
18
a custom variable that functions similarly to The Idol's variables for my joker's purpose. i got it fully functioning this morning, so i don't think it's that.
how do i do something like with driver's license/cloud nine? (i'm trying to tally total face cards here)
you want to use the ease_discards function
is there a certain context i should be using because what i have now crashes "trying to index self"
Where?
In the use function, also in your loc_txt, text should be an array of strimgs
i think that might be the right context checks then
So "3"?
yeah, all it needs to check for is if it's a single card being played and if it matches the ID of cm_card
@old bane I came up with the next batch of Smash Bros jokers if you wanna see 😂
use = function(self, card, area)
ease_discards(G.GAME.current_round.discards_left = G.GAME.current_round.discards_left + card.ability.extra.discards)
end
So like this?
No, just ease_discards(card
ability.extra.discards)
yes show me 👀
will this work?
Wdym by this?
that's gonna trigger multiple times
i know that
crams you in a thread
config = {
extra = {
discards = "3"
}
},
Try it and see!
oh the context is way off, but yeah it kinda works
Wait, how does the SMODS.Consumable's can_use() work again
Is there a way to get the bought card type for context.buying_card? I want this effect to happen only when Joker cards are bought
context.card.ability.set
Me or saph?
saph
== 'Joker'
Thank you!
can_use(self, card) -> bool
Determines whether a consumable is currently able to be used.
Can i do like can_use(self, card) = true?
ease_discard
How was the localization function, or something like that
Like to display the "Nope" for the wheel of fortune
With the square?
Im pretty sure there was a easier way, like localize(C_Color_Purple, "Nope")
okay it seemed to be something weird that just came down to how i was running the balatro executable with java. ended up changing it to just go from java through cmd to run it and that resolved it i guess
there should be practically no need to call attention_text manually
using a tarot isn't integrated with calculation, but you can still use SMODS.calculate_effect
So there is no easier way, kinda like i described?
there is
Where do you want the text?
At the tarot card
Then use SMODS.calculate_effect
Is there docs for that
Yes
The calculate page
noit sure why i'm getting this crash, did i do something wrong in the event?
:add_event
That’s not using calc effect
yeah you need to use the function manually
Whats the effect im looking for called?
you want to put the table you're trying to return into calc effect instead
where {effects} is a table like the return table of a calculate function, and card is the card that is being evaluated.
just read
Making a deck that reduces the joker spot by 1
how do i do that
Wait
Oh nvm i did it
Is there a mod that does that? just curious
lets say i want to set hand size to a variable, how ould i be able to do that?
is there a way to view modded achievements in game after unlocking them?
not sure, but it's what steamodded does behind the scenes if you return something from a calculate function
is there a context for after discarding
Would this work
text = localize('k_nope_ex'),
scale = 1.3,
hold = 1.4,
major = used_tarot,
backdrop_colour = G.C.SECONDARY_SET.Tarot,
align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and 'tm' or 'cm',
offset = {x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and -0.2 or 0},
silent = true
})```
that's specifically not using calc effect...
Im laughing my ass out rn
But it's code from the base game
Thats why
SMODS.calculate_effect({ message = localize('k_nope_ex'), colour = G.C.PURPLE }, card)
the base game code works of course, but it's redundant
The k_nope_ex, can i edit it to anything?
any valid localization key
of course you're also free to not localize something at all and just pass a string directly
however i don't recommend it
Why?
Can you create a localization key?
yes
i want to put the discarded cards back to deck when you have 0 discards left
looks correct at a glance, does it work?
With the loc_txt?
any other method
is there an alternative to is_suit( that get's the cards actual suit?
Like, regardless of wild or the smear joker
loc_txt only allows you to provide descriptions for any objects you create or modify
dictionary entries exist by themselves, so you have to use a different method
card.base.suit
Oh, how do I create a text, like the k_nope_ex? (and how do i include it into the main.lua)
just read the page i sent?
Hearts
I keep bumping my head against it without finding a proper solve. If I have a bunch of metadata in a similar format as the localization files, what's the proper way to make that accessible?
haha, yeah, fair. I have a bunch of data on actors and movie budgets set up in a table, that I want to have accessible in the game
is it localized?
set up like this, but I've been diving into what the proper way to load stuff like this in is
oh i see
none of the data in there is player-facing
you can use SMODS.load_file for that
like local data = assert(SMODS.load_file('path/to/movies.lua'))()
localization files are processed automatically by smods
use SMODS.load_file for anything else
and how do i create a thing like k_nope_ex (I dont understand the syntax)
did you read the wiki page?
Ah, I suspected it'd be something like that, but I thought data in that case wouldn't be the actual data, but rather chunks. But I guess it'd all be one general chunk, in this case? I should read into this a bit more, because any file loading always makes me anxious that I'm just doing things incredibly inefficiently, haha
SMODS.load_file('path/to/movies.lua') returns a chunk to you
you then confirm it exists and call the chunk
how can i make an edition detect the card its been applied to is being removed?
there we go
Like do I do
name = "yes",
text = {...}
Yea
did you read the part of the wiki page that is about localization files?
Yeah
in order to be able to use it like localize('k_your_new_key'), you do something like
return {
misc = {
dictionary = {
k_your_new_key = 'Bruh!',
},
},
}
Ah okay, that makes sense. Good motivation for me to read more about lua generally, rather than just figure out if I can guess what things do based on the function names, haha
not v_dictionary?
v_dictionary if you have variables in your text
but then you also have to call it differently
Oh, yeah
localize { type = 'variable', key = 'a_other_key', vars = {'a', 'b', 'c'} }
What does the k stand for?
And is it needed?
how do joker unlocks work hellp
it's not needed, it's just thunk convention
there's different prefixes used there, I'm not exactly sure what each of them means
ay, everything's working now. Thanks for the help John! 😄
alright, basic lua question because i'm dumb - if i have an array of strings, how can i pick a random one from said string array? basically, i'm asking my_string_array[#what goes here?#]
Thank you John!!
call me Aure 🙄
Ohh, what colors are there?
john "Aure" smods
Haha, sorry 😛 Thanks for the help, Aure
mr john steamodded
search for self.C = in the game code in globals.lua and see for yourself (assuming you mean the G.C. colours. colors used in loc strings are a bit different)
look if it's your display name i'm going to use it 😛
fair enough lmao
(all in dumb fun we love you Aure you're one of the most helpful people in this community)
🔥
Mr. Jonathan "aure__" Steamodded
it's swapping out made-up names for each other so it's not like i can be mad or anything
no it says gullible
no
...can i do pseudorandom_element(my_string_array, pseudoseed('whatever'))?
it does until you show me your code
yes
can i see where that localization file is
can someone help me understand how joker unlocks work
Yes
im trying so hard to get the descriptions to show up correctly
what do you have currently?
they show up as the jokers' descriptions
the normal ones
and all variables in them are nil
i want them to display the achievement description for their unlock
you need to use locked_loc_vars to send variables to the locked description
locale is a placeholder, not the literal value you were supposed to use
how do i get the correct text to show up
i want the achievement text not the joker one
in your localization file add an unlock key which is just a list of strings that will show when locked
to the joker itself
so congrats, this change is dedicated to you
next to name and text
What are you supposed to use then?
...
there's a huge list right there of the values you're able to use
it says right there it can be any of these language keys or the key of a language you've created
why does my shit keep not working waaa
would a Joker be able to make use of some of the other contexts, like the Tag context for activating on the start of a shop?
ah, right. i was working on this.
yeah the wiki needs some updating
wait who added the starting_shop context lmao
it was added with shop util
that's the exact same timing as a context I had to add manually 😭
the shop utils are very cool
I was gonna do some updating (mod functions) but then I realized I cannot write good docs to save my life.
😭
the idea is simple, retrigger the leftmost joker for every bonus card
i strongly recommend you move the counting of cards into the context check, else you're looping over playing cards a lot of times for no good reason
if it's not working, you need to enable the optional feature for joker retriggers
(another thing that needs to be documented)
is there an update I have to get for the starting_shop context and stuff?
just the latest smods if you're behind
so i take the "iterate through every playing card we have" code and move it into context.retrigger_joker_check
i ate it
to be more broad
do i just move everything in the calculate section to the context section
😭
just SMODS.change_base
nothing is printing
also I don't think context.after hits G.play unless you're a playing card modifier
Is there an easy way to filter the pool to only get my jokers when using SMODS.create_card or do I need to create a custom objecttype? right now I'm hooking get_current_pool and removing anything without my mod's prefix
or do i keep the local num in the calculate section
Out of curiosity, has anyone else encountered a bug with Verdant Leaf with SMODS? Or have I induced a failure in Verdant Leaf behavior myself. It simply just doesn't debuff cards for me anymore
if you're just trying to test them
No, I want to have a way to create them in code
oh mkay
Like I'm making a booster rn
I think you need an ObjectType then
well time to refactor my code then
I think you can easily make your pool by looping through SMODS.Centers and filtering set == 'Joker' and mod.id == 'yourid'
I'll try that ty
good luck
Okay, huh
like this?
i hate the formatting on this
the return needs to be outside the for loop
Well I should start using this instead of my own lovely patch, I guess. In like a month lol
what is that indentation
it is pain to look at
but it does look like now the return is outside the loop at least
😭
i saved my changes, and
fixing your indentation might help you spot the issue 😭
there's literally nothing there thoughj
what does it mean by "unexpected symbol near "}""
syntax error
oh
what's near line 207 in doilus.lua
you might be missing an end for your calculate function, but it's hard to tell with the indentation
If I want every joker to basically always check a property of its neighbor, is the best approach to just do that in update, or is there a function to latch onto that handles the repositioning of jokers? I'm doing it in update now, and it works, but it feels inefficient to be checking information that isn't changing most of the time in the update function
i think what's wrong with this is that i haven't set num as a local var
check the value in loc_vars and before using it in calculate or any other places
but tbh putting it in update will have a negligible impact in performance
Wait I mean consumable
how do i make a joker that does something if another joker is present?
Like custom consumable, not a Tarot and not a spectral
yeah, that's true. I'm optimizing a thousandths of a frame away, probably. Or, I'm trying to, because I can't code well enough to actually call it optimizing
i think steel joker loops through the entire deck every update call
and checks if they're steel
damn
Yeah, I've got some jokers that still do that, rather than just do it in loc_vars, haha
if you can't find a better way, leaving it in update is probably fine
why is it still +nil
Okay, so here it checks for the ids (aka the played cards) to see if its rand is 6 or under
if it is then it increases the Xmult by Xmult_gain, which is 0.15
the problem is that when it happens instead of going from X1 mult to X1.15 mult it just goes like X1.2 Mult
and if there is a blueprint or brainstorm it doubles like wtf
But my jokers are checking to see if the movie jokers they neighbour share an actor, and if they don't, they're debuffed. So reordering the jokers should update it too, and I don't think loc_vars is a guarantee in that case
what's going on here...
that's not how loc_vars works, you return a list of values and in your loc_txt you put the index of the value in #
return { vars = { 0 } } and in loc_txt #1#, since it's the first valuue
I'm overthinking things. Not noticable in performance at all, and the moment it becomes noticable I have bigger problems probably
if the error reports that there is a bracket missing, you're missing a bracket. Just match the colours to find out which one isn't closed
no
if you did this it's wrong
ok yeah i did it backwards
num = 1
Please help
wait i got loc_vars confused with config
add a not context.blueprint check for the upgrading part
as for it doing 1.2 instead of 1.15, make sure to start a new run
@sullen fern
Okay thank you
#num# is not an index
And in this case, you're also no longer passing any info through loc_vars, so there wouldn't be anything to index
...
i really recommend you take a look at the example mod jokers, and how they pass info along to their loc_txt. 'num = 1' in this case should just be 1
I'd look into what the config is for as well, and how it allows you to not need to redefine variables in multiple spots across your code
Hi all. I've unsuccessfully tried on my own to update a mod that's recently started crashing. Any help is appreciated.
how do i make a joker equip when a joker (including self) is gained?
if next(find_joker("j_greedy_joker")) and
next(find_joker("j_lusty_joker")) and
next(find_joker("j_wrathful_joker")) and
next(find_joker("j_gluttenous_joker")) then
check_for_unlock({ type = "colorful_jonk" })```
where would i put this
like in general
num is a local variable, but you're trying to reference it outside of its defined scope
how so
referring to my message?
to this^
okok
add what
how much lua experience do you have
but it still should work like that from what i know
you should probably follow a tutorial on the basics,,
or take reference from the example jokers
and how they use variables
i myself am very stubborn when it comes to coding in languages i have no knowledge of
i just wanna make the funny jonklers....
what other languages do you know then?
to be honest i don't code that much
hi sorry to interrupt, but just wondering, how does one go about changing some of the names of the vanilla jokers for a reskin/texture mod? ik you'll have to get like, a localisation file n stuff, but i am gonna be real idk what im doing at all (EDIT: NVM I GOT IT)
function bonuscards()
local bonuscardammount = 0
if G.playing_cards then
for _, v in pairs(G.playing_cards) do
if SMODS.has_enhancement(v, 'm_(enhancement)') then
bonuscardammount = bonuscardammount + 1
end
end
return bonuscardammount
end
return 0
end ```
you could use something like this to check for bonus cards
its more efficent
patched this in, anyone has any idea why it doesn't work?
hm
again, i'd recommend looking at the example jokers for help with syntax
for help with syntax you really just want a helpful IDE
that will highlight errors and warnings
is having multiple source files as simple as including them in the main file?
Yo
sigh. i guess ol' notepad++ isn't enough
i personally use vscode
still doesn't trigger
patched into card.lua
no wait i get it
check here
i have vscode, now what
you could download some lua extension
isnt there a smods specific plugin for vscode
i think there is but i dont really know
ah, much better.
why would you need a smods plugin though
Get the lua extension
and then format your code with crtl shift i
cool animation!
sorry for barging in but i am absolutely stumped and not sure what did i do wrong
I basically am making a silly mod where it grabs every single mult, Xmult, and chips from other joker cards and basically adds them to the card, like some weird blueprint thingy
i made this for loop for it, and logically i think it should've worked, especially when i checked on how each joker is made in Balatro's code, but it just doesn't wanna DO IT
so how do i get this to uh
work with vscode
i did some poking around (and removed the debug messages before screenshotting it) but as it turns out it can't access them for some reason
you could start by iterating throught G.jokers.cards instead of using i
so like
that's what i did
^
for _, k in pairs(G.jokers.cards)
and k takes the reference for each joker you have
?
what?
i pressed ctrl shift i and this appeared
that's always there
Will do, admittedly it is my first time in dealing with lua but not my first time in dealing with programming in general
if ctrl shift i doesn't do it, just right click anywhere on the text and click the format document option
yeahhh for iterations also confused me at first
what did ctrl shift i do
it's the shortcut for "format document"
ohhh i see what formatting the document does
it probably made your file a lot longer, which is why you noticed the preview on the top right
you're telling me lmao
also quick question if you can answer me this, is there a way to let out an output to the console where it lets out what is inside each joker? i know i should convert something to string but not sure what is it
hmmm yeah, verdant leaf appears to be broken for some reason.......
honestly i never used the console ever, most debugging i've done is playing an animation on the boss blind to check whether an if statement is faulty or not
so can't help with that one, sorry

