#đŸ’»ăƒ»modding-dev

1 messages · Page 344 of 1

desert ore
#

I'll bring it up later when it's relevent

brisk rose
#

Brain did stupid again

daring fern
#

At the top of every lovely file there something like this, the priority means the order lovely will take when patching.

brisk rose
#

I forgor you'll always have smodded for most mods

#

And it changes a lot

desert ore
#

ah, so it's literally just arbitrary number set, gotcha

brisk rose
desert ore
#

I see why that would be annoying for mod compatibility

brisk rose
#

Tbh i think he had to change it anyway

daring fern
brisk rose
#

Tbh I think everyone patching blindly into the same code base is exactly what a modding api like smods is supposed to prevent

#

There's a reason even lovelydev says patches should be a lost resort

wintry solar
#

If you’re sensible about it, patching is fine

dapper sun
#

who does trying to navigate to my custom skin crash the game?

brisk rose
wintry solar
#

There’s a lot of things that you can’t do without patching

gaunt thistle
#

but it makes sense in my head so

dapper sun
gaunt thistle
gaunt thistle
zealous glen
gaunt thistle
#

avoid at as much as possible

#

use it if you must but do.so carefully

dapper sun
gaunt thistle
#

ah mb

dapper sun
gaunt thistle
#

brain no work

#

been up too late

dapper sun
zealous glen
#

I’ve used at to turn if A into if A _ B

#

Where _ is some logical operator

gaunt thistle
#

which would then break a patch which targets the line that was overwritten

gaunt thistle
#

that's one of the good used of at patching

zealous glen
#

But without an API for such specific lines it’s not easy to handle it well

gaunt thistle
#

yeah it's unwieldy

zealous glen
#

An alternative are multiple patches trying to mimic a logical operator

#

Like nesting an if inside another for and

#

But is multiple patches better than one?

#

It also depends on other factors, since you can’t always do that neatly

dapper sun
gaunt thistle
#

it's all about using the right tool for the job. in general if you can avoid an at patch in a way that is convenient then please do so, otherwise it's fine.

gaunt thistle
#

I'm just the patch guy

dapper sun
#

fair

gaunt thistle
#

I'm also on mobile so my debugging ability is pretty limited

shell timber
#

once again thank you so much for making lovely so we dont have to manually patch the exe every time we update

dapper sun
#

ah

zealous glen
gaunt thistle
#

my pleasure, it's been a fun project haha

#

pre lovely was pretty grim

shell timber
#

it was indeed

#

a bunch of stuff just wasn't possible

gaunt thistle
#

yeah. smods did similar-ish patching to the game but that functionality wasn't exposed

#

which was really limiting if you were making a mod

#

fun times

shell timber
#

i remember scrapping at least one joker because it would have required a patch

zealous glen
#

In the future when we have Quantum Ranks and the Great Joker Supercollider: “Forsooth, we were such caveclowns once in the past.”

gaunt thistle
#

back then I guess your only option was to copy what smods was doing and write a weird powershell injector

hushed field
shell timber
#

i dont remember anyone doing that because that would have been Horrible

gaunt thistle
#

haha yeah

#

lovely patches aren't easy per say but they at least make it a viable thing to do

shell timber
#

im still shocked that codex arcanum worked without any lovely patches

gaunt thistle
#

although I've also been really happy with how good the patch format has held up over time. it's been pretty flexible, all things considered.

gaunt thistle
#

that's impressive

shell timber
#

yeah but that led to some issues with crossmod compatibility iirc?

#

actually i know that happened because that's the reason colour cards weren't in the shop pool originally

dapper sun
shell timber
#

new modders have it easy with smods 1.0 and lovely

#

i say that as like half a joke

gaunt thistle
#

back then we had .98 and a stick and we liked it

#

1 million downloads is actually mind boggling, thanks guys

shell timber
#

wow

gaunt thistle
#

the scene has definitely come a long way haha

#

and it's remained really strong which has been cool to see

brisk rose
#

Maybe when balatro is a retro game in 20 years

#

And not a living codebase

gaunt thistle
#

maybe in a couple of years

#

it'll be interesting to see how things break when the game updates

reef belfry
#

would checking how many cards are not scoring be something like #G.play.cards - #context.scoring_hand ?

zealous glen
candid sleet
#

how would you go about writing the effect for this?

daring fern
bold sleet
#

hey, does anyone happen to know where the buy and sell values of each card is stored?

daring fern
bold sleet
#

oko

candid sleet
#

right now it just prints hello

#

i might just be completely misinterpreting what the swap function does

daring fern
candid sleet
#

ah ok

#

i wanted to have it do the swap before chip/mult scoring jokers activate, is there a context that would work for that

#

i just tested joker_main and it did it after mult scoring

maiden phoenix
#

Or you can loop in full_hand and use not SMODS.in_scoring()

candid sleet
weary haven
#

ok so whattup someone was showing me how to do multiple deckskins in one file

#

but i gotta set the atlases up for multiple suits in one png

#

OH thats what deck style means i am a gemius

#

ok so, obviously im an idiot, what do i wanna set key and loc_txt to for a suit

#

idk what theyre used for

sturdy compass
zealous glen
#

loc_txt is for the localization. I think for DeckSkins it’s the name displayed in-game

weary haven
#

does that mean when selecting it or does it like, replace instances of that suit's name

zealous glen
#

Selecting

digital valve
#

How difficult would it be to make a Balatro mod which adds a few new jokers, with zero experience? Obviously, it would likely depend on how complex the joker’s functions are but if we’re speaking generally?

#

I’ve got a bit of HTML experience from school but really nothing else outside of it lmfao

candid sleet
#

I'm currently in the process of doing that myself and it's not awful

#

Plus they're really helpful here whenever I get stuck

manic rune
#

and if you have any problems, feel free to ask here

#

i personally think its not too hard, since lua is pretty straightforward

hard flume
#

Hi

tepid crow
plain apex
midnight coyote
#

how would i make all cards of a certain type be ‘considered’ as a different card

long sun
#

hiya! i'm making a Planet card — what goes in loc_vars?

#

can't find where the game put the planet loc_vars

shell timber
#

you can look at what potassium does

#

just remove the Glop stuff

long sun
#

ah thanks :D!

midnight coyote
#

in a similar fashion to how paradolia does it, for example

long sun
#

i'd hook get_id()

red flower
unborn bay
#

you'd need to hook into get_id

midnight coyote
#

thanks

unborn bay
#

damn triple jinx

midnight coyote
#

so would i check for presence of the joker in the hook?

red flower
#

SMODS.find_card

midnight coyote
#

alright

#

and then that function takes the card id, right

primal terrace
#

The "Maximized" Joker from the Cryptid mod does something similar, I had to reference it for my own one

midnight coyote
#

where’s the doc for that

red flower
#

it's in the wiki under utility iirc

midnight coyote
#

alright

#

thanks a bunch

#

you rock, as always

primal terrace
#

Anyway how would I go about destroying a random card in my full deck, not held in hand

manic rune
#

go through G.playing_cards

primal terrace
#

And I reckon context.destroyed_cards also works within the full deck?

manic rune
#

i think so :p

midnight coyote
#

what does get_id take?

manic rune
#

the id of the playing card

primal terrace
#

I guess no one is daring enough to nix cards in the full deck yet

red flower
#

it takes self

midnight coyote
manic rune
#

đŸ€”

red flower
midnight coyote
#

if i do SMODS.find_card(“foobar”), will it return true if found and false otherwise

primal terrace
#

Optional?

red flower
#

yes you need to enable it because calculations in deck are performance heavy

manic rune
#

SMODS.current_mod.optional_features = {cardareas = {deck = true}}

midnight coyote
#

provided a card with the key foobar exists

manic rune
#

put that at the top of your code

red flower
#

for your effect you don't need destroy_card tho because you don't need to do it during scoring

midnight coyote
#

ykw let me just test this out

#

how about that

primal terrace
red flower
midnight coyote
#

just like that or replace the elipsis with the key of the card i want to be found

#

and i’m guessing that would return nil if it can’t find anything?

red flower
primal terrace
#

Fucking awesome

midnight coyote
#

i’m getting better at this lua stuff

#

outdated code but

hard flume
#

Hi :3

midnight coyote
#

what does get_id() return?

placid star
midnight coyote
#

does it return a string

native zinc
midnight coyote
#

o

#

im guessing queen is 12?

hard flume
#

When I get home, I'm going to take a break from Pikmin and instead work on Pronouns for playing cards in Balatro

unborn bay
#

ids above 10 are jack, queen, king, and ace respectively

native zinc
#

2-10 for 2s-10s, J 11 Q 12 K 13 A 14

unborn bay
#

so 11, 12, 12 and 14

midnight coyote
#

yep

#

figures

unborn bay
#

12, 12

midnight coyote
#

alr

#

tanks

manic rune
#

whats SMODS.get_id? đŸ€”

red flower
#

j_modprefix_key

midnight coyote
manic rune
#

o

midnight coyote
manic rune
#

-# wait why did i forget that, i literally just answered above

midnight coyote
#

now to actually make the joker

unborn bay
#

bepis

midnight coyote
#

this shouldnt be too hard as ive already defined what it does

#

just gotta make a fun design, write some loc_txt and call it a day

#

im gonna make a ritual card like the crooked coin from tboi

pale venture
#

One question, i wanted a Joker to display a timer in its textbox, do i have to update the textbox every frame to make it display in real time? How can i do that?

red flower
midnight coyote
#

should i use the og function to check for the card's actual id

red flower
midnight coyote
#

no wait

#

theres a func to check for face cards

#

im dumb :b

red flower
#

dont do is_face or you will get an infinite loop lol

midnight coyote
#

o

#

so i check for the id

pale venture
#

Alright, thank you

midnight coyote
#

can i do if smods_ref_get_id() == 11 or 12 or 13 or is this really stupid

#

wait

#

ykw

#

lets try it

midnight coyote
#

i gotta get in the habit of asking less questions

#

and just trying shit

tepid crow
midnight coyote
tepid crow
#

yes: x == 11 or x == 12 or x == 13
no: x == 11 or 12 or 13

#

I couldn't tell if that's something you already knew so I felt it was important enough to point out

midnight coyote
#

ohhh

#

alright

#

so how do i make this work with paradolia

#

do i just adjust wording

#

instead of face cards i’ll say ‘makes all Jacks and Kings be considered Queens’

red flower
#

you can just hard check for it

tepid crow
#

that works I guess

jolly prawn
#

I've been making a card that reduces blind requirement by 19% and it works well but when you have more than 1 or it's being copied by blueprint/brainstorm all the reduction happens at once and I sort of want it to happen one at a time like when mult is added or smth similar. Is there any way I can do this? (video of card and code I made attatched, card.ability.extra.blind_dec is set to 19)

midnight coyote
#

but face cards in general seems op to me

#

so i’ll restrict it to kings and jacks

#

for balance

jolly prawn
daring fern
jolly prawn
red flower
#

SMODS.calculate_effect({...}, card)

jolly prawn
#

I've got this and the message is appearing but the blind still decreases all at once

tall wharf
#

hmmm

#

add context.cardarea == G.jokers?

jolly prawn
#

ive tried both replacing the context.setting_blind with context.cardarea == G.jokers and combining them into 1 statement (if context.setting_blind and context.cardarea == G.jokers then) but neither make it work how Im trying to get it to. Just incase I wasn't clear earlier I want the blind to decrease when each individual joker activates instead of decreasing all at once at the start of the round

rough furnace
#

I think you can keep the message in the return and just use the event for changing the number

#

It should queue the message immediately after the number change (which takes no time so it seems st the same time)

tepid crow
#

oh wait 800 base blind size

#

ohhhh

jolly prawn
tepid crow
#

wilson meant a return outside outside the event

rough furnace
#

Like you had before

tepid crow
#

you could also try delaying the event with an after, or changing the context to be on round start instead since I suspect it's setting the blind size outside your visual view

jolly prawn
prisma hedge
#

new to modding, not sure why my joker isn't triggering

#

supposed to give x2 mult when light cards are scored

daring fern
#

Also card.ability.extra.Xmult

prisma hedge
#

still no trigger

surreal coral
#

Can you refer to an SMODS joker's calculate function? Gotta be stored somewhere in it's card right?

prisma hedge
#

is that related to what i'm doing or is that just a question

surreal coral
#

Nah just a question sorry

prisma hedge
#

ah ok

daring fern
jolly prawn
tepid crow
#

also also I don't think the next(SMODS.has_enhancement(...)) does anything when put there Liv

prisma hedge
#

what should i do then?

daring fern
tepid crow
prisma hedge
#

so like this?

daring fern
#

Also you need to return x_mult = card.ability.extra.Xmult

prisma hedge
daring fern
# prisma hedge ??

Put that in a big if saying if context.individual and context.cardarea == G.play then

prisma hedge
#

put what

daring fern
prisma hedge
#

ah

plain apex
#

did you figure this out cause im trying to do the same with one of my enhancements and this does not work

prisma hedge
#

still nothing

daring heron
#

how do i decompile balatro's code again?

dapper sun
daring fern
prisma hedge
daring heron
daring fern
prisma hedge
#

i use 7zip personally

daring fern
daring heron
#

aight

dapper sun
daring heron
#

(btw how do yall make the text look like that)

dapper sun
#

`like this`

daring heron
#

hi

#

nice

prisma hedge
#

i'm not sure what could be wrong now

plain apex
#

so card.brick_trigger = true and context.other_card.brick_trigger?

dapper sun
#

yea

plain apex
#

yippee

manic rune
#

does increasing priority of my lovely patches make it so it happen first?

daring heron
#

okay, extracted it

#

where would i find the base joker code?

daring fern
manic rune
#

ack

daring fern
daring heron
#

and then what do i search?

daring fern
proud moon
daring heron
#

i tried searching for "joker" but theres like 300 results

daring fern
daring heron
proud moon
#

the use of both 'text' and "text" bothers me in the games code, i wish the search feature had an option for counting ' and " as the same thing

proud moon
daring heron
#

is that really all the code it has?

proud moon
#

he doesnt do much

#

there is more tho

daring heron
#

ok fair but it doesnt look like it would +4 mult

daring heron
proud moon
#

good quesiton, im trying to find it too

rough furnace
daring heron
#

cuz i wanna make a test joker that just does +4 mult but ive never made a functional joker

daring fern
proud moon
#

wait are you using smoded?

proud moon
daring heron
#

actually, how do i make a joker that just does x1.25 mult?

proud moon
daring fern
proud moon
#

they have a regular jimbo in there, its a perfect place to start

keen tiger
#

okay im probably just bad at lua but why is G.hand.cards[0] yielding nil when there is an active hand

#

wait because lua is indexed at 1 i forgor baffling language

manic rune
#

yeah

rough furnace
#

Wait until you see my js code that's using 1 indexing

keen tiger
#

i love the first mover advantage!!!!!! i love how terrible design decisions become the industry standard because it was the first option on the market!!! woooo!!!!

proud moon
#

i like indexing starting at 0 because from a computer standpoint it makes more sense, 0-9 instead of 1-10 to save on digits, etc

manic rune
#

i this how i patch all (area.cards) to (area.cards or {})?

rough furnace
#

To be fair in C 0 indexing makes sense since an array is just a pointer and indexing is just pointer arithmetic

rough furnace
keen tiger
rough furnace
#

You'll need to escape them

manic rune
#

wh

#

how do i do that

keen tiger
#

\{\}

manic rune
#

ahhh icic, thanks

proud moon
#

"escape" sounds way more awesome than any other alternative

manic rune
#

so something like \(\area.cards\)\?

keen tiger
#

you dont need to surround them

#

you just need slashes before

manic rune
#

oh

#

yeah thanks, thats the first time i used this :p

rough furnace
#

You might need \

#

Oh discord

#

2 backslash

manic rune
#

do i have to do that for payload too?

rough furnace
#

I don't think si

manic rune
#

oh my god it lives, thank you guys so much

keen tiger
manic rune
#

:3 looks as fun as trying to understand shaders, thats for sure

daring heron
#

whatd i do wrong 😔

#
--- Joker Test ---
SMODS.Joker {
    key = "jokertest",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25{}"
        }
    },

    config = { extra = { mult * 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "Jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                mult_mod = card.ability.extra.mult,
                message = localize { type = "variable", key = "a_mult", vars = { card.ability.extra.mult } }
            }
        end
    end
}
daring fern
proud moon
#

mult * 1.25

manic rune
proud moon
#

should be mult = 1.25

manic rune
#

why did it

#

not replace all area.cards

brisk rose
daring heron
proud moon
#

mult_mod only does mult, you would need xmult_mod ( i think thats what its called)

daring fern
manic rune
#

oh wait nvm, that was from my old patch

turned out it didnt work

daring heron
brisk rose
#

Did you ever do this?

daring heron
#

that was a mistake i made then and i forgot to fix it

shut crater
daring heron
brisk rose
daring heron
#

real

proud moon
manic rune
daring heron
#

is it xmult instead of mult_mod?

shut crater
manic rune
#

\(area\.cards\)?

#

ah ic

proud moon
#

idk why the examples use mult_mod instead of just mult

#

mult, Xmult, and chips all do the same thing as the _mod versions, but they call the game's functions so there is a little animation too

manic rune
#

didnt work

shut crater
# manic rune `\(area\.cards\)`?

Regex terrifies me but is actually quite useful. There are websites online that will let you check your pattern to see if it'll work

shut crater
# manic rune didnt work

Try checking the pattern itself, if the pattern is fine then you may need overwrite = true in your patch

daring heron
#

okay it works, but it displays the image twice, one red and one orange

proud moon
rough furnace
daring heron
#

nvm fixed it

proud moon
daring heron
#

yep

proud moon
#

yea the _mod stuff its useful to know, but not to start with

manic rune
#

i checked the website, everything seems fine

daring heron
#

now i hope this question doesnt make yall mad considering the F situation but how do i play a sound?

#

(and what file format should it be?)

crisp coral
#

use SMODS.Sound to add the sound to the game, and play_sound(key, pitch, volume) to play it

#

.ogg preferred, .wav is okay

proud moon
manic rune
#

okay why did it replace the last occurrence, not everything

daring heron
#

what should i put in here?

proud moon
#

thats for if you are adding sounds, are you?

brisk rose
proud moon
#

like, new ones to the game

manic rune
#

WHY IS IT NOT WORKING

daring heron
#

yeah

#

i'm adding new ones

brisk rose
shut crater
daring heron
#

nor where

manic rune
shut crater
brisk rose
proud moon
#

same as any object (that references a file)

daring heron
#

oh mb

shut crater
#

It might be correct but I've never seen that syntax

manic rune
#

its targetting src/utils.lua from SMODS

daring heron
#

why does it give an error?

manic rune
#

im pretty certain thats correct, unless target in patches.pattern works differently compared to patches.regex

daring heron
#

normally i dont have to put a comma there

brisk rose
# daring heron oh mb

As for format, use ogg. I'm sure there's a reason if says not to use mp3 despite bent supported, abs wave is unessacarily big

daring heron
#

yeah i am

brisk rose
daring heron
hearty mesa
#

how would I add a sprite to my mod's config tab? would i useG.UIT.O?

manic rune
#

yes

shut crater
manic rune
#

i will try

brisk rose
brisk rose
#

But I'm not sure either of those things would cause this

manic rune
#

OH MY GOD IT WORKS

#

somethingcom, can you try my mod again

#

:3

brisk rose
manic rune
#

yes

#

i literally answered your question earlier 😭

brisk rose
proud moon
wintry solar
#

A bigger screenshot would be helpful

keen tiger
#

whats the card field determining if something is flipped over or not

#

i.e during wheel or water

#

nvm found it

daring heron
#
--- STEAMODDED HEADER
--- MOD_NAME: Test Mod
--- MOD_ID: TEST
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Test
--- PREFIX: xmpl

--- Atlas ---

SMODS.Atlas{
    key = "Jokers",
    path = "JokersTest.png",
    px = 71,
    py = 95
}

--- Sounds ---

SMODS.Sound{
    key = "Meow",
    path = "Meow.ogg"
}

--- Joker Test ---
SMODS.Joker {
    key = "jokertest",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25{}"
        }
    },

    config = { extra = { mult = 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "Jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.mult,
                Sound = Meow
            }
        end
    end
}```
wintry solar
#

That doesn’t matter

rare obsidian
#

can someone tell me how to add an edition that uses a scribbled.fs shader??

brisk rose
wintry solar
#

Well, it does matter, but that’s not why it’s crashing

#

Is there a crash report?

rare obsidian
daring heron
#

ig it fixed itself

#

still doesnt work tho

shut crater
#

Your return is incorrect

daring heron
daring heron
#

it doesnt give an error

shut crater
#

You need to put the key of your sound as the return value

shut crater
brisk rose
# daring heron

Your sounds folder being /Assets/Sounds instead of assets/sounds can't be ideal

#

Not the crash

#

But still

daring heron
#

yeah i changed it

shut crater
shut crater
#

In quotes

daring heron
#
--- STEAMODDED HEADER
--- MOD_NAME: Test Mod
--- MOD_ID: TEST
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Test
--- PREFIX: mod

--- Atlas ---

SMODS.Atlas{
    key = "jokers",
    path = "jokers.png",
    px = 71,
    py = 95
}

--- Sounds ---

SMODS.sound{
    key = "meow",
    path = "meow.ogg"
}

--- Joker Test ---
SMODS.Joker {
    key = "jokertest",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25{}"
        }
    },

    config = { extra = { mult = 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "Jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.mult,
                sound = "mod.meow"
            }
        end
    end
}
#

well this doesnt work

shut crater
#

mod_meow

daring heron
#

oh mb

#

still doesnt work though

wintry solar
#

SMODS.Sound

brisk rose
daring heron
#

mm nice it works

#

nvm, game crashes when the joker is shown

#

anywhere

sonic cedar
#

bumping this but now as a general question

daring fern
daring heron
#

oops, overlooked that

#

mod still crashes sadly

daring fern
daring heron
#
--- STEAMODDED HEADER
--- MOD_NAME: Test Mod
--- MOD_ID: TEST
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Test
--- PREFIX: testmod

--- Atlas ---

SMODS.Atlas{
    key = "jokers",
    path = "jokers.png",
    px = 71,
    py = 95
}

--- Sounds ---

SMODS.Sound{
    key = "meow",
    path = "meow.ogg"
}

--- Joker Test ---
SMODS.Joker {
    key = "jokers",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25 {}mult"
        }
    },

    config = { extra = { mult = 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "Jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.mult,
                sound = "testmod_meow"
            }
        end
    end
}
shut crater
#

So the atlas field in your joker is still capitalized

#

But the key of your atlas is lowercase

sonic cedar
#

so change line 39 to lowercase

daring heron
#

oop

#

sound didnt play tho

#

but it didnt crash

sonic cedar
#

your sound keys dont match

daring heron
#
--- STEAMODDED HEADER
--- MOD_NAME: Test Mod
--- MOD_ID: TEST
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Test
--- PREFIX: testmod

--- Atlas ---

SMODS.Atlas{
    key = "jokers",
    path = "jokers.png",
    px = 71,
    py = 95
}

--- Sounds ---

SMODS.Sound{
    key = "testmod_meow",
    path = "meow.ogg"
}

--- Joker Test ---
SMODS.Joker {
    key = "jokers",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25 {}mult"
        }
    },

    config = { extra = { mult = 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.mult,
                sound = "testmod_meow"
            }
        end
    end
}

still doesnt work

sonic cedar
#

quick question is that atlas working now

daring heron
#

which one?

#

the sounds one?

sonic cedar
#

no, visual

daring heron
#

this one works if you're talking abt that

sonic cedar
#

ok cool

#

can you put parentheses around the brackets in the sound one just in case that is it

daring heron
#

around the key?

#

or path

sonic cedar
#

around thr brackets

daring heron
#

??

#

theres like 10 brackets in the code

#

the ones in ther sounds atlas?

#

cuz that just gives an error

wintry solar
#

Sounds don’t work with automatic messaging iirc

sonic cedar
#

i just realized ur using an auto message

daring heron
#

so how do i do that then

sonic cedar
#

return it manually

wintry solar
#

You need to add remove_default_message = true too

daring heron
#

to where?

sonic cedar
#

outside of calculate im p sure

wintry solar
#

No

#

In the return

sonic cedar
#

yeah i just looked i was thinking of the other thing

#

mb mb

daring heron
#

like this?

sonic cedar
#

try a localized message instead so you don't have to type out a string

daring heron
#

how do i do that?

sonic cedar
#

though in your case itd be x_mult i believe (do xmult if it doesnt work cause i tend to get them switched up)

daring heron
#

it works, but i want it to be red, and it displays ERROR

sonic cedar
#

send code

daring heron
#
--- STEAMODDED HEADER
--- MOD_NAME: Test Mod
--- MOD_ID: TEST
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Test
--- PREFIX: testmod

--- Atlas ---

SMODS.Atlas {
    key = "jokers",
    path = "jokers.png",
    px = 71,
    py = 95
}

--- Sounds ---

SMODS.Sound {
    key = "testmod_meow",
    path = "meow.ogg"
}

--- Joker Test ---
SMODS.Joker {
    key = "jokers",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25 {}mult"
        }
    },

    config = { extra = { mult = 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                sound = "testmod_meow",
                remove_default_message = true,
                message = localize {type = "variable", key = "x_mult", vars = {card.ability.extra.mult}},
            }
        end
    end
}
daring fern
#

And it should be a_xmult

daring heron
#

yeah thatd do it

sonic cedar
#

got them switched again đŸ„€

daring heron
#

its still yellow tho

daring fern
#

In the return.

daring heron
#

nice

#
--- STEAMODDED HEADER
--- MOD_NAME: Test Mod
--- MOD_ID: TEST
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Test
--- PREFIX: mod

--- Atlas ---

SMODS.Atlas {
    key = "jokers",
    path = "jokers.png",
    px = 71,
    py = 95
}

--- Sounds ---

SMODS.Sound {
    key = "mod_catsalad",
    path = "catsalad.ogg"
}

--- Joker Test ---
SMODS.Joker {
    key = "jokers",
    loc_txt = {
        name = "Joker Test",
        text = {
            "{X:mult,C:white}X1.25 {}mult"
        }
    },

    config = { extra = { mult = 1.25 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    rarity = 1,
    atlas = "jokers",
    pos = { x = 0, y = 0 },
    cost = 1,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                sound = "mod_catsalad",
                remove_default_message = true,
                colour = G.C.MULT,
                message = localize {type = "variable", key = "a_xmult", vars = {card.ability.extra.mult}},
                xmult = card.ability.extra.mult
            }
        end
    end
}
``` well i changed the sound and now it doesnt work
daring fern
sonic cedar
#

i do it with the mod prefix on both and it works fine?

daring heron
#

like this?

#

cuz it still doesnt work

sonic cedar
daring heron
#

i dont even have a card.lua

sonic cedar
#

are we fr

daring heron
#

made a new save file and it crashes whenever the joker activates

daring fern
sonic cedar
#

yeah

daring fern
sonic cedar
#

maybe cause theyre using old header method?

daring fern
daring heron
daring fern
sonic cedar
#

is it acrually an ogg fi- yeah

daring heron
#

yep

daring fern
daring heron
#

oh

sonic cedar
#

youre faster than me rarrgh

#

but yeah

daring heron
#

how do i play a sound from balatro again

sonic cedar
#

i think you just use the base game's sound key?

daring fern
daring heron
#

nvm found it

#

can i make it play multiple sounds at once?

daring fern
sonic cedar
#

simply do it again

daring heron
#

tried but that doesnt work

#

only plays multhit1

daring fern
sonic cedar
#

use play_sound

daring heron
#

how do i make it not do that

#

oh okay

#

like this?

#

that still overrides it doesnt it

daring fern
#

But also no.

sonic cedar
#

play_sound

daring heron
#

oh

sonic cedar
#

this was used in an event though i dont actually know if you can call it straight up in the return

daring heron
#

well it works but it plays it whenever i play the hand, not when it activates

sonic cedar
#

that would have to be a different context though wouldnt it

daring heron
#

how do i do that then

sonic cedar
#

maybe?

daring heron
#

like this?

sonic cedar
#

try it

daring heron
#

doesnt work

#

the sounds dont play at all

daring fern
#

In the return.

sonic cedar
#

true just making it func is way easier

daring fern
#

It's better to keep it off unless you do.

daring heron
#

like this?

daring fern
daring heron
#

that just plays it when i play hand again

wintry solar
#

You need an event

sonic cedar
#

question answered then

bold sleet
#

Me am very not understand.

daring heron
#

honestly i probably know how but i forgor

#

how do i add an event again

wintry solar
bold sleet
#

hold on

#

I may be stupid

sonic cedar
bold sleet
sonic cedar
shut crater
daring heron
#

nvm i think i got it

#

ow my ears

#

it just infinitely plays it

red flower
#

you need to return true for events to end

daring heron
#

alright, how do i make the sound pitch higher each time like how the mult hit does?

sonic cedar
#

doesnt it do that automatically

#

or no

daring heron
#

no

sonic cedar
#

hm

willow plinth
#

if i've read the docs correctly, this should be 1:1 the same, right?

crisp coral
#

fucked up syntax???

willow plinth
#

typescript yeah

crisp coral
#

yes except start materialize

shell timber
#

...why are you making mods in typescript

#

lua isn't good but typescript is definitely not better

hard needle
#

how are you even making mods in typescript

willow plinth
#

i don't like lua and i write javascript every day

crisp coral
#

quirked up

willow plinth
shell timber
#

the WHAT

#

this is not real

crisp coral
#

that exists????

hard needle
shell timber
crisp coral
#

holy shit

golden lake
#

fucked up and evil do not use this

crisp coral
#

hi akai

shell timber
#

True...

willow plinth
golden lake
#

hi myst

#

balatrostuck soon

sonic cedar
#

ts (typescript) pmo

crisp coral
#

real

sonic cedar
#

đŸ„€

willow plinth
#

man i feel like garbage

crisp coral
#

idr smods create card having materialize but i could just be a dumbass

edgy reef
daring heron
#

how would i make a card retrigger each stone card played?

edgy reef
#

But it's not?

willow plinth
#

bruh 😭

#

whatever then, typescript is bad and create_card has a useless skip_materialize param, thanks guys lol

primal robin
#

Typescript is bad that's true, as a web dev I can confirm

shell timber
#

typescript has its uses this is not it

primal robin
#

But skip_materialize is not useless

hard needle
#

typescripttolua is such an oddly specific project?

#

are there any other projects that convert languages to lua

#

or vice vers

#

a

chrome widget
#

My past employment was using typescript and honestly I like it a lot

#

Can recommend

willow plinth
crisp coral
willow plinth
#

being able to write mods in different, especially more popular languages, is a net positive, but anyway, i'll ask here again once you guys are over that lol

primal robin
#

SMODS.add_card is just small upgrade over SMODS.create_card

shell timber
#

i don't really care it's just an interesting decision

primal robin
#

So both of them uses skip_materialize

sonic cedar
chrome widget
#

Have fun with it, Typescript is cool

edgy reef
#

I've thought of doing Rust for fun but I'd basically have to write the classes inside of it too in order to properly work.

#

And I'm too lazy to bother

sonic cedar
#

im a fake hater i just thought itd be funny

edgy reef
#

(also requiring you to put a dll in your game folder)

primal robin
#

JS my beloved Lumaflute

shell timber
#

rust is real and good but overhyped

chrome widget
#

Personally I don't like JS on its own, though after having used Lua, I'd probably be more open to it. TypeScript's better tools and type safety spoiled me

#

But Lua has me doing shit with a lot of lack of intellisense

primal robin
#

Type safety is a myph JangSchna

willow plinth
# primal robin So both of them uses `skip_materialize`

yes...i feel like you arguing my point :/

me ask: are these the same: (vanilla create_card + set_edition + add_to_deck + emplace + start_materialize) -> create_card({area, edition, key, set})
myst says: yes except start_materialize

me think: why would they accept a skip_materialize param then, if there is no start_materialize inside of SMODS' create_card/add_card?

that's all i'm saying but i think i misunderstood something

chrome widget
#

Well yeah that's not a good description on my part, TS doesn't have type safety, but the information gives by its types guides programming better

primal robin
#

Man, just open SMODs source code and check yourself

#

Questions?

edgy reef
willow plinth
chrome widget
#

(SMODS source code could really use some comment function documentation though)

daring heron
#

how would i make a joker that retriggers each played stone card?

chrome widget
#

I wonder if it'd be a fun project to do it myself

daring fern
scarlet spire
#

who knew that smods has built in functions to increase the voucher slots and booster slots overstock-style? I didn't, until I had already attempted to implement it manually

edgy reef
#

Tbf that was like a week ago at least

#

Utility docs have not been updated yet I think

scarlet spire
#

i've used them for a while now
I'm not complaining or anything, I just find it neat

#

since then I check the smods code every now and then for cool functions I may have missed

edgy reef
#

wait yeah it was two months ago lmfao

rare obsidian
#

How do I add an Edition?

chrome widget
#

card:set_edition(key)

#

It's a vanilla function

rare obsidian
#

no like make a new one

chrome widget
#

Resources here!! CattoBlush

rare obsidian
#

theres like no documentation lol

#

ooh nvm

primal robin
rare obsidian
#

im slow

scarlet spire
#

it's pretty similar to an enhancement, but for shader stuff that's a lot more complicated

chrome widget
#

The page describes the use of the SMODS.Edition() function to add a new edition

#

So you call that function with a table containing arguments to create your edition

willow plinth
# primal robin

not the gotcha you think it is lol

i actually dived into vanilla create_card now and the actual unexpected thing is it only using start_materialize when the card is a consumeable

but you are right, i could've looked there in the first place to avoid this clownfest in here

cyan lagoon
#

how can i make a joker trigger an effect of some other joker?

placid star
#

i have a cardarea that that is spawned by a joker being added to deck, i can emplace a card into it but for somereason the card doesnt show up in the cardarea, even though you can see that theres a slot taken up and there is a joker in the area

rare obsidian
#

no idea if thats helpful lol

chrome widget
edgy reef
#

Booster packs iirc

chrome widget
edgy reef
#

Yeah all the booster pack use it because it produces that bug with particles if you don't.

placid star
hard flume
#

I miss being able to dev

cyan lagoon
#

i want to make a table of jokers and have a single joker trigger the effects of all jokers in that table

#

the effect sounds like 'copies the ability of 3 last sold common jokers'

primal robin
chrome widget
#

You're formatting that incorrectly and it's not using the contexts correctly either

daring fern
daring fern
daring heron
rare obsidian
#

how do i quickly restart balatro

cyan lagoon
primal robin
#

m

rare obsidian
#

thx

chrome widget
#

You need to check for a specific context in order for it to play correctly (so if context.repetition and context.cardarea == G.play)

cyan lagoon
daring fern
chrome widget
#

Which are the values set on the context table when the game checks for repetition

chrome widget
#

Similarly, you need to wrap those values you want to return inside a table. So

    remove_default_message = true
    colour = G.C.MULT,
    -- etc
}```
placid star
willow plinth
stray dagger
#

can someone make a mod that replaces royal flush with HOLY CRAP A ROYAL FLUSH!

chrome widget
#

store the return from add_card into a variable like created_card, then do created_card:start_materialize()

#

I don't know if that's the issue obv, but test it anyway just in case

chrome widget
#

Oh!! Actually this is the issue probably

#

Because it only calls materialize on consumeables

wintry solar
stray dagger
#

i just want to make it sound more suprising

#

lol

willow plinth
placid star
willow plinth
wintry solar
chrome widget
#

Did you only add start_materialize() to the use code? What about add_to_deck which also adds a card?

placid star
placid star
rare obsidian
cursive sentinel
#

is there a context for when an enhancement is applied individually?

chrome widget
cyan lagoon
chrome widget
#

And consumeables materialize automatically

rare obsidian
#

wahts bunco lol

cyan lagoon
#

mod

wintry solar
chrome widget
#

Logically that would be a better option yeah

cyan lagoon
wintry solar
#

Destroying and creating might have unintended effects

cursive sentinel
#

or whatever applies an enhancement

wintry solar
#

There’s not

placid star
wintry solar
#

Oh

#

Can you show the creation of your card area?

placid star
red flower
#

type = 'joker' lowercase

placid star
#

this looks hilarious tho

rare obsidian
#

I changed it to match bunco mod. It still doesnt work

willow plinth
stray dagger
#

since you guys were devs i thought you guys knew like a mod to do it đŸ€Šâ€â™‚ïž

red flower
#

you should copy bunco's code and start from there

shut crater
cursive sentinel
#

quick question, is v.vampired a local? or is it set in another script than card.lua?

shut crater
#

I'm not at my computer so that might be the incorrect use of calculate_joker

daring fern
rough furnace
shut crater
daring fern
scarlet spire
#

I've made a patch to trigger a custom context whenever set_ability is called, to detect when a card changes enhancements. how can I stop this from triggering when you open the deck view, which live-creates the cards and spams the context with fake cards?

daring fern
shut crater
red flower
#

calculate_context calls all other calculate functions, that's not what you want here

cursive sentinel
#

card:set_ability(G.P_CENTERS.c_base, nil, true) crashes my game, have i missed smth on how it's done on smodded?

#

trying to replicate vampire's unhencement effect

cursive sentinel
#
if context.cardarea == G.jokers and context.before and not context.blueprint then
            local enhanced = {}
            for k, v in ipairs(context.scoring_hand) do
                if v.config.center ~= G.P_CENTERS.c_base and not v.debuff and not v.punked then 
                    enhanced[#enhanced+1] = v
                    v.punked = true
                    v:set_ability(G.P_CENTERS.c_base, nil, true)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            v:juice_up()
                            v.punked = nil
                            return true
                        end
                    })) 
                end
            end
        end```
#

just replaced vampired by punked

#

heh?

#

relaunched the game, didnt crash this time

#

am i crazy

#

ok doesnt crash anymore wtf

digital niche
#

what do i use to create jokers?

daring fern
digital niche
#

tyty

weak gate
#

How would I go to add a new button to all jokers?

spring thistle
#

im trying to get the card to signal that its effects are being triggered, but I don't see anything happening. what is wrong?



    config = { extra = { dollars = 3, increase_per_hand = 1 } },
    
...
    calculate = function(self, card, context)

        if context.joker_main then
    
            ease_dollars(card.ability.extra.dollars)
            card:juice_up(0.8, 0.8)
            card.ability.extra.dollars = card.ability.extra.dollars + card.ability.extra.increase_per_hand
            card:juice_up(0.8, 0.8)
            card.sell_cost = card.ability.extra.dollars 
        end
    end



turbid maple
placid star
#

how can i remove a card area? using G.'cardareaname':remove() gives me this error

frosty lichen
#

hi, i'm new to modding i have a question, what would be needed to have the .lua file formatted correctly to make modifications to the enhancers textures?

digital niche
#

how do i make something like that for a custom consumable page?

daring fern
#

That reminds me, how do I remove that text? ^

frosty lichen
# daring fern What?

im trying to modify the textures of enhancements but we do not know how the .lua file needs to be formatted

frosty lichen
daring fern
prisma hedge
#

still cant figure it out, anyone know why my joker isnt triggering when a light card is scored?

cursive sentinel
#

is there a check for editions?

prisma hedge
#

?

daring fern
cursive sentinel
#

like there would for ability == 'Lucky'

#

like how can i check if edition's precisely a foil?

cursive sentinel
daring fern
frosty lichen
cursive sentinel
#

crashes

daring fern
#

Log?

cursive sentinel
daring fern
cursive sentinel
#

oh right, adding it, thx

#

works !

carmine roost
#

is there a way to fully replace a file with another using lovely

carmine roost
oblique pond
tall wharf
#

ok so i added suit and rank to jokers

#

how do i hide the suit/rank badge 😭

oblique pond
tall wharf
#

😭

prisma hedge
#

so is just no one gonna answer my question

prisma hedge
#
 key = 'ashbaby',
 loc_txt = {
  name = 'Ash Baby',
  text = {
   '{X:mult,C:white}X#1#{} Mult when a',
   'Light card is scored.'
  }
 },
 atlas = 'ashbaby',
 pos = {x = 0, y = 0},
 config = {
  extra = {
   Xmult = 2
  }
 },
 loc_vars = function(self, info_queue, center)
  return { vars = { center.ability.extra.Xmult } }
 end,
 calculate = function(self, card, context)
  if context.individual and context.cardarea == G.play then
   if SMODS.has_enhancement(context.other_card, "m_cry_light") then
    return {
     x_mult = card.ability.extra.Xmult,
    card = card
   }
   end
  end
 end
}```
tall wharf
#

btw what version of smods are you using

daring fern
prisma hedge
prisma hedge
cursive sentinel
#

whats the debug line to debuff a playing card?

tall wharf
#

update steamodded

#

lol

daring fern
tall wharf
#

how do i remove this lmaooooo

cursive sentinel
daring fern
prisma hedge
daring fern
tall wharf
prisma hedge
#

fixed it

#

accidentally left the old smods folder in the mods

cursive sentinel
daring fern
dapper sun
#

i forgot to actually test that it works 😭

prisma hedge
cursive sentinel
#

am i doing it wrong maybe?

prisma hedge
#

same result as before

weak gate
#

how can extend the Card class in my mod's file?

daring fern
weak gate
#

the Card class is defined in vanilla's card.lua. Is a lovely patch the only way to add new functions to that class?

daring fern
weak gate
#

hmm doesn't seem to work...

daring fern
eager pendant
#

Is there any way to fix this?

daring fern
eager pendant
weak gate
#

well, it's that I want to make a custom button in a card, and in vanilla the func and button functions are stuff that's inside Card (check third line)

  if card.area and card.area.config.type == 'joker' then
    sell = {n=G.UIT.C, config={align = "cr"}, nodes={
      {n=G.UIT.C, config={ref_table = card, align = "cr",padding = 0.1, r=0.08, minw = 1.25, hover = true, shadow = true, colour = G.C.UI.BACKGROUND_INACTIVE, one_press = true, button = 'sell_card', func = 'can_sell_card'}, nodes={
        {n=G.UIT.B, config = {w=0.1,h=0.6}},
        {n=G.UIT.C, config={align = "tm"}, nodes={
          {n=G.UIT.R, config={align = "cm", maxw = 1.25}, nodes={
            {n=G.UIT.T, config={text = localize('b_sell'),colour = G.C.UI.TEXT_LIGHT, scale = 0.4, shadow = true}}
          }},
          {n=G.UIT.R, config={align = "cm"}, nodes={
            {n=G.UIT.T, config={text = localize('$'),colour = G.C.WHITE, scale = 0.4, shadow = true}},
            {n=G.UIT.T, config={ref_table = card, ref_value = 'sell_cost_label',colour = G.C.WHITE, scale = 0.55, shadow = true}}
          }}
        }}
      }},
    }}
  end
#

@daring fern

daring fern
weak gate
#

hmmm, interesting - to what? just remove it?

daring fern
quick kraken
#
    key = "vouchername",
    loc_txt = {
        name = "VoucherName",
        text = {
            "When {C:attention}small blind{} or {C:attention}big blind{} is selected,",
            "Upgrade your most played poker hand",
            "by 1 level"
        }
    },
    atlas = "Vouchers",
    pos = {x = 0, y = 0},
    calculate = function(self, card, context)
        if context.setting_blind and not context.blind.boss and G.GAME.used_vouchers.v_testmod_vouchername then
            for l_hand in G.GAME.hands do
                if most_played == nil then most_played = l_hand end
                if l_hand.played >= most_played.played then most_played = l_hand end
            end
            local text,disp_text = G.FUNCS.get_poker_hand_info(most_played)
            update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=localize(text, 'poker_hands'),chips = G.GAME.hands[text].chips, mult = G.GAME.hands[text].mult, level=G.GAME.hands[text].level})
            level_up_hand(self, text, nil, 1)
            update_hand_text({sound = 'button', volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
        end
    end
}```

Anyone with knowledge of vouchers and hand levelups able to tell me what's wrong with this? Cause I know it doesn't work
#

Calculate() code is the result of patchwork from Obelisk and Burnt, am I having this issue because I did the patchwork without understanding the meaning behind it or is calculate() the wrong place to put this?

wintry solar
#

what's it supposed to do?

quick kraken
#

It's right there on the text part of loc_txt

wintry solar
#

oh yes

tall wharf
#

hmmmmmm

wintry solar
#
if context.setting_blind and not context.blind.boss then
  -- do most_played calc here
  return {
    level_up = true,
    level_up_hand = most_played
  }
end``` I'm pretty sure
#

the display will be jank for now, but I have a fix incoming soon

quick kraken
#

So one thing is that I didn't know that was a way to level up hands

#

And the second thing is why aren't the functions taken from burnt joker working?

#

Is it because of how calculate() is implemented for vouchers?

tall wharf
#

ok so i think i am doing something a bit too advanced (by setting a base suit and ranks for jokers/consumeables/stuff) and i have no idea how to remove this badge from appearing on all jokers

wintry solar
#

probably because you don't initialise most_played

quick kraken
#

Wouldn't the ==nil check work though?

#

I don't know Lua that deeply

wintry solar
#

does it crash or does it just not do anything?

quick kraken
#

It doesn't do anything when I select small or big blind, even when redeemed

#

Does Lua have dynamic typing?

wintry solar
#

yes

quick kraken
#

But wait

wintry solar
#

the for loop isn't correct either

quick kraken
#

Huh

#

what's wrong about it?

#

Man does it show that I don't know Lua

wintry solar
#

should be for l_hand, _ in pairs(G.GAME.hands) do

#

you could use G.GAME.current_round.most_played_poker_hand instead though

flat sorrel
#

you have to use pairs or ipairs to make the table iterable: key, value in pairs if it's a dictionary and idx, value in ipairs if it's an array

wintry solar
#

though I think this only updates at the end of each blind

quick kraken
quick kraken
wintry solar
#

so

if context.setting_blind and not context.blind.boss then
  return {
    level_up = true,
    level_up_hand = G.GAME.current_round.most_played_poker_hand
  }
end```
flat sorrel
tall wharf
#

i am not using take_ownership

broken rivet
#

literally no clue what is causing this crash, other than it being caused by a joker effect in a mod i'm making

the joker's code:

return {
    name = "Alexi",
    key = "alexi",

    atlas = "joker_atlas",
    pos = {x = 0, y = 0},
    soul_pos = {x = 1, y = 0},

    rarity = 4,
    cost = 10,
    blueprint_compat = true,

    calculate = function(self, card, context)
        if context.end_of_round and context.cardarea == G.jokers then
            local other_joker = nil

            -- if there's only 1 slot the for loop will cause a crash, so prevent that
            if #G.jokers.cards > 1 then

                -- find joker to the left
                for i = 2, #G.jokers.cards do
                    if G.jokers.cards[i].ability.name == "Alexi" then other_joker = G.jokers.cards[i-1]; print(other_joker.ability.name) end
                end

                if other_joker and other_joker ~= self then
                    card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_duplicated_ex')})

                    G.E_MANAGER:add_event(Event({
                        func = function() 
                            local card = copy_card(other_joker)
                            card:set_edition({negative = true}, true)
                            card:set_eternal(false) -- remove eternal sticker
                            if not card.ability.perishable then card:set_perishable() end -- don't do it if it's already perishable
                            card:add_to_deck()
                            G.jokers:emplace(card) 
                            return true
                    end}))
                end
            end

            return {
                cardarea = G.jokers, -- G.hand, (G.deck and G.discard optionally enabled)
                end_of_round = true,
                game_over = game_over -- true or false
            }
        end
    end
}
#

crash log:

Oops! The game crashed:
functions/common_events.lua:1020: attempt to call method 'juice_up' (a nil value)

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0408c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
    1: Vocalatro by Aikoyori [ID: vocalatro, Version: 1.0.0, Uses Lovely]
    2: Signalis Deck Skin by Snqwblind [ID: SignalisSkins, Version: 1.0.0]
    3: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.4.1, Uses Lovely]
    4: Alexi's Finisher Blinds by invalidOS [ID: AlexisFinishers, Priority: -2147483648, Version: 1.0.0]
Lovely Mods:

Stack Traceback
===============
(3) LÖVE method at file 'boot.lua:352'
Local variables:
 errhand = Lua function '(LÖVE Function)' (defined at line 575 of chunk [lovely debugplus.console "debugplus/console.lua"])
 handler = Lua function '(LÖVE Function)' (defined at line 575 of chunk [lovely debugplus.console "debugplus/console.lua"])
(4) Lua field 'func' at file 'functions/common_events.lua:1020'
Local variables:
 (*temporary) = nil
 (*temporary) = table: 0x0230ecc8  {alerted:true, _saved_d_u:true, original_key:alexi, mod:table: 0x01e93bb8, _u:true, soul_pos:table: 0x0230f600, rarity:4, cost:10, order:151, _d:false (more...)}
 (*temporary) = number: 0.6
 (*temporary) = number: 0.1
 (*temporary) = string: "attempt to call method 'juice_up' (a nil value)"
(5) Lua method 'handle' at file 'engine/event.lua:93'
Local variables:
 self = table: 0x01f4afa0  {start_timer:true, timer:TOTAL, blockable:true, trigger:before, func:function: 0x01cebde8, delay:0.9375, complete:false, time:44.958815166707 (more...)}
 _results = table: 0x01dca080  {blocking:true, pause_skip:false, time_done:false, completed:false}
(6) Lua method 'update' at file 'engine/event.lua:182'
Local variables:
 self = table: 0x020b0cd8  {queue_last_processed:16.6, queues:table: 0x020b12d8, queue_dt:0.016666666666667, queue_timer:16.60823375568}
 dt = number: 0.0133556
 forced = nil
 (for generator) = C function: next
 (for state) = table: 0x020b12d8  {unlock:table: 0x020b1300, other:table: 0x020b1dd0, tutorial:table: 0x020b14f8, base:table: 0x020b14d0, achievement:table: 0x020b1da8}
 (for control) = number: nan
 k = string: "base"
 v = table: 0x020b14d0  {1:table: 0x02456128, 2:table: 0x01f4afa0, 3:table: 0x0205a248, 4:table: 0x022aaf58, 5:table: 0x022ac6b8, 6:table: 0x022af1b8, 7:table: 0x022b5260 (more...)}
 blocked = boolean: false
 i = number: 2
 results = table: 0x01dca080  {blocking:true, pause_skip:false, time_done:f
#

seems to suggest it's trying to copy a non-existent joker but idk how it would be doing that

#

actually i think i have some idea of what's going on

#

yeah

eager pendant
#

Is there any way to fix this?

broken rivet
#

it's from card_eval_status_text

#

my thing not that

quick kraken
wintry solar
#

you'd have to add this to the return

extra = {
  level_up = true,
  level_up_hand = "different hand"
  --can add another extra table here to keep going
}```
spring thistle
#

im trying to get the card to signal that its effects are being triggered, but I don't see anything happening. what is wrong?



    config = { extra = { dollars = 3, increase_per_hand = 1 } },
    
...
    calculate = function(self, card, context)

        if context.joker_main then
    
            ease_dollars(card.ability.extra.dollars)
            card:juice_up(0.8, 0.8)
            card.ability.extra.dollars = card.ability.extra.dollars + card.ability.extra.increase_per_hand
            card:juice_up(0.8, 0.8)
            card.sell_cost = card.ability.extra.dollars 
        end
    end



eager pendant
#

Is there any way to make it go away?

high sinew
#

How do I destroy a playing card?

#

Consumable selects two cards and destroys one and modifies other destroying isn’t working

eager pendant
#

HOW TO FIX THIS PROBLEM

rare obsidian
high sinew
quick kraken
#

Is there a context for selecting big blind specifically?

weak gate
#

@quick kraken should be
if context.setting_blind and context.blind == G.P_BLINDS.bl_big then

quick kraken
#

Ok I'll test it

#

thanks

weak gate
#

what's the function in UI_definitions that makes a card's information to show up?

#

ohh might be function G.UIDEF.card_h_popup(card)

violet oasis
#

Anyone know where the colour value for the debuff shader is set?

gusty iron
#

Has anyone made a tool where you can make ui easier? Or is it still painful?

red flower
#

still painful why

gusty iron
#

im trying to do something with ui :pain:

hasty mist
#

is there a way to replace a specific boss blind with a different one when the blind is selected

willow plinth
high sinew
#

So for modify rank it seems the amount needs to be a integer is there a way I can link it to a function that basically gets the amount of 2 cards selected and modfiys it to be difference

its crashing on modify rank and thin kits not picking up on it being an integer anyone got an idea?

#

this is the define for ranks it calls

gusty iron
willow plinth
glad osprey
#

how possible would it be to draw all (base game) editions on a card

frosty lichen
#

i tried to change red card's texture into sum else and it straight up became jugglar is that normal

glad osprey
frosty lichen
glad osprey
#

oh well in THAT case

#

did you define the atlas

rare obsidian
#

How do you use the watch command lol

frosty lichen
rare obsidian
#

C:\Users\setht\AppData\Roaming\Balatro\Mods\ScribbledMod\shaders\scribbled.fs is the shader i want to watch

glad osprey
#

watch shader Mods/<folder_name>/assets/shaders/<shader> for shaders

glad osprey
#

assets/shaders/shader.fs

glad osprey