#💻・modding-dev

1 messages · Page 541 of 1

hushed field
#

Official Balatro code barely looks like any modded code

#

You can learn how to do things from it, but I think you need to be very comfortable reading and understanding code to really get much out of it. Especially because sometimes you'll be figuring stuff out in the vanilla code, while smods has a newer and more efficient implementation of it, already

midnight coyote
hushed field
#

I felt like I was going insane trying to set that up, and realizing that the way seals handle UI is by just checking if there's a badge, haha.

hushed field
manic rune
#

heres what i figured from coding yggdrasil and stacked
- if you want to create custom info queues, patch into generate_card_ui, and add into the info_queue table in there
- if you want to create badges, patch into G.UIDEF.card_h_popup

midnight coyote
crimson marlin
#

same

manic rune
#

this is what i did to add badges

hushed field
manic rune
#

this is what i did to add info_queues from extra effects

hushed field
#

My plan is to take some time tomorrow and see if I can make some changes at the SMODS level that make this easier to handle, haha

manic rune
#

yeah thatd be nice

#

unrelated but rn stacked's ui breaks with entropy which kinda sucks 3:

hushed field
#

I ran into some issues with setting calculations up as well. Or, issues, more just me not knowing

manic rune
#

stacked's calculate is really simple so i didnt come into that much trouble with setting it up

#

all i did was hooking into Card:calculate_joker :3

hushed field
#

I assume Stacked works similarly to how I handled spells, which is real easy, haha

manic rune
#

id imagine you will want to hook into uhh something else though, i talked about it here before, lemme check

hushed field
#

I've got it all set up and working, I think, but I just kept running into little hurdles of needing an additional patch, haha

#

Calculations at a card layer level are hardcoded in at multiple steps in the process, is what I learned

manic rune
#

this one is more generalized

#

i think it should check all contexts?

#

shrug

#

i havent tried that approach though

hushed field
#

That sounds like it might be a good target for the mod calculate function PR

#

Yeah, my issue was just that in imitating seals, I didn't just need to patch in a calculate_counters, but also add counters as a key to some arrays, haha

red flower
midnight coyote
#

i don’t know how to PR the wiki

#

i tried forking it

#

but

#

it didn’t take the wiki with it?

manic rune
#

i dont think you need to fork it

hushed field
#

Also wanna sit down at some point and maybe see if I can mess with the way blinds are handled internally, because a lot of that stuff feels spread out and annoying to figure out as well

red flower
manic rune
midnight coyote
#

oh

manic rune
#

u can press here and it will lead you to the wiki github lol

midnight coyote
#

am an idiot

manic rune
#

yeah its fine, it took me a good 5 minutes to figure that out too

red flower
#

the only thing I don't recommend editing is the calculation page because eremel is rewriting it

wintry solar
#

In all that spare time I have

manic rune
hushed field
#

Might just go through a dump and mark all stuff that's hardcoded in and see how easy it'd be to make it modular

wintry solar
#

I also don’t have a huge amount of time to actually read wiki PRs so if people are interested in reading through and making sure they: a) are accurate; and b) make sense, just leave a comment on them and that would be very helpful

manic rune
#

*looks at N'

red flower
#

i dont know how to read

manic rune
#

guess we are both in the 98% then

#

i would volunteer to help but i dont think im qualified myself lmao

wintry solar
#

N does a lot of help already, and this is a community effort, I’d like to see more of you guys help out where you can, and reading a wiki PR and trying it out is certainly something most people who are reasonably confident using smods should be able to do

hushed field
#

Reading wiki stuff I can definitely start helping with

manic rune
#

i didnt know this existed actually

#

looks incredibly helpful since there has been a few people who struggled with what G/G.GAME has

wintry solar
#

But generally, smods is a project run by volunteers (though mostly me at present) who do stuff in their free time for fun. Having messages complaining about things being missing from the wiki, or PRs not being merged yet, whilst might seem helpful to you, is demotivating and makes me less likely to do it

chrome widget
#

Yeah unlike a big funded project that can handle basically whatever feedback and filter what's needed, feedback for this kind of thing needs to be constructive and supportive because it also doubles as compensation for the work

manic rune
#

im sorry to hear that, please take your time with the new documentation :3

#

i want to take a shot on making vanilla ui functions documentation tomorrow

modern kindle
#

I should start funding this project instead then and make it worth the time 😎

manic rune
#

and general guides on like, how to create an overlay menu and stuff

#

the scariest part about ui is just not knowing where to use the nodes imo

chrome widget
#

UI stuff is definitely one of the lighter documented things, so people would benefit from it a lot!!

hushed field
#

I have a bunch of notes that I could realistically turn into some documentation. What to hook for which end result, for example

manic rune
#

knowing which function to hook to, where to patch to get your results would be really nice

red flower
#

if anything doesn't fit smods docs feel free to let me know and i can include it in the vremade wiki

chrome widget
#

A lot of UI hooking that I do looks like complete garbage magic

modern kindle
#

Id love to actually pr things but I am not confident enough to make it something acceptable to people
So I kinda just sit around

hushed field
#

I assume most people have a similar issue as I have when it comes to documenting UI functions, and that is that even if you get end results, it still feels like guessing, haha

rocky plaza
#

uhuh
would yall be ok with me working on a pull request to add some other clarifications to the wiki
i want to contribute somehow but dont have enough time or energy to actually do work on source code

frosty rampart
#

documentation on hooks in general would be nice too I think. from what I can tell most people point to some forum post that isn't even related to balatro modding as a starting point

hushed field
wintry solar
#

The main thing is, is that writing documentation that people are going to find useful is hard, especially when it’s about things that you’ve created and iterated upon so know how they work implicitly

manic rune
#

eremel has been really nice with my prs despite how horrendously the code is set up ngl

modern kindle
wintry solar
manic rune
#

i feel like he would achieve better results by just, reading my code to know where i did it and redo it from scratch lmao

wintry solar
#

Any code stuff I just rewrite if it needs it

red flower
#

A lot of people want tutorials and not documentation, telling them that a function returns a boolean is gibberish sometimes

wintry solar
manic rune
#

gulp

hushed field
#

Finding the proper base line is such a difficult skill that there's uni degrees dedicated to proper copy writing, haha

#

When I was working with setting up LLM training stuff for linguistic research, I was harshly confronted with the fact that even when codebases are documented, good documentation is a whole separate skill, haha. Smods has a lot of gaps that came to be over time, but I personally think the existing documentation is really clear. But yeah, it's definitely not a tutorial.

red flower
#

i also work with LLMs and had the same experience haha

manic rune
#

3: i cant relate, i jumped straight into balatro modding

rocky plaza
manic rune
#

probably why i didnt know that many coding terms too lol, like instead of iterating i used to say "go through the table" before

rocky plaza
#

also yeah good documentation takes lots of effort

manic rune
#

true

#

you need a lot of outside opinions too

wintry solar
#

writing docs is also boring lol

manic rune
#

im used to it

#

ive been writing 500+ words essay thrice a day for 2 weeks now 3:
-# im growing sick of english by now

rocky plaza
manic rune
#

mhm

hushed field
#

Tbf, don't assume me having touched LLMs means I'm a programmer of any kind, haha. The basics are as approachable as any random type of application. There's just a classic ecosystem of nerds writing documentation that is entirely unaware of a realistic baseline, and both crunch and passionate iteration make it so a lot of code libraries just are very badly documented. The luxury of having knowledgeable people around to bother and get answers from is an insane difference, haha

chrome widget
#

Yeah unfortunately for a lot of newer programmers, reading function documentation is not easy. And partially it's because for a lot of traditional programming language documents, it assumes a conceptual background that allows people to make more assumptions

#

It's why I always really enjoyed the Unity scripting documentation because it provides a direct example of almost everything it actually documents

hushed field
#

It's a weird balance where reading documentation is a skill, and writing it is a skill, and if both parties are unskilled, it's a real bother, haha

rocky plaza
chrome widget
#

Yeah. It's hard to build that skill without documentation geared towards the unskilled, but it's hard to write that documentation when you're skilled and primarily sharing for other skilled people, since it seems like bloat

#

In general that's also a major part of code readability and a skill too. Being able to make your code readable to less skilled or less familiar people

languid canopy
#

hello guys, i have a question, instead of replacing the vanilla suits, by the modded ones, how do i do to just, not load them into the deck ? (ping me pls)

rocky plaza
wintry solar
frosty rampart
hushed field
red flower
#

I hate commenting code other than with doc strings

chrome widget
#

I'm personally in the camp nowadays of "code needs to be readable on its own without comments", and typically I only primarily comment code for function defs, or if something is required to be segmented across multiple files and it's hard to find those assumptions

hushed field
rocky plaza
chrome widget
#

I will also occasionally use comments for general file organization as well

frosty rampart
#

ah right yea function defs i should probably get comments on
i'm the resident IDE hater so stuff like the LSP tends to slip past me if i don't purposefully think about it

hushed field
#

I comment my code in part because I've seen people link my code to very green devs, haha. I mostly use it to section things, because if a lot of lines get close to each other I lose sight very easily

red flower
frosty rampart
red flower
#

i use lsp a lot so i try to pr all the changes to smods when i can

languid canopy
red flower
frosty rampart
hushed field
rocky plaza
hushed field
#

Oh, I should make sure to set lsp stuff up for these APIs I'm making

red flower
#

jokerdisplay and joyousspring also have lsp :3 mostly because they are both set up as APIs

#

jokerdisplay more so obviously

wintry solar
rotund sable
wintry solar
#

I also don’t understand lsp properly so miss it out a lot 😭

red flower
languid canopy
hushed field
#

I keep wanting to learn more about Love2D as a whole just to help me figure out some stuff as well. There aren't too many people I can ask about how to handle UI boxes interacting with shaders, after all, haha

wintry solar
#

I’ll post it here when it’s out

#

And whatever other dev channels I remember about if you’re in any of those

rotund sable
wintry solar
#

Right, time to finish this card limit stuff

chrome widget
#

Card limit stuff?

wintry solar
#

It makes card limit modifiers on cards affect the area they’re in

chrome widget
#

Don't they already?

#

Or do you mean just like aside from the specific one used for editions

hushed field
#

They do in the vanilla card areas because they're hardcoded to, right?

wintry solar
#

if you put a negative joker in your consumable slots you'll still have 6 joker slots

#

and 2 consumable slots

#

if you put a negative card in a custom area, nothing happens

hidden notch
#

Will there also be official support for Cards that take 2 up slots then (for example)?

wintry solar
chrome widget
#

It's technically not, though it's a slight difference in how the mechanic is perceived by the player

wintry solar
#

that's true

chrome widget
#

"-1 slots" is a penalty. "Takes up two slots" feels more like it's a big important thing that deserves space

hidden notch
#

I mean yeah.. Kinda?
If I have a -1 Slot property I can still pick the Joker up if there's a Slot open x3
If the Joker "Takes up 2 Slots" I just can't take it

wintry solar
#

I don't think it'd let you take a joker with a -1 slot if you only have 1 slot, though I havent tried yet

chrome widget
#

Logically it shouldn't because the game tries to avoid putting you in a position where you have more items than the slots visibly allow

#

Which is why negatives in the first place extend your slots

#

Rather than just not count against the limit

wintry solar
#

hmmm, it does right now

#

oh I havent patched that function yet woops

hidden notch
wintry solar
#

yeah I can see the logic behind it

#

okay yeah it won't let you buy a card with -1 slots if you're at 4/5

hushed field
#

I didn't even realize that was an extant property already

crimson marlin
mystic meteor
#

Was wondering if anyone could help with this

languid canopy
red flower
languid canopy
#

aight thanks

tulip radish
#

how would i add a second joker? (just got my first one made and polished)

red flower
#

the same way you added the first one

#

you can do it in the same file

tulip radish
#

cause if not i may just copy my first joker's code

red flower
#

<@&1133519078540185692>

bold sleet
#

Another one?!

#

The 4th one today...

red flower
#

no i was pointing mods to how to add more than 1 joker

spring lantern
#

shaders are so fucking weird man

#

how do i make it look more like it's burning

#

i literally copy pasted a bunch of shit from the example mod

tulip radish
wintry solar
#

Do you have a SMODS.Sound somewhere?

tulip radish
#

oh i entirely forgot to add that

#

oops

crimson marlin
#

Im trying to make a new hand but for some reason it is disabling full house and flush house, why wont this work??? 😔

        if true then return {} end
        if #get_flush(hand) >= 1 then return {} end
        if #get_straight(hand) >= 1 then return {} end
        local valid = {}
        local count1 = 0
        local count2 = 0
        local count3 = 0

        for i = 1, #hand do
            local card = hand[i]
            
            local num = card:get_id()
            if card.label ~= "Base Card" then
                if num == 2 then
                    count1 = count1 + 1
                    table.insert(valid, card)
                elseif num == 4 then
                    count2 = count2 + 1
                    table.insert(valid, card)
                elseif num == 7 then
                    count3 = count3 + 1
                    table.insert(valid, card)
                end
            end
        end
        --if hand[1].base.id == 10 then
        --    print("WOOOOOOOOW")
        --end
                

        if #valid > 0 and count1 == 1 and count2 == 1 and count3 == 1 then
            return {valid}
        else
            return {}
        end
    end```
tulip radish
#

ok wtf am i doing wrong (im pretty sure everythings correct)

frosty rampart
#

play_sound() takes the key of the sound you made as a string, and there shouldn't be a file extension
it should be play_sound("thesillymod_horse", 0.7, 0.5)

rocky plaza
#

dont forget the quotation marks

tulip radish
#

ok its the same error again?????

frosty rampart
#

it might need to be SMODS.Sound with an uppercase S?

crimson marlin
#

ye

tulip radish
#

ok it works! (i did NOT realize it needed to be a capital S)

#

well

#

SEMI works apparently

#

(the crash doesnt happen anymore, but in testing the sound just DOESNT play?)

#

it may be because im on a continued save

#

nope

#

this joker MAY just have to go soundless until i figure out how tf to get the sound to work

rotund sable
#

Is the sound present when you open the file manually

faint yacht
#
SMODS.Sound({key = "farts", path = "farts.ogg"})

return {
  sound = 'modprefix_farts'
}
tulip radish
#

i WAS using play_sound before

faint yacht
#

play_sound('modprefix_farts')

ocean sinew
rotund sable
#

And play sound should also work

faint yacht
#

toga is my prefix as example here.

tulip radish
crimson marlin
#

for some reason the new hand I made is disabling full house, do you know why this is happening?? (even just returning {} in evaluate still does this :/)

languid canopy
#

Heya
Is the weight of rarities of jokers the probability that said rarity drops in the shop (W/O the probability that a consumable drops) ?

hushed field
languid canopy
#

very nice, thanks

compact valve
#

demo video for one of the jokers I've made

cursive gazelle
#

Very good looking

#

8/10

#

Would definitely pick up in a run

compact valve
#

ty

icy igloo
#

Error

Syntax error: game.lua:4: '=' expected near 'Game'

Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: at 0x7ff843b42fa0
[C]: in function 'require'
main.lua:16: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

#

i did a bad

#

ive got the same error 4 times

#

GOT IT

wispy falcon
#

Do I make all UI stuff in 1 single file or in multiple?

icy igloo
#

multi

wispy falcon
#

And into what would I split them?

red flower
#

when working on a single feature I recommend keeping things in one file until you think it gets big enough to split

#

multiple files will just make it confusing

wispy falcon
#

Do you have an example for me?

red flower
#

of what

wispy falcon
#

What you would count as too big

red flower
#

whatever you feel like it's too big

wispy falcon
#

Okay

red flower
#

if you start getting lost when looking for stuff then it's too big

wispy falcon
#

And for UI stuff I need to make use of patches?

red flower
#

depends on what you're doing, jokerdisplay is a UI mod that doesn't use a single patch but my other mod uses patches for UI stuff frequently
"UI stuff" is too broad a category

wispy falcon
#

Let's say if I wanted to make extra buttons for cards and maybe change like the things in my mod's menu

red flower
#

I do that in hooks

#

the mod's menu has functions for that in smods

digital pier
#

what does this mean

red flower
digital pier
#

WAIT WRONG CHAT

#

NO I FUCKED UP

red flower
#

probably old bunco if you have that

wispy falcon
digital pier
red flower
red flower
wispy falcon
digital pier
#

nope thanks vro!

red flower
wispy falcon
hidden notch
#

So I wanted to be silly and tried to create a Blueprint that repeats the left jokers effect multiple times; Well, I learned the hard way that trying to merge the same effect crashes the game. I should've seen that coming lewxen_Noblewoman_Laugh

But my Question is: Any good way of repeating another Jokers effect multiple times?

-# Crashing Code attached

calculate = function(self, card, context)
  local copy_effect = nil
  -- get left joker effect
  for i = 1, #G.jokers.cards do
    if G.jokers.cards[i] == card then
      if i > 1 then copy_effect = SMODS.blueprint_effect(card, G.jokers.cards[i - 1], context) end
      break
    end
  end
  if copy_effect then
    -- example: just do 4
    local repeats = 4
    local merged_hell = {}
    for i = 1, repeats do
      -- freezes when merging same effect
      merged_hell = SMODS.merge_effects( { merged_hell }, { copy_effect or {} } )
    end
    return merged_hell
  else
    return nil
  end
end
rocky plaza
red flower
#

if you still want to do it like a copy then you need to copy the table

#

tho thats not very straightforward with return tables i think

hidden notch
#

Hmm.. I see.. I'll make it work (or look into the optional feature) x'3

wintry solar
#

I am surprised merge_effects doesnt work here

rocky plaza
#

yall how are the docs for randomness
am i blabbing too much
i tend to do so when explaining shit

wispy falcon
#

Wait, how do I check if a joker is clicked, so the buttons appear (like the sell, buy and use buttons)?

hidden notch
wintry solar
rocky plaza
wintry solar
#

it will be in the wiki

#

I just haven't finished working on the calculation page rewrite

rocky plaza
#

uhuh
well i'll look elsewhere then

#

see what i can do

wintry solar
#

I'm not saying what I already have is perfect though, just it might be helpful to use as a reference

red flower
#

oh no im not dumb

modern kindle
#

Great news chat he's smart

#

Clap for him

red flower
#

i did make merge_effects so if it doesnt work its because im dumb

wintry solar
#

is it not that they're putting merged_hell inside a table within merge_effects?

#

and the copy table too

#

there's just too many tables, no?

red flower
#

no thats fine, the syntax is likeSMODS.merge_effects( { ret1 }, { ret2, ret3 } )

#

or any number of lists

#

i just copied merge_lists for that part

hidden notch
wintry solar
#

something is wrong here

icy igloo
#

at least the text is a calm color

red flower
#

it doesnt copy the tables

languid canopy
#

hello, how do i make so theres another card instead of the ace of spades floating on the main menu of the game ?

wintry solar
icy igloo
#

could someone do a walkthru with me to get brain storm to run its refusing atm

hidden notch
# hidden notch So I wanted to be silly and tried to create a Blueprint that repeats the left jo...

Just boiling down the Code: This results in the same Hard-Crash:
-# (just make sure there is a Joker to the left ig)

-- Unsafe Code:
local copy_effect = nil
for i = 1, #G.jokers.cards do if G.jokers.cards[i] == card then
copy_effect = SMODS.blueprint_effect(card, G.jokers.cards[i - 1], context) break end end
local merged_hell = SMODS.merge_effects( {}, { copy_effect, copy_effect } )
return merged_hell

I'll skip out on that Joker-Idea for now, don't feel like reading up on the optional Retrigger feature either x3

gaunt folio
#

I've been trying to make a joker that levels up a played hand by how many times it has been played, The level up code with smart_level_up works with a test hand (Pair) but when I try anything relating to the hand played it crashes. I am probably doing something wrong, all I need is like an easier way for it to level up the played hand

(ie if I played a pair 3 times I want it to level up by 3)

wintry solar
#

do you have the count of how often it's been played?

gaunt folio
#

The one I have works with the level up thing

#

(G.GAME.hands[context.scoring_name].played)

#

but removing .played makes it crash so

wintry solar
#

just put level_up = G.GAME.hands[context.scoring_name].played in your return function

gaunt folio
#

okay nevermind i think i messed something else up that would explain crashing

#

gonna try some other trial and error bc it worked before with trying "Pair"

fading kiln
#

does anyone know how to stop check_for_unlock triggering when starting a run?

#

cause currently it checks before the deck is loaded so it always unlocks as soon as run starts

red flower
# wintry solar it's still broken though, right?

sorry i had to test it myself so i understood lol
but no it makes sense (although it probably shouldnt work this way), in the second iteration you're adding t to t so it makes a recursive table

rocky plaza
#

yo is there a function i can hook to prevent a certain enhancement from being copied?

red flower
#

the fix would probably be to just copy each value in the return tables and in extra manually in merge_effects

#

copy_table would probably crash with card objects

red flower
#

i think that makes more sense actually

hidden notch
hidden notch
red flower
red flower
gaunt folio
#

Also is there a way to make every card of a specific type vanish? Trying to make a joker that makes a card with a specified seal, but theres a chance the joker and all cards with that seal disappear at the end of the round. Sorta like a gros michel thing but different?

hidden notch
red flower
#

my solution was a shallow copy of everything except for the extra table and then doing a pseudo deep copy of that

#

but it should be handled from merge_effects side

#

imo

willow scroll
#

how do i check outside of using context if the player is in the shop/opening a booster?

hidden notch
#

Thanks once again, I'm in your Debt pray

willow scroll
gaunt folio
#

Alright I managed to get the card to give seals at the beginning and still have the chance of vanishing. Is there a way to remove all cards of a specific kind such as seals?

glad osprey
#

how do i make a ui button play a specific sound

glad osprey
red flower
glad osprey
#

then how mute the og button sound

red flower
glad osprey
#

ty 🙏

gaunt folio
glad osprey
#

actually

#

its just card.seal

gaunt folio
#

I meant if it has a specific seal

frosty rampart
#

card.seal will be a string containing which type of seal if it has one, and it will be nil if the card has no seal
use debugplus, hover over a card with a seal with your mouse, and do eval dp.hovered.seal in the command prompt. dp.hovered gets the card object that you're currently hovering over for debugplus purposes

gaunt folio
#

ah

#

im dumb lol

#

TLDR what I want to do is when my joker disappears, I want every playing card with a specified seal to disappear too

#

this is idk probably atrocious code copied from recreated vanilla jokers but what would I do as scripts like this do nothing

red flower
#

instead of card it should be playing_card

gaunt folio
#

so thats what i missed

#

ive tried playing card but under a differnet thing so

#

ill try that rq

azure laurel
#

my joker is not working and idk why

gaunt folio
red flower
#

you forgot one card

gaunt folio
#

or do you mean the other card

#

ah

red flower
#

both

gaunt folio
#

so like this?

red flower
#

yes

gaunt folio
#

alright attempt 2

#

nope it still keeps the cards.

#

might be something else tho i found so

#

imma try

red flower
# azure laurel

joker keys are formatted as "j_key" for vanilla and "j_[mod's prefix]_key" for modded

azure laurel
hallow slate
#

Do lower prioritys for .TOML files load after higher priorities?

red flower
red flower
hallow slate
#

and do they load based on mod load order too

red flower
#

lovely doesn't read smods files

gaunt folio
#

okay since that didnt work i lowkey dont know what to do

red flower
azure laurel
#

still no work

red flower
#

it shouldn't be

gaunt folio
#

mines honestly pasted inside some gros michel script but the script itself works fine so im probably messing it up somewhat just pasting it in there so

#

all other functions work as intended so

azure laurel
#

now works

#

good luck i stop to try and not make all the jokers compatible

gaunt folio
#

this is probably atrocious code so idk

gaunt folio
#

to delete all cards with the "OneSeal" seal from the deck

red flower
#

i get that but when, how, why

gaunt folio
#

turns out im a bonehead

red flower
#

also side note that is not relevant to your issue but the smods examples are somewhat outdated, i recommend checking vanillaremade

gaunt folio
#

I put the destroy thing after the card gets destroyed so

red flower
#

so?

#

that shouldn't be an issue

gaunt folio
#

I put it before the destroy seal card command and it works now

red flower
#

weird

gaunt folio
#

when its paced like this

red flower
#

that shouldn't be relevant haha

gaunt folio
#

okay now it works perfectly for some reason

#

issue resolved ig

red flower
#

im going to check myself because if that's true that sounds like an smods bug

gaunt folio
#

might be but who knows

#

all i gotta say at this poitn for me is if it aint broke dont fix it

gaunt folio
#

unlocked = true,

this string maybe?

glad osprey
#

can i make an animated texture faster

frank ridge
#

I cant get my joker to count the cards drawn to hand after the first hand, but it will count initial drawn hand and the cards drawn from second hand on

fading kiln
#

but it triggers before the deck is loaded so it auto unlocks

primal robin
#

Is any SMODS function which fetch 1 item from pool and respect get_weight and in_pool thing?

wintry solar
#

SMODS.poll_enhancement does what I think you are asking

primal robin
#

okay!

keen atlas
#

im losing my mind, is my lua somehow bugged or i just dont understand something

red flower
#

ur lua is cursed

keen atlas
#

my luajit is cursed

#

how

#

tested will all jit versions, all cursed except vanilla lua 😭

wintry solar
#

# stops when it can’t find the next number in the index

wild escarp
#

Is there a context for drawing cards to hand, and where can I get the amount of drawn cards?

wintry solar
#

Oh wait some of them go last 1, wtf

red flower
#

luajit might have some weird implementation of it

wintry solar
#

This sort of makes sense with how pairs works

#

It just randomly looks through until it finds one where n+1 is nil

red flower
#

crazy

wintry solar
#

I wonder how it chooses the values

wild escarp
#

How do I check the amount of cards drawn to hand?

rapid stag
#

is there a way to do a calc_dollar_bonus version of SMODS.blueprint_effect figured it out, but god is it a janky implementation

midnight coyote
#

local function check_stickers(card)
    if card:is_eternal() then
        card:set_eternal(false)
        card.ability.eternaldormant = true

    end
    if card:is_perishable() then
        card:set_perishable(false)
        card.ability.perishabledormant = true
    end
    if card:is_rental() then
        card:set_rental(false)
        card.ability.rentaldormant = true
    end
end
local function reverseOnThatThang(card)
    if card.ability then
        if card.ability.eternaldormant then
        card:set_eternal(true)
        card.ability.eternaldormant = nil
    end
    if card.ability.perishabledormant then
        card:set_perishable(true)
        card.ability.perishabledormant = nil
    end
    if card.ability.rentaldormant then
        card:set_rental(true)
        card.ability.rentaldormant = nil
    end
    end
    
end
SMODS.Joker {
    key = 'phantom_ruby',
    pos = {x=0,y=2},
    atlas = CHAR.G.jokeratlas2,
    
    calculate = function(_,_,context)
        if context.card_added then
            check_stickers(context.card)
        end
    end,
    remove_from_deck = function()
        for i=1, #G.jokers.cards do
            reverseOnThatThang(G.jokers.cards[i])
        end
    end,
    add_to_deck = function()
        for i=1, #G.jokers.cards do
            check_stickers(G.jokers.cards[i])
        end
    end
}

anyone got an idea as to why this makes my game crash on startuo

red flower
heady siren
#

Is there any way I could swap out an atlas for a deck skin on the fly?

#

I wanna make my own deck skin change coloring if Smeared Joker is present

rapid stag
#

which is called first, context.round_eval or calc_dollar_bonus?

scarlet imp
#
if not context.blueprint then
    if card.ability.extra.jiggle > 0 then
        local eval = function() return card.ability.extra.jiggle > 0 and not G.RESET_JIGGLES end
        juice_card_until(card, eval, true)                
    end
end

anyone know why the card jiggles much more erratically then it should? 'jiggle' gets set to 1 whenever the card is meant to be active, similarly to loyalty card

manic rune
#

if i have to guess your card is running multiple juice_card_until

light sable
#

Hi, I'm new to lua, modding in general, everything really 😅

If I'm understanding things correctly I'm wondering if the following would effectively disable the ability to play High Card and make it not show up on the list of hands. Or if there is another simpler or better way to do so.

{
visible = false,
evaluate = function(parts, hand)
        return {},
}) ```
keen atlas
narrow iron
#

i would access the options table with card.ability.extra.options right?

rocky plaza
harsh warren
#

guys i need help my joker does not appear in the game

wintry swallow
#

hi, i've been looking at the source code and have noticed the change_gamespeed and the array intilization of options for speed. Is it possible to call the change_gamespeed in a lua file?

topaz urchin
#

I'm new to this server. Would this be the right channel for getting help with a Malverk Resource Pack I've been working on?

rocky plaza
narrow iron
rocky plaza
harsh warren
rocky plaza
topaz urchin
#

Gotcha, thank you. I have two problems for anyone who knows anything.

harsh warren
#

or is it another one

rocky plaza
rocky plaza
harsh warren
#

sj

narrow iron
#
calculate = function(self, card, context)
        if context.selling_self and not card.debuff then
            G.E_MANAGER:add_event(Event({
                func = function()
                    local card_options = card.ability.extra.options
                    local current_options = {}
                    for i=0, #card.ability.extra.options do
                        if not key_in_table(G.Jokers, card_options[i]) then
                            current_options.insert(card_options[i])
                        end
                    end
                    if not #current_options then
                        local key = pseudorandom_element(card.ability.extra.options, pseudoseed('treasurebag'))
                    else
                        local key = pseudorandom_element(current_options, pseudoseed('treasurebag'))
                    end
                    SMODS.add_card({ key = key, type = 'Joker' })

                    play_sound('magic_crumple2', 0.9 + math.random() * 0.1, 0.8)
                    play_sound('negative', 1.2 + math.random() * 0.1, 0.4)

                    return true
                end
            }))
        end
    end
narrow iron
#

thanks

manic rune
#

also, depending on what your key_in_table does, G.jokers.cards is the table that includes the cards not G.jokers

rocky plaza
harsh warren
#

ooooooh

#

alr thanks ill check that now

narrow iron
rocky plaza
#

theres prob something missing

harsh warren
#

yea it didnt appear yet

manic rune
#

the atlas size is wrong

wintry swallow
#

if im using lovely and lua, how would i go about accessing the change_gamespeed function, if possible? Can I call something like G.FUNCS.change_gamespeed ?

harsh warren
manic rune
#

yes

rocky plaza
harsh warren
wintry swallow
manic rune
#

71 95

harsh warren
#

famn

#

damn*

narrow iron
harsh warren
manic rune
#

do you have a metadata file (.json) file

#

or smods header

rocky plaza
wintry swallow
harsh warren
manic rune
#

looks correct then

#

what does your main.lua file look like now

harsh warren
#

btw another question

manic rune
#

i dont think that works?

harsh warren
#

my lua file of the joker is not named "jokersfreddy.lua" is just freddy.lua

#

like this

#

idk if theres something wrong whit that but im mentioning anyways

red flower
#

the string should be "jokers/"

#

it will get all files in the folder automatically

harsh warren
#

oh ok

#

thanks

#

NO WAY

#

IT APPEARS

#

YESSSS

#

it looks so gooffy lol

rocky plaza
harsh warren
#

IT EVEN WORKS PERFECTLY

rocky plaza
#

that way the text will show up

harsh warren
#

o my bro

#

i spent 7 hours on just one

#

does it get better or worse at this point

#

lol

rocky plaza
#

you get used to what you need

#

also did text appear on ur joker?

harsh warren
#

Not yet i didnt puta anything on the description yet

#

But im happy, it ven works perfectly, no bugs no nothing

gusty iron
#

how would i make a global game variable that gets saved when the game is closed?

gusty iron
#

nvm figured it out

#

HAND DLC

gray void
#

Unlock hand by paying 2.99

narrow iron
#

what do mod_mult() and mod_chips() do?

topaz urchin
#

I'm using Malverk to make a resource pack, does anyone know how to change the undiscovered Joker sprite? Nothing I have done seems to work.

solid mesa
topaz urchin
#

Weird, but thank you for letting me know!

#

Also, I meant to also ask, can you change the intro screen Joker (the one that appears when you open the game)?

solid mesa
#

you can, mods like Cryptid does that, but idk how

wintry solar
icy igloo
#

anyone know how to get brainstorm mod working?

#

no mod i use seems to activate i have steammodded and lovely which are the only requirements for brain storm

#

and i have talismen for cryptid but that wont work either

#

And if I try to unzip any file blue screen on start up code handler

topaz urchin
stuck vault
#

how come it says "ERROR" in my booster pack?

red flower
#

group name should be a string not a table

#

and remove the group_key

red cradle
#

how to check a hand for only a pair, not for contain a pair?

red flower
#

context.scoring_name == "Pair"

wispy falcon
#

I just noticed it says priority under Mods. What is it for? The loading priority?

red flower
#

yes

molten harbor
#

hey folks, i've been thinking about making a sort of "bot" that can play balatro on its own, and maybe win a run? one can dream, but anyway
my first idea is to make it as a mod, but i have zero previous experience with writing mods for any game, let alone balatro, and i'm not entirely sure if smods provides the apis necessary for a mod to be able to play the game entirely on its own
would this be feasible with smods? or would i have to find some other way to programmatically play the game?
i do see there's some prior art for this here, but i haven't seen if that provides exactly what i want yet

wispy falcon
molten harbor
#

also it doesn't seem to have a license so i can't actually use it...

red flower
molten harbor
#

well i guess the fact that that project exists is enough to let me know a mod should work for this

red flower
#

Yeah I don't think smods provides any functionality that would help with this but lua is pretty flexible and you can basically control anything in the game so it shouldn't be that hard to accomplish

molten harbor
#

mhm ok

#

hopefully i like lua, haven't done much coding in it

#

ok actually i'll just start setting it up now, i'm a litte burnt out from my other projects

#

ok probably before that i need to do a deep dive into game theory :D

zenith scaffold
#

Hello! Me again :3

Added "Bunco" to my ever-growing mod-podge, and got this when launching before the loading error appeared. Could anyone provide me a fix or context so I can try to debug this?

red flower
zenith scaffold
harsh warren
#

how do i make my number look whit red colour

#

cause is not working

#

and i tried the +#1#

#

didnt work either

red flower
#

mult lowercase

harsh warren
#

alr

spring lantern
#

do editions need a calculate function? havent done one til now and it's not triggering anything

red flower
#

I think so

spring lantern
spring lantern
# red flower I think so

was going off the example editions mod in the smods examples repo so that might be out of date

#

guess i'll try it

#

think it works now thx

zenith scaffold
#

Any good documentation on how to make proper blinds/decks? Been trying to find some but come up empty handed.

red cradle
#

how can i get a selled card cost value?

cursive gazelle
#

Yes

#

Sell_cost i think

#

There’s also a context for selling cards

red cradle
#

yes

#

but

#

if context.selling_card then
local card_sell = card.sell_cost

cursive gazelle
#

Card references the joker not the card being sold

red cradle
#

yes

#

and what i need put there to get selled card cost value

#

not joker sell value

cursive gazelle
#

Context.other_card ?

red cradle
#

doesn't work

red flower
#

context.card

cursive gazelle
#

Is this a thing ?

red flower
cursive gazelle
#

Vanilla remade wiki is evolution?

red flower
#

usually other_card is for scoring and card is for non-scoring

red flower
cursive gazelle
#

I think i checked the wiki twice

red cradle
cursive gazelle
#

I get no recognition

#

N always stealing the lights

red cradle
spring lantern
#

tryna do an info card for my custom edition in a joker but it keeps crashing, tried with and without the mod prefix and it keeps happening - am i missing something?

long sun
#

is there a way to change the ability of an edition based on the card type it's on, or ban it from appearing on certain card types?

#

also, is there a way to change something when a Joker with that edition is taken, and when it's sold or destroyed or loses the edition?

#

this is for an edition that adds 1 consumable slot, but adds 1 discard if on a playing card instead

slim ferry
#

might be

#

Variables missing though

#

Since that way of adding tooltips doesnt use the default config values automatically

daring fern
long sun
#

cheers :D

long sun
burnt tide
#

can someone explain to me what's wrong ? (it's a smods shader)

long sun
delicate spear
long sun
#

what caused the crash?

daring fern
delicate spear
#

one of my jokers trying to score or multiply

long sun
#

can i see your code?

delicate spear
#

other jokers work just fine

#

sire

#

sure

delicate spear
long sun
#

which joker was it? can i just see its code?

delicate spear
#

its 'roullete' and 'mrbeast'

#

lines 42 and 84

long sun
#

issue found

#

you're returning a message, but the message isn't a string, it's a float

delicate spear
#

ah i understand it now

#

😭

long sun
#

replace:

return {
                chip_mod = card.ability.extra.chips,
                message = card.ability.extra.chips
            }```
with:
`return { chips = card.ability.extra.chips }`
delicate spear
#

ok yeah that makes sense

long sun
#

replace:

return {
                message = card.ability.extra.Xmult,
                Xmult_mod = card.ability.extra.Xmult
            }```
with:
`return { xmult = card.ability.extra.Xmult }`
delicate spear
#

alright lemme test

long sun
#

oh ya, question

delicate spear
#

can confirm it works 👍

#

thank you very much man 🙏

long sun
#

what's the name of the edition card area, in the collection?

long sun
daring fern
long sun
#

thanks :D

#

perfect :D

long sun
#

trying on_apply and on_remove

daring fern
#

So it would happen in the shop.

#

You would probably have to hook Card:add_to_deck and Card:remove_from_deck

burnt tide
red flower
#

remove the card.

long sun
#

you also forgot to change it in x_chips

burnt tide
long sun
azure laurel
#

why my atlas isnt working?

burnt tide
long sun
#

np

red flower
azure laurel
red flower
azure laurel
#

i thought that was already includeed in the code

wintry solar
#

Blind atlases must be animated

azure laurel
#

how i implement it?

ocean sinew
#

how to add custom badges using generate_card_ui

burnt tide
burnt tide
#

it's from Balatro's files

long sun
#

hiya! my conditions don't seem to be applying. can you see why?

daring fern
wintry solar
#

I am actually working on this right now

long sun
#

oh ^^;

#

okay then

candid elbow
#

How can i check if a card is being dragged around ?

#

^_^

red flower
#

card.states.drag.is iirc

candid elbow
#

Is this a boolean ?

red flower
#

yes

candid elbow
#

In calculate ?

red flower
#

in calculate it wont work because it's not a context

candid elbow
#

How can i make it work then

#

Call a function

#

?

red flower
#

what are you trying to do

#

you probably need to hook something

candid elbow
#

Make the joker play sound when dragged

red flower
#

i think you need to hook Moveable:drag()

candid elbow
#

How so

#

Is there documentation or something

#

Sorry N i’m not good at coding 😭

#

Sob

red flower
long sun
candid elbow
#

Thanks 🥺

candid elbow
long sun
#

ignore the missing slot there

#

i'm gonna wait for the update because this is really jank

long sun
burnt tide
primal robin
#

Yay salty ghost now have gool old avatar

royal comet
#

any sites/reps which just have the info like all values you can change in card.children.center or card or get from G. ?

#

because i modify card scale, but it's pivot is at top left
so i need to change it's position too
but i don't know how this position is actually called in code

red flower
#

not really there's no much vanilla documentation

#

for card.children.center i would look at sprite.lua

royal comet
#

apparently the position is VT

red flower
#

center.T.x and center.T.y probably works too

royal comet
red flower
#

weird

long sun
#

i'd like to use the draw function of my edition to change the shader it uses, depending on the card it's being drawn on. is there a better way? what code do i add to it?

foggy ginkgo
#

That's wild

#

I really need to know all the codes

sturdy compass
#

It’s niche but yeah it does exist

foggy ginkgo
#

Man

#

How are you doing btw Astra

#

Forgot to ask

royal comet
foggy ginkgo
#

Wobble

fickle vale
#

does anyone know what's wrong with this? I'm trying to make a deck that starts with the astronomer joker

sturdy compass
long sun
#

why are you using the vremade joker?

frosty rampart
#

^ the key should just be j_astronomer i think

long sun
#

^^^^^^

fickle vale
#

okay i'll try that

red flower
#

i should remove all the vremade prefixes in other files

foggy ginkgo
sturdy compass
fickle vale
#

it worked! thanks @long sun @frosty rampart

long sun
#

npnpnp!

wintry solar
#

people could just copy and paste that I think

red flower
#

oh that's a good idea
but i was more referring to decks using vremade jokers instead of vanilla ones or tarots using vremade enhancements etc

mental yoke
red flower
mental yoke
#

oh mb wrong one

wintry solar
mental yoke
#

okay ty

mental yoke
foggy ginkgo
#

How do I make it so where they can buy a card no matter the cost

#

Like you have 5 bucks but the item is 10

candid elbow
#

Make them go in debt but add the debt back

#

🤓

foggy ginkgo
#

😭

candid elbow
#

I’m so smart

daring fern
foggy ginkgo
#

Thank you

#

Hooks...

spring lantern
#

what the hell does this mean 😭

unborn smelt
#

why does this:

    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'tjr_rex_extinct' .. G.GAME.round_resets.ante)
        return { vars = { card.ability.extra.chips_bonus, card.ability.extra.mult_bonus, numerator, denominator } }
    end

crash the game when hovering the card in a round, but not in the modlist/collection? my other jokers with odds dont have this problem

unless im blind

red flower
#

what's the crash

unborn smelt
#

nvm, it was another joker that crashed the game when hovering this one for some reason

red flower
#

hovering calls the new probability context so it makes sense

foggy ginkgo
#

Eto bleh

daring fern
foggy ginkgo
#

Right

#

I remember seeing this before

#

I'll figure it out

unborn smelt
#

but i have no idea why it did not crash in the collection

wintry solar
#

This sounds like a quantum enhancements crash

mighty ember
#

Hello, can someone help me please ? I'm trying to install the cryptid mod

wintry solar
#

Can I ask what instructions/install method you followed?

mighty ember
#

Cryptid mod's ones

wintry solar
#

Can you link them?

mighty ember
mighty ember
#

Thanks !

knotty orchid
#

Has anyone experienced memory leak issues while developing their mod?

#

I think I know where the problem is but I have no clue on how to actually fix it

glad osprey
#

is there like a globally agreed upon way to specify that a joker is a food joker

glad osprey
#

i mean internally 😭

frosty rampart
#

at least somewhat, yes. here's what paperback does:

if not SMODS.ObjectTypes.Food then
  SMODS.ObjectType {
    key = 'Food',
    default = 'j_egg',
    cards = copy_table(PB_UTIL.vanilla_food),
  }
end

this checks if the "Food" ObjectType already exists, and if it doesn't, it creates it and adds all the vanilla food jokers to it (PB_UTIL.vanilla_food is a table defined elsewhere that contains the keys for all the vanilla food jokers).
then, you just add this to any custom jokers you want to count as a food joker: pools = { Food = true },

#

it's highly recommended to do the check because cryptid doesn't do the check lmao, so it'll collide if you also don't do the check

glad osprey
#

does the table look like "key" or key = true

frosty rampart
#

the vanilla_food table? key = true

glad osprey
#

ty

#

🙏

frosty rampart
#

also don't forget that seltzer's key is j_selzer

glad osprey
#

local thunk™

wispy falcon
#

Why do I get this error after opening the tab I made in the menu of my mod?

glad osprey
#

somewhere you have a variable named node as a number when it should be a table

#

i think

quick scarab
#

breaking my head here, I'm trying to make a joker to modify the propriety of a ench card, which has a property to "debuff" after a certain amount of uses, I don't know if I have to make a newer funtion to work it out

#
SMODS.Joker {
    key = "chica",
    atlas = 'Joker',
    pos = { x = 5, y = 8 },
    soul_pos = { x = 5, y = 9 },

    blueprint_compat = false,
    rarity = 4,
    cost = 20,
    config = { extra = { hands_left = 10 } },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = { key = "fnaf_WIP", set = "Other" }
        info_queue[#info_queue + 1] = { key = "fnaf_sprite_WIP", set = "Other" }
        return { vars = { card.ability.extra.hands_left } }
    end,    
}```
#
SMODS.Enhancement {
    key = 'pizza',
    atlas = 'Enhancers',
    pos = { x = 0, y = 0 },
    config = { bonus = 200, extra = {hands_left = 5}},
    replace_base_card = true,
    no_rank = true,
    no_suit = true,
    always_scores = true,
    shatters = true,
    loc_vars = function(self, info_queue, card)
        local chica_check = false
        if SMODS.find_card('j_fnaf_chica') and chica_check == false then
            card.ability.extra.hands_left = 15
            chica_check = true
        end
        info_queue[#info_queue + 1] = {key = "fnaf_sprite_WIP", set = "Other"}
        return { vars = { card.ability.bonus, card.ability.extra.hands_left} }
    end,
    calculate = function(self, card, context)

        if context.main_scoring and context.cardarea == G.play then
            if card.ability.extra.hands_left > 0 then
                card.ability.extra.hands_left = card.ability.extra.hands_left - 1
                if card.ability.extra.hands_left == 0 then
                    card.ability.bonus = 0
                    return { message = 'Expired', colour = G.C.FILTER }
                end
            end
        end
    end,
}```
wispy falcon
real night
#

hey, does anyone know why my game didn't crash

#

:bucky:

wispy falcon
#

Thank you :3

keen atlas
#

it still doesnt count as doc though lol, imo

wispy falcon
rotund sable
#

We love the UI 👀

mystic river
#

yeah ui construction is terrifying lol

harsh warren
#

how do i make a joker change of slot when blind is selected?

#

and also not making it able to move

quick scarab
harsh warren
quick scarab
daring fern
# quick scarab bro, don't worry about it, thanks for the help anyways
SMODS.Enhancement {
    key = 'pizza',
    atlas = 'Enhancers',
    pos = { x = 0, y = 0 },
    config = { bonus = 200, extra = {hands_left = 5}},
    replace_base_card = true,
    no_rank = true,
    no_suit = true,
    always_scores = true,
    shatters = true,
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = {key = "fnaf_sprite_WIP", set = "Other"}
        return { vars = { card.ability.bonus, card.ability.extra.hands_left} }
    end,
    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            if card.ability.extra.hands_left > 0 then
                card.ability.extra.hands_left = card.ability.extra.hands_left - 1
            elseif card.ability.extra.hands_left <= 0 then
                SMODS.debuff_card(card, true, 'source')
                return { message = 'Expired' }
            end
        end
    end,
    set_ability = function(self, card, initial, delay_sprites)
        if next(SMODS.find_card('j_fnaf_chica')) then
            card.ability.extra.hands_left = 15
        end
    end
}
quick scarab
spare atlas
royal ridge
#

are back objects ever removed in the vanilla game?

ocean sinew
#

wym

wispy falcon
#

How do I change the font size on a button?
-# pls tell me it's simple...

worthy stirrup
wispy falcon
#

Nvm, found it :D

worthy stirrup
royal ridge
ocean sinew
#

they are not removed in the vanilla game

hallow slate
#

Best way to check if a mod's loaded?

red flower
#

next(SMODS.find_mod("modid"))

hallow slate
#

Thx!

red flower
#

to make it change slot just reorder G.jokers.cards

ocean sinew
red flower
#

to pin it idk, look at what the pinned sticker does

harsh warren
stiff locust
#

chat how do i change the required blind score

#

i remember you have to do an extra line to change it visually as well as changing the actual value internally

red flower
rapid stag
#

is there a way i can change the card destruction sound? like say, during context.destroy_card i return a sound argument and that changes the card destroy sound

stiff locust
#

you could just play a louder sound when a card is destroyed

#

and drown out the quieter sound

#

hook remove_from_deck and use play_sound() to play an smods sound

#

:)

#

there might be a way to change the internal sound with like malverk or smthn

knotty orchid
#

What is the way to move a joker to another area?

#

If I've created a new one

red flower
red flower
rapid stag
red flower
#

it allows colour and time but not silent

#

or sound

knotty orchid
#

now works

#

But my problem persists, it seems that my new area, for some reason, has a memory leak when moving the jokers

harsh warren
#

N'

#

you helped me whit a lot of things

#

can you hepl me whit something

red flower
#

no

harsh warren
#

(again lol)

harsh warren
#

im trying to make a joker that moves in to another joker slot when the blind is selected

#

but idk how

#

lol

stiff locust
#

that would let you manipulate the positions of jokers without any table shenanigans

harsh warren
#

how do i do that?

stiff locust
#

¯_(ツ)_/¯

wintry swallow
#

https://docs.google.com/spreadsheets/d/16DAXw2VjLc3ApcH0mp90yCuJ6QC-44GDk60xKWzVOKI/edit?gid=692733071#gid=692733071 I'm still working on it. If this is the wrong channel to post it in, then I'll move. And before you ask, yes, I am aware that someone has already made a Balatro calculator. This one is being made to calculate both vanilla Balatro and modded Balatro. Right now, I need a spreadsheet formula that can show the possible combinations of cards so it can then calculate what the highest scoring hand is.

solid mesa
#

yk you need to add like +50k things right?

wintry swallow
#

Yes.

solid mesa
harsh warren
#

mininlla

spice wadi
#
{
                                n = G.UIT.R,
                                config = { align = "cm", padding = 0.2 },
                                nodes = {
                                    showingList and SMODS.GUI.createOptionSelector({label = "", scale = 0.8, options = pageOptions, opt_callback = 'update_mod_list', no_pips = true, current_option = currentPage}) or nil,
                                    UIBox_button({
                                        minw = 3,
                                        button = "enable_all_mods",
                                        label = {"Enable All Mods"},
                                        colour = G.C.GREEN,
                                        scale = 0.6
                                    })}
                            },

forgive me for my potential stupidity but why dont these appear on the same row?
everything ive tried thus far has the same result and im feeling braindead

hushed field
#

Is there a built-in way to have any calculations that do run when an object is debuffed? 🤔

red flower
red flower
spice wadi
hushed field
#

Yeah, I guess that's the way to go, haha. I wonder what the best approach is. To just add a new context that runs once on debuffed objects, or give counters their own debuff_check function or something

spice wadi
#

im very lazy and tired 😭

spice wadi
#

sigh

#

alright thanks

cursive gazelle
#

Ui stuff

stiff locust
#

how to get the current hand size

cursive gazelle
#

It’s in G.hand.config i believe

stiff locust
#

G.hand.config.card_limit?

#

like joker?

cursive gazelle
#

Mhm

red flower
cursive gazelle
#

Hey N

red flower
#

hi

hushed field
#

I think I might just see if I can add a new context that runs when cards are debuffed, and just pass the normal context's along in a sub table 🤔

spice wadi
#
{
                                n = G.UIT.R,
                                config = { align = "cm", padding = 0.2 },
                                nodes = {col({
                                    row({showingList and SMODS.GUI.createOptionSelector({label = "", scale = 0.8, options = pageOptions, opt_callback = 'update_mod_list', no_pips = true, current_option = currentPage}) or nil}),
                                    row({UIBox_button({
                                        minw = 3,
                                        button = "enable_all_mods",
                                        label = {"Enable All Mods"},
                                        colour = G.C.GREEN,
                                        scale = 0.6
                                    })
                                })
                                })
                                }
                            }

dont think it's any different?
do i need to swap anything around (the helper functions just return the node wrapped in a column or row respectively)

red flower
#

im stupid

#

it was the other way around lol

#

columns inside a row

spice wadi
#

that makes sense

cursive gazelle
#

It’s just like Html 😭

spice wadi
#

i promise im more self sufficient than this 😭

cursive gazelle
#

Lmao

cursive gazelle
spice wadi
#

this looks a bit jank but hell yeah

cursive gazelle
#

I hope my code isn’t all over the place

spice wadi
#

all code written by someone else is hard to understand haha

#

i think im getting it

red flower
#

my ui coding is going bad

spice wadi
#

🤝

#

this is the only thing ive done today

#

moving someone else's button

cursive gazelle
#

You got it

harsh warren
red flower
#

im trying to add a cardarea to a ui without destroying it when it disappears

cursive gazelle
#

Development resumes tomorrow

spice wadi
#

sisyphus

red flower
cursive gazelle
#

Playbook

#

Has a joker like this

red flower
#

oh i never played playbook

cursive gazelle
#

Basically it’s a joker with a card area that appears when you highlight it and disappears when you don’t

#

And it counts in scoring

#

If that’s what you’re looking for

red flower
#

yeah but it needs to specifically be the same cardarea every time, not a copy of it

#

i have a couple like that but they are copies when they display

cursive gazelle
#

You’ll have to read the code and see

#

Can’t you offset the cardarea position ?

spice wadi
stiff locust
#

wait what

cursive gazelle
#

Lmao

spice wadi
red flower
red flower
#

thats the first thing i tried tho

cursive gazelle
#

Draw it under the background

#

?

red flower
#

same problem

sharp geyser
#

hello! I'm new to balatro modding, and I'm trying to get started with a fairly complicated, though still simple joker that detects if you have 4 or more hands, and gives you a 3x mult. Can anyone tell me how I can do this?

red flower
#

i want to specifically draw it inside the ui nodes so i dont have to worry about aligning it

frosty rampart
sharp geyser
#

alright thanks

spice wadi
#

new question, how should these be aligned? having a hard time getting vertical center alignment, wondering if its necessary

cursive gazelle
#

Add some padding

#

It’s just annoying to align different ui elements together

#

I would just move the page to another row

#

Down

#

And call it a day

spice wadi
#

the menu is too tall as it is

#

it feels wrong having too many rows for this anyway

cursive gazelle
#

That’s why an extra tab hurt nobody

#

Lol

spice wadi
#

im not going to just "call it a day" on smth like this anyway

cursive gazelle
#

Aikoyori’s fault

spice wadi
#

everything in less places works better

#

maybe im a perfectionist

hushed field
cursive gazelle
hushed field
#

The prefab buttons and tabs are very handy, but they definitely make it annoying to match things, as you don't get to see how they've been set up

cursive gazelle
#

You can definitely accidentally click enable all when trying to set flip between pages

spice wadi
cursive gazelle
spice wadi
#

thank you

#

i might space out the buttons a lot anyway

cursive gazelle
#

I would’ve wanted to assist but i’m on phone

#

Also should probably put it to charge i’m on 3%

spice wadi
#

definitely 😭

fluid nebula
#

i think i'll do the base joker mechanics and then try and do the codependency of them

#

so i program their basic function and scaling, test it out, then make them try to buff each other

spice wadi
#

ts frying me, why does putting offset on the cycle do absolutely nothing 😭

#

im going to bed after this because my brain isnt working

stiff locust
#

is there a way i could make a card play a sound when you hover over it

#

i know how to play sounds

#

but i don't know how i would detect hovering

red flower
brittle yacht
#

how do i put a custom gradient into the {C:color}

red flower
#

if you made it with smods gradients just do {C:modprefix_key}

brittle yacht
#

ight

#

thanks

red flower
#

hi sleepy

primal robin
#

How to call custom context?

fluid nebula
#

y'all know how i can make a joker choose a selected rank of card, store it as a variable, and change it every round? i'm lost

red flower
primal robin
#

ok

stiff locust
#

is there an easy way to make the background move faster

fluid nebula
#

i see. thank you

#

i don't know why i didn't consider mimicing VRemade mail-in rebate

#

it's not like making a unique variable separate from mail-in rebate would be a challenge. it would just need a different name.

wispy falcon
#

Why does the text push the button up like this?

                                n = G.UIT.R, config = {
                                    align = "cm",
                                    colour = G.C.BLACK,
                                    padding = 0.1,
                                    h = 1,
                                    w = width / 2,
                                },
                                nodes = {
                                    {
                                        n = G.UIT.T, config = {
                                            text = "CONSUMABLES",
                                            colour = G.C.RED,
                                            scale = 0.5,
                                            vert = true
                                        },
                                    },
                                    UIBox_button({
                                        colour = G.C.CSTORM.CON_BUTTON,
                                        minw = 3,
                                        minh = 3,
                                        button = "cstorm_consumables",
                                        label = { localize('k_cstorm_consumables') }
                                    }),
                                }
                            },```
stiff locust
#

that's funny as hell

wispy falcon
#

Sorry for the extreme code wall😅

frosty rampart
wispy falcon
stiff locust
#

can you animate the soul_pos like you can the regular pos of a card

glass blade
#

I don't have a PC lol

long sun
#

hiya! why is this evaluate function for my hand only scoring the 2, and not the 7, 6, 3?

rotund sable
#

Are you sure about what the SMODS.merge_lists returns

jolly shadow
frosty rampart
#

(so i.e. replace SMODS.merge_lists{...} with SMODS.merge_lists(...), with parentheses instead of braces)

olive wren
#

I'm intrested in making a mod and am very lost as to how I start off, I have a general idea as to how the mods work after looking at some example mods, but don't know how to implement it file wise, can somebody help please

long sun
#

it doesn't show that the hand is selected

frosty rampart
#

no yea never mind i read the description for merge_lists more closely

wintry solar
long sun
#

it works as it should

#

it has the expected cards in it

#

(weirdly, one of them says its rank is 4)