#💻・modding-dev

1 messages · Page 276 of 1

crisp coral
#

i think talis fixed this already

frosty dock
#

0 is a number

crisp coral
#

maybe

#

idk

manic rune
#

oh

#

so its a talisman problem, not mine?

frosty dock
#

yeah try updating

manic rune
#

AGAKLGKSAKLS

#

OH MY GOD WHY DIDNT I THINK OF THAT

#

thanks guys 💔

crisp coral
#

tunnel vision

manic rune
#

that was 1 fucking hour wasted

#

ghhh

frosty dock
#

talisman 💔

manic rune
#

talisman compat 💔

buoyant merlin
#

Uh what context would this be paired with

hard flume
#

I should update all my mods but constantly updating them is a chore

frosty dock
#

luajit2 ❤️

manic rune
#

never tried that but it sounds cool ❤️

crisp coral
#

luajit2 ❤️

#

(i don't care about optimization)

spring lantern
#

anyone know how to handle booster pack particles

frosty dock
thin anchor
#

how would i add this enhancement to selected playing cards

frosty dock
#

check code for other consumables

#

the selected cards are in G.hand.highlighted

manic rune
#

....

#

they didnt fix it

#

i downloaded the latest version already

#

it seems to be only occurring when you are using omeganum settings

#

:3

frosty dock
#

😔

manic rune
#

praise fucking talisman

#

🧎‍♂️

tall wharf
#

qwedfqqd

frosty dock
#

praise fucking talisman

manic rune
#

oh nevermind, bignum breaks too

frosty dock
#

ftfy

manic rune
#

fmeafemao

#

welp, adding talisman to incompat for now then 😭

manic rune
#

if i have it off then it will crash

#

thats certainly something

frosty dock
#

😔

thin anchor
#

losing my fukclking mindh

humble girder
#

talisman is bad tbh

#

hot take

manic rune
#

Disable Scoring Animation compat™️

frosty dock
humble girder
#

if i want to watch my es get es without effort i'll go hit up a calculator

crisp coral
#

coldest take in the west

humble girder
#

cryptid's popularity would beg to differ tbh

manic rune
#

❤️

modern kindle
#

lmfao

#

now youll get people asking where to download talismans disable scoring animations

frosty dock
#

😭 unfulfillable dependency

marble flint
#

i still want a way to have "optional dependencies" just to document to users of my mod what integrations exist

stark geode
#

how do i i check how many cards are in a hand

manic rune
#

#G.hand.cards

humble girder
#

what hand

#

hand that has been played?

hard flume
#

The code in my Balatro Mod sucks and I need to reoptimize it

humble girder
#

hand that is being scored?

#

held in hand?

thin anchor
stark geode
manic rune
#

whatchu doin

humble girder
manic rune
#

you need to

#

G.hand.highlighted[1] or smt

#

depends on what your looking for

thin anchor
#

u

#

a

#

hhh

humble girder
#

x

#

g

#

mmm

thin anchor
#

saddness

manic rune
#

:

#

3

#

t

#

al

#

i

#

s

#

man

thin anchor
#

i

manic rune
#

faelfmael

thin anchor
#

l

#

k

#

h

#

nbnbnnm,mnmnoooonononn

stark geode
#

well actually i need to check the whole thing to make sure its one card

humble girder
#

#context.scoring_hand

manic rune
#

^

stark geode
#

so this would act like dna

manic rune
#

im taking a rest early today

#

ive been scratching my head so much im gonna go bald by 18

#

💔

manic rune
humble girder
#

or #context.full_hand because why not use context vars

manic rune
#

true...

humble girder
#

remember mods might add things to scored hand beyond G.play

stark geode
#

then i can use getn to get the length right

humble girder
#

mine does 🙂

#

# is the length

stark geode
#

how does that work lol

buoyant merlin
#

...why are there slots that say they are filled but aren't?

onyx sonnet
#

ghost cards!

pulsar flower
#

i love ghost cards they are very fun

hushed field
thin anchor
red flower
hushed field
thin anchor
#

no

buoyant merlin
humble girder
#

literally just setting mod_conv in config.tarot removes the need for extra code

humble girder
#

HEY SPIDERMAN

#

DO A FLIP

red flower
#

hey peter

manic rune
#

i can literally jump off a bridge and do a flip at the same time rn

hushed field
#

hey paul

manic rune
#

:3

#

i have never been so mentally frustrated before

#

💔

hushed field
red flower
stark geode
#

is there a context for number of hands played

manic rune
#

i think ice might like movies

#

idk

chilly tendon
#

Hello balatro moding developers

maiden river
#

oh, how nice it is to not have a million folders

stark geode
#

rn im using G.GAME.current_round.hands_played

manic rune
#

hi rega

humble girder
#

oh hi mark

red flower
stark geode
#

cool

hushed field
humble girder
#

this year he says

manic rune
#

working on a better-calc tutorial vid tmr

chilly tendon
#

I have like, esentially no prior modding experience other than replacing sprites in folders to make them look like things

thin anchor
humble girder
#

there has been less days in this year

red flower
#

i deleted my letterboxd because of the embarrassing low amount of movies i watch

manic rune
chilly tendon
#

But I wanted to learn how to make some jokers and stuff for a friend to play with

manic rune
#

its not a table

thin anchor
#

a

hushed field
manic rune
#

you cant be flexing on us ice

#

💔

chilly tendon
thin anchor
manic rune
#

mhm, feel free to ask anything ur confused about!

chilly tendon
thin anchor
#

removed the commas

red flower
maiden river
#

you have to attach the :flip to the card object you want to flip 😭

manic rune
#

that resolution is even worse than me running Minecraft ngl 😭

maiden river
#

just saying :flip() doesn't really mean anything

red flower
#

the threads are very funny

thin anchor
#

im done

modern kindle
slender bay
#

Trying to give xmult for every queen held in hand, nothing happens and I'm not sure what I'm doing wrong

humble girder
#

why final scoring step

#

instead of individual

manic rune
#

to_big or to_small

#

that is thy question

slender bay
red flower
modern kindle
#

call my shit to_medium

maiden river
#

if anything, you could just use joker_main and count the number of queens then

reef belfry
#

How do u even write this on ther 💔💔

maiden river
#

and then multiply that by the XMult you want to give

daring fern
maiden river
#

that's also true

slender bay
stark geode
#
SMODS.Joker{
    key = 'PNA',
    calculate = function (self,card,context)
        if context.individual and context.cardarea == G.play then
            if #context.full_hand  == 1 and  G.GAME.current_round.hands_played == 0  then
                G.playing_card = (G.playing_card and G.playing_card + 1) or 1
                local _card = copy_card(context.full_hand[1], nil, nil, G.playing_card)
                _card:set_edition('e_negative', true)
                _card:add_to_deck()
                G.deck.config.card_limit = G.deck.config.card_limit + 1
                table.insert(G.playing_cards, _card)
                G.hand:emplace(_card)
                _card.states.visible = nil

                G.E_MANAGER:add_event(Event({
                    func = function()
                        _card:start_materialize()
                        return true
                    end
                })) 
                return {
                    message = localize('k_copied_ex'),
                    colour = G.C.CHIPS,
                    card = self,
                    playing_cards_created = {true}
                }
            end
        end
    end
}

#

why tf is it trying to call that

hushed field
stark geode
hushed field
#

you don't ever wanna return self in the calculate function, basically

stark geode
#

good to know

wintry solar
#

You don’t need to return card = card either

#

It’ll auto apply the message to the relevant card in that context step, if you want to change it you use message_card = cardObject

hushed field
#

actor pack is proving a bit more cumbersome than I'd hoped. damn.

open aspen
rancid bridge
#

how would i calculate this (i am actually a little stuck on loc vars but i think the only one i definitely need is the Xmult one)

open aspen
#

basically how would you make a calculate function for this?

maiden river
#

for challenges, what's card_key supposed to be?
(in reference to yes_ranks and no_ranks specifically)

open aspen
#

?

#

like when u play a hand with enhanced cards

maiden river
#

maybe I should use my break from my mod to PR the docs

open aspen
#

Well, in that case, what you want to do is loop over context.scoring_hand in calculate function, then for each card in context.scoring_hand (its a table of the scoring cards in the played hand), you can check if it has an enhancement (one easy way to do this is next(SMODS.get_enhancements(currentCardInTheLoop)) ~= nil, the next() is there because that technically returns a table), and check the card rank with card:get_id() and make sure its even. If all of those checks pass, you can put return { xmult = card.ability.extra.xmult } (ofc im assuming what ur config variable is called)

normal crest
#

When you want a specific card do something during scoring you almost always want to use context.individual

normal crest
#

You told them to loop thru scoring_hand

open aspen
#

oh i completely misremembered what context.individual was lmao

#

yea no you dont have to loop through scoring hand

#

you can just check context.individual

rancid bridge
#

oh god why can't the examplejokersmod have an even steven example

red flower
rancid bridge
#

oh
i may be a little stupid

red flower
#

also you can look at vanilla code

rancid bridge
#

i think i get it now...

modern kindle
#

well chat, i finally got around to doing a localization file (mostly)

rancid bridge
red flower
#

yes

rancid bridge
#

and where would i put the enhancement check

red flower
#

you can put it in the same if condition

#

and SMODS.has_enhancement(context.other_card, 'm_key')

long sun
#

hi, is there a toggle, or something i can add to my Joker, which makes it shatter when destroyed?

red flower
#

i dont think so

long sun
#

aw

#

might have to write a hook

#

but have never done that before

marble flint
#

hook function SMODS.shatters(card)

red flower
rancid bridge
long sun
#

maybe i could patch start_dissolve?

red flower
marble flint
rancid bridge
red flower
long sun
#

okay idea

marble flint
#

oh right i'm stupid

long sun
#

hook start_dissolve, check the card it's being called on, if it's one of the Jokers i wanna shatter, call shatter instead

red flower
#

yeah that sounds like what i would do

long sun
#

grand

#

lemme check how hooking works

ancient gorge
#

Is there a readme / guide / starter files for creating a mod for balatro?

ancient gorge
#

thx

long sun
#

first draft, i'm positive this code won't work

#

lemme give it a try though

red flower
#

the first line should be local ref = Card.start_dissolve

maiden river
#

what file is the challenge localization text rendered, does anyone know?

long sun
#

(oh, and i also missed an end)

marble flint
#

your key is probably something like "j_BFDI_bottle"

long sun
#

grand

marble flint
#

(BFDI being whatever the prefix is set as in your manifest .json)

long sun
#

OH WHAT IT ACTUALLY WORKS

#

WHAT

#

WHATWHATWHAT

tall wharf
#

omg ghost

red flower
tall wharf
#

hello

marble flint
#

i should probably do that for Glass Cannon tbh

long sun
#

hai :D

tall wharf
#

today was crazy for me

red flower
#

crazy?

tall wharf
#

first i added math deck

#

for realsies

tall wharf
#

n do you still hate ui

red flower
#

i will try math deck now

red flower
tall wharf
red flower
#

ive never used the sleevs mod

tall wharf
#

it becomes a math deck pro

#

instead of measly simple arithmetic

#

you get variables

#

n a few functions

red flower
#

updated

tall wharf
#

i guess

#

math deck doesn't work with letter sleeve yet but the base math deck should be usable

#

there was an earthquake around 11 hours ago

maiden river
#

it works functionally, it just looks like this 😭

red flower
#

i also use a table for a challenge and I just decided to just hard write it lol

maiden river
#

I'm making a patch balatrojoker

heavy hare
#

what's the equivalent to console.log in LOVE?

maiden river
#

print

#

or use one of the logging functions if you're also using smods

#

LOVE just uses lua, so you can check out the docs for that

heavy hare
#

Never actually used the debugging tools for LUA, just console.log 💀

#

That might just be a tabletop sim function now that I think about it

rancid bridge
#

i didn't think of an effect for this one.... fucjk......

agile thistle
minor furnace
#

on my way to define custom behaviour for my joker when a specific challenge is active

maiden river
#

oh that's not hard

minor furnace
#

I figured

spring lantern
#

5/10 done :3

minor furnace
#

I literally just need a contidional inside the joker to see if the challenge is active

thin anchor
#

doesnt seem difficult

minor furnace
#

the hardest part is finding where the current challenge name is stored lmao

thin anchor
#

oh

normal crest
#

I bet 2 bananas on G.GAME.challenge

minor furnace
#

probably

#

I just haven't looked yet

tall wharf
agile thistle
spring lantern
#

z = 9

normal crest
opal holly
#

got a little error at 431: attempt to perform arithmetic on field 'odds_m' (a nil value)"
I'm not sure if i set my probabilities right

minor furnace
#

good news! G.GAME.challenge holds exactly the string that is the challenge id lmao

hushed field
#

I spent... HOURS debugging this function and it turns out I just forgot to clean the temp pool 😢

minor furnace
#

it happens

agile thistle
#

i mean i guess its efficient

maiden river
sonic cedar
#

blueprint

#

did i just do the thing where you type what youre thinking

#

and think what you wanna type

#

actually speaking of blueprint can you hide the compat label is that a thing

hushed field
#

i just discovered that Kino sometimes overwrites other mods config files. Anyone familiar with that issue and what may cause it??

sonic cedar
#

bro is assimilating

modern kindle
#

in vanilla, whats the lowest hand amont you can start with for a blind excluding the needle

#

since that sets it to 1

maiden river
#

it's 1
if you have zero hands you would just lose

opal holly
#

i feel like i might have an end inserted somewhere that isnt supposed to

maiden river
#

same thing with hand size

modern kindle
#

well yea, i just mean in normal play is it possible to get enough shit to make you actually only have 1 hand to play outside of a blind

maiden river
#

oh

modern kindle
#

or whatever the lowest is

maiden river
#

lemme think

#

there's troub, hieroglyph, and that's -2

red flower
normal crest
maiden river
#

if you play on black deck, that's -3

#

so that's 1 right there

modern kindle
#

gotcha awesome, thanks

maiden river
#

why do you ask 🤨

#

are you up to something

hushed field
uncut grail
#

how would i make a joker that reacts to other jokers getting destroyed?

#

would i use hooks?

normal crest
normal crest
modern kindle
# maiden river why do you ask 🤨

nah im implementing blind phases due to blind expander, and a friend was moaning about how you shouldnt be prevented from facing a boss because you didnt have enough hands (which i fundamentally disagree with due to the needle)

#

so i neeeded to know what the lowest poss was

uncut grail
hushed field
#

yeah, I thought I was doing that, but I think I got distracted while setting it up every time, haha. It's not pushed to teh release branch, and my dev branch sets a mod-specific version of it and then never uses it again, haha

normal crest
#

Hooks are real!

#

You'll find examples somewhere in this discord... i cba to type one in phone

wintry solar
#

Didn’t victin add that context recently?

normal crest
#

No idea

uncut grail
#

so what would the order of things to do be? like...

normal crest
uncut grail
#

how would i add context using a hook

#

i have no clue how context even works, to be frank

#

is it a global variable or something

normal crest
#

Cus we can't all keep track of every commit lol

knotty copper
#

How do you make a toggle button and the describe where it gets put?
Like this?

maiden river
#

gotta keep up to date 🗣️

normal crest
#

And you pass it a table with the info in the context

#

That's for adding your own contexts

uncut grail
#

so i would hook SMODS.calculate_context into Card:start_dissolve?

normal crest
#

Uhh, there might be jokers that shatter instead of dissolve

#

I think glass joker? But idk

#

I hooked Card.remove instead

uncut grail
#

i don't quite get how i would hook something in a method...

#

like, card.remove does not exist yet, does it? and if it does, do i have to hook every instance of card.remove?

#

im stupid

red flower
#
local card_remove_ref = Card.remove
function Card:remove()
    if self.ability.set == "Joker" then
        SMODS.calculate_context({ joker_removed = self })
    end
    card_remove_ref(self)
end
old bane
#

do seals work on Jokers too or just playing cards?

uncut grail
#

just at the top of my mod lua?

red flower
#

yeah

wintry solar
uncut grail
#

apparently this was easier than i thought haha, sorry for the trouble

#

thanks a lot

red flower
#

keep in mind this will count sold jokers too

uncut grail
#

yeah i'll work out the logic

turbid maple
#

I have the full hook for this gimme a sec

red flower
#

and maybe jokers in the collection and stuff so it might need more checks

uncut grail
turbid maple
#

you also have to check if self.added_to_deck otherwise opening and closing your collections will trigger your joker 20 times

old bane
turbid maple
# uncut grail yooo hype
-- Context for Joker destruction
local _card_remove = Card.remove
function Card.remove(self)
    if self.added_to_deck and self.ability.set == "Joker" and not G.CONTROLLER.locks.selling_card then
        SMODS.calculate_context({
            blueatro_destroying_joker = true,
            blueatro_destroyed_joker = self,
        })
    end

    return _card_remove(self)
end
uncut grail
#

tysm! i'll look into this and finally learn how these work...

normal crest
red flower
#

thats what i said

normal crest
#

Oops

red flower
#

🙂

normal crest
#

Discord was lagging, that was the last message for me

humble girder
#

and self.area == G.jokers

tall wharf
#

hello n

red flower
#

hii

old bane
#

hi

tall wharf
#

what do you think about my math deck

red flower
#

i played math deck

#

i didnt like it

tall wharf
#

😭

red flower
#

kinda too easy, letter was more fun

old bane
#

aikoyori still out here inventing new ways to play balatro

tall wharf
turbid maple
#

mixing math and letter cards so you can make 1E308

red flower
#

if numbers were less round it would be better

#

maybe less discards

next timber
#

Pixel deck when
Create an image out kf pixel cards within 1% accuracy or die

tall wharf
#

i have a few problems with this thing idk why

red flower
#

all my hands by the end were X * 10 ^ n

tall wharf
#

i should fix that

next timber
#

Instant e 👍

sonic cedar
#

is this the base game version of smods' calculate? or is there also a calculate_joker that i couldnt find documentation on

next timber
#

I think it would get a lot more interesting if you didnt have "0" cards by default

red flower
#

thats it afaik

tall wharf
#

hi toma

sonic cedar
#

hi aiko

tall wharf
#

i am so cooked

next timber
tall wharf
#

FUCK YOU

#

I AM TESTING

red flower
#

oh i got chicot in my run too

tall wharf
#

FOR FUCK SAKE

sonic cedar
red flower
#

depends on what the effect is

old bane
#

is this for like a passive effect like pareidolia

thin anchor
#

i LOVE GDSCrIPT

red flower
#

gdscript is cool

thin anchor
#

very

#

my first language

sonic cedar
red flower
#

there's a utility for doing blueprint effects in calculate

old bane
# sonic cedar its for a copy effect

oh so like blueprint/brainstorm? you might wanna check in like the lovely dump of either card.lua or common_events.lua because i think there you can find it?

red flower
#

but ive never used it : )

sonic cedar
#

im in card.lua rn

old bane
red flower
#

try SMODS.blueprint_effect

uncut grail
#

btw where is the rarity stored in a joker card?

red flower
#

card.config.center.rarity

thin anchor
#

arabic letters make me scared for some reason

uncut grail
#

tyty!

radiant plank
#

can someone help me diagnose why my joker isn't showing up in the collection?

#

the mod is being loaded, here's my SMODS.Joker call

#
SMODS.Atlas{
    key = 'j_chikenjokey',
    path = 'j_chickenjokey.png',
    px = 71,
    py = 95,
}

SMODS.Joker{
  key = 'j_chikenjokey',
  loc_txt = {
    name = 'Chiken Jokey',
    text = {
      'If the first hand played is a pair',
      'destroy the played cards and gain',
      '{X:mult,C:white}#1#X{} Mult',
      'Currently at {X:mult,C:white}#2#X{}',
    }
  },
  atlas = 'j_chikenjokey',
...
old bane
thin anchor
#

lol

uncut grail
#

i didn't know i would make it rare joker so i didn't make it that but it could've been called cannibalism

#

truly a missed opportunity...

thin anchor
#

r.i.p
jim
"bo"

sonic cedar
old bane
hexed heath
#

hmm

#

the game shuffles the deck both before and after a blind for some reason

spring lantern
#

the booster packs i made aren't appearing naturally in the shop even when i set the weight to like 20

#

:(

old bane
tall wharf
#

@red flower is this better

red flower
#

much better

spring lantern
#

y this mofo not appearing regardless of whatever weight value i set

radiant plank
spring lantern
#

the key should be j_CHK_chikenjokey methinks

#

but also that shouldnt be the atlas name

thin anchor
#

what does juice_up do?

spring lantern
sonic cedar
#

the lil shake

radiant plank
spring lantern
#

shimmy shimmy

radiant plank
#

should it be like CHK_Jokers.png?

spring lantern
#

that's the file name of the image

radiant plank
#

yeah

thin anchor
#

just need to figure out how it works hmmm

red flower
radiant plank
red flower
#

not the file name

spring lantern
#

atlases dont prefix

#

their keyts

red flower
tall wharf
#

no more skipping

spring lantern
#

what

red flower
#

with the mod prefix

#

you can ignore it for your objects tho

spring lantern
#

aint it just whatgever key you give it

sonic cedar
red flower
#

modprefix_key

spring lantern
#

i have never had to add the prefix

#

for an atlas

red flower
#

yeah its automatic for your own objects

tall wharf
radiant plank
#

so i should manually prefix in my main.lua for the joker like atlas = 'CHK_j_chikenjokey

spring lantern
#

nah no need

red flower
#

no

radiant plank
#

okay hm idk what im missing here

red flower
#

hows the file called

#

and where is it located

radiant plank
#

i have that SMODS.Joker call in main.lua as of right now

#

and my folder structure looks like this

red flower
#

i mean the image thats throwing the error

spring lantern
#

just to make sure we're on the same page, this is the structure of an atlas definition

radiant plank
#
├── assets
│   ├── 1x
│   │   └── j_chikenjokey.png
│   └── 2x
│       └── j_chikenjokey.png
├── Chiken_Jokey.json
├── jokers
│   └── chikenjokey.lua
└── main.lua
#

ignore the jokers folder, i moved the chikenjokey.lua content into main.lua for debuggin reasons

#

no i dont prefix the atlas key with CHK, should i be doing that?

spring lantern
#

no need

old bane
#

inside your joker definition and in the atlas definition you dont need to be prefixing with the mod prefix

thin anchor
#

is this correct for juice_up?

radiant plank
#

just for clarity here's what i have, im not manually prefixing

SMODS.Atlas{
    key = 'j_chikenjokey',
    path = 'j_chickenjokey.png',
    px = 71,
    py = 95,
}

SMODS.Joker{
  key = 'j_chikenjokey',
  loc_txt = {
    name = 'Chiken Jokey',
    text = {
      'If the first hand played is a pair',
      'destroy the played cards and gain',
      '{X:mult,C:white}#1#X{} Mult',
      'Currently at {X:mult,C:white}#2#X{}',
    }
  },
  atlas = 'j_chikenjokey',
...
spring lantern
#

wait i have a prefix right there am i stupid

red flower
spring lantern
#

yeah i imagined as much

old bane
#

also your key should just be chikenjokey in your joker definition

radiant plank
# red flower what's the rest of the file
...
  rarity = 3,
  cost = 10,
  config = {
    extra = {
      Xmult = 1.0,
      Xmult_scaling = 0.25,
      active = false,
    }
  },
  unlocked = true,
  discovered = true,
  blueprint_compat = true,
  eternal_compat = true,
  perishable_compat = true,
  pos = {x = 0, y = 0},
  loc_vars = function(self, info_queue, center)
    return {
      vars = {
        center.ability.extra.Xmult_scaling,
        center.ability.extra.Xmult,
      }
    }
  end,
  check_for_unlock = function(self, args)
    unlock_card(self)
  end,
  calculate = function(self, card, context)
    if context.before and next(context.poker_hands['Pair']) and #context.poker_hands == 1 then
      sendTraceMessage("[context.before] A pair has been played!", "ChikenJokeyTraceLogger")
      card.ability.extra.active = true
      card.ability.extra.Xmult = card.ability.extra.Xmult + 0.25
    elseif card.ability.extra.active and 
        context.destroy_card and 
        context.cardarea == G.play 
    then
      sendTraceMessage("[context.destroy_card] Destroying the cards", "ChikenJokeyTraceLogger")
      card.ability.extra.active = false
    end
  end
old bane
#

otherwise the full key would be j_j_chikenjokey

hexed heath
#

what's the difference between the name and key of a joker

radiant plank
#

great info im going to try removing the j_

spring lantern
tall wharf
#

hi alrexx

spring lantern
#

Joker vs. j_joker

hexed heath
#

ah

spring lantern
#

herllo

old bane
hexed heath
#

thanks

wintry solar
#

That’s not true

spring lantern
#

😨

old bane
#

well

radiant plank
#

still not seeing my issue :'(

old bane
#

name in a SMODS joker definition doesnt work really

#

but name in a loc file/definition is what you see

spring lantern
#

name is some like vanilla thing i think actually

wintry solar
#

name as in card.ability.name is in vanilla the name of the joker, but in a smods joker object you can set it, or it’s auto populated with the key. It’s recommended that you check the key of a joker to find what you’re looking for to stop mod conflicts

red flower
old bane
#

keys are really important because if you have multiple mods that have the same joker name SMODS can still know which joker is which

hexed heath
#

alright, thanks

radiant plank
#

wtf really how

radiant plank
red flower
#

post log

radiant plank
#

holy shit i think i see it

#

i was spelling chicken properly

radiant plank
#

THAT WAS IT LOL

tall wharf
#

bro spelt properly unintentionally

radiant plank
#

fml

red flower
spring lantern
#

yea it appears in my collection

red flower
#

maybe you are unlucky

spring lantern
#

i set the weight to 20 and it still didn't show up

old bane
#

nuuu

spring lantern
#

if this shit dont work im done

old bane
#

you can also always just debugplus it

spring lantern
#

okay there it is

radiant plank
#

well now that i can actually work with this

spring lantern
#

i just wanted to make sure it does show up in the shop

sturdy monolith
#

how could i add a tag based on the currently hovered over tag in the collection with a keybind? trying to add more stuff to the debug menu and this isn't working for some reason (sorry for the picture instead of a screenshot, my laptop doesn't have Internet at the moment)

radiant plank
#

can someone direct me to how i check for a hand being the first hand played?

sturdy monolith
red flower
#

yeah

sturdy monolith
red flower
sturdy monolith
#

are you using debugplus?

red flower
#

yes

sturdy monolith
red flower
#

oh

#

well just copy what that does if you dont want to use it for some reason

sturdy monolith
red flower
#

if i help you i would just use that code so it would be the same

uncut grail
#

dusk 2 and dusk 3: the graveyard pack

sturdy monolith
#

but my implementation won't work

#

which is why I'm asking for help

sonic cedar
#

the cycle

sturdy monolith
minor furnace
#

how does one add custom text to challenge descriptions

sturdy monolith
#

God that was delayed

minor furnace
#

localization file in the first image?

red flower
#

yes

minor furnace
#

my favorite 🙃

uncut grail
#

they grow up so fast 😢
the dusk lookalikes are gone forever..

hushed field
#

If I want to make a card visually disappear with a dissolve effect, and then move it to another card area, is the trick to just copy the start_dissolve implementation and remove literally just the event that containst the remove call?

red flower
#

thats what i would do

dense vector
#

The shovel

opal holly
#

3 probability checks, based off those scratch cards

red flower
#

omg fauna

#

you should use {X:mult,C:white} for xmult

opal holly
#

oh yeah oops

minor furnace
#

we are so back

#

and I've already proved it's beatable

opal holly
#

i still need to do sana and baelz

old bane
#

random idea: special “attacks” as playing cards that are activated on discarding the cards

#

oh wait i can cook with this, imagine action commands from paper mario but using the playing cards

hexed heath
#

am i on something or onto something

old bane
#

ooh

#

i like the design of it

#

cause it could be a double edged sword

#

sometimes you dont want your enhanced cards all the time and sometimes you do

limber blaze
#

top here meaning next drawn right

hexed heath
#

yeah

#

it also ends up affecting the cards dealt for the tarot packs

#

so thats another tradeoff

zealous glen
#

but it was one of each

hexed heath
#

ooh

next timber
#

i had an idea for a joker or consumable or whatever that helps you get x of a kinds by moving cards of the same rank as ones your holding further up the deck

hard flume
#

new suits

#

bells and whistles

minor magnet
minor furnace
#

there are no base game challenges that disable skipping, right?

bronze ocean
#

Hello, everyone!

#

I started playing around with mods about 2 days ago by modifying the Ace in the Hole deck mod I found here. Basically the same, but with a config menu

However, this mod was originally made last year so it's not up to date with how it should (?) be done

I'm going to re-write it like god intended, but I would like to keep this "original" (and wildly unbalanced) version archived somewhere. Should I start a new thread on modding? Or should I send the .lua file to the original mod's thread?

#1215144701586575360 message

old bane
#

also idea to throw out there: using SMODS.calculate_effect() to merge joker together using a sticker
(imagine stuff like Canio and Pareidolia together)

#

i know cryptid has like double sided jokers but having two effects in one joker always active would be hype

rugged pier
#

is there any documentation on what the weights are for different rarity of jokers? and can we make a new rarity that is a part of the same pool as an existing rarity? (just for visual purposes, creating a new rarity)

old bane
rugged pier
old bane
#

check the wiki not the code idk if that was clear 😅

rugged pier
#

oh cool, some common jokers are more common than the others?

#

thought its all a part of the same pool, pretty cool

rancid bridge
rugged pier
rancid bridge
#

the rarity is legendary
and the character is from a game called it's not me, it's my basement

rugged pier
rancid bridge
#

in the game they basically feed a "monster" (may or may not be their imagination) so that the monster doesn't get upset and eat them

red flower
narrow iron
#

when using add_card, what 'set' would playing cards be in?

red flower
narrow iron
#

ah okay

rugged pier
pulsar flower
red flower
rugged pier
narrow iron
#

oh theres create_playing_card() nvm

red flower
rugged pier
red flower
#

yes

rugged pier
#

awesome thats perfect, thank you!

rugged pier
#

idk something to do with steel cards? just giving that sort of vibe

sonic cedar
#

so this code i currently have should have this joker do its flip animation event after another joker triggers, but the problem is that the animation triggers twice. how can i fix that?

#

better crop that makes sense oops

normal crest
#

Do you have anything else before that context.other_joker check

rugged pier
#

for some reason, this set up for a new rarity is causing the following error

#

is there something else that i have to implement?

normal crest
#

Try putting your mod id before the rarity

#

In the Joker

sonic cedar
rugged pier
normal crest
sonic cedar
#

i didnt hit paste pretend i did

rugged pier
rancid bridge
normal crest
rugged pier
sonic cedar
normal crest
rugged pier
normal crest
sonic cedar
#

well how can i narrow the trigger down to only when another joker triggers its effect

normal crest
#

you need to add more conditions to filter the context you want

#

I'm not sure what contexts are available for that

#

If they're not in the wiki you'll have to experiment

#

Try logging the context

sonic cedar
#

elab?

wintry solar
#

Use post_trigger

normal crest
#

No need, eremel is here

#

Now I go

wintry solar
#

It should run after every joker trigger

old bane
sonic cedar
#

one sec

sonic cedar
#

?

thin anchor
#

anything wrong with this?

wintry solar
red flower
sonic cedar
thin anchor
#

oop

sonic cedar
#

could’ve sworn i tried it but maybe not

karmic arch
#

Hi chat!! I'm bad at coding, but why doesn't this code allow you to build full house
local get_X_same_test = get_X_same
function get_X_same(num, hand)
return get_X_same_test(num, hand)
end

sonic cedar
#

gonna try with the and thing for the hell of it

wintry solar
#

Oh you need to enable them too

#

They’re an optional feature

sonic cedar
#

what do

#

you mean enable?

#

that’s a thing? /genq

zealous glen
#

something like this

thin anchor
#

is this right

sonic cedar
zealous glen
wintry solar
#

It’s in the wip docs

sonic cedar
#

lifesavers

#

thanks guys

junior lily
#

does this look right? im trying to check if a scored card is a bonus card then create a random consumable but im not sure if im getting everything right so far

chrome widget
#

Remove the outer joker_main check and the return statement

karmic arch
rugged pier
#

why is the text white when i defined it as black in SMODS.Rarity

junior lily
#

dangit i forgot to install debug+

red flower
rugged pier
old bane
rancid bridge
#

is that all of the vars i need for it's effect or do i need more vars

red flower
#

not that i see at least

raw geyser
#

I'm trying to draw a high detail joker, but the stickers are tiny. Is there a way to scale them up?

rugged pier
thin anchor
#

is this how you delay code?

junior lily
wintry solar
rugged pier
thin anchor
#

i see

rugged pier
#

delay = seconds

thin anchor
#

thanks

red flower
rugged pier
rancid bridge
junior lily
dreamy thunder
sonic cedar
#

why is this considered a nil value? should it say G.jokers instead?

junior lily
dreamy thunder
#

return the print part and get rid of joker_main

thin anchor
junior lily
dreamy thunder
#

no

#

you still have

#

joker_main

junior lily
#

oop

rugged pier
# thin anchor so like this?
    trigger = "after", 
    delay = 5, 
    func = function() 
        print("Hello, world!") 
        return true 
    end
}))```
trigger should be first i believe
dreamy thunder
#
if SMODS.has_enhancement...
return{
print("beans :3")
}
dreamy thunder
#

take ifs out of return

junior lily
#

fixed

#

lets see if the game opens

#

okay it opens

red flower
#

take the return out too

#

you're not returning anything

dreamy thunder
#

oh wait

#

true

#

you dont need to return prints

#

😭

junior lily
#

it works

dreamy thunder
#

nice

junior lily
#

now to actually make it do something

thin anchor
dreamy thunder
#

i dont think you did

thin anchor
#

well

#

no

#

ok

dreamy thunder
#

what are you trying to do

thin anchor
#

apply enhancement to playing card
i know the code to do so isnt there but
yeah

#

its a tarot card

dreamy thunder
#

something like this should do the trick

#

but it doesnt have the flip

#

part

thin anchor
#

oh

dreamy thunder
#

you can play arround with it and add flip

junior lily
red flower
rugged pier
#
calculate = function(self, card, context)
        if context.before
            and context.cardarea == G.jokers
            and not context.blueprint
            and not context.retrigger_joker
        then
            card.ability.extra.xmult = 1
        elseif context.other_joker and context.other_joker.ability.set == "Joker"
            and not context.other_joker.debuff
            and context.other_joker.config.center.rarity == 'csmr_preserver'
            and not context.retrigger_joker
            and not context.retrigger_joker_check
            and not context.blueprint
            and context.other_joker ~= card
        then
                card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
                G.E_MANAGER:add_event(Event({
                    func = function()
                        context.other_joker: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,
                }
        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

I made a function to check if other jokers have the rarity "Preserver" and if they exist in the joker area then i want to give the current joker x1 mult. Right now based on the placement of the current joker, it does not count rest of the jokers in its xmult calculation. How would I fix it?

red flower
junior lily
red flower
#

yeah i think so, i might be mistaken tho

junior lily
#

alr

#

ty!

red flower
sonic cedar
#

where did i fuck up (this is in loc_vars btw)

red flower
#

#G.jokers.cards

junior lily
#

like the sets and for k v

red flower
#

in calculate because other mods can load after yours

junior lily
#

alright

sonic cedar
red flower
#

it shouldnt be

old bane
#

Would SMODS.ObjectType allow me to like group things together so I can easily disable them later

#

or like i forget what Cryptid uses but something like wht they do

sonic cedar
red flower
#

is it the same crash log

junior lily
#

it works :D

sonic cedar
red flower
#

oh it's in the collection?

sonic cedar
#

yes

red flower
#

you need to have a check if G.jokers doesnt exists

night juniper
#

is there any builtin thing for drawing a dynamic text object that has an updater callback function? i see there's a DynaText class in the game but can't find an example that has it auto-update, so if it does id appreciate anyone pointing me at an example of this use case

sonic cedar
#

would it be like if G.jokers = false or something

red flower
sonic cedar
#

oh i was close

night juniper
red flower
#

i know UIT.T does

old bane
sonic cedar
#

!

night juniper
# red flower i know UIT.T does

im using UIT.T and keeping a ref to the node but i guess passing it to create_tab clones it so my ref gets stale / doesn't affect the actual object being rendered

#

I'll try DynaText with ref_table, thanks

night juniper
#

someone's contributing the settings page & i wanna make that smol addition

#

(never tried writing UI before because the game's ui code scares me)

red flower
old bane
#

basically what N said, I admittedly am not the best at balatro UI (i struggled for a while with my own config tab)

red flower
#

everyone asks me for UI stuff so I guess I know things

thin anchor
red flower
next timber
#

is there any way to make a card return to the player's hand after being played? other than just destroying it and remaking it which ideally i dont want to do

sonic cedar
#

i think i messed up rendering that card copying compatibility ui thing

rugged pier
# red flower can you elaborate on the effect? i dont completely get it

so i have a few jokers that have a rarity type called "Preservers" (same as uncommon, think of baseball bat that gives 1.5x mult to each uncommon card), i want this joker to gain 1x mult for each of those jokers the player owns.

The current implementation does that but its positional, i.e., if the joker is placed in the first position and there are 4 "Preservers" after it, it would just give 1x mult instead of 4x.

sonic cedar
#

cause it's not showing up

old bane
daring fern
red flower
rugged pier
red flower
#

if you need the message then do it in before

rugged pier
#

so it would be if context.joker_main and context.before
for k,v in ipairs(G.jokers.cards) do
xyz

#

?

red flower
#

context.joker_main and context.before don't happen at the same time

#

just one of those

heady siren
#

context.before is used for stuff like hand upgrading jokers like Spare Trousers and Runner and the card modifying jokers like Vampire and Midas Mask

red flower
#

if they need to have an animation of the joker "upgrading" like they have now then i think it's the right context

sonic cedar
#

should it not be in loc_vars is that the issue

#

cause then where should it go instead

red flower
#

no thats correct

sonic cedar
#

generate_ui mayb- oh

red flower
#

are you returning the main_end?

sonic cedar
#

in that case yeah it doesnt show the thingy

sonic cedar
#

theres no way i did the same mistake twice

radiant plank
#

how exactly does the context.remove_playing_cards context work? is it run once for each card or is there a table i can read from to see info about the cards destroyed

red flower
#

context.removed is a list of cards

radiant plank
#

thank you

next timber
#

which context would be correct for running a function on a card in a scored hand just before its sent to the discard?

sonic cedar
red flower
sonic cedar
#

(brb)

red flower
stiff nest
#

hey all, if i wanted to ask a quick question about a difficulty im having with textures, would i ask that here or in another channel? 🤔

chrome widget
#

Does anyone know off the top of their heads where the actual position of cards within a cardarea's array is set during/after a drag? I want to make a soft separation in my consumable area between types of items so that you can't mix the two types (for ease of organization basically)

red flower
stiff nest
#

ahh fair

#

i just slapped my texture image into the game files but for some reason specifically scholar maintained its texture lol

red flower
#

you could try using malverk for it

stiff nest
#

ill look into that

#

but if anyone knows why this might be happening id love the advice
(and if anyone knows please ping me)

#

FOUND IT
There are two scholars in the asset

limber blaze
next timber
#

bit of a dumb question but is it more accurate to do pseudorandom('seed') < probability or pseudorandom('seed') <= probability?

sonic cedar
hushed field
next timber
#

👍

#

oh also how do i make my custom suit not show up in decks unless i specifically want it to show up in a custom one?

#

the wiki page for suits does mention something like it with in_pool but im still not really sure how to use that

rancid bridge
#

now i'm stuck at calculate...

night juniper
#

i like bright text themes, my fave is moonfly

digital niche
#

how do i start in modding?

next timber
#

download lovely, download steamodded, look through the steamodded docs

digital niche
#

tyy

next timber
#

np

#

youll end up asking a lot of questions here still but such is the nature of modding

digital niche
#

yeah im sure i will ask a bunch of stuff, specially since its my first time in lua language

hushed field
digital niche
#

tyty!

chrome widget
#

Hmm I'm getting a crash here

    table.sort(self.cards, function (a, b)
        if a.ability.set == 'Stand' and b.ability.set ~= 'Stand' then
            return true
        end
        return a.T.x + a.T.w/2 < b.T.x + b.T.w/2 
    end)
end```

I tried to add this hook to the CardArea:align_cards() function to make it so my Stand cards are always soft-grouped on the left side of the consumable area, but for some reason, it says this sorting is invalid if and only if I have more consumables than available slots due to using debug tools. Anyone got a clue?
heady siren
#

Do jokers trigger their remove_from_deck function when blueprint is moved off of them? If not, how could I make something trigger when the blueprint is moved off?

chrome widget
#

Okay nvm I just had to put a specific inverse check and return false apparently

digital niche
#

what exactly is a key?

heady siren
#

So there's the Space Joker, but internally it's called j_space

chrome widget
#

in a programming sense, a "key" is the identifier of a value in a key-value pair. The entirely of lua is structured as tables with keys and their paired values

   key = 0
}```

So the key for this value of 0 is 'key', or `table.key`
digital niche
#

there is the

SMODS.Class {
    key = 'key',
    other_param = 0,
    loc_txt = {
        -- ...
    },

part, the "key" should be what? like the name or something?

manic rune
#

anything

chrome widget
#

Just whatever you want to identify it as

heady siren
#

The key should be a simplified version of the name that you can reference back to later, all one word and without capitalization

digital niche
#

oh okok, like a variable in python right?

next timber
#

yeah like the variable name

digital niche
#

the class is just if its a joker, tarot, spectral etc right?

heady siren
#

Tarot and Spectral would fall under the Consumable class

#

But yeah

#

Remember to reference the documentation, all of the classes are shown on the right sidebar
https://github.com/Steamodded/smods/wiki

GitHub

A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.

#

You can also access the source code of Balatro by literally just extracting the balatro.exe file with 7zip

main mica
#

working on a diamonds skin :3

digital niche
#

ooh okok, tyy!

heady siren
#

So you can search around and see how LocalThunk did some stuff himself

next timber
#

in a suit's in_pool function, is there a way of telling if it's a vanilla deck or not?

heady siren
heady siren
next timber
#

what do you mean? i'm trying to stop my custom suit spawning in vanilla decks

#

do you mean take ownership of every vanilla deck or smht

heady siren
#

Oh, nevermind

#

I misunderstood

next timber
#

any clue how to check the current deck type then?

heady siren
#

I'm not really sure what you actually want to do, so

next timber
#

check if its a vanilla deck so i can return false in in_pool to stop it spawning in vanilla decks

#

i want my suit to only spawn in specific decks

last sentinel
#

What would be a function to call in context.discard to trigger cards with gold_seals when they're discarded?

next timber
#

can't wait to get the first version of my mod out, i wanna try modding Scoundrel into balatro after

digital niche
#

ok ive seen most of how to do the mods, but where do i actually make the mod (like, the code part)

sonic cedar
#

(vscode)

digital niche
#

didnt know bout that

sonic cedar
#

lua extension

digital niche
#

totally forgot about extensions

thin anchor
#

is this right

red flower
#

also please don't spaghetti code and put stuff in different lines

thin anchor
#

ok

next timber
#

how do i use a custom suit's text colour in a loc txt?

digital niche
heady siren
#

Decided to actually post my mod in #1209506514763522108, first time I've actually like, publicized a mod I've made

zealous glen
#

Integrated the effect with calculation. It seems to handle card destruction well enough; I wonder if it needs more safeguards, but it seems functional for now.

I wonder how to handle pop-up messages.

digital niche
#

how does mod compatibility work? cause i have looked over some mods files and neither cryptid or sleeves mod have the custom sleeves assets but it shows up ingame for some reason?

zealous glen
#

Anyways, the Red King

tepid crow
#

in short, CardSleeves defines the API to use, and Cryptid provides the effects/assets

tepid crow
rancid bridge
daring fern
rancid bridge
#

take ownership...

#

how would i do that

rancid bridge
red flower
digital niche
daring fern
#

Try this ```lua
SMODS.Enhancement:take_ownership('m_steel',
{
update = function(self, card, dt)
if #SMODS.find_card('jokerkey') > 0 then
card.ability.h_x_mult = 2
else
card.ability.h_x_mult = 1.5
end
end
},
true
)

#

I haven't tested it though.

thin anchor
#

how would i add a little info window about an enhancement?

daring fern
#

Replacing key with the key of the object.

rancid bridge
daring fern
#

Of all the code.

rancid bridge
#

so do i need a calculate function or

daring fern
digital niche
#

do i neeed to add lovely to the "dependencies" part?

rancid bridge
daring fern
digital niche
#

okok, ty!

#

did i do something wrong? just to be sure

zealous glen
tepid crow
rancid bridge
daring fern
rancid bridge
#

oh okay

limber blaze
#

is there any good way to include a raw plaintext "#" in localisation text

digital niche
thin anchor
tepid crow
digital niche
daring fern
thin anchor
#

ok

rancid bridge
#

i always do one thing wrong

#

i think i just forgot a "then"

red flower
limber blaze
#

makes sense

thin anchor
rancid bridge
daring fern
thin anchor
#

ok ok

rancid bridge
daring fern
#

Also you need to put G.P_CENTERS.m_prefix_redbulls

rancid bridge
#

WHAT?!?!??!? WHAT IS WRONG?!??!?!!?
JUST TELL ME!!!!!!!!!!