#💻・modding-dev

1 messages · Page 174 of 1

gaunt thistle
#

uh yeah I should've scrolled up a little bit

#

god speed o7

wind turtle
#

this joker is Silly

#

game HARD froze

cerulean rose
#

not that i'm aware of

#

i don't use extra and i haven't experienced any issues with it

stray warren
#

What version of Lua is Balatro running? Is table.move() not available?

rough furnace
#

5.1

#

(luajit)

stray warren
#

great, just below the cutoff

rough furnace
#

it might be

stray warren
#

When I try to use it, it just says "attempt to call field 'move' (a nil value)"

clever bear
cerulean rose
rough furnace
vital scarab
#

ive never coded anything in balatro before, how would i even start to implement custom jokers into the game

rough furnace
vital scarab
#

thanks

stray warren
cerulean rose
#

anyone know why this isn't working?

SMODS.ObjectType({
    key = "clubs_pack",
    default = "j_gluttenous_joker",
})
local clubs_pool = { pools = { clubs_pack = true } }
SMODS.Joker:take_ownership("gluttenous_joker", clubs_pool, true)
SMODS.Joker:take_ownership("blackboard", clubs_pool, true)
SMODS.Joker:take_ownership("onyx_agate", clubs_pool, true)
SMODS.Joker:take_ownership("seeing_double", clubs_pool, true)
SMODS.Consumable:take_ownership("moon", clubs_pool, true)
if next(SMODS.find_mod("YART")) then
    SMODS.Consumable:take_ownership("yart_rmoon", clubs_pool, true)
end
marble flint
cerulean rose
#

also i tried with the prefixes and that didn't work either

marble flint
#

dunno then :/

manic rune
#

i suppose you cant use loops to make jokers/consumables faster lol

#

a bit of a shame

whole hawk
#

could someone mod the game so that chicot reverses boss blinds instead? start with 0 discards > double your discards, all club cards are debuffed > all club cards give x1.5mult when scored

#

genuinely the worst joker in the game

manic rune
#

you could, though that needs a lot of patching

manic rune
whole hawk
# manic rune why so?

because i'm malding over the fact that my last 5 soul cards have been chicot and have tanked my runs

manic rune
#

and most of the time its not even that bad either

#

not having to deal with debuffs is quite convenient, i had my run ruined because of "All face cards are debuffed" so many times lol

rough furnace
manic rune
#

wait actually?

limpid wing
#

Hi, anyone know where find the example mods inside of steamodded?

#

i cant find them now

#

and i dont have a older version

manic rune
rough furnace
manic rune
#

i dont actually know what im doing wrong there 💀

#

i manually put consumables with that exact same format, and it worked every time

#

thats a manually put consumable of mine

rough furnace
#

I'm assuming one of your values for the extra is nil

#

(likely wrong key)

manic rune
#

its "extra" which seems to be nil, kinda weird

rough furnace
#

your the one setting extra

manic rune
#

hmm

#

shouldnt this be correct?

#

.

#

wait nevermind

#

theres a typo

#

😭

#

bruh i hate myself

manic rune
#

musketeer and muskeeter, my banes of existence 💔

manic rune
#

thanks for telling me tho, this will genuinely save so much of my time 😭

runic pecan
#

Do we have to play_sound('multhit2') before calc returns, or would the game/smods handle that part?

plush cove
#

They also take care of showing the messages, so you don't need to include localizing stuff (unless you want a special message)

runic pecan
#

Chat, is this stable?

normal crest
#

Idk what I'm looking at, but you can simplify all those not equal checks by removing them

solar eagle
#

is there an smods way to execute an action when you buy/select a specific joker from a pack? or would i have to lovely patch that

runic pecan
normal crest
#

Answer is not really

marble flint
normal crest
#

Solutions included a hook to add_to_deck or cardarea:emplace

solar eagle
#

thats what i figured

#

add_to_deck is prob easiest

#

ty!

normal crest
#

Unfortunately

marble flint
#

it'd be god-awful form to do so, but you can change how a Lua object behaves on member access (a.b or a[b]) or member assignment (a.b = c or a[b] = c) by making it call an arbitrary function

solar eagle
#

where's it defined? dont see it in misc_functions, common_events, state_events, card.lua, or game.lua

#

maybe i missed it

normal crest
#

I was referring to every ~= check in the screenshots you sent

#

In the for loops

solar eagle
#

i may be stupid

#

i should probably go to bed soon

normal crest
runic pecan
normal crest
#

I see, then don't mind me

fallen vigil
#

how would i make this apply only to the cards held in hand

runic pecan
fallen vigil
solar eagle
wintry solar
runic pecan
wintry solar
rose dragon
#

balatro/lua plugin for jetbrains?

plush cove
plush cove
#

also I love to see another jetbrains user!!

#

rider my beloved ✨

rose dragon
plush cove
#

holy hell

#

which one are you gonna be using for balatro?

rose dragon
plush cove
#

makes sense

#

I just use Rider because its what I have and the plugins are compatible with it anyway

tall wharf
#

why do you guys not just use vs code

rose dragon
tall wharf
#

i may be stupid here but i don't see how using an IDE intended for other languages could be better than just a normal sybtax-highlighting-enabled text editor

plush cove
manic rune
#

whats jetbrain

plain wyvern
rose dragon
tall wharf
#

i only use intellij idea

plush cove
tall wharf
rose dragon
plush cove
plush cove
tall wharf
#

in any case

rough furnace
rose dragon
tall wharf
rose dragon
plush cove
tall wharf
#

oops didn't mean to reply

tall wharf
edgy reef
#

All this talk of IDEs and what would be overkill when you can get the same package with a terminal text editor.

plush cove
edgy reef
#

Sad there’s no vim or nvim users here

plain wyvern
#

i am an occasional nvim user

tall wharf
#

fr tho just use whatever you want I'm just half trolling

rose dragon
tall wharf
#

still i actually do think it's a bit overkill to use jetbrains stuff for lua

#

you can't really compile directly you had to just open the game to test

plush cove
tall wharf
#

like for what

plush cove
tall wharf
#

ah

#

yeah you do

#

i was thinking about modding video games in general

plush cove
#

balatro is the only game that I really actively mod

tall wharf
#

i was modding a different game

primal robin
#

JetBrains stuff is not free, while VSCode is open-source and free. trash

#

Also who says that Java better than JavaScript

primal robin
#

Sometimes bad companies can also make good products, imagine

random sleet
#

microsoft detected opinion deleted

#

(i use vscode)

rose dragon
tall wharf
#

it's the same thing but only the MIT part

primal robin
#

Only moment where IDE speed matters is when you're using the most casual 30GB node_modules folder. That's it

#

In other cases speed doesn't matter

tall wharf
#

it shouldn't

rough furnace
primal robin
#

nano

random sleet
#

real men use real men

rough furnace
modern kindle
#

Real men.

tall wharf
#

real men uses git in terminal

#

🏳️‍⚧️

rose dragon
paper zealot
#

magnetized needle and a steady hand etc

random sleet
#

chat rate my art tamariPlush

rose dragon
random sleet
#

(brutally and with no remorse)

modern kindle
plain wyvern
rough furnace
#

Looks better than my "art" so it's probably good

tall wharf
#

you self

random sleet
rose dragon
plush cove
modern kindle
#

I can draw a pretty mean square myself
But that's about it

rose dragon
rough furnace
#

I for some reason can make hats for Celeste and that's about the limit of my art

random sleet
#

hell yeah

modern kindle
plush cove
random sleet
#

lmao good luck

tall wharf
#

mmmm

#

i can draw

#

maybe

#

i am a com sci student after all

random sleet
#

i cant draw

#

:3

rough furnace
#

I can draw just not well

plush cove
#

my expertise is coding

#

such a shame, i'm not good at that either

random sleet
#

needs the y to be like flickering at the end

modern kindle
rough furnace
#

I just have dev art

plush cove
modern kindle
rose dragon
#

instead of drawing i just rip some of the stuff off of the balatro and r/okbuddyjimbo subreddit and add their joker ideas to the game

rough furnace
#

(I also made the art for the steamodded example deck skin)

plush cove
rough furnace
#

All the ones that look good I didn't do

rose dragon
# rough furnace

you can use the text tool instead of sketch it on use the paintbrush /j

rough furnace
#

Yeah but where's the fun in that

random sleet
#

old pic:

#

but like i have a lot placeholders too

plush cove
rough furnace
#

You should use the example deck skin its great

rose dragon
random sleet
#

no

rough furnace
#

Lovely mentioned??????

mental dove
#

How do I edit the original joker sprites? (I want to change The Idol into that hatsune miku from a mod)

rough furnace
tall wharf
#

with the power of ADHD I can do anything

modern kindle
#

Oh yea I should ask again since I have the all knowing you here

How do I check for if a glass card shatters again? I need to check for if a glass king or queen shatters

modern kindle
#

That's quite the record egg

tall wharf
#

i changed the idol to ai hoshino

plain wyvern
#

i usually draw my own jokers :3

tall wharf
plush cove
#

randomly had this idea for a joker and realized it might be hell to develop

rough furnace
#

I believe G.GAME.hands has a reference to the example hands

random sleet
#

does cause issue with spectrum framework's spectrum hands since they use a dummy "wild suit"

frosty dock
#

not like the example can't be replaced by mods using it (six suits does this)

random sleet
#

pog

#

that means i should make my spectrum hands do that when i see six suits

#

or maybe i can just check if there is a different fifth suit? idk complicated x x

plush cove
placid compass
#

anyone can help me create a deck? Ehe, i'm so dumb xD

past forge
plain wyvern
#

exactly the same hand

#

(i think)

rose dragon
# placid compass anyone can help me create a deck? Ehe, i'm so dumb xD

create an atlas of back textures for the deck, which is a grid of back textures, each back should be 71x95 pixels
add/modify this code to your main lua file

SMODS.Atlas({
    key = "decks",
    px = 71,
    py = 95,
    path = "decks.png" -- the name of the deck file, i will be using decks.png for mine
})

then, add this basic code after that to register the deck into the game, everything which i comment edit at the end you should edit

SMODS.Back({
    key = "DECK_KEY", -- EDIT
    loc_txt = {name = "DECK NAME", text = {'Deck Subtext', 'Respond if you need help with text markdown'}}, -- EDIT
    atlas = 'decks', pos = { x = 0, y = 0 }, -- make sure that you're using the same atlas key and adjust the x and y correctly
    config = { extra = { } }, -- some configurations for scaling and etc.
    calculate = function(_self, _back, _context) -- remove the underscores if you are using the variable
        -- MODIFY THIS FUNCTION HEAVILY; https://github.com/Steamodded/smods/wiki/calculate_functions
    end
})

that should be about it for the basics

runic pecan
#

Is the localization default always en-us.lua when my mod doesn't have default.lua? Or do I have to specify that?

frosty dock
runic pecan
#

Is this change safe?

manic rune
#

quick question

#

how do i make it so each row only shows 4 consumables?

modern kindle
runic pecan
fallen pelican
#

tho I don't think a debt collector makes it easy for u if ur in debt...

modern kindle
#

it has a big mult for the fact you cant ever have any cash...stuck in the poverty mines...

runic pecan
modern kindle
#

yea at some point ill polish up ui viewing
its nowhere near release ready rn

molten ice
past forge
#

its 8 by default i mean

runic pecan
molten ice
#

i don't think that's supported by smods as of currently, it's basically just automate the page separation and stuff, as the collection page orders are always fluids

#

other mods can technically adding to your consumable as well and cause things to shift around, so there's not really a good way to determine proper order if there's a dynamic amount per page I think

#

you could probably build a completely custom collection page though and hook the call using it

plush cove
# fallen pelican x8 is crazyy

I'm under the impression that recreating the example would take a lot of meticulous effort and/or luck, so I feel like it should have a big reward

placid compass
#
functions/common_events.lua:2169: bad argument #1 to 'ipairs' (table expected, got nil)
Stack Traceback
===============
(1) Lua local 'handler' at file 'main.lua:612'
        Local variables:
         msg = string: "functions/common_events.lua:2169: bad argument #1 to 'ipairs' (table expected, got nil)"
         (*temporary) = Lua function '?' (defined at line 31 of chunk [SMODS _ "src/logging.lua"])
         (*temporary) = string: "Oops! The game crashed\

anyway to fix this?

plush cove
runic pecan
past forge
#

hello people

#

somebody knows how to referece the total money that the player has?

#

it it G.GAME.dollars ?

maiden phoenix
rose dragon
past forge
# rose dragon yea

Im trying it to take all of your money when you leave the shop but the game crashes

vocal verge
#

Wouldn't it be better to just ease it to 0?

past forge
#

ill try to check the ox code

past forge
frosty dock
vocal verge
#

ah fair

frosty dock
#

either way you don't need a config value if what you're doing just depends on the current money

past forge
#

I could do a local, thats true

frosty dock
#

at best maybe a config value for the relative amount of money to take (the 10%)

past forge
#

yay!

#

ive done the money part

wintry solar
#

You can also just return dollars = -G.GAME.dollars

tepid crow
#

is that instant?

#

quickly scanning the code seems to imply it isnt

past forge
#

Now the joker works perfectly, but the text doesnt updates when the multiplier goes up

SMODS.Joker {
    key = 'tithe',
    loc_txt = {
        name = 'Tithe',
        text = {
            "At the end of the shop it takes away {C:money} 10% {} of your", 
            "money (min {C:money} $1{}) and adds to its {C:mult} +mult {} the quantity taken",
            "(Currently {C:mult} +#1# mult {})"
        }
    },
    config = { extra = { mult = 0 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { 0 } }
    end,
    rarity = 3,
    atlas = 'ModdedVanilla',
    pos = { x = 1, y = 0 },
    cost = 2,
    calculate = function(self, card, context)

        if context.ending_shop then
            local taken_dollars = G.GAME.dollars * 0.1

            if taken_dollars < 1 then
                taken_dollars = 1
            end

            card.ability.extra.mult = card.ability.extra.mult + taken_dollars
            
            return {
                    ease_dollars(-taken_dollars, true),
                    print(card.ability.extra.mult),
                    message = 'Collected!',
                    colour = G.C.MONEY,
                    card = card
                }    
        end

        if context.joker_main and not context.repetition then
            return {
                mult_mod = card.ability.extra.mult,
                message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
            }
        end
    end
}
#

The "(Currently {C:mult} +#1# mult {})" seems to be good, i dont know where the error is

wintry solar
#

Does it need to be instant?

tepid crow
runic pecan
#
functions/common_events.lua:2250: attempt to concatenate local '_type' (a nil value)

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1410a-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0
Platform: Windows
Steamodded Mods:
    1: Talisman by MathIsFun_, Mathguy24, jenwalter666, cg-223 [ID: Talisman, Version: 2.0.3~dev, Uses Lovely]
        Break Infinity: bignumber
    2: Multi Text Box by Riv_Falcon [ID: MultiTextBox, Version: 1.0.0.25w07a, Uses Lovely]
    3: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.2.0, Uses Lovely]
    4: holotro by Riv_Falcon, and potentially others [ID: Holotro, Version: 0-alpha_25w07b, Uses Lovely]
Lovely Mods:

Stack Traceback
===============
(3) Lua global 'get_current_pool' at file 'functions/common_events.lua:2250'
Local variables:
 _type = nil
...```
#

Oh, nvm.

fallen vigil
#

how do i get the level of the played hand as a number

wintry solar
runic pecan
past forge
runic pecan
fallen vigil
#

for the played hand not for a given hand?

#

also i have 0 hope of this being compatible with any other mod lmao my code as organized as macaroni art 😭

runic pecan
fallen vigil
#

im confused

runic pecan
placid compass
#

how to make a joker spawn for the first shop of the game?

fallen vigil
runic pecan
runic pecan
runic pecan
fallen vigil
#

thank you wise one

past forge
#

im not sure why my game crashes

olive moth
#

yo, hi everyone

#

i, as a very mentally stable person with 0 knowledge of modding or löve (or lua at all) decided today that i wanna pick up balatro modding because i had an idea.

past forge
#

wow

#

good luck then

#

that was me yesterday and im not doing bad at all

#

ive made 2 jokers so far

olive moth
#

problem is - i can't figure out where to start and what, like, programs to use for it all

#

everyone directed me to this server's modding section, and either there isn't a guide thread in the forum channel, or my attention-impaired ahh didn't see it

#

any help/tips?

past forge
#

yes, this is the best and until now ive learned a lot

glad osprey
past forge
#

Do you have any experience with programming?

glad osprey
#

what be your idea autistic frieren

past forge
#

dont cry we all are autistic here

glad osprey
#

very true

olive moth
#

i'm uhh, somewhat knowledgeable

placid compass
#

why is this strechy TwT

olive moth
#

only in godot tho, so the learning curve would kick me in the family jewels hard

glad osprey
past forge
glad osprey
#

its like json

#

kinda

past forge
olive moth
glad osprey
#
{
key = "string",
int = 1
}```
olive moth
#

gotchu

past forge
#

Another golden resource is Balatro's source code

glad osprey
#

its very easy lol

past forge
#

yeah

glad osprey
#

just item is equal to whatever value

olive moth
#

nah, i meant like i need to reeducate myself a bit, because i'm only thinking in godot terminology here (which i don't even have a 100% vocabulary of), so i need to actually understand what a table is 🥲

#

but that's minutia

glad osprey
#

ok so just forget godot

#

just forget all of it

#

tables are what lua objects are

olive moth
#

oh, starting to catch on

past forge
#

with practice we'll get it

olive moth
glad osprey
#

so if you wanted to make a joker it would be smth like

-- SMODS.<whatever object you want to define>
SMODS.Joker {
-- what the joker would be called internally (like if you were checking what a joker is)
key = "key",
-- what shows up in game
loc_text = {
--- name of the card
  name = "name",
--- description of the card
  text = {
    "description line 1",
    "description line 2"
    }
  }
}
past forge
#

Okay, im having a problem.

olive moth
past forge
#

my game keeps crashing when I leave the shop

#

I know it has to be because of this jonkler

olive moth
past forge
#

but i cant see the issue

glad osprey
past forge
#

the thing is that it was working last night 😭

olive moth
#

(based off the fact it's the only part using the word "local" here)

#

i'm guessing there's some variable in there that is supposed to be filled in, but it's left undefined

#

and it returns null and everything goes down the drain

#

(had many bugs like these)

past forge
#

ive done it

glad osprey
#

what was it

past forge
#

it was the card = card, dont know why

#

but now it works

glad osprey
#

oh

#

well

#

yea idk

olive moth
#

the machine spirit works in mysterious ways

past forge
#

true

#

no for my next creation

tepid crow
olive moth
#

also, coming back to my problem, we kinda went off topic

past forge
olive moth
#

i was asking for what software to use T . T

past forge
tepid crow
olive moth
#

i'll watch some tutorials once i get there

hardy viper
#

wtf you have to use neovim to be a pure developer /j

past forge
#

thats your choice, but choose any code editor of your preference

hardy viper
#

vscode in 2025 🤮 disgusting chat fr ong

tepid crow
past forge
hardy viper
#

why return anything when you can modify mult and add all the events yourself

past forge
#

thanks

hardy viper
#

think about the function call overhead guys cmon

glad osprey
past forge
#

im just learning ok? 😭

olive moth
#

...goddamn the development world is wider and more diverse than i thought

tepid crow
past forge
#

@olive moth another things you might want are the DebugPlus and tooManyJokers mods

hardy viper
#

not a whole lot of people making balatro mods on linux software anyways

olive moth
#

i thought there would be some visual interface kinda stuff, closer to game engines, but in these trenches we use notepad++

olive moth
#

aight, thanks for the advice chat o7

hardy viper
#

too many jokers such a good mod i love shilling

glad osprey
#

someone should make an app for making balatro mods

crisp coral
#

can we go back to oldestcalc (0.4.2)

hardy viper
olive moth
hardy viper
#

we definitely have the resources for that

past forge
random sleet
#

hee hee hoo hoo programming

crisp coral
#

i'm putting back no reply pings in my server nickname

tepid crow
olive moth
#

but i guess an app would be a bit too limiting for some mods tbh

hardy viper
#

iirc immolate is intended to have a sort of block code solution at some point that translates to cpp

olive moth
#

like that one minecraft mod maker app (iykyk) that had lots of tools to create items and entities and all kinds of stuff, but no real way to add something groundbreaking like whole new game systems/mechanics

tepid crow
hardy viper
random sleet
#

a game maker style drag and drop interface for creating joker calculate functions

glad osprey
#

where get

hardy viper
#

we will never be able to abstract as hard as midjourney

hardy viper
#

not it being like a thing

glad osprey
#

oh

hardy viper
#

i personally don't see it happening but meh

random sleet
#

i just say things dont listen to me or take me seriously or believe anything i say ever

olive moth
#

also, while we're on the topic of minecraft and its mods, is there any chance to have mod interactions/compatibility?

bleak bone
#

oh no

random sleet
#

you can have mod interactions and compatibility

olive moth
#

lessgoooooo

random sleet
#

95% of the reason for lovely's existence is compatibility

hardy viper
#

you can communicate with other mods by changing registry values if you want

#

i think you can do that in usermode windows right

random sleet
#

you can also use lovely to patch other mods if people aren't doing something you need them to do

bleak bone
olive moth
#

the whole stake sticker buff idea is good, but it gets way way way better if you add, for example, cryptid's wagonload of stakes

random sleet
hardy viper
#

ill double check tho

bleak bone
#

I want a stake that doesn't apply the other stakes and simply forces discards to become Hands instead

#

oops all hands

olive moth
#

...also i probably need to update my game, i think there's been some updates since like 5 months ago when i installed it

#

(i had too many mods crash the game even in solo)

#

anyway, thanks again for the support!!

#

cya around

#

❤️

past forge
#

Good luck

#

any doubt you can ask it here

olive moth
#

u2

obtuse silo
obtuse silo
broken cliff
#

all other declarations start with smods.typename {
codehere
}

cerulean rose
#

its still a function call either way

hardy viper
#

func{
}
is sugar for
func({

})

broken cliff
#

smods lua is different from normal Lua tho

hardy viper
#

you can do the same thing with like, print"hello"

cerulean rose
#

yeah also my modded jokers add to the pool just fine

broken cliff
hardy viper
#

smods lua isn't a thing

#

unless you're talking about luajit

broken cliff
#

prob that

wintry solar
#

no this guy just doesn't know hwat he's talking about 🙃

#

maybe you can use SMODS.insert_pool?

hardy viper
#

regardless both syntaxes worth in both luajit and normal lua 5.1

#

idk about 5.4

bold sleet
#

Hello, good peploe of balatro. Today I come with a maybe not that simple question: How do pools (for jokers, for example) work? How do I set them up? How do I add jokers to them etc etc (idk) (ok, more than one question)

ionic timber
#

what's the best context to calculate a scaling x_mult similarly to Steel Joker ? (for every steel card grant x0.2) I wish to do it for every joker with negative, but can't really find an easy context to update the value

wintry solar
tepid crow
bold sleet
tepid crow
dire palm
#

Is there a way to make my joker change Glass Cards probability to get destroyed, without modifying any other probability?

tepid crow
past forge
#

I dont get this to work, the face cards are destroyed, but the mult doesnt add

#

the print for "That was a face card" never shows up so the error must be in that for loop

cerulean rose
#

you arent giving xmult anywhere

past forge
#

I know im not doing the joker main, but the mult is not scaling

wintry solar
#

this entire logic makes no sense at all

bold sleet
#

yes?

bold sleet
glad osprey
bold sleet
#

7th beat cards and fool's gambit mod development.

plain wyvern
#

-# hi jogla wavey

ionic timber
bold sleet
wintry solar
hardy viper
ionic timber
#

because I kinda want to see the current mult everytime (I'm displaying it in loc var)

wintry solar
#

you count them in locvars too

tepid crow
#

might be nice to have an example steel joker or whatever in the ModdedVanilla example

astral forge
#

Hey new here but I was wondering is it possible to make enhancements like Lucky Card and such appear over a card as if they were a seal instead of replacing the card backing?

ionic timber
olive moth
#

following a tutorial and trying to start my mod off, and i have a question

wintry solar
#

the vanilla files aren't the best to look at for counting effects, thunk does them in a stupid way

#

this is an example of a counting effect joker

olive moth
#

can the mod_id have underscores in it, or is it better to just leave it on full caps with no breaks?

wintry solar
#

underscores are fine

olive moth
#

lesgooo

#

ty

safe token
#

sorry i think, i chat at wrong channel

pulsar flower
#

@wintry solar hope you don't mind the ping, the new select_card functionality seems to not let you use consumables while a pack with selectable cards is open

wintry solar
#

oh I'll look at that, I'm actually just fixing a few things with it rn

pulsar flower
#

cool

#

also

#

is there any chance this could be implemented per-card? i have a consumable type wih a hidden spectral card i wouldn't want to allow to be pulled to the consumable area due to perkeo shenanigans

wintry solar
#

I'm fixing how the per set works, would that cover your use case?

pulsar flower
#

since the hidden is a spectral, i think so?

fallen vigil
#

how can i test the suit of each card in context.repetition

pulsar flower
#

Card:is_suit() unless there's a smods function for it

runic pecan
fallen vigil
#

thank you wise eldritch god of the machines

long sun
#

hi, why is context.other_card nil in the last line?

if context.individual and context.cardarea == G.play then
      context.other_card:set_ability(G.P_CENTERS.m_steel, nil, true)
      G.E_MANAGER:add_event(Event({
        func = function()
          context.other_card:juice_up()```
wintry solar
#

it's in an event and has been cleared by then

long sun
#

ah, i see -w-

#

thanks :D

wintry solar
#

you can save it locally if you need the event

long sun
#

yup, fixed it ^^

wintry solar
pulsar flower
olive moth
#

by jove it's working

#

it's literally that easy to add new content here?

vocal verge
#

once you know how to lua and what the functions are, yeah

olive moth
#

looks like i found a new hobby

wintry solar
pulsar flower
#

sickkkk

maiden river
#

is there a game state for being in the round?

rough furnace
#

like G.STAGE == G.STAGES.RUN

maiden river
#

that should work, I think

gaunt thistle
#

is there a game state for being round jimball_roll

hardy viper
#

thunk after having both G.STATE and G.STAGE

rough furnace
hardy viper
#

almost all states have multiple stages if you think about it

#

wait

maiden river
#

😭 this is confusing

glad osprey
#

how sticker for consumables

maiden river
#

is there a way to make something happen when you hit the select button

hardy viper
#

that's wrong

#

hang on why'd i say that

#

am i stupid?

maiden river
#

no

#

the system was designed to confuse you

#

it's sabotage trust

rough furnace
#

oh waitthats backwards

tepid crow
#

3 seconds?

rough furnace
#

oh actually all the stages have multiple states

glad osprey
past forge
#

I dont really know why the mult on this card doesnt go up

#

I need it to work somewhat like canio, where if you destroy face cards (on any way) it would make mult

hardy viper
red osprey
past forge
#

okay

glad osprey
past forge
#

but i think im checking it wrong, what does the ipairs work for?

#

i took the code from the canio but it seems to be checking the not-played cards

glad osprey
hardy viper
glad osprey
past forge
#

Consumemable is fire

hardy viper
#

i think it's all caps tarot too i might be wrong

glad osprey
#

so TAROT?

hardy viper
#

okay nvm wiki is probably right

glad osprey
#

is there a list of sets somewhere

#

bcus thats what i need to define

hardy viper
hardy viper
violet void
#

what a typo can do

glad osprey
#

im losing my mind

hardy viper
#

hm

hardy viper
#

why must stickers be so weird

violet void
glad osprey
#

rerolling shop

#

alot

violet void
#

Try applying it with debug plus

glad osprey
#

how

violet void
#

Hold tab to see the keybind to apply stickers

#

(I don't remember)

glad osprey
#

those are only for eternal rental and perishable

red osprey
violet void
#

Sad

red osprey
#

Add v.is_face and before that

past forge
#

and or or?

violet void
#

For the sticker to appear

glad osprey
#

no but it should default to 0.3

violet void
#

Set it to max just too see if it works at all ig

red osprey
#

It checks if "is_face" exists on v before running it

#

I don't really know why is_face wouldn't exist in this instance

#

Wait

glad osprey
#

I AM AN IDIOT

red osprey
#

Okay so your code doesn't make sense according to the documentation

past forge
#

i think i know why wait

glad osprey
#

nevermind?????

past forge
#

okay done know it works with pareidolia

#

But still dont add xmult

red osprey
#
  • context.destroy_card is a boolean and is used to mark the state where you can return { remove = true } to destroy scoring cards. This should go with your first if
  • If you want it to trigger when cards are removed, you need to check context.remove_playing_cards, although that apparently also triggers on discard for some reason, so I'd test that
    • You can filter that out by also checking context.scoring_hand
  • The list of cards in that instance is context.removed
glad osprey
#

god dam im stupid

#

needs_enable_flag is true by default

red osprey
#

Extracted code from the main game for Caino:

if not context.blueprint then
  if context.cards_destroyed then
    local faces = 0
    for k, v in ipairs(context.glass_shattered) do
        if v:is_face() then
            faces = faces + 1
        end
    end
    if faces > 0 then
      G.E_MANAGER:add_event(Event({
        func = function()
          G.E_MANAGER:add_event(Event({
            func = function()
                self.ability.caino_xmult = self.ability.caino_xmult + faces*self.ability.extra
              return true
            end
          }))
          card_eval_status_text(self, 'extra', nil, nil, nil, {message = localize{type = 'variable', key = 'a_xmult', vars = {self.ability.caino_xmult + faces*self.ability.extra}}})
          return true
        end
      }))
     end
  end
  if context.remove_playing_cards then
    local face_cards = 0
    for k, val in ipairs(context.removed) do
        if val:is_face() then face_cards = face_cards + 1 end
    end
    if face_cards > 0 then
        self.ability.caino_xmult = self.ability.caino_xmult + face_cards*self.ability.extra
        G.E_MANAGER:add_event(Event({
          func = function() card_eval_status_text(self, 'extra', nil, nil, nil, {message = localize{type = 'variable', key = 'a_xmult', vars = {self.ability.caino_xmult}}}); return true end
        }))
        return nil, true
    end
  end
end
glad osprey
#

i hate myself

olive moth
#

cursed (/pos)

glad osprey
#

ok now how do i destroy card

#

isnt it like

#

card:destroy

#

or smth

red osprey
#

:start_dissolve() to do the animation

#

(I'd like a second opinion on this as I've had side effects using this)

past forge
#

for me the remove = true works

sullen fern
red osprey
red osprey
sullen fern
#

it works but it gives perishable to all jokers instead of only one

glad osprey
#

ok boosted is done now how do i change reroll cost correctly

olive moth
glad osprey
#

lmao

olive moth
#

i'm just trying to make the easiest +chips card, christ on a skate😭

#

if i had a penny for each crash i'd be able to hire an AAA Studio's worth of programmers to do this

sullen fern
#

how do i make perishable apply to only one joker and have the message actually appear on the targeted joker

olive moth
sullen fern
#

it doesn't apply perishable to EVERY joker, but that's still not a single joker

#

also ronald is applying perishable to itself

#

which i don't want

red osprey
#

Replace ~= self with ~= card for that

wintry solar
red osprey
#

In calculate, card is the actual joker, self is the code (more or less)

red osprey
wintry solar
#

Well it’s more that you need to make sure you do everything that’s required when removing a playing card and the majority of people have no idea how to do that

#

I should make a util function to do it probably

sullen fern
#

ronald no longer applies perishable on himself but he still applies perishable on too many cards

faint yacht
#

Add and not context.repetition and not context.individual.

wintry solar
red osprey
wintry solar
sullen fern
#

wait who are we talking about here

glad osprey
#

how do i make config

maiden river
#

a real read-the-docs moment

wintry solar
#

I’m not sure it will

#

But it’s worth a quick test

#

Otherwise I will add some on_select support or something

sullen fern
maiden river
olive moth
maiden phoenix
olive moth
#

i'm clearly confused about how to do the whole calculation code

wintry solar
#

I think

#

Though looking at it it looks like it’s in the wrong place 🤔

maiden phoenix
#

Alright, is that the same reason why it replaces context.area check?

#

Oh

maiden river
marble flint
#

Does anyone know why this isn't retriggered correctly (e.g. with Hanging Chad)?

wintry solar
normal crest
#

what's the 2nd value for

maiden phoenix
marble flint
#

That also didn't work (neither within the if nor without)

normal crest
#

And then returns nil, true

marble flint
#
  1. ease_hands_played already puts it in an event, doing it twice would put it in the wrong spot in the queue
  2. returning nil, true didn't do anything (the second return value isn't even used)
wintry solar
marble flint
wintry solar
#

Oh wait hang on

#

That will definitely repeat when repetitions exist

marble flint
wintry solar
#

What’s the whole code look like? It looks like you remove any of the scoring stuff

marble flint
#
SMODS.Enhancement {
    key = "TimeWalk",
    atlas = 'BakeryEnhancements',
    pos = {
        x = 0,
        y = 0
    },
    replace_base_card = true,
    no_rank = true,
    no_suit = true,
    always_scores = true,
    weight = 0.1,
    calculate = function(self, card, context)
        if context.cardarea == G.play and context.main_scoring then
            if not (Talisman and Talisman.config_file and Talisman.config_file.disable_anims) then
                G.E_MANAGER:add_event(Event {
                    trigger = 'before',
                    delay = 1 * G.SETTINGS.GAMESPEED,
                    func = function()
                        play_sound("Bakery_TimeWalk", 0.8 + math.random() * 0.2, 1)
                        return true
                    end
                })
                G.E_MANAGER:add_event(Event {
                    trigger = 'immediate',
                    func = function()
                        card:juice_up(0.6, 0.1)
                        return true
                    end
                })
            end -- Entirely visual
            ease_hands_played(1)
            delay(0.85)
        end
    end
}
normal crest
#

i'm pretty sure an event's delay already takes into account the game speed

marble flint
#

yeah I'm undoing that to match the timing of the sound

wintry solar
#

Oh do return { effect = true }

sullen fern
#

how would i make ronald stop turning multiple jokers perishable and do only one (and have the message appear over the joker that got perishable'd)

wintry solar
normal crest
marble flint
wintry solar
#

The other one is for joker retriggers without a return table fyi

marble flint
#

why are neither of those documented

wintry solar
#

Because writing docs isn’t fun

sullen fern
#

okay, there we go

#

i want the message to appear below the affected card and not ronald

#

so when a card gets afflicted with perishable the "i'm lovin' it" appears

#

i also don't want ronald to reapply perishable to an already perishable joker

wintry solar
#

message_card = whateveryourappliedrefis

sullen fern
#

actually, i want perishable to apply at the end of the shop, not the end of a round

#

because applying perishable at the end of a round makes it tick down by 1 immediatley

#

okay it applies at the end of the shop but the "i'm lovin it" message doesn't appear under the card

#

maybe it should be before the code?

#

no. that didn't work

#

why is it not showing up?

#

also ronald still applies perishable to already perishable jokers

#

which in turn resets the perishable timer

normal crest
#

you put message_card alongside message

#

tho I wasn't aware message_card exists

normal crest
graceful magnet
#

mixed together Idol code and the card creation I was figuring out yesterday.

The intent is to create a Cryptid card when a targeted Diamond card is played (I'll add the "first" check later), but right now it just targets nil

sullen fern
normal crest
#

that's not in the for loop

sullen fern
#

ohhhhhhh

#

i thought you meant THE loop

graceful magnet
#

mkay it still doesn't trigger the effect

sullen fern
normal crest
#

you just gotta apply the same concept

sullen fern
#

~= card?

#

what the hell am i even supossed to do

normal crest
#

if G.jokers.cards[i] ~= card and not G.jokers.cards[i].ability.perishable then

chrome prawn
#

hey can I really quickly get some help with this

sullen fern
#

so it works

#

now all that remains is the message

normal crest
# chrome prawn

you didn't add self as the first parameter of the function

normal crest
#

the stuff in parenthesis always evaluates to "Hearts"

sullen fern
#

it should be this but it just doesn't show

pseudo current
#

So... I want to make a mod for the game, but i don't know how to program at all, how can i learn? (or find someone willing to work toguether with) I really need the help

normal crest
#

so you should have both

sullen fern
chrome prawn
#

well how would make it so that the game counts stones as another suit

sullen fern
pseudo current
normal crest
#

the programming language you'll be using

#

to mod balatro

pseudo current
#

I see

night pagoda
#

Is it possible assign an existing planet card to a new hand type?

sullen fern
graceful magnet
graceful magnet
sullen fern
# sullen fern

i still have no idea what to make message_card because nobody told me about it in more detail

normal crest
#

message_card should be the card you want the message to appear on

sullen fern
#

so, the joker

normal crest
#

it can be any card you want, but if you want it to show up on the joker then yes

sullen fern
#

i need it to show up on the joker that became perishable\

normal crest
sullen fern
normal crest
#

you have a syntax error

sullen fern
normal crest
#

comma after your message

sullen fern
#

fuck!

graceful magnet
sullen fern
#

i might be a biiit stupid

past forge
#

how do i spawn a booster pack with debugPlus and toomanyjokers?

red flower
# graceful magnet hm?

that error is probably SMODS.add_card not finding the card, what are you trying to add?

graceful magnet
sullen fern
#

i need to make ronald blueprint compatable

red flower
sullen fern
#

but what

graceful magnet
normal crest
graceful magnet
normal crest
#

just fyi

graceful magnet
#

cuz I did make this adjustment

normal crest
#

everywhere you used base.suit == "something"

graceful magnet
normal crest
#

if you want wild cards to work with it yes

#

and I recommend you use not SMODS.has_no_suit(v) instead of checking if the effect isn't Stone Card

#

that way it won't break with modded cards with no suit

#

there's also SMODS.has_no_rank

past forge
#

somebody knows why canio is always referred in the code as caino?

normal crest
graceful magnet
past forge
#

that gave me headaches

#

couldnt find the canio code

#

and it was caino

#

now back to work

edgy reef
#

It's worse, there's both english color and british colour + consumable/consumeable

#

It's so funny

tepid crow
#

tbf I also interchangeably use color/colour

sullen fern
#

this should not be too hard

#

i just gotta do a retrigger for every bonus card in the deck

faint yacht
#

You'll have to explicitly enable your mod to allow retriggers of Jokers.

SMODS.current_mod.optional_features = function()
    return { retrigger_joker = true }
end

Then you can use this set of conditions... you'll just need to get the amount of Bonus cards in your deck. Also, full deck or what's *left* in the deck?

if context.retrigger_joker_check and not context.retrigger_joker and card == G.jokers.cards[1] then
 return { repetitions = value } -- where value is the result of the amount of Bonus cards.
end
past forge
#

do you guys know whats the grey color that is used in the "currently xmult" descriptions?

sullen fern
#

C:inactive

past forge
#

ive tried C.grey and C.joker_grey

past forge
sullen fern
normal crest
#

shouldn't you try to achieve this on your own before asking for help

graceful magnet
#

is there somewhere to find the functions to change card suit, like the Tarot cards (Sun/Star/Moon/World), cuz digging through source code isn't yielding too much

normal crest
#

if you just want the function use SMODS.change_base(card, suit, rank) you can leave suit or rank as nil if you don't want to change either

sullen fern
#

am i really that inept at coding i have to continually ask questions about things that i should know about

red flower
#

you should look up how other cards do it, steel joker does exactly what you want for example

#

(other than checking steels instead of bonus)

normal crest
sullen fern
#

looking through steel joker's code

#

i see self.ability.steel_tally

normal crest
#

steel joker counts all steel cards on update, which I don't recommend

sullen fern
#

currently. this is all i have

red flower
sullen fern
#

what, "tally"?

past forge
#

Not really sure how but it is working

#

im testing it and may do it X0.5

normal crest
graceful magnet
normal crest
#

Does it work?

sullen fern
#

self.ability.steel?

graceful magnet
normal crest
#

Ah, because you're using context.other_card

#

other_card is only for context.individual

#

and full_hand is presumably not defined either, it's context.full_hand

sullen fern
#

what am i intended to be looking at here

#

what am i meant to get from this

graceful magnet
red flower
#

not there

normal crest
sullen fern
#

i noticed for k, v in pairs(G.playing_cards) do

normal crest
red flower
#

^

sullen fern
#

LOVELY DOES THAT???

normal crest
#

the one you're looking at doesn't have the modifications steamodded does, which are useful

sullen fern
#

okay i think i might be able to get it now

#

if SMODS.has_enhancement(v, 'm_steel') then self.ability.steel_tally = self.ability.steel_tally+1 end

red flower
#

yeah

#

that's basically how you learn to mod the game, by looking at what already made cards do

sullen fern
#

i still have this though

graceful magnet
sullen fern
#

and this isn't teaching me anything about how to get the amount of lucky cards in your entire deck

graceful magnet
red flower
sullen fern
#

you did?

red flower
#

yeah, what do you think "m_steel" is?

sullen fern
#

yeah but thats in the HAND

#

i want it to be the whole deck

normal crest
red flower
sullen fern
#

oh. fuck

#

FUCK

#

now what?

#

this is probably not correct

#

well obviouly becase there's two ifs

hardy viper
#

repetitions=

past forge
#

My jonkler works perfectly, but is missing the message when any card gets destroyed

normal crest
#

"if if"

past forge
hardy viper
#

yeah you can't stutter in Lua unfortunately

graceful magnet
sullen fern
past forge
normal crest
sullen fern
graceful magnet
#

it's only doing the first card in the hand

normal crest
#

because you're returning inside the loop

graceful magnet
#

right, the classic blunder

obtuse silo
#

question: how would I make a joker check a played card's enhancement?

#

like
i'm specifically looking for played steel cards

sullen fern
#

SMODS.has_enhancement i think?

normal crest
#

for @obtuse silo ^

faint yacht
#

...is there a font for the plaque on Legendary jokers? 🦐

sullen fern
#

i've gotten somewhere and nowhere at the same time

#

i know how to check for all bonus cards in the deck but i don't know how to turn that into repeitions

past forge
spring lantern
#

hey dumb question, how should i mark a whole hand to be destroyed after scoring?

graceful magnet
normal crest
sullen fern
#

how exactly

normal crest
#

steel joker code is doing just that FYI

sullen fern
#

and do i have to change anything about my code

normal crest
#

yes you do, v is not defined there

obtuse silo
sullen fern
#

what is v intended to be

past forge
faint yacht
normal crest
past forge
spring lantern
normal crest
sullen fern
#

or do i keep it as v

past forge
spring lantern
#

i saw that in the wiki but was unsure how i should use it

#

thanks

vivid solstice
#

what platform do you use for coding, ive been using notepad which is probably not a good thing to be using, but i could be wrong

spring lantern
#

i would recommend vscode

sullen fern
#

i realize i shouild be sending the entire code for my joker

past forge
hardy viper
#

the three most common are vsc notepad++ and sometimes neovim but the more important thing is incorporating luals (which is easiest on vscode)

normal crest
#

luals meaning lua language server

hardy viper
normal crest
#

if you're able to ignore the millions of warnings due to undefined globals then yes

sullen fern
hardy viper
obtuse silo
#
    key = "millicent",
    loc_txt = {
        name = "Millicent",
        text = {
            "Played {C:attention}Steel Cards{}",
            "give {C:mult} +4 {} mult when",
            "scored"
        }
    },
    blueprint_compat = true,
    rarity = 1,
    atlas = "MintConditionCards",
    pos = {x = 0, y = 0},
    cost = 4,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calcualte = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if SMODS.has_enhancement(card, 'm_steel') == true then
                return{
                    mult = card.ability.extra.mult
                }
            end
        end
    end

} ```
this should work?
sullen fern
normal crest
#

and you're missing the config definition in your joker

sullen fern
#

as said by the comment

hardy viper
rough furnace
sullen fern
past forge
#

im really autistic

rough furnace
hardy viper
# sullen fern copied directly from steel joker code
local num = 0 --we increment this
for i, v in pairs(G.playing_cards) do --iterate through every playing card we have
 if SMODS.has_enhancement(v, "m_bonus") then --check for the enhancement 
  num = num + 1 --increment num
 end
end
--num now holds the number of bonus cards we have
--if you only want the number of bonus cards in deck (so excluding those discarded, played, in hand) replace G.playing_cards with G.deck.cards
normal crest
rough furnace
#

no this is neovim

normal crest
#

Is it possible to achieve that in vscode

rough furnace
#

but you should be able to configure luals the same in vscode

hardy viper
#

for both you have to include steamodded and balatro in your workspace

normal crest
#

Are you able to point me towards a guide to setting up the ls for that

rough furnace
#

This is what i did

#

if you don't care about it not working on others machines you can just change hte .luarc paths to the full paths

sullen fern
rough furnace
#

theres some extgension you need probably

hardy viper
sullen fern
#

so what this is doing is finding every bonus card and putting it into a var

#

which is num

normal crest
#

it is counting the amount of bonus cards in your full deck

hardy viper
#

well it doesn't put the cards in the var, it increments the var by one everytime it sees a bonus card

sullen fern
#

i see

#

should this go into the loc_vars section of my joker

#

because num is indeed a var

hardy viper
#

naw, in the calculate

#

variables can exist anywhere

#

when and where they become invalid is complicated

sullen fern
#

do i put it before the code that does the whole retrigger thing

hardy viper
#

yup

#

and for repetitions you'll put repetitions = num

sullen fern
#

full joker code now

normal crest
#

change the card == G.jokers.cards[1] to ~=

#

Tho

#

That will repeat every joker

sullen fern
#

okay

normal crest
#

If you only want to repeat the leftmost you need more

sullen fern
#

there's MORE???

normal crest
#

do you even understand your code

#

if context.retrigger_joker_check and context.other_card ~= card and context.other_card == G.jokers.cards[1] then there you go

sullen fern
obtuse silo
#

i should add i made these changes

normal crest
#

what does it look like now

#

fully

obtuse silo
#
    key = "millicent",
    loc_txt = {
        name = "Millicent",
        text = {
            "Played {C:attention}Steel Cards{}",
            "give {C:mult}+#1#{} mult when",
            "scored"
        }
    },
    config = { extra = {mult = '4'} },
    blueprint_compat = true,
    rarity = 1,
    atlas = "MintConditionCards",
    pos = {x = 0, y = 0},
    cost = 4,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calcualte = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if SMODS.has_enhancement(card, 'm_steel') then
                return{
                    mult = card.ability.extra.mult
                }
            end
        end
    end

}```
this
normal crest
#

ah you need to use context.other_card in has_enhancement

#

card is your joker, your joker is never going to be steel

obtuse silo
#

i see

normal crest
#

An mult shouldn't be a string in your config

sullen fern
#

+nil ❤️

normal crest
#

it should be a number

obtuse silo
sullen fern
past forge
#

okay one doubt

#

how do you put the mod name under the joker quality?

normal crest
#

that gets put there by default?

normal crest
#

I didn't know about specifying libraries

#

this is all I put

sullen fern
obtuse silo
obtuse silo
normal crest
#

because you put othercard

normal crest
obtuse silo
#

i sincerely apologise for my density