#💻・modding-dev

1 messages · Page 224 of 1

vagrant moth
#

For example, Bonus and Mult

manic rune
#

quantum enhancement

#

its an optional feature, i didnt look into how to use that though

sturdy compass
#

Or you could just use in_pool

hushed field
#

quantum enhancements don't do much for enhancement_gate, as far as I know

manic rune
#

oh, i thought quantum enhancement is exactly for that?

#

or am i misunderstanding what enhancement_gate is for

hard flume
#

Would it be better to have all my ideas in one mod or to separate them into separate mods based on theme?

sturdy compass
# vagrant moth For example, Bonus and Mult

Here’s what I did for this exact example (though this is for bonus or mult, not bonus and mult)


in_pool = function(self, args)
        for k, v in pairs(G.playing_cards) do
            if SMODS.has_enhancement(v, 'm_bonus') or SMODS.has_enhancement(v, 'm_mult') then
                return true
            end
        end

        return false
    end
hushed field
# manic rune or am i misunderstanding what enhancement_gate is for

enhancement_gate is what limits jokers from spawning so that steel joker doesn't show up when you don't have a steel card in your deck. So quantum enhancements wouldn't matter for it, because enhancement_gate is just a string value it checks when trying to create the joker

manic rune
#

ohhhhhhhhhhhh

#

why does it have enhancement inside it 😭

hushed field
#

oh it does check if one of your playing cards has that enhancement, haha

topaz monolith
#

I do know the SMODS.OPENED_BOOSTER function. I just need to be able to grab a specific data (Unsure where) and check if its one of the four spectral packs. Anyone know how to do this?

forest ivy
#

just because i got knowledge in lua and know english

#

💔

#

dont know nothing abt the smods lua

topaz monolith
red flower
#

there's no smods.opened_booster function, it's a context in calculate

#

can I see the code?

red flower
topaz monolith
#

The SMODS.opened_booster does exist, and does give me the table data of the pack. Does, however, generate a very long list

red flower
#

oh yeah i remember that, you should still use context.card

topaz monolith
#

Really? If thats the case, how can that be used to compare the opened booster pack and the required pack (In this case, all the spectral packs)

red flower
#

what version of smods do you have

topaz monolith
#

If it hasn't been updated the past 4 days, latest

red flower
#

it is context.card.kind as far as I know, you could also use SMODS.OPENED_BOOSTER.kind but that should be the same thing

topaz monolith
#

So, if I put context.card.kind in the print statement, when I open a spectral pack, should it return the name of the pack or the keyid or nil? Looked at a previous message about this in this cahnnel and found something related, but they were doing it for Tarot Packs

red flower
#

I think it returns 'Spectral'

#

it should return 'Arcana', 'Celestial', etc for the other ones

topaz monolith
#

Its returning a nil for spectral. Unsure about the other ones. I can check the other packs really quick

#

They all return nil

red flower
#

weird

#

maybe it is actually an smods bug

#

unless it's config.kind?

topaz monolith
#

I can quickly try SMODS.OPENED_BOOSTER.kind to see if that works

forest ivy
#

gng, how do i actually make atlas ?

#

like 8 joker's in 1 image

red flower
#

do you mean how to make the image or how to add it to the game?

forest ivy
#

do i have to like make it manually or smth

#

because making it accurate enough myself will kinda be hard

red flower
forest ivy
#

holy cow, ty

#

exactly what i needed

topaz monolith
primal robin
#

Is there an easy way to make tags buyable and add them to shop?

#

Maybe Steamodded have smth for this, idk

red flower
strong jacinth
#

How would I create a popup with two card areas that only accept a certain type of consumable?

topaz monolith
#

Doing SMODS.OPENED_BOOSTER.config.center.kind did work. It gave me "Arcana" for the arcana pack. Thanks

red flower
#

yay

red flower
strong jacinth
#

But how do I create a popup?

red flower
#

G.FUNCS.overlay_menu

spring lantern
#

bro 😭

#

so anyway everything gets multiplied but the base chips reset after each round i think?

strong jacinth
#

What did you do? 😭

spring lantern
#

i should probably cut some decimals

strong jacinth
#

Yes

spring lantern
#

so apparently modifying a card's nominal value also changes its position in hand when sorting by rank

#

fascinating

forest ivy
#

people who managed to understand basics of programming in smods lua

#

are lucky

#

fr

spring lantern
#

it was a long windy road to get here

#

and i still make the dumbest mistakes sometimes

forest ivy
#

welp

#

much better

#

than not making anything at all

spring lantern
#

you'll get there is all im sayin

red flower
#

i got all the smods stuff pretty fast, the vanilla stuff is hard

spring lantern
#

digging through vanilla code and lovely dumps is the vein of my existence

#

bane=

#

?

#

hold on i gotta look this up

forest ivy
red flower
#

bane

forest ivy
#

everything

spring lantern
#

what the fuck would vein even mean in this context

#

am i stupid

red flower
#

veins do let you exist

spring lantern
#

true

forest ivy
#

literally don't understand all that

#

like how in the world is that supposted to work like

#

💔

red flower
#

calculate is called in a bunch of places
a context tells you where it's called

#

the returns handle all the basic gameplay elements with the correct timing

forest ivy
#

what u said is the same as

#

我什么都不

#

for me

red flower
#

do you know what called means?

forest ivy
#

no.

spring lantern
#

might wanna start there

red flower
#

then the problem is not smods, it's programming

forest ivy
#

dont think so

spring lantern
#

been thinking about making tutorials for this stuff

forest ivy
#

ik luau and lua

spring lantern
#

so you should know what calling a function means

forest ivy
#

calling a function

#

yes

#

called without any context

#

is nonsense

spring lantern
#

that's where context comes in

forest ivy
#

calling a function is

functionname(vars here)

red flower
#

"calculate [the function] is called"

spring lantern
#

so that's what the game is doing, at a certain point it goes oh i gotta calculate effects and does calculate(varshere) for every card including your joker

forest ivy
#

just fyi i dont understand all that

#

not just the calculate

#

neither what G means what colour means

#

what card means, what context is

#

except for the if

#

💔

#

and local

#

ye

spring lantern
#

G is the game object so the thing that stores everything related to the game

forest ivy
#

so G.C.MULT is accessing mult color ?

red flower
#

yes

forest ivy
#

peak

red flower
#

G.C is a table with all the colors

spring lantern
#

yeah C is a table that defines global colors for stuff

forest ivy
#

yee i got it

#

now what is that

#

only thing ik is that it add's jimbo

spring lantern
#

yeah that creates jimbo

forest ivy
#

but no wonder how it works like

red flower
#

the first return is not updated tho
it should just be this now
return { xmult = card.ability.extra.Xmult }

spring lantern
#

yeah this whole calculate function seems very outdated

forest ivy
#

yee it is

#

like by 6 months

red flower
#

also instead of create_card it should be SMODS.create_card

spring lantern
#

usually for creating cards you would use this

forest ivy
spring lantern
#

much easier interface basically

forest ivy
spring lantern
#

dont gotta write nil, nil, nil, nil, nil,

spring lantern
forest ivy
#

yee thats also what i was wondering of

#

abt

#

or smth

#

my english kinda suck

#

why is there 4 nil's

#

💔

spring lantern
#

dont gotta worry about it with the SMODS func

manic rune
#

mult x chips

red flower
#

is there a globalthunk

wintry solar
#

smods.add_card would be even better here

spring lantern
#

true

#

that's why i screenshotted both

forest ivy
spring lantern
#

yeah add card does the emplacing for you and all that

red flower
#

yeah it does all 3 of those lines

wintry solar
#

Yup

forest ivy
#

peak

spring lantern
#

thank you smods very cool

wintry solar
#

So that massive block you screenshotted can actually be reduced to just a few lines

forest ivy
#

so how do u like

#

tell it to create um

#

a swashbuckler

#

like specify the joker u want it to add

red flower
#

SMODS.add_card{key = "j_swashbuckler"}

spring lantern
#

j_swashbuckler

forest ivy
spring lantern
#

basically you can check the game's source code to see all the vanilla joker keys

manic rune
#

anyone got that "yipee" cat(?) gif

red flower
#

yes, not all of them have intuitive keys

spring lantern
#

j_ is the prefix for all joker objects

forest ivy
manic rune
#

not the one im finding but im taking that

red flower
manic rune
spring lantern
forest ivy
#

oh

#

right

red flower
#

G.jokers.cards is a list of the cards there

forest ivy
#

does g.jokers return joker's that player has atm ?

#

or some kind of that

spring lantern
#

there's also G.hand for your hand, G.play for played cards, G.consumeables for consumables

#

etc etc etc

forest ivy
#

kinda explains a lot

#

ty guys

manic rune
#

consumeables

spring lantern
manic rune
#

cant believe i mistyped consumeables

#

sorry guys

spring lantern
#

consumeables

ionic cobalt
#

sigh sorry bepis were gonna have to kill you now

spring lantern
#

😭

forest ivy
#

because how in the world

#

do i know

#

which one of them

#

i need

red flower
#

read all of them

spring lantern
#

try these first

forest ivy
#

thats even crazier

#

💔

manic rune
red flower
#

i did i like reading documentation

manic rune
#

:(

#

all goood and cool until its about undocumented functions

spring lantern
#

then if you're gonna make a joker read SMODS.Joker

forest ivy
#

last question

#

how do i access editions

red flower
manic rune
#

-# whats wrong with you

#

:3

red flower
#

:3

spring lantern
#

:3

forest ivy
#

this chat is going crazy

#

a little

spring lantern
manic rune
#

its always been crazy

spring lantern
forest ivy
spring lantern
#

we are a bit silly

manic rune
forest ivy
#

what card is in calculate function

spring lantern
#

card is your card

manic rune
#

its card.edition.key i thiink

forest ivy
#

no i mean like

#

in game editions

manic rune
#

oh

#

check balatro code

#

;3

forest ivy
#

edition = "foil" or smth

#

when adding card

red flower
#

e_ + edition name

forest ivy
#

peak

#

yt

#

ty

spring lantern
#

oh you can do card:set_edition(edition key)

#

hold on

manic rune
#

its in game.lua

spring lantern
#

yeah and edition key would be e_foil for example

manic rune
#

all the vanilla keys are here

spring lantern
#

yup

#

it is quite a huge chunk of text

spring lantern
#

weee

manic rune
#

ive seen worse :3

spring lantern
#

every time i see vanilla code and im about to go insane i remember the vvvvvv switch case of doom

#

and i remember things aren't that bad

manic rune
#

jesus

#

next week i have tests EVERYDAY

red flower
#

i love switch cases i wish we had them

manic rune
#

💀

red flower
#

damn

spring lantern
#

thanks lua...

red flower
#

also there's no continue...

manic rune
#

goto continue

#

:3

red flower
#

yeah i saw smods using goto jumps

spring lantern
#

i have never in my life used continue

manic rune
#

my automaticColoring function uses it

tall wharf
#

:>

manic rune
spring lantern
#

i'm too normie for anything past like

#

for while if else break

#

return

red flower
#

i mean continue is like break but the opposite

manic rune
#

you have a lot of control with goto

#

i think its cool

red flower
#

i think it's ugly

spring lantern
#

seems useful

manic rune
#

:(

red flower
#

that's an entirely different face

tall wharf
#

should i

#

nerf or buff

red flower
#

it kinda makes you have to sell your jokers if they're too strong but it's easy to play around so i think it's fine

manic rune
#

isnt #eidolonGains more than 0 in this case

#

:(

red flower
#

the table is not indexed

hushed field
#

For the events, are the variables given to it set when the event is created and queued, or when it runs?

red flower
#

i always wondered that but never tested it

unkempt thicket
#

I'm trying to change the rank and suit based on cards order, it does change them but only after the hand scores instead. How do i fix this? (this is an enhancement)

hushed field
#

I'm working on my abduction system, and I'm getting some strange behaviour that I think is event related, but I'm not sure yet and if someone here knew, it'd be quicker than testing it 😛

manic rune
#

abduction

hushed field
# manic rune abduction

naming it that is a marketing strategy, so that I can make a reddit post about my mod adding alien abduction to Balatro

red flower
#

i like the counter

hushed field
#

It's been my nemesis since I came up with it, I'm not any closer to figuring out how to do UI stuff 😛

red flower
#

you should try copying my xyz material box but changing the box for a Sprite

manic rune
#

:3

red flower
#

debugging

hushed field
#

But because it's a mechanic that is relevant over the entire ante, I want the number to be more obvious. Abductions take cards when triggered, and return them to where they came from after defeating the boss blind. So it's good to be able to see a number that reminds you that you're probably gonna get those cards back

#

Only thing I still have to decide is whether selling/destroying a card that is currently abducting cards will return the abducted materials or just destroy them, because either it makes selling cards to do deck fixing an unintended option, or you can sell certain jokers to cheat joker slots

hushed field
red flower
#

yeah, that one is kinda complicated because I didn't want to patch stuff

#

the xyz material stuff i stole from cartomancer :3

manic rune
#

im gonna be completely honest

#

i forgot how my code works

#

:3

#

im wondering how i made the whole "add thing to config and it auto works" 😭

hushed field
#

Haha, it's thievery all the way done

hard flume
#

Hi guys! I've decided to start simple with some custom suits & ranks.

tall wharf
red flower
#

why is there a repeater there

tall wharf
#

sprite

manic rune
#

ghhhh

red flower
#

big

manic rune
#

how tf does my code work

#

😭

#

from what im looking at, it shouldnt even work at all but it does

#

how???

red flower
#

what are you trying to do

manic rune
#

soo uhh all of my jokers have functions which read those parts

#

and like, add them to this table

#

its straightforward, but the thing is that the table is not even doing anything

#

its just there

#

its not added in here

#

but for some reason, it still works

#

huh???

hushed field
simple mural
#

How can i change something like weight for an edition locally for the challenge?

#

I know that i can use take_ownership but it works globally

red flower
#

idk about the weight part but you can use a custom rule to check if you need to modify the weights or not

spring lantern
#

hold on im in the middle of making this bullshit function but now im thinking wait wouldnt it make sense if theres some function that i dont6 know of that does this for me while also taking modded hands into account

hushed field
#

hmm, okay, this turns out to be more complex than I was hoping. If I want the visuals for the abduction to happen only after scoring, I'd use an event, but using that event, I'm not sure which card area the card will be in, because it may change due a card changing card area 🤔

#

If I don't do it in an event, I get the intended effect, but the card's visually no longer present during scoring, which I also don't want to happen

red flower
#

can't you just use card.area

maiden phoenix
#

For modded planets it might be different

spring lantern
#

fair, however i need to do the reverse, get the planet from the hand name

maiden phoenix
#

Check if a config and hand_type exists

#

Then get the name/key of it

#

And also check if the set is a Planet ofc

#

In case a joker uses hand_type

hushed field
# red flower can't you just use card.area

I thought I could, but if I call card.area:remove_card() inside the event, the card will not be removed from that area if it was a card that was scored. I think it's because the event will have checked its card area on creation, but the card's area will change to discard after scoring, even if it's not visually there

#

I guess I should check out how the timing on the destroy context works, that's also not synched with the visuals

unkempt thicket
#

Why doesn't this change the rank/suit before scoring hand of the card? (this is for an enhancement)

simple mural
#

What am I doing wrong?

red flower
#

take out the ()

hushed field
simple mural
#

How can I apply take_ownership only to challenge?

hard flume
#

Why is spriting the hardest part of making cards...

spring lantern
#

what we think

waxen mesa
spring lantern
#

no for playing cards there's a whole different function

#

create_playing_card()

red flower
dense vector
spring lantern
#

these are meant to be like hella powerful lol

waxen mesa
spring lantern
#

it's a vanilla func so not the friendliest interface

#

basically create_playing_card({front, center}, area to place, nil, nil, {color})

#

i havent used it a lot but that's kinda how it works

spring lantern
#

those are for skip_materialize and silent apparently

#

just checked

unkempt thicket
waxen mesa
#

and what are front and center for?

cerulean rose
#
G.round_eval:add_child(
                {
                    n = G.UIT.R,
                    nodes = {
                        { n = G.UIT.T, config = { text = "Next Ante:", colour = G.C.WHITE, scale = 0.5 } },
                        { n = G.UIT.C, config = { id = "next_ante_preview" } }
                    }
                },
                G.round_eval:get_UIE_by_ID("eval_bottom"))

why are these two nodes rendered side-by-side instead of on top of each other?

spring lantern
#

front is the rank & suit

#

center is the enhancement or just base if it's unenhanced

waxen mesa
spring lantern
#

i think that's for the materialize animation

earnest nova
#

how do i make my own collab? like, i found this, added minecraft and duplicated among us textures with the name collab_MC. but it doesnt show up in-game

spring lantern
#

for example spectral cards that create new cards use {G.C.SECONDARY_SET.Spectral}

earnest nova
waxen mesa
cerulean rose
spring lantern
#

think i can explain things better with a screenshot

unkempt thicket
#

How can i set the base of a card to be suitless/rankless?

spring lantern
unkempt thicket
earnest nova
spring lantern
#

so ace of hearts would be H_A

red flower
spring lantern
#

enh is an enhancement, you can use poll_enhancement or if you don't want any enhancements just replace it with 'm_base' for an unenhanced card

#

then like i said you can add a seal and/or edition afterwards with set_seal and set_edition

earnest nova
#

... it works only on the steam version, doesnt it...

red flower
#

yes

spring lantern
#

yeah

earnest nova
#

oh so thats the problem

slender cape
#

trying to get localization working but its throwing a hissy fit

#

its specifically these bits that mess it up and i cant figure out why

            k_celestial_pack="Celestial Pack",
            k_planet="Planet",
            k_planet_comet="Comet",
            k_planet_moon="Moon",
            k_planet_unknown="???",
            k_planet_q="Planet?",
        },
        labels={
            planet="Planet",
        },```
#

ive tried putting them both in individually and they ruin it then too

wintry solar
spring lantern
#

okay so if i want to upgrade the current most played hand by like 10 levels

#

uh how do i do that

#

my brain is kinda soupy rn

cerulean rose
manic rune
#

that astronaut joker code (for increasing hand lvl) + obelisk (check what hand is played the most)

spring lantern
#

suit .. '_' .. rank

manic rune
#

:3

cerulean rose
wintry solar
#

You then need to wrap your text node in its own row node and change the column node to a row too

spring lantern
#

spacemans uses level_up = true

#

so that just levels up once

wintry solar
#

Return level_up = X and level_up_hand = whatever hand it is

waxen mesa
spring lantern
#

suit should be just D, H, S or C

#

also to choose a random one do pseudorandom_element({put all options here}, seed)

frosty dock
#

wrong order

spring lantern
#

oops

#

yeah mb i am fried rn

frosty dock
#

to get a random rank and get the card key for indexing into G.P_CARDS, pseudorandom_element(SMODS.Ranks, 'some_seed').card_key

cerulean rose
#

this is what ive got rn

G.round_eval:add_child(
    {
        n = G.UIT.R,
        config = { align = "cm" },
        nodes = {
            { n = G.UIT.R, config = { align = "cm" },            nodes = { { n = G.UIT.T, config = { text = "Next Ante:", colour = G.C.WHITE, scale = 0.5 } } } },
            { n = G.UIT.C, config = { id = "next_ante_preview" } },
        }
    },
    G.round_eval:get_UIE_by_ID("eval_bottom"))
frosty dock
#

mixed rows and columns at the same level behave weirdly i think

spring lantern
waxen mesa
spring lantern
#

i'm very new with consumables

frosty dock
tall wharf
#

:<

spring lantern
#

do i have to like set a flag on use and then handle it in calculate

tall wharf
#

vertex shader fried my peanut brain

frosty dock
#

change L6W.C.secondary to an actual color, that doesn't magically exist in your mod

#

m_base should be c_base

spring lantern
#

bro i really said m_base huh

#

i am so cooked

frosty dock
#

and setting a seal doesn't work like that

cerulean rose
#

balatro ui code is so spaghetti

frosty dock
#

card:set_seal('Red')

waxen mesa
spring lantern
#

do listen to mr john smods tho they know way more than i do

slender cape
#

john smods you beautiful man can you help me with my localization file

waxen mesa
raw geyser
#

Is there a way to add symbols into descriptions?

spring lantern
raw geyser
#

I'm trying to have the card message be "🍒🍒🍒"

cerulean rose
#

got another misbehaving ui element here

G.round_eval:add_child(
    {
        n = G.UIT.C,
        nodes = {
            { n = G.UIT.O, config = { object = blind_sprite } },
            {
                n = G.UIT.R,
                config = { align = "cl" },
                nodes = {
                    { n = G.UIT.T, config = { text = number_format(blind_amt), colour = G.C.RED, score_number_scale(0.5, blind_amt) } },
                }
            },
        }
    },
    G.round_eval:get_UIE_by_ID("next_ante_preview"))

the text node doesn't appear at all

waxen mesa
cerulean rose
cerulean rose
spring lantern
frosty dock
waxen mesa
#

wait watfool

spring lantern
#

the game itself handles randomness with the global seed

manic rune
#

e5 and e5 look so good until you realize its just x1.25 because all gains from the joker is halved :3

frosty dock
#

it's turned into a seed internally based on the game seed

waxen mesa
#

lol

frosty dock
#

the string effectively creates different randomness pools

manic rune
#

:3

waxen mesa
#

I ment "WHY THE HELL HAS YOUR JOKER MULTIPLE PAGES OF EXPLAINATION" but ok

manic rune
#

they have equipment slots

waxen mesa
wooden nexus
#

Question: Which 0.5 and which 1 do you like more?

manic rune
#

top left and top right

wooden nexus
#

Top row is from my old D&DG designs and Bottom are more based on K6T's

cerulean rose
#

top left by a mile

#

not sure abt the 1 tbh

#

top right feels empty

#

but bottom right uses a completely different “1” than 10

wooden nexus
#

Problem with the 1 from 10 is that it's squashed

#

I'd have to make it 3 pixels wide

#

idk, looks weird

waxen mesa
#

ok, then another thing:

#

key = "Vegetables",
primary_colour = G.C.GREEN,
secondary_colour = G.C.RED,

loc_txt = {
   name = 'Vegetables', -- used on card type badges
    collection = 'Vegetables', -- label for the button to access the collection
    undiscovered = { -- description for undiscovered cards in the collection
        name = 'Vegetables',
       text = { "A card that contains healthy food" },
    },
},
 shop_rate = 1,
 cards = {
    
   ["j_lilith_apple"] = true,
}
}```
#

Dont ask, i just want this thing to work at all

#

something particually wrong here?

cerulean rose
cerulean rose
hard flume
#

does this concept suit look okay?

cerulean rose
#

also not code but apple is not a vegetable

edgy mountain
#

hi, this code broke sometime because of a steammodded update i think?
its just supposed to change the rank of the card to an Ace

cerulean rose
#

cannot think of a recent smods update that would break that

waxen mesa
cerulean rose
# waxen mesa

please send the actual error
this is section of the traceback

waxen mesa
hushed field
#

Do Cardarea:emplace and cardarea:remove not work when they're called inside of an event?

mighty trench
#

Hello! Is there a reason the value shows up as nil? I'm trying to remake a joker similar to egg. Thank you in advance :3

hushed field
mighty trench
#

oh!

mighty trench
#

so I'd need to add a loc_vars?

hushed field
# red flower im pretty sure they do

I don't see a reason for them not to work, yeah, but I guess it's an issue due to the sequencing then. If I call them in an event, the playing card's cardarea doesn't change, for some reason

red flower
#

yeah mine are jokers and consumables so they shouldn't change location

wooden nexus
#

<@&1133519078540185692> I dunno who else to ping to get rid of

grand violet
wooden nexus
#

Thank you my Egg Friend

mighty trench
#

Thank you, moderation

wooden nexus
#

For some flavor text you could replace $ with ETH and it works the exact same

#

Because at worst you have it for 3 rounds

mighty trench
#

I'll keep that in mind! I'm planning to just make an "evil egg" for this one but this seems like a much more logical idea

hushed field
mighty trench
#

I enjoy this idea. Especially the ETH flavor text. Thank you for sharing

wooden nexus
#

Meanwhile I'm strugling with bugfixing my mod. Stuff like Sigil and all that are crashing

#

But instead of doing the bugfixing, I'm just making another branch of my mod to work on the next update lol

raw geyser
#

what's the code to make something never have rental tags?

mighty trench
#

Everything in the text works well but it doesn't seem to change value at the end of the round. I copied this from the egg jokers data so it should be adding 3 right now (which it is not doing)

#

thank you in advance :3

cerulean rose
#

change self to card

mighty trench
#

nothing seems to have changed as nothing happened ingame

#

could it be a formatting issue? like with commas and everything

strong jacinth
#

How would i create a button that opens a popup?

cerulean rose
mighty trench
#

oh! i had skipped over that

cerulean rose
#

proceed at your own risk

strong jacinth
#

Haha, yes

#

I know

cerulean rose
#

but also idk

edgy mountain
#

this just says im calling change_base with invalid arguments?

hushed field
#

at least something's loaded in 🥲

edgy mountain
#

suit isnt doing anything there, i was just testing

cerulean rose
edgy mountain
#

hang on

#

let me get it

mighty trench
#

once more, nothing has happened upon completing a round. I'm lost since this is my second day using lua at all

latent portal
#

hi chat

edgy mountain
#

i guess thats really the only relevant part

    ```if context.before and next(context.poker_hands['High Card']) 
    and G.GAME.current_round.hands_played == 0 then    
        
                    card:juice_up(0.5, 0.5)
                    play_sound('card1')
                    suit = card.base.suit
                    SMODS.change_base(card,nil,'Ace')
                
    end```
latent portal
#

how do you make cards shuffle again?

#

im trying to crossreference default game code but

#

no dice

#

it says shuffle is a nil value

cerulean rose
#

shuffle like amber acorn or shuffle like at the start of a blind

latent portal
#

amber acorn

#

but for hands

cerulean rose
#

G.hand:shuffle

latent portal
#

oh, i was doing G.hand.cards:shuffle

#

thanks!

cerulean rose
latent portal
#

btw

#

flipped cards can still be sorted

#

is there any way to prevent that?

cerulean rose
#

thats just how the game is

latent portal
#

dang

cerulean rose
#

works against the wheel too

knotty copper
#

For the path for textures can you have it so its stored in a sub folder in the 2x folder
Like path = "subfolder\texture.png"? or does it have to be in the root of the 2x folder?

cerulean rose
#

you can

#

also you need 1x versions too

latent portal
#

this is what im making btw

#

is this broken or just cracked

mighty trench
#

Don't know about balance but I know I'd enjoy it

#

if it hits a face card/if you have pareidolia thats an x4 with photo

#

and then theres chad...

cerulean rose
#

also keep in mind that cards get turned face up when played

latent portal
#

yeah

#

i added a check for that to make it work

#

turns out you can inject variables into cards

#

ok so

#

not so simple question

#

how hard is it to make custom rules for a challenge

cerulean rose
#

not that bad

waxen mesa
cerulean rose
#

you set that on the joker you want to be in the objectgroup

red flower
raw geyser
#

I'm setting rental_compat = false, but it's still showing up with a rental tag.
Anyone up to help?

latent portal
cerulean rose
waxen mesa
pale temple
#

i need this asap

cerulean rose
sturdy compass
marble flint
cerulean rose
#

why are my ui elements overlapping

manic rune
#

they are hugging each other

cerulean rose
manic rune
#

very wholsome

marble finch
#

quick question, i had made a booster pack earlier and noticed that since i had only one valid content for it, the rest would be jokers, i tried using the in_pool function as i read somewhere that causes duplicates to be valid, but i still get mostly jokers

in_pool = function(self, args)
return true, {allow_duplicates = true}
end

did i screw up there somehow perhaps?

wooden nexus
red flower
red flower
cerulean rose
#

right

marble finch
#

wait, makes sense actually :o

#

well, then ill quickly send in my create_card code since thats likely where something could be off

#
create_card = function(self, card, i)
  return {set = 'TagSet', area = G.pack_cards, skip_materialize = true, soulable = false, key_append = "tagpack", edition = {negative = true}}
end

i honestly dont know in detail what i did, i mostly took a look at certain other mods and the docs for answers ._.

#

sometimes i hate discord formatting

hushed field
#

N, do you know if object nodes can have child nodes? I'm trying to stack the text onto the sprite for the display

cerulean rose
marble finch
hushed field
#

ah, i bet it's a syntax error somewhere then

karmic heart
#

How can I check for when specific tarot cards are being used?

manic rune
red flower
cerulean rose
latent portal
#

as in all playing cards

cerulean rose
#

thats barely a custom rule

latent portal
#

well yeah

#

but still, i wanna dip my toes in the water

cerulean rose
#

that should be an easy one

pulsar flower
knotty copper
#

Is it possible to make it so the text box for the collab sets wider to fit more text?

cerulean rose
#

probably

wooden nexus
manic rune
cerulean rose
#

anything is possible if you're insane enough

manic rune
#

id rather use like 4 planet cards than risking my run 😭

#

the benefits are really marginal when you consider that some boss blinds can potentially put your run to an end

cerulean rose
#

also makes Boss Tag totally useless

latent portal
#

btw where in the source code are vouchers stored

knotty copper
#

For DeckSkin what is the suit_icon used for in-game?
Bit confused where it is used

hard flume
#

custom suit progress :)

dense vector
gleaming zealot
gleaming zealot
sacred pike
#

hey peeps anyone can help me turn my textures into a texture pack?

wooden nexus
latent portal
#

how do i make cards be drawn flipped?

waxen mesa
#

this... seems too easy, where is the error?

strong jacinth
wooden nexus
#

Because there's this deck

#

Instead of Jack Queen King it's Man, Woman, Ace

hard flume
#

That's fun. I'm just doing my own thing tbh

wooden nexus
#

ik, just a fun thing i wanted to mention

manic rune
sturdy compass
cerulean rose
wooden nexus
#

98% of balatro fans can't read

#

Reread what you replied to

granite turret
#

||boy, girl, nil||

wooden nexus
#

Ace is Ace

wooden nexus
cerulean rose
#

J -> ♂️
Q -> ♀️
K -> 🇦
A -> ❓

granite turret
wooden nexus
#

I will not dereference your gender lol

manic rune
#

wha

#

what happened to my table gif

granite turret
#

guh

#

broken

wooden nexus
cerulean rose
#

oh so this is a deck with only 12 ranks

wooden nexus
#

mhm

#

Shinku's Card Binder is all about the weird and unique like that

#

6 suit decks, 12 suit decks, New Ranks, Odd Ranks, Ports, UNO

#

MF UNO

#

LUIGI'S PICTURE POKER

hushed field
#

got it working! Kinda want it to be further up in the right corner, but no clue how to do that

distant grove
#

how do you do a random mult?

#

like 1-15

wooden nexus
#

There's a pseudo random generator in balatro

distant grove
#

so how would i put that into my code?

wooden nexus
#

good question. off the top of my head idr lol

#

lemme look

hushed field
#

pseudorandom()

distant grove
#

ok

wooden nexus
#

There you go, what ice said basically

distant grove
hushed field
#

No, you want to put that in your calculate function. It does take parameters though, but you could control-f your lovely dump and see how it's implemented in smods

distant grove
#

okay

#

so what would i put in config?

#

mult = 1-15?

hushed field
#

that's very dependent on what your joker does

waxen mesa
wooden nexus
#

if you wanted to not use the balatro psuedorandom, idk if this works but you could try math.random(15), since that's a basic thing in Lua with the mathmatical library

teal herald
#

how do i detect when my joker has been sold?

hushed field
#

I recommend you check your dump for how misprint does it, PEAK

distant grove
#

okay

hushed field
distant grove
#

trying to find misprint code rn

karmic heart
hushed field
distant grove
#

okay

#

thanks

#

so i put the min and max into config?

#

than the pseudorandom into calculate?

hushed field
#

do you know what the config does?

waxen mesa
hushed field
#

Judging from the error, though, you're probably just dealing with a syntax error in your localization

waxen mesa
hushed field
#

myfirstjoker's text isn't bracketed

waxen mesa
#

hm, didnt help

hushed field
#

I'm assuming you have that same syntax mistake happening at more places

#

I'm not sure how you've programmed the vegetable object, but I haven't encountered descriptions contained within a loc_txt element yet

waxen mesa
#

ah, found it

red flower
waxen mesa
#

next problem, the game refuses to find the description again

hushed field
hushed field
waxen mesa
red flower
#

im thinking about making that a bit more modular

hushed field
#

I couldn't find a way to render the text atop the sprite as a child node, btw, so it's just two separate roots that get stacked 😛 I haaate UI 😄

hard flume
#

I had a really dumb idea cuz it's too complex but I kinda wanna do it, since it slots in really well into the features I already have planned.

I guess I can always save it for later

red flower
#

if it works 🔥

hushed field
#

Now to the next step, which is going back two steps and trying to figure out how to fucking get this abduction effect to work, haha

red flower
#

maybe you can save the areas in G but name them after the card

#

like G.kino_abduction_[j_key]_[unique_id]_area

hard flume
red flower
waxen mesa
#
key = "pink_seal",
badge_colour = HEX("f598ed"),
sound = { sound = 'red_seal', per = 2.0, vol = 0.4 },

calculate = function (self, card, context)
    if context.main_scoring then
        SMODS.create_card({
        "food"})
    end
    
end


}```
#

is something wrong with this?

red flower
#

set = "food" (if you made a set called that)

waxen mesa
#

wasnt sufficient

#
                name = "Pink Seal",
                label = {"Whenever this card gets resolved, generate a Food Consumable"}


            }```
#

tried to change label, to text, didnt help either

#

sigh

unkempt thicket
#

Is there a way to make any card rankless/suitless, also is there a way to make any card score? (without modifiers like seals or enhancements)

pale temple
#

check out splash's code maybe

#

for rankless/suitless i'm assuming it would work like stone?

#

because stones still have an underlying rank and suit

radiant grove
#

Hi, can anyone help with an error I’m getting. My game was working with mods yesterday but when I added talisman and Maximus, Maximus wouldn’t even open on the steamodded version I had so I got a newer version and now the game opens but everytime I click a card, it crashes

wintry solar
radiant grove
#

Idk code so idk what I’m doing but when I click a card it crashes and says it’s in functions/common_events.lua:566 attempt to index a number value

latent portal
#

hey

#

whats the function that draws a card so i can hook it?

wintry solar
#

What are you trying to do?

latent portal
#

im trying to make it so that all cards are drawn flipped

radiant grove
#

So I just added a few mods and I’m just trying to play a run but if I click a single card, it immediately crashes

wintry solar
#

For a blind or just generally?

latent portal
#

just always

#

its for a challenge

strong jacinth
#

How would i create a button that opens up a popup

latent portal
#

I tried G.draw_card and Card:draw_card but it's not either one

wintry solar
#

I don’t remember exactly what it is but you could search for the calculate context call that has first_hand_drawn in

red flower
#

you can check the graveyard in my mod if you want reference

latent portal
forest ivy
#

soo what is wrong with this single line of code ?

SMODS.add_card(set = 'Joker', area = G.jokers, key = j_swashbuckler)

#

💔

latent portal
#

i want every hand

wintry solar
#

I mean to find what the function is called

red flower
forest ivy
#

ohh {} not ()

#

holy mistake

#

ty man

#

but theres other problem, it spwans random joker instead of swash

#

even worse, it also spawns random tarot

#

💔

wintry solar
#

They need to be strings

red flower
#

key has to be in quotes

forest ivy
red flower
#

the key

forest ivy
#

just the key ?

#

they mostly means 2+

#

not a single thing

#

js asking

maiden river
latent portal
#

see thats what i dont want

#

i dont want them to flip in hand

#

i want them to come already flipped

forest ivy
#

ye it works but

#

it spwans random tarot too

#

not just the swash

wintry solar
#

Then you have something else spawning the tarot

forest ivy
#

i dont think so

latent portal
#
local drawcardlocal = draw_card
function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
    drawcardlocal(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
    if G.GAME.modifiers.cherrysmod_allflipped and card.facing == "front" then
        card:flip()
    end
end

this is what i have so far and it crashes whenever a card attempts to be drawn. any glaring obvious issues or?

forest ivy
#

tarot isn't mentioned anywhere

latent portal
#

it says all values are nil

forest ivy
#

the code is basically simplest joker ever

red flower
wintry solar
#

Pls just return xmult =

latent portal
strong jacinth
unkempt thicket
strong jacinth
#

Yeah, how do i use the grave yard? is it open from the start?

red flower
#

it's hidden while there's nothing in it

#

just sell a joker from my mod

wintry solar
red flower
#

modify_scoring_hand

wintry solar
#

I’ve not added it to docs yet though so you’d have to dive into the code to see how to use it properly

latent portal
red flower
#

I think it's just returning add_to_hand = true adds it and remove_from_hand = true removes it

#

no, sorry

#

I'm literally making that effect later today tho

#

I just don't have the code in hand rn

latent portal
#

alright

#

if i figure it out before then i'll let you know

strong jacinth
#

Or do i need the ui too

#

Like the Popup

red flower
#

a minimal version should work if you delete the create tabs here

red flower
latent portal
#

why is card set to a nil value before being drawn???

long sun
#

hiya! question

#

i've written this ability:
If played hand contains a Straight, gains +1 Mult for each unique scoring suit (Currently +0 Mult)

#

i'm able to write the ability by making a table of all the unique suits in the straight, as it's scored

#

but how do i handle Wild cards?

latent portal
#

wild cards count as any and all suits all at once

long sun
#

actually no

wintry solar
long sun
#

they can be used as any suit, but for any one joker, it can only be used as that suit

#

for multiple, they can have different perspectives

wintry solar
#

The game doesn’t normally draw a specific card

long sun
#

iirc. Flower Pot wouldn't allow a Spade, Club, Wild hand

frosty dock
#

the way these work is that it counts non-wilds first, then wilds

latent portal
#

hi john survwave

frosty dock
#

for wilds, flower pot counts them as the first suit it can find that hasn't been accounted for yet

long sun
#

ah icic

#

i'll take a look at Flower Pot's code and see if i can write it from there

latent portal
#

john i need ur help for a second

long sun
#

thanks ^^

frosty dock
latent portal
#

im trying to hook draw_card for a challenge

#

but

latent portal
latent portal
#

am i even hooking the right func

wintry solar
#

I don’t think you can do this with a hook either

#

I think you need to patch draw card instead

latent portal
#

waitwaitwait HUH

#

no there HAS to be an easier way to do this

wintry solar
#

It’s called patching

sonic cedar
#

taking the moment to push this since it's a new day

how would i format it? i looked at the tarots but i think that's just for playing cards. i looked at amber acorn since it flips jokers, how would i format that for k, v flip function to make mine flip?

strong jacinth
#

I need help understanding ui and stuff

wintry solar
sonic cedar
#

is the amber acorn one the right idea? or would the tarot thing be better

#

(example: death)

wintry solar
#

I don’t know what you’re trying to achieve other than you said flipping cards sounded hard

sonic cedar
#

realized i should also post the different ones

sonic cedar
wintry solar
#

You don’t need any loop then

hushed field
#

Eremel, outside of events, is there a way to get played cards to not yet update their visuals, before the scoring code happens? I've been trying to get my functionality of moving a scored playing card to a temporary out-of-play card area, but either the card's visually gone during scoring, or isn't properly moved if I use an event to do it

red flower
# sonic cedar i just want the joker to do the flip/unflip anim so it'll mask the change of it ...

something like this i think

G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:flip()
            return true
        end,
    }))
G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:set_ability(G.P_CENTERS[other_key])
            play_sound("card1")
            card:juice_up(0.3, 0.3)
            return true
        end,
    }))
G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:flip()
            return true
        end,
    }))
#

maybe change the delays

sonic cedar
sonic cedar
#

give me a second to comprehend

red flower
#

i hope the formatting is fine because im on mobile :3

sonic cedar
#

terrifyinh

wintry solar
hushed field
#

Ah, I guess that makes sense. I'll read up on the timings then

sonic cedar
#

did i miss anything

red flower
#

yeah thats correct
i had an effect like that and i did that
but then i removed the flipping

latent portal
#

A hook doesn't seem to work

#

If I put the edited value before, it gets overwritten

latent portal
#

If I put it after, the card has already been drawn and so it's too late

#

I'm gonna have to learn what the hell a patch is

red flower
#

patches are not that hard but they seem intimidating

latent portal
#

what does a patch do exactly

red flower
#

it adds stuff in the middle of the code

sonic cedar
latent portal
#

and how do i make one

#

:(

red flower
hushed field
# wintry solar Sounds like your event is mistimed

I've currently set it up like this (I know delay doesn't matter for an immediate trigger, but it's there for swapping around), but no timing seems to successfully remove the playing card from the card area, and it just gets placed into G.deck after the hand is played, instead of my custom cardarea. If I remove the event, it does work, though it's visually jarring because the card's not visible, ofc

red flower
red flower
#

the card object

#

like just replace that line with the one you were using

sonic cedar
#

i mean i was using your generate_ui before

#

which still does the self, card, yadayada setup

wintry solar
latent portal
red flower
#

because it's not a lua file 🙂

sonic cedar
#

lovely uses .toml files

latent portal
#

oh i see

hushed field
wintry solar
#

hmmm

#

might need to alter the function that empties the cards at the end of play

hushed field
#

Yeah, I'll take a look at that, then. My other idea was to make being abducted a function of the card, see if it then does move properly

long sun
#

the way i'd like to run this involves checking each card as they score, then displaying a message if it's a new suit

#

hmm wait no, maybe not

#

i could do it before everything

#

which would make Wilds easier to implement

#

how do i get all of the suits that are in the game?

#

i know some mods add suits to the game

sonic cedar
latent portal
#

okay so

#

i added lovely/challenges.toml to my mod

#

do i have to do anything else for the game to recognize it or?

red flower
#

as long as in the lovely folder then it should workd

red flower
sonic cedar
#

i fixed it after the ss

#

but thanks

red flower
#

also put it outside the return

#

on in func

unkempt thicket
#

This case usage does not appear to be working G.hand.highlighted[i].always_scores = true

latent portal
#
[manifest]
version = "0.0.~1"
dump_lua = true
priority = 0

# Challenge stuff

[[patches]]
[patches.regex]
target = "functions/common_events.lua"
pattern = '''
if pseudorandom(pseudoseed('flipped_card')) < 1/G.GAME.modifiers.flipped_cards then
stay_flipped = true
end
'''
position = 'after'
match_indent = true
payload = '''
elseif G.GAME.modifiers.cherrysmod_allflipped and to == G.hand then
stay_flipped = true
'''

is this correct?

strong jacinth
#

Yo

#

N

#

Where did you define G.C.JOY.TRAP

#

Like the color

red flower
latent portal
#

oh.

#

that.

#

okay.

red flower
latent portal
#

okay so the patch isnt doing anything

strong jacinth
#

Oh, how would i change the text?

latent portal
#

im trying to reference the default balatro folder

red flower
#

reference the lovely/dump

#

that's after the steamodded patches

strong jacinth
sonic cedar
cursive gazelle
#

chat

#

i'm cooked

#

help

#

i'm ass at pixel art

strong jacinth
#

What do you want to do?

latent portal
stuck seal
#

Anybody know how I can instantly win/lose a run? Using SMODS

red flower
red flower
cursive gazelle
#

i want to draw hatsune miko sideway but it doesn't look good because 95x71 isn't enough space

strong jacinth
#

With what? Dont i need to predefine that?

latent portal
#

ty

sonic cedar
#

flipping

tall wharf
#

omg toma

sonic cedar
#

omg

red flower
tall wharf
strong jacinth
#

Would this work?

red flower
stuck seal
strong jacinth
sonic cedar
#

alr moment of truth

red flower
tall wharf
red flower
strong jacinth
red flower
#

yeah that's in the first link i sent you earlier

latent portal
red flower
#

my challenge patches just happened to be regex which are a bit harder to write

latent portal
#

oh wait

#

remember that thing you told me

#

where u said that i was putting an elseif after an end

#

that was intentional

red flower
#

that would crash the game

latent portal
#

no because the if statement im targeting is inside another if statement

red flower
#

oh ok

latent portal
#

even still

#

i dont think its doing anything

strong jacinth
red flower
red flower
strong jacinth
red flower
#

no, the problem is that JoyousSpring is a table from my mod
just put everything inside the create_overlay_graveyard inside joy_open_graveyard

latent portal
red flower
#

oh is that what you meant by target lol

latent portal
#

w

#

yea

#

?

red flower
#

take out the lovely/dump then

latent portal
#

😭

tall wharf
#

😭 how do i make game force save when i select card