#💻・modding-dev
1 messages · Page 211 of 1
this code polls together all base cards from a card area and then chooses one and applies a certain enhancement
Is there a way to use a voucher to affect shop items? like all x type booster packs are replaced by y type booster packs?
oh, so this should work?
if u need two cards, just remove the selected_card from the table and pseudorandom_element again
if you don't want any filter on which cards get chosen, yes
nice, thanks
then that table is safe to use
never tried anything like this but my idea rn would be like
- hook into CardArea:emplace
- check if the emplaced card is the target booster
- remove that card and add the desired booster in its place
again completely untested just a theory
maybe play around with P_CENTER_POOLS?
that too
since i believe shop and pack items all get pooled from this
what do you mean by that? im not quite familiair
real quick, does ease_hands() change perm or temporary hands?
Chat i’m so fucking lost
temp, for permanent i'm not sure whether SMODS has a custom function but in vanilla it is done with G.GAME.round_resets.hands
no no its fine, we all start somwhere lol
it's a table like P_CENTERS, except it holds all pooled items
malverk?
Malverk is textures, Galdur is the deck menu.
focus on making a mod that you'd actually want to play with most if not all of the time
Idk how to start LOL
YES, galdur
ty fr
this one right ?
Yes.
so theoretically i just make it remove certain items from the pool
have an idea, look in the joker examples mod on the wiki for the basics, continue research on the wiki
Can you link me up please
fanarts can also have some pretty neat ideas too actually
i am not sure how exactly it works, i'd suggest reading the source code yourself to find out how it's used because i have never personally used it
ctrl + F is the way
7 pages of blinds is so peak
the cat is cute
u got the wiki and the examples
Thankssss
is there a way to tell if a run has been resumed
kinda like how the throwback unlock works
Chat any suggestions to make my ui look better?
balatro everywhere huh 😭
dark version is peak, add some glowing things fr
not even power outage will prevent balatro players 💔
Balatro running in a 2$ micro controller and 6 AA batteries is the goal
and im getting another mfing error
everyone is talking code i havent even start coding
im still at the idea phase
anyway speaking of idea here's another one
e.g. if you're at +36 Mult, there's a 36 in 100 chance it resets to +1 Mult
so on average you're gonna be mostly about at 10 to 30 mult
maybe touching 45 if you're quite lucky
but also very easy to be hardstuck at below 10 mult for a couple ante
joker'll go crazy with retriggers
would oops all 6s affect it?
would probably pick it up any day over something like misprint
it always doubles the odds
okay
real
so i think the funnier answer is yes oops affects it
let me rephrase - if you code odds correctly it doubles
if not it does nothing
:L
damn
Balatro IRL has been a project. I have a thread if you want to see more details. https://discordapp.com/channels/1116389027176787968/1342904656124182618
basically there's this value inthe game, G.GAME.probabilities.normal, oops doubles that and then all odds based stuff uses it as a baseline
https://docs.google.com/spreadsheets/d/1L2wPG5mNI-ZBSW_ta__L9EcfAw-arKrXXVD-43eU4og/edit?gid=510782711#gid=510782711 ts is so peak
reminds me of like the couple of people doing physical ktane builds
hi, im early in the process of learning to mod the game. im trying to make a simple deck that starts you with three vouchers to familiarize myself with making decks but i'm having some trouble getting it to work. if anyone could review my code id appreciate it a lot!
i also attached the crash error im getting at the moment. not really sure where im expected to close that bracket? (also i put the code in the mod's main file temporarily just so i can see what line is causing the crash so dont mind that)
with modules that can be switched out of the casing
need commas after each item
one of them has a socket for a small co2 cartridge
so if you fail it bust the cartridge to make an explosion sound
ohhh, tysm!
how does this look lol
aapl
how do you make jonkler spirte
cuz i have the template i used to make joker-styled cards for tts
but like it's probably not the right size
hello everyone. i believe i know how to code. but one thing i have trouble getting right are the variable an function names. for example how was i supposed to know what G.GAME.probabilities does and what G.E_MANAGER does? is there some documentation explaining local thunk's commands or something?
thank you 😁
me?
why does hooking functions feel illegal
i just do it at 71x95 with 1 pixel border
sand me a man
there's documentation for the event manager, but for a lot of stuff you just have to ask/look at the code
thank you 🙂 do you know where the documentation for the event manager is? is it at the github of steammodded?
the other thing that felt illegal was writing a patch to destroy a card in a played hand before it scores
yeah it's in the wiki
take me by the hand lead me to the land that you understand
oshanman
thank you
getting a crash with that says unexpected symbol near 'end' now
what is B a picture of?
how do i combine two strings into one? im trying to use poll_edition() to get a random edition but to actually use it later on i need to add 'e_' to the beginning of it, which is a separate string
i see the unexpected symbol
string1 .. string2
Bee
you know what you have to do for e tho right
I'm gonna be honest I still don't see it 😅
epicsauce
i see thanks
where is it?
that final 'end,' shouldn't be there
might be the comma at the last end
no

hey, it's us again, yes it's that goshdarned blueprint-like joker again. it isn't copying DNA correctly. like, specifically DNA. we'd like it so it copies the card 3 additional times to what DNA does, but it just does it one extra time a-la normal blueprint. how could we add DNA compatibility for this thing?

or estrogen, both are viable options
kimty
blueprint-like jokers are hell to make (source: i tried making one and right now it's a broken mess that does nothing right
well aware. ;P
thank you, that fixed it!
me when I have Kirby, who not only does Blueprint to the left, but CREATES negative blueprints...
Good to know.

hey, sorry, can i ask about crashes here?
It's okay, you can only get three negative Blueprints from him before he FUCKING DIES
Ye
i got this crash and can't figure out what the problem is
No need to apologize if you're not being a dick
on startup :d
this crash says the script InkColor.lua from InkAndColor has a bad instruction in line 184
now to know why it's a bad instruction you're gonna have to look in there
It's trying to grab a field
The "field" it's going for isn't a field at all. It's a table.
i have never touched lua
:(
yup we're in business
this is what's on line 184
what could this mean ?
you can also disable the problematic mod temporarily by adding a file called .lovelyignore i think
I have no idea how to do anything that has to do with programming so the best I can do is look at some words that kinda make sense in the context they're in and hope for the best.
oh you need to install smods
im gonna try coding one of the joker idea i think
wait let me double check the mod list from the crash log
@spring lantern they have the latest smods version
show me your atlas
yeah it looks like they have 0301 BETA which is quite recent
wait no that's 0301a
my what sorry
ah okay i missed that
I don't think this is their mod causing the crash
I could be ENTIRELY wrong.
i mean if anything i instealled steammodded like an hour ago max
yeah yours should be latest
wait this card art is peak
[SMODS InkAndColor "InkColor.lua"]:184: attempt to call field 'Blind' (a table value)
atlas = 'Blind'
okay so why does the game not recognize SMODS.Blind
line 184 is the opening of the command to grab the Blind for The Bleach, but smods is saying that's a table value, not a field
this isn't line 184 nor a table
AH
Okay
so
lemme
hold on lemme think here
neanderthal discovering how fire works, gimme a sec
By "not their mod" I mean a mod they did not develop lol
youre all right i read too quickly sorry
Also yeah atlas = 'Blind' is line 189, not 184
might have to contact the mod creator if possible, this is a weird error for sure
well the thing is, earlier on the game booted with a Celeste cards mod, after installing other mods this error appeared, when i deleted this mod the Celeste cards mod was now failing
Yeah no I got nothin, I just kinda understand vaguely how that SHOULD work and slightly less vaguely how it's NOT working.
Quick question for blinds do we need a new SMODS.Atlas?
this makes me think from my lack of knowledge that maybe one of the mods i installed fucked up something ????
holy shit
FireB🔥 🔥
you can try disabling mods manually by adding a file like this inside the folder of the mod
.lovelyignore tells the injector to not inject the mods code into the game
in theory an atlas can be used for anything, it's just a sprite fetcher. but for practical uses then yeah
Another thing you can do is a clean wipe of your mods folder (not counting smods) and go from there
yeah
alright i'm trying to run the game after disabling the ink thing mod
incrementally add mods til it starts fighting back
Toss down the crash log and see if you get an answer.
yay another error
So I get a different atlas for both jokers and blinds?
which one ? the one i just got or
Oh so you just have a whole BUNCH of different suits mods don't you.
The first one, the attempt to index a field that's a table.
maybe :d
That seems easy enough hopefully
This consumable im trying to make is giving me a lot of trouble, right now im getting the crash "attempt to index local 'p_edition' (a nil value), anybody can help? will send code in a sec
local randomenhance = SMODS.poll_enhancement('erudition', nil, true, true)
local randomseal = SMODS.poll_seal('erudition', nil, true, true)
local randomedition = 'e_' .. poll_edition('erudition', nil, false, true)
G.E_MANAGER:add_event(Event({
trigger = 'after', delay = 0.4, func = function()
play_sound('tarot1')
card:juice_up(0.3,0.5)
return true end}))
for i=1, #G.hand.highlighted do
local percent = 1.15 - (i-0.999)/(#G.hand.highlighted-0.998)*0.3
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('card1', percent);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
end
delay(0.2)
for i=1, #G.hand.highlighted do
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
G.hand.highlighted[i]:set_ability(G.P_CENTERS[randomenhance])
return true end }))
end
for i=1, #G.hand.highlighted do
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
G.hand.highlighted[i]:set_seal(randomseal)
return true end }))
end
for i=1, #G.hand.highlighted do
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
G.hand.highlighted[i]:set_edition(randomedition, true)
return true end }))
end
for i=1, #G.hand.highlighted do
local percent = 0.85 + (i-0.999)/(#G.hand.highlighted-0.998)*0.3
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('tarot2', percent, 0.6);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
end
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2,func = function() G.hand:unhighlight_all(); return true end }))
delay(0.5)
end```
its supposed to add a random enhancement, seal, and edition
Has Bunco been fixed yet?
Because I see Bunco and that will likely lead to ✨problems™️✨ in the future.
where is the p_edition line? i don't remember p_edition being anything
this does cause the game to crash upon starting a run though. did i code the logic for the vouchers wrong? is there something more i have to do than the config line?
show card.lua:260 rq
you are using a LOT of mods after all, there's a big chance some aren't updated for recent steamodded/lovely versions
wait that mod is that 25th one?
yeah using too many mods can lead to many issues
what in the world does this mean
unless you know what you're doing
LMAO I SEE IT 😭
don't ask 🔥
i mean what line of code is it
i dont know i never wrote p_edition anywhere
oh it's an smods thing
i chuckled, thanks 
what the
that also not how you use SMODS.poll_seal or SMODS.poll_enhancement
I'm surprised that isn't where you crash
oh is it not
seems to be this portion
this is part of the base game's code though im pretty sure
is center a variable
i based it on how the wiki says its supposed to be
did you make sure it's declared
no you didnt
what in the world is that 💔
where is it wrong then
seems to be declared here
they take a table
Something isn't compatible with your Steamodded.
you mean options in the arguments? it defaults to all available
no
so i tried reinstalling smods and that got me absolutely nowhere
the smods functions aren't like poll_edition
does anyone know what i can do :(
Concise answer, when in doubt... Bunco.
From there...
Good luck. You're gonna have to start kneecapping mods until it works.
okay so i guess the card init func doesn't get a center passed to it? damn
wrong, i deleted bunco
and kneecapping wont work as
it happens in game
not when i just launch the game
how do i use these then
but in round
I meant deleting mods until it works.
check what that line is in the lovely dump
Or just moving them out of the mods folder.
ik what it means
im saying itll be impossible to do because it crashes in round
nope, your function should be like SMODS.poll_seal({ key = "blah blah", mod = 2, guaranteed = true, etc. })
correct me if i understood poorly
so if ill delete the modded deck or something that i had in the run
it might get even worse
ooh i see
doesnt look like it in the doc but ill try that
huuh.
Is there a way to return another blind's description as one of the vars in loc_vars()?
name = "The Beast",
text = {
"Face the gauntlet...",
"#1#",
"#2#"
}
},
dollars = 5,
mult = 2,
discovered = false,
boss = {showdown = true, min = 10, max = 10},
boss_colour = HEX('C72A00'),
loc_vars = function(self, info_queue, center)
return {vars = {G.localization.descriptions.Blind[G.GAME.beast_wave].name, G.localization.descriptions.Blind[G.GAME.beast_wave].text}}
end```
not to be annoying but can someone please help me :d
yeah it's poorly transmitted that args is a table
I suggested earlier, might wanna just clear your mods folder (don't delete lovely or smods) and incrementally add mods til it stops liking it
i got a modpack that adds 150 blinds
:bro
💔
ah alright, hadn't seen your message, i'll try thanks
honestly? just add one mod at a time until you find the culprits
lmao
hmmm..
did this and nothing's changed, still getting the same p_edition nil value error
but for this specific crash it's tetrapak that's the cause
i dont think that part of the code is wrong tho its probably something with my deck's code since it only crashes when i start a run with it but i dont know where to start with fixing that
poll_edition returns a key, you don't need to prefix e_ to it
since the other blinds this boss is compatible with only have descriptions that are one or two lines each, I might just hard code both of those cases in...
i'll keep that in mind ! thanks
also hey turns out ink and color wasn't the issue
my motto in modding has been "it may not be elegant, but it gets the job done"
something else must've messed up Something and that messed up ink and color
very likely
aaah cheers it actually works now
i had an error earlier that i thought meant polledition wasnt returning with the e_
u mean putting the description in the info_queue?
is the info queue something I can use for this?
info_queue is like when you hover over the empress and the mult card description appears as well
yeah I've used it before for my custom consumables and jokers
welp i got a crash does someone know what mod this is from
there is no info queue for blinds though
ur returning the text table in second option
if im gonna be honest u could have it check how much text in the blind description
hold on ik a mod that did something like that, lemme find it
What's the most recent mod you added?
anything but just make smth that will check if ur mod can work with all version's of steammodded and lovely
although if I append it then I need to worry about removing it when the effect changes
i present my 100% original and legally distinct character: pokemon wearing hat
so like this
for i,v in pairs(G.localization.descriptions.Blind[G.GAME.beast_wave].text do
-- code to add to ur table
end
loc vars is a dynamic function i think
well i was adding three at a time but i found out which one it was, it was tetrapak
wait
cool
there also might be another problem
idk if the method WILL work since #2# will probably only end up displaying 1 text
so u can try concatonating the string to be one instead of putting them all in a table
or u can try to add like more #x# things idk.
or update the loc_txt itself...? idk how the game would react to that
yeah I just went with this
name = "The Beast",
text = {
"Face the gauntlet...",
"#1#",
"#2#",
"#3#"
}
},
dollars = 5,
mult = 2,
discovered = false,
boss = {showdown = true, min = 10, max = 10},
boss_colour = HEX('C72A00'),
loc_vars = function(self, info_queue, center)
if #G.localization.descriptions.Blind[G.GAME.beast_wave].text == 1 then
return {vars = {G.localization.descriptions.Blind[G.GAME.beast_wave].name, G.localization.descriptions.Blind[G.GAME.beast_wave].text[1], ""}}
else
return {vars = {G.localization.descriptions.Blind[G.GAME.beast_wave].name, G.localization.descriptions.Blind[G.GAME.beast_wave].text[1], G.localization.descriptions.Blind[G.GAME.beast_wave].text[2]}}
end
end,```
since my descriptions are at most two lines for this specific effect
aight
actually, I could probably reduce it to one return
do something like
"" or G.localization.descriptions.Blind[G.GAME.beast_wave].text[2]
this writing is Fire
ok so i found the mod
it's #1343670935122870342 and it uses a custom toml patch to implement the blind tooltips
wtf do i do for q
you should find it under the lovely directory
question mark?
quicksort
i went with this
quip
quill!
ok i diagnosed the problem haha
for Ъ you should do Ъорошо
blue vowels
had the keys for the vouchers wrong, i could not find documentation for what the keys actually are though so ill do some guesswork (found the keys in the game's source code we GOOD)
this mod is one of the most autism coded things ive made in my life
bro does NOT know about 300+ if statements for all the vanilla joker abilities 🙏🏿 😭
oh no i've seen them with my own eyes
undertale dialogue ahh if else chain 😭 🙏
hey listen if u do not have a stockpile of if conditions in your indie game
are you really an indie dev?
yall talk about if else chains, i present to you, the vvvvvv giga switch statement
if you don't make people reading your source code go insane you're not a dev of any kind 
you go insane from the following
- you realize your code is inferior
OR - you get a sudden rush of anger from having someone do the worst possible code on the planet(it barely affects anything)
hi guys it's federapi that breaks the thing
Real
can't be that ba- FOUR THOUSAND NINETY NINE CASES?
how can I make the description text of an enhancement/joker change color based on a bool?
I know of the example case for changing text colors in the vanilla jokers example mod, but I don't quite understand it enough to know how to convert it to work with a boolean
the {V:} format changes the color for the one specified in the colour variable passed in loc_vars
use a "ternary" for the value you assign it
okay wait yeah this was sort of what I was already doing
but, hmm
it only ever returns green, never red
the text itself returns correctly, but the color doesn't
then thats never true
How would I draw a random card from deck, rotate 90 degrees, then after that renderthe deck on top. Like change the position of the deck
why would the bit above ever return "will destroy" then? because that works fully as intended
here's the full block
also, is it possible to use variable colors as the block behind the text (i.e. how Xmult is displayed), instead of for the text itself?
there we go
What’s hash for
wild card
{X:color}
im not sure what the problem is honestly
I mean, when I have the colors as a variable as opposed to just typing it directly.
Jimbo
oh i see, my bad
this is all there is on the wiki, so unless it's undocumented, small chance
zoom?
Holy you’re so smart
great, is there really not a variable color option for the X: text block
X:mult
Iirc
I reiterate
Sorry. I just tuned in
Aiko what will it spell if I play just wilds
poor U is being left out :(
?
Cute
he's on the other page unlike his vowel friends :(
@tall wharf what do you think of this artwork (blood, or blood imagery)
do you guys have any tips for making your pixel art look less fuzzy?
I think it's the Miku equivalent of the voice program they use
what do you mean? in-game?
like the joker I made looks a little fuzzier than other similar jokers
yeah
maybe i saved the image incorrectly?
I think it's a filter the game applies
There's also some love stuff going on
Usually on the edges
Firch knows better
i will say some of the curves look a bit inconsistent in their shape
God bless those who have had bugs before me, I've been able to search this channel for every issue giving me a headache
especially the mag
oh that's just because I am an amateur pixel artist
Here, the edges on the collar look thicker than they are, and the top right looks pure grey, but we can see it has a bit of red on the bottom left
No idea why it looks like that
jokers from other mods look a bit sharper
yea that's fair, just think that might be contributing to the fuzziness
Smartest modder 🌌 🧠
Oh how are you upscaling
does SMODS or base game have something for checking when a card changes suits or enhancements?
It pays to be a game dev
Firch made Bunco by the way
canvas size or resize
You should use nearest neighbor
Not interpolation
oh ok
not that I know of
I presume that's a setting when I save it at a larger canvas size
thanks
without pixel art smoothing on it looks like every other joker
idk about paint.net, let me see Photopea
when i wanted to check for cards changing rank/suit i had to hook into the Card:set_base() function
I have aseprite aswell
t's because it uses the 1x image
as for enhancements im not sure maybe set_ability
yup yup
I think Aseprite automatically scales it correctly since it's made for pixel art
welp guess I'm gonna go do things in an incredibly stupid way
generally speaking, jokers in vanilla(and other mods i suppose) have defined outlines. maybe this is also a reason why it looks a bit out of place
Photopea
just got aseprite today so i'm still learning the ropes, I am as of now unaware of how to upscale images in there
thanks for the advice
You can choose the option when exporting
export for twitter 😭
never used aseprite is it worth it if im already doing fine with photoshop
You could try it for free
idk I just got it, but i've heard that it's nice if you're specifically trying to do pixel art
I think the annoying part is not having automatic rotational symmetry
probably a good idea for when my student license runs out 🫠
You can try Photopea as an alternative to Photoshop
TRUE 😭
right i forgot clones exist
literally my biggest gripe
I think it might be coming in an update
I couldn't find an extension that does it 😭
other than that, amazing software, worth my money
we pray
I compiled it for free but I should buy it sometime
oh yeah this looks so much better
thanks guys
now to try to code a joker that isn't just a walkie talkie reskin
your status and bio are very funny
if your profile picture was a gif of a cat looking at the screen it would be funnier
thanks pal, i've had it that way for like 5-6 years
I had an avatar and bio combo I kept for years
but not for positive reasons at first v_v
the beautiful gray
speaking of which
I need to put another Joker that's darker than Balatro grey into the game
incredibly stupid way done, time to see if it works
looking into it, this is just not programmed into the dynatext system at all
whats the code that is needed to make the joker already discovered?
cause i forgot
discovered = true,
is there an example mod for enhancements
cant find one on the smods example mods page
anyone got a reference
i know there's one for editions and seals but not enhancements afaik
yeah
unforchuinte
any small clean mods i can look at to get an idea
thx
what do them letters do
Is it card.config.center.member or just card.member?
guess what happened.
vscode spat out the alabell lua into the jokers folder.
but! now alabell is real
hello code hepl pls
Intended Behaviour : After hand is scored, roll some RNG check.
- If pass, Joker should say "Safe!"
- If fail, Joker should say "Reset!", do the animation, and reset some variables
What's happening :
Sometimes the animation play, but no text is shown and the variable doesn't reset
The safe text also doesn't show up
am i using the wrong trigger/context or
hwo to make it actiavet
oh oop
when a high card happens?
the docs has it i think
k
you can yoink that
context.gameover is usually nil except when context.end_of_round, which doesn't happen with context.after.
And context.after doesn't have context.repetition, either.
this aint even an oc mod anymore im jus adding random youtubers and shit
so I'm saving cards to an extra table, but it's erroring out when it tries to compare to what's saved in the table
the saving to table code
whats the error?
i think to access base you need to go into config.center
okay, now to code alabell
which is as follows.
add a self destruct seal to two selected cards
so like card.ability.extra.refHand[i].config.center.base
although you can also do is_suit() and get_id() directly from the card object
how should i interpret errors like this? ive got a lot of mods installed so i'm not sure really where to narrow this down to
what the hell is a 7869
do a skim through the crash log below and try and pinpoint mod names
huh
anybody's ever changed the in-game music with create_option_cycle?
there's more stuff in the crash log, usually reading carefully will tell which mod's functions caused the error
bump
okay so whatever you're saving into the table has no config table, that's weird
May we see the whole calculate function?
in a moment, trying something
larger stack trace looks like this. only mod name i can pick out is steamodded, and that line of overrides.lua isn't pointing at any relevant code as far as i can tell
hey i know that guy
yeah
(granted the error is more likely pointing at a modded version of the file rather than the original one, but some mod i have installed makes --dump-all crash on startup so i dont have access to that either :( )
i guess before i put any energy into debugging further im just gonna go up-to-date on all of my mods
Could you also describe the effect of your joker?
As in, what is in loc_txt.text?
Gains 5 chips whenever a card changes suit or becomes a wild card
i'm looking at the code for "obituary" from the pokermon mod to see if i can learn anything about adding seals to cards from it
Usually I would recommend to hook suit changing functions,
or to store the suits in the list instead of storing cards.
yeah might be best to store the suit
And what if a card is already a wild card?
And what if there are modded enhancement that does something similar to Wild enhancement?
Is Alex doing sign language
not really thats jus meant to be L-6
-6?
L6*
6?
culate
culate
t = 1,
ity = 1
interesting
I didn't know
just asking if thats how your supposed to do multiplication or nah
k
k
So what if, instead of store the suit, you store a truth table of each suit?
Like { Hearts = _card:is_suit("Hearts"), ...}
And then you compare with each element of the truth tables.
This way you don't need to worry about Wild cards.
also Xmult_mod rather than mult_mod
where do you see the mult mod
i meant to send this one
nvm
okay
and i think
the first joker in this dumb mod is done
hopefully
now to find it in my shop
Also xmult rather than Xmult_mod+message
man i forgot things are easier now
wait i dont need the message =
i still do it the mod+msg way
anymore??
yeah don't do that
uh
yeah, i can use this.
you just do xmult=card.ability.extra.xmult or whatever
y'all need to read https://github.com/steamodded/smods/wiki/calculate_functions
all i really need to change is how many cards get a seal
i read it on the daily and i still default to deprecated shit 😭
rip
bump
former
card.config.center.member with what you did there
like lowkey i still catch myself writing eval_this()
:)
how do i make it so that I start with the joker at the start of a run?
ruh roh
where should I put this and how do I use this
if context.before then
cae.refHand = {}
for i,v in ipairs(context.full_hand) do
local _table = {}
for _,_suit in ipairs([the pool for all suits in game]) do
_table[_suit] = v:is_suit(_suit)
end
cae.refHand[i] = _table
end
elseif context.after then
for i,v in ipairs(context.full_hand) do
local _tick = false
for _,_suit in ipairs([the pool for all suits in game]) do
if cae.refHand[i][_suit] ~= v:is_suit(_suit) then
_tick = true
break
end
end
if _tick then
[Gain +5 chips]
[use SMODS.calculate_effect instead of return]
end
end
end```
I forgot the variable name of the pool for all suits in game.
got two questions:
- how would i make a joker whose ability works when a players income is negative
- in the photo provided, if i switched out edition for enhancement, would it still work or is that a whole other story
ok 30 minutes later all mods are updated and, if i'm interpreting the error right, it's a CCC problem?
- You can hook function
ease_dollars. not context.repetitionandcontext.other_cardare redundant whencontext.individualis true. I also think enhancement would be another story.
this isn't crashing but it's, also not doing anything
SMODS.calculate_effect({message=localize("k_upgrade_ex")}, card)
okay that's
a result (I played a 5 card hand)
I have never used that before
thanks (:
I was told that it works similarly with return but allows you do multiple messages in one context.
its not really for multiple messages
I know it's not its main purpose, but that part of functionality is currently what matters to me the most.
this also does not work with suit changing Tarot cards
Your original code made me think you only want to consider the case where the cards change suit during scoring, sorry.
Consider hooking with SMODS.change_base or Card:change_suit, then.
in what situation are you using it for multiple messages?
One example is when I need to deal with each played card individually in context before/after
it looks like there isnt a deck calculate call there
ah you mean multiple messages like that, fair
Can it be integrated into SMODS or do I have to do it myself
yeah it should be
Awesome, lemme know when it's added please 😄
how do i make a custom poker hand in smods? i have basically no programming knowledge and tried to make one with the RoyalFlush example mod and it appears in the poker hands tab but it isnt playable
This might help: https://github.com/Steamodded/smods/wiki/SMODS.PokerHand
is this good?
key = 'ManoAz',
visible = false,
chips = 903,
mult = 93,
l_chips = 90,
l_mult = 3,
example = {
{ 'S_4', true },
{ 'H_K', true },
{ 'D_7', true },
{ 'D_3', true },
{ 'C_Q', true },
},
loc_txt = {
['en-us'] = {
name = 'Mano de Az promedio',
description = {
'la mano maineada mas promedio del blud'
}
}
},
evaluate = function(parts, hand)
return hand.ManoAz
end
}```
Never made a poker hand, but I don't think that's how evaluate work
Check other mods that add poker hands like AutumnCircus
bet, thank you :)
anybody know how to make it so that you get a joker at the start of a run?
Is there a guide/selection code for making challenges have specific cards in a deck (deck if all kings or deck of all hearts cards)?
I just made my first modded joker 😭don’t mind the art i have no background in pixel art
Thanks :3
Thank you
Use debug plus mod to make it easier and make it a low rarity
Thats so nice
its already at common
thanks
👍
trying to mod lor
into balatro
its going
eh
Add like 700$ and start rerolling
k
you too
Remind me how to access the "center" of an existing card?
card.config.center?
Hold Tab, and hit that +$10 button 70 times.
one sec
while this works for one specific card interaction, it doesn't reeeeeeeally work how I'd like it to still, because it only adds more Chips after the hand is done, and if I alter the contexts in any way, none of it works
Hay, I have a message in my modding thread that I want to get pinned. Is there anyone here that can do that for me?
Just the one with the image
Would you like to consider hooking SMODS.change_base or Card:change_suit instead?
yes
i ping Egg usually
ping eggslashether in your thread
Do you need a guide or you already know how to do that?
um
Of the over 50 cards I've made not a single one of them has hooked anything so yeah guidance would be helpful
i got my poker hand to work but now it detects anything as it
key = 'ManoAz',
chips = 903,
mult = 93,
l_chips = 90,
l_mult = 3,
example = {
{ 'S_4', true },
{ 'H_K', true },
{ 'D_7', true },
{ 'D_3', true },
{ 'C_Q', true },
},
loc_txt = {
['en-us'] = {
name = 'Mano de Az promedio',
description = {
'la mano main del blud'
}
}
},
evaluate = function(parts, hand)
return { hand }
end
}```
with debugplus enabled go to your collection and press 3 on any joker to spawn it
function the_function_to_be_hooked([function inputs])
[Something you want to happen before the stuff]
temporary_function_name([function inputs])
[Something you want to happen after the stuff]
end```
What is its condition and why is this average ace hand in spanish under en-us?
im testing the game in en.us, ill change that later
and wym its condition?
lmaoo
As in, when would a hand be considered a ManoAz.
its not a average ace hand, its Az's Average Hand cause he always be overcomplicating builds, if u cant tell, its a joke mod lmao
when it has 4 of spades, king of hearts, 7 of diamonds, 3 of diamonds, and queen of clubs in that specific order
Google translator shenanigan, I guess.
ace is "as" so its kinda similar
IN that specific ORDER?
yea if its not too complex to program lmaoo
i want to make it as odd as possible
Honestly that might even make it easier to code.
right
I, don't, know what to do with this
ExampleJokers uses Castle for this which is exclusively setting up a variable, so that's, not really helpful.
Like I do not know where to go from here
bet, so whats the problem that makes it trigger when i select ANY card?
ignore the description, right now this enhancement is supposed to be playable once, and then the second time you play the card, it destroys itself.
for some reason, it's global between all cards, and playing one of them and then a second one destroys the second one, AND it saves between instances of the game and only resets on reload ???
I take a two day break from programming and I forget literally everything, the issue is probably obvious I don't know at this point
For example, you can do this:
function Card:change_suit(new_suit)
suitChanger(self,new_suit)
for _,J in ipairs(G.jokers.cards)do
J:calculate_joker({suit_change=true,...})
end
end```
And then you'll have context.suit_change to trigger your joker.
Because you return {hand} no matter the condition?
Sorry, my bad.
local suitChanger = Card.change_suit
Dot instead of colon.
ur right. so i gotta put the return {hand} inside an if, but how would it detect its THAT hand
sorry i have 0 programming knowledge, ty for ur patience...
local _tick = 0
if hand[1]:is_suit("Spades") and hand[1]:get_id()==4 then
_tick = _tick + 1
end
if hand[2]:is_suit("Hearts") and hand[2]:get_id()==13 then
_tick = _tick + 1
end
if hand[3]:is_suit("Diamonds") and hand[3]:get_id()==7 then
_tick = _tick + 1
end
if hand[4]:is_suit("Diamonds") and hand[4]:get_id()==3 then
_tick = _tick + 1
end
if hand[5]:is_suit("Clubs") and hand[5]:get_id()==12 then
_tick = _tick + 1
end
if _tick == 5 then
return {hand}
end
end```
bet, thanks a lot kind person 🙏 🫶
have you tried setting extra.has_been_played to false instead of nil? i don't know if this changes anything
Alternatively, if you don't mind one long-'S code, you can also and-chain all 10 conditions.
you mean like:
if hand[1]:is_suit("Spades") and hand[1]:get_id()==4 and hand[2]:is_suit("Hearts") and hand[2]:get_id()==13... and so on?
bet
nil is falsy so this wouldn't matter, and is unrelated to the issue where the value is treated as global instead of per-card and persists until the game restarts
i wonder if it would be possible to add stickers to consumables. If not, I can most likely replicate the behavior of a specific sticker using the card's calculate function 🤔
Try card.ability.extra.has_been_played = true instead of self.config.extra.has_been_played.
Oops! The game crashed:
[SMODS idk "main.lua"]:33: attempt to index a nil value
oh god, right, it's card.ability instead of self.config
I forgot about that whole thing
I'd want it to be card.ability in the loc_vars too, right?
Put if hand == nil then return {} end before local _tick = 0, match the indent.
bet, ty
tf
it still crashes, it crashes when i start up balatro
huh
yea
okay hmm, it now seems my new issue is how to get a card enhancement to do something at the end of every ante, regardless of position
if the card is in the deck, it seems it doesn't do anything during end of round context, which I guess makes sense
might just have to patch that behavior in? maybe that's overkill, not sure what other potential implementations of this could be
where is the code for the functionality of the Enhancement Tarot cards stored? Trying to locate Lovers comes up with nothing in basically anywhere
Just straight up crashed? Without anything such as Error message?
it plays the intro animation, cuts halfway and says the same error mesage
attempted to index a nil value
and the "if hand == nil then return {} end" matches the indent and is before local _tick = 0
Which line did the error occured?
wait, nvm
if hand[1]:is_suit("Spades") and hand[1]:get_id()==4 then
why doesnt my joker have a animation and the red and blue box for chips and mukt?
Might not help but add if #hand ~= 5 then return {} end following that.
okei
it helped, ty :)
Is there something special I have to do to get SMODS.Ranks to not be nil?? I'm so confused, I can't seem to get anything out of it no matter what I do
At least I'm assuming it's nil cause I'm getting empty lines when I try to print anything, even a key which should by all rights just be a string
What is the name of the variable you've tried to print?
This is currently what I'm trying to do, I tried SMODS.Ranks[1] on its own and it also gave me nothing
What do you currently think SMODS.Rank is?
I'm trying to upgrade scored cards (in a way that supports modded ranks) but I was kinda getting desperate
So you want a pool that contains all ranks available in game, is that right?
It would help, and I thought SMODS.Ranks was that
SMODS.Rank is an object declaring function, if this info would help.
@frosty dock Which variable is the pool for all in-game suit/rank?
is it not SMODS.Ranks?
Wait, hold on.
SMODS.Rank is the base class
Well I'll be damned.
yeah it's just a map indexed by card value instead of a lua """list"""
So, the reason SMODS.Ranks[1] being nil is because there's no rank with id 1.
So how do I reference a specific rank then
would I have to use its key to get its key??
What effect do you want to achieve?
next time just try tprinting the entire table btw
I want to increase the rank of each scored card by 1
oh do NOT change SMODS.Ranks for that haha
So like Strength
Yes, pretty much
you'd be changing the definitions of what the actual ranks are internally lol
anyway take a look at SMODS implementation of Strength
Something I forgot to mention is I don't want the last rank to loop around to the lowest (like how aces become 2s with vanilla Strength), how would I go about doing that 
You'll encounter hotel room paradox.
the hotel room paradox? 🤔
son of a bitch
the "fully occupied hotel with infinitely many rooms may still accommodate additional guests, even infinitely many of them" paradox?
A new customer walked in to the infinite hotel, but the infinite hotel is full.
So the new customer was arranged to Room 1, and the resident of Room 1 is rearranged to Room 2, and so on.
I mean, there's no internal definition (in vanilla or smods) that a rank is the "highest" as far as I can tell
unless...
sorting? 🤔
I thought you're gonna say declare any new ones on flight.
Anyway, you'll need to at least stop at somewhere.
Unless you really want to register for Every Single Goddamned Positive Integers.
hmm, basegame uses Card:get_nominal to sort cards
you might be able to use that
(which in 99% of cases boils down to Card.base.nominal)
how exactly is a modded enhancement formatted? cuz im tryna make one and i feel as if somethings in the wrong place
there we go
Ight, I've been flipping through the code for a while and while I'm finding some stuff detecting which hand is being played, but I don't see anything I could use to set the hand.
context.remove_playing_cards and context.playing_card_added only triggers once when multiple cards are removed/added and I don't know why it's not triggering for each card
Is there a trigger for buying a voucher? I can't find anything about it
Oh sorry I meant context
buying_card mqaybe works
won't that trigger for all purchases?
yes
you need to check that context.card is a voucher
ohhhhh
really odd issue, Card:get_chip_x_mult returns X3 when used on a glass card? is it accidentally adding the X2 to what is presumably a card base value of X1 instead of multiplying it properly?
wait no, I see what's going on, nevermind, it was on my side
or.. is it? this might be an issue with the new(ish) hiker-style xmult accumulation
setting a regular card's ability.perma_x_mult to 2 gives it X3
yeah it's a bit weird like that
doesn't seem intentional?
like, that just shouldn't happen, why is it adding xmult instead of multiplying it like it should
I'm guessing so you can easily have cards that say "add 0.1 mult"
right, I guess it does make a little more sense from the accumulation perspective, actually
hmm
I guess I should just subtract 1 when setting?
....oops
nice lol
score nuke
oh that's what is extra confusing about this
actually I really don't know
why did this base card just return an xmult of 0 that's not right
for some reason Boss Blinds activate the first part of this if instead of the other part
okay well now I know I'm using the wrong thing to check
I use G.GAME.blind.boss
if context.buying_card and context.card == ('Voucher') then
return {
card.ability.extra.Xmult = card.ability.extra.Xmult + 2,
message = 'Upgrade!',
colour = G.C.MULT
}
end
Am I missing something
Vouchers are not cards
Oh
and that is the extent I know how to help 
this mostly works the way i want but the upgrade message happens after the upgraded cards get juiced up and i don't know how to fix the timing on that
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if context.other_card.ability.set == "Enhanced" then
local buff = context.other_card.ability.name
local gain = "unset"
local buff_to_gain = {
["Bonus"] = "chips",
["Stone Card"] = "chips",
["Mult Card"] = "mult",
["Glass Card"] = "xmult",
["Steel Card"] = "hxmult",
["Lucky Card"] = "cash",
["Gold Card"] = "hcash"
}
gain = buff_to_gain[buff] or "unset"
if gain == "unset" and type(context.other_card.ability.extra) == "table" then -- Table check avoids crashing on glass cards, because :thunk: momence
gain = context.other_card.ability.extra.gymboost or "unset"
end
gain = gain:gsub("_", ""):lower() -- Remove underscores and force to lowercase
local valid_gains = {
chips = true,
hchips = true,
xchips = true,
hxchips = true,
mult = true,
hmult = true,
xmult = true,
hxmult = true,
cash = true, money = true, dollars = true,
hcash = true, hmoney = true, hdollars = true,
none = true
}
if not valid_gains[gain] then gain = pseudorandom_element({
"chips", "xchips", "mult", "xmult", "cash", "hchips", "hxchips", "hmult", "hxmult", "hcash",
})
end
--mintySay("Gain is "..gain)
for i = 1, #context.scoring_hand do
local juice = true
if context.scoring_hand[i].ability.name ~= buff then
local gain_map = {
chips = "perma_bonus",
hchips = "perma_h_chips",
xchips = "perma_x_chips",
hxchips = "perma_h_x_chips",
mult = "perma_mult",
hmult = "perma_h_mult",
xmult = "perma_x_mult",
hxmult = "perma_h_x_mult",
cash = "perma_p_dollars", money = "perma_p_dollars", dollars = "perma_p_dollars",
hcash = "perma_h_dollars", hmoney = "perma_h_dollars", hdollars = "perma_h_dollars"
}
local ability_key = gain_map[gain]
local extra_value = card.ability.extra[gain]
if ability_key then
local ability_table = context.scoring_hand[i].ability
ability_table[ability_key] = (ability_table[ability_key] or 0) + extra_value
else
juice = false
end
if juice then
G.E_MANAGER:add_event(Event({
func = function()
context.scoring_hand[i]:juice_up()
return true
end
}))
end
end
end
return {
extra = { message = localize('k_upgrade_ex'), colour = G.C.CHIPS },
card = card
}
end
end
Yo guys, how do I make a consumable again in steamodded?
Ok but what about making a custom consumable type?
that one's over here: https://github.com/Steamodded/smods/wiki/SMODS.ObjectType#api-documentation-smodsconsumabletype
SMODS.ObjectType {
key = "chemical",
primary_colour = "CCCCCC",
secondary_colour = "ADADAD",
loc_txt = {
name = "Chemical",
collection = "Chemical Cards",
undiscovered = {
name = "Undiscovered",
text = {
"You haven't discovered this Chemical yet!"
}
}
}
}
Why is the mod loader not loading this in? It's getting loaded before all the consumables.
Oh shit
I had to change ObjectType to ConsumableType, but now the game is crashing when I enter the collection
they are cards though
the thing going wrong is that you don't buy them
you redeem them
Hi!, i was wondering wether it would be possible to make a joker give a specific tarot card at the start of a round
yes
how do i get it to play the desired "ultrakillcoinsound"? im trying to replace the "xmult" sound with it
what could be the cause of this?
Oops! The game crashed:
[SMODS _ "src/utils.lua"]:949: attempt to index local 'card' (a nil value)
im not sure i quite understand
return sound = 'soundname'
I asked chatgpt in Web browsing mode and it came up with this code
SMODS.Joker{
key = 'HERMIT_GIVER',
loc_txt = {
name = 'Blind Sage',
text = {
'Adds {C:attention}The Hermit{} Tarot card when entering a Blind'
}
},
atlas = 'Jokers',
pos = {x = , y = 0},
config = {},
calculate = function(self, card, context)
if context.enter_blind then
G.GAME:add_to_deck('tarot_hermit', 1) -- Adds "The Hermit" Tarot card
return {
message = 'The Hermit has joined your deck!',
colour = G.C.TAROT
}
end
end
}
It shows up in game and doesn't crash the game but it doesn't create a card when you enter a blind
because that's not a function that exists and 'tarot_hermit' also doesn't exist
I'm pretty sure it's setting_blind and not enter_blind as well
overall I wouldn't recommend chatgpt for coding in a very niche api
Thanks for the advice, would you happen to know where i can see the actual ID for consumables?
it says is does not exist, although it in fact does exist
search for P_CENTERS in the code
I'm pretty sure it's something like c_hermit
never used sounds so I'm not sure
have you tried appending your mod's prefix to the sound key?
what is exactly "the mod prefix"?
do you have a steamodded header in your mod file or are you using the json
i got the steamodded header
do you have a --- PREFIX: field
nope
then your mod's prefix is the first four letters of your MOD_ID
it's used to identify things from your mod so there aren't any name conflicts
I think it worked becuase at the start of a blind the game crashed
Oops! The game crashed:
[SMODS CBALATRO "main.lua"]:88: attempt to call method 'add_to_deck' (a nil value)
Sorry if we are beign anoying with questions by the way
that function doesn't exist
use
SMODS.add_card({key = 'c_hermit'})
i also recommend reading the wiki https://github.com/Steamodded/smods/wiki/Utility
it got the sound to play which is good, but now its playing both the mult sound and the sound. how would go about making it just replace the sound instead?
It works now! thank you!
use xmult_mod instead, that should give xmult without playing a message or sound
Anybody?
if context.buying_card and context.card == G.vouchers then
return {
Xmult_mod = card.ability.extra.Xmult + 2,
card = card,
message = card.ability.extra.Xmult,
colour = G.C.MULT
}
end
Is there a context for destroyed consumables? I'm trying to have a card upgrade when a consumable or joker is destroyed, but cards_destroyed doesn't work.
I tried adding the both "a_xmult_mod" as well as "xmult_mod". neither seem to quite replace the original mult sound, is there something i might be missing?
So this finally doesnt crash but Im not sure how to trigger on voucher purchases
a get_id is causing this, how could I fix it?
i mean the first line in the return that says Xmult
change that
are you doing card:get_id with the colon?
AFAIK no, you need to make your own
okay! that seems to be all done and working, thanks for the help!
ahh. alright!
damn vgen
where would you put deck.yes_suits in your challenge code?
not on my PC so I can't check but i think it's something like context.card.ability.set == 'Voucher'
The syntax is killing me 😭
lua moment
SMODS.Challenge({
-- the rest of the stuff
deck = {
yes_suits = {...}
}
})
and if I wanted to use the hearts suits where would I find the value for that
i think its S C H D
Anybody? I really want some help over here. I'm wondering why my new consumable type is crashing the game when I enter the collection
so H
can you send a screenshot of what is in engine/ui.lua:698
in the dump folder
also update your smods
try ['H'] = true
or just H = true idk why i put the brackets
both work
would it be deck = { deck.yes.suits = 'H = {...} } })
no
this but put H = true where the ellipsis are
I have the latest version of steamodded...
prep_draw(self, 0.97)
latest is 304, if you're a dev I recommend updating from source if you run into any problems
also i said screenshot because i need a bit more context lol
after changing it it gave me an error
The ui.lua file is not in my mod
that's a syntax error
yep I forgot the comma
i know, I need to know where the problem is so I can know if i can help
the color codes need to be like this HEX('CCCCCC')
ok it's working now thank you
New code:
SMODS.ConsumableType {
key = "chemical",
primary_colour = HEX('CCCCCC'),
secondary_colour = HEX('ADADAD'),
loc_txt = {
name = "Chemical",
collection = "Chemical Cards",
undiscovered = {
name = "Undiscovered",
text = {
"You haven't discovered this Chemical yet!"
}
}
}
}
Screw it, i'm sending the entire mod folder for you to check
i don't want to sound ungratefull but is there a way to add more card to a deck for a challenge, like 52 heart cards (4 aces of hearts, 4 kings of hearts, etc...)
can't check dawg I'm on phone
Who's not on phone
you need a 2x asset
i'm not but i'm not great at looking at the code ( i am having trouble myself)
never did this so I'm not sure but you might need to use deck.cards instead of yes_suits
Ok i added one
if I used card.deck would I need to put them in indivudally (s_H r_k)
or how ever you do it
It works now thx
hypothetically how difficult would it be to make a mod altering the name of a single basegame joker? i’m assuming pretty simple
like re-making it but changing the name?
nope, keeping the joker the same but changing the name
my friends & i desperately want to rename Cavendish into Jokerpoker Banana
yeah like
cards = {
{s='H', r='Q'},
{s='H', r='2'}, --etc
}
for every card in a deck? also thank you for getting the values where di you find them
yes
What is the main difference between setting_blind and first_hand_drawn?
the wiki
I'm not too sure how one would do this sorry
all good!
You can try to patch this one.
yeah that probably works. thank you!
can you patch localization files?
doesn't that one mod which balatro university uses changes the names of vanilla jokers
hello code question
how do i get the combined rank/base chip of all scored card of a hand
like e.g. if you play a 7 7 7 9 9 full house i want to be able to get the value 39
or a K Q J 10 9 straight i'd get the number 49 (if chip) / 55 (if rank)
ok so I typed out all the cards so now there are 4 sets of hearts suit (4 aces of hearts, 4 kings of hearts, etc...) but now there are "ghosts cards"
localization files cannot be patched iirc
despite being lua files... lovely doesn't touch them at all, so you can't patch them
use :get_id() on each card and add them up