#💻・modding-dev

1 messages · Page 140 of 1

frosty dock
#

I've been meaning to for like the past 2 weeks 🥴

proper stratus
#

silly goose

long sun
#

thanks!! :D

proper stratus
#

ok wait

#

strange

wintry solar
#

shall we get it done now and then I'll document them all?

frosty dock
#

oh wait i thought you were talking about something else

#

silly me, it's 1am and I'm tired

#

I did add context.main_eval

proper stratus
#

i just used the dnd screen cus i didnt care lmao

frosty dock
#

I'm not sure there's any others that need to be added

wintry solar
#

cool cool, I'll take a look through and add any that might be missed

proper stratus
#

oh wait

#

i just didnt materialize it

wintry solar
#

holy indentation

proper stratus
#

they call me god they way i make space

#

also can someone explain to me why like half of the parentheses in the vanilla code are backwards

#

like on the other end of that Event

#

whats up with that

sturdy compass
proper stratus
#

:)

#

yep

#

i can feel the pain that that question caused

sturdy compass
#

Everything within those parenthesis are defining what happens in the Event

ionic verge
#

hey real quick
i need to do something more than this to actually set up the ID right?

vagrant cedar
#

The empty ones

ionic verge
#

or

#

i dunno at this point

dusk harness
#

i cant seem to find what im looking for using the search, but how does one add a joker to the jokers table, like programatically add lets say perkeo to the joker roster?

wintry brook
sturdy compass
proper stratus
ionic verge
sturdy compass
wintry brook
#

cryptid does it with one of its decks

#

im not too sure how but thats probably a place to look

dusk harness
#

do you know which one?

#

if not im just gonna restart the game with Talisman installed

proper stratus
#

equlibrium deck

dusk harness
#

tahnks

ionic verge
#

like this right?

#

what does file name need to be

wintry brook
#

modName.json would work

obsidian nexus
#

[SOLVED]: #💻・modding-dev message

Hello, I am creating a small mod and I want to update the multiplicator of a card with the number of stone cards in the full deck x2

Here is my code:

update = function(self, card, dt)
    if G.STAGE == G.STAGES.RUN then
        local new_mult = 0

        for _, v in pairs(G.playing_cards) do
            if v.ability.name == "Stone Card" then
                new_mult = new_mult + 1
            end
        end

        self.ability.extra.curr_mult = self.ability.extra.curr_mult*new_mult
    end
end

However, it doesn't work. I used the Sandshrew card from pokermon as an example

cerulean rose
#

check stone joker from vanilla

obsidian nexus
#

Also if there are some docs about different contexts I'm interested

cerulean rose
obsidian nexus
#

I can't find the code for the vanilla jokers

cerulean rose
#

extract balatro.exe as a zip

proper stratus
#

heyo! final thing,
this code works, but it only copies the first card
even if i have multiple cards with fecundity, all of them trigger, but they all copy the first one

#

dont mind the rats

obsidian nexus
tepid crow
proper stratus
#

RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS

cerulean rose
#

🐀

proper stratus
#

anyway yeah idk why it does that lol

#

i just yoinked the code from DNA so thats probably it

#

but idk what the actual problem is in the script

#

oh wait

#

im dumb

#

just a second lemme try something

distant aurora
#

i apologize if this is a stupid question, but i installed DebugPlus, how would i use it to spawn my custom joker i made into a round?

proper stratus
#

hover over it in the collection and press 3!

#

all the keybinds are in a text file in the mod

distant aurora
#

oh awesoem tysm!

proper stratus
#

mhm!

ionic verge
#

is it possible to define a new function for a custom joker

proper stratus
#

im pretty sure, yes

ionic verge
#

something like this

proper stratus
#

i saw cryptid doing something like that when i was peruzing

cerulean rose
#

you can do that

proper stratus
#

OH WOW

ionic verge
#

oh wait

#

it needs a comma

#

lol

proper stratus
#

yeah thats useful

ionic verge
#

alright my idea didnt work

proper stratus
vivid forge
#

hello, i've just finished making my first joker. it works perfectly, but... did i need THAT many checks in the if statement for it to work? i know end_of_round is one of the trickiest contexts, but if someone knows a better way, please give me some feedback

obsidian nexus
# obsidian nexus [SOLVED]: https://discord.com/channels/1116389027176787968/1233186615086813277/1...

Thanks @cerulean rose , it works now !

update = function(self, card, dt)
    if G.STAGE == G.STAGES.RUN then
        self.ability.extra.curr_mult = 0

        for _, v in pairs(G.playing_cards) do
            if v.config.center == G.P_CENTERS.m_stone then -- strange thing with m_stone
                self.ability.extra.curr_mult = self.ability.extra.curr_mult + 1
            end
        end

    self.ability.extra.curr_mult = self.ability.extra.mult*self.ability.extra.curr_mult
    end
end

Here is the updated code if anyone has the same problem

cerulean rose
runic pecan
proper stratus
#

its slightly different because its before the calculation so interest goes up

high sable
#

How would I go about making a visual mod for the game?

vivid forge
#

and yes i did check out the that guide while making this

violet void
#

The crash was caused by the repetition context

vivid forge
#

rolo helped me to fix the joker, it pretty much requires many of those checks or else it crashes the game or gives a lot of money by retriggering itself
we wanted to know if there's some suggestions for optimization

ionic verge
#

the problem:
i am trying to tell the description what my joker (mimic joker, copies a random joker each round) what joker it is copying this round, and i have no idea how to do that
does anyone have any input on that?

high sable
vagrant cedar
#

Does anyone know the simplest way to make it so specific Jokers can't be in shop if you have another in the list

ionic verge
vagrant cedar
#

I mean I guess

ionic verge
#

ill be honest, no idea

vagrant cedar
#

the opposite tho

ionic verge
#

oh yeah good point

vagrant cedar
#

I have 10 Jokers that override the background music, and I don't want you to be able to have multiple of them, as only one can do the effect at a time

dusk harness
#

i have looked around and could not figure out how to get all the available vouchers, is there someone that can help me with that?

#

i've looked around in the game couldnt and couldnt figure it out

cerulean rose
#

you'd have to figure out which in that list are vouchers

dusk harness
#

whats in Centers, what define center type objects?

cerulean rose
cerulean rose
vagrant cedar
#

I see the in pool

#

I'm aware I need to use that

#

How

cerulean rose
#

you specify a function that returns whether the joker is allowed to spawn

#

it's defined in the same place as calculate

ionic verge
cerulean rose
#

card.ability.extra.selectedJoker

#

if it's pointing at a Card object, it would be card.ability.extra.selectedJoker.config.center

vagrant cedar
#

or like before

cerulean rose
#

before

ionic verge
cerulean rose
#

no, that'll give the center of the joker

tepid crow
#

you should be able to add a tooltip with the center digitaldetective just gave you

cerulean rose
#

if you want the name inline, maybe check HOOK://

worthy stirrup
#

Is a x2 folder needed?

vagrant cedar
#

ok i'm not gonna lie I'm just getting more confused staring at this webpage

#

Yet again

cerulean rose
ionic verge
#

its used for pixel smoothing

cerulean rose
worthy stirrup
#

Ah, if I turn off pixel smoothing, it uses x1?

cerulean rose
#

yes

worthy stirrup
#

Thank you

vagrant cedar
#

I understand I have to use the in pool function.

#

How do I use it.

#

What code goes there?!

#

Nothing is on the page for that

cerulean rose
#

return true if the joker is allowed to spawn

#

return false if it isn't

vagrant cedar
#

ok but how do I specify that I want it to spawn when the other Jokers aren't there

#

This is just a static do or don't spawn

cerulean rose
#

no, it's a function

#

use SMODS.find_card to check if you have a certain card

#

here's an example from a custom blind i made

#
in_pool = function(self)
    if G.GAME.round_resets.ante < 3 then
        return false
    end
    for k, v in ipairs(G.jokers.cards) do
        if not v.ability.pinned then
            return true
        end
    end
    return false
end,
#

this makes the blind only spawn if you have a joker without pinned and are on at least ante 3

ionic verge
cerulean rose
#

check how cryptid's HOOK:// gets the name of a joker

ionic verge
#

ok

vagrant cedar
cerulean rose
#

the idea is right

#

the code is completely malformatted though

vagrant cedar
cerulean rose
#

it would be

in_pool = function(self, args)
    return not SMODS.find_card("j_MUSC_inrainbows")
end,
vagrant cedar
#

so is that telling the pool to no longer have those cards if this function is ran?

#

that would make inrainbows impossible to grab if I have davidbyrne ?

cerulean rose
#

no, the function is evaluated when the joker pool is determined

#

so that means that davidbyrne can't appear if you have inrainbows

vagrant cedar
#

ah

#

so the other way around

cerulean rose
#

yes

vagrant cedar
#

ok

#

So before I embark on my journey

#

I must ask one final question

cerulean rose
#

🦈

vagrant cedar
#

I have 10 Jokers that this must be compatible with

#

Do I just do this for 9 on all 10

#

Or is there a global function

cerulean rose
#

there isnt a global function by default

ionic verge
#

this is it?

#

what's happening here?

cerulean rose
#

but you could define a function in your file

cerulean rose
#

so that it will display the joker's name in the selected language

dusk harness
tepid crow
#

the list is a lot bigger than that

#

and the vouchers should indeed be in there 🤔

dusk harness
#
        for k, v in pairs(SMODS.Centers) do
            sendMessageToConsole("Info", nil, k)
            --if starts_with(SMODS.Centers[k], "v_") then
            --    sendMessageToConsole("Info", nil, string.format("voucher : [%s]", dump(SMODS.Centers[k])))
            --end
        end```
am i doing something wrong?
tepid crow
#

weird

#

oh

#

you're checking the SMODS pool

vagrant cedar
# cerulean rose 🦈

in_pool = function(self, args)
return not SMODS.find_card("j_MUSC_inrainbows") and not SMODS.find_card("j_MUSC_nwa")
end,

tepid crow
#

which only has the modded stuff

vagrant cedar
#

Is this what it would look like to make it do it for 2

tepid crow
#

try G.P_CENTER_POOLS.Voucher instead

dusk harness
#

ok brb

cerulean rose
dusk harness
tepid crow
#

then try the value not the key?

dusk harness
vagrant cedar
#

But I got you

cerulean rose
#

count_debuffed is the parameter name

vagrant cedar
#

oh

#

, count_debuffed = true ? or just , true

proper stratus
cerulean rose
#

so it wouldn't include all vouchers

dusk harness
wintry solar
dusk harness
#

no value, its so weird

cerulean rose
tepid crow
wintry solar
#

print value.key

proper stratus
#

thank you very much

dusk harness
#

ill try to print a different way

#

brb

proper stratus
#

now to make it a 1 in 4 and the sigil is completely done!

wintry solar
tepid crow
#

I mean

#

printing the value should've printed something or crashed 🤔

dusk harness
#

i might have been stupid brb

#

i didnt do my string.format correctly

tepid crow
wintry solar
#

I mean the value is a table so if he's trying to manipulate it as a string it wont like that

tepid crow
#

yeah but it should've crashed if he tried to concat it with a string

#

unless he just misspelled the value variable in the code

solar eagle
#

im at a wall here, i have this joker that crashes with this
the intent is that whenever a king or jack is discarded, 32 chips are added to a pool. then when a queen is scored, that queen is upgraded by however large the pool is (similar to hiker)

#

however it crashes whenever a king or jack is discarded with this error

#

and im not quite sure why

dusk harness
#

i forgot to put [%s] in my string in the string.format("voucher : [%s]", dump(v))

solar eagle
#

poking in the game source for these functions didnt help unfortunately

tepid crow
#

just let me print(var)

dusk harness
dusk harness
tepid crow
#

a fellow pythonista in my lua modding-dev, I love it

wintry solar
#

I don't understand why you're formatting it anyway

solar eagle
#

yea give me a second

cerulean rose
solar eagle
#

hold up

#

that was when i improperly referenced variables

solar eagle
#

its a hardcoded value either way

tepid crow
#

also card = self is usually wrong in steamodded code, but I'm not sure that's the cause of the crash

cerulean rose
#

heyo rq can someone code review me here

for i = #G.playing_cards, 1, -1 do
    local card = G.playing_cards[i]
    if SMODS.has_enhancement(G.playing_cards[i], "m_pencil_diseased") then
        G.playing_cards[i].ability.remaining = G.playing_cards[i].ability.remaining - 1
        if G.playing_cards[i].ability.remaining <= 0 then
            G.playing_cards[i]:remove()
        end
    end
end

this is in a lovely patch btw

solar eagle
cerulean rose
solar eagle
#

but i can try

#

ooh i see

#

give me a sec to get the full error

dusk harness
cerulean rose
wintry solar
#

but why do you want to print the full table? it's almost all entirely useless for what you're trying to do

solar eagle
#
Local variables:
 self = table: 0x09273540  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x09a63d60 (more...)}
 dt = number: 0.00353747
(13) Lua field 'update' at file 'main.lua:996'
Local variables:
 dt = number: 0.00353747
(14) Lua function '?' at file 'main.lua:935' (best guess)
(15) global C function 'xpcall'
(16) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
 func = Lua function '?' (defined at line 906 of chunk main.lua)
 inerror = boolean: true
 deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
 earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])```
and also this as well (sry for wall)
wintry solar
#

it's probably unhappy that the message is a number rather than a stirng

solar eagle
#

yea thats what i figured

#

interesting error tho

tepid crow
#

ah yeah that's probably it

solar eagle
#

guess i gotta go figure out how to force lua variable to be string or something.

tepid crow
#

tostring should work

solar eagle
#

and vice versa?

cerulean rose
#

or use localize with a +chips message

vagrant cedar
#

Digital my man

#

I think the code worked too well

#

They don't seem to be appearing in shop at all now

solar eagle
#

im very new to lua and balatro modding in general i have no idea how i got any of my other jokers working

vagrant cedar
#

I used DebugPlus to give myself $4000 and and I didn't see any of them through the rerolls

#

Like I couldn't even get the first one

#

Which is weird because previously they were showing up frequently

cerulean rose
solar eagle
#

oooooh

#

thank you!!

#

how would i put this in a description though? or does this produce a string

cerulean rose
#

oh i thought you meant for the message

solar eagle
#

no im pretty sure the issue is

#

"{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chips)"

cerulean rose
#

no, don't think so

solar eagle
#

oh wait im stupid

#

i understand what u mean

#

maybe i should go to bed Anyway thank you!!

cerulean rose
#

if it's crashing when trying to display a message then

solar eagle
#

yea i got it

dusk harness
#

ok, so now that i get the voucher list, how do i add all of them to the current shop?

dusk harness
#

cause im trying to unlock everything so testing things is easier

cerulean rose
dusk harness
#

i didnt know it existed

vagrant cedar
cerulean rose
solar eagle
#

ok nice it no longer crashes i just have to fix up some other issues

#

thank you!

cerulean rose
vagrant cedar
#

where do I add this print

tepid crow
cerulean rose
#

do it in the joker_main

#

and then play a hand

wintry solar
#

that is a crazy way of setting a pool of joekrs to be unique

vagrant cedar
cerulean rose
#

oh what would you reccomend?

vagrant cedar
#

i have NO CLUE what's happening

wintry solar
#
in_pool = function(self)
  if G.GAME.MUSC_present then return false end
end,
add_to_deck = function(self)
  G.GAME.MUSC_present = true
end,
remove_from_deck = function(self)
  G.GAME.MUSC_present = false
end
#

something like this

cerulean rose
#

wouldn't work if you have multiple

#

through showman

vagrant cedar
#

You're not supposed to have multiple through showman of this bad boy tho

cerulean rose
#

actually how does showman interact with in_pool?

vagrant cedar
#

well if he appears you shouldn't take him

cerulean rose
vagrant cedar
#

My jokers don't interact with each other, if you take an additional it doesn't do anything

wintry solar
#

in_pool overrides showman iirc

cerulean rose
#

right but having multiple would break the add/remove deck method

vagrant cedar
#

That's why I said you shouldn't take one through showman

vagrant cedar
wintry solar
#

but you wouldn't be able to have multiple

cerulean rose
#

we're talking about what happens if you do

vagrant cedar
#

Don't

cerulean rose
#

you said you shouldn't take one through showman, implying that it's possible

#

you should never rely on the player's good will

cerulean rose
#

especially for something so technical

vagrant cedar
#

Like this?

cerulean rose
#

cus i'd think you would just do

in_pool = function(self)
    return not G.GAME.MUSC_present
end,
solar eagle
#
            local value = context.other_card:get_id()
            print("card scored")
            print(value)
            if value == 12 then
                print("queen?")
                print(card.ability.extra.pool)
                context.other_card.ability.perma_bonus =
                    context.other_card.ability.perma_bonus + card.ability.extra.pool
                    return {
                        message = localize('k_upgrade_ex'),
                        colour = G.C.CHIPS,
                        card = card
                    }
            end```
next question - this section is not working properly, ive verified through the console that its properly detecting queens but the upgrade bit never shows and the card isn't upgraded
#

any more ideas... i feel bad for asking

wintry solar
#

returning nil treats it as true yes

#

or rather, it treats it as not being there and goes off base logic

cerulean rose
#

oh that makes sense

solar eagle
#

the perma_bonus section was gotten from balatro's card.lua and looking for hiker-related code

vagrant cedar
#

Ok so I don't know what's going on

#

They were appearing in shop before

#

Now none of them appear

solar eagle
#

hmm i need to figure out why this card is resetting every hand

vagrant cedar
#

Same as the last code

#

It's almost what I want

#

But they don't have a first one appear

#

I rerolled 100+ times

#

They work when I spawn them in through DebugPlus

#

But they just aren't appearing in shop

#

They were before this in_pool stuff

solar eagle
#

ok wait

#

it seems to be

#

that the pool variable is getting reset

#

and i have no idea why

cerulean rose
#

seems like in_pool isn't working rn

vagrant cedar
#

Odd

solar eagle
#

this is so weird

#

do config variables reset each hand?

cerulean rose
#

no

tepid crow
tepid crow
solar eagle
#

ok why the flip is mine

#

no to 0

#

each hand my pool variable gets reset to 0

#

before scoring happens

#

and i have no idea why

cerulean rose
#

check 2XPWACI4 with strange pencil

#

normally calendar spawns in the first shop

#

but if you add

in_pool = function(self)
end,

to calendar's code it doesn't appear

vagrant cedar
solar eagle
#

i am silly

#

i set it manually

#

misread how joker scoring works .

#

ok part of it is now working

pulsar flower
#

i've patched in a few blind callbacks of my own, but they don't activate matador. is there a standard way to trigger it in those cases?

#

i could probably loop over all the jokers every time and trigger it manually but that doesn't seem ideal

cerulean rose
#

G.GAME.blind.triggered = true

pulsar flower
#

that's what i thought, but that doesn't seem to have worked

cerulean rose
#

works fine for me

pulsar flower
#

i think i'd need to call calculate joker with the debuff context

#

hm, no, matador checks the triggered variable directly

misty anchor
#

Im new to the modded balatro comunity and have been trying to get my game working but it eventually crashes and i dont know what to do to fix it

#

can someone help me?

cerulean rose
#

try adding a print to see if that line even executes

pulsar flower
#

the line does execute, i put it right before the actual action

#

what i think might be happening is that the blind does get triggered, but matador isn't calculated yet and the moment you play a hand again since there's nothing to debuff it returns to normal, and matador doesn't trigger

misty anchor
#

do you want me to dm it to you strange

pulsar flower
#

since i'm not triggering the blind around the time a calculate_joker happens

cerulean rose
misty anchor
#

ok

cerulean rose
#

known issue with cryptid on the newest steammodded

misty anchor
#

ok how do i fix it

cerulean rose
cerulean rose
misty anchor
#

Thank you so much Detective that worked

cerulean rose
#

please call me detective

misty anchor
#

oh sorry

cerulean rose
#

its cool

#

😎

pulsar flower
#

i'm not sure if i'm missing something

cerulean rose
#

should work on press_play i'd think

#

but setting it on discard wouldn't work since matador doesn't trigger in that context

#

and it gets cleared when a hand is played

pulsar flower
#

oh well

vagrant cedar
#

They appear in shop again

#

Good

#

They appear in shop while owning the other Jokers though

#

Bad

#

I did notice an error as I was going through though that might have caused it, so I'm going to try one more thing and see if that fixes it

#

Nope they just don't appear in shop at all now

#

Ok

#

They spawn, they play the music, all that works

#

But they keep appearing in shop

cerulean rose
#

put back the other two functions

lapis summit
#

hello balatro modding chat
i am brand new to modding this game. as in like
45 minutes ago new
so please excuse me if i come back here frequently with dumb or obvious questions

solar eagle
#

dw

#

im similar i somehow managed to slap together a joker or two and now im deciding to add a new hand

cerulean rose
#

theres lots of people like that here

#

everyone's been that person at some point

lapis summit
#

word

#

ok

wintry brook
#

would this not work?

cerulean rose
#

context???

tepid crow
#

just tried to auto-roll for a modded joker from a mod I don't even have enabled, no wonder it couldn't find a seed 🤦‍♂️

wooden nexus
wintry brook
#

just calling G.P_CENTERS with the center key like that

wooden nexus
#

Ditpyrc spriting go brrrrr

#

(i literally just changed the sprite colors ngl)

tight thistle
#

hello! does anybody know how to make a joker delete a single random card of a specific rank?

wintry brook
#

nevermind it works

cerulean rose
#

i have an enhancement description which makes no sense without an actual card existing, so i have a special collection description

vagrant cedar
#

None to appear ever

solar eagle
#

or you can check for fake_card

cerulean rose
vagrant cedar
cerulean rose
#

put back add_to_deck and remove_from_deck

#

but use my version of info_queue

cerulean rose
#

(thats me btw)

#

(if i read the fucking commit i would've realized that)

solar eagle
#

yea..

#

it helps

vagrant cedar
#

I see the difference in the two now

#

I didn't know what info_queue meant

#

I see how the two versions are different besides the add_to_deck and remove_from_deck now though

#

Adding the add and remove back in

cerulean rose
#

wait no not info_queue

#

in_pool

#

i'm stupid

#

or dyslexic

#

or both

solar eagle
#

many such cases. unfortunately

cerulean rose
#

@vagrant cedar

vagrant cedar
#

ok now i feel slightly justified in being confused lmao

#

i fixed it though

#

it works now

#

I appreciate the help @cerulean rose @wintry solar

gilded narwhal
#

hey how do I get these guys to not trigger every frame

lapis summit
#

how exactly do i go about testing my mod?
really i just want to do a simple asset replacement mod. im not super interested in poking around in the code for now
ive been cautious to backup any files i want to change before i do irreparable damage to my game that cannot be undone

cerulean rose
lapis summit
#

thanks

solar eagle
#

im creating a custom hand and it does properly detect

#

however, the cards dont score

#

im probably missing something cause the documentation on poker hands is VERY sparse but

wraith topaz
#

Art of The Deal has released Version 1

wintry brook
#

does anyone know where the code that sets the cards into G.play might be

turbid violet
#

hey guys quick question, trying to add/change some of jimbo's quotes, currently using the localization files but they aren't loading in, does steamodded use a different path for it or am missing something?

ionic verge
#

is there a way to have a joker not appear in the collection?

turbid violet
cerulean rose
#

localization

runic pecan
#

Is "Stone cards give +81,800 chips" too straightforward for a Legendary-like joker?

turbid violet
#

just the language files, currently editing en_us

cerulean rose
#

hm, not sure

runic pecan
cerulean rose
#

no

#

don't do that

#

use no_collection in the center

cerulean rose
turbid violet
#

just replaced lq=1 with the quote i wanted but it didn't get replaced in-game

cerulean rose
#

huh?

turbid violet
#

the lose quotes, that's how they're named in the lua file

cerulean rose
#

can you send the file?

turbid violet
#

sure

cerulean rose
#

woah thats a lot

#

you only need to return the entries you're changing

hardy viper
#

ya don't return things you aren't changing that's very bad

turbid violet
#

i see, i'm pretty new to this so i just thought editing the files would do the trick

but do i need to do something in order for the game to read it?

hardy viper
#

oh wait huh

#

you're just editing the files?

turbid violet
#

the one on the steamodded folder yeah

hardy viper
#

generally for localization changes you make a steamodded mod as usual and place an en_us.lua (and/or other languages you want to support) in the same folder as your mod

#

and then you can just return whatever fields you're changing and omit the rest

cerulean rose
#

yeah, just like minecraft resource packs

turbid violet
#

okay, that makes more sense, is there a guide i can look up for how to make a mod in the first place? kinda just the first time i tinker with stuff like this

cerulean rose
turbid violet
#

awesome, thanks!

gilded narwhal
#

is this cursed

cerulean rose
#

yes

hardy viper
gilded narwhal
#

I mean

cerulean rose
#

oh yeah that too

gilded narwhal
#

It did

cerulean rose
#

no

#

test again with a non-mega

gilded narwhal
#

nvm my bad

cerulean rose
#

also you should either check the number of cards to choose

hardy viper
#

("a" == "b" or "c") -> true

cerulean rose
#

or make a table for mega booster packs like cryptid's meme pack pool

hardy viper
tight thistle
#

how does this work, exactly?

hardy viper
#

actually

#

that might be left to the joker

gilded narwhal
#

this doesn't work either

hardy viper
#
local allowed_names = {
 mega_blahblah = true,
 mega_blag2 = true,
 ...
}
if allowed_names[SMODS.OPENED_BOOSTER.config.center.key] then
 --blah blah
end
gilded narwhal
#

Damn was that obvious and I'm just silly

hardy viper
#

i wouldn't call it obvious dw

gilded narwhal
hardy viper
tight thistle
runic pecan
hardy viper
#

this except without the misspelling destroying part

runic pecan
#

yeah, my bad.

#

fixed it.

cerulean rose
gilded narwhal
hardy viper
cerulean rose
#

thats also not great cus it enforces making keys for your objects a specific way

gilded narwhal
#

Yk mod compat is completely broken with my mod anyway so I'm not gonna worry about it

cerulean rose
#

aight

runic pecan
gilded narwhal
#

Speaking of which is there a way to disable mods on a specific condition or do I have to like ask ppl "hey could you disable all other mods pls"

tepid crow
cerulean rose
#

you're thinking of the conflicts key!

hardy viper
#

string.find(key, "[^o]mega")

tight thistle
cerulean rose
#

just don't search string the key

tepid crow
# hardy viper

pretty sure that doesn't work for the one I posted 👀

hardy viper
cerulean rose
tepid crow
#

fair enough

hardy viper
#

regardless if you aren't putting mega in the key of a mega pack that's on you

cerulean rose
#

but many many errant matches

#

just use a modifiable table okay!?

hardy viper
runic pecan
tepid crow
hardy viper
#

you aren't seeing mega in the key of a pack that isn't a mega

#

not unless the mod prefix happens to be mega

#

you could fix that with more pattern but meh

tepid crow
#

I mean the _mega_ riv suggested seemed pretty idiot-proof

hardy viper
runic pecan
hardy viper
#

are underscores taken literally in lua patterns

#

okay they are

tepid crow
hardy viper
#

if we really want to go into it we can search the name and description as well as the key

#

surely it's not too complicated

tepid crow
#

and here's one with the opposite problem mega_d6_jokers_pack

runic pecan
#

But I think the real condition should be [if you can choose 2 card from this pack or other amount].

tight thistle
#

...i still cant get the destroying effect to work

hardy viper
#

which is a lot of mods nowadays

#

oh wait

#

you can check center

tepid crow
cerulean rose
tepid crow
#

forgot the underscores

#

oop

hardy viper
#

you can guarantee there's gonna be two underscores in the key before a mega can appear

tepid crow
#

no I just suck at lua patterns so I need to convert it to regex in my mind to understand it

hardy viper
#

does generic regex not have -

tepid crow
#

that's the *?

hardy viper
#

is * not "match 0 or more of the previous character, as many as possible"

runic pecan
tepid crow
hardy viper
#

- in a lua pattern will match 0 or more of the previous character, as few as possible

tepid crow
#

also known as a lazy 0 or more

hardy viper
#

not sure what you mean by making it lazy

tepid crow
#

right?

#

lazy means match shortest possible string

cerulean rose
#

yes

hardy viper
#

that feels like unnecessary complexity but i guess that's what regex is all about

tepid crow
#

what feels unnecessarily complex to me are lua patterns

#

that mf is barely documented

hardy viper
runic pecan
tender gale
#

I'm trying to add a new type of consumable called Zodiac cards. Currently I'm just trying to see if I can get them to show up in the collection in-game. However whenever I try to access the collection I get this error:

#

How could I fix it?

#

I apologize if my code is bad, it's my first time modding

runic pecan
#

did you put the sprites in both 1x and 2x?

hardy viper
#

oh wait

#

i forgor

#

lemme just delete that message

tender gale
runic pecan
#

in ui.lua:
which probably means it needs alpha value

tepid crow
hardy viper
#

nobody uses 5.4 anyways am i right...

#

right guys .m rightj....

tepid crow
#

Thunk sure doesn't >:D

hardy viper
#

i think it's the same but w/e

runic pecan
# tight thistle

You need to drag if context.destroying_card out of if context.individual and context.cardarea == G.play ... statement

tight thistle
#

oh

gilded narwhal
#

this activates regardless of if I bought something or not

hardy viper
#

context.individual and context.destroying_card are mutually exclusive

hardy viper
tight thistle
gilded narwhal
#

I mean these are the only two functions that are part of it. I'm trying to make it so it gives 2 hands and discards if you leave the shop without buying anything

hardy viper
tepid crow
hardy viper
tepid crow
#

I just googled "lua patterns" in a private tab?

hardy viper
#

unsurprising then

#

afaik if you want 5.4 you have to specify 5.4

tepid crow
#

makes me wonder why their url isn't /manual/latest/manual.html

tepid crow
#

you're not storing cards_bought anywhere

#

(also you're resetting the value every time you call the function regardless)

runic pecan
#

I suggest you put cards_bought in config.extra and reset it every round.

tepid crow
#

can just reset it in context.ending_shop yeah

gilded narwhal
#

Alright I'll make a few changes and see if that works

#

I can also make the local boss_hands... stuff into the config

#

Okay this works !

tight thistle
#

now i just need to figure out how to make it destroy only one random king rather than every single scored king

gilded narwhal
#

599 lines of code in lua and 11 lovely patches

#

Most advanced thing I've ever managed to program

foggy carbon
#

in context.selling_card can I see what card was sold?

runic pecan
wintry solar
runic pecan
wintry solar
wintry solar
wild patrol
#

Explain Boolean in counter strike terms

cerulean rose
#

yes or no

cerulean rose
foggy carbon
#

yeah, I got that working, but it doesn't display a message?

sturdy compass
# foggy carbon

Do you have a message in your localization called k_drinkme?

foggy carbon
#

yes

#

it could just be that selling_card isn't intended to display messages?

sturdy compass
#

That could be the case

#

I wonder if you could circumvent that with card_eval_status_text

wintry solar
#

What smods version ?

foggy carbon
#

1.0.0-alpha-1304a

wintry solar
#

That’s why the message won’t work

foggy carbon
#

?

wintry solar
#

Old calc is very restrictive in what you can return from a calculate function, you should be developing on better calc

foggy carbon
#

ahh

tender gale
#

Is there a way to use {X:} to display a custom colour that isn't a suit colour or CHips or Mult?

#

If so, how

wintry solar
#

Add your colour to the loc_colour table

tender gale
#

How do I do that

onyx inlet
wild patrol
#

What's the best way to find a card function in the vanilla game

#

To implement into a custom card

#

Just curious

#

So not playing needle in a Heystack

runic pecan
wild patrol
#

I guess what's the most common phrase used in a function

#

Just look through functions

runic pecan
wintry solar
#

Only loc_colour in misc_functions, the others in global aren’t used for description text

wintry brook
wintry solar
#

Quantum enhancements makes cards function as if they had enhancements without actually having the enhancement, you could say 6s count as gold cards for example

foggy carbon
#

so, I downloaded the newest smods and...

#

looks like it should be fine if I knew where card.lua was?

#

found it.

#

@wintry solar

wintry solar
#

There’s nothing missing there

foggy carbon
#

the line originally was G.jokers.replace(card) return nil, true return nil, true

#

and it goes back to that whenever I try to run the game

wintry solar
#

Screenshot mods folder pls

foggy carbon
wintry solar
#

How did you download smods?

foggy carbon
#

from github

wintry solar
#

Using git or direct download?

foggy carbon
wintry solar
#

Delete it and try downloading again

foggy carbon
#

it worked

#

guess I got a small corruption in the download first time?

wintry solar
#

You didn’t clean up the old version you had properly so there were some duplicate patches

wild patrol
#

Since my code is unorganized as hell is it possible to have jokers and consumables in the code or do I have to make a separate Lua

wild patrol
#

Alright

#

Just gonna duck tape and glue this mod because I can't figure out custom booster pack lol

#

Guess my next question would be what's the best way to make a card you can add to ur deck

#

Similar to rock card but the card can actually do something

wintry brook
#

like an enhancement? or something more special

wild patrol
#

Nutshell

#

Pot of greed in the deck

#

Instead of being like a number card it's like a consumable that stays in ur deck every round

wintry brook
#

cryptid made consumeable playing cards, but they destroy themself when used so i imagine for what you want you'd have to either disable destroying them or make a copy secretly

#

if you want an easy way to do it, i dont think there is one

runic pecan
wild patrol
#

I wonder if it is possible to combine the function of playing a hand

#

But it doesn't count towards the number hands u play

#

I wonder if I can find the function in the vanilla game

#

Can I use vanilla game functions or are we restricted to what smod allows

wintry brook
#

you can use anything the base game uses

wild patrol
#

I'll just try duck taping and gluing some code together from the vanilla game

#

Hey as long as it works

wintry brook
#

you can even override base game functions, although im not sure thats ideal

runic pecan
wild patrol
#

I've played the game a little bit and beaten it a few times but haven't seen everything yet

#

What's the key value for a booster card?
I know there's tarot, celestial, and Derek for some reason as joker

wild patrol
#

That'll def help

#

Just look for the function it calls and copy paste it and modify it

runic pecan
#

functions/state_events.lua

wild patrol
#

So guessing I have to make a smod.booster
And make the key for the card key = booster?

ionic verge
#

how do i make it so a joker cant be found in the shop

wild patrol
wintry brook
ionic verge
wintry brook
#

I havent done it for a joker but I did

        return false
end,```
ionic verge
#

cool

wintry brook
#

im not entirely sure if that works but worth a shot

runic pecan
runic pecan
wild patrol
#

Ty

#

Also what's the key to add a card in to the boosters

#

For extra cards in ur deck

runic pecan
#

Or just look up SMODS.Booster section in SMODS.Center document.

tender gale
wild patrol
#

The smod.booster

#

Is what I should use correct

#

Unless I wanna get fancy with it

tender gale
wild patrol
#

Also ty for the help sorry coming off as annoying constantly asking for help but I'm more a visual learner and over the years visual guides kinda died out on how to mod games lmao

#

Actually went back reread the custom booster packs part of the wiki and it got easier to understand the more I fiddle with this

runic pecan
tender gale
#

it just crashes

runic pecan
#

What about G.ARGS.LOC_COLOURS.Plus = G.C.ZPLUS

tender gale
#

same error

wild patrol
tender gale
#

oh

#

How do I fix that

wild patrol
#

Basically saying it can't find whatever it's looking for

#

You'll have to go to that line it says in the error message in the .lua file

#

And see if there's a typo in ur code or something

tender gale
#

Oh i think i know why

#

I had a space between HEx and brackets

#

No that's not it

wild patrol
#

Can u copy paste the code

#

with ```

#

People probably be able to help u of they can see it

#

Possibly the fiction it's calling for has a typo

tender gale
#

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

SMODS.ConsumableType{
key = "Zodiac",
primary_colour = HEX("123098"),
secondary_colour = HEX("5448AD"),
collection_rows = {4, 4},
shop_rate = 1,
loc_txt = {
collection = "Zodiac Cards",
name = "Zodiac",

   undiscovered = { -- description for undiscovered cards in the collection
         name = 'Unknown Sign',
         text = { 'Find me! Find me nowww' },
     },
},
can_stack = false,
can_divide = false,

}

G.C.ZPLUS = HEX("5448AD")
G.ARGS.LOC_COLOURS.Plus = G.C.ZPLUS
SMODS.Consumable {
key = 'Aries',
set = 'Zodiac',
loc_txt= {
name = 'Aries',
text = { "+1 {X:Plus,C:white} Zodiac Level{} to all played 2s", }
},
atlas = 'Zodiacs',
pos = { x = 0, y = 0 },
unlocked = true,
discovered = true,
}

#

Here's the entire code of the main lua lol

wild patrol
#

Which one was on line 28

tender gale
#

G.ARGS.LOC_COLOURS.Plus = G.C.ZPLUS

runic pecan
#

@frosty dock Does current smods allow mod maker add their custom loc_colour?

tender gale
#

Idk which smods I have actually

#

I'll check

runic pecan
#

(I feel like there should be a SMODS method)

wild patrol
#

Download the alpha

#

U might have the -old version

tender gale
#

"1.0.0~ALPHA-1220a-STEAMODDED" is my version

wild patrol
#

Maybe HEX isn't a value in the Loc_colours?

#

Because that's basically what the error is saying

#

It's saying it basically doesn't exist

#

Usually what a nil is

runic pecan
#

No no no, it says LOC_COLOUR was a nil value when the code is processing it

wild patrol
#

Dumb idea but is it maybe the spelling of colour

#

Because how some people spell is color

tender gale
#

I'm pretty sure smods uses colour

runic pecan
wintry solar
#

Call loc_colour(‘red’) first

runic pecan
#

Or just loc_colour() if you don't want to specify

frosty dock
#

it does need an argument i think

runic pecan
#

Yeah, this way G.ARGS.COLOURS initiates before indexing

runic pecan
tender gale
#

That actually worked

frosty dock
#

yeah but it tries to index G.ARGS.LOC_COLOURS with its argument

tender gale
#

thanks

frosty dock
#

which means it crashes if there is no argument

#

table index is nil

tender gale
random sleet
#

wooooo more zodiac cards

surreal marsh
#

how do i use this bettercalc target 🤔

wild patrol
#

Ask it nicely

#

Pretty sure if u search up xmult should give u some ideas how to add it

#

Or I'm probably reading it wrong

surreal marsh
#

i think it means i can use a lovely patch to add another cardarea

#

but the message itself is from a lovely patch so how does it work

wild patrol
#

I dunno if lovely has a wiki

#

Maybe probably look there if it does

#

I'm still trying figure out smod

surreal marsh
#

ok ik

#
version = "1.0.0"
dump_lua = true
priority = 1```
#

changing my lovely file's priority to be lower than smod's

molten ice
#

smods's lovely priority has been changed to -10 for a while (since the start of january), so even keeping it to 0 would work iirc

surreal marsh
#

bettercalc is 0

molten ice
#

huhh

#

i guess there was a bug indeed

wintry solar
#

Better calc is zero because loads of them whiffed at -10 and we haven’t fixed it yet

surreal marsh
#

but why not -9 balatrojoker

sick sparrow
#

anyone do you tried to animate card or have a singular card have a multiple variants?

random sleet
#

holy shit its betmma

#

betmma's on screen guys

surreal marsh
#

that target is another scoring card area, but how do i add another joker-like area that calculates on scoring cards? (into G.jokers.cards + G.consumables.cards)

#

bettercalc seems much different from a week ago

#

apparently needs to inject on for k = 1, #G.jokers.cards + #G.consumeables.cards do balatrojoker

#

no it's a smod file

#

🤪

wild patrol
wintry solar
#

I don’t think that’s where you want that

surreal marsh
surreal marsh
wintry solar
#

In score card and calculate context

#

This will run in every single evaluation otherwise

#

Like each check of a joker for an individual card will also run it through all of your spells

#

Where as I think what you want is each scoring card to go through your spells once

surreal marsh
#

i think ideal place is here

surreal marsh
wild patrol
#

If that file directory means what I think it does

surreal marsh
#

i think

wintry solar
surreal marsh
#

score_card is in a smod file, can i inject into that

#

i suppose lovely patch only works on files in vanilla game

wild patrol
#

I dunno but being able to dump game functions in real time would be a cool feature for modding

frosty dock
#

-# 0.7.0 soon-ish maybe possibly??

surreal marsh
#

that'll be cool balatrojoker messing other mods' files

tight thistle
surreal marsh
#

what does 142073 mean

wild patrol
#

How many lines does other card have lol

#

I wanna say it's line 142073 row 262 lol

#

But not sure lmao

surreal marsh
#

usually it's file path: line number

frosty dock
#

for some reason a buffer has the name 142073?

random sleet
#

classic

vocal verge
wintry brook
#

ive seen this problem before but im not sure how to fix it. i have playing cards destroying other playing cards and the game is fumbling & drawing already destroyed cards. how do i properly destroy cards in a played cards calculate function

candid epoch
#

can a consumable be used as a holdable boosterpack?

random sleet
#

you could probably have it spawn a booster pack like how tags do, but be careful on when you allow it to be used

candid epoch
#

what do you mean by that?

random sleet
random sleet
candid epoch
#

so its best just to make it give a tag?

wintry brook
long sun
#

Might steal that idea actually, hmm

#

Nah nvm ^^

random sleet
merry raven
#

Are there contexts to check if a blind is completed/won and also to check what ante the player is at
Trying to make a one-per-ante effect for a Joker

summer shard
#

I tried removing "jimbo's pack" already, still crashes when I accept payment

#

after beating a blind

#

I'm assuming its obvious, but sense I am new I just don't see it

wild patrol
#

this worked thank u

#

dunno how but it did lol

merry raven
#

context.end_of_round = true is a check to see if a Blind has been defeated right?

wild patrol
long sun
#

hi! i have this condition that should trigger when Midas Mask, Runner, etc. trigger — however, it triggers after the hand is played (not before), and also triggers twice. why?? :>
if context.cardarea == G.jokers and G.GAME.current_round.hands_left == 0 and not (context.blueprint_card or self).getting_sliced and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then

wild patrol
#

what does SMODS.Back

#

do

#

is that just for the back texture of a card?

night pagoda
wild patrol
#

oh

#
SMODS.Booster
{
    key = 'yugioh',
    loc_txt { 
            name = 'Yugioh Pack',
            group_name = 'yugioh',
            text = { 'A collection of yugioh cards' }
            },
}```
#

hoping this is correct

#

trying to make custom booster pack again now that I have 6 so far

sand oasis
#

is there any documentation on how to make tarot and spectral cards?

#

never mind, I found SMODS.Central

#

(though I think having an ExamplesConsumables.lua would rock BUT i get this is free labor)

wild patrol
#
    key = "yugioh",
    path = "yugioh.png",
    px = 71,
    py = 95
})

SMODS.Booster({
    loc_txt { 
            name = 'Yugioh Pack',
            group_name = 'yugioh',
            text = { 'A collection of yugioh cards' }
            },
    atlas = 'yugioh',
    pos = { x = 0, y = 0 },
    config = { extra = 5, choose = 1 },
    weight = 1,
    cost = 4,
    group_key = 'Yugioh Booster',
    draw_hand = true,
    unlocked = true,
    discovered = true,  
})```
#

Have I done this right?

sand oasis
#

fundamentally looks good, did you try it in game yet?

wild patrol
#

not yet

#

doesn't doo anything but create it

sand oasis
#

you can spawn boosterpacks in the shop with DebugPlus jsyk

wild patrol
#

I haven't figured out how to actually add the cards to it

#

not even sure it'll show up in-game

long sun
#

hmm, this joker feels a little bland — what's missing? :P

frosty dock
long sun
#

ooh wait lemme try something

surreal marsh
wild patrol
long sun
#

okay i like this a little more :D

#

might make the slant slantier though :D

wild patrol
#

no one noticed I forgor the = after loc_text

#

so error says i'm missing a key

#

i'm assuming key is booster?

sand oasis
frosty dock
wild patrol
#

ah ok

#

I made it bosster but i'll change it

#

it worked tho

long sun
#

okay, i've settled on this :D

wild patrol
#

This stuff isn't hard it's just i'm a dumbass trying to put a puzzle together lol

sick sparrow
#

daniel j. d'arby joker?

sick sparrow
wooden nexus
#

smh

#

there's a YUGIOH CARD MOD RIGHT ABOVE YOU

#

Why are you worried about copyright infringement in a balatro mod

#

it's not like you're monetizing it

#

Anyways

wild patrol
#

My dumbass struggling to figure out how to use create_card

#

once I can figure this out I should be set to just go crazy on this mod

hardy viper
#

you dont egg

#

technically you do but you basically dont

wild patrol
#

I just wanna do it in the simpliest way possible

wooden nexus
#

D'arby Joker:

Jacks and Queens give +10 mult when scored. Gives x2 mult instead if the hand is two pair:

(References his hand of Jacks and Queens)

sick sparrow
#

since the ability is to "see" a card's "front" when touched

wooden nexus
#

How does that have to do with D'arby?

frosty dock
wooden nexus
long sun
# long sun okay, i've settled on this :D

i'm giving this the boilerplate ability type in my pack, which is creating consumables:
(Uncommon): When Blind is selected, creates a Planet card or a copy of Strength (Must have room)

wooden nexus
#

But a casual Jojo fan would not even know that

#

because they see everything on Youtube

#

and what do they see on Youtube? Engrish and the two pair

sick sparrow
#

but here the thing

X4 Mult next hand
if the first drawn card
contains your hand's rank
```how to "predict" the rank of card?
#

what's context for before drawing the card?

wild patrol
frosty dock
#

no, the list of your cards is handled by the ObjectType

sick sparrow
wild patrol
#

oh do I put my list of cards in the SMODS.ObjectType?

frosty dock
#
pools = { yugioh = true }, 
#

into the definition of each yugioh card

#

and in create_card you do set = 'yugioh'

tight thistle
#

is it possible to force the game to play a certain hand type without any cards?

wild patrol
sick sparrow
upper fern
#

this is completely random but i just realized it is possible to put a #variable# in the name field of a joker LeSanae

frosty dock
#

I don't think such a context exists, you'd have to make your own

#

there's only first_hand_drawn (which is after drawing the first hand of the blind)

wild patrol
#

@frosty dock lovely gave me a crash with attempt to call set_card_area with a nil value?

wild patrol
#

Oops! The game crashed:
cardarea.lua:57: attempt to call method 'set_card_area' (a nil value)

frosty dock
#

where is it being called and can I at least have the full crash?

wild patrol
#

I don't even have that mentioned in my .lua?

upper fern
#

post the full crash log

frosty dock
#

just show me your code

wild patrol
#

just a warning it's very shit

#

i'm not very organzied

#

i'm literally a duck tape and glue type of guy

frosty dock
#

🦆 tape lmao

#

I don't see a create_card function here?

wild patrol
#

all that I care about is if it works lmao

frosty dock
#

oh you just put it in the file lmao

wild patrol
#

I did lol

frosty dock
#

it's supposed to be in the fucking booster

wild patrol
#

lmfao

upper fern
#

create_card is a vanilla thing

frosty dock
#

and you don't have an ObjectType yet

hardy viper
#

i love naming things the exact same as other things without clarification

frosty dock
#

just adding ```lua
SMODS.ObjectType { key = 'TCG_Yugioh' }

 should do
wintry solar
merry raven
#

Is there a context that detects the start of a new blind?