#💻・modding-dev

1 messages · Page 189 of 1

shadow rapids
#

(this log is after fixing the card = context.other_card)

dreamy thunder
#

dont you need to check for each card?

stiff locust
#
calculate = function(self,card,context)
if context.individual and context.cardarea == G.play then
  if context.other_card.ability.name == "Mult Card" then
  stg.mult = stg.mult + increase (whatever your increase by value is, it goes here)
  elseif context.other_card.ability.name == "Bonus Card" then
    stg.chips = stg.chips + increase (whatever your increase by value is, it goes here)
  end
end
if context.joker_main then
  return {
  chip_mod = stg.chips,
  mult_mod = stg.mult
  }
end

do that

shadow rapids
#

? doesnt that happen utomatically

dreamy thunder
#

i think you need context.individual

shadow rapids
#
    calculate = function(self, card, context)
        local stg = card.ability.extra
        if context.joker_main then
            return {
                chips = stg.chips,
                mult = stg.mult,
                card = card
            }
        end
        if context.cardarea == G.play then
            if SMODS.has_enhancement(context.other_card, 'm_bonus') then
                stg.chips = stg.chips + stg.dchips
                return {
                    message = 'Bonus!',
                    colour = G.C.CHIPS,
                    card = card
                }
            end
            if SMODS.has_enhancement(context.other_card, 'm_mult') then
                stg.mult = stg.mult + stg.dmult
                return {
                    message = 'Mult!',
                    colour = G.C.MULT,
                    card = card
                }
    end end end```
shadow rapids
#

does that context loop the cards played?

sturdy compass
#

yes

#

kinda

stiff locust
#

context.individual and context.cardarea == G.play goes through every scored card

#

and context.other_card is the current card being scored in these contexts

shadow rapids
#

ah ok

stiff locust
#

idk what your increase by value is, make sure you fill that in

shadow rapids
#

i use :has_enhancement as well, does that change anything

stiff locust
#

idk how that works, i just check by ability name

sturdy compass
stiff locust
#

there's a bunch of ways to do it, whatever way works for you

stiff locust
#

if it doesn't, then remove _mod from chip_mod and mult_mod in the return

#

sometimes it is and sometimes it isn't needed and I don't know why

sturdy compass
#

Genuine question, have you taken a look at the Calculate Functions page on the SMODS wiki?

#

If not I would heavily recommend it

stiff locust
#

better yet

#

look at the example mods

#

for smods

dreamy thunder
wintry solar
stiff locust
#

oh

shadow rapids
minor gyro
#

Hello guys

#

It's been a month

wintry solar
#

You can use it if you want a custom message though I prefer an alternative way of doing a custom message

minor gyro
#

I was on a cruize but I'm back

#

❤️

shadow rapids
stiff locust
#

sock and buskin is in there

#

that is very similar

shadow rapids
#

good point

stiff locust
#

just swap context.repetition for context.individual

hushed field
sturdy compass
#

Usually your best bet when looking at vanilla code is to ctrl + f the name of a card that does something similar

hushed field
#

I'm trying to find where the game sets the best hand for the current run. Is that just done in the save function?

stiff locust
hushed field
#

oh, nvm, there's a function that's called check and set high score, should've used my eyes better

stiff locust
#

you can add other folders alongside it too

#

remember that balatro is open source modding

#

if you see something that does what you wanna do, go see how they do it

wintry solar
#

It’s arguably more useful to search through your lovey dumps

sturdy compass
#

Lmao same mindset

stiff locust
#

.

#

i never really thought about that

#

but i'm going to keep doing it with the exe dump

#

because i'm used to it

sturdy compass
#

have fun debugging patches clueful

stiff locust
#

i don't do patches

sturdy compass
#

brave

gaunt thistle
#

--dump-all gives you the entire game and love2d source 😈

stiff locust
#

my mod has two patches and i dont need any more

gaunt thistle
#

even buffers that haven't been patched

dreamy thunder
#

i dont even know how to patch

wintry solar
#

What smods version are you on Marie?

stiff locust
#

-# technically it's 3, but the third one adds an end for the second one

stiff locust
hushed field
#

checking the exe isntead of the dump is a great way to accidentally try and inject in code that's patched out by SMODS, I found

wintry solar
#

I have almost certainly broken your patches 🙃

stiff locust
#

i doubt it

#

unless you touched the splash logic

wintry solar
#

Like I said

#

I have almost certainly broken them

sturdy compass
#

lmfao

hushed field
neat plover
#

okay people

dreamy thunder
#

so what are patches used for? someone enlighten me

neat plover
#

im actually installing vscode now

stiff locust
#

guess i'll go update grr

stiff locust
opal spade
#

marie you should update smods so you can turn better calc into wetter calc

neat plover
#

im tired of nil value i got me in my sleep

shadow rapids
#

fun fact i know where it is erroring

neat plover
wintry solar
#

It actually made splash logic a lot cleaner to modify I just haven’t documented it yet 🙃

sturdy compass
#

Imma be so real
all of this commotion made me forget I was dealing with stuff before we were so kindly enlightened

stiff locust
#

hah

#

suck it

#

my patch still works on latest smods

#

i downloaded the main branch with the green code button and it still works

#

i am gonna go test my other patch too to see if that works

dreamy thunder
#

i wonder when will i need to update my lazy talisman compat

grim remnant
#

Any clue why this is still paying out with nothing? The card text is perfectly fine, so like, we know the for loop itself is set up right.

sturdy compass
#

I wonder when I can figure out the source of this damn crash 😭

stiff locust
#

where's that damn fourth crash emerald

wintry solar
grim remnant
sturdy compass
#

Lmao

#

You'd think so

wintry solar
#

Pls show patch

dreamy thunder
stiff locust
#
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "for i=1, #G.play.cards do"
position = "after"
payload = """
        for k, v in ipairs(Splashkeytable) do
            if next(SMODS.find_card(v)) then
                scoring_hand[i] = G.play.cards[i]
                break
            end
        end
"""
match_indent = true
#

i put all my jokers with splash effect in splashkeytable

#

and it checks if you have them, and if you do, every played card is scored

wintry solar
#

Is that pattern actually unique?

stiff locust
#

i'm pretty sure it is

wintry solar
#

That is incredible

stiff locust
#

indeed it is

sturdy compass
dreamy thunder
#

yup i dont understand shit

sturdy compass
#

exactly lmao

wintry solar
#

Easy solution, don’t work around talisman

stiff locust
#

main.lua:1781: main.lua:1567: bad argument #1 to 'floor' (number expected, got boolean)
Stack Traceback

sturdy compass
stiff locust
#

i found a different crash when testing my second patch

red flower
shadow rapids
stiff locust
#

both contexts

#

not just one

wintry solar
shadow rapids
#
    calculate = function(self, card, context)
        local stg = card.ability.extra
        if context.joker_main then
            return {
                chips = stg.chips,
                mult = stg.mult,
                card = card
            }
        end
        if context.cardarea == G.play and context.individual then
            if SMODS.has_enhancement(context.other_card, 'm_bonus') then
                stg.chips = stg.chips + stg.dchips
                return {
                    message = 'Bonus!',
                    colour = G.C.CHIPS,
                    card = card
                }
            end
            if SMODS.has_enhancement(context.other_card, 'm_mult') then
                stg.mult = stg.mult + stg.dmult
                return {
                    message = 'Mult!',
                    colour = G.C.MULT,
                    card = card
                }
    end end end```
wintry solar
#

That’s not a screenshot

stiff locust
#

both my patches work

shadow rapids
wintry solar
#

And what’s the crash?

grim remnant
shadow rapids
normal crest
grim remnant
#

oh! have to re-clarify the local variable, got it. ;P

wintry solar
shadow rapids
#

whats the log function

#

is it just print

stiff locust
#

if you're using debugplus there's send_debug_message and also print

#

and balatro has a helper function built in for printing tables
print(tprint(table))

shadow rapids
#

oh it works now

#

... i must not have saved changes smh

stiff locust
#

happens

shadow rapids
#

whats the context for discard effects?

#

i should probably go to definition for context

#

thats not easy

#

anyone have a context list

dreamy thunder
#

there is one at the wiki

shadow rapids
#

lmao im failing

#

#5xb core

#

-# #roblox upgrade tree references be like

#

should i use pre discard or on discard to retrigger discard effects

#

probably discard

neat plover
#

anyone got some qol extensions for vscode?

#

for lua coding

stiff locust
#

the lua extension

#

you dont need anything else

neat plover
#

OK

shadow rapids
neat plover
#

I GET WHY EVERYONE WAS TELLING TO GET VSCODE

#

NO MORE NIL VALUES!!!!1!!1111 yipeeee

minor furnace
#

holy crap it works

shadow rapids
#

well done

minor furnace
#

My goofy ahh cards are scoring properly

shadow rapids
#

yippee

minor furnace
#

nevermind I lied, they do not currently work in straights. But everything else seems correct

shadow rapids
#

lmao f

#

wait there was a value i remember seeing

#

that made aces work in straights

minor furnace
#

Full house works

red flower
minor furnace
#

I'll need to see if I can find a way to fix it

red flower
minor furnace
#

because this is registering as a pair

shadow rapids
#

oh thats what that card does

#

its every rank isnt it

minor furnace
#

it's literally just straights it seems

shadow rapids
#

that sucks

#

i have no idea

minor furnace
#

I'll have to see how it checks for straights

edgy reef
shadow rapids
#

🇫

minor furnace
#

I don't actually touch the hand evaluation function at all

edgy reef
#

And committing just a version that works for everything else but straights is an incomplete feature.

red flower
#

remove straights from the game

minor furnace
#

no more straights, only gays

#

we love to see it 🙏

shadow rapids
#

and aces dont forget aces

minor furnace
#

I'm pretty sure there's a mod that renames them

#

trueeee!

shadow rapids
#

🖤 🩶 🤍 💜

minor furnace
#

If I can fix this one issue though, the feature will be complete

wintry solar
#

you say that as if it's a simple issue to solve 🤣

minor furnace
#

slight lie. I need to patch all the rank-based joker functions but that should be as simple as adding a check if card has this enhancement

wintry solar
#

it's the main reason this feature isn't in smods yet

minor furnace
wintry solar
#

yeah you've done the easy bit

broken cliff
edgy reef
#

Unfortunately the most I’ve done related to calculating if a hand is a straight is via math equations, not any actual algorithm (which is required here).

broken cliff
#

god forbid

minor furnace
#

perhaps I was a little too optimistic

shadow rapids
#

is it possible to get the current score parts

#

i want to make a joker that increases mult based on chips

neat plover
frosty dock
#

I've had some ideas about how I could try to iterate on my last proposal that doesn't work with quantum ranks and state it as a bipartite matching problem

shadow rapids
neat plover
#

yes

shadow rapids
#

cool

#

anyway is it possible

frosty dock
#

I'm having an oral exam on graph theory in like 6 weeks time, so maybe this is good practice. that particular course doesn't give a whole lot of fucks about algorithms though so meh

neat plover
shadow rapids
#

that happens after all scoring right

#

im pretty sure

neat plover
#

oh

#

im dense

shadow rapids
#

anyway

#

is there a way to do so?

neat plover
#

sorry

neat plover
frosty dock
#

yeah

shadow rapids
#

darned

frosty dock
#

you can access the current mult and chips as globals

#

mult and hand_chips respectively

minor furnace
#

I'm wondering if my straight problem might be a consequence of any changes smods makes to get_straight()

wintry solar
#

it's not

#

it's just not a simple problem

frosty dock
#

current get_straight in smods also has its issues btw, it just doesn't show with standard ranks

edgy reef
#

I assume that’s addressed by the get_straight PR?

frosty dock
#

yeah

#

it performs a lot worse with shortcut though

minor furnace
#

the other thing that happened is I'm suffering the consequences of making this a O(13^n) algorithm... because it stutters when I select four of them in the same hand

#

I think I'm gonna need something better than this naive approach

edgy reef
#

There’s a bunch of examples in the issue you can look at.

minor furnace
#

I'll take a look

red flower
#

speaking of that the summoning algorithm for my mod is not the best performant so I need to sit down and think about it someday

#

I feel like I would disappoint my uni professors

minor furnace
#

actually it's even simpler. Because they will all take the same value, all I need to know is if there are 4 or 5 cards in the played hand, and if it is a flush

vestal ore
#

bom bom bom, badum badum
jimbo walked up to the lemonade stand
and he said to the man, running the stand
"hey!" bom bom bom

dense vector
#

Holy aces

zealous glen
#

duck

shadow rapids
#

problem with modding is artwork

#

(and also getting the code to work to an extet)

tropic elk
#
                card.ability.extra.x_mult = card.ability.extra.x_mult + card.ability.extra.x_mult_gain
            
                return {
                    message = localize{type='variable',key='a_xmult',vars={card.ability.extra.x_mult}}
                }
        end```
I've got a joker that scales off of Eris and the scaling works, but I can't figure out how to make it trigger a message when the mult increases. anybody know why it's not working?
foggy carbon
#

can I use #SMODS.find_card('key') > 0 as a means of just checking if the player has a joker without needing to know where it is or anything about it?

normal crest
#

yes

hushed field
#

When the card fronts are put on the base card or enhancement art, is there a way to mask parts of them? To make them match transparency of the card base, if relevant? Without me writing a function to include sprite masks, I guess

frosty dock
stiff locust
#

how do you hook a function that runs attached to stuff

#

like Back:apply_to_run() i can't get it to hook the way I hook any other function

frosty dock
#

wdym

stiff locust
#

it just doesn't work

#

i don't know what to say

frosty dock
#

how you hook a function doesn't depend on how it runs

stiff locust
#

it doesn't make sense to me

faint plank
stiff locust
#

it doesn't recognise that the function i wanna hook is a function if I do it the normal way

hardy viper
#

and you can treat it as such

stiff locust
#

sugar?

hardy viper
#
local old = Card.get_id
function Card:get_id()
 return old(self)
end
stiff locust
#

iii see

hardy viper
rose dragon
faint plank
#

its literally the inversion of blackboard

stiff locust
#

jojokers has that but for the played hand instead of held in hand

faint plank
#

ah

stiff locust
#

familiar

#

i think?

hushed field
#

I suspect that every suit or rank specific joker has every modded counterpart

shadow rapids
#

ive just had a cool idea for ajoker

wintry solar
#

that sprite is almost exactly the same as the ortalab one too 🤣

shadow rapids
#

negative +mult and *mult

stiff locust
#

negative +mult is -mult

faint plank
hushed field
#

Negative Xmult is an instant loss, basically. Though I guess Blueprint'd solve that

stiff locust
#

you can put the joker leftmost and offset it with +mult xmult

#

negative xmult is only super detrimental if your xmult comes from playing cards

hushed field
#

-2 X 3 is still a negative number, just as 3 X -2 is

stiff locust
#

and you're right back where you were

hushed field
#

Good point, hahaha

#

Goes to show why I am I linguist and not a number guy, I guess

shadow rapids
#

It's kinda like a risk reward

#

-25 might be a bit much

stiff locust
#

nah i'd keep it as -25

shadow rapids
#

Also what's the normal (not default) cost of each rarity

#

sans legendary ofc

stiff locust
#

sans?

limpid halo
shadow rapids
stiff locust
#

go check

shadow rapids
#

Is there any way to check in-game or will I have to code surf

stiff locust
#

code surfing is faster anyway

sonic cedar
#

not for me,,,, for the people,,,, for the world ✨

shadow rapids
#

I have had another interesting joker idea

#

Should I have sent that here? Probably not this isn't hashtag general

vestal ore
minor furnace
#

wrong number of arguments to insert?
table.insert{ace_high, hand[i].base.id}

red flower
#

() not {}

minor furnace
#

I genuinely don't know how I managed to do that

#

it's the only insert statement I did that for too...

stiff locust
#

how do I get the type of booster pack in context.open_booster

high stag
#

time for round 2 of bare-knuckle boxing a simple concept for a deck mikudab

red flower
edgy reef
stiff locust
#

ideally I wanna use the method that will encompass custom packs too

#

like dx tarots' deluxe packs

#

of the same type ofc

edgy reef
#

All vanilla packs are technically custom packs

stiff locust
#

.

#

balatro isn't real

#

i'll check the state

edgy reef
#

SMODS takes ownership of them to use SMODS.Booster methods so if it works for modded packs it will work for vanilla.

stiff locust
#

will the state check still work

#

assuming it's like if G.STATE == G.STATES.TAROT.PACK

edgy reef
#

Don't think so

stiff locust
#

damn

shadow rapids
#

can i add buttons to a joker description

#

is that a ting

stiff locust
#

you do not wanna do UI code

#

save yourself

shadow rapids
#

fair enough

zealous glen
shadow rapids
#

crud

edgy reef
zealous glen
#

Because the tooltip ceases to exist when you hover away

shadow rapids
#

:[

zealous glen
#

So if you tried to click on the button your mouse wouldn't be hovering over the Joker

hushed field
#

That's why you have a second mouse plugged in

zealous glen
#

You can add a button like a Sell or Use button

stiff locust
zealous glen
#

marie has two mouses for her two hands

hushed field
stiff locust
#

having two mice plugged in doesn't give you two mice on screen

zealous glen
#

not with that attitude

#

maybe you need to right-click them with cheese so they breed like in Minecraft

hushed field
#

You have to acquaint them first, they're skittish creatures. But they're social so if you keep them both plugged in and check on them every once in a while, it should be fine

stiff locust
shadow rapids
#

you wanna know what my idea was? something akin to the gambling machine in roblox not jjt upgrade tree, where you can select different risk-reward bets that will run when the joker is scored

red flower
#

it's TAROT_PACK

stiff locust
#

oh

#

i make that mistake a lot

#

woohoo it worked

#

now what's the value that says how many cards are in a booster pack

stiff locust
#

pack_size

#

i got it

high stag
#

so this is a deck I have

it's supposed to destroy one card from the played hand, then make 1 random card appear in your hand

it does this, but it leaves a ghost card behind, an empty slot that can be drawn as part of the deck into your hand, unselectable and taking up hand size

        local destroyed_cards = {}
        if context.after and context.destroy_card then
            return{
                remove = true,
            }
        elseif context.after then
            destroyed_cards[#destroyed_cards+1] = pseudorandom_element(context.full_hand, pseudoseed('random_destroy'))
               G.E_MANAGER:add_event(Event({
                   trigger = 'after',
                   delay = 0.1,
                   func = function() 
                    for i=#destroyed_cards, 1, -1 do
                           local card = destroyed_cards[i]
                        if SMODS.shatters(card) then
                               card:shatter()
                        else
                               card:start_dissolve(nil, i ~= #destroyed_cards)
                           end                            
                       end
                end 
            }))                
            
               G.E_MANAGER:add_event(Event({
                   trigger = 'after',
                delay = 0.7,
                   func = function() 
                       local cards = {}
                       for i=1, 1 do
                           cards[i] = true
                           local _suit, _rank = nil, nil
                               _rank = pseudorandom_element({'2', '3', '4', '5', '6', '7', '8', '9', 'T','J', 'Q', 'K','A'}, pseudoseed('incantation_create'))
                            _suit = pseudorandom_element({'S','H','D','C'}, pseudoseed('incantation_create'))
                           _suit = _suit or 'S'; _rank = _rank or 'A'
                           local cen_pool = {}
                        for k, v in pairs(G.P_CENTER_POOLS["Enhanced"]) do
                               if v.key ~= 'm_stone' then 
                                   cen_pool[#cen_pool+1] = v
                               end
                        end
                           create_playing_card({front = G.P_CARDS[_suit..'_'.._rank], center = pseudorandom_element(cen_pool, pseudoseed('spe_card'))}, G.hand, nil, i ~= 1, {G.C.SECONDARY_SET.Spectral})
                       end
                       playing_card_joker_effects(cards)
                   return true end 
            }))
        end
       end``` 

plz help I dont know whats wrong
stiff locust
#

the states method doesn't work for dx packs

zealous glen
#

the game/Steamodded can handle it for some timings

high stag
wintry solar
#

use the destroying context

high stag
#

context.destroying_card ?

wintry solar
#

yes

high stag
#

okay
so the only case of that I can find is Sixth Sense and I can find 0 hint as to how it actually destroys the card, that code just talks about creating the spectral

wintry solar
#

read the wiki

shadow rapids
#

Keep searching for it's effect label

humble girder
#

check for context.destroy_card == [card you want to destroy], return {remove = true}

high stag
#

so I want my code to use this?

            return{
                remove = true,
            }```

for the proper destroying part?
humble girder
#

not context.after

#

context.destroy_card is passed in the destroying phase (which is not before, after, individual, or any of the other things)

high stag
#

so then just

            return{
                remove = true,
            }```
limpid halo
#

is 10 jokers enough to publish a v1 Leafeon_hehe

wintry solar
#

no not the destroyed_cards[#...] bit

#

<@&1133519078540185692>

#

you need to flag the card you want to destroy in an earlier context and then look for it in destroying

livid scroll
#

🔫

humble girder
#

you seem to have a list of cards or something there i don't even get what you're doing with it

#

your code will destroy the last card in that list

#

(wherever it is)

#

but also based on your earlier code it's a local so it won't even contain anything by the time we get around to destroying cards

#

you'd have to persist it in card.ability or something

wintry solar
#

you probably want something like this

if context.before then
  local card_to_destroy = pseudorandom_element(context.full_hand, 'seedherepls')
  card_to_destroy.destroy_me_pls = true
end
if context.destroying_card and context.destroying_card.destroy_me_pls then
  return {remove = true}
end```
humble girder
#

^ although note that context.destroying_card only works for cards in play

wintry solar
#

which is fine in this case

humble girder
#

yeah just possibly confusing cause i told him destroy_card lol

wintry solar
#

it'll actually perform marginally better as it won't check all the cards in hand too

high stag
#

well positive, its not making a ghost card

negative, its suddenly saying hand.chips is a table value, so I get to start hunting for that problem

stiff locust
#

is context.end_of_round and context.blind_boss a valid way to check when a boss blind is defeated

minor furnace
#

So I wrote a new extremely straightforward function to detect a straight that I've tested and am pretty sure works

    local ace_high = {}
    local ace_low = {}
    local all_hands = {}
    length = next(SMODS.find_card('j_four_fingers')) and 4 or 5
    can_skip = next(SMODS.find_card('j_shortcut')) and 2 or 1
    if #hand >= length then
        for i=1, #hand, 1 do
            table.insert(ace_high, hand[i].base.id)
        end
        table.sort(ace_high)
        if ace_high[#ace_high] == 14 then
            for i=1, #hand, 1 do
                if hand[i].base.id == 14 then
                    table.insert(ace_low, 1)
                else
                    table.insert(ace_low, hand[i].base.id)
                end
            end
        end
        table.sort(ace_low)
        table.insert(all_hands, ace_high)
        if ace_low then table.insert(all_hands, ace_low) end
        for i=1, #all_hands, 1 do
            local strt_len = 1
            for j=1, #hand-1, 1 do
                if (all_hands[i][j] == all_hands[i][j+1] or all_hands[i][j+1] - all_hands[i][j] > can_skip) then
                    strt_len = math.max(1, strt_len)
                else
                    strt_len = strt_len + 1
                end
                if strt_len >= length then return true end
            end
        end
    end
    return false
end```
stiff locust
wintry solar
#

blind_boss isn't a flag in any context

#

you're looking for G.GAME.blind.boss iirc

stiff locust
#

oh

#

okay

wintry solar
#

woops wrong way around

humble girder
#

Rocket should have the same check if you look for it

stiff locust
#

any idea why G.GAME.win_ante = G.GAME.win_ante - 1 would be setting the win ante to -1 instead of reducing it by 1

faint plank
stiff locust
#

you dont need to enable anything?

#

you just use context.repetition instead of context.individual

wintry solar
#

he means retriggers

stiff locust
#

yeah that's

#

that's what context.repetition does isn't it

wintry solar
#

no

humble girder
#

not for jokers

stiff locust
#

what do you mean not for jokers

faint plank
#
    -- enable additional SMODS contexts that can be CPU intensive
    retrigger_joker = true,
}
humble girder
#

he's retriggering jokers, not playing cards

stiff locust
#

oh

minor furnace
stiff locust
#

that's not a straight with those cards though

humble girder
#

this is precisely why i wouldn't ever go near a card "having any rank"

zealous glen
#

what's alphabet soup ace

minor furnace
#

it counts as any rank

humble girder
#

i assume it's a wild card for rank

minor furnace
#

which with four fingers and shortcut, this is a straight

zealous glen
#

I mean, I don't think the base game was built to handle multi ranks

stiff locust
#

sounds like an enhancement issue over a balatro straight detecting issue

zealous glen
#

So yeah it wouldn't detect it

sturdy compass
#

Oh my goodness I figured out what was causing my crash 😭

zealous glen
#

The main discussion in the GitHub issues thread discussing multi ranks was Straight detection

#

where's a Straight-dar when you need one

humble girder
#

i'm certain balatro's hand detector considers that card as its base rank

minor furnace
sturdy compass
#

that took WAY too long

minor furnace
#

I'm going to try patching this function over the smods get_straight() and see what happens

minor furnace
wintry solar
#

it also isn't particularly relevant for the smods implementation of quantum ranks

stiff locust
humble girder
zealous glen
humble girder
#

but yeah that sounds like a smoking CPU if you play a hand of 5 wild ranks

#

just to get to the conclusion that it's probably a flush five

zealous glen
#

It's not like there's only one algorithm that's custom-hand-compatible

old bane
humble girder
minor furnace
wintry solar
#

it needs to evaluate properly though still

old bane
tropic elk
#

does anyone know why my blinds keep showing up as "ERROR"? I haven't actually coded their behavior yet so I'm not sure what's wrong with it

zealous glen
wintry solar
#

for effects that look for poker hands being contained

zealous glen
#

And to detect a Straight you just need to traverse a graph

zealous glen
#

I had suggested DFS

humble girder
wintry solar
#

if I play 5 wild rank cards, it should trigger every effect that is "poker hand contains X"

zealous glen
#

Still wrong AFAIK

stiff locust
#

if you play 5 wild rank cards it should go to five of a kind every time

zealous glen
#

Again each mod implementing a new hand would need to implement a way to detect that hand

humble girder
#

also balatro collects every single hand included in what you played in context, so you have some legwork to do there

tropic elk
stiff locust
tropic elk
#

oh i see

stiff locust
#

that's genuinely unwinnable a lot of the time

zealous glen
#

I don't know if it should trigger Full House and Two Pair

wintry solar
#

why not?

minor furnace
#

and also shouldn't contain a flush if it isn't one

zealous glen
frosty dock
#

imo it should because there's a valid combination of ranks that forms these hands

minor furnace
zealous glen
#

For proof, let the first card be a rank. The other cards are also that rank.

#

Therefore they're the same rank.

minor furnace
#

I think this is just up to personal choice of implementation at this point

frosty dock
#

counterargument, cards are considered one rank at a time

humble girder
zealous glen
humble girder
zealous glen
#

Then you're not talking to me

minor furnace
#

My thought on multirank cards is that while they can serve as any value card, they should only take one value when making a scoring hand

stiff locust
#

easiest and cleanest way to do it

zealous glen
stiff locust
#

that being said if you play 4 or 5, they should prioritise the highest hand, so playing 5 always results in 5 of a kind

humble girder
wintry solar
#

but equally, if you play 5 wild rank cards, they should trigger every joker that says "Do X when a Y is scored"

tropic elk
minor furnace
stiff locust
minor furnace
humble girder
#

balatro collects every hand that you played

#

in context

#

how would that interact with multirank

#

do you collect every possible resolution

stiff locust
#

like it is physically impossible

zealous glen
stiff locust
#

that is my issue with it

zealous glen
#

Just like a card can't be all and none suits simultaneously

wintry solar
#

so if they trigger every joker effect, then the poker hands table should have all the lower hands too

zealous glen
#

in SMODS

frosty dock
#

for reference i have not thought about a possible implementation of "same ranks"

wintry solar
#

and therefore a 5oak would also be like a full house

tropic elk
#

yea, that's why it can't appear for the first few antes, that way you won't tend to get it while your deck is unmodified

minor furnace
#

I was going to have it count with every rank-based joker, like sixth sense, cloud 9, baron, shoot the moon, etc. But those joker checks should be as simple as adding an or has multirank enhancement to their conditions

stiff locust
humble girder
zealous glen
frosty dock
#

3;3;3;(3,4);4 i would expect to both contain a 4oak and a full house, for example. i'm not sure how that plays into how these are checked with get_X_same

tropic elk
#

or other ways to do it through mods

humble girder
#

this argument boils down to whether or not cards lock in to a specific rank after the best possible hand has been determined

tropic elk
#

maybe it could be that non-editioned cards are debuffed but that would punish hands that have more than one and less than 5 editions

frosty dock
#

similarly a 3;3;3;(3,4);(3,4) is also both a full house and a 5oak depending on what the multirank cards are deemed to score as

wintry solar
#

they 100% shouldn't lock in

stiff locust
# tropic elk yea pretty much

so you're telling me i have to go out of my way to prepare in advance for 1 specific blind with items that are only available in large content mods, the lack of which makes the blind unwinnable and extremely unfair and still luck based on if you win or find an editioned playing card even if you go out of your way to do it?
that's just bad game design

humble girder
#

but if they don't lock in, poker_hands should have the full house and the 4/5oak

zealous glen
frosty dock
minor furnace
zealous glen
#

Because I do agree multi rank cards should trigger every relevant rank Joker

#

But Full House and Two Pair specifically ask for different ranks

#

and the cards wouldn't have different hands

stiff locust
humble girder
#

that makes sense and ugh

#

i hate this because going by that you're absolutely right

zealous glen
humble girder
#

a wild rank card is the same rank as all other cards

zealous glen
foggy carbon
#

every time I get the memory allocation failed error, I forget how to fix it

frosty dock
foggy carbon
#

I need to just self-pin the answer

humble girder
#

ok i'm annoyed because definition-wise, Victin is absolutely right, but it still doesn't intuitively make sense not to have a full house in the above example hands

stiff locust
wintry solar
#

but these cards aren't the same rank, they can function as any rank

red flower
#

what about for example a multi-rank hand of (1,2);(1,2);(2,3);(2,3)
doesnt that contain 4oak and two pair

foggy carbon
zealous glen
wintry solar
#

we can't really base the logic off thunk's definitions of cards that have one rank only

sturdy compass
#

The funny big number deck can finally go the distance omg Prayge

zealous glen
foggy carbon
humble girder
#

basing it off of the logic of poker_hands my expectation for a general implementation of multirank cards is that every possible permutation is included in poker_hands

foggy carbon
#

oh god

sturdy compass
#

Like I said, funny big number deck

minor furnace
zealous glen
zealous glen
minor furnace
#

this is true

wintry solar
#

I'm talking from a fundamental design point of view rather than how efficient an algorithm would be

humble girder
#

efficiency is secondary, make it make sense first

zealous glen
#

But both make sense

minor furnace
vestal ore
#

ggnore

humble girder
#

there's always the nuclear option

#

implement both, make behaviour toggleable on the wild rank enchant by a flag

#

¯_(ツ)_/¯

minor furnace
#

and my custom straight detection algorithm definitely isn't the most efficient, but it seems to work for what I need it to do for my own mod

zealous glen
#

do you think they're gonna implement two algorithms

humble girder
#

honestly?

#

i think they're gonna implement 0

#

but it's an interesting thought experiment

zealous glen
#

I'm a supporter of implementing multi ranks without Straight detection

#

Because it's better than nothing

#

and multiple mods want to play with the concept

#

and people are inventing their own

minor furnace
#

so you just make playing them incompatible with straights?

zealous glen
minor furnace
#

ah ok

humble girder
#

straights looking at the base rank is actually awful, see the above example

minor furnace
#

I feel like it would be more fun if they completely ignored base rank, but that could work

humble girder
#

I can't even properly tell what the base rank is

zealous glen
minor furnace
#

the answer for me is that its base rank doesn't actually matter, because I wasn't going to let it score chip

humble girder
#

plus it is very unintuitive from a player perspective

zealous glen
#

not with the concept

zealous glen
humble girder
#

i'd argue the draw of wild ranks is to make straights somewhat less unappetizing

zealous glen
#

I think making them compatible with each other is more appealing than the mods not working together

#

Also

#

it's less work for modders

frosty dock
#

i do actually have some time on my hands coming up, so chances are I'll figure something out

candid willow
#

what is "smods lsp definitions"?

zealous glen
frosty dock
candid willow
#

so its autocomplete stuff for vscode?

frosty dock
#

more or less

candid willow
#

how do I start using it?

frosty dock
#

checkout the PR's branch and refer to its description for how to use it

high stag
#

So I've changed the code to use that version of the context.destroying_card

        local destroyed_cards = {}
        local murder_card = {}
        if context.after then
            murder_card = pseudorandom_element(context.full_hand, pseudoseed('random_destroy'))
            murder_card.destroyThisCard = true
            destroyed_cards[#destroyed_cards+1] = murder_card
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.1,
                func = function() 
                     for i=#destroyed_cards, 1, -1 do
                        if SMODS.shatters(murder_card) then
                            murder_card:shatter()
                         else
                            murder_card:start_dissolve(nil, i ~= #destroyed_cards)
                        end                            
                    end
                 return true 
                 end
            }))
            
               G.E_MANAGER:add_event(Event({
                   trigger = 'after',
                delay = 0.7,
                   func = function() 
                       local cards = {}
                       for i=1, 1 do
                           cards[i] = true
                           local _suit, _rank = nil, nil
                               _rank = pseudorandom_element({'2', '3', '4', '5', '6', '7', '8', '9', 'T','J', 'Q', 'K','A'}, pseudoseed('incantation_create'))
                            _suit = pseudorandom_element({'S','H','D','C'}, pseudoseed('incantation_create'))
                           _suit = _suit or 'S'; _rank = _rank or 'A'
                           local cen_pool = {}
                        for k, v in pairs(G.P_CENTER_POOLS["Enhanced"]) do
                               if v.key ~= 'm_stone' then 
                                   cen_pool[#cen_pool+1] = v
                               end
                        end
                           create_playing_card({front = G.P_CARDS[_suit..'_'.._rank], center = pseudorandom_element(cen_pool, pseudoseed('spe_card'))}, G.hand, nil, i ~= 1, {G.C.SECONDARY_SET.Spectral})
                       end
                       playing_card_joker_effects(cards)
                   return true end 
            }))
        end
        if context.destroying_card and context.destroying_card.destroyThisCard then
            print("destroy")
            return{
                remove = true,
            }
        end
       end```

it's still making ghost cards though, and when I remove the function about destroying the card then it just leaves the cards as they are and it's only adding to the deck
humble girder
#
                trigger = 'after',
                delay = 0.1,
                func = function() 
                     for i=#destroyed_cards, 1, -1 do
                        if SMODS.shatters(murder_card) then
                            murder_card:shatter()
                         else
                            murder_card:start_dissolve(nil, i ~= #destroyed_cards)
                        end                            
                    end
                 return true 
                 end
            }))```
#

you don't need this

limpid halo
#

what context can i use for a trigger like space joker? The source code just has it listed in else after all the other context checks so...

wintry solar
#

you're also completely mistiming your events

high stag
#

I tried cutting that and it just doesnt touch the played cards at all

wintry solar
#

context.after is after context.destroying_card

frosty dock
limpid halo
high stag
humble girder
wintry solar
#

it is after the hand is scored

frosty dock
zealous glen
#

Now that I think about it, maybe my one card that looks for different suits isn't working along that philosophy balatrojoker

frosty dock
#

3 3 3 (3,4) (3,4)
in my eyes this should both scale pants and proc the family

zealous glen
#

yeah I'd need to change the logic in case all "all suit" cards are the same base suit

zealous glen
frosty dock
#

if I apply your logic to suits, a wild flush isn't a spectrum-?

zealous glen
#

Yes

frosty dock
#

that seems unintuitive

zealous glen
#

Only if Spectrum is higher ranked than Flush

frosty dock
#

so it does contain a spectrum

#

then my hand contains a two pair

tropic elk
#

why does this text show as error?

zealous glen
#

Spectrum is assymptotically easier than Flush as the number of suits tend to infinity*

wintry solar
zealous glen
#

So it makes sense that Flush trumps Spectrum

frosty dock
#

okay, take a bunco spectrum

tropic elk
frosty dock
#

but i don't see how it matters

unkempt thicket
zealous glen
frosty dock
#

hands containing a hand doesn't depend on the hand being higher on the list

humble girder
#

I dunno about this whole same vs. different thing, I mean Seeing Double could make a strong argument against it; "contains a club card and any other suit", works with a wild card and a club but they're the "same suit"

frosty dock
#

if I have a 4oak with two extra same-rank cards, that is scored as a 4oak but it still contains a two pair

zealous glen
#

In a multi rank world

#

You take the set of ranks from each card and look at the intersection

#

It's either empty or not

#

It can't be both

frosty dock
#

that means having the same rank is not transitive

zealous glen
#

So it's either the same rank or not

#

hmmm

frosty dock
#

(2,3) (3,4) (4,2)

zealous glen
#

The alternative is allowing two cards to both be the same and different ranks

#

Neither is intuitive IMO

frosty dock
#

these cards are pairwise the same rank by your interpretation

zealous glen
#

of course

frosty dock
#

yet they're not all the same rank

zealous glen
#

(3,4) (3,4) are the same and different ranks simultaneously

frosty dock
humble girder
frosty dock
#

take a club and 4 wild cards

zealous glen
#

I guess if vanilla suits work with that logic it's sufficient to convince me SMODS can take the same approach for ranks

humble girder
#

a wild rank card is both the same rank and different rank as another wild rank card, but also not not the same rank and not not different rank

rose dragon
#

where in the game files can i find the music?

frosty dock
#

they score as a flush, meaning they are considered the same suit for this purpose

zealous glen
#

But philosophically I'm still unconvinced either alternative is more consistent

frosty dock
#

seeing double considers any of the wild cards a non-club as well, so they're different suits as well

humble girder
zealous glen
#

why are you acting like I can't read

rose dragon
#

wait nvm i found it

frosty dock
#

no i'm just tired and slow

humble girder
#

that was probably aimed at me /shrug

zealous glen
#

both of you

humble girder
#

idk I kinda just put it together in my head and got excited

zealous glen
#

ye but you had said it and I had reacted to it

frosty dock
#

mb

zealous glen
#

if you repeat it to me, and especially if you and aure do it it sounds disrespectful

humble girder
#

I can offer you nothing but my word that it's not intended that way lol

frosty dock
#

same

zealous glen
#

'tis fine

wintry solar
#

such is the way of written communication in a fast moving environment

zealous glen
#

I was just annoyed in the moment

humble girder
#

i'm just loud and obnoxious ¯_(ツ)_/¯

zealous glen
#

Mathematically, I'd see which is more useful. But this is a practical matter

zealous glen
wintry solar
#

I think intuitively for a card to trigger multiple joker effects based on it's quantum ranks, it can't "lock in" to only 1 rank during scoring

humble girder
#

I think the way to look at is vanilla never considered the possibility of wild ranks but specifically implementing it in the way where is_same_rank() is true if the intersection of covered ranks is non-empty and is_different_rank() is true if the intersection of covered rank is not equal to the full set of ranks of either card would be the closest way to act like vanilla wild suits

#

and then efficiency is secondary

zealous glen
#

It's just set theory

#

and/or algebra

#

I defined it with set theory but the concept of equality (or equivalence classes) has things either be equal or not

humble girder
#

I dunno man, set theory and algebra is fundamentally not an intuitive way to approach a game that has a self-imposed limit of 4 lines of text per card to minimize having to think about it

zealous glen
#

I mean you don't need to go that deep

#

I just did to justify it mathematically

#

Other people agreed with me and I dunno if they looked that deep

high stag
#
        local destroyed_cards = {}
        local murder_card = {}
        if context.before then
            murder_card = pseudorandom_element(context.full_hand, pseudoseed('random_destroy'))
            murder_card.destroyThisCard = true

[...] (create new card code, working perfectly)

        end
        if context.destroying_card and context.destroying_card.destroyThisCard then
            print("destroy")
            return{
                remove = true,
            }
        end
       end```

So I've set the context to before but the destroying_card thing refuses to proc no matter what combination of context.destroying_card, murder_card, and destroyThisCard I use
wintry solar
#

oh I bet this is a jank ass old smods build issue

high stag
#

I re-upped my build like 2 days ago

limpid halo
#

What's the best mod to test compatibility with, Cryptid?

zealous glen
#

no

hardy viper
humble girder
#

cryptid is probably the least compatible mod out there

hardy viper
#

well

#

full+talisman

limpid halo
hardy viper
#

cryptid focuses on cross-mod content/compatibility quite a bit

zealous glen
#

we need stickers to reply to questions like "read the wiki please please please pl" and "old ahh jank smods" and "oops you're right it's undocumented"

humble girder
frosty dock
#

my favorite

zealous glen
#

that's a good one too

limpid halo
frosty dock
hardy viper
limpid halo
wintry solar
humble girder
#

(if that's intended you can turn on SMODS.optional_features.cardareas.unscored = true )

high stag
#

it's not working on Straights

wintry solar
#

it 100% works on straights

high stag
#

I wish you were right

wintry solar
high stag
#

whatever you're running is working on straights but mine is not

wintry solar
#

I literally copied your code into my joker

#

and added a print to show what card it chose

high stag
#

(how do I record balatro)

zealous glen
#

windows?

humble girder
#

can we eliminate smods version as an issue

#

what is your smods version

wintry solar
#

where is your effect coming from?

humble girder
#

calculate = function(self, back, context) is it a cardback?

minor furnace
high stag
#

never noticed prtsc can record ngl

minor furnace
#

it can?

high stag
humble girder
#

it's a cardback

wintry solar
#

lemme take a look

high stag
wintry solar
#

it would appear that decks are never passed the destroying contexts

high stag
#

WAIT I MAY HAVE FOUND IT

#

oh

#

nvm

#

i thought i had solved some big riddle when i realized that the "make new card" thing return true-d and maybe that was just shutting down the whole thing

#

so like, decks can't destroy cards?

#

I physically cannot make this deck?

humble girder
#

you can always patch in the functionality

minor furnace
#

for some reason, despite identifying the correct scoring hand, none of the cards score when played... So I will have to look into this

#

at least I know it only happens when my hand contains one of these cards

high stag
wintry solar
#

nah it's just been missed on the smods end

#

give me 5 minutes

#

5 minutes was a wild over estimation

#

it works now

high stag
#

what

#

so i just go grab the newest files for smods and it'll like, run?

wintry solar
#

yup

limpid halo
#

eremel the goat

humble girder
#

🐐

high stag
#

you really are a 🧙

orchid thunder
#

how can i check if a card is a certin enhancement

humble girder
#

SMODS.has_enhancement(card, key)

minor furnace
#

is there a way to make a print of a table not give the "+x more values" and actually give me the full thing

queen bluff
#

I'm new to modding in Balatro and need some help with this Joker. I'm trying to make it retrigger all lucky cards, but retrigger twice if their lucky effect triggers. I've tried various different ways but nothing seems to work. This is the last thing I tried. It seems to only retrigger them once.

frosty dock
humble girder
# minor furnace is there a way to make a print of a table *not* give the "+x more values" and ac...
function BALIATRO.tprint(tbl, indent, max_depth)
    if not max_depth then max_depth = 1 end
    print(BALIATRO.tprint_i(tbl, indent, max_depth))
end

function BALIATRO.tprint_i (tbl, indent, max_depth)
    if not tbl then return '<nil>' end
    if max_depth <= 0 then return tostring(tbl) .. " <too deep>" end
    if not indent then indent = 0 end
    local toprint = string.rep(" ", indent) .. "{\r\n"
    indent = indent + 2
    for k, v in pairs(tbl) do
        toprint = toprint .. string.rep(" ", indent)
        if (type(k) == "number") then
            toprint = toprint .. "[" .. k .. "] = "
        elseif (type(k) == "string") then
            toprint = toprint  .. k ..  "= "
        end
        if (type(v) == "number") then
            toprint = toprint .. v .. ",\r\n"
        elseif (type(v) == "string") then
            toprint = toprint .. "\"" .. v .. "\",\r\n"
        elseif (type(v) == "table") then
            local ret = BALIATRO.tprint_i(v, indent + 2, max_depth - 1)
        if ret then
            toprint = toprint .. ret .. ",\r\n"
        else
            toprint = toprint .. '<nil?>,\r\n'
        end
        else
            toprint = toprint .. "\"" .. tostring(v) .. "\",\r\n"
        end
    end
    toprint = toprint .. string.rep(" ", indent-2) .. "}"
    return toprint
end```
frosty dock
#

that is a combination of context values that does not occur

humble girder
#

I use this when I need deep detail

humble girder
#

oh

#

that would've been nice to know lol

queen bluff
frosty dock
humble girder
#

listen

#

I deserve that

frosty dock
#

xd

humble girder
#

but I reserve my right to feel offended

edgy reef
# frosty dock

btw despite the fact that this meme was created because of an undocumented function in smods, it's still not documented xdd.

#

Anyone wanna take a guess before I commit it to the wiki?

limpid halo
#

something something force a game-over

tropic elk
#

is there a version of press_play that triggers on discard instead?

humble girder
#

I had to patch that in

minor furnace
humble girder
#

but I did not look in the docs so I might be about to die

#

actually that's not even true i literally patched it in because it wasn't in the docs lol

tropic elk
#

i've been looking but I can't find it, then again i still don't know if there's actually a list of everything you can do in the docs

#

cause if so I don't know where it is

random sleet
#

the list of everything you can do can be easily found with ctrl+shift+f "function"

spring lantern
#

first row complete

tropic elk
#

where do I do that search?

random sleet
#

everywhere

humble girder
tropic elk
#

there's a discard_cards_from_highlighted function, maybe that works

normal crest
#

i love baliatro

minor furnace
tropic elk
humble girder
#

what exactly are you trying to do

#

blind triggering on discard?

tropic elk
#

yea

#

a blind which makes hands and discards cost one of the other

humble girder
#
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "-- TARGET: effects after cards destroyed in discard"
position = 'after'
payload = """if G.GAME.blind and G.GAME.blind.in_blind and G.GAME.blind.config and G.GAME.blind.config.blind and G.GAME.blind.config.blind.after_discard and type(G.GAME.blind.config.blind.after_discard) == 'function' then
    G.GAME.blind.config.blind:after_discard()
end
"""
match_indent = true```
tropic elk
#

which works fine with hands costing discards

humble girder
#

I did this

#

for my particular need

high stag
humble girder
#

I mean you can just put it in your main outside any function and it'll just be enabled

tropic elk
humble girder
#

no that's a lovely patch

#

goes in a lovely.toml

tropic elk
#

makes sense

#

thanks

spring lantern
#

okay so for some godforsaken reason when i use a familiar card context.cards is a boolean value instead of a table of added cards. how do i idiot proof my code so the game doesn't crash when that happens

zealous glen
#

@wintry solar is that actually a thing or

tropic elk
#

it is interesting that there doesnt seem to be a way to just copy what the serpent does

humble girder
#

well, yeah, no "officially supported" way

#

you can still just override G.FUNCS.draw_from_deck_to_hand or patch it

wintry solar
#

I don't think there's ever a context.cards

spring lantern
humble girder
spring lantern
#

yea i'm in that context

wintry solar
#

I am blind

high stag
#

and now the Deck of Theseus can set sail! thank you so much @wintry solar and @humble girder (and the others who've put up with my nonsense, those are just the 2 rn)

humble girder
#

the thing is, it's weird, even in vanilla:

#

I don't know what was the idea behind this but yeah that isn't a particularly useful context bit

wintry solar
#

I guess just check that the value is a table first

edgy reef
#

I think cards is just an array of true

#

All the time iirc

humble girder
#

not all the time, actually

#

Cryptid passes a table of cards

spring lantern
#

nah sometimes you do get the cards added

humble girder
#

ALL other sources pass one true for each card created

spring lantern
#

standard packs did seem to be working tho

edgy reef
#

That should probably always be passing the cards since true doesn't tell you the card type.

spring lantern
#

why the actual fuck is it coded like this

wintry solar
#

well isn't that a load of vanilla jank

edgy reef
#

This is def LocAtlHunk code

humble girder
#

listen

#

we don't question why things are the way they are in vanilla

edgy reef
#

true

spring lantern
#

boutta patch the context so it's not stupid and useless when using specific spectral cards

humble girder
#

ah i see why vanilla does it

#

not the easiest thing to patch

#

cards are created in an event but playing_card_joker_effects is called outside the event

#

effectively, before the cards are even instantiated

spring lantern
#

ballsack

humble girder
#

not actually sure why it has to be that way tbh

spring lantern
#

am i gonna have to hook into the card creation func

wintry solar
#

no they're not

#

at least, some of them aren't

humble girder
#

i'm looking at marble joker

#

just assumed all are like this

spring lantern
#

this was meant to be an quick and easy joker to make 😭

humble girder
#

don't hook create_card, you'll surprise literally every other mod

wintry solar
#

yeah looks like marble and certificate are outside the event

wintry solar
spring lantern
#

thx

zealous glen
#

Sometimes it passes the card

#

Well I think it was inconsistent

#

Even though Canio exists

#

Maybe I’m confusing with adding cards @_@

#

I should go to sleep

normal crest
wintry solar
#

I did 🤣

#

my local copy isn't updated

tropic elk
#

ah the screenshots are slightly mismatched but it throws the same error regardless of whether or not there's the preamble to the function

limpid halo
#

does anyone wanna check if the release version of my mod works for them 😭

tropic elk
limpid halo
tropic elk
#

would you not be able to figure that out yourself? or is it to test if it's somehow different for other people's systems

limpid halo
#

i suffer from severe "works on my machine" syndrome so, yeah that.

tropic elk
#

fair enough

#

where can I find it?

orchid thunder
red flower
tropic elk
#

cool

#

well it also gives basically the same error if I don't include that part

red flower
#

did you remove the ()

tropic elk
#

but maybe I need to add a different thing in front

#

hm

#

I think so but i should check again

#

yea it still breaks

red flower
#

you're also missing a comma

tropic elk
#

oh well that would explain it

#

oh wow it really was that easy

#

I for some reason didn't think there needed to be one there

#

the error message looked suspiciously "missing a comma" but i wrote it off as some other formatting issue

hot island
#

has this been done before

tropic elk
#

a browser screen? or does this actually play

hot island
#

actually plays

tropic elk
#

oh then thats very cool

hot island
#

yeah

manic rune
#

ok so i genuinely need an example of a joker using generate_ui

#

because i dont know what the hell i am doing at this point

#

😭

manic rune
rose dragon
red flower
hot island
#

i used love.js and had to change a ton of shit in both the game and love.js

red flower
#

if you tell me what you want to do i could cook up an example

hot island
manic rune
#

nah it should be fine honestly, i dont even know where to start with this 😭

rose dragon
hot island
#

i just added the icons to the menu

tropic elk
manic rune
hot island
manic rune
hot island
#

please dont murder me localthunk im not releasing it

manic rune
#

man i both love and hate uis, they seem so convenient if you understand how it works but it looks like freaking black magic

manic rune
#

u r cooked 💔

hot island
#

😔

#

oh yeah the only difference is that rng isnt identical to real balatro

#

so like seeds and stuff arent the same between normal and web

manic rune
#

huh

#

but at least does rng save in the seed?

hot island
#

yeah

#

i just had to modify the rng code cuz the normal one doesnt work in love.js

red flower
manic rune
#

and i kinda dont know how to add stuff to it rn

#

so if i understand the basics of how it works, it should be nice

red flower
#

if you want to edit the main description and not the info tooltip then you check desc_nodes == full_UI_table.main
desc_nodes.name contains the UI table with the name
desc_nodes itself contains the description

#

you want to add stuff to desc_nodes by using localize

manic rune
#

oh i see

red flower
#

i feel like the easiest way to start is to call SMODS.Center.generate_ui inside your generate_ui function and printing what it gives you

#

and then see how you want to alter that rather than making it all from scratch

manic rune
#

mmm i will do that and see what i can work with, thanks :D

orchid thunder
#

why no work i dont kow what im doing

#

wait

red flower
manic rune
#

oh so do i just do print(desc_nodes) and take a look at it

#

(i feel like it would just be nothing)

red flower
#

yeah its probably going to be a bit of UI nonsense but you can work out the parts

#

it will be a table with the name and description tables

valid leaf
#

Question, For deckskins do I need to separate each set of cards into different image?

tropic elk
#

delphox spotted

#

i've not done deck skins but i dont see why it wouldnt work like any other atlas

valid leaf
#

trying to port from deckskinslite

red flower
manic rune
#

ghhhhjhjh

#

yeah im scratching my head over here

#

😭

polar marlin
#

how would i add a card into balatro along with modifying it?

polar marlin
#

huh

manic rune
#

wait, what kind of card are we talking about here

polar marlin
#

joker

#

custom joker

manic rune
#

oh

#

yeah, thats the correct one

red flower
polar marlin
#

alright thanks

manic rune
#

if you are confused where to start

#

its a bit outdated, but it should tell you the basics ❤️

polar marlin
#

i was just about to ask

#

/thanks

manic rune
red flower
#

yes

#

if desc_nodes == full_UI_table.main then desc_nodes.name is going to be a UI table
if it's not main (an info tooltip) then I think it's just a simple string

polar marlin
#

wait is pixel art smoothing absolutly needed for it to work properly?

candid willow
paper zealot
#

Do you not have google? Obviously a bad take, i will drink more coffee in silence

polar marlin
#

because im currently using aseprite and i dont know how to make it double the size without fucking it over

manic rune
polar marlin
#

im using trial so idk

red flower
polar marlin
red flower
#

idk

polar marlin
#

aw man

candid willow
#

It would make it a lot easier to just have guides like this pinned so modders can just come here and get what they need

#

instead of doing 20 minutes of searching and trying to ask more experienced modders for help only to be ignored

#

for a single issue

manic rune
#

yeah so uh

#

i tried changing desc_nodes.name to both a string and an ui table

#

doesnt seem to change anything

polar marlin
#

it doesnt work with the trial

manic rune
#

oof

polar marlin
#

i hate being broke T-T

manic rune
#

definitely fucking up something but here, this is what i tried for the string

paper zealot
polar marlin
#

does anyone have the link to paint. net website?

manic rune
#

as for the part where i changed it to an ui table, i did the exact same with the desc_nodes above, was i supposed to do it like that

manic rune
#

already in the name

red flower
manic rune
#

oh nevermind, i remembered it wrong

paper zealot
manic rune
polar marlin
manic rune
#

here

manic rune
polar marlin
#

thanks guys

red flower
#

this is how I add the card types to the name

manic rune
#

oh nice, i got it working

#

:D

#

thanks!

manic rune
#

i can finally add more complicated chars like acheron with this one

#

💔

red flower
#

i love acheron

manic rune
#

me 2

#

sadly she is getting power crept

red flower
#

💔