#💻・modding-dev
1 messages · Page 252 of 1
how?
how are you guys pulling off stack overflows in balatro
explain it like im 3 years old and have holes in my brain mr ice
I've not ran into a stack overflow yet either, haha
i don't know man ;-;
opera gx, discord, visual studio code and balatro
boom
i have done my fair share of infinite loops
see thats your problem right there
youre using opera gx
btw are spectral tags called? is it tag_spectral?
it happened without opera gx too
i had to additionally close discord to get it going
see that's your problem right there
you're playing balatro
oh i never said not using opera gx would actually fix the balatro problem
i just said using opera gx is the problem
:B
its not that bad...
X1.5 Mult for every 1 GB of free RAM you have
guess im getting X-1.5 Mult then
no no no it should do the opposite
Whats happening
it measures how much free ram you have when you open the game, then gives x1.5 mult for each 1gb BELOW that measured number
so we can minmax by opening balatro, then opening 15 instances of minecraft at once
here's my new joker when you obtain it starts benchmarking your gpu and-
So, you have the key of the joker you're copying, right? That means you can use it to get the definition of the object by using it as a key in SMODS.Centers[//joker_key]]. For example, I might grab the atlas used by a joker by doing local _grabbedatlas = SMODS.Centers["j_jimbo"].atlas
If I want to know it's coordinates on that atlas, I'd do SMODS.Centers["j_jimbo"].pos and store that. If I then want my joker to copy that image for its art, I'd just set the atlas and pos of the joker who's art I wanna change, to the atlas and pos I grabbed
do you think with the jokerdisplays mod itd just look like a wifi test
are all your blinds bosses
yeah
fear
all of them will have phases :3
ok i think that explains it lemme try writing it
literally p2w
i am going to steal this when its done
if people keep joking about p2w jokers, I'm going to make it a reality by launching a shitcoin and tying it's xmult to its value
real
can i pay you for a lose joker
fuck p2w, we go for p2l here
i like that because its only p2w for people who invest, you could just download the mod and pray to god other people make sure the coin works
i mean, i'm planning a pump and dump, so I guess that's true
wait fr?
isnt that like
immoral??
uhm
people who buy crypto aren't people its fine
TRVTH NVKE!!!!
no, not for real, haha, I'm too technologically illiterate to set up a crypto by myself and too chill of a person to want to learn how to do it for a pump and dump 😛
hmmrmrnm
my plan on making money is ofc to make sure that Kino becomes very popular, and then make studios pay me to advertise their movie by adding a joker ❤️
ok im not saying this should be a perma fix im suggesting it as a debug test
-# meanwhile, 🧊 is already secretly scheming a balatrocoin nft project
its not immoral if i dont consider the morality
im very illiterate in lua
@thin anchor can you put PixelP_Finger.ogg in the base game sounds folder instead of in your mod folder?
making a new mod where jokers have to be traded as nfts
old pokemon fangame art of mine was stolen for an nft once 🥲 I felt scammed but also offended because I don't think anyone bought it
i have a feeling it might be checking the base game files instead of your mod's folders
might be wrong tho
do you mind if i take your joker art for the same thing
I didn't even know you could return sounds
oh, thats terrible
I literally can't claim any ownership over them considering they're literally just movie posters I shrink down, so I don't think I have a leg to stand on, haha
mfw gift card:
stongs
it's called a conversation
LOL
hurry up and make some art you get really attached to then so i can steal it
wait whered it go i was checking
pfft
Is the highlighted part in fig.1 correct? (fig.2 for reference)
ah ok then its specifically a problem with the play sound and not the sound file location
hmm
can you try calling play_sound directly
How could one make planets effect all hands?
You mean like Blackhole?
Yes.
i thinkkk you can just do string.find(joker_to_the_right.config.center.key,"j_Holotro_")?
like this
it's assets, not resources
if it helps any, engine/sound_manager.lua:63 is s.created_on_state = args.state and 197 is elseif request.type == 'restart_music' then RESTART_MUSIC()
uhhh
also the sound key needs to have your mod prefix
im pretty sure PixelP is the prefix
yeah its PixelP
No, I want the ingame planets to affect all hands.
What do you mean by "affect"?
alright did you change resources to assets?
yes
close but not quite. it fails if the joker you're checking doesn't have a mod
only art I've done for Balatro mods that's not mostly traced is for the confections and that art's not great, haha, sorry
is there a way to do a multiline comment in lua or do i need to add the -- to every line :/
--[[ like this ]]
--[[
]]
Instead of the planets specific hand, it levels up all hands.
ty
so black hole?
So joker_to_the_right and joker_to_the_right.mod and joker_to_the_right.mod.id ?
((joker_to_the_right or {}).mod or {}).id is how i would write that, but sure
Yes.
does the file name match with what's in the SMODS.Sound definition?
like this?
yeah so look at the code for black hole
no
does SMODS.poll_rarity return a key or a number?
does the path in your SMODS.Sound call match the file name?
it returns a number for the vanilla rarities
otherwise it returns the key
Ah okay, that makes sense. type checking it is then
i dont know
i dont know what im doing
i dont know where everything is
this isnt for me
Here, I highlighted the most important part.
wait have you even created the sound object, or do you just have the file?
just the .ogg file
oh i see
SMODS.Sound {
key = 'Finger',
path = 'PixelP_Finger.ogg'
}
you should just need this
Yes, but how do I make all the vanilla planets level up all hands individually?
in the sound.lua file?
Aure could you please explain this, i still dont understand what causes this
Would it be a voucher effect or a joker effect? (Even though there might not be much difference)
doesn't matter where exactly, just at top level in some lua file you're loading
Voucher.
I'll type it out, it's gonna take a while.
uhhhh
I'm not sure why the whole return table is inside extra but that shouldn't cause issues
doesnt make sound
im using the example jokers mod lua file if that helps
💔
ill try with it normally and see if that changes anything somehow?
I'll assume this is on latest?
if context.using_consumeable then
if context.consumeable.ability.set == 'Planet' then
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=localize('k_all_hands'),chips = '...', mult = '...', level=''})
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2, func = function()
play_sound('tarot1')
context.consumeable:juice_up(0.8, 0.5)
G.TAROT_INTERRUPT_PULSE = true
return true end }))
update_hand_text({delay = 0}, {mult = '+', StatusText = true})
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.9, func = function()
play_sound('tarot1')
context.consumeable:juice_up(0.8, 0.5)
return true end }))
update_hand_text({delay = 0}, {chips = '+', StatusText = true})
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.9, func = function()
play_sound('tarot1')
context.consumeable:juice_up(0.8, 0.5)
G.TAROT_INTERRUPT_PULSE = nil
return true end }))
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.9, delay = 0}, {level='+1'})
delay(1.3)
for k, v in pairs(G.GAME.hands) do
level_up_hand(context.consumeable, k, true)
end
update_hand_text({sound = 'button', volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
end
end
end```
is there a resource somewhere on how to get started making a mod
This should tell me each variable per round, right? like first round is the first variable, second round is the second variable, third round is the third variable
calculate = function(self,card,context)
if context.before and context.cardarea == G.jokers then
i = 1
if i = 1 then
debug(card.ability.extra.jkey)
i = i+1
elseif i = 2 then
debug(card.ability.extra.jatlas)
i = i+1
elseif i >= 3 then
debug(card.ability.extra.jpos)
i = 1
end
end
end```
someone get the copypasta
what is debug
ty
custom function i made for debugging
function debug(txt)
attention_text({
text = txt,
scale = 1.3,
hold = 1.4,
major = aura_card,
backdrop_colour = G.C.RARITY[4],
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
})
end```
i recommend choosing a different name
why :?
there's already a global debug
oh
you'd be breaking anything using the debug library
that may get in the way
other than that your if statements are incorrect
there we go, ctrl+f changed all debugs to have my mod prefix
you're using single =
i always forget the second one
using a normal return table didnt change anything
just tried this and it worked just fine for me
How would i make so that all packs/vouchers/cards can appear in all card areas in the shop?
jesus christ
That upgrades the hand it normally upgrades then all hands.
What?
im just imagining the amount of packs lmao
wait, i just realized
is this like, for a deck?
i think cryptid does this on a deck
you don't happen to have this on?
downloading cryptid to check their code
Record it with Win+Alt+R and show us.
oh
no aure the issue is another
i disabled the upgrade message when making that video just because i found it mildly annoying
No, voucher
the issue was the scaling of the perm mult
But I'll make a deck that starts off with that voucher
that much is expected
how so?
you're scaling it as the cards are already scoring
that's too late, joker effects happen after the bonus chips/mult apply
if you want it to apply to the same scoring cycle, you need to do it earlier
thennnnn i suggest getting the code for magic hat and replacing the references to cards with references to packs
lemme check that
context.check_enhancement?
... no?
most scaling that should affect the current hand's score happens in context.before
Wait, I understand what you meant now.
Unfortunately, it would require either a hook or some patches.
No, like the vouchers can appear in the booster pack slot, everything can appear everywhere
oh that
What if it leveled each hand individually?
doesnt seem the most balanced lmao but lemme figure this out
thats just a bad idea cuz youd have to wait ages
Everything, everywhere... all at once?
doesnt cryptid do this
Black Hole code technically does level up each hand individually
what does it? cuz i checked the wiki and didnt see anything
You can also consider skip over the hand the planet already leveled up by using if.
What do you exactly mean by this?
Nothing, just a cheeky reference.
~~https://en.wikipedia.org/wiki/Everything_Everywhere_All_at_Once~~
How?
The Deck of Equilibrium is a deck added by Cryptid that allows all cards to appear in the shop at equal rates, in any shop slot. For example, it's possible to encounter...
ohp yurp i just checked the lua
there it is
Before:for k, v in pairs(G.GAME.hands) do level_up_hand(context.consumeable, k, true) endAfter:for k, v in pairs(G.GAME.hands) do if context.consumeable.center.config.hand_type ~= k then level_up_hand(context.consumeable, k, true) end end
anyone can help me find out why my localization suddenly broke? it only returns 'Error' instead of tthe actual message
Kinda like this
yeah then youll wanna just copy the code from cryptid's equilibrium deck
and change it how you see fit for modifications
but i do wanna write down my initial idea
is there a guide for making custom decks?
What is above misc?
As in, what is misc key to?
Because I notice your brakets have different set of colours with mine.
I guess its this?
local gp = get_pack
function get_pack(k, t)
if G.GAME.modifiers.cry_equilibrium then
if not P_CRY_ITEMS then
P_CRY_ITEMS = {}
local valid_pools = { "Joker", "Consumeables", "Voucher", "Booster" }
for _, id in ipairs(valid_pools) do
for k, v in pairs(G.P_CENTER_POOLS[id]) do
if not Cryptid.no(v, "doe", k) then
P_CRY_ITEMS[#P_CRY_ITEMS + 1] = v.key
end
end
end
for k, v in pairs(G.P_CARDS) do
if not Cryptid.no(v, "doe", k) then
P_CRY_ITEMS[#P_CRY_ITEMS + 1] = v.key
end
end
end
return G.P_CENTERS[pseudorandom_element(
P_CRY_ITEMS,
pseudoseed("cry_equipackbrium" .. G.GAME.round_resets.ante)
)]
end
return gp(k, t)
end
But man, what is happening?
average cryptid code
its just where things like custom messages go in most mods
some would say it's... cryptic
is there a function that randomize things
theres pseudorandom but i dont understand its api
I'm just curious why you have different colours of brakets than mine.
can't find that in the documentation
probbly just a theme i have
OK, I thought it was because the layer were wrong.
yeah me neither, thats why i dont know its api
but its the random function balatro uses thats influenced by the seed
its not something added by smods, since it exists in balatro already i think
Your indentation is... weird.
does anyone know how to make custom decks? i cant find the documentation on it in the smods wiki
Have you checked SMODS.Back?
I changed it to context.consumeable.ability.hand_type and it worked.
oh thats what that is? i didnt realize cuz its like
just a list of commands, its not an explanation like the rest of the wiki pages lmao
in which lua, i can probably read them from the source
i saw this when looking up deck in the smods github but clicking on it takes me nowhere
I mean like this /jic
https://github.com/Steamodded/smods/wiki/SMODS.Back
ah ok
well yes i have
im pretty sure the smods.back is like, general commands for everything listed under the smods.center area of the wiki but i skimmed so idk
i just read the parts that are relevant to me in that moment
no, SMODS.Back is a custom deck
ah
how doth challenges display
wdym
i dont think so, just defining it should add it
yeah this wiki page sucks i have no idea what im reading :V
whys it so sparse unlike the other pages
are you loading that file correctly?
here be the main
do assert(SMODS.load_file('challenges.lua'))()
is your mod prefix "b"?
i did that at random yes
crashes saying the sound doesnt exist
mod prefix?
PixelP
Then sound = 'PixelP_Finger',
i swear i am a single celled organism my god
urrrrrrrgggg
May I see your assets folder?
Um... I believe someone already told you it's assets not resources so... yeah...
hai modding-dev
im so done with this
changed it to assets! crashes! hooray!!!
how do i make an edition randomize its x mult on apply?
basically just how do i access the edition values from on_apply
OK so RandomDude changed it to assets and it didn't work, which I don't know why, or how to help, either.
they didn't have a SMODS.Sound definition at all
It's added just earlier:
file structure
yes
Now that's a TIL.
🪦
how is it supposed to know that you consider the parent folder to be the root?
err
I originally thought the game wouldn't even load the mod at all if such thing happens.
local this_card = context.scoring_hand[i]
if this_card.config.center_key ~= 'm_stone' then
if not SMODS.has_enhancement(this_card, 'e_polychrome') then
this_card:set_ability(G.P_CENTERS.e_polychrome, nil, true)
end
end
end ```
this isnt how you set polychrome right?
would it be set_edition?
You'll need :set_edition, yeah.
ahh
bump
Wait, really!?
Did you start a new run, or continued a previous run? (Might not be the issue, but start a new one just in case)
she error on my thread until it Oops! The game crashed:
look at all my previous messages
Don't you have to put a k_ in front or is that not required
You're not supposed to type resources in the string either
i believe you're supposed to use SMODS.Path
and then use assets in that
I ask to see the sound definition and the json file again
So I just purposely and temporarily changed one of my sound file's filename, and the error I get is this, which is different than yours.
hmmm
why did you add the prefix to the sound definition
uh
Thank you john smods
it gets added automatically
i thought it would help
local this_card = context.scoring_hand[i]
this_card:set_edition(G.P_CENTERS.m_polychrome, nil, true)
end
delay(0.3)```
for some reason its not turing the card into polychrome :)
new error @frosty dock
set_edition('e_polychrome', nil, true)
it worked fine before
also i tried
it just broke at some point
I see
Anyone good at coding could help to create a really good touch screen mobile controls mod like Balatro mobile but much better if it's possible (I know there is a mod called Mobilelikedragging but it's not the only thing I want plus it's buggy) and you will be asking a reason why I need this it's because I play touch on portable mini laptop
I'd like to stay optimistic and say you solved the sound issue, which could be unrelated with this one.
im just wondering what it means because i didnt touch the atlas
are you doing anything with the atlas
no
then remove it
Let's see your assets folder again, shall we?
After you remove the atlas, yeah.
is there a way to add a Polchrome name to your Joker?
whatd i do wrong? :(
SMODS.Back{
key = 'booster_deck',
loc_text = {
name = 'Collectable Deck',
text = {
'{C:}Booster packs{} show up instead of',
'cards in the shop,',
'{C:}Reroll{} cost is double.'
}
},
atlas = 'dick',
pos = { x = 0, y = 0 },
config = {
reroll_cost = 10
}
}```
well i do need the atlas for the jokers i believe, im not sure
if you mean dynamically, like changing a jokers name to look polychrome when it shows up as polychrome then thats either impossible or REALLY hard i think
loc_txt, not loc_text.
hmm okay
i may be stupid
No, this mistake might be more common than you'd think.
mainly cuz youll have to like somehow take hold of polychrome's code in order to add the information that would let you change the joker's loc_txt and afaik you can only take ownership of jokers
on top of that youll have to design up a polychrome attribute for the text
hmmm, im just trying to change it now in general
and its just not working
these colours grrr
yeah joker names are notably hard to change with text attributes
but i know @sonic cedar got it to work once using {C:inactive}
brink of insanity
what huh hi who
hey toma
hi
whats the thing
theyre trying to apply text attributes to joker names
and ik youve done that before so i tagged you
oh legit nothing so far
oh ok
ive been playing around with the colours you know
trying to get to work to begin with
you got a localization file?
no i dont
you uh
you should start with that
o7
localization.json or lua
wait sorry so i create a folder for localization
and then i make a file called default.lua
do you alr know how to set up a localization?
hi
you make en-us.lua
in localizations folder
okay ill make en-us.lua then
i don't have default
all this for a silly colour change
-# dick
frick my big chungus life
big big chungus big chungus big chungus
lowkey miss 2018 sometimes (im lying)
it only gets worse in uni!!
but yeah default is well default
it applies whenever stuff like en-us isnt found or working
since you have nothing you honestly could just put en-us
can confirm
can also confirm
okie awesome makes sense
think of it as a fallback
how do i modify reroll cost with a deck
wait toma would it be easier in dms?
i tried using the api reroll voucher used and it broke :(
SMODS.Back{
key = 'booster_deck',
loc_txt = {
name = 'Collectable Deck',
text = {
'{C:}Booster packs{} show up',
'instead of cards',
'in the shop,',
'{C:}Reroll{} cost is double.'
}
},
atlas = 'dick',
pos = { x = 0, y = 0 },
config = {
G.GAME.starting_params.reroll_cost = 10
}
}```
hello, devs
I have a custom cardarea, but when you try to take a card and the area's full, it shows the "no space" text on the consumable area
is there a way to change that (probably a lovely patch)
attempting to make a booster pack, it keeps crashing at this part in the localize() function
loc_target = G.localization.descriptions[(args.set or args.node.config.center.set)][args.key or args.node.config.center.key]
end```
this is the pack declaration
key = "zodic_1",
set = "Booster",
atals = "zodiac_booster",
pos = {x = 0, y = 0},
loc_txt = {
name = "Zodaic Pack",
description = {
"Choose {C:attention}#1#{} of up to",
"{C:attention}#2#{C:zodiac} Zodiac{} cards to",
"be used immediately",
}
},
cost = 4,
weight = 1,
draw_hand = true,
config = {extra = 3, choose = 1},
loc_vars = function(self, info_queue, center)
return {vars = {center.ability.choose, center.ability.extra}}
end,
create_card = function (self, card, i)
return create_card("Zodiac", G.pack_cards, nil, nil, true, true, nil, "pack")
end
}```
you can hook G.FUNCS.check_for_buy_space
i think it should be "text" instead of "description"
Does anybody know how to do this?
How do I get a specific booster pack?
Something like booster == "JumboMegaPack
what do you mean by get, what are you trying to do?
What do you mean
yeah that was it...
do any of you have a joker that gives playing cards permanent mult when scored?
Like if _card.booster.name == "joker_normal" then or if _card.booster.type == "joker_pack then
if context.other_card:get_id() == card.ability.extra.white then
for k, card in ipairs(context.scoring_hand) do
assert(SMODS.change_base(card, nil, 9))
end
end
end```
Is this syntax not correct?
now I just need to figure out why my atlas isn't working lol
booster.config.center.key == "p_boosterkey"
oh look zoodia- oh wrong mod
this looks right, thanks
omg void hello
ALSO ZODIAC PACK RAAAGRH
EVERY TIME I SEE SOMETHING RELATED TO ZODIAC
i love drident
zodaic... 🥀
i cant get this to work im gonna tweak
surely this should work
atals = "Zodiac_Booster", pos = {x = 0, y = 0},
key = "Zodiac_Booster",
path = "reverse_boosters.png",
px = 71,
py = 95
}```
🤔
AHHHH
what are the actual line numbers
can you send a screenshot
its slightly different cuz attempts to debug it to no avail
but this reference should be correct, right?
you cant just change G.GAME in a table like that
for balatro playing cards, how do enhancement textures work? i ask because if i look at wild cards they obscure the suit like so
atlas*
other than that it seems fine?
Ahhhh
so then how do i modify reroll price in a deck?
i can see the spade still lol
itis hard
it shouldn't be, I know how these words are supposed to be spelled
i spent an hour troubleshooting a joker of mine because i mispelled one of the optional smods features
so it just wasnt enabled
you probably need to put it in apply i dunno i havent made a deck yet
it's probably something you have to do with an event in apply, yeah
is there any example mods that have enhancements?
mine 😎
It looked right, but not it. Gives a crash instead and I also tried _card.config.center.key == "packkey" but that ain't it either
there should also be one in the smods examples
oh wait those are editions
I cen never get it right 💀
see the thing is
we are so back
i am super unfamiliar and intimidated by how modding works with lua/balatro
now let's see if they actually work
oh I see
im more used to modding frameworks like tmodloader
and this is very different
to me
where are you trying to do this
honestly its not so bad, smods wiki is very helpful and you can always look at countless mod repos to learn how to do stuff
the method of stealing someones code and breaking it to learn it helps loads
and what's the crash
well you can actually look at my mod to see a really simple edition
I can send it in here rq
Bring the chaos of Friends Vs Friends to Balatro. Contribute to rae-vyn/FriendsVsBalatro development by creating an account on GitHub.
should have probably told you this but I'm doing patches not any smods stuff
very coool
thank you!
this is the effect, btw
with the terrible shader 😭
I'll pay aiko 200 RaeBucks to make a better one
Green
ok, but what are you doing and where?
Green
greeb
btw snaz
what mod are you working on
I see you in here a lot
wait thats still an edition though
misc_functions.lua and I'm trying to check if a spesific booster pack was opened
yeah that's what I was saying
an enhancement is pretty similar though
yea should be
just instead of a shader i assume it will be atlas stuff
yeah
i don't see a function that uses _card, which one are you changing?
how would i make the reroll price increase by 2 instead of 1?
hi n
hi aiko
I'm making a new function in misc_functions.lua and _card. is used where there usally is self. and then some card function like ability.set or something.
i will finish Pokémon Black and White trust
working on two mods at the moment actually
one is for myself with 28 jokers and 2 boosters
one is for someone who's making art for me and it has 30 jokers
big
bepis my goat
hi dilly

hmm then config.center should be working, weird
You're working on the FvF mod for balatro right?
it's pretty neat from what little ive seen
-# just realized i fucked up the wording for boost deployment a bit
utter woke nonsense
play trails in the sky
i fw this
will the phases have diff impacts
yeah I am
mhm
I just added 3 vouchers and it's caused me extreme stress
all because of a typo that I didn't detect until yesterday
if a boss has too many passives
i may consider adding pages for that too
:3
i am the page man
i need to add pages for the ability transfer thing i think
or toggleable tooltips maybe
been there 😔
balatro needs more screen space
just dont have actual descriptions do what tboi does where its just a flavor text instead
"Good luck" the flavor text
oh btw raevyn Pro Tip:
if you have a custom card area you can set view_deck = true when you're making it to make it show up on the sides instead of the top
so if you're a yapmaster like me you don't have to worry about the textboxes clipping out of the top of the screen 😭
and its just you trying to figure out wtf the boss blind does
why do neither G.GAME.current_round.reroll_cost_increase = 2 modify the reroll cost increase? >:(
SMODS.Back{
key = 'booster_deck',
loc_txt = {
name = 'Collectable Deck',
text = {
'{C:}Booster packs{} show up',
'instead of cards',
'in the shop,',
'{C:}Reroll{} cost is double.'
}
},
atlas = 'dick',
pos = { x = 0, y = 0 },
config = {},
apply = function(self)
G.GAME.starting_params.reroll_cost = 10
G.GAME.current_round.reroll_cost_increase = 2
end,
calculate = function(self,card,context)
if context.reroll_shop then
G.GAME.current_round.reroll_cost_increase = 2
end
end
}```
dick
are you gonna say that every time?/silly
:3
Does anyone know how to use draw_card to randomly arrange cards or just shuffle the deck? I was trying to use it to move cards from G.hand to G.deck and they just go to the bottom.
localization people: where do you put the text for the booster pack after you've opened it in the localization files?
i think theres a function to shuffle the deck
i saw it before
G.deck:shuffle()
misc.dictionary.k_set_pack
☝️²
you can also define a group_key in your booster
still goes in misc.dictionary though
why hasn't anyone reported about my relic pack showing "ERROR" too, i wonder
yeah
thanks
@red flower got the error functions/misc_functions.lua:195: attempt to index global 'booster
I tried that and it didn't work for some reason
yeah booster was just a name i gave the card object, it should be _card or whatever in your case
this is in the booster section
i usually just try reference the localisation of something else thats doing a similar type of thing as me
you might need some parameters, they're in CardArea:shuffle
your name reminds me of Yme for some reason 💔
I'll check it out, thank you
-# genshin mod dev, fyi
true
but (this is the same way I felt about learning about the "dump_loc" key in the metadata) it should really be in the localization docs, with everything else
but that's just me
you can PR the wiki ❤️
aaa its probably G.config.center.key == "p_boosterkey"
I'll try it after I finish eating
why would it be G
that's also true
or smods
G is the global table for the game, you want the booster card
@tall wharf i think you should add a short shake effect to the jokers that lilac lasso doesnt select to be debuffed
I want to get the type of booster that is open at the moment the if statement passes but I'll deal with it later
oh thats easy gimme a sec
send this in my stupid thread lol
i use this in a lovely patch so idk if its different in joker calcs
self.config.center.kind == 'Arcana'```
theres probably a context for opening booster packs
which lets you read this
yeah, they're not doing a joker they're modifying the code directly from what i understood
information provided within the open_booster context
if context.open_booster then
{
cardarea = G.jokers, -- G.hand, (G.deck and G.discard optionally enabled)
open_booster = true,
card = self -- the booster pack being opened
}```
excuse me but if i wanted to learn how to mod balatro where would i start thanks in advance
Is the highlighted expression correct?
wah.....
thank youu
it should just be self.WAH_index
wtf 😭😭😭😭
well you're doing better than my green
i still do not know how to make it clip the low parts and overflow for the high parts
it's kinda tough since I need to emulate shaders from a different game
but I have cool concepts for the enhancements
i tried adding time and it did this??
nope
thats the same image
hang on it keeps doing htis
why does adding time make it do this??
surely adding time should just make it animate??
How does one check if a card in hand is being scored?
where are you checking?
In G.hand.
no, like what are you trying to do? also cards played is G.play
all i did was add a sound and this happened
i saw aure tell you to delete the atlas but maybe you were actually using it?
If a card in hand is scoring then gain chips.
is this a joker?
Yes.
yes but i am using it for jokers
did you remove it?
hmmm no idea then you probably need a post trigger or something
removed it, still crashes
no it was fine to not delete it i was just asking if you did because that might have been the crash
try add_to_deck instead of set_ability
i just moved it to a different location
well, im also having it appear debuffed in the collection
well that might be it
unless the collection also calls for adding to deck
i dont think so
where is the UI for deck preview stored?
i found this in the core.lua
---@field set_debuff? fun(card: Card|table): boolean|string? Allows controlling when a card is debuffed or not. Return "prevent_debuff" to force a card to be undebuffable.
im wondering how this atlas issue even happened
could i call for card:set_debuffed(true)
set_debuff, yes
i don't think that's different from the other one but you can try
hm, didnt seem to work
G.UIDEF.deck_info
what I do is I search the localization for a string in the UI and then search the key in the code
is there something thats called for whenever the card appears
using vouchers with full-sized card sprites is so goofy
what is this comment referring to? can i set cardarea to G.hand to access cards held in hand? eg to have something happen with an enhancement before cards are played?
yes, you can do context.cardarea == G.hand for that case for example
By the way, for context.before, is it after the hand is played but before the scoring begins?
yeah
okay, i found a work around, i just debuff it every frame
😭 uh oh
because i wanted to make an enhancement that moves to the next card over before the hand is played
so
thats a bit tough now
Last time I checked there's no context for "when drawn to hand", should I make a patch for that?
there is i think
well
im also new
so im not sure if that applies when a card is drawn and you have the calculate function in an enhancement on that card
but theres definitely a context for that on the api page
how could i use loc_parse_string to allow me to use {X[colour]} in both joker names and the return message of calculate() and have it show up with that highlight in those conditions?
There is a context for "when hand is drawn", but I need "for each individual drawn card".
ooh
perhaps you could do something with having a variable that tracks the handsize when cards are discarded, how many cards were discarded, and compare those to the hand size afterwards using the hand_drawn context
and that could help you calculate how many cards were drawn
(that ofc wouldnt address edge cases like drawing the first hand when entering a blind but ig in that case u can just check how many cards are in hand. i cant think of other edge cases)
as a workaround at least
Is this doable?
eg handsize before was 7, i discarded 5 cards (but its serpent so i only draw 3), so my hand size will now be 5 after discarding. so i can do 7-5 = 2, then do 5-2 = 3 cards drawn
How do I make it so that the cards only start scoring after they flip?
if context.individual and context.cardarea == G.play and context.scoring_name == 'Pair' then
for i=1, #context.scoring_hand do
local percent = 1.15 - (i-0.999)/(#context.scoring_hand-0.998)*0.3
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() context.scoring_hand[i]:flip();play_sound('card1', percent);context.scoring_hand[i]:juice_up(0.3, 0.3);return true end }))
end
delay(0.2)
local _rank = pseudorandom_element({'6','9'}, pseudoseed('yin'))
for i=1, #context.scoring_hand do
G.E_MANAGER:add_event(Event({func = function()
local card = context.scoring_hand[i]
local suit_prefix = string.sub(card.base.suit, 1, 1)..'_'
local rank_suffix =_rank
card:set_base(G.P_CARDS[suit_prefix..rank_suffix])
return true end }))
end
end
lets say i wanted to make a mod. what is the minimum assets/code required to have it show up with steammodded. doesnt have to add anything but just like a base skeleton for a mod
cause like i cant even figure that out atm 😭
context.individual and context.cardarea == G.play is for each scoring card, you might wanna put flipping animation under other context?
you just need a folder with the mod metadata and a main file, I believe
don't think so
i closed outta the tab but it seemed like some mods had like their mod id at the top of the main file in some code
like an init thing looking
and other mods didnt so i was really confused
Ill try that then
that's the old version of the system
no problem
what about mods that separate their code into multiple files?
eg a file for enhancements and one for editions etc
I just put it under context.scoring_name and the cards flip like 10 times
how do i change whats in the shop?
do i have to have a main file to pull all those together or will steamodded just pick it up
like, say i want to modify the jokers that can appear in the G.shop_jokers area
you have to have a main file
how can i change the list of items that can appear
You can load each file you want to load in your main file.
You can even make it tree-like.
how so
got it
im making a custom deck that replaces all of the rerollable shop cards (jokers, tarots, and planets) with booster packs
but then to balance it, rerolls are doubled. Ive fully figured out that part, now i just need to get boosters into the shop_jokers area
ok my shader's going well but i have no clue how to fix the cutoff, or the fact that you can see into the texture below it
modular arithmetic
??
So according to what I found in lovely/dump.lua, context.hand_drawn is a table of drawn cards, but on SMODS wiki it only says they are true.
At least one of them need update, it seems.
Otherwise you get the other textures in the atlas
its kinda hard to have a wavy effect without some peaks being lower than others
im still just annoyed that the wavy shader image in the docs isnt one of the shaders in the example mod
that would solve All of my problems
Docs haven’t been updated recently, I’m still working on it but life has been very busy recently
How are you doing it
ill send the function in a minute hang on
ive just realised the laminated shader miight actually be what im looking for so im tryna test it out
because I think you could use modular arithmetic to cover from a square to a wavy square
ok nvm laminated was NOT what i wanted
or just wavefy the square directly
hang on discords being a bitch
freaky jimbo
freakbo
basically, makes a sine wave using the x and the current time, then uses that to stretch the texture accordingly along that column
add more sines
how exactly does a more wobbly line solve the cutoff issue
I was trying to solve this issue
but I see I misread what you were saying
What was the cutoff issue again?
put into a crude jspaint drawing this is my issue
it cuts off at the borders of where the normal jokers are, and has bits of the next texture down
Avoiding drawing other Jokers is easy
why does context.end_of_round trigger twice again?
and how do I make it only trigger a seal once
which should be around 0 and 1
one is for individual effects I reckon
I tried adding an and context.individual and it didn't proc
so maybe I need a different context
hmmm
Bump
I think the wiki says how to limit yourself to triggering once
I'll check the wiki again
If it’s a seal it’s context.olaying_card_end_of_round iirc
olaying
olaying
looking at paperback mod source code i see examples of enhancements they made. but nowhere is there like an smods.load_file to load it (that i could see at least). I think thats where some of this confusion is coming from
main file needed yes, but do you need to specifically load other files?
thanks, I'll try this then. fwiw, that one's not on the wiki page for calculate
ah nvm i figured out how they did it
they do load it but have a util file that lets them quickly load stuff
so it doesnt ever explicitly say load_file("enhancementName.lua") but rather calls a function that loads all files in a folder
coolio
anyone got a deck making tutorial
yep its defined in misc_functions and they then call it on each folder in content
mm sorry it isnt working but the idea for it is super cool i love it
hope u get it working!!!
id say look at the decks in game and in mods and reference the smods wiki
...
Yeah I know, it was added post better calc 2.0 so hasn’t been updated yet
anyway to make sure the event completes the dissolve before ending?
currently it is looping before the card is destroyed and sometimes selects a dissolving card to be dissolved again
is there a guide for how an atlas should be set up?
is it possible to make a new type of "addition" for cards. Like a fourth thing that isnt a seal/edition/enhancement
or bar that, a way to have an edition/enhancement not conflict with other enhancements
what are you doing 😭
every loop selects a random card from hand and dissolves it
problem is, the loop is finishing before the dissolve
what's the whole effect
so it has a chance to pick the same card again
is this in joker calculate
its a consumable
does it destroy all the cards in hand
it repeats 3 times
yup
in its current state sometimes it selects the same card multiple times and ends up deleting only 2 or 1
...what's the simplest way to set my mod's modicon in the steamodded mod menu?
i think you'll have to use while loop
and increase i for each card destroyed
store destroyed cards in a table
feels a bit janky still?
A tiny one. I am using a combination of leds, tiny screens and other methods for it
modicon atlas
its not really jank, maybe not the best way to do it tho necessarily
like thats the brute force method yea ig
i wanted to just delay the end of the event untill dissolve was done
im a brute force kinda programmer anyways
ante will be 7+ segments?
I've been checking into your thread often, you're doing a sick project
The center part of that model is a big play surface to place your jokers and playing cards on
link?
like i see holes
oh shit solidworks?!
Yeah
peam
how will it detect the jokers/cards? i assume you will have to print stuff
NFC tags on the back of every card
crazy
And a moving reader head under the play surface
i just make an SMODS atlas with the key modicon?
Cheaper than having a ton of nfc reader
i think so
How low have you gotten the price to so far?
it does introduce moving parts i guess
DEVELOPMENT TOMORROW
RAAARHH
Yeah but it’s so much cheaper
Also here is some early testing for the nfc stuff
smart to have it on the back too
I want to make it cheap. Just in case I can make it into a product
imagine actual casinos having nfc reader for cards
i don't mean credit card
ik
even if not a product at least people can try and make it themselves if its cheap
The playing cards are but the jokers are going to be raised up and at an angle facing the player
fair enough
I plan on doing a small production run of around 5 of them.
I have access to some machinery that will let me do custom circuit boards
So that should be fun
ok ive been making (slow) progress on the shader, but why does the bottom edge look janky? idk how to describe it but its like, almost jagged looking
everything is possible with enough programming
-# except the halting problem
something tells me if you decide to sell any of the 5 copies you're going to have a bidding war on your hands
works
The true. I am going to make a video on it once it’s done and hopefully try to pitch it to local thunk
i know im gonna be tryna get my hands on one if you do decide to do a limited run
does anyone know how to change a joker's loc_txt.text on the fly? 
i'm looking into working with the functionality of being able to actively change the description
After that, if we went through with it, I would most likely do a kick starter to try getting enough funds to mass manufacture them.
if it's your joker you could hypothetically just do "#1#","#2#" so on so forth
and feed the entire line of text into the loc_vars
if its not your joker idk
for more complicated changes I use main_end
There is one touch I really want to do for the final project.
I want the game board to have a layer of green felt over it
Like a card game table
i see! how should i go about looking into this 
Ah yes - I do love a good nil in nil chance to gain a nil mult (also no clue why its nil values)
you basically need to write the UI nodes manually
does anyone know why the bottom edge might be jagged and janky?
local misc = NFS.load(SMODS.current_mod.path .. "/misc_functions.lua")()
local _generate_main_end = function(card)
if not misc.is_in_your_collection(card) then
local add_node = function(nodes, text, colour)
nodes[#nodes + 1] = {
n = G.UIT.T,
config = {
text = text,
colour = colour,
scale = 0.3
}
}
end
local nodes_ = {}
add_node(nodes_, '(Currently ', G.C.UI.TEXT_INACTIVE)
add_node(nodes_, tostring(card.ability.extra.blinds_defeated), G.C.FILTER)
add_node(nodes_, '/', G.C.UI.TEXT_INACTIVE)
add_node(nodes_, tostring(card.ability.extra.blinds_to_defeat), G.C.FILTER)
add_node(nodes_, ')', G.C.UI.TEXT_INACTIVE)
return {{
n = G.UIT.C,
config = {
align = "bm",
padding = 0.02
},
nodes = {{
n = G.UIT.R,
config = {
align = "cm"
},
nodes = nodes_
}}
}}
end
end
try going for slightly less than 1.0
i really suck at modding this game lmao what have i done wrong
wrong path
example for how to determine the path correctly
actually wait that one still uses NFS.load lol
ok this worked well, still not perfect at the corners but beggers cant be choosers lol
How does one make a certain probability of an object to always trigger when a joker is present?
now is there a way to make the shader get cut off at the edges of the joker, or am i just gonna have to adapt to that size
god i wish there was a way to print values in a shader
so i think i set up the scoring itself correctly, but how does stone joker's card counting work? does anyone know?
it iterates through the deck and counts all the stone cards
it does in update for some reason but you can do it on demand
is there an easy way to spawn in cards? i made an enhancement and want to see it in game but I realize i dont have a way of actually obtaining it?
does it run in a context?
no, it does it every frame lol
but you can put it in the same context you need it and in loc_vars for the description
ok so i fucked up the shader somehow
ohhh ok
can i send the loc_vars in to make sure its right?
yea
loc_vars = function (self, info_queue, card)
return{vars = {card.ability.extra.chips, card.ability.extra.chips*(card.ability.stone_tally or 0), card.area and card.area == G.jokers and "...?" or ""}}
end,
you want to do something like this
loc_vars = function(self, info_queue, card)
local stone_tally = 0
for k, v in pairs(G.playing_cards) do
if SMODS.has_enhancement(v, 'm_stone') then stone_tally = stone_tally + 1 end
end
return { vars = { card.ability.extra.chips, card.ability.extra.chips * (stone_tally or 0), card.area and card.area == G.jokers and "...?" or "" } }
end
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhh
i thought the k, v would go somewhere else
ok ok cool
Bweh
ill test this out and see if it works
another simple bug that my brain isnt figuring out, why is the bracket not closed? it looks closed to me
i think this is because i'm using texture_coords which apparently changes depending on where in the texture atlas you are, funnnn
is there any equivelant i can use that's always on a scale of 0 to 1 and not dependent on where the texture is in the atlas?
oh wait modulo exists
How could one make the operator be exponential instead of multiplicative?
missing comma
you're missing a comma after your config table
idk why lua sees a missing comma and says literally any other error but it does
yea i noticed just now whoopsies
i should probably stop asking questions that i immediately realize the solution to
to be fair missing commas are stupidly easy to overlook
also blah blah rubber duck etc
hold on k,v wouldn't work here cause of k right?
yeah no it doesnt
hi
i am stupid and don't know anything about lua, yet i'm still trying to mod balatro
how would i make a joker self destruct upon getting debuffed and make it add +1 ante
THEY SHREDDED M FUCKING JIMBO
start with learning lua 😭
another good thing to look at would be
https://discord.com/channels/1116389027176787968/1349064230825103441
Bump
-# PLEASE IM DESPERATE
-# THAT WASNT A BIT??
Can anyone help me see why this is happening when I am using the prism mod, when I press the double card
-# Are you talking to me?
-# yes 😭
i just decided to ball and not learn lua at all
-# what do you mean by "that wasnt a bit"
Send me ur code
-# What
i thought that you made the button run away for the funny
k, v are correct, i think you need to check nil for G.playing_cards
So
for k, v in pairs(G.playing_cards or {}) do
Snippet of your code that causes it to run away
Does a playing card drawn facing down still get featured as context.other_card?
-# I did it accedentally, BUT I CANT MAKE IT NOT RUN AWAY
i seee i seeee ill check that (forgot i could check for nil)
-# The offset = {x = 1, y = 0}, is what is making it run away
my own mod is now crashing the game on startup.
i wish i were a bird
(not puyomod, but thrills and chills)
Anyone?!
-# Anjone
i don't know when this happened, but i have no idea where or when it could've happened anywhere in my code.
it's fucked that my mod just, doesn't work at all anymore
oops!
How?
talisman
why
what's going on here?
No, I'm talking about this.
istg im gonna go crazy trying to write this shader, i have no fucking clue what the variables actually look like because i cant debug print them
are you using debugplus's watch shader
thats. a thing?
yeah
it's just watch shader [shader path]
you have to use watch stop afterward tho
Cryptic does that
i'm looking throug all of my code and i can't even see anything wrong with any of it
Cryptid*
why is it just now shitting itself
i keep getting "file doesnt exist" no matter how i format it
what are you putting in?
Both.
I think you will have to patch for both 😕
ive tried slime, slime.fsm assets/shaders/slime.fs, shaders/slime.fs, nothings working
@manic rune intended receiving end
you can only encounter the boss when you are on negative ante
i don't fucking understand. why are you NOT working
you used to work, but not anymore???
for some absolutely braindead reason
it has to be watch shader Mods/[your mod folder]/assets/[yourshader]fs
help please?
ah
sorry
can you guys figure out what's wrong here
if anyhting
this is, genuinely fucked
as I said that's true for all shaders
Ar you by any chance creating the joker before the atlas?