#đ»ă»modding-dev
1 messages · Page 421 of 1
well I mean for me in my main file I have
G.PROFILES[G.SETTINGS.profile].variable = variable or 0
ohhhhh that makes a lot of sense
đ
so first time coder here
what the hell am i meant to do
i know all the other things just not the coding
thanks :)
bumping
I didnât even know that was a thing
ok so i got all the resources, how do i open my .lua file (srry if i'm being annoying i just have alot of ideas rn)
cardsauce has a config that changes the background, you can reference that
visual studio code
ok thx vros!!!!!! :)
is cardsauce a dependency you can add to your mods?
nah lol, its a content mod
is there a code that can randomize a number between 2 numbers and all the values between it? cause i tried psuedorandom for 0.5 and 2 but for some reason it only gives 0.5, 1.5, and 2.5 so i wanted to know if theres any way to make it so its numbers literally between 0.5 and 2
Technically you can but it's not a great idea to do for one feature
whats the use case of this?
cause that matters
usually id just opt for getting a value between 5 and 20 then dividing it by 10
so its 0.1 increments
ah
im trying to make a card where the joker randomized its xmult from numbers between 0.5 and 2
ill try what you said
i will be coming back here very often bc i'm new to any form of coding besides scratch one singular time
bump
it works now thanks
That's what we're here for. Welcome to the hobby
there is no escape
LMAO
MWAHAHAHAHAH
Technically there is always escape.
Don't tell them that
At that point, though, you're buried.
I turned off the escape button, not anymore
The big red one?


me when someone unbinds esc so i gotta alt f4 every time:
me when someone unbinds esc so I have to dust off my mouse
Quick guys open console and type unbind all it gives you a cool skin
me when someone unbinds esc (i play on controller):
idk if this is described in the documentation anywhere but is there a function that runs when i open a run
like hitting the continue button
OH RIGHT I CAME TO ASK AN ACTUAL QUESRION đ
lmao
doesnât it use the same one as when you start a regular one
(Unrelated)
okay so calculate_context has 2 parameters, the second being return_table
what is that
what is the function that runs when you start a regular run?
i didnt know it existed
id imagine that its just whats inside the return table?
madam what
returns are a table are they not?
If ya wanna access code from within the calculated context, in the function you called SMODS.calculate_context() in
Just like how you'd want return {mult = whatever} to change the mult outside of the calculated context
so i wanna make a joker that changes stone cards to give 250 chips instead of 50 how do i do that
or atleast what do i reference
Look into SMODS's wiki, the Calculate Functions page should help
thank
Searching this channel for keywords related to your goal can help too
should be Game:start_run if Im not mistaken
perfect, thanks
can you give a minor example
asking in case this can help with trigger amount
Is this example too smol
How can you find if you win the round on your last hand?
so this wonât help with like
Preventing multi triggers
just see if your hands was equal to 0 at the end of the round
Haven't worked with retrigger things before, so dunno much about it
no thats the thing
Itâs not supposed to retrigger at all
but the custom context is getting called twice any time I use it
but only in scoring
Ah, what is your code?
incoming
Wondering if it's one of the ones where you just add and context.main_eval to the condition and it'll be fine
I tried that it didnât work
Mkay, so it's a different context then
I can put it back in though
funny story-
Nah, let's describe what you want your card to do, then show the code
in this instance, whenever a lucky card triggers this card gains xmult
that part works
the problem is it does it twice
so instead of 2-> 20
it's 2 -> 200
ok wait can i open two main.lua;s at the same time
if you want
main_eval version
Is it possible to code this?
What is the chudhit context for? Would probably just put the xmult calculation and return in the if statement, in place of the SMODS.calculate_context call.
This is why I said in this instance, because it also applies to
The other probabilities
âWell what about glass? Thatâs scoring too!â glass_trigger wasnt
coded
How do I reference what enhancements do or smth like that. For example, i wanna say foil card do smth in the context and I wanna put what foil does. How do I implement that?
Come again
Does has_enhancement work for your needs?
this function should decide if the currently viewed deck in the new run menu is playable. if the name of the deck is b_joey_honkifex then it shouldn't be selectable, yet it is. it works fine with locked decks, but is unable to check if this has a certain name. im really lost
what does that mean?
...Confused. Normally Axy would do the SMODS.calculate_context call in a Lovely patch, then check for that context separately inside a Joker's calculate function.
the name of the deck in question is the same as the one it's checking...
I did that for literally every joker that uses probabilities, but this is for lucky cards themselves
The enhancement
this is so frustrating auuuaaaagh
the cat,,,
It's in utils.lua in the code
holy shit i'm actually having fun learning this
yeah, coding is fun :3
i thought this was gnna be hell on earth to figure out but
ah i think i kinda understand
I give her 5 minutes
ok thanks
How does one find the current hand count? Bc hands_remaining doesn't work but it's all i found
It's fun if ur not dumb 276% of the time :3
Try G.GAME.current_round.hands_left
itâs this one
oh shit đš
i'm dumb for atleast like 19 hours of the day
(that was reffering to myself, no one else bc no one here is as dumb as me)
try 22
is that a challenge 
Yes >:3
try 25
You can't be awake 25 hours unless you drink 5 "5-hour-energy"s
That worked, ty :3
yay
Could you please print(context) in the code block that's running twice, and you don't want it to?
Because rn that code feels too complicated for what Axy thinks you want to do, but you might have good reason for writing it that way
Honestly genius debugging move. I feel silly not thinking of it
INFO - [G] Table:
main_eval: true
chudhit: true
cardarea: Table:
T: Table:
h: 2.6136585365854
x: 4.7573170731707
y: 0
r: 0
+2 more values.
layered_parallax: Table:
x: 0
y: 0
created_on_pause: false
children: Table:
area_uibox: Table:
T: table: 0x0206cf681dd8
+35 more values.
NEW_ALIGNMENT: false
highlighted: Table:
cards: Table:
1: Table:
T: table: 0x0206e75e3c58
+67 more values.
+27 more values.
INFO - [G] Table:
main_eval: true
chudhit: true
cardarea: Table:
T: Table:
h: 2.6136585365854
x: 4.7573170731707
y: 0
r: 0
+2 more values.
layered_parallax: Table:
x: 0
y: 0
created_on_pause: false
children: Table:
area_uibox: Table:
T: table: 0x0206cf681dd8
+35 more values.
NEW_ALIGNMENT: false
highlighted: Table:
cards: Table:
1: Table:
T: table: 0x0206e75e3c58
+67 more values.
+27 more values.
INFO - [G] Table:
main_eval: true
chudhit: true
cardarea: Table:
T: Table:
h: 2.6136585365854
x: 4.7573170731707
y: 0
r: 0
+2 more values.
layered_parallax: Table:
x: 0
y: 0
created_on_pause: false
children: Table:
area_uibox: Table:
T: table: 0x0206cf681dd8
+35 more values.
NEW_ALIGNMENT: false
highlighted: Table:
cards: Table:
1: Table:
T: table: 0x0206e75e3c58
+67 more values.
+27 more values.
the print of course printed twice
w
The loc_vars variable can take a function that can do whatever you want to a card, but mayyybe looking at Vanilla Remade's version of Misprint might help?
why are there 3
That's the best part of coding 
Being silly
tru dat
truth nado
let me be clear
Hehe, of course the Abby from Mindwave reacts to that xD
where are you AT đ
loc_vars, not the localization file
I wish more people know putting <> around links suppresses embeds
i am actually incredibly aware i just dont
man, i just wanted to add that text alongside with normal text:<
is it not possible?
no
no
grug
You can see how they're doing that in loc_vars
astra you legend
Blue screen is usually a result of a bad lovely patch
I have anything and everything
i see
i said that and realized i literally have it
LOL
you look like you collect polaroids
Do you have any other cards that are calling the chudhit context and setting it to true, in your code?
ooooh, thats a good one
LMAO
yes actually (last one is an ownership)
Hm. Is it possible that one of those definitions is being set to true when you don't want it to, for the card you're currently working on?
HELL YES
banger
baller
maybe?? All I do is:
start run
Grab joker
Enter blind
Change enhancement of a card to lucky
Copy said card a billion times
Play high card until a lucky card triggers
Cry when it double triggers
What does a lucky card do again?
1 in 5 for 20 mult, 1 in 15 for 20 bucks
Hmmm. Let's try print(inspect(context)) next, inside of your code block.
Then look at the two prints side by side.
got it
Reminder that individual goes off during end_of_round as well
Axy hasn't worked with that context at all, so am unfamiliar with it.
true! i am aware!

pain
Yunli noises
just in case
goes?
went*

oh it shows
alright good enough
now i need to make it to play a sound when bought
I just took a look at my own joker that checks for lucky triggers and doesn't double trigger and I have not context.after for some reason? I wonder if that's helping

Oo
Oh right mb
I don't know why I have that tbh but it could be worth trying
INFO - [G] main_eval: true
chudhit: true
cardarea: table
INFO - [G] main_eval: true
chudhit: true
cardarea: table
INFO - [G] main_eval: true
chudhit: true
cardarea: table
three
Hm, so looking at context doesn't help tell them apart
gonna try the after thing
Am suspecting it's because you called SMODS.calculate_context{chudhit = true} for every different card, even though Axy would have named them differently, or added more things rather than just chudhit = true in there to give more information.
Maybe that's not the case, but it's hard to rule out atm.
This is the block btw. Only difference is the after and the fact I'm checking for a lack of a lucky_trigger
i mean all else i could put there is return_table
surely
eternal pain that I did all that and it triggered on the first lucky card
funniest shit all day but eternal pain
Is it only triggering once now?
i have to reboot the game first
ouchie
Was talking about this
(This will not stop me from doing it again)
You use Alt+F5 to reboot the game, yes?
ok i have a problem
game works normally but does not detect the joker
Ofc
I tried to do something using joker banana code but it still doesn't detect it.
what did you DO astra

INFO - [G] main_eval: true
chudhit: true
cardarea: table
INFO - [G] main_eval: true
chudhit: true
cardarea: table
INFO - [G] main_eval: true
chudhit: true
cardarea: table
INFO - [G] main_eval: true
chudhit: true
cardarea: table
FOUR
?????????????????????????????????????????
what I am trying to do is to have the joker divide the total score of the boss blind by 3
like
boss blind score/3
Wdym it doesnât detect the joker though
Like, not find in collection, not find the mod, not trigger when held while in game...
just use context.blind.boss
oh
Do use context.blind and context.blind.boss, to make sure a blind exists
this
yeah just the boss thing the guy had cause that was a finicky way to do it
Those are three options???
Those are three separate problems
the first
Do you have any other Jokers or is this your only one
banana
only one of a banana (not gros or cavendish) that gives 64 of mult and that's it.
Ok. I ask because I wanted to see if it was a mod problem or a joker problem lol
Sounds like a mod problem atm
Do you have a metadata file
I don't think so
This is crucial for your mod getting detected by Steamodded
Anyways yeah... Axy personally wouldn't use chudhit for every different thing you want to do. This pattern makes debugging harder, as you're seeing now. Using different names like chudhit_bloodstone or chudhit_hallucination would make things easier to trace.
oh, no, the mod detects it, what it doesn't detect is a joker I just made.
I don't think that's the problem and that solution would just add clutter
send your code
what so create a separate calc context for each one? That seems like cluâok astra
in a code block or file, please
Is this new joker in a file seperate from your main file?
that would be why haha
Hm... Labeling different reusable contexts with different names isn't clutter to Axy, but it's fine if y'all see it differently.
ou
also I recommend removing this and creating a .json file
instructions on setup can be found in this link
tee hee
simply rename to joker3?
anything you want
whatever you see fit
ooooooo
personally, I recommend a key that is close to the name
generic names like 'joker2' or 'joker3' will bite you in the long run
I'm going to see if it works
for funky mode, funkyMode is good
for Oh Banana! ohBanana is probably good
Hm... wondering how this talk about having non-generic keys is different from the talk about not using the same context name for different things.
it is lol
itâs like if I said âuse context.joker_main for this guy, context.joker_main 2 for the next, etc etcâ
the joker failed successfully, I guess
im a hypocrite btw

I will try another boss blind
the FIRST
Right, but these aren't just joker_main, they're for when different cards trigger like bloodstone, cavendish, Space Joker, and so on. At the moment, there's no added stuff in the context table to differentiate them, like having {chudhit = true, bloodstone = true} or something.
CARD
they're unneeded
especially since the only thing in the actual return table is the message
the hit is just checking for if one hits
it doesnt need to know which
Ah
For sure
hence why 4 of them (the screenshots) are just patches
wof wouldve been one but i had already taken ownership for an unlock so
just use it again lmao
So it wants to happen regardless of which card activates, and could activate for multiple of them, huh...
yeah it just calls the context in appropriate circumstance
yet for some reason when it comes to scoring
ONLY scoring
Okay, that explains that pattern then
I wonder if you calling the context in the middle of the card scoring is causing it? maybe instead of calling the context you just do the scaling within that conditional instead
It'd be functionally the same
deviation from lucky cat it is
Hmmmm
wait so then when am I calling it
Knowing which patch is being triggered would be helpful for debugging, here... Bleh
none of them
Just don't call it during your lucky conditional. Just do the same scaling you do as if it were chudhit
Will it be five now
yayyyy
Im trying. To get the money to trigger
now to recheck with literally everything else because Iâm paranoid 
another two notes to add to my creditsâŠ.
Hm, so what was the change in the end?
Trying to understand why that worked, and why the previous one didn't work.
Ah
Didn't you want that context to be true in that case, though?
all that changed was i took the code FROM the context
and put it in the conditional
instead of calling it to do that
im guessing cause it was in the same joker
instead of external
gdi astra you already have a chud credit

how do you download mods on mac
Right, but now if you have any other card that wants to activate when any chudhit is true, it won't work with the way you've set this up
Hmmm
That's not true
She kept the chudhit conditional too
It's just the lucky card edge case that was screwing with things
Ah, she did? Dun see it in the first picture
cuz it cropped
?
Oh
youve reached n' levels of helping we gotta get rid of you
Ah hell nah
Hm, so this code would have the mult gain and return it in the joker main context. And the card also prints out "triggered joker", and the appropriate message.
nvm miscounted 1 off
i forgot to remove the print
oops
ahh i am getting the thing where the jokers are being created from my consumable but its just like, over the game. like i can move them but they arent scoring anything. how do i fix this
Does the print happen only once, actually?
i know that thinking face anywhere hi somecom
ofc not
but now it's doing the NORMAL double triggering that instead of fixing i did a work around by using the square root of 10 as my xmult gain
did you emplace
actually no you dont even have to
What function are you using, create_card or add_card? The latter emplaces for you, when given a Card Area to put it in
add card
yeah its like judgement
Is it SMODS.add_card tho
TRUE
Using SMODS when possible is preferred
ohh ok
...Forgot that vanilla has an add card function too
ok let me see if this works better then !
Alright, so things are working as desired now. Yay.
I can finally restâŠ
Apologies for not being helpful this time.
Cough cough itâs 3 am cough
Good time to code
My credits say otherwise but ok
It was confusing for everyone lol
Donât be too hard on yourself
Both are true

Greed has consumed him
Well um, thank you for feeling Axy was helpful
Thank you for being helpful
Damn guess Iâll let you hang out to dry next time smh /j
HELP
xD
i forgot revo hi revo
Huh... Axy felt like since they couldn't solve the problem, and was stuck on what chudhit was intended to do for most of this time, that they weren't helpful. But somehow we were considered to have helped.
Revo the goat
has done NOTHING and made it anyway what a prodigy
Fr
yay
it was literally your printchecks
i would not have known it was four triggers
Oh, yay
he's here too ig
Pft, it's not that bad haha
yandev
Yandev's code could be performant on specific hardware actually, even though it looks bad
yeah a toshiba microwave


Surely, we can code Balatro on a microwave
The fire is the food burning
Because your chips and mult set the cook time
xD
burning down the house trying to play balatro on a microwave
HA
i forgot i went to the credits to actually give you your thing
i did axy
Thatâs not my discord tag đ
is that a joker
Game
I signed up for the closed beta (that I didnât get in) and early on it didnât allow usernames with underscores at the end lol
laaame
They fixed it but after I speedran signing up lol
fixed
Thank
OH RIGHT
Wondering what you wrote for Axy now 
here's your competition while i get it from the gallery /j
Bet
Jsyk I helped N with VanillaRemade so I think Iâve earned the right to stand with him
Ijiraq transformation sounds cool
Like a gundam
or a magical girl
or a magical gundam girl
itâs actually a cryptid that steals kids but sure
I endorse this message
you

i saw you earlier somecom here's yours
Seems like the Chud Joker is being reworked a lot xD
Man
It was the breaking handcuffs image lol
Why is yours mirrored đ
so it can look at my pfp
Surely
Who
idfk that's just her name
The vocaloid?
yeah
Lmao
there is now only one behemoth keeping this release from releasing
Thats gonna be hype
Oh boy
three patches
this guy has three patches
and NONE OF THEM WORK FOR THE LOVE OF
(they patch properly they just dont do anything đ)
What exactly is he meant to do
whats it called in balatro when it does that little splash text effect? like the NOPE or the EXTINCT effect. i want to find it in steam modded guides but idk what to look for
youre not gonna believe this
STOP LMFAO
its called message?

so if youve ever played inscryption
Yes
ok thanks!
I have not
oh right it was you
ok well postgame spoilers
Marathon:
but you rushed to the closed beta
but yeah he disguises himself as a joker at the start of each ante and if you trigger the joker it'll turn into him
also if you get the joker he disguises as it'll apply the priceless sticker to itself
in which you cannot sell it
there are special exceptions for some jokers
exceptions as in "i have a funny twist on the effect"
well
as you saw in the ss
he doesnt pick the fake costumes
he uses the basegame sprites đ
the exceptions arent finished because we're trying to get the actual automated system (a fodder joker) running
and one i havent even begun on
it went from the sticker being on literally everything
if it was a card, it was priceless
to uh
nothing it just
wont
appear
at all?
Bruh
hence "we suppressed it too much"
id hit up delirium more often but he's doing his own thing rn im not tryna cramp
pardon
âIf you get the joker he disguises as itâll apply the priceless sticker to itselfâ
How Iâm interpreting this is if you acquire the joker the Ijiraq is disguised as, the Ijiraq gets the sticker. Is that correct?
the costume heâs wearing does so you canât just sell him
Once the transformation happens he loses it
the costume
Hm... How would Axy approach this... So it would "disguise" itself by setting its atlas and position to the target joker, along with any soul positions. If another joker (in the card areas with calculated jokers) contains the target joker, apply sticker?
this is costume say hi
Ah ok this is making a bit more sense now
see it's not THAT bad (it's that bad)
I didnât realize costume was technically its own joker
whats the lua syntax to check if a card is in a table
for instance if table destroy contains context.destroy_card
where destroy contains several cards to be destroyed
like .contains
a for loop
for _, card in destroyed, if card == context.destroy_card?
function table(table, card)
for i = 1, #table do
if (table[i] == card) then
return true
end
end
return false
end
should be self explanatory but lmk
actually dont lmk omg it's almost 4 am
why did i let you people keep me here good NIGHT
cant even say tmr
im already there
elseif #destroyed > 0 then
if context.destroy_card and context.cardarea == G.play then
for i = 1, #destroyed do
if (context.destroy_card == destroyed[i]) then
return {
message = 'Electrocuted!',
colour = G.C.RED,
remove = true
}
end
end
end
end
seems like that should do it
I was hoping to make a joker without asking a question here but that'll have to be later ig
how do I check the currently played hand type?
context.scoring_name?
why in the world is this displaying as 400
loc_vars?
nothing out of the ordinary
Ohhh, this makes sense now that Axy's read the code. Interesting that you copied the card's description text too, Axy thought you'd just change the atlas sprites. It's a nice idea to apply the sticker while setting the ability, Axy doesn't know enough about set_ability to know why that's preferred over using add_to_deck. Could the sticker be removed in a calculate function, by removing the sticker if the appropriate boolean is false? That seems inefficient, and might not work if you have a valid reason to apply the priceless sticker when the costume is removed. Would have to experiment with the Joker and try random things to see if it works.
No need to reply rn, feel free to ping when you're awake and such
Still does nothing
(ik for a fact i used the right hand bc the right hand is always full house for rn)
context.scoring_name not context.string_name
after destroying some cards it removes them from the full deck but not from the like, deck counter? and still tries to draw them
and the deck says like 52/48 and draws empty spaces
also is there a better way to remove a playing card than start_dissolve
how does SMODS.destroy_cards work
never used it before :3
fair enough
I have Joker Hands themselves working perfectly, now I just need to figure out this.
What happens if you print G.P_CENTERS.j_modprefix_key.config.extra.score?
this genuinely doesnt make sense to me
it literally says 150
Did you save the file?
what is Joker Hands referring to
rewrote the whole joker, seems to work now
Poker hands but for jokers?
anyone know the name of code for the negative cards? (not jokers or consumables)
ill try thanks
is it possible to call a function of another card in another card? for example calling hermit to be used 5 times in another consumable
Vanilla cards do not really have a specific function of their own to call. For modded consumables, you can reference the .use function of the center.
Better off just duplicating what you need.
how can i get the values for the current and max count of hands/discards?
Hey ! I'm pixel art artist RogueLeaderArt and I also happen to be quite passionate by balatro So feel free to reach out if you need some help designing some jokers for you mods ! All I request in return is just a mention in the credits 
(Attached, a quick example of the kind of stuff I can do !)
you should use Balatro's color palette (for example the base game does not use black, only dark grey, look at Sock and Buskin) and pixel perfect
Is there a way to check if the most recent discarded cards are a specific enhancement and then draw them back to the hand if so?
I tried draw_card(G.discard, G.hand, 90, 'up', nil, discarded_card) to no avail so im asking here
-# im not goint to make the same mistake thrice, discarded_card was established earlier in the function
Yes.
Please, elaborate slightly
I need to go to sleep, i'll ask more tomorrow
is there a way to instantly win with a card if i have a certain joker?
Yes.
I want to make steel cards count as gold cards and vice versa as a side effect for my Joker, so I looked at Smeared Joker's black magic hook and made this which obviously doesn't work at all and crashes the game
what do I do and how do I check for enhancements ike "card.base.suit" does?
howww
Yeah I know ! These are actually of a card game i'm making for a friend who loves to collect Joker themed cards !
for that you should use quantum enhancements
(i dont have an example with me on how to use them)
Is there a way to remove a joker from the pool through a calculate function?
how do i make my own mod
check the lastest pin on #âă»modding-general
thanks, will research it
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollars } }
end,
calculate = function(self, card, context)
if (context.joker_main) then
local hand = G.GAME.current_round.current_hand
local hand_score = get_numeric(hand.chips) * get_numeric(hand.mult)
local blind = get_numeric(G.GAME.blind.chips)
print("hand_score:", hand_score, "blind:", blind)
if hand_score >= blind then
ease_dollars(card.ability.extra.dollars)
return {
message = "$" .. card.ability.extra.dollars,
colour = G.C.MONEY,
}
else
G.GAME.chips = math.huge
return {
message = "WRONG!",
mult = - math.huge,
colour = G.C.DARK_EDITION,
}
end
end
end,
}
is this right?
context :If your scoring hand catches on fire, gives 25$
otherwise, set your score to false infinite.
the otherwise is 1 in 6 chance
how do you get unseeded randomness?
math.random()
thanks :D

how can i make my own planet card?
omg nxkoo and missing number voice reveal
shh
Is there a context that enhancements held in hand can use to do something when a card scores
Or stickers too
Is there an example or anything?
No.
No.
finally uploaded my first modđ„ł
i should add planets to vanillaremade those seem easy to copy paste
bump
whats the problem
does it seems right
or am i missing something
context :If your scoring hand catches on fire, gives 25$
otherwise, set your score to false infinite.
the otherwise is 1 in 6 chance
well there are a couple of things i would have done differently
but it would works right
good idea actually
hold on
well i mean it does work
but idk if the false inf one works or not
or do i forgot to putt probabilities in it?
i dont see the probabilities in the code
elseif pseudorandom("seed") < G.GAME.probabilities.normal / 6 then
yes
well idk what get_numeric is
this is what i would have done
calculate = function(self, card, context)
if context.final_scoring_step then
local hand_score = hand_chips * mult
if hand_score >= G.GAME.blind.chips then
return {
dollars = card.ability.extra.dollars
}
elseif pseudorandom("seed") < G.GAME.probabilities.normal / 6 then
G.GAME.chips = math.huge
return {
message = "WRONG!",
mult = - math.huge,
colour = G.C.DARK_EDITION,
}
end
end
end,
idk if the second return works
thats fair
imma try something else first
and if it srill doesnt work
imma try and tweak the thing you send
I kept hearing about a way to change base Balatro code?
lovely patching?
is that what it's called?
bunp
context.full_hand for played hand.
context.pre_discard and context.full_hand for the discarded hand
anyone know any examples of planet cards?
there's one in the pokerhand example in the smods examples repo
do i have to do the statements for them separately or can i make it an or inside the for statement (and if so how would i do that, am i able to just make it like for k, v in pairs(context.full_hand or (context.pre_discard and context.full_hand))?)
depends on what you want to do
for k, v in pairs((context.before or context.pre_discard) and context.full_hand or {}) would work
ok
wait is it possible to have a joker that has a different description when they appear in the shop
yes
hwo
do you want it to be different only in the shop? boosters as well? the collection too?
make it booster and shop only
in loc_vars return { key = card.area and (card.area == G.shop_jokers or card.area == G.pack_cards) and "j_modprefix_altkey" or nil }
and where do i put the text for desc?
oh okay
OHHH OKAY i understand it now
@red flower ?
en-us.txt ?
.lua
you would do j_mvan_original = { name = "name", text = {"desc"} } like you would a normal joker
gotcha
hmm
does that mean it works or it doesnt
this one is the main one
not the shop one
can i see the code
i will also join was the shop
how do i combine them togeher
thanks
gold on
ohhhh
okay i see now
return { vars = {}, key = ... }
?
pardon
descriptions
why does it have 2 keys and 2 loc_txts?
which
woah discord bugged out
I was seeing this image
oh trippin
hmmm idk :3
kill people with hammer
try just key = "j_mvan_original" to see if it works at all
in where
loc_vars
key = self.key doesn't work?
what would that do
Just use the original key.
nah
oh ok then thats the problem
im fairly new to this, what does this mean
how can i have a boss blind detect unscored cards? i assume context.full_hand and context.scoring_hand don't exist
...wouldn't key = nil break it?
no
it's the same as not returning a key
huh. well, I do it anyway.
context.cardarea == 'unscored'
i mean thats fine, but its not relevant to this issue
whats seems to be the issue here
this mod is a curse to begin with
sure
i press Ctrl + S every 2 seconds
this is for some reason not only working at the wrong time (for some reason whenever the first hand is drawn it looks through the deck?), but also adding/subtracting more times than intended
ur mod is cursed sorry
god damnit
this a sticker?
do music tracks have priorities? mine isn't playing
(might be an issue with my context though)
SMODS.Sound({
vol = 1,
pitch = 1,
key = "polargeist_music",
path = "phanta_polargeist.ogg",
select_music_track = function()
if #SMODS.find_card('j_phanta_normalface') > 0 then
return true
end
return false
end
})```
yes
Yes.
i dont know what the first issue is but the second is because each card with the sticker is doing the code for all other cards witht the sticker
Try putting return 1e6
you need to check if the card is the same card doing the calculate
đ
so add context.other_card == card?
what does self.key do tho
sorry, i just noticed something else
you would do instead of card.ability.hmlt_br_st
v == card
if the condition is false it uses the original key
that's why I added the or nil you removed đŠ
ohhhhhhhhhh
forget this
imma scrap that
ill keep the line and the loc folder just in case it works tomorrow
like this?
yes
is this still connecting all stickers to go off at once
does context.cardarea exist for blinds? not sure where i would call it
yes
(depending on the context)
which context would you need to call it in to do effects on individual cards?
context.individual?
do booster packs technically discard cards at the end of them? (asking so it doesnt fuck up my code)
hey, can you detect player's least played hand for a description?
or is it not possible
it does not evidently (or the game accounted for it, anyway)
You could set it to have at least 1 play which would help the 0 tie
ties?
Multiple lowest played hands
ohhhh
If 9 hands are played 0 times thats 9 hands that are lowest played
not possible then
Setting it to a limit of being played at least 1x imo is the wave
Because then its less likely to be a huge tie
hows that
i'd break the ties by having the lowest poker hand win
Just have a check to see each hand that was played at least one time
i.e. if it's between pair, 3oak and 4oak, choose pair
here's my plan:
i want the title to have their least played hand
but i want the description to be a random hand
like obelisk and todo at the same time
i guess this is right?
ignore the config
worked
Im gonna save this and send it every time someone asks if their code will work
Basically I'm gonna send it 30 times a day
i stole it from aiko
not asking in this channel anymore due to fragility
jk
balatro modding guide but it just teaches you how to add prints everywhere to debug
Its okay I'd make a mental note and ping you at random hours instead
This is the most Bill Wurtz thing i've ever seen that wasn't made by Bill Wurtz
im literally listening to bill wurtz rn
I will always think anything made like that is bill wurtz
thank you doc
does this work đ„ș
no
im deleting my IDE
im struggling
i want this to delete some cards and put an enhancement on the rest but i just cant figure out the right context order
calculate = function(self, card, context)
local charged = {}
local eletrocuted = {}
if context.destroy_card and context.cardarea == G.play and not context.blueprint then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_suit('Hearts') then
if pseudorandom('defibrillator') < G.GAME.probabilities.normal / card.ability.extra.odds then
eletrocuted[#eletrocuted + 1] = scored_card
end
end
end
if #eletrocuted > 0 then
for i = 1, #eletrocuted do
print(i)
print(eletrocuted[i])
if context.destroy_card == eletrocuted[i] then
eletrocuted[i]:remove_from_deck()
eletrocuted[i]:start_dissolve()
-- SMODS.destroy_cards(eletrocuted[i])
end
end
return {
message = 'Electrocuted!',
colour = G.C.RED
}
end
elseif context.before and context.main_eval and not context.blueprint then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_suit('Hearts') then
charged[#charged + 1] = scored_card
scored_card:set_ability('m_nycto_charged', nil, true)
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end
if #charged > 0 then
return {
message = 'Charged!',
colour = G.C.BLUE
}
end
end
end
It's okay when I get mad I start deleting mod githubs as a coping mechanism
There should be no more balatro mods by tomorrow
because there is no context.destroy_card in context.before and context.main_eval and not context.blueprint
destroy_card happens almost at the end
but there is no electrocuted outside that for loop
you need to reverse the logic, first mark the cards for destruction and transforms the rest, then destroy
thats what i tried
but it seems like that table disappears
outside the scope or something
it does, you need to mark it on the card
oh how do you do that
each context is a different call to calculate so local variables disappear
card.modprefix_marked = true or anything you want to name it
so first go through the context.before and mark whichever ones dont get transformed, then at context.destroy remove all marked cards
bless
2 more questions, quick ones
calculate = function(self, card, context)
local charged = {}
local eletrocuted = {}
if context.before and context.main_eval and not context.blueprint then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_suit('Hearts') then
if pseudorandom('defibrillator') < G.GAME.probabilities.normal / card.ability.extra.odds then
scored_card.nycto_marked = true
else
charged[#charged + 1] = scored_card
scored_card:set_ability('m_nycto_charged', nil, true)
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end
end
if #charged > 0 then
return {
message = 'Charged!',
colour = G.C.BLUE
}
end
elseif context.destroy_card and context.cardarea == G.play and not context.blueprint then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card.nycto_marked and context.destroy_card == scored_card then
card:start_dissolve()
eletrocuted[#eletrocuted + 1] = scored_card
end
end
if #eletrocuted > 0 then
return {
message = 'Electrocuted!',
colour = G.C.RED
}
end
end
end
is start_dissolve okay here or should i be using some other method
like SMODS.destroy_cards or whatnot
yeah
so for every played heart card in main.eval, 1 in 10 chance to mark it, then later during context.destroy_card, return { remove = true } for each marked card
yes
sidenote i should test if context.before and context.main_eval makes sense or remove it from vanillaremade haha
I don't understand how to use get_weight()
For what?
changing a rarity weight, that's what it's used for, right?
i wish there was a doc about smods.font cause like idk what im doing wrong can somebody give me a hand here
hmm
load file maybe?
hi, i made this code to double a joker's number values, but instead of that its changing its ability to give xmult, what 's wrong with it? lua for key, effect in pairs(G.jokers.cards[card.ability.extra.sel_joker].ability) do if type(effect) == "number" then effect = effect + effect G.jokers.cards[card.ability.extra.sel_joker].ability[key] = effect end end for key, effect in pairs(G.jokers.cards[card.ability.extra.sel_joker].ability.extra) do if type(effect) == "number" then effect = effect + effect G.jokers.cards[card.ability.extra.sel_joker].ability.extra[key] = effect end end
No.
Is there any way to see if the hand being discarded is a pair?
Would you please elaborate on how I'd do that?
Look at Reverse Card from Cryptid
Honestly just elaborate in general, âyesâ doesnt help anyone
Thanks a lot
how do i make it work đ
G.GAME.selected_back.config.center.key iirc
where is this
selected_back.effect.center.key?
If a question is not elaborated then an answer doesn't need to be
Its like when people ask 'is x possible'
Yes, it is
When people decide to say 'hey, if this possible, and if it is how would I go about it?' Then they can get themselves a valid answer
Just asking a simple question leads to the perception getting a yes would lead them to look at other documentation or other mods as examples
Is there a way to reroll booster packs?
yeah, you also don't know how much elaboration they need
do you only need to know if there are any difficulties? do you need an example? do you need a hint on how to do it? do you need me to code it for you?
i just dont reply tho
Followup questions do exist, and would reasonably be expected
A simple "yes" discourages that sort of ask
follow up questions have the same problems as asking to ask
Yea there's no point in asking a question just to ask it
They do slow things down, but just a simple yes can feel aggravating too
how can i make new tab like shop or selecting blind?
Like, yes, do you need any help with that?
where you're basically already trapped on helping them and they will also not get help from someone who might know but can't code it fully for example
Mmh, although Axy stays silent if we're not sure how to do a thing
same, i do think replying with just yes is often rude
Also in what way are you meaning
Adding a reroll button, generating a new one on skip
Or how
I suffer in a problem of being unsure how to deal with it
Like the 'is x possible' question always feels foolish because there isnt much you really cant do in a hacky way or otherwise that people come up with here
I just wish people on both ends were more concise
Like in the shop when you press reroll, it also rerolls the booster packs.
is there a way to make like shop discount?









