#💻・modding-dev

1 messages · Page 463 of 1

signal lotus
#

maybe I will find someone better than this to help work on the mod with me

vast night
#

thx

signal lotus
vast night
signal lotus
#

but i cant imploement it on my own

vast night
#

you just divide G.GAME.blind.chips by 100, floor it and add it to conf

signal lotus
#

also not that hard for you is almost impossible for me

signal lotus
#

this is the most complicated thing ive made

vast night
#

if you always do one thing a bit more complicated you learn much more than by just reading

gilded blaze
# signal lotus maybe I will find someone better than this to help work on the mod with me
if context.before and context.main_eval then
    card.ability.extra.card_list = {}
    card.ability.extra.suit_list = {}
    local suits = {}
    for _, v in pairs(SMODS.Suits) do
        suits[#suits+1] = tostring(v.key)
    end
    for i = 1, #context.scoring_hand do
        for _, suit in ipairs(suits) do
            if context.scoring_hand[i]:is_suit(suit) and not card.ability.extra.suit_list[suit] then
                table.insert(card.ability.extra.card_list, context.scoring_hand[i])
                card.ability.extra.suit_list[suit] = true
                break
            end
        end
    end
end
if context.individual and context.cardarea == G.play then
    for _, _card in ipairs(card.ability.extra.card_list) do
        if context.other_card == _card then
            return {
                x_mult = card.ability.extra.xmult
            }
        end
    end
end
vast night
#

and second

signal lotus
#

second what

fallow breach
#

could someone walk me through adding the chance effect towards the end

#

i'm copying gros michel's code for it but i'm not sure how i would make it effect every joker + consumables

red flower
#
SMODS.destroy_cards(G.jokers.cards)
SMODS.destroy_cards(G.consumeables.cards)
tepid crow
#

that's a thing??

red flower
#

yes

fallow breach
#

where would those go

red flower
#

instead of that whole event

tepid crow
#

oh it got added a month ago

#

actually does that account for eternals? 🤔

red flower
#

hmm i dont think so

tepid crow
#

yeah I don't think so either

fallow breach
red flower
#

yes

gilded blaze
#

the code suggests SMODS.destroy_cards mainly targets playing cards

red flower
#

nah it's for any card

#

it does extra stuff for playing cards

gilded blaze
#

I mean

#

the eternal thingy

red flower
#

there's no function that accounts for eternal afaik, everything checks before destruction so it follows what the game usually does

#

although i will pr an eternal check and see what eremel thinks

#

and also the ability to make it immediate instead of an event which i need

gilded blaze
tight hull
#

Nice! sorry I couldnt help you

gilded blaze
#

yea, calling SMODS.destroy_cards(G.jokers.cards) definitely crashes the game

red flower
#

weird

#

can you send the full log

formal parrot
#

Hello devs

rancid flare
#

Is there a way to do like SMODS and add thing to help do repetitive code like we do with SMODS.Joker an all the other ?

red flower
#

you mean make functions? yes

gilded blaze
#

should the for loop run from #cards to 1 instead

rancid flare
red flower
fallow breach
#

it's telling me that odds is a nil value even though i set in the config

idle plaza
#

What did you set it to and how did you use it?

fallow breach
gilded blaze
#

reverting the direction fixes it

fallow breach
red flower
#

well who am i to disagree with results

empty solstice
idle plaza
# fallow breach

Could you show the whole context function? Everything here looks fine so the actual issue might be something else.

fallow breach
idle plaza
# fallow breach

This is (presumably) a separate, unrelated issue, but your loc_vars function should use (G.GAME and G.GAME.probabilities.normal or 1) instead.

If this Joker is viewed in the collection from the main menu, G.GAME won't exist, and that'll cause its own crash.

tight hull
red flower
#

might be some mod messing with it

next timber
#

why tf is the line Image depths = prophecy.z; in my shader giving me 4 entire errors?

ERROR 'z' : vector swizzle selection out of range
ERROR 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: depths
ERROR '=' :  cannot convert from ' temp float' to ' temp sampler2D'
ERROR: '' : compilation terminated
#

prophecy is the name of the shader, and i'm setting an image as the 3rd item in the ARGS.send_to_shader

#

so prophecy.z should be the image, correct?

gilded blaze
polar parrot
#

anyone know how the joker art thing works? like what code chooses where the joker is on the .png file

red flower
empty solstice
idle plaza
# fallow breach

Okay, the cause is that your Joker is running the destruction check outside of a specified context, so it's running it in all contexts.

Merge that section, and the one above, into one end_of_round and game_over == false check. Within, have a single pseudorandom check with the destruction stuff, then put the upgrade stuff in an else.

As in (pseudocode because quicker to type):

if end of round and game over == false then
    if pseudorandom < probabiilties.normal / odds then
        destroy the stuff
    else
        upgrade
    end
end

Just cut/paste the actual code into the appropriate places.

fallow breach
#

thank you i did figure that out

#

there would also have to be and not context.blueprint and not context.repetition right

tight hull
#

but it would take me a long time to figure it out anyways

gilded blaze
#

alr PR opened

faint yacht
serene granite
#

heyy quick question is there a way to detect if a card is not being scored, i want to make a simple joker that destroys all cards that are scored, not the ones that arent scored, any advice?

next timber
#

you can just loop through the scoring_hand

#

context.scoring_hand, i believe?

idle plaza
red flower
vast bough
red flower
#

dont destroy cards like that

#

use this during scoring

serene granite
#

ok i will try that, thank you !

idle plaza
#

The game will already run your function once for each card in hand when your code is within the destroy_card context.

context.destroy_card is also a card object, you can directly check its base.nominal.

brittle tide
vast night
#

This is more of a random questioon, because I wondered. What does stop_use() do?

#

And this is not such a random question: How can i make a text ui object be dynamic/changeable/always correspond to a variable

#

And the third one

#

how do i add that hover animation to text? (nvm i think i found it on the wiki)

#

thats all

red flower
vast night
#

does it updfate continuously

red flower
#

yes

vast night
modern kindle
#

Good afternoon chat

#

N and smt my goats

floral narwhal
#

How can I add localization to cards? Like 2 of hearts : +2 chips. How can I add text to this?

red flower
floral narwhal
#

I wanna add new mechanic and new value so I've to show it like chips

red flower
floral narwhal
red flower
frigid perch
#

Is there a way to make the name of a Joker toggle-able?
I have 2 packs, but the same joker is named different things in each pack, and their textures are different. I wanna be able to turn one off so I can keep the other, without just disabling the pack with the name I don't want entirely

red flower
#

yes, in loc_vars return a key to a different localization entry

modern kindle
#

damn i was gonna be much dumber and use find_mod to disable

#

N is smarter

red flower
#

I was just answering the question directly but if they're two different mods disabling might just be easier

vast night
#

hi again!
can someone explain to me why the text is not centered?
(fixcrow is just a function that puts the item in a G.UIT.R node so it correctly displays)

                -- ui definition
                G.fates_wait_for_poll = UIBox {
                    definition = {
                        n = G.UIT.ROOT,
                        config = { r = 0.1, minw = 8, minh = 6, align = 'tm', padding = 0.2, colour = G.C.BLACK },
                        nodes = {
                            {
                                n = G.UIT.C,
                                config = { },
                                nodes = {
                                    fixcrow({ n = G.UIT.T, config = { text = 'Your fate is in their hands!', colour = G.C.UI.TEXT_LIGHT, scale = 0.5, padding = 0.15, align = 'cm' } }),
                                    fixcrow({ n = G.UIT.T, config = { text = '60s', colour = G.C.UI.TEXT_LIGHT, scale = 0.7, padding = 0.15, align = 'cm' } }),
                                    fixcrow({ n = G.UIT.C, config = { minw = 7.85, minh = 1, colour = G.C.UI.BACKGROUND_INACTIVE, padding = 0.15, align = 'tm', r = 0.1 }, nodes = {
                                        fixcrow({ n = G.UIT.T, config = { text = FATES.Options[1].text, colour = G.C.UI.TEXT_LIGHT, scale = 0.4 } }),
                                        fixcrow({ n = G.UIT.T, config = { text = FATES.Options[2].text, colour = G.C.UI.TEXT_LIGHT, scale = 0.4 } })
                                    } })
                                }
                            }
                        }
                    },
                    config = { align = 'bm', offset = { x = 0, y = G.ROOM.T.y + 19 }, major = G.hand, bond = 'Weak' }
                }
red flower
#

you might need the column and the row to also be cm-aligned

vast night
#

while im at it: i forgot how to use ref_table and ref_value. could you help me 😭

frigid perch
red flower
#

ah if it's for a texture pack i have no idea

frigid perch
#

I can do the texture pack just fine, like, I know how to disable the texture on its own

#

It's just the name to go along with it is all

red flower
vast night
#

i would try elsewise

#

but if theres already a templatge for that im happy enough :)))

red flower
#

i think there's a love2d function for that
but you can use G.TIMERS.REAL and keep track of the initial time + 60

#

(i dont think its in seconds tho)

tepid crow
#

pretty sure it is in seconds is it not?

vast night
vast night
red flower
#

perfect then

tight hull
#

hi, is it possible to add buttons here? (I want user to have a choice between replacing tarot cards, planet cards, or both)

tight hull
tight hull
#

so instead of it being there its in another tab?

#

is it easier to do?

red flower
#

yeah, mostly for consistency with other mods

#

both are the same difficulty although you would need to use the config file described there for both

tight hull
#

I will try to do that then

vale quarry
#

Hello, how does one write a multiline pattern in a lovely patch ?

red flower
#
'''
line1
line2
'''
vale quarry
#

Thx !

modern kindle
clever rose
#

Is there a way to get this to only activate if I play a mercury card, as it currently activates on any planet card? and also is it possible to fix this visual bug when it activates or not?

red flower
red flower
wind steppe
#

how would i check if the player has scored higher than vanilla naneinf in an unlock condition? (talisman is required)

tight hull
red flower
tight hull
#

oh ok

#

yea

#

sry

red flower
#

no worries

brittle tide
#

for enabling joker retriggers do you place it inside of the joker you want to be able to retrigger other jokers or do you place it at the bottom of the overall code?

modern kindle
red flower
brittle tide
#

alr cool

tight hull
#

where can I find "Building a UI" page?

#

Im blind and cant find it anywhere

#

wait i think i found it

uncut cloud
#

alright yall im dealing with a few issues here while trying to code in a timer
talked about this a while ago, went with N's recommendation of a global table and TimerGuwbi.seconds seems to be working however not the display of the dynamic text
can anyone tell me if im doing something wrong here?

next timber
#

is there a way to make edition shaders stack on top of a joker's existing shaders instead of replacing them? for some reason foil seems to do this but holo, polychrome and negative all remove the custom shader

uncut cloud
#

AH

#

i see

next timber
tight hull
#

Whats the problem? it doesnt do anythingSMODS.current_mod.config_tab = function() return {n = G.UIT.ROOT, config = { {n = G.UIT.C, config = {align = "cm", padding = 0.1}, nodes = { {n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}} -- config values here, see 'Building a UI' page }} }, nodes = { -- work your UI wizardry here, see 'Building a UI' page }} end

red flower
#

the nodes need to be inside nodes not inside config

tight hull
#

so how do I make the config tab?

red flower
#

like you posted

tight hull
#

ohhh

red flower
#

i mean like this goes there

tight hull
#
    return {n = G.UIT.ROOT, config = {
        -- config values here, see 'Building a UI' page
    }}
    }, nodes = {
        {n = G.UIT.C, config = {align = "cm", padding = 0.1}, nodes = {
            {n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}}
        -- work your UI wizardry here, see 'Building a UI' page
    }}
end```
#

like this?

red flower
#

yeah

tight hull
#

so in config I should put the config...

midnight coyote
#

how do i get the current chip val of a card

red flower
vast night
#

Hey Im back with another dumb question. Why tf is random here always picking first 19 and then 29???? i just dont understand it

local function choice(array)
    local i = math.random(#array)
    print(#array)
    print(i)
    print(array[i])
    return array[i]
end
red flower
stiff locust
#

what's the balatro lua version

red flower
#

5.1

stiff locust
#

cool great thanks

midnight coyote
#

use pseudorandom instead

stiff locust
#

so the % should work

vast night
midnight coyote
#

doesn’t matter

#

do not use math.random

vast night
tight hull
red flower
# tight hull ...

there you're only building the UI, the changes to your mod's config are done through buttons and stuff

red flower
tight hull
vast night
#

i forgor to put the id

vast night
red flower
tight hull
#

thnx

#

it still doesnt show up

#

shouldnt I put something in the main .lua file to register the config.lua?

#

or does it just work automaticly

red flower
#

idk works for me

red flower
tight hull
#

uh

red flower
#

like this

tight hull
red flower
#

yes

tight hull
red flower
#

oh wait i misread

#

ignore the first message :3

tight hull
#

sure

tight hull
# tight hull makes sense now

so the code should look smth like this?


function SMODS.INIT.ReZeroTarot()

    local rezerotarot = SMODS.findModByID("ReZeroTarot")
    
    local sprite_trt = SMODS.Sprite:new("Tarot", rezerotarot.path, Filename, 71, 95, "asset_atli")
    local sprite_jkr = SMODS.Sprite:new("Joker", rezerotarot.path, "Jokers_Subaru.png", 71, 95, "asset_atli")
    local sprite_pla = SMODS.Sprite:new("Planet", rezerotarot.path, Filename, 71, 95, "asset_atli")
    local sprite_spc = SMODS.Sprite:new("Spectral", rezerotarot.path, Filename, 71, 95, "asset_atli")

    sprite_jkr:register()
    sprite_trt:register()
    sprite_pla:register()
    sprite_spc:register()

end

SMODS.current_mod.config_tab = function()
    return {
        n = G.UIT.ROOT, 
        config = {}, 
        nodes = {
            {
                n = G.UIT.C, 
                config = {align = "cm", padding = 0.1}, 
                nodes = {
                    {n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}}
                }
            }
        }
    }
end
#

it still doesnt work but it doesnt crash

red flower
#

what version of smods do you have

tight hull
#

the newest one (i think)

#

I started moding balatro 2 days ago

#

idk if it got updated since then

red flower
#

are you making a texture pack?

tight hull
#

yes

vast night
#

i hope this is the last question: where in the fricking smods wiki can i find all colors in the g.c table

red flower
red flower
vast night
red flower
#

it's not all the G.C colors tho, only the ones in LOC_COLOURS

#

but should be most of them

inner folio
#

Why my card back texture always become like this ?

vast night
tight hull
tight hull
tight hull
red flower
#

and it might be causing problems

tight hull
#

I will try to change it then

#

thnx

final jewel
tight hull
# tight hull I will try to change it then

is this better?

Filename = "ReZero_Tarot-Balatro_v12.png"

SMODS.Atlas{key = "Joker", path = "Jokers_Subaru.png", px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas{key = "Tarot", path = Filename, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas{key = "Planet", path = Filename, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas{key = "Spectral", path = Filename, px = 71, py = 95, prefix_config = { key = false } }
red flower
chrome widget
#
    key = miracle_center,
    front = pseudorandom_element(filtered_cards, pseudoseed('csau_miracle_card')),
    skip_materialize = true,
})```

Am I doing something wrong with trying to create an enhanced card here? the front seems to apply correctly, but passing in the gold key (`m_gold`) is still giving me unenhanced cards
red flower
#

or set = "Playing Card" or set = "Enhanced"

chrome widget
#

that's.... strange

#

Why would I not just be able to pass in the enhancement key as the center key?

red flower
#

because there was already an enhancement field so i didnt change that idk

tight hull
#

and looks a lot cleaner

#

thnx

next timber
# next timber bumppp

bump.. please im getting desperate here ive been trying to make this joker look good all day i cant have it be ruined by editions..

next timber
tight hull
tight hull
#

what does this star mean?

glad osprey
red flower
#

it's a cog, means that it has a config

mild grove
#

For some reason the Bonus cards aren't appearing in the deck

tight hull
glad osprey
#

photochad

tight hull
tight hull
red flower
tight hull
wet chasm
#

Are there any requirements to start coding, I assume steam modded

red flower
red flower
wet chasm
vast night
vast night
# red flower i would help if i knew anything about shaders sorry 😞

I lied. This wasnt my last question. Why tf is this event getting stuck and not printing "I'm on 4" and "I'm on 5" (code directly taken from the cash out button, just replacing the cash out screen with my custom screen

        G.E_MANAGER:add_event(Event({
            trigger = 'immediate',
            func = function()
                print('I\'m on 4')
                if G.fates_wait_for_poll then
                    print('I\'m on 5')
                    G.fates_wait_for_poll:remove()
                    G.fates_wait_for_poll = nil
                end
                G.GAME.current_round.jokers_purchased = 0
                G.GAME.current_round.discards_left = math.max(0,
                    G.GAME.round_resets.discards + G.GAME.round_bonus.discards)
                G.GAME.current_round.hands_left = (math.max(1, G.GAME.round_resets.hands + G.GAME.round_bonus.next_hands))
                G.STATE = G.STATES.SHOP
                G.GAME.shop_free = nil
                G.GAME.shop_d6ed = nil
                G.STATE_COMPLETE = false
                return true
            end
        }))
    end
red flower
#

i dont see anything wrong there, is it not adding the event to the queue maybe?

vast night
#

how do i see the event queue

red flower
#

no idea

sonic cedar
#

would i say if v:is_suit in a for loop if im checking for a suit?

red flower
#

whatever you named the value in the pair

mild fractal
#

apologies if i'm being stupid i'm very new to this
i'm trying to check for a king being destroyed and thought
" if context.remove_playing_cards and not context.blueprint and
context.other_card:get_id() == 13 then"

would work but it isnt lmao

vast night
# red flower no idea

apparently this event is firing the whole time

        G.E_MANAGER:add_event(Event({
            func = function()
                print('Event Dolla Dolla')
                G.GAME.previous_round.dollars = G.GAME.dollars
                return true
            end
        }))
red flower
#

weird, the return true should stop it

vast night
vast night
mild fractal
#

ah okay ty

vast night
mild fractal
#

i just pulled it from vanillaremade's baron code so i thought it would work lmao

vast night
#

like this one in another function

                G.E_MANAGER:add_event(Event({
                    trigger = 'immediate',
                    func = function()
                        print('Event Alignment Offset')
                        if G.fates_wait_for_poll.alignment.offset.y ~= -7.8 then
                            G.fates_wait_for_poll.alignment.offset.y = -7.8
                        end
                    end
                }))
vast bough
#

does anybody have some good examples of jokers with variables or effects that happen at the end of each hand

red flower
vast bough
vast night
red flower
primal robin
#
-- Code to debug event queue
local callstep = 0
function printCallerInfo()
    -- Get debug info for the caller of the function that called printCallerInfo
    local info = debug.getinfo(3, "Sl")
    callstep = callstep + 1
    if info then
        print("[" .. callstep .. "] " .. (info.short_src or "???") .. ":" .. (info.currentline or "unknown"))
    else
        print("Caller information not available")
    end
end
local emae = EventManager.add_event
function EventManager:add_event(x, y, z)
    printCallerInfo()
    return emae(self, x, y, z)
end
vast bough
mild fractal
#

gahhh i still have to much to learn 😭

vast night
vast bough
#

like if a mod has a joker that does something similar at the end of hands

vast night
mint kettle
#

Hi, is it difficult to mod Balatro to change in-game sounds?

pastel torrent
#

method to detect if face card is played?

vast night
pastel torrent
#

thx

vast night
pastel torrent
#

also I passed and got accepted into college

#

hooray

chrome widget
#

Declare an SMODS.Sound with no prefix settings and a key matching a vanilla sound

#

It'll overwrite it afaik

#

(you can do similar things with shaders)

mint kettle
#

I want to add the binding of isaac tarot narrator when you use a tarot card

mint kettle
paper elbow
#

I followed the guide to install Lovely Injector and SMODS and it doesn't appear to be working. What do I need to look for troubleshootingwise?

mint kettle
#

And when wheel of fortune fails: wheel of...fortune?

vast bough
red flower
paper elbow
vast bough
#

like if you play flush five with only aces it would do the sound bite for the ace

red flower
paper elbow
#

One sec

formal quest
#

How can I check when any listed probability happens?

mint kettle
red flower
vast bough
red flower
paper elbow
#

Hold, on, I'm just stupid.

vast bough
paper elbow
#

I put WINEDLLOVERRIDE not WINEDLLOVERRIDES

#

Okay, I'm all good.

formal quest
red flower
#

yes, that function returns if the chance succeeds or fails and has what card did it as an argument

formal quest
#

How do I get the contained hand types before a hand is played?

chrome widget
#

You mean when cards are highlighted?

formal quest
#

Yeah

sullen brook
#

Is there a prefix list in the source code somewhere? Looking for the prefixes for challenges to work on my localization file, can't seem to locate one and I think it's what's breaking things. I've found for most cards, but not one for challenges

chrome widget
#

You'd probably want to hook the CardArea:ParseHighlighted function and use what it sends to evaluate play

sullen brook
#

AH, ok, and looks like ch is used for the v_text used as the description

primal robin
#

You know, I never asked for my code review. Maybe I should? trash

formal quest
chrome widget
#

In Lua, functions are variables, and functions not declared as being stored locally are automatically, implicitly placed in the global table. Hooking means storing the original version of the function locally, redeclaring the function with a new body, and then using the reference to the original as a limited type of inheritance

modern kindle
#

winterr!

chrome widget
#

Dilly!!!

modern kindle
#

hi my friend how are you

formal quest
#

It's not relevant to my question

chrome widget
#

👍 if you want to ignore fundamental information for applying it anywhere, up to you

formal quest
#

The question I asked was how Balatro's internals work with this. You giving me an irrelevant basic level answer is plain disrespectful.

spice wadi
#

i think the point that theyre making is hooking is hooking, it doesnt vary too much by function

primal robin
modern kindle
#

yea, winter gave a pretty solid answer without just giving the code for them

#

code is code and balatro doesnt magically treat hooks differently

chrome widget
#

When a woman gives an explanation about something: "that's just plain disrespectful"

#

Lmao

formal quest
#

That has nothing to do with this lmao

spice wadi
dreamy thunder
#

how does one make a card area

spice wadi
modern kindle
formal quest
#

I just can't figure out the syntax of CardArea:parse_highlighted. I copied https://forums.kleientertainment.com/forums/topic/129557-tutorial-function-hooking-and-you/ this example to the best of my ability but the syntax doesn't match up.

Klei Entertainment Forums

In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...

vast night
#

Where is the display name of the joker card stored? (G.jokers.cards)

spice wadi
formal quest
#

This is my attempt to figure out lua hooks

spice wadi
#

why is it so red
what are the errors

modern kindle
spice wadi
formal quest
spice wadi
#

i cant remember if cards store the localised text

modern kindle
#

i know i use ability.name but i coudlnt remember if that was an older way of doing it

formal quest
#

This isn't something where following the errors would actually fix it cause it's clearly so far off

modern kindle
#

so didnt wanna recommend poss bad prac

spice wadi
spice wadi
modern kindle
#

hooks dont go inside

#

yea

formal quest
#

Still some red outside the card

spice wadi
#

i think the best way of accessing it from inside the card is SMODS.calculate_context

spice wadi
#

probably space between function and brackets next line is there is still an error

primal robin
#

There's more incorrect things than correct ones trash

placid star
#

so i have a joker that checks if a card is in hand, if not it draws it. but when i have two of this joker it just draws the card twice and makes a ghost card. i tried wrapping this in a function and it didnt work either

formal quest
formal quest
primal robin
#
local cardarea_parse_highlighted_ref = CardArea.parse_highlighted
function CardArea:parse_highlighted(...)
  local result = cardarea_parse_highlighted_ref(self, ...)
  -- Your code
  return result
end
formal quest
#

Thanks

rotund sable
daring fern
placid star
modern kindle
#

and secondly you have wonderful eyes or something idk

paper elbow
#

How do I override default assets in a mod?

chrome widget
#

How do you instantly trigger a game over?

#

I tried setting the state to game over but afaik that doesn't actually do everything it needs to

red flower
#
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false
chrome widget
#

AH! Forgot to set the state completion

sonic cedar
#

so this should work right

daring fern
sonic cedar
#

i did not mean to change those actually

#

otherwise good?

daring fern
sonic cedar
#

right ik ik but like counter wise

#

will this count properly

red flower
#

if you're doing things in update you should probably also check if the card is in G.jokers

sonic cedar
#

ohhhhh true

faint leaf
#

how do i make a random number function for a '1 in whatever' thing

#

cause this just crashes when i click on the joker lmao

sonic cedar
#

pseudorandom('seed', min, max)

faint leaf
#

still getting a crash but for a different reason now

tepid crow
#

cuz you didn't define odds

faint leaf
#

im lowk a little unknowledgeable can you give like a basic rundown on how to do that

tepid crow
red flower
#

eremel said to not tell that to new modders yet so I'm just following orders o7

tepid crow
#

oh

#

fair enough

tepid crow
#

"just following orders sir"

tepid crow
#

with defining I simply mean x = y

faint leaf
#

hmmmmm

tepid crow
#

change the .odds to .chance

faint leaf
#

okay it works now awesome sauce

tepid crow
#

and you understand why, right?

faint leaf
#

pretty sure

#

okay i lied

tepid crow
#

lmao

faint leaf
#

now whjen i start a round

tepid crow
#

so that was a fucking lie

red flower
#

that's because you need a strict context check

sturdy compass
#

Oh yeah N huge props for fully finishing vremade!

red flower
#

thank you

#

im sure there's a lot of broken stuff there tho

sturdy compass
#

Nothing is ever bug free

faint leaf
#

okay i THINK i

#

cutting that short

#

its best i did

#

what SYNBOLL

red flower
#

that then in line 130 should be an and

faint leaf
#

this WILL be the LAST CRASH

sonic cedar
sturdy compass
#

WRONG

faint leaf
#

okay well its not crashing but shit is stiiiill broken

red flower
faint leaf
#

i WILL fix it myself though

sonic cedar
#

maximus 1.0 is out guys btw

sturdy compass
#

1.1 soon

#

Probably as soon as SMODS stable updates

sonic cedar
#

1.1... TOMORROW!

#

blackpanther gif

sturdy compass
#

I hate that I know which one you're talking about cuz I saw the same one for Deltarune

sonic cedar
#

DELTARUUUUNE

#

TOMORROWWW 🗣️

#

god i need to play 3/4

sturdy compass
#

Toma please do

#

it's so good

faint leaf
#

i just finished 3/4 the other day it was so good

supple crag
#

i rly like the enhancement, seal and edition decks, but i dont want the rest of cryptid, so can someone pls turn that into a mod for me?

faint leaf
#

ohhh my god i fixed my error

#

im a GENIUS!

sturdy compass
faint leaf
#

honestly how i feel

#

it was a simple error of just.. not setting a value after something had been done

subtle merlin
#

What does G.GAME.dollar_buffer do, exactly?

red flower
#

Dollars get updated in an event (to display the small animation over the text) but during scoring some jokers (like bootstraps) need the total money immediately so effects update the dollar buffer temporarily to let them work before the event runs

subtle merlin
#

oohhh, oki, ty!

faint leaf
#

okay ONE LAST THING what am i missing here 😢

red flower
#

line 141 should be outside the return
also I recommend getting the lua extension to autoformat the file with correct indentation

subtle merlin
sonic cedar
#

so how can i use THESE (left) in HERE (right)
would i just add card to the function params and then do an
if card.blahblah then do wtv?

(both of these are in the same file)

sonic cedar
red flower
#

but then why do you need to hook change_suit if you're already checking in update

sonic cedar
#

for the s-

#

gdi

formal quest
#

How do I get the contained hands of the highlighted cards?

red flower
#

like that

sonic cedar
red flower
red flower
formal quest
#

This is 4800 lines of code

red flower
#

i linked to the specific line

#

you might need to let it load a bit

formal quest
#

It doesn't

red flower
#

line 4628 then

red flower
sonic cedar
#

yeah but thats what i mean how would i do that

sonic cedar
red flower
#

how are you counting rn

sonic cedar
subtle merlin
red flower
# sonic cedar

ok instead of doing that update a local variable like local spadecount and then do card.ability.spadecount ~= spadecount

(then update card.ability.spadecount to the new count)

sonic cedar
#

let me set that up rq

faint leaf
#

i got the joker working properly!! thakn u N for all ur help ❤️

formal quest
# red flower line 4628 then

What can I do with the return value of get_poker_hand_info? I'm trying to get all the hands it contains, not just the "played" hand which is what Burnt Joker uses.

inner folio
#

What's the code to change the Texture of Enhancedments Texture and Jokers Texture game file ?

subtle merlin
red flower
sonic cedar
red flower
#

what's the full code

sonic cedar
red flower
#

local heartcount = 0

#

as well

sonic cedar
#

ok ok hold on

brittle tide
#

bump

daring fern
brittle tide
#

would you mind telling me how?

pastel kernel
#

is it possible to make a joker switch the suit of played hand?

#

cause i don't know how to implement that.

daring fern
subtle merlin
#

oh it's cash earned

#

nvm

sonic cedar
#

all good?

formal quest
#

How do I get the chips and mult of a hand type?

red flower
# sonic cedar

you need to set card.ability.***count = ***count after the last if

hasty mist
#

why does this becomes an infinite loop

red flower
idle plaza
hasty mist
#

ah

sonic cedar
hasty mist
#

does anyone know where the code is that's responsible for adding the hand's total score to the round score

red flower
#

after this end i mean

red flower
hasty mist
#

ty

fallow breach
#

is there a way to change whether chips or mult triggers first on a card with both

#

i mean i know it doesn't change anything but i think it looks nicer when mult goes then chips

inner folio
#

don't know why i always try add new Enhancedments Texture, the texture always become like in the game

red flower
fallow breach
#

that's what i have and it still was procing wrong

red flower
#

yes

#

that's not what i wrote tho

fallow breach
#

oh i see

sonic cedar
random sleet
#

does anyone more knowledgable on UI know how to "refresh" a displayed UI box? e.g. while a card is being hovered

red flower
#

what I do and what I've seen others do is to unhover and hover a card in code

#

idk if there's a better way

random sleet
#

dang

fallow breach
flat mist
#

Hmm ok what about a joker
Played hand is duplicated or destroyed

red flower
flat mist
#

Is this idea good

#

Played hand is duplicated or destroyed

fallow breach
#

based on what

#

a chance or first hand played, or what

flat mist
#

First played hand

fallow breach
#

i mean wouldn't that just be dna but better

flat mist
#

Yes 50 50 chance

fallow breach
#

okay

flat mist
#

But there will be risk for destroying

fallow breach
#

that would be weird to implement but you could do it

hasty mist
#

can i not use if statements in this scenario??? (lovely patch)

fallow breach
#

"1 in 2 chance to create a copy of each played card in first hand of round, otherwise each card is destroyed" or something like that

flat mist
#

Hmm ok

manic rune
hasty mist
#

hm

#

what should i do instead

manic rune
#

if statement outside the event?

hasty mist
#

can i just put the if statement outside the add

#

okay yeah

bold gyro
#

Hey y'all, I'm trying to replicate those speech bubbles that Jimbo uses, based on vanilla code and code from the Partner mod. I seem to be very close to getting it to work, but for some reason no text is showing up.

function G.UIDEF.tf_speech_bubble(input_key)
    local text = {}
    localize{type = "quips", key = input_key, nodes=text}
    local row = {}
    for k, v in ipairs(text) do
        row[#row+1] = {n=G.UIT.R, config={align = "cl"}, nodes=v}
        -- print("a")
        -- this part does not seem to run - text is empty?
    end
    local t = {n=G.UIT.ROOT, config = {align = "cm", minh = 1, r = 0.3, padding = 0.07, minw = 1, colour = G.C.JOKER_GREY, shadow = true}, nodes={
        {n=G.UIT.C, config={align = "cm", minh = 1, r = 0.2, padding = 0.1, minw = 1, colour = G.C.WHITE}, nodes={
            {n=G.UIT.C, config={align = "cm", minh = 1, r = 0.2, padding = 0.03, minw = 1, colour = G.C.WHITE}, nodes=row}
        }}
    }}
    return t
end
sonic cedar
formal quest
#

So this is my attempt at adding chips/mult of contained hands while selecting cards. It doesn't work

red flower
#

like, as a preview?

formal quest
#

Update: Doesn't crash but doesn't do anything either

red flower
#

you would need to use update_hand_text probably

formal quest
red flower
#

I would check how the game uses it, it's not very straightforward

sour garden
#

why does having the loc_var info_queue[#info_queue + 1] = {key = 'perishable', set = 'Other'} crash the game when i hover over it? when it's an error, it works just fine, but perishable crashes

#

oh wait, i have an idea as to why

formal quest
red flower
#

you can check the folder under lovely/dump too

faint yacht
formal quest
formal quest
faint yacht
#

That's the recommended way to "check" for a Joker instead of find_joker.

formal quest
#

Thanks. How do I use prefix with that?

faint yacht
#

Your modprefix.

formal quest
#

Do I include the j_x_

faint yacht
#

SMODS.find_card uses full keys, so yes.

pastel kernel
sour garden
#

is there an easy way to add a custom info_queue to a joker, or do i need to add something to a localization file

red flower
#

you do need to add it to a localization file

pastel kernel
sonic cedar
#

how do i check if the scoring hand is the lowest ranked one?
like, say i play a two pair of 2|2|5|5

i want it to focus on the pair of twos
cause that's the lowest ranked hand in scoring
(will only focus high card if you play a pair or a high card)

unborn bay
#

Note that you can individually go through the poker hands in the scored hand via context.poker_hands[poker_hand_name]

#

that includes pairs

#

its a table of tables

sonic cedar
#

or will it sometimes pick the 5s over the 2s

formal quest
#

I have a feeling these variables won't be the same for me though, so I'm trying to figure out what to replace them with

frigid cargo
#
SMODS.current_mod.set_debuff = function(card)
    if card and card.ability and card.ability.fainted == G.GAME.round then
      return G.STATE == G.STATES.SELECTING_HAND or G.STATE == G.STATES.HAND_PLAYED or G.STATE == G.STATES.DRAW_TO_HAND
    end

    if card.ability.name == "Wild Card" and next(find_joker('Natures Touch')) then return 'prevent_debuff' end

   return false
end

is this all i need for wild cards to not be debuffed? cause its not working

serene granite
#

how can you make the text of a card dynamically update for a card that uses Xmult. like for a scaling joker, i guess a good example is vampire. the text isnt updating 😭

sonic cedar
#

This Joker is supposed to destroy part of or all of the cards in your scoring hand, depending or not whether it contains a poker hand stored in type (in this case Pair) is this how that would work?

midnight coyote
#

how do i check if a blind is a boss blind

sonic cedar
bold gyro
#

does anyone have experience making those speech bubbles from Jimbo (for example in the tutorial)? i can't get text to show up for some reason

sonic cedar
#

id help more but im dead tired cat_stealing_sushi_then_flying

bold gyro
#

understandable

ripe nova
#

I'm trying to build a text-based interface for balatro e.g. for blind people / to let LLMs interact with balatro.
Things I'm currently working on but need help with -

  1. Getting the current state of the game
    1a. I'd love to be able to spit out all the cards that are in the hand, and which of them are currently selected
    1b. I'd love to be able to read where the game is, in the menus
    1c. Currently I'm exploiting the Balatro save system, reading the save data and converting it to Json - but this doesn't work in menus and can't tell me which cards are currently selected.
    1d. I'm thinking of using cheat engine to directly extract the game state by reading the game's memory.

  2. Being able to interact with the game from a command line
    2a. I've tried using the Typist mod; but I note that this only lets you interact with a limited number of cards (11, one for each key on the home row of your keyboard - probably not an issue for most players, but could prevent some power users from fully engaging with cryptid card shenannegans)
    2b. I've also toyed with emusating a gamepad but this wouldn't work unless I can read the current game state, including which cards are currently selected.

Anyone got any better advice for me re reading the state of the game and interacting with it from a text only interface?

median veldt
#

a few questions

  • what exactly does next() do
  • is there a relatively easy way to make a blind picture like i can code one but idk what to do to make the image
  • how do i change the icon of the mod, like the one that shows up in the mod menu it kinda looks like a tag
    sorry if that last one is in the docs, it sounds like it would be but idk i didnt see anything

gosh i wrote this like 5 hours ago but i forgot to hit enter 😭

gilded blaze
median veldt
#

i apologise for the probably very simple questions

#

thanksmuch

#

thats the big one the other two are jhust out of curisoity

gilded blaze
#

SMODS.Atlas{key = "modicon", path = "icon.png", px = 34, py = 34}

median veldt
#

thanks much x2

#

nevermind about the next thing for some reason i didnt piece together that its just a lua thing

stoic void
#

Is this what i do for the rank names?

hasty mist
#

is there a way to round numbers to the nearest hundred

#

math.floor and math.ceiling only seem to round to the nearest integer

stoic void
#

Divide the number by 100, round then multuiply by 100

#

50/100 = 0.5 rnd 0.5 = 1
1100 = 100
49/100 = 0.5 rnd 0.49 = 0
0
100 = 0

tall wharf
#

also yes do that if you just want to round numbers

hasty mist
#

that seems to do nothing

stoic void
#

oh

hasty mist
#

still not rounded

stoic void
#

round it after dividing

#

silly

hasty mist
#

oh

stoic void
#

1x2/2 = 1

stoic void
median veldt
stoic void
#

Making this

#

I just want to know if that is what i put for the numbers

#

The face cards are sorted ofc

median veldt
#

i mean if you're talking the cards' internal numbers you don't put them in strings and it's just
2 thru 14 (ace)

#

the numbers

stoic void
#

Oh

median veldt
#

what exactly are you doing with them tho

stoic void
#

so "2", "3" ..... "13", "14"

#

no jack queen king ace

median veldt
median veldt
stoic void
#

really? ok

median veldt
#

so that they are numbers

stoic void
median veldt
#

and not text

stoic void
#

ok

median veldt
#

ok granted i dont know how to make a deck skin

#

but im just going off of my knowledge of card IDs

stoic void
#

Ok

#

Ill come back in a sec

#

thx

median veldt
#

hold up

#

wait

#

i'm looking at the code of a deck skin i have

#

you were right

#

so long as something like this is going on i think

#

i do not know

#

lemme look at the example

stoic void
#

So i do add quotes

#

ok

median veldt
#

look at this

#

you should find your answers

stoic void
#

ok

median veldt
stoic void
#

"2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"
?

median veldt
#

yeppers

#

are you actually replacing all of those cards tho

#

or just the face cards

stoic void
#

Im making all of them

median veldt
#

alrigh

stoic void
median veldt
#

i love this a lot actually

stoic void
#

thx

#

I have some things in my folder

#

These are high res ofc

gilded blaze
# stoic void

Lusty Pareidolia: All cards with Hearts suit are considered face cards

median veldt
#

I could totaly make that

#

Can I steal that and put it in my big balatro mod because I have zero ideas for jokers and that would actually be pretty decent

#

i can credit u if u want

gilded blaze
#

you don't have to

#

it was just a faint idea of mine based on the texture

#

since they all look like face cards

median veldt
#

hell yeah

stoic void
wet chasm
#

Anyone know if steam modded works on Xbox game pass balatro, last time I heard it was in progress

stoic void
wet chasm
#

Got my ass

gilded blaze
#

gamepass got hands

#

you see

stoic void
wet chasm
molten musk
#

hello chat

vast night
flat mist
#

during testing how to make a joker to always appear in the first shop

shell timber
#

you can just use debugplus to spawn it

molten musk
#

so i tried reading and saving seals in a table and then printed the output
its gave me 0 every time even tho i have seals
whats the issue?

daring fern
molten musk
#

what do i use then?

#

i just want to be able to read seals and call them back, similar to how "The idol" calls cards

daring fern
molten musk
#

now it prints out "nil" instead of 0

#

@daring fern still here?

daring fern
# molten musk

Yes, playing_card doesn't exist outside of the loop, and I was referring to using playing_card.seal

molten musk
#

oh

#

ok let me try that then

#

it worked

#

now i need to make it choose one of the seals in the table randomly, count how many are there, and give money based on that number

stoic void
#

Why cant i code D:

molten musk
#

oh, hi lusty

stoic void
#

hi

molten musk
stoic void
molten musk
#

joking, u can learn

stoic void
#

What is wrong with thiss

molten musk
#

whats the issue? does it crash? not work?

stoic void
#

No, it's this

#

This is the png used

#

Ive got the 4 files correctly named

molten musk
#

so whats the issue?

#

is it repeating the 2s?

stoic void
#

yeah

molten musk
#

hmm...

#

let me look it up real quick

stoic void
formal parrot
#

Heyy devs

stoic void
#

Hi

molten musk
#

hello heaven

molten musk
stoic void
#

My deck sskin is broken

molten musk
formal parrot
#

Oh hello

formal parrot
molten musk
stoic void
#

Also

#

The 2,4,3,2 is meant to be ace,king,queen, jack

molten musk
#

and flips 4 and 3 pos

formal parrot
#

Mhm

#

You can use aiko’s mod and change some files , some stuff on the deck skin is outdated as I remember

molten musk
#

some how i feel there is something wrong with the code

#

dont know where

stoic void
#

I should flip the order of the cards

#

Ill do that later because it isnt going to crash my game, i tested it already

molten musk
#

...

#

do it now

flat mist
#

So I install debug plus how to spawn any jokers during a run

molten musk
#

yes

formal parrot
stoic void
#

Done

molten musk
molten musk
stoic void
#

I did

#

I flipped it after testing

molten musk
#

oh i see

#

so the issue is something else

formal parrot
# molten musk

hc_atlas = hc_registered and atlas_key..'_hc' or atlas_key..'_lc',

#

Try this

#

In the last one

stoic void
#

Ok

frigid cargo
#

what does card.abillity.fainted do?

frigid cargo
#

nvm

formal parrot
formal parrot
molten musk
formal parrot
#

Put it in a variable and

#

Do a for

#

To count how many are they

molten musk
#

hmm, i thought of pseudorandom

stoic void
#

It did nothing :(

molten musk
#

ig that code is not yours...

formal parrot
stoic void
#

If not, it made it so i cant use low/high contrasrt

formal parrot
#

Aiko had a mod that added deck skin and its up to date you can change the asset files and some optional stuff and it will work

#

They don’t mind

molten musk
#

yeah do that

stoic void
#

Ok

#

What do i put for the key?

#

Is it the name of the deck skin?

formal parrot
#

Make sure to rename it in other instances of appearance in code

stoic void
#

Ok

formal parrot
#

If you’re using vscode just click it and it’ll show you

frigid cargo
#

im tryna do a function to check for a wild card, can i use if card.ability.name == "Wild Card" is that even a thing?

stoic void
daring fern
formal parrot
#

😭you might wanna use vscode

#

Its free

frigid cargo
#

how can i make it so the function checks for a specific joker

molten musk
daring fern
subtle merlin
#

llllllooooooooonnnnnnngggggggg sigh if i had a penny every time i've fixed and then forgot how to fix this issue i'd be rich enough to cure transphobia-

frigid cargo
formal parrot
#

I think

#

I might be stupid

daring fern
molten musk
#

love u thanks

#

heaven

stoic void
molten musk
#

all hail teacher

formal parrot
#

You know your code isn’t fucked up when you don’t get a ⁉️‼️ as a reaction

molten musk
#

your "😭 " are tears of joy right?

formal parrot
molten musk
#

just making sure haha

stoic void
#

tee hee

formal parrot
#

Tell me if you have any other troubles

#

:>

stoic void
#

<3

#

My mod crashed the game

subtle merlin
stoic void
#

i forgot a bracket

#

It says line 10 and im like

#

oh yeah

#

no closed bracket

#

Now it is as brocken as last time

#

What did i do?

formal parrot
#

They mean

#

,

#

When they said expected }

stoic void
#

What did i do man

#

Git hub dosent like me

inner folio
#

can we moding the joker card in the intro

formal parrot
stoic void
#

We can modding the joker

molten musk
formal parrot
#

Don’t be mean some people don’t have the greatest english skills :>

molten musk
#

what do i change to?

formal parrot
#

The table that contains the seals

#

Your local table 😂

stoic void
#

How on earth have i got someone elses code wrong

molten musk
#

crashes, tells me context is ...

#

i think i know, it needs calculate, right?

formal parrot
#

Context.end of shop should work

#

Probably

frigid cargo
#
if SMODS.has_enhancement(card, "m_wild") and next(SMODS.find_card('j_batrocities_NaturesTouch')) then 
            return {
                'prevent_debuff'
            }
        end

will this work if i just slap it on calculate of the joker (highly doubt) (idek if the code is proper)

stoic void
#

atlas_table = 'ASSET_ATLAS',
what do i do for atlas_table

molten musk
#

calculate is not calculating lol

stoic void
frigid cargo
#

whats the difference between SMODS.add_card(t) and SMODS.create_card(t)?, and when would i use either?

crisp coral
#

add_card automatically emplaces the card to the area and runs add_to_deck

frigid cargo
#

ah i see thanks

#

but what about create_card?

crisp coral
#

SMODS.create_card is the same as base create_card

frigid cargo
#

ah without the add_to_deck i see thanks

stoic void
subtle merlin
#

I keep trying to return a card to the hand from scoring but it always comes back flipped...

tight hull
#

what does that mean?

stoic void
primal robin
#

syntax error

stoic void
#

How do i fix it

tight hull
tight hull
stoic void
#

Im trying to make more than the face cards work

stoic void
tight hull
#
    hc_atlas = "vocalatro_hearts_2",```
#

try using your keys instead of that?

#

i dont know much abt deck skins

tight hull
#

could you send what mod did you copy from?

stoic void
tight hull
#

dont mind this

tight hull
#

and then it stopped?

stoic void
#

Not quite

#

It worked with fac cards only

#

the i added more ranks and it broke for no reason

tight hull
#

ok

stoic void
#

Also your code crashed my game

#

hc_atlas = "hearts_2",

shell timber
#

...why does your deckskin reference vocalatro

tight hull
shell timber
#

also the commas

#

get rid of the commas

#

in the main scope

stoic void
#

like this?

shell timber
#

yeah

#

...are you editing in github

stoic void
#

yes

shell timber
#

,,,,,

stoic void
shell timber
tight hull
stoic void
#

Done

shell timber
#

install an actual code editor ,,,,,,

stoic void
#

no

shell timber
#

your loss

stoic void
#

I have parental controls

shell timber
#

the ever-reliable notepad:

stoic void
#

I use that to edit my code occasionally

#

If its small i do

#

actaually

#

yeah sure

#

Still have a problem

tight hull
snow vale
#

why wont this destroy?

#

(enhancement)

stoic void
polar parrot
#

how do i change this so it shows the correct joker

snow vale
#

what atlas do you ahve?

#

have

#

you have to set the correct position so it transforms into the joker for that position

#

in your atlas

#

like

stiff locust
#

X = 0 and Y = 0 is the top left corner of your spritesheet

snow vale
#

rn, x=0 y=0 here is the first card

stiff locust
#

increase X by 1 to go right by 1, increase Y by 1 to go down by 1

snow vale
#

x=1, y= 0 is the second card

#

x is the row and y the column

polar parrot
#

and which corner do i have to put in of my joker

snow vale
#

depends on your atlas

#

can we see the spritesheet you're using?

polar parrot
snow vale
#

which one do you want your joker to show?

polar parrot
#

the flower

snow vale
#

then use {x=1, y=0}

polar parrot
#

my games loading fine, but my mod isnt appearing on my mod list nor is the joker appearing in the collection

snow vale
#

can you show us your mods folder?

tight hull
#

why does it show error?

snow vale
#

please switch to json file

#

header is a bit bad

tight hull
#

you mean to put the header in json?

snow vale
#

no

#

i mean

tight hull
#

the whole file?

snow vale
#

this

tight hull
snow vale
#

yeah

tight hull
# tight hull

this is an temporary mod so I didnt want to do that but sure

snow vale
#

tho it's way better to use that

tight hull
#

ok

polar parrot
snow vale
polar parrot
snow vale
#

enter it

tight hull
snow vale
stoic void
polar parrot
snow vale
#

now enter the main

tight hull
#

shouldnt the lua file be named the same as the folder?

snow vale
#

nah

#

the json must

#

i think

tight hull
#

no