#💻・modding-dev

1 messages · Page 167 of 1

livid tapir
#

ok

#

whats kind though?

sullen fern
#

how do i set the mult and chips of a seal and how to i refer to them in the description

maiden river
livid tapir
#

ohhh thats cool

#

thx raevyn

maiden river
#

no problem

maiden river
#

and then referring to them in the description would be the same way you would in a joker

sullen fern
#

how do i make a card with the specific seal self destruct after scoring is complete (like a glass card)

#

that's the main point of the self destruct seal after all

smoky talon
#

the code i made for a tag isnt working

#

i copied the cryptid schematic code and altered it for my joker

#

not showing up though

#

game works, just my tag doesnt exist

hollow charm
#

hey i'm trying to use EnhanceAPI and just loading it in crashes whenever i play a card
this is what my mods folder looks like

livid tapir
#

i wanna make my booster pack appear in shop so that i can test it

weak gate
#

made a minimal sticker that does nothing, but where does the Error come from... ULTRAthink

hollow charm
#

(i also tried it on the latest version of smods and it doesn't work either)

smoky talon
smoky talon
#

maybe without the text part

#

idk thats what worked for me

#

looks like it should work but i guess not

edgy reef
#

Add label = bonus2

#

name and text refer to the tooltip, label is the badge text.

livid tapir
#

plus*

weak gate
smoky talon
sullen fern
#

lol

#

the plight of a newbie balatro modder

weak gate
smoky talon
#

correct

#

not in collection, not in gameplay

weak gate
#

Hmm, can you send the whole file it's in?

smoky talon
#

like just send a copy of the lua file?

#

ok

#

its a bit messy lol but it works so idc

tepid crow
smoky talon
#

lol ok i wanted to use smods tag but couldnt figure out what to put in it

#

the wiki is confusing for someone not super used to coding

#

so what do i do?

tepid crow
tepid crow
weak gate
#

Finding out which mod to emulate to find good examples is non-trivial... seems like it'd be a worthy goal to

  1. ensure the wiki has one example for each kind of game object, or 2) get e.g. Eremel's permission to link to their tag code in the wiki, someone else's code for a sticker, etc
tepid crow
weak gate
#

aye, I'm referring to that part, which has many helpful examples for some things

tepid crow
#

yea

smoky talon
#

clearly i screwed something up

#

its hard to know what is needed and wht needs to change

weak gate
#

there seems to be one too many "end"

smoky talon
#

k ill delete one

livid tapir
tepid crow
smoky talon
#

game launches but the happens when using debug to spawn it

#

the atlas part is unchanged aside from just changing their atlas name to mine

#

unless

#

nvm i misspelled my atlas

#

lemme try now

#

now it spawns but gives me this after reaching the next shop

#

also how do i give it a name and description?

livid tapir
#

ill download a new version soon

#

im in bopl rn

mystic river
high stag
#

so the intent is for this to, at the end of thre round, give 2 dollars per Joker on that list on line 279 currently owned. Right now it's instead giving 10 dollars when all 5 are owned.

I don't get why since it should be looping from 277 to 283 once for each joker, (in the current test 5 times total), increasing by 2 each time, and then going on to give the dollar value once, for a total of 10 dollars.

untold pilot
#

is there like a table of events i could use as reference for when i want to put them into code?

#

such as gaining chips/mult or resetting

livid tapir
#

hm i may have somehow allowed jokers guys

high stag
#

hey, want a +4 mult?

livid tapir
#

and i gotta make the uno cards pullable not usable

#

but howwww do i make the pack not use a consumable

#

PLUHHH

scarlet spire
#

extremely new to modding- am I missing something? why does this always say nil?

random sleet
#

are you giving a loc_vars function for the (enhancement?)

#

(also vvv cool art i like wood card)

scarlet spire
#

thank you, I spent ages trying to get it to look right

random sleet
#

if theres a wooden joker you gotta make it look like its carved into the wood

scarlet spire
naive notch
#

wrong channel lol

paper zealot
#

What's the preferred way to throw an error for logging in Lovely?

random sleet
#

the two pound signs denote a variable; the number between is the index

scarlet spire
#

ahh I see

random sleet
#

i.e. loc_vars needs to have something to the effect of

return { vars = { 1, 2, 3... } }```
scarlet spire
#

nice, okay now I just need to figure out how to calculate this

hardy viper
#

love2d implements an error handler which lovely sees (balatro overrides that error handler but it works mostly the same) (steamodded overrides that error handler but it works mostly the same with a much greater amount of info)

rough furnace
rough furnace
#

and print

paper zealot
#

sendErrorMessage(message, logger) is what I'm after, thanks

hardy viper
#

interesting

#

why so

rough furnace
#

also as a shill note, DebugPlus lets you see logs in game

#

pretty handy

paper zealot
rough furnace
#

ah

hardy viper
#

crashing is usually good for that kinda thing because of the stack traceback

#

but i get it

rough furnace
#

for the crash log theres also a method of adding info under your mod in the crash log

paper zealot
hardy viper
#

i think that crashes if it fails anyways

#

looks like it doesn't on the love end so maybe im wrong

rough furnace
#

oh are you looking for pcall?

paper zealot
#

I don't think it's necessary. Looks like save_mod_config would only actually error on assert(mod.config and next(mod.config)) failing, all other calls just return the success state. I'm almost definitely overthinking this though

paper zealot
carmine burrow
#

yeah it looks like the default default card is jimbo

#

does smods have something to set those?

scarlet spire
#

here's the code as well

tepid crow
#

What I usually do for my jokers is I externalize the counter to outside the enhancement in a seperate function, then call it in both loc_vars and calculate

weak gate
#

Interesting, if you have 5 jokers and 5.1 joker slots, you can add one more joker to stay at 6/5.1

#

(Nothing in particular seems to break if you have fractional joker slots)

tall wharf
#

1.8 discards left

weak gate
#

The localization for this sticker doesn't work - ideas?

#

(and the add_to_deck and remove_from_deck don't work either, I assume they're only for cards...?)

livid tapir
scarlet spire
weak gate
#

I think a lovely patch is probably the best way to make this sticker do its thing without having to add code in all cards

scarlet spire
sturdy compass
#

Just came across a really funny bug with this Joker. I've since fixed it but I thought I'd share lol

sturdy compass
#

HEY 🗣️

noble anchor
#

Unsure why, but the variable in the description is always showing as nil

faint yacht
#

Tried without the brackets for the returning value?

noble anchor
plush cove
noble anchor
#

Still showing nil though

faint yacht
#

Show the full, bit difficult from just snippets alone. Chalking up to Joker key not being right imo.

rough furnace
#

Also did you save the file(s)

long sun
#

rate this ability?
The Spear (Rare): If played hand contains any Spades, destroy one and upgrade Straight

obtuse silo
#

seems pretty cool! It's deck thinning and scaling!

long sun
#

yas :D

#

cheers!!

obtuse silo
#

okay lemme go for mine
Lifesteal Scythe (Uncommon): Whenever a card is destroyed, this gains +5 mult.

#

this ranges from playing cards to jokers

#

so like
using hanged man, Madness, and most of the spectral cards ngl

#

most of them destroy a card

long sun
#

hmm, doesn't scale fast enough imo

obtuse silo
#

what do you suggest?

long sun
#

hah wait no that's fine

marble flint
#

Jimbo doesn't scale fast enough either :bonk:

long sun
#

just, destroying cards is quite difficult to do consistently

plush cove
long sun
#

that's why Canio grants X1 per destroyed face card

obtuse silo
#

i see
but that plays more into specific cards being destroyed

marble flint
#

ah heck there's a balatro related :bonk:, we'll need to find some other non-existent emote to use instead

obtuse silo
#

Lifesteal Scythe targets any destroyed card.

#

canio lite ig

long sun
#

ya but consider, it starts really small

plush cove
long sun
#

you could probably get a Green Joker to scale faster

#

i mean i'm not one to be good with game balance, so =w=

plush cove
obtuse silo
#

it's not necessarily about having the mod outclass the base game

long sun
#

ya i mean, fair =w=

obtuse silo
long sun
#

well i mean +5 is fine i guess :>

faint yacht
#

At the end of the day, do what drives ye.

long sun
#

hokai ideas for the other three

#
The Fuse: If played hand contains any Hearts, destroy one and gain X0.1 Mult
The Mace: If played hand contains any Clubs, destroy one and gain $5
The Dagger: If played hand contains any Diamonds, destroy one and gain +10 Mult```
obtuse silo
#

liking these

#

liking the theming

long sun
#

thanks ^^"

#

they're these jokers

obtuse silo
#

RE:VENANT (Rare): After 6 rounds, sell this to instantly clear current blind.
The thing was 12, but feedback from elsewhere suggested otherwise.

#

I lowered it to 6 so it's not that much of a burden

marble flint
#

12 rounds would be at minimum half the game (excluding hieroglyph)

#

6 is at minimum a quarter of it

obtuse silo
#

3 then??

marble flint
#

6 does feel fair though

obtuse silo
#

yeah.
I have another joker this works well with.

marble flint
#

although I'd probably take any other rare joker than this, cus it feels like a worse Mr Bones (who already isn't that impressive)

#

interesting concept, though

obtuse silo
#

I'm trying to make this actually practical
maybe lowering it's rarity to Uncommon would help

#

that way it's more likely to appear, and still benefits off of being in your hand thanks to Baseball Card

marble flint
#

yeah

#

I can't see much of a reason to take this except for the ante 8 finisher (in endless, buying one free round is either absolutely unnecessary (and has quite a high opportunity cost) or won't save you for the following blind)

#

which means you need to find it before the ante 6 boss and already be decently confident you'll need it, plus you need the spare cash to afford it, so you're probably only buying this in antes 4-6

#

Feels Bad

obtuse silo
#

i mean i guess there are jokers that exist to get outclassed

marble flint
#

there's something salvageable here, though

obtuse silo
#

mm?

marble flint
#

a joker that makes some alternate condition win the blind

#

maybe drawing your whole deck?

obtuse silo
#

oh yeaa that sounds good

marble flint
#

maybe using a number/type/etc of consumables?

obtuse silo
#

like
the joker is meant to be a massive greatsword/railcannon thing
so "putting it all into one shot" could work

#

(hi, this is RE:VENANT)

marble flint
#

i think it needs to be at least a little bit reusable to be an interesting option, but also not consistent reusable

obtuse silo
#

how so?

#

like how would i make it more reusable

#

like
just
instead of selling it, just give it a cooldown period?

marble flint
#

perhaps, I'm very not sure

#

another idea:

#

the main thing about railguns is their speed, so how about skipping a blind (which powers the speed tag) activates it?

obtuse silo
#

that sounds real cool

#

would it start activated or deactivated?

#

RE:VENANT (Uncommon): Instantly clears blind upon drawing whole deck. Recharges after skipping a blind.

broken cliff
#

so ur supposed to have no cards left in ur deck

#

sounds cool

obtuse silo
#

yea

marble flint
#

to be clear what i meant by that, the lose condition where you still have hands left but no cards to play

obtuse silo
#

right, that.

scarlet spire
#

gave up a few hours ago, gonna try getting some help with this again

#

this enhancement gives +10 chips per all other cards with that same enhancement in your deck. the issue I'm having is that the chip value calculates correctly, but is very commonly out of date, only updating right before changes are made to your deck, so it ends up being wrong if you've just loaded the game (nil or default value) or have added or removed one of them to your deck (off by 10 chips). it's also not actually applying the bonus chips when scored.

scarlet spire
#

it doesn't crash, just has some issues that I have no idea where i'd start looking for

#

since i'm extremely new to this kind of modding

marble flint
#

trying to keep every card up to date all the time will be a major hassle to get right (as you've already discovered)

#

does that make sense?

broken cliff
#

is there an event when the edition has been applied

scarlet spire
#

I do yeah, I tried earlier but messed up the syntax horribly, so i'll try again

broken cliff
#

so could u create a G.storagenum for storing all the chips u need to give out later

#

when edition is applied, add ten
otherwise, subtract

marble flint
#

actually

#

you can just copy and paste what you have in calculate to loc_vars

long sun
#

question, how do you level up a particular hand?

obtuse silo
#

try looking at the code for Space Joker

long sun
#

i did

#
return {
  card = self,
  level_up = true,
  message = localize('k_level_up_ex')
}```
scarlet spire
long sun
#

that's for the played hand

#

but i wanna upgrade Straight in particular

marble flint
#

look at the code for Black Hole

obtuse silo
#

or Saturn

scarlet spire
obtuse silo
#

since you want Straights specifically

marble flint
#

Saturn is less helpful to look at

broken cliff
long sun
#

that's not my card's ability

obtuse silo
#

that's the thing, it doesn't check for played hand

marble flint
broken cliff
#

hm

long sun
#

where do i find Black Hole in the game's source?

broken cliff
#

spectral cards

marble flint
#

find in files exists in many text editors

#

searching for "Black Hole" will get you most of the way there

#

or at least get you an ID to search for after

plush cove
#

@long sun try this maybe?
level_up_hand(self, "Straight", nil, 1)

long sun
#

hmm just thinking, actually

#

(ah thanks :D)

#

but i think creating a copy of Saturn might be more useful in this modpack, for Luke

plush cove
#

found that by scowering through the files, let me know how that works out for ya

long sun
#

ah nevermind, it would make more jokers a little worse by needing a slot

#

cheers ^^

obtuse silo
#

okay so i may end up editing a legendary joker
Birus (Legendary): -1 Ante when sold.

scarlet spire
#

like, the value is updated by a new card being created, but it happens too early

#

I am also still having trouble getting the chips themselves to apply to scoring?

marble flint
#

you need to return the chips from your calculate function, like return { chips = 47 }

#

(but only in the correct context)

plush cove
# plush cove <@1296935801606770813> try this maybe? `level_up_hand(self, "Straight", nil, 1)`

@long sun
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname="Straight",chips = G.GAME.hands["Straight"].chips, mult = G.GAME.hands["Straight"].mult, level=G.GAME.hands["Straight"].level}) level_up_hand(self, "Straight", nil, 1) update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=context.scoring_name,chips = G.GAME.hands[context.scoring_name].chips, mult = G.GAME.hands[context.scoring_name].mult, level=G.GAME.hands[context.scoring_name].level})

#

its a bit clunky but let me know if that works out for you

#

update: i forgot to put "context" in a few places, whoops, but it should be all fixed

#

yup, I tried it out in my own code, and it worked like a charm!

long sun
#

it threw an error for me =w=

plush cove
#

it should work fine

long sun
#

possible ^^

#

indeed!

#

though it's a bit clunky, it scored the cards that were destroyed

#

but i'll change the timing :D

#

nah wait no this can be fixed

plush cove
#

what's your overall card code looking like? i wanna see if you have the joker context set up properly for how you want it to work

long sun
#
if context.cardarea == G.jokers and context.before then
      local destructable_card = {}
            for i = 1, #context.scoring_hand do
                if context.scoring_hand[i]:is_suit("Spades") and not context.scoring_hand[i].getting_sliced then
                    destructable_card[#destructable_card + 1] = context.scoring_hand[i]
                end
            end
            local card_to_destroy = #destructable_card > 0 and pseudorandom_element(destructable_card, pseudoseed("thespear")) or nil

            if card_to_destroy then
                card_to_destroy.getting_sliced = true
                G.E_MANAGER:add_event(Event({
                    func = function()
                        (context.blueprint_card or card):juice_up(0.8, 0.8)
                        card_to_destroy:start_dissolve({ G.C.RED }, nil, 1.6)
                        return true
                    end,
                }))
                update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname="Straight",chips = G.GAME.hands["Straight"].chips, mult = G.GAME.hands["Straight"].mult, level=G.GAME.hands["Straight"].level})
                level_up_hand(self, "Straight", nil, 1)
                update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=context.scoring_name,chips = G.GAME.hands[context.scoring_name].chips, mult = G.GAME.hands[context.scoring_name].mult, level=G.GAME.hands[context.scoring_name].level})
                return nil, true
            end
    end```
#

i mean, they work otherwise!

#

except The Mace but i can probably fix that

plush cove
#

glad to help out a little bit!

long sun
#

tysm!!

#

so the cards aren't being destroyed properly

plush cove
#

have you checked how the hanged man does it?

broken cliff
#

i think u should add remove = true

#

somewhere in the code

crisp coral
#

return remove in context.destroying_cards

rose dragon
#

how can i directly set/get the chips/mult for custom xchips implementations?

faint yacht
#

hand_chips and mult are globals for currently scored Chips and Mult respectively.

scarlet spire
#

this crashes
I know i'm definitely doing like a million things wrong but even looking at lua tutorials I can't tell how the syntax works at all, my brain can't parse any of it even though I know exactly what the smaller pieces are doing

broken cliff
#

bcuz normally isnt it supposed to return a table?

#

and not just a number

scarlet spire
broken cliff
#

line counter not shown 💀

scarlet spire
#

god oops

#

instinctively cropped it out

broken cliff
#

anywho calculate function should have context and return the table

broken cliff
#

did u forget an end

scarlet spire
#

wait that's. an old version of the code ignore that

#

why did I have that image lying around

#

there we go, same code just with line counter

broken cliff
#

calculate should be a function returning a table

#

it should return the table with chips equalling out to the chips u want to score

#

and calculate should feature a context check

#

so it doesnt trigger every context possible

#

heres an example of calculate function

karmic arch
# scarlet spire

(I'm a bad coder, so maybe that's not what the advice is about) But if there is a function without checking if there is a G.playing_cards, then when you look at the collection, it will cause an error since g.playing_cards is nil

broken cliff
#

it triggers in every context, mind u

#

so it would trigger when ur in shop

#

or rerolling

#

or at the end of the round

#

afaik theres no card to be spoken of when ur in shop

#

so u should add the context check

karmic arch
#

Although I can easily be wrong.

broken cliff
#

and u can do chips = woodScoreCalc(self.config.chips) so u could still do ur check

broken cliff
#

u can modify it when in shop(when the joker is added to the joker area)

karmic arch
broken cliff
#

therefore it doesnt exist

#

anywho whats ur progress @wheat

karmic arch
scarlet spire
#

alright the game is launching now, but woodScoreChips in the function is nil

broken cliff
#

declare/put the function above the enhancement

scarlet spire
#

hm, same thing happens

broken cliff
#

hm

broken cliff
#

thats why its nil

wintry solar
#

give me 2 mins to write it up for you, hold on

karmic arch
#

Swap return woodscorechips with with the last end?

broken cliff
#

function received an improper reference to bonus chips value, and accepted nil instead

#

aka u put the wrong value that doesnt exist

scarlet spire
#

alright it's not crashing now, though it's not updating the value whatsoever

wintry solar
#
loc_vars = function(self, info_queue, card)
    return {vars = {count_wood() * card.ability.config.bonus_chips}}
end,
calculate = function(self, card, context)
    if context.cardarea == G.play and context.main_scoring then
        return {
            chips = count_wood() * card.ability.config.bonus_chips
        }
    end
end


function count_wood()
    local count = 0
    for _, v in pairs(G.playing_cards) do
        if v.config.center_key == 'm_ytf_wooden' then count = count + 1 end
    end
    return count
end
#

there you go

broken cliff
#

js use what eremel posted

wintry solar
#

loc_vars and calculate go in the nehancement, the function underneath

#

oh hold on

#

it's an enhancment 2 secs

#

fixed

broken cliff
#

what does to_big() do

#

could it be used to take in the mult to alter it?

scarlet spire
#

thanks for sticking through my complete lack of understanding with everything, been trying to learn an actual programming language for years now but nothing's ever stuck, so I'm hoping this mod is gonna be a project interesting enough to keep me in it until I understand

tall wharf
#

what the fuck am i doing

high stag
karmic arch
#

Yoasobi^^

tawny perch
#

All they did was the opening song of the anime

dire palm
#

How can I make text appear above a card in hand when a joker ability triggers?

wintry solar
tall wharf
#

i know it's outside of the card rn but

signal bloom
#

Hey everyone. I want to lead off with: I've never modded anything, or coded anything. I have a general idea of things pertaining to it, but I've never done it. However. My friend and I were joking about it one day, imagine if there was a post run screen, that shows how many blunders you've made, like on chess.com how it shows how many blunders you've made. So, I had chatgpt write a mod for it. I don't know how to implement that into a mod though, so I was wondering if someone here, could do that for me, if I were to send the code. Obviously I don't care for anything from it, or credit or anything. I had the idea but don't have the ability to carry it out, so I thought I'd ask y'all. I also don't know if the code is going to work 100%...

royal ridge
#

curious what even counts as a blunder

signal bloom
#

Not picking up a certain joker, not playing a specific hand that would've mathematically been better etc

#

Which of course not picking up a certain joker could be because you're going for a specific build

scarlet spire
#

chess is a pretty straightforward (structurally) game that afaik makes it easy to calculate how "good" a move is, I don't know if blunders are really calculable for something like balatro?

signal bloom
#

So that could be potential for the mod to say you have more blunders. So could be potential for not ideal things, but could be interesting

signal bloom
royal ridge
#

i'm not saying a total run analysis is impossible but would require a lot of work on the backend

signal bloom
#

I can send the code, because I honestly have like no idea what I'm looking at, but if someone wants to take a glance at it, they're more then welcome to lol

tall wharf
#

ok i think i am done

#

actually i have a few more things

signal bloom
#

This is what I'm assuming the code is classifying as a blunder:

if (move.PlayedHandStrength < move.PossibleMaxHandStrength)
return "Played a weaker hand than possible.";
if (move.UsedJoker && move.JokerEffectiveness < 50)
return "Used a Joker inefficiently.";

    return "Unknown blunder."
scarlet spire
#

I'm curious, what are people's opinions on what new tarot cards in mods should be? minor arcana? making up new tarot cards? something else? I need to add new tarot cards so you can even access my enhancements outside packs but I'm sort of lost in regards to what they should actually be

royal ridge
#

i think first course of action for run analysis would be a way to define material/tempo

signal bloom
manic rune
#

does anyone have a guide on patches? i see a lot of mods having them but i dont know how to make one, their function and basically the basics

signal bloom
royal ridge
signal bloom
royal ridge
vagrant flax
#

hi guys, I'm new here
I created a mod with a new seal and a new tarot that applies that seal to max 3 selected cards, but when I try to use the tarot the game crashes
This is the code for the new tarot, any advice?

signal bloom
manic rune
royal ridge
manic rune
vagrant flax
#

i'm trying both bepis and tone methods, see u later

royal ridge
#

um

#

i'm not exactly sure how much you know already actually

manic rune
#

literally nothing lol

royal ridge
#

oh ok

vagrant flax
#

IT WORKS THANK YOU SO MUCH balatroheart

royal ridge
#

gg

scarlet spire
vagrant flax
manic rune
#

itd be really nice if you can help me go through what patches can do, im practically new to this whole balatro modding scene :D

runic pecan
#

How do I separate my joker's name into multiple lines?
I don't like the way those letters being squeezed together.

tall wharf
#

there we go

maiden river
#

I've spent the past week adding the friends vs friends cards to balatro
I just got done with the weapons yesterday

vagrant flax
#

Hi again guys, second dilemma
I tried to create a new deck wich starts with 2 tarot cards called "The Sauce" (key = sauce) but when I start a game with it, it doesn't have any consumables and it crashes
Any advice?

@manic rune @royal ridge

maiden river
#

If I remember right, you have to use events to add the consumables in the apply function of the deck

#

I could be wrong tho, it's been a while

royal ridge
#

you can have a look in card.lua, buncha interesting game code there (basegame joker calculates and stuff)

once you've found a place where you want to patch, you can make a (yourmod)/lovely/(filename).toml file beginning with the structure that goes something like

[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

(just open .toml files in notepad, no big deal)

then you can actually do a pattern match, the file will usually look something like

[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

# description of patch can go here, this patch makes spare trousers work on flushes instead of two pairs
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '''if self.ability.name == 'Spare Trousers' and (next(context.poker_hands['Two Pair']) or next(context.poker_hands['Full House'])) and not context.blueprint then'''
position = 'at'
payload = '''if self.ability.name == 'Spare Trousers' and (next(context.poker_hands['Flush'])) and not context.blueprint then'''
match_indent = true


# square joker gives $4 when scaling
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '''if self.ability.name == 'Square Joker' and #context.full_hand == 4 and not context.blueprint then'''
position = 'after'
payload = '''
ease_dollars(4)
G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + 4'''
match_indent = true

the line that is the focus is pattern. you can also put multiple lines here, but you shouldn't need to do that most of the time. note that a pattern match will match multiple lines if possible which can cause syntax errors and unexpected behaviour
target is card.lua, since that's the file which is being patched
payload is the stuff you want to inject/change, it can be pretty much anything
position can be either before, after, or at. at overwrites the code, while the other two are self-explanatory

#

forgot to reply lol

maiden river
#

lmao

manic rune
vagrant flax
worthy stirrup
#

im getting a crash from my mod but idk whats causing it

#

ill send the crash log in just a sec

crisp coral
#

px and py should be numbers not strings

worthy stirrup
#

ohhh

dire palm
#

How can I make text appear above a card in hand when a joker ability triggers?

worthy stirrup
#

oops

#

I fixed it and im still getting a crash

#

crash log ^

#

updated code ^

crisp coral
#

your requires isn't a table

#

requires = {'v_hone', 'v_glow_up'}

worthy stirrup
#

oh, its a table? thank you

manic rune
timid star
#

how would i go about storing a custom variable in a playing card?

tall wharf
manic rune
timid star
#

still makes an error huh

#

oh im using extra whoops

worthy stirrup
#

is there any way to quickly get all non modded vouchers so i could test my vouchers

dire palm
#

How can I make my Joker shake and show a message when its ability triggers?

worthy stirrup
#

i think its message()

#

or its return()

#

does this increase the chances of a negative?

manic rune
#

probably? the best way to know is to test lol

weak brook
#

doed anyone know a good example of a modded joker that uses the functionality of matador? where a joker ability goes off when the boss blind "is activated"?

#

had issues with this before

worthy stirrup
#

well, im not sure if i refresh the mod it will apply the redeem effect twice upon the reload or if i need to buy it again

zealous glen
#

Thunk has said they want to rework it

manic rune
#

what would i need to do if i want to add more boxes in a joker's description?

weak brook
#

ah yeah i can see that

#

damn guess depressed brother is gonna be disabled for a while then

zealous glen
manic rune
zealous glen
#

An easy alternative would be to add boxes inside the white box

dire palm
#

I don't understand why my message doesn't appear in-game.

manic rune
#

thanks

zealous glen
#

The Event Manager doesn’t care

dire palm
#

So, where should I return it?

zealous glen
#

Maybe in the body of the calculate function

vagrant flax
#

ehy victin
do you know how to solve this?
I tried to create a new deck wich starts with 2 tarot cards called "The Sauce" (key = sauce) but when I start a game with it, it doesn't have any consumables and it crashes

worthy stirrup
#

how can i check if theres consumables in the shop

zealous glen
zealous glen
worthy stirrup
#

wait, how do i check the shop

#

bc i only see when the shop is rerolled

dusk harness
manic rune
#

what do i need to do to have a joker working like blueprint?

worthy stirrup
dusk harness
timid star
#

thingy works now i just need a sound effect, i think i can check the balatro files and use the same file name for it right

dusk harness
timid star
timid star
dusk harness
#

uhm, cool concept

timid star
#

could be a boss blind ability now that i think about it

dusk harness
#

would have been more like it

worthy stirrup
#

i got one of my vouchers to work

timid star
#

it's a joker ability due to the reference

dusk harness
timid star
#

but it works perfectly

dusk harness
#

it does, good job on that

worthy stirrup
#

ive removed that part of the code but now im just trying to figure out how to make it call for it when the shop is rerolled/ first opened

dusk harness
#

i figured both of those out, let me show you, i just need to get my github repo

worthy stirrup
#

thanks

dusk harness
#

been trying to do that too for 2 weeks,

#

why are you trying to read shop state?

worthy stirrup
#

im gonna work on the art of my other vouchers and then work on it more

#

im trying to make consumables in the shop negatives

dusk harness
#

sick

#

good idea

worthy stirrup
#

yea, part of a voucher mod im working on

dusk harness
#

very nice, hope we cross path again with more updates to our mods

runic pecan
manic rune
crisp coral
wintry solar
#

That’s a nice offset sprite you’ve got there 😉

manic rune
#

this SHOULD work like brainstorm except it uses the rightmost joker's effect, right?

zealous glen
crisp coral
#

­

zealous glen
#

Thanks

manic rune
wintry solar
#

I mean it doesn’t look like there’s anything to copy until you’ve added the brainstorm

manic rune
#

but for some reason it just straight up disables the rightmost joker's function too

wintry solar
#

Can you show the code for both jokers?

manic rune
#

its this one (rightmost joker)

#

this is the one with the copying function

#

i assumed its because of the "and not context.blueprint" which made the code not run, but brainstorm and blueprint still allowed it so idk whats going on 💀

normal crest
#

Never thought I'd see star rail in balatro

manic rune
wintry solar
#

Nah that code should still run

#

Can you throw a print outside that event and see if it prints?

manic rune
#

lemme see

#

istg am i doing smt wrong here 💀

#

i even tried copying blueprint's code once and slapped it on my joker, the same bug still happens

normal crest
#

and your check should compare against card not self

manic rune
#

though the problem still remains, which is that my modded jokers' effects r disabled if they have that "not context.blueprint" in the condition

wintry solar
#

If you remove the copying joker does it print?

wintry solar
#

oh

#

I know what this is

manic rune
#

😭 fr?

wintry solar
#

You need to set context.bluepritn back to nil

normal crest
#

In your copying joker ^

manic rune
#

im kinda lost here, where am i supposed to put that?

wintry solar
#

After you calculate the other joker

manic rune
#

like this?

#

oh my god, thank yall so much 😭

normal crest
#

and you should set blueprint_card to nil too

#

just make sure to store the value before

lament steeple
#

👋

Hello! Using SMODS, is there an easy way to access stuff provided by another mod? I see SMODS.current_mod.* stuff, so I tried (specifically trying to use Pokermon stuff in mine) - SMODS.pokermon.config and SMODS.Pokermon.config but neither worked - I figured I should search out documentation/help rather than continuing to randomly stab at it at that point

faint yacht
#

SMODS.Mods['Pokermon']?

crisp coral
#

SMODS.Mods["Pokermon"]

lament steeple
#

awsome, thank you both!!! ❤️

normal crest
#

And you don't need the [] or "

faint yacht
#

But as nothing was done for suit/ranks by SMODS itself, if I want a rank to also be considered a different one (Aces count as 10s, for example) w/ a Joker, do I hook or patch?

wintry solar
#

I say good luck lol

manic rune
wintry solar
#

that's cryptid

dire palm
#

The game never goes in my

  return {message = "Isekai'd",}
end```
and I'm confused as to why. Anything stupid I'm missing?
normal crest
#

because you're modifying it in an event

#

events don't happen immediately

dire palm
#

I see... How could I solve the problem, then?

normal crest
#

from what I see only the code within your for loop after you define destroyed_cards should go in the event

#

Tho I just realized you're using that textkai variable to see if jokers_to_create is >= 1

dire palm
#

Yeah. That's the point. The message should not appear if no joker is created.

normal crest
#

then you could replace textkai == 1 with that, jokers_to_create > 0

#

and just get rid of it entirely

wintry solar
#

use SMODS.calculate_effect within your event

dire palm
shell geyser
#

hi sorry to bother i am trying to create a joker similar to dna that create a negative copy if the first hand is a single card but can't get it to work , the error is that "full hand is a nill value"

normal crest
pulsar flower
#

if you don't narrow down the context, i believe it triggers when the hand isn't drawn, causing a crash

shell geyser
normal crest
#

So after a hand is played?

#

Or before a hand is played

pulsar flower
#

pretty sure dna triggers before

pulsar flower
#

^

shell geyser
#

ok thx i will try this

pulsar flower
#

right so how would i add a custom enhancement to the info queue of a consumable?

normal crest
#

info_queue[#1116390750314307698_queue + 1] = G.P_CENTERS.m_gold

but instead of m_gold you put m_prefix_id where prefix is your mod prefix and id is well, the id of your enhancement

pulsar flower
#

yeah i figured

#

didn't think it would be as straight forward, oops

#

actually, speaking of info queue

#

how would i access the smods negative playing card info where it says +1 hand size

worthy stirrup
#

to be sure, is context.buying_card or context.selling_card relating to jokers

faint yacht
#

Any card.

worthy stirrup
#

okay, im probablt just gonna check this at the start of every blind then

pulsar flower
#

i think you just check the set

normal crest
#

Oh wait

pulsar flower
#

yeah

normal crest
#

try e_negative_playing_card

faint yacht
#

Well, sticking with hooking it.

nocturne garnet
#

that truly is a five of a kind of only one rank

violet void
wintry solar
#

It would be better with hand types it can work with

#

Otherwise it’s just extra discard limit, which is fine

violet void
#

this is while I was testing and I thought it was funny lol

wintry solar
#

Oh it working in straights like that is cool

#

Do flushes and oaks work too?

violet void
wintry solar
#

That’s pretty neat then, I’d say it’s worth it

sage reef
#

Hey there yall, I am thinking about making a mod for Balatro but have never had any experience in the field beyond some very basic coding. Any advice, tips, or tools yall find especially useful? I can do the pixel art myself no sweat, but its the coding aspect thats a bit daunting

wintry solar
#

Start simple to get the hang of things then slowly work up to more complex effects. Make sure you read the wiki and don’t be afraid to ask questions if you need help, there are plenty of us who do know what we’re doing that are happy to help!

edgy mountain
#

hey, how do i make sure other_joker gets assigned?
right now it is always turning out as nil when the joker is being sold

#

i copied blueprints code to select the joker to the right of this

wintry solar
#

Also why is the entire logic inside an event?

dense vector
edgy mountain
#

thanks tho

shell geyser
#

sorry to bother again i feel like my conditions are close but wrong it never seems to enter inside the loop (trying to make a negative dna)

violet void
dense vector
#

Could you technically play an eight of a kind of all of your held in hand cards are aces?

dense vector
#

I know that it would count as a five of a kind but still

shell geyser
#

same as before , i am trying to add a negative copy of a card to the deck, given that it is the only card played on the first hand (similar to dna)

tall wharf
#

can someone add coulrophobia mode for balatro

#

where every single instance of jimbos are replaced with cats

shell geyser
#

yes yes joker

wintry solar
#

Then remove the cardarea check

shell geyser
#

ok i will try

violet void
maiden river
#

how do you add chips to a card, like hiker does?

vagrant flax
#

hey guys, anyone has evere modded a deck in Balatro?

maiden river
#

I have

#

did you ever figure out that thing from earlier

vagrant flax
#

still hasn't

wintry solar
#

What’s the question?

vagrant flax
#

I need to create a new deck that starts with 2 tarots that I created and a Joker
I did this, but when I start a game it crashes

normal crest
#

Probably have to put the full id for the consumable

shell geyser
wintry solar
#

Problem with your return table

#

Remove the card = line

smoky beacon
#

Does anyone here know how to sort modded out on linux?

foggy carbon
#

The joker still works as intended, but hovering over it gives this error. No other joker with info_queue breaks this way. I wonder if this is something I did?

vagrant flax
normal crest
#

Try c_prefix_key

shell geyser
wintry solar
#

Something like this but with your key

foggy carbon
normal crest
foggy carbon
#

I think they're just Smods. All the other mods I have sit on top of smods rather than using lovely

wintry solar
#

What’s your mod list?

vagrant flax
#

IT WORKED

maiden river
vagrant flax
#

thank you so much guys ur pretious

maiden river
vagrant flax
maiden river
foggy carbon
wintry solar
#

It very well could be one of those mods, I’m not aware of anyone else having this issue

normal crest
#

Yeah you have a lot of mods, hard to pinpoint the culprit

urban veldt
#

Is there a font for Spectral/Tarot cards?

#

Or do I just gotta pixel-art something thats legible and nice?

foggy carbon
wintry solar
#

That was my guess

foggy carbon
#

which I guess makes sense? This is the only joker that has info_queue relating to tags

cerulean rose
#

yup, known issue

smoky talon
#

im trying to make a tag that spawns a custom joker, and im having problems. I spawned the tag with debug mode and at the next shop the joker appeared, but the game seemingly froze as the tag stayed and i couldn't interact with anything, but the music continued. Any idea why this is happening? (Also, how do I add a description to the tag?)

faint yacht
#

?

if context.type == "store_joker_create" then
  local card = create_card("Joker", context.area, nil, nil, nil, nil, "j_gcbm_avo")
  create_shop_card_ui(card, "Joker", context.area)
  card.states.visible = false
  tag:yep("+", G.C.RED, function()
    card:start_materialize()
    card:set_cost()
    return true
  end)
  tag.triggered = true
  return card
end
smoky talon
#

i got the basis for the code from someone else in here yesterday, so some of it may be wrong idk

wintry solar
#

You need the yep

smoky talon
#

that works

#

i just need tto know how to add a name and description for the tag

#

its just blank rn

#

also i put set_cost to 0 and the joker still costs 15

#

any idea why?

#

why did it send that bunny lol

faint yacht
#

card.ability.couponed = true in yep.

vagrant flax
smoky talon
#

and how do i add a name and description?

faint yacht
#

Same loc_txt structure.

smoky talon
#

k

vagrant flax
#

ehy @wintry solar , do you know how to create a deck that starts with a joker?

wintry solar
#

I believe you add joker = {‘key’} to that config table

#

It might be jokers

zealous glen
#

Can this be pixel precise?

wintry solar
#

It’ll have to be in terms of the games coordinates

vagrant flax
#

tried and didn't work

zealous glen
wintry solar
#

🤷‍♂️ dunno I just adjusted until it was where I wanted

cursive glade
#

Is it possible to add a new hand type through SMODS?

maiden river
#

yup

#

I think?

wintry solar
#

I think I based it off self.T.w being 71 pixels

cursive glade
#

thx

wintry solar
cursive glade
#

I think it needs to be a lovely patch

zealous glen
maiden river
#

every time I get a modded consumable from a booster pack, it adds itself twice?
one is invisible tho

#

oh wait I think I fixed it lmao

#

yeah it was be being clueless

wintry solar
#

@vagrant flax using jokers = {'key'} in your config on newest smods will work now

maiden river
#

should someone add the information about config on decks to the wiki? seems like that would be helpful

livid tapir
#

how do i make it so that my booster pack has the consumable type be pulled into your consumable slot and not be used
what i mean is
i have a booster pack
and the cards inside it (besides all the placeholder joker guys) have a use button instead of a button that like adds to your consumables

livid tapir
#

raevyn howw are you always doing what im trying to do-- 💀
literally a smarter version of me lol

maiden river
#

so you're going to want to use the keep_on_use function and make that always return true

#

and then in your use function, at the end, add card:start_dissolve()

#

so it destroys itself when you actually use it

livid tapir
#

in the consumable, consumable type or booster

maiden river
#

in the consumable

livid tapir
#

makes sense

#

ok

#

thxxx

maiden river
#

no problem

wintry solar
#

no

#

don't do that

maiden river
#

oh

wintry solar
#

that's not how to do it

maiden river
#

nvm guess I'm cancelled

#

what's the issue with that

#

just wondering

wintry solar
#

it'll mess with usage counting for one

pulsar flower
#

is there a way to access a card's key to index into G.P_CENTERS later?

#

unsure if it's an actual property of it or if i should make a patch that stores it

wintry solar
#

card.config.center_key

livid tapir
pulsar flower
bleak bone
#

Does anyone know if it's possible to have a card and joker set only appear if you choose the deck for them?

wintry solar
livid tapir
#

yeah ngl, thats a pretty essential feature
so should i just do raevyns suggestion for now?

maiden river
#

So I win for now

livid tapir
#

uhh

#

i tried it

#

doesnt seem to work

#

see use is grayed out

#

and unclickable

maiden river
#

Oh yeah I forgot to mention that

cerulean rose
#

seems like an issue with your can_use function

wintry solar
#

just need to figure out the best way to enable it

maiden river
#

Make can_use return true

#

I have all of mine all return true all the time

#

Which isn't good lma

#

Lmao

#

Rae's Scuffed Solutions™️

wintry solar
#

super scuffed 🤣

maiden river
#

There's a state that's when a booster pack is open, I believe

#

G.STATES_SMODS_BOOSTER_OPENED, iirc

livid tapir
#

ok

maiden river
#

I don't know if that's just for modded boosters tho

livid tapir
#

well this is a modded booster so EEEEEEEE

maiden river
#

I've learned so much about modding from the project I'm working on

#

Mainly that debugging is hell

#

And holding the m key is a bit annoying

#

Shoutout to whoever made the LSP definitions for smods btw

livid tapir
maiden river
#

You're my hero

maiden river
#

I think you can make your own keybinds with some code

edgy reef
#

Yea

livid tapir
#

this is the consumable ```
SMODS.Consumable {
key = 'skip',
set = 'unoc',
loc_txt = {
name = "Skip",
text = {"pluh"}
},
atlas = 'uno',
pos = {x = 0, y = 0},
keep_on_use = function(self, card)
return true
end,
use = function(self, card, area, copier)
card.start_dissolve()
end,
can_use = function(self, card)
return true
end
}

and then when i use the thing in a booster it decides to crash bc it indexed self
maiden river
#

so you have to have some kind of check to see if the card is being used in a booster pack

#

Here's some of my code

#

At the very end of the function is where the start_dissolve is

livid tapir
#

so smth like this?

SMODS.Consumable {
    key = 'skip',
    set = 'unoc',
    loc_txt = {
        name = "Skip",
        text = {"pluh"}
    },
    atlas = 'uno',
    pos = {x = 0, y = 0},
    keep_on_use = function(self, card)
        return true
    end,
    use = function(self, card, area, copier)
        if G.STATE == G.STATES.SMODS_BOOSTER_OPENED then
            return
        else 
            card:start_dissolve()
        end
    end,
    can_use = function(self, card)
        return true
    end
}
maiden river
#

Yeah

#

You technically don't need the else since the function returns

livid tapir
#

oh yeah

#

optimization 101

wintry solar
#

it's nearly done dw

maiden river
livid tapir
maiden river
#

Oop

#

Well apparently we won't have to worry about all this in a little bit lol

pulsar flower
mystic river
wintry solar
#

There we go, pushed. Use select_card = 'key of card area to save the card to' in your booster object

#

for example, select_card = 'consumeables' to save to the consumable slots

#

I also need this for ortalab so I'd have been doing it at some point anyway 🤣

maiden river
#

Big

#

Also btw

#

Is there a way to disable the use button? Like hide it

wintry solar
#

when?

tall wharf
#

oh in the booster pack?

rough furnace
#

consumeables have a can_use function on them

hushed briar
#

is there a way to have the color of text in a description be variable? {C:#4#}#1#{} Joker doesnt work and neither does passing the whole thing as a loc_var work, like loc_vars = function() return {"{C:blue}Common{}"} end and then #1# Joker

rough furnace
#

you can define custom colours in loc_vars

tall wharf
#

i guess you're trying to add dynamic formatting

rough furnace
hushed briar
#

oohhh i see, thank you

tall wharf
#

ah

#

sounds simple

sullen fern
#

if i wanna create the self destruct seal i need to learn how to trigger self destruct after scoring is finished

tall wharf
#

i made kinda same concept but it does it at the end of the round

#

not every hand

sullen fern
#

yeah i want it to trigger after every hand scored

tall wharf
wintry solar
#

you can use the destroying_card context in that case

noble anchor
edgy reef
wintry solar
#

yes

edgy reef
#

ok

wintry solar
#

it wouldn't work referencing the cardarea directly

dire palm
#

Wondering something... How can I get the number of cards currently held in hand?

normal crest
#

#G.hand.cards

summer torrent
#

Do y'all think it's realistic for me to try to make a mod with very little experience, or should I start somewhere else?

stiff locust
#

uhh

stiff locust
rough furnace
#

as long as you're willing to read docs and stuff you should be fine

stiff locust
#

also balaui

#

shows you joker code format
but be warned, it likes putting variables as strings instead of integers, not a difficult fix tho

#

anyway

#

my sound is being distorted by the game

summer torrent
#

Thanks!

stiff locust
#

i knew the game changed sound files a bit but how do I reverse engineer it

#

to make the sound normal ingame

naive notch
#

Finished these 2 cards, how they looking?

#

heres a better ss (idk why the first one was so small)

sullen fern
#

i forgot to show off the alabell card and seal sprites

solar tide
#

Hi

#

Someone have some documentation about card_eval_status_text

#

i already created a additionnal script for implemt the "x_chips" and want to put a message when i multiply the x_chips

#

but dont rly understand the parameters about the fonction card_eval_status_text

zealous glen
#

I think Steamodded implements xChips no?

solar tide
#

no

#

its only Talisman

#

But its okay i already implement it

#

the problem is with the card_eval_status_text

vagrant flax
sullen fern
#

this may be the greatest joker ever

solar tide
#

no. but it is cool

tepid crow
wintry solar
solar tide
#

and u know when its gonna be release

tepid crow
#

I don't even think they have decided whether to add it or not

rough furnace
#

talisman does iirc

solar tide
#

'cause if its soon, maybe i can more focus on the other jokers and for this one juste w8 the implementation of xchips

#

but i dont want to made a dependency with talisman

wintry solar
#

it isn't hard to add though

solar tide
#

i just want my mod can be launch without it

wintry solar
#

so if we do decide to it'd be pretty speedy

solar tide
#

hmmm okay

#

thats can be really cool for me, if u implement it

#

why y hesitate ?

wintry solar
#

imo it steps a bit far from vanilla, and it;s functionally xmult in almost every circumstance

#

I only suggest adding it so people stop asking about how to add it 🤣

zealous glen
#

I think xChips is just Mult

#

and xxChips is xMult

rough furnace
#

^chips\

tepid crow
mystic river
#

iirc it was also suggested to implement ^mult (and ^chips) so people can stop requiring talisman for those
(if people want ^^things they'll probably need talisman anyway :v)

tepid crow
#

^mult (and ^chips) seem too far for me but idk

wintry solar
#

I don't think we'd implement ^mult/chips

tepid crow
#

"slippery slope" and all that

zealous glen
#

They can require Talisman for those

rough furnace
#

esepcially since your going to be needing talisman for the higher scores anyways

zealous glen
#

I don't like xChips but I think it's ok for SMODS to add it as an API

scarlet spire
#

/chips that always divides your chips into a smaller number

zealous glen
#

I think for the most part they only want ^Chips because Cryptid does it

zealous glen
rough furnace
#

0.5x mult

scarlet spire
#

I love <X1 mult

rough furnace
#

-1x mult

wintry solar
#

negative scoring is fun

mystic river
#

oh yeah did playing cards accumulating mult and xmult hiker-style get added to smods or was that just put on the to do list

zealous glen
#

I don't think I like negative scoring

wintry solar
#

I think victin and lars are working on it

scarlet spire
#

is there any documentation/template for specifically making tarot cards?

zealous glen
#

-# Lars has put in all the work so far, I need to stop procastinating jimbOrb

wintry solar
#

thats fine take your time
-# jk I need it for ortalab hurry up pls

tepid crow
livid tapir
orchid thunder
wintry solar
livid tapir
orchid thunder
#

bc people hate new calc

rough furnace
#

pretty much every mod but crytpid uses new calc at this point

#

and cryptid is being updated

livid tapir
#

Mika's Mod Collection?

rough furnace
#

ikd what that is

livid tapir
#

it has some decks and stuff

livid tapir
wintry solar
#

mika's isnt even 1.0

livid tapir
#

huh, it just works

wintry solar
#

if we remove the compat layer it will just stop working

rough furnace
#

0.9.8 compat layer go brrrrrrrrrrr

livid tapir
#

ah ok

tepid crow
#

yeah I was about to say that's 10 months old

tepid crow
livid tapir
#

me finally giving in to the breaking change propaganda-- /j (about propaganda)

#

ok i just switched and guess what
a miracle
the game launched

#

i was expecting 40 errors to be thrown at me

#

so

tepid crow
#

yeah you should really be developing for new-calc anyway

wintry solar
#

you just might have a few calcs trigger more than once or not trigger depending on what they were

#

or some patches miss

livid tapir
#

is it a problem with the mods or the new calc

rough furnace
#

the mods

livid tapir
#

ok

zealous glen
#

The names people use here are interesting

livid tapir
#

lol

zealous glen
#

When is stupid meeting dumb*ss

livid tapir
#

bc i am #1 dumbass, its no secret

zealous glen
#

SMODS Cinematic Universe

livid tapir
#

LOL

mystic river
# livid tapir is it a problem with the mods or the new calc

a lot of mods used weird shortcuts that worked on old calc because only certain contexts got passed to certain items
better calc passes every context to every item so being insufficiently specific with contexts will have funky results now

livid tapir
#

ah i see

#

also fellow cat pfp no way

mystic river
#

some of the shortcuts were so weird I'm surprised they even worked under old calc

#

also kitypaw

wintry solar
#

it's just a far superior system now

#

you have so much more control

livid tapir
#

ngl i have a slight feeling my jokers could be funnied by the new context stuff, though im sure its simple fix so

#

i just realized
NO
everytime i say "must be simple fix" it is 10x harder than i thought

#

WHAT HAVE I DONEEE

graceful magnet
#

so I'm quite literally just starting working on something (I wrote out 50 Joker ideas and decided that's my current limit for ideas before I need to start making them), and I'm wondering what the 'key' it talks about here. I'm not familiar with this area of modding so I'm just wondering like, Mod name or something, should this be the same for every object, etc?

livid tapir
#

50 is an oddly large limit--

wintry solar
#

key is individual to each object, it's how the game refers to it

graceful magnet
#

okay, good to know

livid tapir
#

ok eremel your new feature good
YAY
ty

#

yknow i just realized smth
im kinda stupid
why would i not let duplicates in a booster pack about uno 💀

#

a booster pack that has a sprite made to look like a deck too

molten kestrel
#

Hey everyone im pretty new to modding but wanted to try doing some statistical analysis on bits of the game as a sort of a personal project. Where should i start in pulling things like game infomation like the hand a deck (probably with the end goal of giving it to Python)?

rough furnace
#

the current hand is stored under G.hand iirc

#

or well the cards are in G.hand.cards

molten kestrel
#

This is super helpful thank you!

scarlet spire
#

I made a custom enhancement tarot card that works perfectly, except it doesn't do the card flip animation when converting to a different enhancement, what am I supposed to do for that?

wintry solar
#

you need to add the flips in events before and after you change the ability

dense copper
#

Hey yall, I have the json all set up for my face card reskins. how do i set up the lua file to make it work? i have been rummaging through the github wiki but i cant seem to figure it out

solar eagle
# scarlet spire I made a custom enhancement tarot card that works perfectly, except it doesn't d...
            local percent = 1.15 - (i-0.999)/(#G.hand.highlighted-0.998)*0.3
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.15,
                func = function()
                    G.hand.highlighted[i]:flip();
                    play_sound('card1', percent);
                    G.hand.highlighted[i]:juice_up(0.3, 0.3);
                    return true
                end
            }))
        end
        delay(0.2)```
*before* the code that converts to enhancement
```for i = 1, #G.hand.highlighted do --unflips cards
            local percent = 0.85 + (i-0.999)/(#G.hand.highlighted-0.998)*0.3
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.15,
                func = function()
                     G.hand.highlighted[i]:flip();
                     play_sound('tarot2', percent, 0.6);
                     G.hand.highlighted[i]:juice_up(0.3, 0.3);
                     return true
                end
            }))
        end
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.2,
            func = function()
                G.hand:unhighlight_all();
            return true
        end })) --unselects cards
        delay(0.5)```
*after* the code that converts to enhancement
#

you'll notice that the hierophant unselects the cards that you selected after converting them but your tarot does not

scarlet spire
#

oh yeah, that too

#

thank you!

#

I wish there was more example code in the docs for how to achieve base behaviors like this

solar eagle
#

yeaa

#

the best documentation is really just the game source code lol

#

cryptid helps too, sometimes

scarlet spire
#

I should take a look at that

cerulean rose
#

doesn't seem to work

#

it won't let me reference outside locals during the take_ownership call

graceful magnet
#

is there an example Joker somewhere so I have like a good guide for formatting and how to actually like, slot in functions and stuff?

solar eagle
#

what exactly are you trying to do tho?

graceful magnet
solar eagle
# graceful magnet currently reading through things mostly but attempting to make a Joker that gain...
    key = "placeholder",
    loc_txt = {
        name = "Placeholder",
        text = {
            "Text goes",
            "here, on",
            "{C:attention}multiple lines!{} by {C:mult}+#1#{}",
            "{C:inactive}(Currently {C:mult}+#2#{C:inactive} Mult)"
        }
    },
    config = { extra = { mult_add = 1, pool = 0 } },
    rarity = 0,
    blueprint_compat = true,
    eternal_compat = true,
    atlas = "jokers",
    pos = { x = 0, y = 0 },
    cost = 4,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult_add, card.ability.extra.pool } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and not SMODS.has_no_rank(context.other_card) then
            if context.other_card:is_face() then
                card.ability.extra.pool + card.ability.extra.pool + card.ability.extra.mult_add
                return {
                    extra = { message = localize('k_upgrade_ex'), colour = G.C.MULT },
                    colour = G.C.MULT,
                    card = card
                }
        elseif context.joker_main then
            return {
                message = localize { type = "variable", key = "a_mult", vars = { card.ability.extra.pool } },
                mult_mod = card.ability.extra.pool
            }
        end
    end
}

heres what should do exactly that

#

breakdown!

#

key is the key of the joker, in case you want to check for it later or something
loc_txt is the name and description
config is where you can store variables and the like, so for example mult_add is how much mult it will add to itself when a face card scores, and pool is what it sounds like - a pool of all the mult to add

#

rarity is whether its common, uncommon, rare, legendary which are 0, 1, 2, 3 respectively

#

blueprint_compat means it can be cloned with blueprint or brainstorm, eternal_compat means it can have the eternal sticker

#

atlas and pos are to do with the sprite - i can explain those separately if you want

#

cost is how much it costs in balatro bux

#

loc_vars is how you return variables to the description field, so you can use #n# to display them, where N is their order in the array you return

#

the description there shows +1 (mult_add) highlighted with {C:mult}{} so it will show in the red text

#

And then the line below that shows how much mult it would currently be adding, like how Runner does with chips

cerulean rose
ionic verge
#

how easy would it be to make extra booster packs spawn

solar eagle
#

i might have misremembered im tired lol

cerulean rose
ionic verge
#

ok

solar eagle
#

but anyway

cerulean rose
#

loc_vars is the same as it is with loc_txt

solar eagle
# solar eagle And then the line below that shows how much mult it would currently be adding, l...

And finally calculate is where everything actually happens! you can read more about the various things it can do here:
https://github.com/Steamodded/smods/wiki/Guide-‐-Joker-Calculation
but for our purposes, we only need two contexts.
the first makes sure that what's currently happening is that cards are being played, then checks if the card is a face card, and if it is, increases the joker's pool count by one.
then later, it checks for context.joker_main which means that jokers are adding chips/mult/xmult etc etc, and adds the mult from its pool!

GitHub

A Balatro ModLoader. Contribute to Steamodded/smods development by creating an account on GitHub.

#

sorry if this was a lot

wintry solar
#

thats the old guide

graceful magnet
#

I have not touched lua I do not know what breaks it

solar eagle
#

Yeah you should use tab

#

Discord just hates formatting and changes it to spaces

solar eagle
#

cause it works

wintry solar
#

bits of it might work, but bits of it are wrong now

#

this is the updated one

plush cove
#

heya! so I'm trying to make a Joker that adds +1 free Reroll every time you go through a shop without rerolling, and it works mostly as intended, but there's one major bug that I only realized after discussing in the Cryptid server

if you have only one of these jokers, it works perfectly as intended. but if you have two of them, and you reroll, the value is subtracted from both rather than from just one

is there any way around this? besides swapping to using D6 Tags rather than a native free reroll function kekw

    remove = function(self, card, from_debuff)
        G.GAME.current_round.free_rerolls = G.GAME.current_round.free_rerolls - card.ability.extra.reroll_total
        calculate_reroll_cost(true)
    end,
    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
            card.ability.extra.win_reroll = true
            G.GAME.current_round.free_rerolls = G.GAME.current_round.free_rerolls + card.ability.extra.reroll_total
            calculate_reroll_cost(true)
        end
        
        if context.reroll_shop and card.ability.extra.reroll_total == 0 then
            card.ability.extra.win_reroll = false
            return {
                play_sound('tarot2', 1, 0.4),
                message = localize('k_nope_ex')
            }
        end

        if context.reroll_shop and card.ability.extra.reroll_total ~= 0 then
            card.ability.extra.win_reroll = false
            card.ability.extra.reroll_total = card.ability.extra.reroll_total - 1
        end

        if context.ending_shop and card.ability.extra.reroll_total < card.ability.extra.reroll_max and card.ability.extra.win_reroll then
            card.ability.extra.reroll_total = card.ability.extra.reroll_total + 1
            return {
                message = localize('k_upgrade_ex')
            }
        end
    end```
#

and here's the config if you need it

    config = { extra = {reroll_bonus = 1, reroll_total = 0, reroll_max = 10, win_reroll = true}},
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.reroll_bonus, card.ability.extra.reroll_max, card.ability.extra.reroll_total}}
    end,```
ionic verge
#

ok where can i find the lovely patch that adds the extra booster pack slots that cryptid adds

cerulean rose
#

search the repo for G.GAME.modifiers.cry_booster_packs

graceful magnet
# solar eagle ```SMODS.Joker { key = "placeholder", loc_txt = { name = "Placeh...

So if I have this right

SMODS.Joker{
    key = 'princess',
    loc_txt = {
        name = "Princess",
        text = {
            "Gains {C:mult}+1{} Mult for each",
            "scored face card",
            "{C:inactive}(Currently {C:mult}+#0#{C:inactive} Mult)"
        }
    },
    rarity = 1,
    discovered = true,
    cost = 4,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = false,
    atlas = "Princess",
    pos = { x = 0, y = 0 },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult_add, card.ability.extra.pool } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and not SMODS.has_no_rank(context.other_card) then
            if context.other_card:is_face() then
                card.ability.extra.pool + card.ability.extra.pool + card.ability.extra.mult_add
            return {
                extra = { message = localize('k_upgrade_ex'), colour = G.C.MULT },
                colour = G.C.MULT,
                card = card
            }
        elseif context.joker_main then
            return {
                message = localize { type = "variable", key = "a_mult", vars = { card.ability.extra.pool } },
                mult_mod = card.ability.extra.pool
            }
        end
    end
}

this should be functional so long as the files are all properly organized?

solar eagle
#

yeah should work fine!