#💻・modding-dev

1 messages · Page 402 of 1

pale holly
#

well the popup message to explain the card doesn't appear but tbh i'm already thankfull the card on itself work

pale holly
solid mesa
pale holly
solid mesa
#

looks amazing too

pale holly
# solid mesa pretty strong

yeah, i wanted first to make it so it can also be any rank (or a unique rank) but outside of the fact i don't know how to do this, it would have also probably made the card a bit too powerful

pale holly
solid mesa
pale holly
#

i didn't knew indeed

#

took me a bit but it finally works

bold sleet
#

sun cards

pale holly
#

yeah that was the thing lol

bold sleet
#

I will forever react to whatever stupid bullshit I come across in english servers and is in spanish.

solid mesa
solid mesa
bold sleet
#

I don't know dialects, sorry

#

-# aranés at most, and I only know it exists. I don't know how it works.

#

-# note: catalán, gallego, etc are not being counted as dialects

solid mesa
#

i dont know what aranés is xd

bold sleet
#

-# well, programming guy, actually

solid mesa
bold sleet
#

Not quite.

#

I am not certain if they qualify as entire languages.

#

If they don't, they are between being a dialect and being a language.

solid mesa
#

oh i see aranes is pre-spanish

bold sleet
#

Again, I am not the guy who knows about these things.

bold sleet
solid mesa
#

and only talking in spain nowdays

bold sleet
#

I don't know the history of it.

#

Anyways.

#

Back to balatro modding.

solid mesa
#

ok

rapid stag
#

bump

solid mesa
bold sleet
#

back to trying to help peeps with balatro modding because I ran out of shit to mod in the game that doesn't take a bajillion years.

#

haven't touched deck skins in my life.

#

That would require me to well, know how to make pixelart.

rapid stag
#

do you know anything about the other issue at least

bold sleet
#

send code snippet

#

and forther explain your issue.

#

because fuck u trying to do?

rapid stag
bold sleet
#

Hooking functions and stuff?

rapid stag
#

what?

#

i'm not hooking anything or changing how invisible joker works at all

#

it was just like this by itself

#

invisible joker copied a custom joker and didn't immediately switch to its atlas, instead remaining on the default atlas

#

i can't answer your question because i'm not really trying to do anything

bold sleet
#

Let me check with my balatro copy

rapid stag
#

invisible joker is just being weird

bold sleet
#

It works just fine for me

#

How do you have your joker setup?

rapid stag
#

the joker it copied? it doesn't really mess with any of the draw stuff if that's what you mean. it's set up no differently than any of my other jokers. specifies an atlas and a position. then when i want to change it to a different sprite, i adjust the x or y in the position table and then call set_sprite_pos() with it.

i don't see how that can make invisible joker not switch to the correct atlas right away

bold sleet
#

no hecking idea, tbh

red flower
#

i did make a change to copy_card but it should only be for the card back

rapid stag
red flower
#

does it do this with the release?

rapid stag
red flower
#

weird

rapid stag
#

but that also fixes on loading the run

red flower
#

do you have any other mods?

rapid stag
red flower
#

your files are cursed

rapid stag
red flower
#

but kidding aside invis works well for me

#

idk

rapid stag
#

should i just patch a draw call after emplace in invis code

wintry solar
#

I wonder if it’s a malverk issue

rapid stag
#

...wait, invis doesn't change itself, it makes a new card. so it isn't trying to go from one atlas to another. it's just making a copy of the card object. that's even more confusing that it does this

#

i don't get it.

sturdy compass
#

Just gave this a go but seemingly no dice. Here's my derivative

SMODS.DrawStep { -- Derived from Ortalab
    key = 'footprint',
    order = 35,
    func = function(self)
        if SMODS.has_enhancement(self, 'm_mxms_footprint') then
            G.shared_stickers['mxms_footprint'].draw_major = self
            G.shared_stickers['mxms_footprint']:draw_shader('dissolve', nil, nil, nil, self.children.center)
        end
    end,
    conditions = { facing = 'front' },
}
#

I tried your method of creating a Sprite variable in the DrawStep too but it yielded the same result

outer basalt
#

I am still struggling 😭 (This is continuation of me trying to make active abilitys on cards I just havent been able to work on it for 2 days)

outer basalt
#

i made this while religiously stealing borrowing from N's code 😭

manic rune
#

ahh icic, i implemented this to my mod too, lemme cross-ref

outer basalt
#

hell yea

manic rune
#

first thing i noticed is that this should be G.C.WHITE

#

another thing i noticed is that you didnt clean up use_button ui properly (this is what you should do, im p sure)

wintry solar
cyan lagoon
#

i was thinking why i was getting the same 4 spectrals over and over, but this crashes if it's other than those 4

sturdy compass
manic rune
#

oh, also

wintry solar
manic rune
#

im pretty sure this will make your custom button not even showing up

sturdy compass
# wintry solar Can you show the code for creating the sprite?

Sure thing

SMODS.Atlas { -- Main Modifiers/Backs Atlas
    key = 'Modifiers',
    path = "Modifiers.png",
    px = 71,
    py = 95,
    inject = function(self) -- Derived from Grim
        self.full_path = (self.mod and self.mod.path or SMODS.path) .. 'assets/' .. G.SETTINGS.GRAPHICS.texture_scaling .. 'x/' .. self.path
        local file_data = assert(NFS.newFileData(self.full_path), ('Failed to collect file data for Atlas %s'):format(self.key))
        self.image_data = assert(love.image.newImageData(file_data), ('Failed to initialize image data for Atlas %s'):format(self.key))
        self.image = love.graphics.newImage(self.image_data, { mipmaps = true, dpiscale = G.SETTINGS.GRAPHICS.texture_scaling })
        G[self.atlas_table][self.key_noloc or self.key] = self
        G.shared_stickers['mxms_footprint'] = Sprite(0, 0, G.CARD_W, G.CARD_H, G[self.atlas_table][self.key_noloc or self.key], { x = 0, y = 4 })
    end
}

I had a print at the end of the inject function and it went off just fine. No other error messages either

outer basalt
manic rune
red flower
#

this is mine

manic rune
#

man

#

i literally spotted it just earlier, i

outer basalt
#

i hate brackets 😭

high stag
#

So I know that adjusting hand size via joker is typically done via a function when the joker is added or removed

I want to have a joker add hand size based on how many jokers of a certain set are in play (sort of like how baseball card triggers per Uncommon)

what context and functions would I need to utilize? could I do it at round start like how Burglar adds hands? Or would it be better to do it at the end of each hand score count, for if someone sells one of the other Jokers during the round?

tawdry shale
#

is my SMODS outdated or am i doing something wrong

red flower
#

probably outdated

manic rune
#

what version is your smods

#

you cut off that part 😭

tawdry shale
#

hold on

sturdy compass
#

1404g???????????????????????

red flower
#

yeah very outdated lol

tawdry shale
#

am i grandma

#

oh yeah

sturdy compass
#

YES

manic rune
#

can you make me some cookies :3

tawdry shale
#

lmao

sturdy compass
#

LMAO

tawdry shale
#

sure :3

sturdy compass
#

banger

tawdry shale
#

well god damn it now i gotta reinstall

#

hopefully my stuff won't become outdated

manic rune
#

is there a context for when jokers are removed from deck yet

wintry solar
outer basalt
#

I always feel conflicted when i get a new crash. is this me having fixed the old crash to discover new crashes, or have I made it worse.

sturdy compass
manic rune
#

hopefully someone will correct me :3

outer basalt
sturdy compass
tawdry shale
sturdy compass
sturdy compass
wintry solar
#

It’ll need the right args passing to draw shader

sturdy compass
#

I'm referencing the drawstep code for seals and stickers rn and it doesn't look like they have different args?

wintry solar
#

Huh

sturdy compass
#

Huh indeed

#

This is the main line I'm looking at since I'm pretty sure that's the actual sprite while the second one is for the shine

pure salmon
#

is anyone familiar with the plasma deck balancing code? i have this and it works but visually has no effect. what functions does plasma use for juice?

red flower
#

this is plasma but only for chips?

pure salmon
#

adds mult to chips

wintry solar
pure salmon
#

i mean the visuals, like the balanced text etc.

red flower
#

you can search for if key == 'balance' then in the smods utils to see the visuals

pure salmon
#

thank you

sturdy compass
outer basalt
#

actually. its the local ret line

wintry solar
#

What is that line supposed to be for

outer basalt
#

hook (?)

manic rune
#

what "ret" are you returning here 🤔

#

wait nvm

#

no, thats not what i told you to do

red flower
#

yeah that's not how hooks work

outer basalt
#

😭

outer basalt
#

peak understanding

#

by top do you mean in the function or above the function

manic rune
#

in the function

#

anything below local ret = ... means the code runs after everything in the initial function has already been run, which means your buttons wont be overridden

outer basalt
#

gotcha

wintry solar
#

Before the function too is wrong

cyan lagoon
#

why does this only create the fallback card?

#

though that also creates the 4 cards i commented

outer basalt
#

okay it didn't crash on start up but when i clicked new run. pointing to line 62 which is

manic rune
#

wheres card_highlight_ref

#

please dont tell me you removed that sob

outer basalt
#

i might be a little dumb

#

the comment is there for a reason LMAO

manic rune
#

😭

#

honestly ur doing much better than me when i first started, N' can confirm

#

keep going :3

red flower
#

i cant you were always amazing

manic rune
#

ignore whatever the man above me has said

#

oh wait

manic rune
#

if you place it there, it will always remove the buttons sob

#

oh wait, not there

#

uhh inside the if statements to create the new buttons

#

:3

keen loom
#

why is my description empty?

outer basalt
#

higlighted ????
ive looked through my code and I dont see that typo on my end but also highlighted isnt looking like a word anymore

manic rune
#

your localization is set up wrong

outer basalt
#

its not even the variable causeing the crash im just 😭 i think im going insane

#

one could say

#

even crashing out

manic rune
#

insane? i was insane once

manic rune
outer basalt
#

I like havent changed anythign ive just been looking at higlighted in the crash log 😭

manic rune
keen loom
# keen loom why is my description empty?

this is how the description look in the localization file

                name = 'Skater Cookie',
                text = {
                '{C:chips}+#1#{} Chips, {C:mult}X#2#{} Mult',
                'Gain {C:chips}+#3#{} Chips for each card played,',
                'and {C:mult}X#4#{} Mult at end of round.',
                '{C:inactive}(Currently {C:chips}+#5#{}{C:inactive} Chips, {C:mult}X#6#{}{C:inactive} Mult{}'
                },
            },```
red flower
#

i do fix the typo of highlighted in my code

outer basalt
# manic rune

im going to rewrite the entirety of balatro to fix this. - artist who came to front just to air his greivances

manic rune
#

😭

manic rune
red flower
#

no

#

that's their name

manic rune
#

...$10???

#

i think i might have a career idea going on here

outer basalt
#

oh shit i never thought of making balatro jokers irl < has a deck of cards im customizing

#

in my defense I started the project before i played balatro i just love cards

manic rune
outer basalt
#

uhh i gotta go do something rq ill be back in like 5

manic rune
#

-# but also, i dont recommend having uppercase letters in keys, i still cant remember why but someone told me so

keen loom
#

anyways, i'm so not enthusiastic about somehow implementing an element type system

onyx sonnet
north swallow
#

how would i make it so that this code plays a different sound effect if it has a certain edition?

outer basalt
outer basalt
#

im going to have beef with this goddang button

daring fern
outer basalt
daring fern
outer basalt
#

wdym by set the reference?

#

oh nvm i think i figured it out 😭

north swallow
#

does anyone know why opening this booster pack crashes the game?

outer basalt
#

check the line its pointing to. I think you called a function that wants a table?

wintry solar
#

What card is it supposed to contain

north swallow
outer basalt
lyric wadi
#

chat how do you check what a different joker returns

north swallow
wintry solar
#

And have you actually created that type?

north swallow
#

not a file of my mod

lyric wadi
#

like i want to check not just when the joker to the left triggers, but specifically what it's doing

north swallow
lyric wadi
#

e.g. i want to check if a joker to its left is returning a +mult, +gold, or +chip,

#

how would i do that

shut crater
# north swallow thats like a lovely file

The error is coming from that line, so even though it's not in your mod, something about your mod is causing that line to throw an exception. Looking at that file can help you understand where the issue is coming from.

Better yet, if you showed the whole stack trace of your error, we could see the function that you're calling and pinpoint the exact line in your file that's causing the error

#

Now probably it's just that you've set up something wrong with your set

wintry solar
#

I’m 99% sure it’s an issue with trying to create a card of the custom set but I don’t have access to my source code rn

shut crater
#

But it would be good practice to learn to read the stack trace

shut crater
wintry solar
#

No

shut crater
#

Ok that's what I thought

wintry solar
#

My guess is that the set just isn’t a thing

#

But I haven’t done any custom sets for anything so I’m not 109%

normal crest
outer basalt
#

colour error..
I did find one color in my code but i fixed it but the crash did not change at all

shut crater
red flower
normal crest
outer basalt
red flower
#

i see these two crashes a lot lol

north swallow
normal crest
#

To create a custom set that you can spawn using create_card, as an example, declaring the pool in the joker definiton is not enough

#

You have to also define an SMODS.ObjectType which should be on the wiki

north swallow
#

ohhhh

#

ok ik what you're talking about

#

hold on let me try that

#

yup! it was that

shut crater
north swallow
#

i forgot i had to SMODS.ObjectType

#

ty all

brittle tide
#

hey, im making a joker that when sold halves the number of chips required by the boss blind, is there a variable i can access or way i can change the visible chips required? i've got the joker functioning fine, but i'd like to give a more clear visual cue for the player

normal crest
#

G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)

brittle tide
#

Thank you

normal crest
#

To update the texr

#

You can also G.GAME.blind:wiggle() to make it move

#

Tho it's not very visible

outer basalt
red flower
#

idk i would need to see the code

outer basalt
tawdry shale
#

i'm trying to make a spectral card that applies a custom seal but i'm getting this error (i didn't code the seal stuff yet it's just visuals)

red flower
red flower
normal crest
#

In set_seal ^

outer basalt
red flower
#

you're still missing the ones in the nodes =

#

nodes = { { n = G.UIT.C, ...} }

outer basalt
red flower
#

here i mean in the screenshot i sent before

#

i never looked at the earlier part of the code

outer basalt
#

😭

red flower
outer basalt
#

okay now i understand 😭 I need like. youtube red arrows to point for me LMAO

#

ABSOLUTE W (ignore the fact its bright yellow. i vastly misunderstood the colour crash 😭)

#

the sell button kinda died i guess but i think having my own sets precedence in excitement

#

(also i kinda predicted that it would vanish but I have an idea on how to fix)

hybrid shadow
#

how do i make a planet card show up after playing the hand type, similar to the vanilla ones that use a secret hand

normal crest
#

In the planet config set softlock = true

hybrid shadow
#

is this all i need then, excluding the stuff that goes in the localization file

normal crest
#

You're missing a position for the sprite

hybrid shadow
#

lemme double check if my other cards that have an atlas of just one card needed a position in order to work

red flower
#

they dont

#

it defaults to 0, 0

normal crest
#

yeah in that case you don't need it

red flower
#

hi srockw how are u doing

modern kindle
#

Super cool people in chat rn

normal crest
#

hi n I'm super boredd

red flower
keen loom
#

i worked so hard on my 4 jokers, only for them to be too op 😭

red flower
modern kindle
red flower
normal crest
keen loom
red flower
#

make more common commons

keen loom
#

and i haven't even implemented the element system

keen loom
#

i didn't knew these 4 will stack up the score too much, it's around 12k if positioned properly

devout badger
#

okay guys I'm new to modding and I need to know if I'm stupid rq

red flower
outer basalt
normal crest
devout badger
#
calculate = function(self, card, context)
        
        if context.individual and context.cardarea == G.play and not context.blueprint then
            card.ability.extra.sum = ( card.ability.extra.sum + context.other_card:get_id() )
                return {
                    card = self
                }
        end
        
            if context.joker_main then
                card.ability.extra.root = ( card.ability.extra.sum % 9 )
                if card.ability.extra.root == 0 then
                    return {
                        mult_mod = card.ability.extra.nine,
                        card = self
                    }
                else
                    return { card = self }
            
            end

        end
    end``` whenever I try to score this
#

I get this

normal crest
#

card = self is the issue

lyric wadi
#

happy with this concept but it does feel a bit much

#

what do you think

devout badger
normal crest
#

Both

#

All 3

#

Didn't see the first one

devout badger
#

ok now it doesn't crash on scoring

#

and the reason it wasn't scoring was because I somehow wrote mod_mult in the return instead of mult

#

can I use context.pre_joker safely to trigger something after context.individual but before context.joker_main

normal crest
#

I think pre_joker is for editions

devout badger
#

I need to trigger an upgrade after iterating through the scoring hand with context.individual so it can't go in context.before

normal crest
#

The scoring hand is available during context.before

#

Unless you want to do something whenever a card scores?

devout badger
#

but then I'd have to iterate through it manually instead of using other_card

daring fern
devout badger
normal crest
#

its an opportunity to learn then

daring fern
devout badger
#

I assume v is value here

pure salmon
#

i usually substitute v for playing_card

#

makes it a bit more obvious what it's referring to

devout badger
#

is k the loop index or suit

red flower
#

i use pcard because im lazy

pure salmon
#

index

#

starts at 1 (thanks LUA)

normal crest
daring fern
normal crest
#

Pairs just loops thru all the keys regardless of if they're numbers or not

pure salmon
#

nvm i always use ipairs instead, which i think is better if you know your list is integer-indexed

normal crest
#

yep it is

devout badger
#

I can just lua for index, playing_card in pairs(context.scoring_hand) do card.ability.extra.sum = card.ability.extra.sum + playing_card:get_id() end right

upper onyx
#

is there a way to use create_card to make a joker without it showing up? just save it to a variable for use in the code later? if not, is there a way to immediately and silently delete the joker afterwards?

devout badger
#

why does lua not have +=

left fox
pure salmon
red flower
left fox
#

Are there any good guides for modding balatro and where to get started and stuff

red flower
left fox
pure salmon
red flower
#

python is even missing ++

devout badger
pure salmon
#

python has them now, also C is archaic and i don't like it

#

grrrr low-level languages

devout badger
#

i would use python more if it didn't make whitespace part of the syntax

outer basalt
#

i've only really every used python </3

#

anyways. how to make the buttons.... better (same size. etc.)

#

And center the text 😭

red flower
#

uhh cant you just copy my code lol

outer basalt
#

I tried 😭

outer basalt
devout badger
#
if context.before and context.cardarea == G.play and not context.blueprint then
    
    for index, playing_card in pairs(context.scoring_hand) do
        card.ability.extra.sum = card.ability.extra.sum + playing_card:get_id()
    end
    card.ability.extra.root = ( card.ability.extra.sum % 9 )
    card.ability.extra.sum = 0
    if card.ability.extra.root == 0 then
        card.ability.extra.root = 1
        card.ability.extra.final_mult = card.ability.extra.final_mult + card.ability.extra.nine
        return {
                message = 'Upgraded!',
                colour = G.C.MULT,
                card = card
        }
    end
end```
is my loop set up wrong
clever rose
#

hey, im trying to get the entire description of a joker to change when a condition is met, but i wouldnt know how to update the text, is there a function or variable to change to accomplish this?

normal crest
#

oh nevermind

devout badger
outer basalt
normal crest
devout badger
#

it doesn't trigger the upgrade when I play a 9 high card

red flower
normal crest
sonic cedar
#

do you use context.main_eval for xmult gain? i want a joker's xmult to gain to trigger outside of scoring, and if a global variable is a certain value

normal crest
devout badger
tawdry shale
#

i'm trying to make this seal give x9 mult when there are 0 hands left and the score is less than the blind requires, whenever i hover over the card it crashes

normal crest
normal crest
tawdry shale
daring fern
normal crest
#

re-apply the seal or apply it to a different card

tawdry shale
normal crest
#

is it the same crash

tawdry shale
#

forgot to mention

tawdry shale
daring fern
tawdry shale
wintry swallow
#

how do I get the current amount of money the player has?

daring fern
zealous glen
#

not sufficient

#

also needs the buffer

zealous glen
outer basalt
#

what is the key for blackhole

daring fern
outer basalt
#

awsolme

wintry swallow
#

how do I compare the money to a number? because when I do something like" (G.GAME.dollars + (G.GAME.dollar_buffer or 0)) <= 0" the game just crashes

daring fern
wintry swallow
wind steppe
#

didnt notice it

daring fern
wintry swallow
wintry swallow
wintry swallow
sonic cedar
hybrid shadow
#

is k_planet_q the default badge for planet cards?

latent raven
#

Hi, im currently trying to fix my friends mess of code. its supposed to upgrade the joker with a +1 mult increase when diamond suit cards are scored and also destroy them after scoring

#

I might need help with this

wind steppe
latent raven
wind steppe
#

this reads like someone who's writing code to be read by someone who knows nothing about programming

hybrid shadow
wind steppe
#

none of this does what it says it does

latent raven
#

yeah

wind steppe
#

wtf's going on with the remove_from_deck

latent raven
#

idk 😭

wind steppe
#

does the game crash when you sell this joker?

latent raven
#

probably

wind steppe
#

i'd have to imagine so considering card.ability.extra.discard_size isn't real

latent raven
#

😭 bro what was my friend trying to do

wind steppe
#

notably the diamonds don't actually do anything other than show a message cause mult is 0

#

also thats a five dollar common with no econ capabilities wtf

hybrid shadow
#

card crashes when i hover over it w/ message saying 'colours' is nil

wind steppe
#

you need that for {V:1} i think

outer basalt
#

i know because mine still has comments from it 😭

wind steppe
outer basalt
#

if it aint broke dont fix it

wind steppe
#

they're probably not even right though???

outer basalt
#

besides it helps with switch n shit /sys

hybrid shadow
wind steppe
#

not everything is context.joker_main

wind steppe
outer basalt
#

that never confused us lol. its like the one thing we got right away 😭

latent raven
#

ok I started rewriting that entire code and I need some help. each scored diamond card should give the joker a +1 mult and after that it destroys them

#

oh wait damn

wind steppe
#

oh wait context.other_card doesn't always exist

red flower
#

that looks like it will crash yeah

latent raven
#

damn

#

uhh what context could I use

wind steppe
#

put the first if in an if context.individual and context.cardarea == G.play then

latent raven
#

like that?

wind steppe
#

please deindent the one line inside it though

#

it doesn't matter but it looks bad

latent raven
#

yeah I'll do that

#

thanks!

main minnow
#

currently trying to make a joker that modifies lucky card trigger probabilities and i'm not sure of the best way to go about it - i'm guessing i'd need to somehow override the default Card:get_p_dollars() and Card:get_chip_mult() functions within the custom joker definition?

wind steppe
red flower
#

im pretty sure lucky cards are hardcoded

wind steppe
#

thats stupid

red flower
#

unless that changed recently you would need to patch

wind steppe
#

take ownership of magician then

#

and make your own lucky cards

tawdry shale
zealous glen
#

SMODS might redefine vanilla Enhancements

#

not sure

red flower
#

it does for glass but not for lucky iirc

#

i only know because i see this asked a lot

wind steppe
tawdry shale
wind steppe
latent raven
#

How do I make the played cards destroy itself?

wind steppe
# latent raven How do I make the played cards destroy itself?
para_consumefood = function(card)
    G.E_MANAGER:add_event(Event({
        func = function()
            play_sound('tarot1')
            card.T.r = -0.2
            card:juice_up(0.3, 0.4)
            card.states.drag.is = true
            card.children.center.pinch.x = true
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.3,
                blockable = false,
                func = function()
                    card:remove()
                    return true
                end
            }))
            return true
        end
    }))
end

this is for food jokers but i would assume you could just input other_card instead

#

idk i haven't tested it

red flower
#

dont do that with playing cards

#

use context.destroy_card

wind steppe
#

isn't context.destroy_card on destroy?

#

instead of doing destruction

red flower
#

no that's remove_playing_cards

#

destroy_cards is to destroy during scoring

hybrid shadow
#

this returns nil whether it's card or center

tawdry shale
hybrid shadow
tawdry shale
tawdry shale
latent raven
red flower
hybrid shadow
#

(ignore the other parts of the context that's just part of the joker i screenshotted)

#

actually context.cardaea == G.play would be smth for you to use if you only want to destroy diamonds played

latent raven
#

yeah I want only played diamond cards to be destroyed

hybrid shadow
latent raven
#

after that its return { remove = true }?

hybrid shadow
#

if the conditions are set right, it should destroy only the diamonds cards in the played hand (though it will also destroy any unscored diamonds cards in played hand)

latent raven
#

like this?

#

nvm it crashed

hybrid shadow
#

lemme double check the cardarea for scoring cards (you just want to destroy scoring cards right?)

latent raven
#

yes

red flower
latent raven
#

oh it works

#

thank you very much

zenith sage
#

printing any information out of a table (with lovely?) returns nil, its driving me crazy does anyone know anything about it

#

like

for k, v in pairs(context.scoring_hand) do
    if v.edition then
      print(v.edition)

prints nil

#

also tried edition_type

#

and i should say returns not just prints, checking for the editions just pretends like they dont have any

hybrid shadow
# latent raven like this?

if it destroys unscoring cards try the cardarea G.scoring or some variation of that (i forget what variation actually works)

hybrid shadow
keen totem
#

how can i make a joker do its own effect multiple times?

#

(and make it so if it gets retriggered then it does that effect multiple times)

zenith sage
red flower
hybrid shadow
red flower
#

yeah i see, thats not what i asked

#

at what timing i mean

#

in what context

hybrid shadow
#

ah

zenith sage
#

        if context.cardarea == G.jokers then
            if context.before then
                if next(context.poker_hands['Pair']) then
keen totem
#

id assume something to with a bunch of retriggering

willow scroll
#

is there a simple way to replace the title screen texture? ive followed the example mod for deck skins but a quick glance through the documentation doesnt show an easy way to change the title screen texture

zenith sage
#
calculate = function(self, card, context)
    if context.cardarea == G.jokers then
        if context.before then
            if next(context.poker_hands['Pair']) then
                for k, v in pairs(context.scoring_hand) do
                    print(v.edition)
                    print(v.edition_type)
#

both nil

red flower
zenith sage
#

i think i saw somewhere it was a lovely bug but tamershrug

red flower
#

are you sure they have an edition lol?

zenith sage
#

pretty sure :p

#

ill run a quick test

#

pair, one has an edition (foil)

#

so it should, before scoring, detect a pair and iterate through those 2 cards, find the one with the foil edition, and print its edition

#

the first thing, v.edition is probably a bool

#

but both just return nil

#

i did find a workaround though

#

very jank code, it hurts me, but

#
calculate = function(self, card, context)
    if context.cardarea == G.jokers then
        if context.before then
            if next(context.poker_hands['Pair']) then
                local edition_one
                local edition_two
                for k, v in pairs(context.scoring_hand) do
                    print(context.scoring_hand)
                    if v.edition then
                        if(v.edition.holo) then
                            print("holo")
                        end
                        if(v.edition.foil) then
                            print("foil")
                        end
                        if(v.edition.negative) then
                            print("negative")
                        end
                        if(v.edition.polychrome) then
                            print("polychrome")
                        end
red flower
#

v.edition is a table

zenith sage
#

that does the trick

zenith sage
#

probably, it does store the correct value but lovely's print function just cant handle tables at all

red flower
#

oh maybe lovely doesnt print tables? you should try debugplus

zenith sage
#

same conclusion, ill give it a try

cyan lagoon
#

why does this only create the backup card?

keen totem
#

does context.after literally do it after all scoring

cyan lagoon
#

yea

keen totem
#

like after the round total chips are added

#

i thought it was after everything but at least before it put the cards back in your deck

red flower
#

it's after scoring the chips, why?

keen totem
#

idk

red flower
#

lol

urban wasp
#

is there a way that i can have a joker return mult = naneinf or the like without the score turning into fake infinity?

keen totem
#

like virus cards are going back into the deck before doing their conversion animation

sonic cedar
#

reasking now that im back
can i call a joker's xmult upgrade using a global that's only modified in a take_ownership, or would i have to do something else? (global in question is highlighted)

red flower
keen totem
#

i think its all cryptids fault

#

because it was working before i turned cryptid on

red flower
sonic cedar
#

you're asking me like i'd kno-OH I SHOULD ADD THIS IMAGE IN

#

important image i straight up just left out

#

everything except the xmult gain works perfectly

red flower
#

i mean like

G.GAME.chudhit = G.GAME.chudhit + 1
SMODS.calculate_context{chudhit = true}

and then use context.chudhit

red flower
brittle tide
#

I'm making a joker that gives a card that has a random enhancement, seal, and edition when blind is selected and while I've gotten edition and seal working it keeps returning an error for enhancement and I'm wondering if it's because of my "set_enhancement" line. Is that the problem or am I missing something?

red flower
#

set_ability

brittle tide
#

thank you

sonic cedar
red flower
#

yes

keen totem
sonic cedar
#

wont that clash?

red flower
#

that's just the name of the context

#

it's not the same value

red flower
sonic cedar
#

in that case it's test time

cyan lagoon
willow scroll
red flower
#

the title logo is G.SPLASH_BACK

#

i think pokermon replaces it you can check that

willow scroll
#

thank you

sonic cedar
outer basalt
#

what. is happening to the consumable slots

hybrid shadow
wind steppe
outer basalt
#

nope

spring lantern
#

the screenshot is me trying to diagnose the issue

sonic cedar
tawdry shale
#

i'm trying to make it so a seal does x9 for the first scored card that has the seal and does x9 mult if the score is less than the blind requirement

#

it does the x9 mult in final scoring step but it doesn't get the final round score

elfin stratus
#

guys

plush depot
#

how should i draw an N instead of a J for my joker

elfin stratus
#

can i get a list of the cards i currently i have in hand?

keen totem
#

just draw it

plush depot
#

no like whats the font

keen totem
#

doesnt have one

#

its handwritten and inconsistent

spring lantern
#

just feel it

keen totem
#

egg and jimbo arent even the same font

#

jimbo has one less pixel

urban wasp
#

is there a way that i can have a joker return mult = naneinf or the like without the score turning into fake infinity?
-# asking again

hybrid shadow
keen totem
#

do you really need to set mult to naneinf?

plush depot
#

is this look good

urban wasp
#

with talisman

plush depot
urban wasp
plush depot
#

no i mean the N

wind steppe
urban wasp
#

my mod is literally called shitposting

wind steppe
#

fair enough

elfin stratus
hybrid shadow
# urban wasp yes

are you not able to just have an if statement for whatever level of talisman and then have the mult be the max for whatever level it is?

urban wasp
#

i'm not sure how to do that, is all

wind steppe
urban wasp
#

like this is my current code

SMODS.Joker {
    key = "gamblecore",
    config = { immutable = { numerator = 1, denominator = 255 } },
    rarity = 2,
    atlas = "crp_placeholders",
    pos = { x = 3, y = 0 },
    cost = 5,
    blueprint_compat = true,
    demicolon_compat = true,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.immutable.numerator, card.ability.immutable.denominator } }
    end,
    calculate = function(self, card, context)
        if (context.joker_main) or context.forcetrigger then
            if pseudorandom(card.ability.immutable.numerator, card.ability.immutable.denominator) then
                return {
                    mult = math.huge
                }
            end
        end
    end,
    crp_credits = {
        idea = { "Unknown" },
        code = { "Glitchkat10" }
    }
}
#

but math.huge = fake infinity

hybrid shadow
wind steppe
urban wasp
#

yeah but like how

hybrid shadow
keen totem
#

naneinf is, by definition, not a number

urban wasp
#

yeah

willow scroll
# red flower i think pokermon replaces it you can check that

im very much not familiar with lua, where in here is the x position? I need to move the texture a bit to the right

    local balala = "balala"
    G.SPLASH_LOGO = Sprite(0, 0, 
        13/333*389*SC_scale, 
        13/333*389*SC_scale*(G.ASSET_ATLAS[balala].py/G.ASSET_ATLAS[balala].px),
        G.ASSET_ATLAS[balala], {x=0.0,y=0})
keen totem
#

so you cant exactly do that

plush depot
#

hes sad and crying

solid mesa
urban wasp
#

yeah i just don’t exactly know how i could manage this

keen totem
urban wasp
#

ah true

wind steppe
#

omeganum is massive

solid mesa
urban wasp
#

i’m not really asking how big it is tbf

keen totem
#

omeganum is also not a number

#

its a table

solid mesa
plush depot
#

what should he do

elfin stratus
plush depot
#

the noker

solid mesa
#

so it's a matrix?

keen totem
#

its a table

plush depot
solid mesa
solid mesa
#

walltext xd

elfin stratus
#

i want to pick a random card from current hand

#

then extract info from that card

hybrid shadow
solid mesa
#

i read that down worry @wind steppe

willow scroll
elfin stratus
wind steppe
plush depot
keen totem
willow scroll
hybrid shadow
#

im just gonna go take my test and bump my earlier issue later

wind steppe
willow scroll
#

wait i cannot read

#

yes it replaces a suit

plush depot
#

is this good wording or should i change it?

north lodge
#

-4 mult when a blind is beaten. After reaching -40 mult, instead give +100 mult
imo is better for that effect.

plush depot
#

alr

north lodge
#

You definitely need to specify when the mult is subtracted, hence why I added "when a blind is beaten"

#

Then you also need the current mult counter at the bottom

plush depot
#

how do i make that count

outer basalt
plush depot
outer basalt
#

ya but theyre negative

#

so it should bump up to 8

plush depot
#

it dosent feel like it

gentle rain
#

how come my injection (left) isnt working on this script (right)? none of the print() functions go off when i try to trigger it by using a planet card

red flower
cyan lagoon
gentle rain
north lodge
# plush depot how do i make that count

Welcome to the Balatro Modding 101 tutorial.

In this beginner-friendly guide, I'll walk you through the steps to get started with modding in Balatro. Whether you're looking to install mods created by others or dive into making your very first mod, I've got you covered!

Links!:
https://github.com/Steamodded/smods - Steamodded
https://github.com...

▶ Play video
#

That timestamp talks about the text part and such.

wintry swallow
#

does anyone know why this line crashes? self.ability.extra.mult = self.ability.extra.mult_mod * math.floor(math.abs(to_big(G.GAME.dollars) + (to_big(G.GAME.dollar_buffer) or to_big(0))) / self.ability.extra.dollars)

devout badger
#

what's the maximum width of a joker description in vanilla

plush depot
#

so far

#

does nothing

plush depot
wind steppe
plush depot
#

so probably infinite

wintry swallow
#

Is there anyone who could help me with my problem?

plush depot
wintry swallow
# plush depot whats the problem

I'm trying to use (to_big(G.GAME.dollars) + (to_big(G.GAME.dollar_buffer) or to_big(0))), in a equation, but the game crashes with this error every time: functions/commonevents.lua:1091: attempt to compare number with table

plush depot
wintry swallow
clever rose
#

is there a line of code that destroys a playing card?

red flower
clever rose
#

i was attempting to make a joker that would destroy all cards in hand at the end of the round

limber obsidian
#

uhh

#

my messages wont send with my code

red flower
clever rose
#

okay thanks ill try that

red flower
#

you need to be using the latest smods release tho

clever rose
#

okay cool ill check that

plush depot
#

what should the joker do

wind steppe
limber obsidian
#

how would i add to this joker the ability that when winning a boss blind it destroys 2 cards in your deck?

limber obsidian
#

joker code so big i gotta make it a .txt

#

also if possible how would i optimize that code to be less massive

red flower
#

yes all the areas you're checking always exist so you dont need to nil check

#

also returning just { mult = bonus } is shorter

red flower
#

in loc_vars you only need to check for one of them not all

limber obsidian
# plush depot what should the joker do

if your current score is at e1 or above, have a 50/50 chance to destroy this joker and give a legendary joker, or to destroy this joker and gain 333$ (E but backwards)

plush depot
#

i like the chips one

humble pawn
#

Anyone have an idea on how I might be able to randomize all scored cards into random suits and ranks?

vapid sable
plush depot
#

i get it cuz e

#

wait one?

vapid sable
#

one has an e

plush depot
#

but theres no one cards

vapid sable
#

Oh

wind steppe
#

ace has an e regardless

limber obsidian
vapid sable
#

I got too caught up counting egg

limber obsidian
wintry swallow
#

could someone experienced with the G.GAME.dollars function please help me?

limber obsidian
#

yup

limber obsidian
red flower
#

i would ask in the talisman thread or the cryptid server honestly

wintry swallow
red flower
plush depot
#

rate the card

red flower
#

E

plush depot
#

🇪

keen loom
#

balettero

plush depot
#

hi sooji

keen loom
#

yo

plush depot
#

i made 2 new jokers that dont work yet cuz im too lazy to make them work

#

Noker and E

keen loom
#

meanwhile i nerfed all my jokers

wild escarp
#

Is there some built-in way to do xchips?

plush depot
#

why

lethal mural
#

im probably being stupid but how do i make a joker trigger every time a card with a specific suit is scored?

plush depot
#

broken is fuyn

red flower
#

{ xchips = value }

wild escarp
#

Thanks!

keen loom
#

i keep seeing this word, what is it?

plush depot
#

what word

keen loom
#

talisman

plush depot
#

oh

wind steppe
#

increases score requirements and screws up all of your mods

elfin stratus
#

deleted my message because i was completely wrong

plush depot
elfin stratus
#

sorry for my dumbass braindead response

plush depot
#

no?

#

ok dont trust me on that sooji

red flower
wind steppe
plush depot
#

ah

red flower
#

talisman is a regular mod

lethal mural
#

also (im still probably being blind) but is there a way to quickly restart the game (not a run, the whole game for whenever i'm testing)?

red flower
#

hold m or alt+f5

lethal mural
#

alright ty

keen loom
sonic cedar
short girder
#

where's the wiki page for decks :[ i cant find it

sonic cedar
#

it's SMODS.Back

short girder
#

okay thanks you!!!

plush depot
#

i need to hire someone to code for me cuz im too lazy but im broke so

devout badger
#
if context.individual and context.cardarea == G.play and not context.blueprint then

                if context.other_card:is_suit('Hearts', true) or context.other_card:is_suit('Diamonds', true) then
            
                    card.ability.extra.final_mult = card.ability.extra.final_mult + card.ability.extra.mult_count

                    return {
                            message = 'Upgraded!',
                            colour = G.C.MULT,
                            card = card
                    }

                elseif ( context.other_card:is_suit('Spades', true) or context.other_card:is_suit('Clubs', true) ) and (card.ability.extra.final_mult > 1) then

                    card.ability.extra.final_mult = card.ability.extra.final_mult - card.ability.extra.mult_count

                    return {
                            message = 'Downgraded!',
                            colour = G.C.MULT,
                            card = card
                    }
                end

        end```
how do I reference the joker itself in the return block?
#

this results in the messages appearing over the card being scored

#

(card = self makes it crash)

sonic cedar
fringe patrol
#

not sure where to ask for help for this, but tl;dr i'm making a music mod, right?

#

most of it is working. however, it's meant to be used in conjunction with another mod, which adds its own custom track

sonic cedar
#

well if you need help with developing a mod this just might be the right channel /lh

umbral zodiac
#

anyone know whats up with get_current_pool?
specifically the UNAVAILABLE and ", Joker4"

fringe patrol
#

and that one custom track clashes with the rest of the music mod, so i opted to replace that mod's track from within my own mod

#

however, i have not been successful in doing so. here's a screenshot of what remains from my latest attempt

#

i'm aware some mods can check for the existence of other mods to basically work in tandem

#

how do i replace another mod's assets conditionally?

north lodge
#

How do I check if another mod is present and as a result make something specific happen because of it?

red flower
next pivot
#

my achievements aren't working, and aren't unlocking at all
here's my code for one of them:
-# comments added to show... stuff?

SMODS.Achievement{
    key="touch_grass",
    atlas="achieve",
    hidden_text = true,
    pos={x=1,y=0},
    hidden_pos={x=0,y=0},
    unlock_condition = function(self,args)
        -- check for achievement unlocking (not in here cause it doesn't work either way)
        return true -- just here to test if it works
    end
}
red flower
north lodge
#

What if I'm not using smods 😬
(rawdogging it with lovely)

red flower
#

idk

north lodge
#

I'll just look at smods source

#

Thank you for the direction!

red flower
#

i think you need to check the files

#

as in find the files in the mod folder

sonic cedar
#

~~or use steamodded cinema ~~

red flower
#

(and check that there's not a .lovelyignore)

fringe patrol
sonic cedar
#

which one loads first

nova eagle
#

could someone help me understand what this error is?

#

i've never seen this one before

next pivot
nova eagle
#

ohhh

#

oops

fringe patrol
nova eagle
#

yep, that fixed it... thanks

umbral zodiac
red flower
umbral zodiac
#

i see, thank you

next pivot
north lodge
next pivot
north lodge
#

Is it called "smods" for the purposes of doing

local SMODS = require("smods")
sonic cedar
#

i have no idea

sonic cedar
next pivot
#
SMODS.Joker{
    key="grass_joker",
    rarity=1,
    cost=3,
    atlas="grass",
    pos={x=0,y=0},
    loc_vars = function(self,info_queue,card) -- it's in the loc_vars to check when it's hovered
        SparkLatro.touched_grass = true
        check_for_unlock({type="touch_grass"})
    end,
}
nova eagle
#

im unsure as to why this is happening... but it seems to crash when i do this,

however with context.repition it doesnt crash, and instead tries to retrigger the card

#

do i have to add a loc_vars thing?

wind steppe
#

is this balanced for a seven dollar uncommon

next pivot
red flower
nova eagle
#

so if i add context.repetition, and do repetitions = card.ability.extra.Xmult it should work right?

sonic cedar
nova eagle
#

because when i try that it just retriggers the card

next pivot
wind steppe
#

yeah thats what context.repetition does

red flower
#

use context.individual

wind steppe
#

and context.card_area == G.play

red flower
#

that's already there

nova eagle
#

ok its working now, thanks

#

how do i make a joker debuff certain cards?

red flower
#

context.debuff_card
return { debuff = true }

nova eagle
#

this is new territory for me

vale oak
#

yo ok so ive tried to patch the smods Mods box thing by editing like 3 functions but clicking on the search bar moves all the mods. is there anything ive missed and im being really dumb or is this some other kinda error?

#

I wanted to add a search bar

sonic cedar
nova eagle
red flower
next pivot
red flower
#

also im not sure if debuff_card uses other_card, let me check

short girder
nova eagle
red flower
red flower
upper onyx
#

how do i add a custom secondary textbox to a joker, like the ones that explain what modifiers do?

red flower
long ruin
#

hi guys can someone tell me how to make consumable

keen loom
#

is there a way to use a custom joker message from the localization file?

long ruin
#

i have a problem with the 'key' and 'atlas'

nova eagle
long ruin
#

thx king

nova eagle
#

if so what would i add to that to make it work

red flower
nova eagle
keen loom
sonic cedar
red flower
nova eagle
#

oh

red flower
nova eagle
next pivot
nova eagle
normal crest
sonic cedar
short girder
red flower
#

i will check

#

i usually do both the config and the function versions

normal crest
#

oh i see

#

yeah it looks like here you only have the recreation of the config functionality

#

which is confusing people

red flower
#

yeah i will change it then

normal crest
next pivot
long ruin
normal crest
red flower
#

i will write a comment

long ruin
#

i forgor the main one that is

default = 'c_vremade_fool',

normal crest
#

you know how when you run out of jokers to get in balatro the game starts to spawn just the +4 mult one

#

that's what default does

red flower
#

are you making a new type of consumable or are you making a tarot

long ruin
#

so if i want to create a consummable i just ignore this thingy

#

new one

red flower
#

oh then you use that yeah

long ruin
#

want to make my own one with specific things (like code card in cryptid)

red flower
long ruin
#

i wanted to use the derek mod to do this but he kept using the joker atlas

#

you truly are THE helper

next pivot
# sonic cedar elab

i added the prefix, and checked for if it was sending with the prefix too

        if args.type=="touch_grass" then -- check if it's unlocking w/o the prefix
            print("Came without the prefix")
            return true
        end
        if args.type == "touch_grass" or args.type == "SPL_touch_grass" then
            print("unlocked with the prefix") -- this is where it's going to
            return true
        end
long ruin
#

one last thing, what is the "badge" ?

normal crest
#

badge is the text that appears under a card when you hover over it

#

like the rarity badge

long ruin
#

oh okay, that where people write their name to say that this is their joker right ?

normal crest
#

no no

#

yk how the rarity of a joker is just a little bubble of text under the descrption that says "Common" or blah blah

wind steppe
normal crest
#

Those are called badges

long ruin
#

oh okok

#

OH I UNDERSTAND

#

im so dumb

#

srry y'all

wind steppe
#

how would i check and change a card's edition?

#

(playing card)

normal crest
#

card:set_edition('e_foil') where card is the playing card ofc

short girder
#

how do i make a deck add a joker
i tried this and it didnt work :[

untold vigil
#

I was making a joker mod but it dosen't appear

#

Did I mess something or what? Cuz i need help

normal crest
long ruin
short girder
normal crest
#

with the .json extension

untold vigil
normal crest
#

From SMODS.Joker and below goes to your main.lua

#

the stuff above goes to a json file in your mod folder

untold vigil
short girder
normal crest
untold vigil
#

To check if i understood

untold vigil
#

I'll ask something else if something goes up kay? It's my first joker just cuz i thought of doing it

long ruin
#

wouldn't the consummables fcked up if i use the color of the tarot card of smth ?

normal crest
#

whose key is absentia?

#

if so you want to type j_modprefix_absentia

solid mesa
#

in what cases you use return? like when upgrading or retrigger?

short girder
#

oh okay!!

normal crest
fringe patrol
normal crest
#

in the most general terms possible

fringe patrol
solid mesa
normal crest
#

what do you want to do exactly?

wind steppe
keen loom
#

how would i make the joker destroy itself?

solid mesa
next pivot
wind steppe
# keen loom how would i make the joker destroy itself?

i have this for food jokers

para_consumefood = function(card)
    G.E_MANAGER:add_event(Event({
        func = function()
            play_sound('tarot1')
            card.T.r = -0.2
            card:juice_up(0.3, 0.4)
            card.states.drag.is = true
            card.children.center.pinch.x = true
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.3,
                blockable = false,
                func = function()
                    card:remove()
                    return true
                end
            }))
            return true
        end
    }))
end
daring fern
solid mesa
normal crest
short girder
#

worked!!! many thankses :]

wind steppe
#

if you want to do anything else you'll put it before return in calculate

daring fern
sonic cedar
solid mesa
sonic cedar
#

Can you show me the achievement setup again

wind steppe
#

like above it

solid mesa
next pivot
solid mesa
#

uh i am reading that....

wind steppe
#

why does my joker not appear? there shouldn't be any issues

SMODS.Joker{ -- Malanga Fritter implementation
    key = 'malangafritter',
    config = { extra = {
        hands = 5
    }},
    pools = { ["Food"] = true },
    rarity = 3,
    cost = 7,
    blueprint_compat = false,
    eternal_compat = false,
    perishable_compat = false,
    loc_vars = function(self,info_queue,card)
        return {vars = {card.ability.extra.chips, card.ability.extra.chip_loss}}
    end,
     calculate = function(self, card, context)
        if context.before and context.cardarea == G.play and not context.blueprint then
            if context.full_hand[1]:get_edition() == "e_base" then
                context.full_hand[1]:set_edition('e_negative')
                card.ability.extra.hands = card.ability.extra.hands - 1
                  return {
                      message = localize('para_k_transformed'),
                      colour = G.C.ATTENTION
                  }
            end
        elseif context.after and card.ability.extra.hands <= 0 and not context.blueprint then
            para_consumefood(card)
            return {
                message = localize('k_eaten_ex'),
                colour = G.C.ATTENTION
            }
        end
    end
}
next pivot
daring fern
wind steppe
wind steppe
solid mesa
#

so, if i want a joker to upgrade himself, the code that does that should be in return?

wind steppe
#

just change card.ability.extra.whatever before the return

solid mesa
daring fern
wind steppe