#💻・modding-dev

1 messages · Page 277 of 1

rancid bridge
#

i swear to god if i forgot another comma somewhere

daring fern
rancid bridge
#

i forgot commas.

#

please... please just let me be happy....

thin anchor
plush cove
#

you need to put return after the info queue

#

return means the end of a function

rancid bridge
thin anchor
#

i did not know that

daring fern
#

Replacing prefix with your mod prefix.

rancid bridge
#

either that or i lose my mind

daring fern
rancid bridge
#

alright

#

where's the lua extension

red flower
normal crest
#

sum neko

#

meow

red flower
#

sumireko

digital niche
#

ok so i know how to make most of the stuff like enhancements, seals, jokers, consumables etc but where do i even start on the code itself? by making the thing i want? by setting something before?

rancid bridge
#

mhm. that helps.

red flower
digital niche
rancid bridge
#

i just forgot an "end"

thin anchor
#

never making a consumable again this took me 2~ days

digital niche
digital niche
red flower
thin anchor
digital niche
thin anchor
#

yeah a little

cerulean rose
#

how would i go about adding a joker from another mod to my ObjectType?

red flower
#

but maybe theres a cleaner way

cerulean rose
#

whats v supposed to be

red flower
#

oops wrong code

red flower
willow void
#

question for you gamers: is it possible to change the text/name of a joker once it has been bought?

winged igloo
winged igloo
willow void
red flower
#

if not then you can use generate_ui

willow void
#

ok, cool thanks!

cerulean rose
gleaming summit
#

ok I updated it to use the new stuff
I still have the same issue of not being able to detect when I'm selling a card and not itself
the calculate for the joker has just this code and when I try selling itself or any other card it always says false
so is there another way of checking for the joker being sold not being itself? (I've tried context.selling_card ~= card and it also doesn't work)

digital niche
#

wait what should the atlas be? im a little confused

rancid bridge
#

having a slight issue...
it does not render in game

red flower
rancid bridge
red flower
gleaming summit
thin anchor
gleaming summit
rancid bridge
#

i have it laid out like this
what am i doing wrong

#

does the y value need to be negative since it's going into the row below the top one

stark geode
#

what are you doing?

thin anchor
#

pillar john

rancid bridge
#

i just want them to render in game but they're invisible

sonic cedar
#

can you show

stark geode
#

odd

digital niche
#

what should the px and py be in the atlas? ik what they do but im not sure how i should set it

rancid bridge
#

i don't think anything is wrong with my pos or soul_pos variables

stark geode
#

full code?

#

atlas included

red flower
digital niche
#

its tarot card

#

is it that?

rancid bridge
stark geode
#

basic template for jokers

red flower
normal crest
#

unrelated to your current issue

stark geode
#

like this

cerulean rose
stark geode
normal crest
#

it is indented, discord is just weird

#

click view whole file

digital niche
rancid bridge
stark geode
#

now that i have it downloaded it looks better lol

normal crest
errant fulcrum
#

Does context.other_card:get_id() return a string?

normal crest
#

number

digital niche
errant fulcrum
#

What about for the face cards and aces

normal crest
#

also id

#

a jack is id 11 for example

errant fulcrum
#

Gotcha

red flower
cerulean rose
red flower
digital niche
#

yeah

daring fern
digital niche
cursive ocean
#

does anyone know where one could get a data set of the jokers and their effects and all that?

red flower
stark geode
red flower
stark geode
#

by accounts this should work

cursive ocean
#

hm like a data file a csv or json. ill even take an xml

digital niche
rancid bridge
#

why is mine evil and scary and not working then

red flower
stark geode
rancid bridge
#

alright let me bundle it all in a zip rq...

red flower
normal crest
sonic cedar
digital niche
rancid bridge
stark geode
#

the atlas looks fine

digital niche
stark geode
#

it looks like mine

normal crest
#

okay that looks fine

rancid bridge
stark geode
manic rune
#

good morning chat

sonic cedar
#

unrelated but does smods still use glass_shattered as a context, or was that lumped into destroying_card?

red flower
#

morning bepis

sonic cedar
#

hi bepis
hi belis
hi craig
hi bella

manic rune
#

destroying a card through context.destroy_card seems to still have the glass shatter effect

red flower
manic rune
#

which is nice

sonic cedar
#

and ill just have to specify i want glass

#

right

manic rune
#

mjm

#

mhm

digital niche
# red flower can you post the crash log

[{
"resource": "/c:/Users/eurea/AppData/Roaming/Balatro/Mods/I might be making a mod/a.lua",
"owner": "generated_diagnostic_collection_name#0",
"code": "undefined-global",
"severity": 4,
"message": "Undefined global sendDebugMessage.",
"source": "Lua Diagnostics.",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 17
}]

sonic cedar
#

look at me learning hwarhwarhwar

manic rune
#

awr awr awr awr

sonic cedar
#

I DIDNT UPDATE MY NAME

red flower
digital niche
#

editor warning is that little "!" sign right?

red flower
#

yeah you can put SMODS in your development folder if it annoys you

digital niche
#

oh okok, ty!

red flower
#

(or rather open a folder with smods in it, dont put smods inside your mod)

manic rune
#

include: "fucking smods itself"

#

:3

midnight coyote
#

hi guys

manic rune
#

hiii basil

stark geode
hard flume
#

bells and whistles complete

stark geode
rugged pier
#

bringing this back to implement now

stark geode
#

it works fine on my balatro

#

but not on thiers

midnight coyote
#

just making my game on the godot

#

baking lighting takes like 3 minutes so i’m just lazing off

red flower
digital niche
#

i want to make a tarot card where you can choose 2 different cards that have different editions (like one king wiith steel and one queen with lucky) and fuse those 2, i would need to make both be destroyed then add one king with the edition that would be steel+lucky to the deck right?

#

looks like the easier way

#

at least to me

red flower
#

that would get rid of any other stuff on them but if you're fine with that then yeah

stark geode
digital niche
#

and one to fuse everything from both, but thats for later wwhen i get to spectral cards

#

so i would need to set the fusion result of all the fusions id want to have (like the editions i would add) first and then do the tarot things right?

stark geode
#

when you turn on pixel art smoothing they stop rendering

#

i keep mine off

daring fern
rugged pier
#
calculate = function(self, card, context)
        if context.before and not context.blueprint and not context.retrigger_joker then
            for k,v in ipairs(G.jokers.cards) do
                if v.config.center.rarity == 'csmr_preserver' and v.ability.set == 'Joker' and not v.debuff then
                    card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            v:juice_up(0.3, 0.4)
                            return true
                        end,
                    }))
                    return {
                        message = localize({
                            type = "variable",
                            key = "csmr_xmult_gain",
                            vars = { card.ability.extra.xmult_gain },
                        }),
                        colour = G.C.MULT,
                    }
                end
            end
        elseif context.joker_main then
            return {
                message = localize({
                    type = "variable",
                    key = "a_xmult",
                    vars = { card.ability.extra.xmult },
                }),
                colour = G.C.MULT,
                Xmult_mod = card.ability.extra.xmult,
            }
        end
    end

now it is only taking the first joker and ignoring the rest?

manic rune
#

:3 i cant read on phone

#

ghh

#

how can u do this N'

#

😭

rugged pier
manic rune
#

oh wait

#

ur returning in the for loop

stark geode
#

2x (left) 1x (right)

manic rune
#

that completely stops the loop from running at the first joker

rugged pier
#

okay

#

im going to

manic rune
#

use SMODS.calculate_effect instead

rugged pier
#

use a variable to count

#

oh

sonic cedar
rugged pier
stark geode
manic rune
#

its like returning, but doesn't interfere with ur code ig

stark geode
#

someone elses

#

im helping debug

rugged pier
manic rune
#

ex:
SMODS.calculate_effect({xmult = 1.5},card)

rugged pier
#

can i return a message as well

manic rune
#

increases mult by x1.5

manic rune
#

format in {} is exactly like how you would return stuff

sonic cedar
thin anchor
#

what do yall think

manic rune
#

no clue what that is :3

sonic cedar
thin anchor
#

its an art

manic rune
#

but looks cool, the blue inside could be darker tho

thin anchor
#

ok

manic rune
sonic cedar
rugged pier
sonic cedar
thin anchor
#

ok

manic rune
#
if context.destroy_card then
   if SMODS.has_enhancement(context.destroy_card,"m_glass") then
      --do stuff
   end
end
#

actually, thats wrong

#

uhhhhh

sonic cedar
#

no wait i remember stone

manic rune
#

check how glass joker works, i completely forgot how to check whether the card is being destroyed or not 💔

red flower
sonic cedar
rugged pier
manic rune
#

what is it supposed to do again

#

:333

red flower
sonic cedar
manic rune
#

surely

rugged pier
red flower
#

yeah

manic rune
#

oh

lavish lake
#
poll_question_text

What might smoke cards do?

victor_answer_votes

3

total_votes

3

victor_answer_id

1

victor_answer_text

1.5X mult but dissolves after 3 rounds

manic rune
#

use context.glass_shattered then

red flower
manic rune
#

:3

rugged pier
#

awesome

red flower
#

yeah it does it for you

tawny narwhal
#

Why??? Am I a mega goober?

    key = 'singular',
    loc_txt = {
        name = 'Singularity',
        text = {
            "Squares the Mult",
        }
    },
    config = { extra = { Xmult = 1 } },
    rarity = 1, -- Rare rarity
    atlas = 'singularityatlas',
    pos = { x = 0, y = 0 },
    cost = 1, -- Adjust cost as needed
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.Xmult } }
    end,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                message = localize { type = 'variable', key = 'a_xmult', vars = { squared_mult } },
                mult_mod = squared_mult  -- Apply squared multiplier
            }
        end
    end
}
#

Bruh I cut down the vid, why is this the uncut version...\

manic rune
#

whats squared_mult

tawny narwhal
#

Holy moly

#

I am a mega goober

#

old variable I changed...

rancid bridge
stark geode
#

good thing i asked for the whole mod lol

red flower
stark geode
#

mfing spacebar misbehaving

tawny narwhal
#

I'm still learning lmao

red flower
#

I'm forgetting

stark geode
#

i needto setup the returns for my jokers

rain slate
#

If I'm doing ```lua
SMODS.ObjectTypes["Joker"].rarities[4].weight = 0.02

rancid bridge
#

also one of the jokers is not working properly
great... 🥹

junior lily
#

i scaled the 1x up by 2 using a website why is it so blurry

sonic cedar
#

"i scaled the 1x up by 2 using a website"

junior lily
#

yes idk how to do it otherwise

rancid bridge
rain slate
#

you need nearest neighbor

sonic cedar
rugged pier
junior lily
rancid bridge
sonic cedar
#

not the resize

junior lily
#

oh

#

krita

#

the 1x looks fine

#

ignore square that was just from ctrl key

thin anchor
#

im going to notice that square

sonic cedar
#

i dont know aanything about krita pensive_cow

junior lily
#

how could you

rancid bridge
#

why is the joker text so blurry

junior lily
rain slate
#

because by default it will use something like bilinear and bicubic and those don't work too well for pixel art

rancid bridge
thin anchor
rancid bridge
#

if you have over 20 bucks to spend you can get aseprite

rain slate
#

you can also compile aseprite yourself

thin anchor
#

yeah that too

rain slate
#

I think

rancid bridge
rain slate
#

if you don't want to spend over 20 bucks on it

thin anchor
#

someday i will do that because im a penny-pincher

stark geode
#

or you can use ms paint

junior lily
#

does it have an upscale thingy on its own

rain slate
#

krita also has a resizing feature

#

just so you know

rancid bridge
stark geode
#

the paint resize feature is so ass

#

im going to use a python script

junior lily
rain slate
#

and you'll be good

stark geode
#

-# def didnt lift it off the cryptid github

unkempt thicket
#

I use kirta for art and resizing

red flower
rancid bridge
#

i.. want it to detect all vanilla enhancements

rain slate
#

nice

stark geode
red flower
junior lily
#

much better

stark geode
#

crazy how diverse the modding community for this game is

junior lily
#

are added jokers automatically able to be bought in the shop

red flower
red flower
junior lily
#

alright

#

if its legendary its pulled from soul right

red flower
#

yeah

junior lily
#

alrighty then

rancid bridge
#

accidentally deleted the then

#

yay it works!

#

i put enchanced instead of enhanced 😭

rugged pier
#

this feels a little...weak for legendary

#

why just even, make it every enhanced numbered card

rancid bridge
#

you may be right...

rugged pier
#

wheres the fun in b a l a n c e

tall wharf
#

omg

tawny narwhal
#

What is the name for the value of the current mult when scoring?

#

I'm as lost as a wet spoon rn

rugged pier
crisp coral
#

mult

rancid bridge
#

and enhancements are like colors and fun

tawny narwhal
#

so when I config Xmult = mult for the calc, that should work, right?

rugged pier
rugged pier
rancid bridge
tawny narwhal
#

wait I'm testing it

rugged pier
crisp coral
#

are you doing xmult equals to current mult

tawny narwhal
#

My friends say I sometimes use weaponised incompetence, but rn this is just straight up incompatence

tawny narwhal
crisp coral
#

i guess

tawny narwhal
#

mmmmm it gave me x1

rancid bridge
tawny narwhal
# rugged pier wdym, show me your calculate function
    config = { extra = { Xmult = mult } },
    rarity = 1, -- will be Rare/legend rarity
    atlas = 'singularityatlas',
    pos = { x = 0, y = 0 },
    cost = 1, -- Adjust cost
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.Xmult } }
    end,

    calculate = function(self, card, context)
        if context.joker_main then
            local squared_mult = card.ability.extra.Xmult ^ 2
            return {
                message = localize { type = 'variable', key = 'a_xmult', vars = { squared_mult } },
                Xmult_mod = squared_mult
            }
        end
    end
}
#

wait why have I local'd my square

#

idk

rancid bridge
tawny narwhal
#

take me back to signal analysis

stark geode
#

yo this resize python script go crazy

rancid bridge
#

do i just get rid of this part of the card check thingy

#

the rest is uh

rugged pier
rancid bridge
#

so would it be context.other_card:not is_face()

tall wharf
#

not card:is_face()

rugged pier
#

what they said

tall wharf
#

I'm not that smart

#

i might be misremembering things

stark geode
#

my latest additon

night juniper
#

just wanted to come back and say thank you for the help since i disappeared after you made the suggestion 🙂

rugged pier
tall wharf
stark geode
rugged pier
stark geode
tawny narwhal
#

Ugh I was trying to be stubborn

#

But you right

rugged pier
# stark geode +1 handsize

:0 is there an overflow? like does it physically increase handsize or does it just bring one from deck but go over handsize

stark geode
#

typically i do one joker and one feature

#

so PNA and rarity

rancid bridge
#

again: i'm a little silly so expect me to have done this wrong

stark geode
rugged pier
#

so it should be context.other_card:is_face()

rancid bridge
#

alright

tall wharf
#

not context blah blah

rancid bridge
#

so this, then

rugged pier
#

maybe should work, try it

stray warren
#

Is there a way to store values onto a Blind like the config for Jokers? I don't see that on the Wiki.

#

other than just adding an attribute to it at declaration

tall wharf
#

i put shit in blind debuff

stray warren
#

I guess that would work lol

rancid bridge
rugged pier
#

yay

rancid bridge
#

now i need to change the description hang on

rugged pier
#

new idea for joker brb

rancid bridge
rugged pier
#
if self.ability.name == 'Stone Joker' and self.ability.stone_tally > 0 then
                            return {
                                message = localize{type='variable',key='a_chips',vars={self.ability.extra*self.ability.stone_tally}},
                                chip_mod = self.ability.extra*self.ability.stone_tally, 
                                colour = G.C.CHIPS
                            }
                        end
``` this is the implementation for stone joker in Balatro, but is self.ability.stone_tally something i can use in my mod with 
```card.stone_tally```?
modern kindle
#

is there a good way i can make a blind take note of the scored hand and then either subtract that amount, make it 0, or leave it untouched?

im attempting to make a blind that rolls against the player and if the blind wins then the chips are instead subtracted from the total chip count instead of added, if the roll ties then it makes the scored hand worth 0, and if the player wins its the normal score of the hand

night juniper
stray warren
night juniper
#

functions/state_events.lua:1049

slender bay
#

So it's apparently scoring the queens again after the round ends and the score bleeds over to the next round

modern kindle
#

cause i use this for some of my jokers as well

sturdy compass
#

This is so janky but it actually works lmfao

night juniper
#

you need to patch into it or diff G.GAME.chips before and after

cerulean rose
modern kindle
#

yea ill have to look into which works better and go from there
i am probably shrimply tired rn and just not comprehending shit as i should

sturdy compass
#

Just gonna check if there are any duplicates then. Thanks for the catch

thin anchor
#

why am i making this many enhancements blueprint

tawny narwhal
#

Maybe a basic question, where can I find the names of all the different hand types and jokers etc?

#

Specifically High Card hand

rapid stag
#

how can i check if a card has a seal cirThink

jolly ruin
#

holy shit im in the wrong chat

#

im dumb

#

i will keep this here as a reminder that im dumb

tawny narwhal
#

lmao no prob

rapid stag
digital niche
#

i can add things like a way of knowing some card is a specific thing, like there are "food" and "candy" cards in cryptid to playing cards?

#

without those things being enhancements itself

night juniper
digital niche
thin anchor
#

wow

#

wowies!

digital niche
#

im making fusion of all the normal enhancements

thin anchor
#

oh thats cool

digital niche
#

like, bonus+bonus, bonus+mult, bonus+wild and it goes on

#

im rn seeing what the things could make

thin anchor
#

i like that

digital niche
#

i just dk what wild+wild could make yet

rapid stag
# night juniper print(card.seal)

do you know how i can apply a seal to a card? and if that method works on jokers cirNod i imagine it should since jokers have the same structure as cards cirDerp

cerulean rose
#

check how basegame does it balatrojoker

night juniper
rapid stag
night juniper
rugged pier
#
calculate = function(self, card, context)
        if context.joker_main and card.ability.extra.stone_tally > 0 then
            return {
                mult = card.ability.extra.stone_tally * card.ability.extra.mult_mod
            }
        end
        if context.before and not context.blueprint then
            card.ability.extra.stone_tally = 0
            for k, v in pairs(G.playing_cards) do
                if v.config.center == G.P_CENTERS.m_stone then 
                    card.ability.extra.stone_tally = card.ability.extra.stone_tally + 1
                end
            end
        end
    end

why could this be making my joker file unrecognizeable? is there any mistake in this code

sturdy compass
#

Is there an error or crash report?

rapid stag
#

i see cirDerp i was looking to see how the spectral do it, but couldn't find their code that calls the function

rugged pier
cerulean rose
sturdy compass
#

^

#

Pleas

rugged pier
rapid stag
#

they might want the full crash log cirBox

rugged pier
#
local mod_path = '' .. SMODS.current_mod.path
local function load_folder(folder)
    local files = NFS.getDirectoryItems(mod_path .. folder)
    for i, file in ipairs(files) do
        SMODS.load_file(folder .. '/' .. file)()
    end
end

load_folder('src/joker')
sturdy compass
#

well what's line 96 in cosmere.lua

rugged pier
#

line 96 is SMODS.load_file(folder .. '/' .. file)()

#

so my lua file is not compiling or something?

cerulean rose
#

yeah seems like a syntax error

tawny narwhal
#

whenc checking poker hands what is the name for High card? Surely There's somewhere that has all this stuff listed...

rugged pier
#

cannot for the life of me figure out whats wrong though, i checked every loop, if statements, etc

cerulean rose
#

send the whole file

rugged pier
#
--Hammond: This Jokers gains +4 Mult for each Stone Card in your full deck
SMODS.Joker {
    key = 'hammond',
    atlas = 'scadrial',
    pos = { x = 0, y = 0 },
    rarity = 'csmr_preserver',
    cost = 4,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    config = { extra = { mult_mod = 4, stone_tally = 0 } },
    loc_vars = function(self, info_queue, card)
        return { 
            vars = { 
                card.ability.extra.mult_mod,
                card.ability.extra.stone_tally * card.ability.extra.mult_mod,
            } 
        }
    end,
    calculate = function(self, card, context)
        if context.joker_main and card.ability.extra.stone_tally > 0 then
            return {
                mult = card.ability.extra.stone_tally * card.ability.extra.mult_mod
            }
        end
        if context.before and not context.blueprint then
            card.ability.extra.stone_tally = 0
            for k, v in pairs(G.playing_cards) do
                if v.config.center == G.P_CENTERS.m_stone then 
                    card.ability.extra.stone_tally = card.ability.extra.stone_tally + 1
                end
            end
        end
    end
}

This is the only new thing in this file

sturdy compass
#

How do you know this is the joker that's causing it?

rugged pier
#

this is the one that broke it

crystal snow
#

is there a way to get a table of all the jokers in the game? (i'm looking to get all the keys)

sturdy compass
#

I think G.P_CENTERS holds them all (along with all consumables)

rugged pier
sturdy compass
#

Have you tried removing the file from your folder just to experiment to see if it really is that causing the issue?

#

If you can 100% confirm it's this file that's the problem it will help a ton

manic rune
#

have u tried using assert to load ur file

#

:3

sturdy compass
#

belis loves to assert dominance

rugged pier
#

oh my god

#

im such a ding dong

rugged pier
#

i removed a condition in an if statement and forgot to remove "and" from that condition

sturdy compass
rugged pier
#

sigh

rugged pier
#

but

#

what if the user adds new stone cards, the joker description wont auto update to reflect the new stone cards

#

like the stone joker does in real time

#

what context would i use?

sturdy compass
#

You wanna do that in an update function instead of calculate

rugged pier
#

theres an update function??

sturdy compass
#

Check the API methods

stark geode
#

I wonder if I could make a joker that just rips wheels of fortune

#

Like a specific number

rugged pier
#

thank you

sturdy compass
#

It's how I have my Minimalist Joker up and running

sturdy compass
rugged pier
sturdy compass
#
update = function(self, card, dt)
    local stg = card.ability.extra
    if G.STAGE == G.STAGES.RUN then
        stg.chips = stg.base_chips
        for k, v in pairs(G.playing_cards) do
            if next(SMODS.get_enhancements(v)) and stg.chips > 0 then
                stg.chips = stg.chips - stg.dChips
            end
        end
    end
end
rugged pier
#

goat

sturdy compass
#

Should be able to pretty easily adapt that to check for stone cards

rugged pier
sturdy compass
#

That should work I think

sturdy compass
#

That's just a way to make accessing card.ability.extra more convenient for myself

rugged pier
#

awesome

sturdy compass
#

so I'd just have to type stg instead of card.ability.extra

rugged pier
#

makes sense

sturdy compass
#

Thank you random person in chat like a month ago for enlightening me

radiant plank
#

hey for the context.selling_card how do i get the sell value of the card being sold? im only seeing it for the joker that owns the calculate function

rugged pier
#

thank you so much :)

radiant plank
#

im guessing its stored somewhere in context but im not seeing where it would be on the wiki

sturdy compass
#

try context.card.cost

#

context.card is a reference to the card being sold

radiant plank
#

thanks will try this

manic rune
#

good morning everyone

sturdy compass
#

gm

radiant plank
#

thanks jerome that worked

sturdy compass
#

please call me astra lmfao

radiant plank
#

you got it maximus astra

sturdy compass
#

😭

radiant plank
#

i said it correctly

sturdy compass
#

Close enough ig

manic rune
#

hi john

sturdy compass
#

hello bepis/belis/craig/bella

manic rune
#

hi mark

sonic cedar
#

did i do it right,,,, this is within calculate this time NOT loc vars like an idot

modern kindle
#

Hi bepis

manic rune
#

do i need to_big this one

#

:3

#

hi dilly

sonic cedar
manic rune
#

context.destroy_card will cycle through every card in your playing hand, hand and deck (this is an optional feature)

#

since, yk

#

returning true will destroy it

sonic cedar
#

so,,,, i did it,,,? glass joker transplanted,,?

#

(i mean of course theres the other contexts but PLEASE

brazen tusk
#

what exactly does ipairs mean?

#

its used in most for loops i see people here doing

sonic cedar
#

also ipairs does index

#

(hence the

the i)

faint yacht
#

How do I check current deck again?

brazen tusk
rugged pier
#

is there a way to make debuffed cards score?

sonic cedar
stark geode
#

Id look but

#

I'm in bed on my phone

#

I'm getting better at reading the sacred texts

sonic cedar
manic rune
#

???wtf happened

#

i just reloaded my run

#

😭

#

am i cooked chat

rugged pier
#

naneif on a 1050 round

manic rune
#

nane NEGATIVE inf

ionic cobalt
#

nan e negative inf

#

so its basically infinitely small

rugged pier
sonic cedar
rugged pier
manic rune
#

talisman shenanigans

#

idfk

rapid stag
#

...i can't do this like this? cirLost
oh, i didn't notice the malformed property, why did it not paste the full G.GAME.round_resets.ante when i copied it wtf

sturdy compass
#

Why do your screenshots have aura wtf lol

rapid stag
#

funny sharex post-image processing

sonic cedar
brazen tusk
#

imma be real i have no idea how for loops work, how would i fit a destroy into this?

rapid stag
sturdy compass
#

You have a hanging . Lol

rugged pier
# rugged pier is there a way to make debuffed cards score?
calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and context.scoring_hand then
            if context.other_card.debuffed then
                if pseudorandom('cladent') < G.GAME.probabilities.normal/card.ability.extra.odds then
                    --WHAT DO I DO HERE? I NEED TO MAKE THE CARD UN-DEBUFFED
                end
            end
        end
    end
#

any ideas?

daring fern
rugged pier
rapid stag
daring fern
# rugged pier wdym

You need to use lovely to patch code into the game but im not too familiar with patching so I can't help with that.

rugged pier
#

alternatively

#

is there a way to remove the boss blind for a hand played

#

and add it back

#

since that would remove the debuff anyway

minor furnace
#

can you disable the content of other mods for your own custom challenges?

sturdy compass
rapid stag
sturdy compass
#

Adding a seal. Ok cool good to know

rapid stag
sonic cedar
# manic rune i think

bepis,,,,,,,,,, how do i,,,,,,,,,,,,,,, do this for remove_playing_cards,,,,,,,,,,,,,,,

brazen tusk
sturdy compass
rapid stag
#

might probably need to be in an event manager first

sturdy compass
#

start_dissolve actually does work on an event basis by default lmao

#

We love inconsistency

rapid stag
#

thank you localthunk, very cool

minor furnace
#

if it works it works

minor furnace
faint yacht
rugged pier
#
calculate = function(self, card, context)
        if context.setting_blind then
            if pseudorandom('cladent') < G.GAME.probabilities.normal/card.ability.extra.odds then
                if G.GAME.blind and ((not G.GAME.blind.disabled) and (G.GAME.blind:get_type() == 'Boss')) then 
                    G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.5,func = function()
                        card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('ph_boss_disabled')})
                        G.GAME.blind:disable()
                        return true end }))
                end
            end
        end
    end

h e l p

modern kindle
faint yacht
#

...why are you using self?

rugged pier
#

omg

faint yacht
minor furnace
#

honestly the best implementation I can think of is to either hook or patch the get_current_pool() function directly and remove things from the pool there

edgy reef
#

restrictions is a challenge blacklist.

edgy reef
#

Prob doesn't cover everything by itself but most vanilla-based objects are covered.

sturdy compass
#

Show code

rapid stag
# sturdy compass Show code
                local jkrsToSeal = {}
                local finalSealChoice = nil
                
                for i, jkr in ipairs(G.jokers.cards) do
                    if not jkr.seal then
                        table.insert(jkrsToSeal, jkr)
                    end
                end
                
                if #jkrsToSeal > 1 then
                    finalSealChoice = pseudorandom_element(jkrsToSeal, pseudoseed('randJokerSeal'..G.GAME.round_resets.ante))
                else
                    finalSealChoice = jkrsToSeal[1]
                end
                
                if finalSealChoice ~= nil then
                    finalSealChoice:juice_up()
                    G.E_MANAGER:add_event(Event({
                        trigger = 'after',
                        delay = 0.005,
                        blocking = false,
                        func = function()
                            finalSealChoice:set_seal(card.ability.extra)
                            return true
                        end}))
                end
            end```
sturdy compass
#

Would you mind sending it via screenshot? I’m on mobile 😭

minor furnace
# edgy reef

this reads like I would have to manually list out every card, tag, and blind from every possible mod, which I cannot do if I don't know what mods people have installed

minor furnace
rapid stag
radiant plank
#

for localization with localization files whats a clean way to not have to rewrite default.lua to be en-us.lua

#

like does lua have a built in #include like in c that just expands the file given into the source of the calling file

faint yacht
minor furnace
#

all jokers are prefixed with j_ though

#

so it would work

sturdy compass
# rapid stag

I’m curious of what would happen without the juice up call

sturdy compass
minor furnace
#

that would probably be a better implementation

edgy reef
minor furnace
#

yeah

tawny narwhal
#

Where would I look to figure out how to have a joker destroy itself and turn into another joker? Similar to Ghost, except it turns into a spcific card.

edgy reef
#

Probably just setting each table with a __index metamethod that always returns true if it's not a part of the curated object list.

rapid stag
minor furnace
#

I can probably just hook get_current_pool()

edgy reef
#

Probably more advanced than needed

sturdy compass
#

Cuz idk either lol

edgy reef
#

(about metamethod not get_current_pool)

last sentinel
#

does the core game/SMODS allow consumables to be perishable?

sturdy compass
#

No clue but it’d be worth testing

last sentinel
#

doesnt seem like :set_perishable works on them like it does for jokers

sturdy compass
#

Have you taken a look at the code for that function? It could be specifically checking for set == joker

rapid stag
sturdy compass
#

Suuuuuper weird

#

I’d check the code for set_seal myself to see what gives but like I said, mobile :(

last sentinel
sturdy compass
#

Ah that makes sense. Honestly though I could see it working out fine

rapid stag
#

i'm wondering if deja vu calls it with immediate being true

sturdy compass
rapid stag
sonic cedar
sturdy compass
#

Ouch

rapid stag
sturdy compass
#

Ofc LOL

sonic cedar
#

save me astra im begging you

sturdy compass
#

I’m jim support tonight inuSlain

#

What’s triggering that causes it to die

sonic cedar
#

i started a blind

sturdy compass
#

Do you have anything checking for that?

sonic cedar
#

no

sturdy compass
#

Hrrrm

sonic cedar
#

the crash:

sturdy compass
#

What is that line in utils.lua

sonic cedar
#

i will go look

sturdy compass
#

Would you mind showing the full block lol

#

Context is key

sonic cedar
rapid stag
# sturdy compass Ofc LOL

and now i have a function problem - when scoring, the red seal on any joker basically just acts like seltzer

sturdy compass
# sonic cedar

Ok so it’s happening because something is trying to add mult when you’re setting the blind I think??

sturdy compass
sonic cedar
sturdy compass
#

What Jokers did you have in hand at the time of the crash (if any)

last sentinel
sturdy compass
#

Damn

sonic cedar
rapid stag
sonic cedar
#

(im transplanting glass joker)

sturdy compass
sonic cedar
#

so i need to do an elseif [whatever] then ?

sturdy compass
#

Actually calculate_seal would be better

tawny narwhal
#

What function do I use to transform one joker into another (I.e. it turns into a different Joker)

sturdy compass
sturdy compass
#

Check the death code

sonic cedar
#

it's set_ability

tawny narwhal
#

where is said death code

sturdy compass
#

card.lua

#

ctrl + F and search for death

sonic cedar
sturdy compass
sonic cedar
#

oh

#

so just move the if down a peg

sturdy compass
#

So you need a second set of conditionals within the context.joker_main conditional to handle the xbase comparisons

#

Or you could just make it easy and check if xbase is > 0 in the same line and ditch the else lol

spiral crown
#

Hello! New to modding and was hoping for some help with my first mod
I have made the json file with the drag and drop info from the Steam modded documentation but I can't get the mod to appear in game
this is what I have in json file

tawny narwhal
#

I had a similar thing, removing badge colour and text colour fixed it for me

manic rune
#

did u fix it

sonic cedar
#

here with astra doing exactly that

#

i have no idea

#

ok granted this is a different issue

sturdy compass
#

I’m being Joe Helpful danceman

manic rune
#

❤️

tawny narwhal
spiral crown
sonic cedar
tawny narwhal
#

I'm not

sturdy compass
tawny narwhal
#

I'm talking about set_abilityu

sonic cedar
#

oh well in that case whaddya have

tawny narwhal
sonic cedar
tawny narwhal
manic rune
#

dunno, never used that before

#

💔

sonic cedar
#

crying

sonic cedar
sturdy compass
# spiral crown

Nothing immediately sticks out as wrong here. I wish I could cross reference with my mod but I cannot

tawny narwhal
# sonic cedar well you wanna put it in an event
SMODS.Joker {
    key = 'stellar_collapse',
    loc_txt = {
        name = 'Stellar Collapse',
        text = {
            "After {C:attention}#2# High Card{} hands,",
            "collapses into {C:legendary}Singularity{}.",
            "{C:inactive}(Currently {C:attention}#1#{C:inactive} hands played)",
        }
    },
    config = { extra = { high_card_count = 0, high_card_limit = 20 } },
    rarity = 2,
    atlas = 'collapseatlas',
    pos = { x = 0, y = 0 },
    cost = 6,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.high_card_count, card.ability.extra.high_card_limit } }
    end,

    calculate = function(self, card, context)
        if context.before and next(context.poker_hands['High Card']) and not context.blueprint then
            -- Increment count
            card.ability.extra.high_card_count = card.ability.extra.high_card_count + 1
            
            -- Check if it should transform
            if card.ability.extra.high_card_count >= card.ability.extra.high_card_limit then
                return {
                    message = "Gravitational Collapse!",
                    colour = G.C.LEGENDARY,
                    card = card,
                    action = function()
                        card:set_ability -- NO CLUE WUT TO DU
                    end
                }
            end

            -- Normal progress message
            return {
                message = "Collapsing...",
                colour = G.C.ATTENTION,
                card = card
            }
        end
    end
}
sonic cedar
tawny narwhal
#

Imma hail mary it and hope you guys (smart people) can help out

rapid stag
sonic cedar
#

i was saying set_ability cause it's what ive been doing for like,,,, oh my god its been a month,,,

tawny narwhal
#

A month?

sonic cedar
tawny narwhal
#

I see

sturdy compass
rapid stag
radiant plank
#

how do i check when a tarot card is used in my calculate function?

manic rune
#

how do i save stuff in a blind that wont get reset when i re-enter a run

manic rune
#

asides from G.GAME

#

does self.config work?

rapid stag
tawny narwhal
#

Where do I store a sound in the mod folder? I hadn't considered that, but now I want to do it. Also, does it have to be initialised beforehand?

radiant plank
sturdy compass
#

I just can’t find it tho

sonic cedar
rapid stag
sturdy compass
sonic cedar
#

one moment

#

having discord pc open with balatro and vscode equals

#

no memory

sturdy compass
#

Ouchie

sonic cedar
#

my pc sucks

#

did my discord crash on opening

#

there we are

#

there we aren’t im in a loading l—

#

i should close balatro

sturdy compass
#

Yes

sonic cedar
#

wait i don’t need to show the transform code it’s just taking up screenshot space

#

much better

sturdy compass
#

So no matter what it should give xmult during joker_main?

sonic cedar
#

yes

tawny narwhal
#

@sonic cedar I tried using your structure and got this when the event should have happened

rapid stag
last sentinel
#

Anyone got any bright ideas as to why this puppy would be crashing with "attempt to index local card (a nil value)" ?

sturdy compass
#

just calculate

faint yacht
tawny narwhal
#

I gurentee I am the one who goofed it

sonic cedar
#

i dont

#

😭

tawny narwhal
#
 -- Check if it should transform
            if card.ability.extra.high_card_count >= card.ability.extra.high_card_limit then
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.15,
                    func = function()
                        card:set_ability(G.P_CENTERS("j_LSingle_singular"))
                        card:juice_up(0.3, 0.3)
                        return true
                    end,
                }))
            end
sturdy compass
sonic cedar
#

it does a little thing called

#

crash my game when i select a blind

sturdy compass
#

I’d ask you to hand over the code so I could start digging if I could do work on it lol

spiral crown
sonic cedar
tawny narwhal
#

yea

#

wait

#

maybe

tawny narwhal
#

It is now

sonic cedar
#

IT IS NOW 😭

sturdy compass
manic rune
#

??????????????????????????

#

BRO IM TESTING

#

😭

sonic cedar
#

NOT YOU TOO

sturdy compass
#

Insane

manic rune
#

oh nvm we good

sturdy compass
#

Kill

#

@ aikoyori

tawny narwhal
#

P_CENTERS seems to be the error cause for some reason

sturdy compass
# last sentinel bumpsies

gifted_card is being instatiated within the scope of the conditional statements and therefore doesn’t exist elsewhere in the block. Define the variable before assigning it a value in your conditionals

sonic cedar
tawny narwhal
#

In existasnce?

#

yes

#

wait

#

would it being a legendary mean anything? I wouldn't think so...

sonic cedar
#

no that’s fine lmao

tawny narwhal
#

thought so

manic rune
sonic cedar
tawny narwhal
#

'singular'

sonic cedar
#

and NOT the joker you’re transforming FROM right

tawny narwhal
#

no, Joker I'm transforming from is 'stellar_collapse'

sonic cedar
#

is

#

is this in a context

tawny narwhal
#

I don't think so

#

Sorry man I just started learning lua yesterday

#

My base of knowledge is using python and MatLab lmao

rapid stag
# sturdy compass just calculate

yeah i think the problem is with calculate_seal(). it doesn't really matter what i do to the seal itself, since as i showed in the calculate_seal() screenshot, i think it's being run on the card side? and is checking the type of seal itself? and just repeating if it sees a red seal somewhere in the calculation? because this is what i wrote to try and make it not do what i showed

and not only did it keep doing what i showed, it didn't print either of those things once

sonic cedar
tawny narwhal
#

Once 20 high card hands have been played

rapid stag
#

i think what i need to do is patch calculate_seal and have it differentiate between the seal being on a card and being on a joker.

tawny narwhal
#

Wait so yes, it is in a context

#

if card.ability.extra.high_card_count >= card.ability.extra.high_card_limit then

sturdy compass
tawny narwhal
#

clearly I have an enormous brain

#

so what have I missed here?

sonic cedar
#

ok so

#

take your code there

#

put it within

#

if context.joker_main then

tawny narwhal
#

Oh you right

#

so like...

sonic cedar
#

joker_main is the main scoring step for jokers

tawny narwhal
#

Oh okay

#

well I have put it in if context.before and next(context.poker_hands['High Card']) and not context.blueprint then

#

Like the card functions correctly right up until it should transform

#

So I think it's the transforming that blows it all up

sonic cedar
#

you had it in a context this whole time i

#

ok

#

send the whole block

manic rune
#

AND THATS THE ENTIRE BOSS DONE

tawny narwhal
sonic cedar
#

it’s chill

minor furnace
#

after fooling around with it for a while, I feel like it's too much work to force disable other mods' content for my own challenges...

tawny narwhal
#
SMODS.Joker {
    key = 'stellar_collapse',
    loc_txt = {
        name = 'Stellar Collapse',
        text = {
            "After {C:attention}#2# High Card{} hands,",
            "collapses into {C:legendary}Singularity{}.",
            "{C:inactive}(Currently {C:attention}#1#{C:inactive} hands played)",
        }
    },
    config = { extra = { high_card_count = 0, high_card_limit = 20 } },
    rarity = 2,
    atlas = 'collapseatlas',
    pos = { x = 0, y = 0 },
    cost = 6,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.high_card_count, card.ability.extra.high_card_limit } }
    end,

    calculate = function(self, card, context)
        if context.before and next(context.poker_hands['High Card']) and not context.blueprint then
            -- Increment count
            card.ability.extra.high_card_count = card.ability.extra.high_card_count + 1
            
            -- Check if it should transform
            if card.ability.extra.high_card_count >= card.ability.extra.high_card_limit then
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.15,
                    func = function()
                        card:set_ability(G.P_CENTERS("j_LSingle_singular"))
                        play_sound("CollapseBoom")
                        card:juice_up(0.3, 0.3)
                        return true
                    end,
                }))
            end

            -- Normal progress message
            return {
                message = "Collapsing...",
                colour = G.C.ATTENTION,
                card = card
            }
        end
    end
}
rugged pier
sonic cedar
#

i have not

#

i chose suffering willingly

#

…plus i can just run discord on my phone

rugged pier
#

true, just less of a hassle having everything open in one place

minor furnace
#

sounds like someone has 8 gigs of ram

tawny narwhal
#

I think...

radiant plank
#

@rapid stag quick question, do you know how to get the key of the consumeable that's used? seems to be nil for context.consumeable.key and context.consumeable.ability.key.

rugged pier
#

no

tawny narwhal
rugged pier
#

yes youre right, it does

#

let me show you how i implemented something like this

daring fern
sonic cedar
rapid stag
radiant plank
#

AWESOME

rugged pier
radiant plank
#

thanks that's so useful i didn't know that existed

rugged pier
#

so it will count those instances of high cards being played

tawny narwhal
minor furnace
sonic cedar
#

i knew i wasn’t crazy

rugged pier
daring fern
rugged pier
tawny narwhal
rugged pier
tawny narwhal
#

valid

minor furnace
daring fern
tawny narwhal
minor furnace
#

every hand contains a high card

sonic cedar
#

did you want it to contain or be

rugged pier
sonic cedar
#

if BE a high card yeah use the modified code

#

if contains a high card leave it how it is

rugged pier
#

im sure OP doesnt want it to be "contain" since he wouldnt need the check anyway

#

everytime hand is played just do effect lol

sonic cedar
#

it’s the first day let em cook 😭

rugged pier
#

true

tawny narwhal
#

Nah he right though

rugged pier
#

did you end up using talisman @tawny narwhal

minor furnace
#

I've really been modding this game for a month and a half now...

tawny narwhal
#

In the pursuit of good practise, what would I do for it being only a single card scored?

sonic cedar
tawny narwhal
rugged pier
tawny narwhal
#

Dependency is a next week kinda thing

rugged pier
minor furnace
sonic cedar
#

who is this yall you speak of

minor furnace
rugged pier
rugged pier
#

im a pesky business major that loves coding and wishes he went into CS instead

ionic hill
sonic cedar
rapid stag
ionic hill
#

One message removed from a suspended account.

ionic hill
minor furnace
rugged pier
sonic cedar
rugged pier
#

NO RECURSIVE FUNCTIONS UNDER MY WATCH

minor furnace
#

I wrote a recursive function to make my Omnirank enhancement work

ionic hill
sonic cedar
rugged pier
#

am i just stupid

sturdy compass
rugged pier
#

on another note, i have 70 hours in the game and the last 20 hours are just creating mods...

#

love opening and closing the game 15 times for minor changes

sturdy compass
#

I wanna say at least 95% of my hours were spent modding

rugged pier
minor furnace
# rugged pier i have no idea what the use case would even be in balatro for recursion

I created a card that can count as any rank, and I needed a way to iterate through the possible values regardless of how many there were in the played hand. However, this grows exponentially with the number of cards, so it does something different if four or more of them are played, because by the game's logic there's only a few hands you can make because it always picks the highest scoring hand

rugged pier
sturdy compass
rugged pier
rugged pier
minor furnace
#

break the game how?

faint yacht
rugged pier
minor furnace
#

ohhh like balance-wise

rugged pier
minor furnace
#

idk

rugged pier
minor furnace
#

I did it because I thought it would be fun

rugged pier
minor furnace
#

I also had to patch literally every base-game joker that does something with ranks

rugged pier
tawny narwhal
minor furnace
rugged pier
tawny narwhal
daring fern
tawny narwhal
#

Bruh

#

you right

minor furnace
# rugged pier rip

What the base game does when it wants a rank is it uses if card:get_id() == 14 for something like Scolar. And there's no useful way to override get_id() for Omnirnak so I had to edit the base game code

rugged pier
minor furnace
#

every instance of card:get_id() I replaced with a boolean function is_rank(card, {2,3,4}) to compare against all necessary ranks

minor furnace
#

you can also hook functions which is less intrusive and less likely to have issues with other mods

rugged pier
#

you have to go through the entirety of the cards.lua file and pick out every joker and other abilities therein

minor furnace
rugged pier
#

also blinds that dont allow a certain hand type being played

#

or repeated hand types

minor furnace
rugged pier
rugged pier
tawny narwhal
#

Okay guys.... I swear I'm making progress

#

When it goes to trnasfrom, I'm still getting this

#

ALSO

minor furnace
tawny narwhal
#

Debuffed cards still count, how I stop that?

rugged pier
tawny narwhal
#
SMODS.Joker {
    key = 'stellar_collapse',
    loc_txt = {
        name = 'Stellar Collapse',
        text = {
            "After {C:attention}#2# High Card{} hands,",
            "collapses into {C:legendary}Singularity{}.",
            "{C:inactive}(Currently {C:attention}#1#{C:inactive} hands played)",
        }
    },
    config = { extra = { high_card_count = 0, high_card_limit = 20 } },
    rarity = 2,
    atlas = 'collapseatlas',
    pos = { x = 0, y = 0 },
    cost = 6,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.high_card_count, card.ability.extra.high_card_limit } }
    end,

    calculate = function(self, card, context)
        if context.before and context.scoring_name == "High Card" and not context.blueprint then
            -- Increment count
            card.ability.extra.high_card_count = card.ability.extra.high_card_count + 1
            
            -- Check if it should transform
            if card.ability.extra.high_card_count >= card.ability.extra.high_card_limit then
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.15,
                    func = function()
                        card:set_ability(G.P_CENTERS("j_LSingle_singular"))
                        play_sound("CollapseBoom")
                        card:juice_up(0.3, 0.3)
                        return true
                    end,
                }))
            end

            -- Normal progress message
            return {
                message = "Collapsing...",
                colour = G.C.ATTENTION,
                card = card
            }
        end
    end
}
rugged pier
radiant plank
#

how exactly does the SMODS.create_card function work? im using it to create a tarot card but its not putting the card in my consumeables

#

i can just drag it around the screen and everything

daring fern
rugged pier
radiant plank
#

im specifying the area field for the table

tawny narwhal
rugged pier
#

what the other person said

tawny narwhal
#

I'm being hard carried rn

rugged pier
minor furnace
rugged pier
#

time for me to sleep