#💻・modding-dev

1 messages · Page 122 of 1

steep rain
crystal willow
#

Does anyone know what I did wrong?

frosty dock
steep rain
#

help me pls

wet sand
#

its an issue with whatever your claimh.lua file is

steep rain
wet sand
#

you dont have a closing bracket

stray warren
# steep rain

I'd recommend not using Notepad to write the code, as it will probably cause you a lot of unnoticed mistakes

wet sand
#

^^

quaint latch
#

i dont understand what im doing wrong

#

it should work perfectly fine

sick sparrow
#

how to change deck's atlas

quaint latch
#

by using the atlas property

sick sparrow
quaint latch
#

hasnt the .Deck method been deprecated for the .Back one

tidal steppe
#

Is antimatter deck too strong? XD

#

my friends 1st run with it

quaint latch
# stray warren I'd recommend not using Notepad to write the code, as it will probably cause you...

Hey! Mind if i take some of your time for my issue regarding disabling discards when a specific card is selected? You absolutely dont have to but if you feel like it, id appreciate some help :)

Essentially, I'm pattern patching the G.FUNCS.can_discard method and want to check if a certain card in the selected cards has a specific key and disable the discard button accordingly without breaking other mods in the process.

These are my patches:

# Crowded Discard Disable
[[patches]]
[patches.pattern]
target = 'functions/button_callbacks.lua'
pattern = 'G.FUNCS.can_discard = function(e)'
position = 'after'
match_indent = true
payload = '''
    local has_crowd = false
    for i = 1, #G.hand.highlighted do
        if G.hand.highlighted[i].key == 'crowd' then
            has_crowd = true
            break
        end
    end
'''

# Crowded Discard Disable
[[patches]]
[patches.pattern]
target = 'functions/button_callbacks.lua'
pattern = '''
    if G.GAME.current_round.discards_left <= 0 or #G.hand.highlighted <= 0 then 
        e.config.colour = G.C.UI.BACKGROUND_INACTIVE
        e.config.button = nil
'''
position = 'after'
match_indent = true
payload = '''
    elseif has_crowd then
        e.config.colour = G.C.UI.BACKGROUND_INACTIVE
        e.config.button = nil
'''

and this is the original function im patching:

  G.FUNCS.can_discard = function(e)
    if G.GAME.current_round.discards_left <= 0 or #G.hand.highlighted <= 0 then 
        e.config.colour = G.C.UI.BACKGROUND_INACTIVE
        e.config.button = nil
    else
        e.config.colour = G.C.RED
        e.config.button = 'discard_cards_from_highlighted'
    end
  end
stray warren
#

Sorry, I haven't used lovely patches

quaint latch
#

That's alright, thank you for your time anyway blobcatcozy

steep rain
#

Does anyone know how to make your mod load multiple lua files for each individual card?

rapid swallow
#

Yall, is there a way to know when the wheel of fortune has failed?

I'm trying to trigger a joker off of it, but atm idk if anyone or any mod has already done this

steep rain
#

I need to know

rapid swallow
#

Relative from the current file

It's a lua feature, so you can find it via that

steep rain
#

But I mean like I would have multiple lua files for each joker and I want the mod to load all of them

#

How would I do something like that

rapid swallow
#

you want loadfile

#

it seems

shell tangle
#

You can also look into using SMODS.load_file(filehere)().

rapid swallow
#

oh huh

shell tangle
#

Also, NFS.getDirectoryItems(folder) might be nice, it returns a table with everything in a folder, but you'll have to set up local whatever = SMODS.current_mod.path because unlike SMODS.load, it doesn't automatically start off in your mod folder, so you'll have to include where to start.

#

NFS stands for Native File System, by the way.

rapid swallow
shell tangle
#

There's definitely a way, and I think I remember seeing someone ask before, I don't remember what the way was though.

#

Don't know how good of a solution is is, but you could probably search up "The Wheel of Fortune" and make it call a calculate with a custom context provided,

compact olive
#

hey guys, how easy is it to create the 52 cards with skins and upload them for myself?

#

( not the art part but the dev part )

nocturne estuary
#

hi, I'm trying to mod Balatro for the first time and I was wondering how I would go about adding more things (like for example a slider) to the games options menu (the "Game" Tab specifically)?
For context, I am trying to expand a mod called "IncreaseJokerCap" (by AkitaAttribute) (not for distribution, just for my own learning).
My current code looks like this:

table.insert(G.SETTINGS, base_jokers)

G.SETTINGS.base_jokers = 10

setting_tabRef = G.UIDEF.settings_tab
function G.UIDEF.settings_tab(tab)
    local setting_tab = setting_tabRef(tab)

    if tab == 'Game' then
        local jCount = create_slider({label = 'Max Joker Count',w = 4, h = 0.4, ref_table = G.SETTINGS, ref_value = 'base_jokers', min = 1, max = 9})
        table.insert(G.UIDEF.settings_tab, jCount)
    end
    return setting_tab
end

Every time I open the settings the game just closes without any errors. Why could this be?

frosty dock
#

you shouldn't really expand the game settings tab, it's bad practice

#

you should have a config tab for your mod instead

nocturne estuary
frosty dock
#

for the actual code here, what's wrong is that your inserting into G.UIDEF.settings_tab instead of the returned settings_tab

rapid swallow
compact olive
#

where do i find the textures folder?

#

in my resources folder there are no textures

#

( im on macos )

shell tangle
shell tangle
compact olive
#

ill try yeah

#
7z Balatro.app

7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.05 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,12 CPUs x64)



Command Line Error:
Unsupported command:
Balatro.app```
tall wharf
#

ok uh

#

how do i

#

code a joker

compact olive
shell tangle
tall wharf
#

i am blind

#

i just need API doc yea

rapid swallow
tall wharf
#

card.ability??

#

where can i read more about that

rapid swallow
#

its essentially the card name, except in some cases when its a name for the kind of joker (such as the hand mult jokers)

quaint latch
rapid swallow
#

? whats the ability here? 👀

quaint latch
#

lose a card slot permanently for this round for an upside

#

depending on how many slots are gone, the upside is better

#

disabling the discard and play button is just so you cant remove the card :D

zealous glen
#

You could do it directly; if you search the Steamodded code for that key you should find the code that does exactly that

#

Thanks!

tall wharf
#

programmer's art

#

i am rewriting this this is confusing

#

what's the mod that allows you to click on collection item to get it

wet sand
#

use DebugPlus and then when youre in the collection you can hover over an item and press ctrl+3

tall wharf
#

ty

#

how do i directly set mult :P

spring lantern
#

wait how are you applying mult

sick sparrow
#

how to ignore debuff from joker card?

spring lantern
#

why is it becoming 0 LOL

sick sparrow
#

like if the boss blind debuffs the card, ignore it and calculate anyway

tall wharf
spring lantern
#

LMAO

#

that's like adding 1 then multplying by 0

#

this is why most jokers start at x1 mult instead of x0

tall wharf
#

it's supposed to start at 1

sick sparrow
tall wharf
#

how do i properly directly set mult

sick sparrow
#

how to make perishable_compat on custom card to false

tall wharf
#

@spring lantern here you go

#

i could probably word it better

#

actually coding this isn't too bad apart from the lack of intellisense

#

actually i meant autocompletion

spring lantern
#

so it adds more mult on every round?

#

that seems hella busted can't lie

tall wharf
#

it just swaps the current mult with the store mult and gives x1.5

spring lantern
#

oh i think i get it

#

still really powerful for a common

tall wharf
#

i meant for it to be at least uncommon

spring lantern
#

that makes more sense

tall wharf
thorny adder
tall wharf
thorny adder
#

Wtf is that art lmao

tall wharf
#

programmer's art

#

it's fine

#

ill redraw it later

thorny adder
#

The joker gameplay is good tho ggs

sick sparrow
#

how to add unbreakable sticker? (successor of eternal sticker, attempt to replace/remove will not result that card be destroyed)

thorny adder
crisp coral
#

why do you need something higher than eternal

thorny adder
#

Yeah

#

Eternal does it already

#

You cannot get rid of eternals by any means

tall wharf
#

me when eternal 2

#

doom

thorny adder
sick sparrow
thorny adder
brisk quartz
#

so basically this is an oddly specific sticker to counter one boss blind

thorny adder
#

Making a new sticker would not solve the problem tbh

#

Its just that the dev forgot that eternal was a thing or didnt make it a thing

crisp coral
#

probably intentional

thorny adder
#

If you want to fix that, you can take ownership of that said boss blind and make it not do its effect if eternal is on the joker

crisp coral
#

cryptid's boss blinds should not be your problem

thorny adder
#

You should make your mod based on vanilla experience

#

Like

#

Make your mod for people who use only your mod

tall wharf
#

is this a better programmer art

thorny adder
#

Still pretty black and white but

#

Better

tall wharf
#

programmer art

rapid swallow
#

I got the wheel of fortune working, its a dumb hack:

      -- This joker gains +1 Mult for every failed Wheel of Fortune
        calculate = function(self, card, context)
            if context.joker_main then
                return {
                    mult_mod = card.ability.mult,
                    message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.mult } },
                }
            elseif context.using_consumeable and not context.blueprint and context.consumeable.ability.name == 'The Wheel of Fortune' then
                sendDebugMessage("Detected use of Wheel", "NijntjeCard")

                local aimed_jokers = {}

                for k, v in pairs(context.consumeable.eligible_strength_jokers) do
                    aimed_jokers[k] = v
                end

                G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    delay = 0,
                    blocking = false,
                    blockable = true,
                    func = function()
                        local succeeded = false

                        for k, v in pairs(aimed_jokers) do
                            if v.edition then
                                succeeded = true
                            end
                        end

                        if not succeeded then
                            sendDebugMessage("Wheel failed, adding mult", "NijntjeCard")

                            card.ability.mult = card.ability.mult + card.ability.extra.mult
                            G.E_MANAGER:add_event(Event({
                                func = function()
                                    card_eval_status_text(card, 'extra', nil, nil, nil,
                                        { message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } } }); return true
                                end
                            }))
                        else
                            sendDebugMessage("Wheel succeeded, NOT adding mult", "NijntjeCard")
                        end

                        return true
                    end
                }))
            end
        end
crisp coral
#

just go on the minecraft wiki and slap that bad boy on there /j

thorny adder
#

Or steal some texture pack stuff

#

(dont)

rapid swallow
#

Sorry for the spam, just wanted to post the code here in case anyone from the future wants to do a funny thing after nope

tall wharf
#

i also rewrote the description

#

t in Then should be lowercase i just noticed

sick sparrow
#

and the passive effect that runs along with love.main()?

crisp coral
#

what

sick sparrow
#

an passive effect that runs no matter what

thorny adder
#

What for

thorny adder
#

Idk I don't even think you do that but

crisp coral
#

definitely not

#

i don't see a way to truly make the card immutable

thorny adder
#

Yeah

tall wharf
#

i am going to make a spectral card just to spite that

thorny adder
#

Maybe just check if it was destroyed and if it was just spawn it back

tall wharf
#

remove any stickers but -1 hand and -1 hand size

crisp coral
#

that is dogshit id rather have my joker rental

#

sorgy

tall wharf
#

don't be sorry

#

it's all fun and games until eternal leaf

tall wharf
#

eternally renting

violet void
tall wharf
violet void
#

I put the total loss of hands there

#

should I write -1 instead?

tall wharf
#

i am not a good player but -1 makes more sense to me

dreamy thunder
#

yea -1 makes more sense

tall wharf
#

for some reason

#

maybe

#

ill change the mult to 2

sick sparrow
#

how to create consumable?

tall wharf
#

you love some programmer arrt

violet void
# tall wharf

so like if my hand would score 10x30 and I havent scaled this yet it becomes 10x1?

violet void
tall wharf
#

outright replace the mult

#

not saying i can't draw just that i want to focus on the function first

violet void
sick sparrow
#

palmface

#

how to create consumable?

cerulean rose
#

create_card

tall wharf
crisp coral
#

kinda

tall wharf
sick sparrow
crisp coral
#

can be cool if you somehow alternate between all chips and all mult

tall wharf
#

it literally just moves your mult in current to the next hand and x1.5

#

i changed it to x2

#

maybe too overpowered?

#

tho this technically discourage play to discard

nocturne estuary
#

is there a built in function for reloading the a GUI?
or is there some other way to update ui elements when a value is updated through some other means?
(example: a button sets a value, which can also be set by a slider, however the slider does not update to show said value).

violet void
#

How can I add a new property to the Card object with Hooks? Im doing it with lovely rn but maybe theres a different way

crisp coral
#

just add it to card.ability

violet void
#

this worked

tall wharf
#

is there a way to track chip and mult change lol

wintry swallow
#

wdym

tall wharf
#

like

#

listen to changes in chips and mults

wintry swallow
#

what do you need to do that for

tall wharf
#

because that's the effect i want to achieve

#

every time either one of them change trigger card effect

#

oops sorry i read that as why

weak brook
#

trying to make this joker say it unlocks with black stake but localize doesnt wanna work

#

not sure if this is a locked_loc_vars glitch or something

#

pretty sure i put in the right key, which the value is "stake_black"

frosty dock
#

i think stake descriptions are in Other

weak brook
frosty dock
#

okay I might be mistaken

weak brook
#

yeah its weird

#

I hardcoded the description to say Black Stake and just used the colors but i imagine this may be an issue for other modders who arent comfortable with doing that

shell tangle
#

I'd like to request that someone narrow down this UI issue, because it's really weird, and I can't narrow down the issue any further, it's like the check that the toggle creates doesn't exist the second time arround. I've at least narrowed it down to this section and it's reproducible, but I don't know where to go from here.

The main thing, is that it works perfectly the first time normally, but if you reload the page in any way, interacting with the toggle causes a crash because it can't change if the checkmark is invisible or visible, even though it obviously exists, as, well, you can see it still.

rare bobcat
#

How would I make a joker that makes blinds take less chips to beat?

#

And how would I change the scaling if you have a different joker in your inventory (goes from x0.5 to sqrt)

weary jungle
#

G.GAME.blind.chips for one blind, G.GAME.starting_params.ante_scaling for future blinds

#

im not sure about he scaling option

#

try looking at double scale from cryptid

tepid crow
rare bobcat
#

Would it just check all the jokers in the inventory and use a series of if thens?

#

For changing from half to sqrt?

tepid crow
rare bobcat
#

I want it so that if you have a different joker in your inventory, instead of halving the required chips, it takes the square root

tepid crow
#

oh for the first joker you mentioned?

rare bobcat
#

Yes

weary jungle
#

how do you add 1 hand for a round, like ease_discards? ease_hands doesnt work

tepid crow
# rare bobcat Yes

within the first joker's calculate, probably iterate through G.jokers checking if card.label or card.config.center_key is what you expect

weary jungle
#

im so ingrained in control s, i do it when im messaging in discord 😭

tepid crow
#

ease_hands_played
also lol

tall wharf
#

no how do i watch for scoring change lol

#

like if there is a way to do it directly i'd like to know

sturdy compass
#

I don’t believe there is in vanilla

weary jungle
#

also, 10 runes left!

tall wharf
weary jungle
#

yeah that is not in vanilla

#

that is 100% patches time

tall wharf
#

😭

crisp coral
tall wharf
#

how do i hook

crisp coral
#
function original_function()
    return variable
end

-- your code
local function_ref = original_function
function original_function()
    -- code that runs BEFORE the original function is called
    local ret = function_ref 
    -- code that runs AFTER the original function is called
    return ret
end
normal crest
#

local ret = function_ref()

tall wharf
#

ah

#

makes sense

weary jungle
#

thats a lot of lines

tepid crow
wintry solar
#

Is that actually it

tepid crow
#

(I did not bother to figure out why)

weary jungle
#

im so close

#

yet so far

shell tangle
cerulean rose
#

malverk broke

AltTexture({
            key = 'suit_planets',
            set = 'Planet',
            path = 'classic_planets.png',
            loc_txt = {
                name = 'Classic Suit Planets'
            },
            keys = {
                "c_cry_Timantti",
                "c_cry_Klubi",
                "c_cry_Sydan",
                "c_cry_Lapio"
            },
            localization = {
                c_cry_Timantti = {
                    name = 'Timantti'
                },
                c_cry_Klubi = {
                    name = 'Klubi'
                },
                c_cry_Sydan = {
                    name = 'Sydan'
                },
                c_cry_Lapio = {
                    name = 'Lapio'
                },
            }
    })
    TexturePack{
            key = 'classic_planets',
            textures = {
                'cry_suit_planets',
            },
            loc_txt = {
                name = 'Classic Planets',
                text = {
                        'Revert planet name changes'
                }
            }
    }
weary jungle
#

i have only 10 runes to go, but then i have to make them actually look nice (animations, sounds, etc.)

tall wharf
#

this might sound dumb but how do i make the card show triggger animation in hook

normal crest
#

should be card:juice_up() to make it move

#

If that's what you're referring to

cerulean rose
#

super weird that my pack doesn't apply cus it even shows the correct sprite in the texture menu, but it doesn't actually change anything

tall wharf
#

i think i am falling victim for the x y problem

#

i want a joker that watches if the score changes then adds +1 mult to itself every 2, 3, 4, ... times (the times needed increases every mult increases)

#

i got the times part but the watching score change is a bit more complicated than just card scoring i think

#

actually hold on lemme cook for a bit

sonic cedar
#

how would i play a sound effect during a joker’s message display?

#

like a sound effect plays when that message is triggered to show up

tall wharf
wet sand
#

what would be the best way to remove cards from the entire deck

tall wharf
#

maybe it counts changing both of them as a different thing

faint yacht
nocturne garnet
viscid bough
#

Okay im gonna ask this question again cuz im new to this stuff and i think i need to reword my question.

Im making a joker card that will flip the values of your mult and chips. However, im not sure how to do this, let alone put it within a joker card. Ive been searching through the wiki and source code and such but i cant seem to find and example of something like this. This is the code i have rn:

-- Flipped Joker --
SMODS.Joker {
    key = "fJoker",
    loc_txt = {
        name = "Flipped Joker",
        text = {
            "Swaps Chips and Mult values"
        }
    },
    rarity = 3,
    atlas = "R3Jokers",
    pos = {x = 0, y = 0},
    cost = 8,
    calculate = function(self, card, context)
        if context.joker_main then
            ---SWAPPING CODE HERE

            return {
                message = "Swapped!"
            }
        end
    end
}

Again, ive been searching through the wiki and cant seem to figure this stuff out. Id assume theres some way to get/set the current chip/mult values, but i cant find anything on this topic.

weary jungle
#

this is probably a patch thing

faint yacht
#

No, actually.

weary jungle
#

oh

faint yacht
tall wharf
#

actually

#

i think tracking score is easier but like

#

where scor

#

ykw good enough

wet sand
#

or is that only one subset

faint yacht
#

Or... well, I guess that may contain all the cards, not sure. Head empty, no thought.

wet sand
#

seems like it does? ig ill try

viscid bough
wintry solar
faint yacht
dreamy thunder
#

when a joker is being added to the deck, how to check if its full or not?

faint yacht
#

G.jokers.config.card_limit for actual Joker slot limit, #G.jokers.cards for amount of Jokers held.

viscid bough
tepid crow
sonic cedar
# sonic cedar like a sound effect plays when that message is triggered to show up
            SMODS.eval_this(context.blueprint_card or card, {
                chip_mod = card.ability.extra.chips,
                message = localize{
                    type = 'variable',
                    key = 'a_chips',
                    vars = {card.ability.extra.chips},
                    play_sound('hpfx_thumbsup')
                    
                },```
i thought something like this would have worked, but the sound always seems to play BEFORE the message, when i need it to play WITH it
tepid crow
#

I don't think the docs are updated, but in the latest steamodded you should be able to return a sound

weary jungle
#

time for patch #3

#

woah

#

cyber :3

#

#3

wet sand
# faint yacht That is separated into cards in deck, cards held and cards played, technically. ...

something like this should work right?lua if context.end_of_round and context.game_over then local steel_cards = {} for k, v in pairs(G.playing_cards) do if v.config.center == G.P_CENTERS.m_steel then steel_cards[#steel_cards+1] = k end end if self.ability.steel_cards == G.GAME.round_resets.ante then for i=#steel_cards, 1, -1 do G.playing_cards[i]:start_dissolve(nil, i ~= #steel_cards) end [more code here] end end

sonic cedar
#

whatever it is overwrites the preexisiting mult-chips i had set

vagrant cedar
#

Is anyone able to help me make a single custom Joker? I have no experience whatsoever, but I already made the Joker art and I know what it will do. I just want myself as a Joker.

frosty dock
edgy reef
#

that was me

orchid thunder
#

How does abstract Joker work

#

Like what is it's context

frosty dock
sonic cedar
#

it wont break anything if i take it out will it

wintry solar
#

Playing on a branch is something new

sonic cedar
#

i went too new 😔

edgy reef
#

Didn't notice I committed that lmfao

sonic cedar
#

oh phew lmao

frosty dock
#

truly on the bleeding edge

viral jacinth
#

just wondering if there is a way to change the mod name tag colour?

vagrant cedar
frosty dock
viral jacinth
#

as in, in the steamodded header? or in a seperate metadata file

frosty dock
viral jacinth
#

ahh ok ty

frosty dock
#

I suggest you switch to json metadata

vagrant cedar
#

Is anyone able to help me make a single custom Joker? I don't know how to do anything, all I know is I want a Joker that starts with xMult and then adds xMult to itself when a High Card is played

sonic cedar
#

steamodded header uses BADGE_COLOR but header is also outdated

vagrant cedar
#

I have the art for it

frosty dock
#

but this is also supported in headers

frosty dock
vagrant cedar
#

Bet, you're a g

sonic cedar
frosty dock
#

i can call if you want, whatever works for you

vagrant cedar
violet void
#

I found this in the emplace logic and... is it possible for a non-joker to end up in G.jokers.cards? 🤔

viral jacinth
open bone
#

Hey, I'm trying to get a simple "if current hand score higher than the blind's goal score" function to work, but trying to "if hand_chips*mult >.." gives me an error about trying to do arithmetics with global hand_chips- Any idea how to make it work?

weary jungle
#

what is the specific error?

open bone
#

Gonna screenshot real quick-

open bone
viral jacinth
weary jungle
open bone
#

It's not a joker admittedly

It's a voucher that gives you 5$ if your current hand reaches higher than the goal's score, so an overkill/one shot type of deal
It has been a bit complicated since it's not a joker admittedly lmao but little by little I managed to make it work, at least the basic functions of it- But now I'm stuck with this last part

Here is the function that hosts the hand_chips * mult condition, which is what just kinda breaks

#

"overkill_bonus" is just turned to true when the voucher is purchased

sonic cedar
edgy reef
#

better_calc.toml, lines 206 to 233

sonic cedar
#

right thanks

languid mirage
sonic cedar
#

i should
not have done that i think

wet sand
#

SMODS.Joker supports enhancement_gates right

#

or at least it should? in theory

tranquil gull
#

hello yall

dreamy thunder
#

hey

tranquil gull
#

been in this discord before, but it's been a bit

#

i have an Idea

#

balahtzee

wintry solar
sonic cedar
#

i fixed it

#

works properly without the 20buff now

violet void
royal carbon
#

Is it possible to generate a random number within a certain range that's also seed-based thinkvi I'm trying to make a roulette, and I wanna be sure it always hits something

teal estuary
#

oh shit, calc 2.0 is finally o-

wet sand
#

im going to go insane

sonic cedar
wet sand
#

im trying to add a card that saves you (like mr bones) and it works perfectly so all i need to do is find out how to change One line of text (the "Saved by Mr. Bones" blind ending text)

#

i think this is going to require at least one patch

viral jacinth
tall wharf
#

waaaa

#

i think i juiced it up too much

sonic cedar
tall wharf
#

i think this is plenty OP

sonic cedar
#

can it disable itself

tall wharf
#

no

nocturne garnet
#

hyperjuice

tall wharf
#

is there a context for starting the round

sonic cedar
tall wharf
sonic cedar
#

steamodded branch,,,,,

tall wharf
#

is the joker fair

viral jacinth
tall wharf
#

if you are cracked at this game you can try soloing this card

viral jacinth
#

is there a way to make a consumable make a joker both a specific edition + put a sticker on it at the same time?

#

i assume its not too bad right?

zealous glen
#

Change the edition then add the sticker

wintry swallow
#

for stickers, the Card:set_eternal, Card:set_rental and Card:set_perishable methods exist

viral jacinth
#

i was going to try make a shader that was a border+icon PNG and a gradient but that seems too hard to do? so my solution is the gradient plus a custom sticker

#

dunno if im overthinking it here but thats what i've landed on

zealous glen
#

I think making the shader do both is overthinking

viral jacinth
#

a shader for me atm looks like a really daunting task to do, but i want to make this edition for my cards

#

guess its back to aseprite for a custom sticker LOL

violet void
#

Is there a way I can check if a Joker has changed position in the Joker area as I drag it?

rough furnace
#

what are you trying to do?

violet void
sudden dew
rough furnace
sudden dew
#

for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
position = i
end
end

violet void
sudden dew
orchid thunder
#

anyone know a joker that works like abstract

sudden dew
#

If you scroll down to the list of methods for centers, one of them is called "update." it gets called every frame. You can just define your own version of it when you define your joker

rough furnace
violet void
#

I wonder how heavy that is

#

does it reduce performance or something

wintry solar
#

you can just do your counting inside your calculate and loc vars functions

sudden dew
#

Realistically I doubt it. Even if you did something crazy and got like 20 jokers, you're looping through 20 things per frame. Not hard for your computer to do at all

rough furnace
#

update does run every frame so it can cause performance issues if you do a lot, but it's probably not a big deal

sudden dew
#

I'd be worried if that number exceeded 100 maybe

orchid thunder
#

im tryign to make a joker that gives xprobability based on how many jokers there are

violet void
#

thank you both 🫡

I'll test it asap

sudden dew
rough furnace
#

I was thinking it might be possible to make a "lazy_update" that only triggers at a few times, such as, before calculation, before rendering ui box, etc.

#

might be handy

orchid thunder
rough furnace
#

just look at how abstract works

orchid thunder
#

i did but its context is just "else

sudden dew
#

Can you elaborate on what context are you looking for? When do you want this to trigger?

orchid thunder
#

I dont knwo thats why im here

rough furnace
#

probably joker_main

orchid thunder
#

i was like an oops all sixes when jokers are in the tray

sudden dew
#

I see, so you want all probabilities modified

orchid thunder
#

i tried doing that

rough furnace
#

I'm confused now

orchid thunder
#

i want a joker that can dynamiclt increse / decrese how much probabilti it is based on how many jokers

#

atlease how can i check if any joker is added or removed from deck

rough furnace
#

probably update makes the most sense

orchid thunder
#

or from the tray

rough furnace
#

oops uses add_to_deck

#

but yours changes

#

I guess you could hook Card:add_to_deck and Card:remove_from_deck

orchid thunder
#

isnt that for that card

sudden dew
#

Jokers count as cards, you just need to check if the card being added is a joker or not

#

Here's the code for oops all 6's:

When you first get it:

for k, v in pairs(G.GAME.probabilities) do
G.GAME.probabilities[k] = v*2
end

When you lose it:

for k, v in pairs(G.GAME.probabilities) do
G.GAME.probabilities[k] = v/2
end

#

So you would just replace that v*2 with whatever way you want to manipulate the game's probabilities

#

And trigger that whenever you gain or lose a joker

#

For future reference, if you open card.lua in Balatro's game files, you can search for the name if the joker you're interested in and see how it's been implemented in the real game

viscid bough
#

ive got this calculation code for a joker, and everything seems to be working fine. The only issue is that the messages colors are all orange. How do i change the color to make it red for the mults and blue for the chips?

calculation code:

calculate = function(self, card, context)
        if context.joker_main then
            if pseudorandom('NerdyJoker') < G.GAME.probabilities.normal / card.ability.extra.cc then
                if pseudorandom('NerdyJoker') < G.GAME.probabilities.normal / card.ability.extra.mc then
                    if pseudorandom('NerdyJoker') < G.GAME.probabilities.normal / card.ability.extra.xc then
                        return {
                            message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } },
                            Xmult_mod = card.ability.extra.Xmult
                        }
                    end
                    return {
                        message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } },
                        mult_mod = card.ability.extra.mult
                    }
                end
                return {
                    message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } },
                    chips_mod = card.ability.extra.chips
                }
            end
        end
    end
frosty dock
#

add colour = G.C.WHATEVER to the return table

#

e.g. G.C.CHIPS or G.C.MULT

#

also chips_mod should be chip_mod

viscid bough
#

thanks

tidal steppe
#

your nested if's cause me pain

fallen tendon
#

i mean its not even close to the monstrosities committed by local thunk

tidal steppe
#

ikr

sudden dew
#

lol

viscid bough
#

also, is there a G.C.XMULT? or would it just be G.C.MULT for both mult and Xmult

fallen tendon
#

nervously looks at card.lua

viscid bough
fallen tendon
#

a better way would be to use elseifs

sudden dew
#

Is there documentation anywhere for all the possible flags that can show up in context? Because I don't think the Joker Calculation page on the smods github shows them all

viscid bough
frosty dock
#

it's incomplete with respect to better calc / retrigger api

#

we should update it soon-ish

sudden dew
#

Is there a simple way to take ownership of all jokers to make a global change?

rough furnace
#

don't think so

zealous glen
#

like what

rough furnace
#

what do you want to do?

viscid bough
#

Anyone think i should change these values?

rough furnace
#

not sure X3 mult may be a bit much

sudden dew
#

x3 mult is wildly stronger than the other values, yeah

viscid bough
#

currently theres a 1/7 chance that it actually gives X3. But yeah maybe 2X or 2.5X?

#

the mult has a 2/7 chance also\

#

and the chips 4/7

sudden dew
# rough furnace what do you want to do?

I was thinking the most direct way to implement a certain joker feature was to make every other joker check something when it stopped being debuffed, but I decided against it

zealous glen
#

what feature

zealous glen
viscid bough
zealous glen
viscid bough
#

so should it be 7 mult?

zealous glen
#

Not necessarily

#

I was thinking more like 50 Chips, but this card does multiple things so you can adjust where the power is

viscid bough
#

just realised i was calculating chances wrong and so i was getting more XMults than i thought i should

orchid thunder
#

this did not work

night saddle
#

Im trying to add 4 bucks when discarding a face card and it shows a yellow square. I dont know how to fix this issue. Is it just colour = G.C.MONEY ?

#

idk how to compress the message so its not a wall of text. If someone knows, Ill just dm my code if there are issues

rough furnace
#

just send it

night saddle
#
SMODS.Joker {
  key = 'Foxy',
  loc_txt = {
    name = 'Foxy the Fox Pirate (RAWR)',
    text = {
      "Gain {C:money}$#1#{} each time",
      "you discard a {C:attention}face{} card"
    }
  },
  config = { extra = { money = 4 } },
  rarity = 2,
  atlas = 'AthensBaltro',
  pos = { x = 5, y = 0 },
  cost = 6,
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.money } }
  end,
  -- Evaluate bonuses for each discarded card
  calculate = function(self, card, context)
    if context.discard and context.other_card then
      -- Ensure the other_card exists and is a face card
      if context.other_card:is_face() then
        local bonus = card.ability.extra.money
        if bonus > 0 then
          return {
            money_mod = bonus,
            card = context.other_card
          }
        end
      end
    end
  end,
  -- Provide the total dollar bonus at the end of the round (SMODS-specific hook)
  calc_dollar_bonus = function(self, card)
    -- Default to the configured extra money value
    return card.ability.extra.money
  end
}```
frosty dock
#

```lua
put your code in between this so it looks nice kthx
```

tidal steppe
#

this ^

muted timber
#

guys what is colour required in

night saddle
#

thanks

frosty dock
#

why are you also trying to add the money at end of round

#

change money_mod to dollars + i think you need a message

#

colour = G.C.MONEY for the color

crystal willow
#

Alright what am I missing lol

wooden nexus
#

Progress has been made, but i'm taking a break for now

wet sand
#

how should i phrase this so that its less confusing
Iron Savior: Prevents death, destroy 1 random Steel Card for each Ante
the actual function feels pretty simple (if youre on Ante 10, itll destroy 10 steel cards [if you have that many]) i just dont know how to phrase it

frosty dock
wet sand
#

ohhh true i forgot variables exist

tidal steppe
#

How would i manipulate the pool flag of existing cards. basically i want to make a deck in which all planet cards are secret, only showing up once you have played them. this is strong so ofc ill add some negative as well such as -1 joker slot.
but ye, how can i make all planets cards secret; only add to pool after play?

orchid thunder
#

am i just an idiot why did this not work

    if G.jokers and card.added_to_deck then
        for k, v in pairs(G.GAME.probabilities) do 
            G.GAME.probabilities[k] = v*card.ability.extra.odd_change
        end
    end
    if G.jokers and card.remove_from_deck then
        for k, v in pairs(G.GAME.probabilities) do 
            G.GAME.probabilities[k] = v/card.ability.extra.odd_change
        end
    end
end,```
tidal steppe
#

i have no experience with the update function so im not sure. but can G.Jokers and add/remove be true at same time?

wintry solar
#

this absolutely should not be in the update function

wooden nexus
quaint latch
#

Adding to the if statement by adding an elseif

sturdy compass
#

Gonna bump this since it's not night time anymore lol

#

My best guess is I’m using the wrong variable for deck size? If that’s so then idk what the correct one would be

wet sand
#

youre computing card_limit - 52

tidal steppe
#

abandoned deck pop off!

wet sand
#

which cascades through the entire function

frosty dock
#

isn't this literally 3e * -0/1000 if you have default deck size

#

which evaluates to negative zero

#

also G.deck.config.card_limit can be funky

wet sand
#

you probably dont want the -1 * and you probably also want to add some base value like 1

frosty dock
#

you should use #G.playing_cards

#

the deck card limit doesn't update when adding cards in a blind until they're shuffled back into the deck

viscid bough
#

how do i change the color of text in the joker description to match a suit color?

frosty dock
viscid bough
#

Found it, thanks

sturdy compass
#

This is how I'm coming up with the equation btw

#

f(x) = the mult it should be giving

#

and if f(52) then it should be 3

wet sand
#

youre missing a power

#

between math.exp(1) and the rest of the equation where you have a multiplication

#

thats supposed to be a power

cerulean rose
#

yes, but only for jokers

#

that is until bettercalc is actually functional

sturdy compass
wet sand
#

id still recommend adding a +1 to the equation though (and reducing scaling by 1 if you want to keep the cap at 3x)

#

its not unfeasible to hit 86 cards at which point your card starts getting worse than 1x

near iris
#

does anyone know if there's a way to trigger a joker ability when a played card is retriggered (due to either a seal or a joker preferably, but if just jokers that's fine)

royal carbon
#

What exactly does the pseudorandom function output? Trying to make a roulette with some random outcomes

frosty dock
#

if you give it a min and max values, it returns an integer within those bounds

royal carbon
#

Epic 👍

sturdy compass
#

There we go lmao

tidal steppe
#

woop woop

sturdy compass
#

only problem now is it crashes when viewing from collections on the menu cuz there's no fallback for #G.playing_cards

tidal steppe
#

store that into local var, if not exist set to smth else

sturdy compass
#

Well it doesn't crash...

#

Oh found the issue with that lol

#

rogue colon

tidal steppe
#
    trigger_effect = function(self, args)
        -- all jokers are negative and rental
        -- on joker creation (be that shop or pack or other):
        -- apply negative and rental
    end

how do i in deck.trigger_effect access when joker are created?

#

printing(args) was unhelpful

viscid bough
#

How can i change the maximum joker variable? Or really what im asking is what is the variable if it is there

tidal steppe
#

i got u

    apply = function()
        G.GAME.starting_params.joker_slots = 0
    end,
sturdy compass
tidal steppe
#

aww shucks

sturdy compass
#

On the flip side, finally working!

#

The need for "approximately" kills me lmao

tidal steppe
sturdy compass
#

Off the top of my head I do not

worthy stirrup
#

I am very confused, the joker doesn't show up in the collection of jokers, am i missing something?

--- STEAMODDED HEADER
--- MOD_NAME: Yonka-Card
--- MOD_ID: Yonkagor
--- MOD_AUTHOR: [Flote]
--- MOD_DESCRIPTION: Adds Jokers based on the Yoncats

----------------------------------------------
------------MOD CODE -------------------------
local MOD_ID = "Yonkagor"

local jokers = {
    Seadrive = {
        name = "Seadrive Joker",
        slug = "Seadrive",
        config = {
            extra = {
                mult = 4, -- Updated for Joker 2
            }
        },
        spritePos = {x = 0, y = 0},
        loc_txt = {
            name = "Seadrive",
            text = "{C:mult}+#1# {} Mult"
        },
        rarity = 1,
        cost = 2,
        unlocked = true,
        discovered = true,
        blueprint_compat = true,
        eternal_compat = true,
        functions = {
            loc_def = function(self, info_queue, card)
                return { vars = { card.ability.extra.mult } }
            end,
            calculate = function(self, context)
                if context.joker_main then
                    return {
                        mult_mod = self.ability.extra.mult,
                        message = localize {
                            type = 'variable',
                            key = 'a_mult',
                            vars = { self.ability.extra.mult }
                        }
                    }
                end
            end
        }
    }
}
cerulean rose
#

your just defining a table

#

and its structure is totally wrong

worthy stirrup
#

im holding everything together by tape

cerulean rose
#

to define a joker you need to call SMODS.Joker

worthy stirrup
#

ohh

#

i might be dumb

cerulean rose
#

you need a key for your joker

#

loc_def should be loc_vars

#

loc_vars and calculate need to be in the main table

viscid bough
cerulean rose
#

yes this^

frosty dock
#

you're piecing together stuff from code made for old old steamodded^

cerulean rose
#

also please use the new header format

worthy stirrup
#

my apologies, thank you

frosty dock
#

-# though this was still the more convenient way to write code for 0.x steamodded compared to doing direct arguments

#

the frick is ```lua
SMODS.Joker:new(name, slug, config, spritePos, loc_txt, rarity, cost, unlocked, discovered, blueprint_compat, eternal_compat, effect, atlas, soul_pos)

cerulean rose
#

the fuck!?

frosty dock
#

-# we don't talk about 0.x APIs

thick panther
frosty dock
#

like perishable_compat

tidal steppe
#
if context.type == 'store_joker_modify' then
                    _context.card.temp_edition = true
                    self:yep('+', G.C.DARK_EDITION,function() 
                        _context.card.temp_edition = nil
                        _context.card:set_edition({negative = true}, true)
                        _context.card.ability.couponed = true
                        _context.card:set_cost()
                        G.CONTROLLER.locks[lock] = nil
                        return true
                    end)
                    _applied = true

following is in tag.lua. gotta work out how to apply to my deck

frosty dock
#

tags get an apply function

#

signature (as per docs) is apply(self, tag, context) where self is the tag's prototype as always, tag is the Tag object as referred to as self in the snippet you sent above, and context is.. well, context

dreamy thunder
#

how to make a joker give mult for every scoring glass card?

tidal steppe
#

i know, i am looking at tag. im asking how to have my deck trigger this when back has no apply function, and that wouldnt even work, for this isnt when the deck applies, but when jokers are created in shop

frosty dock
#

oh i didn't see the bottom part

#

you should be able to patch into create_card_for_shop to send a Back:trigger_effect with the same context

#

then you can use a trigger_effect function in your deck to catch that

#

my bad

tidal steppe
wintry solar
#

do back effects get the same contexts as tags?

tidal steppe
#

they dont even get context, only self, and args

sonic cedar
#

what's the fix to the attempt to concatenate global 'i' (a nil value) crash? it's something to do with the state events file

tidal steppe
#

this has been my biggest gripe, the diff functions get diff vars. context/G/args each contain a lot but different things, and which you have access to can determine whether your creation will be easy or hard 😅

frosty dock
tidal steppe
#

?

viscid bough
# tidal steppe i got u ```lua apply = function() G.GAME.starting_params.joker_slots...

i might have used this wrong. Im attempting to make a joker that takes up two slots (Really it just does the opposite of a negative card) Heres my code if you see an issue with it, because right now the joker slots stay the same.
code:

    add_to_deck = function(self, card, from_debuff)
        G.GAME.starting_params.joker_slots = G.GAME.starting_params.joker_slots + card.ability.extra.ajoker
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.GAME.starting_params.joker_slots = G.GAME.starting_params.joker_slots - card.ability.extra.ajoker
    end,
frosty dock
#

but they should

tidal steppe
cerulean rose
#

how to add a cryptid enhancement deck for a custom enhancement?

tidal steppe
frosty dock
# tidal steppe wdym?

if the call to trigger_effect is added, it can just pass the same table that tags would receive as context as args

#

or, variable names are arbitrary and there's nothing wrong with calling the deck argument context too

tidal steppe
#

are you saying i can do this:
trigger_effect = function(self, args)
print(context)
print(args)
end

orchid thunder
frosty dock
#

I'm saying you can do trigger_effect = function(self, context)

wintry solar
tidal steppe
orchid thunder
#

I want it to detect other Jokers getting added/removed

frosty dock
wintry solar
#

throw it in calculate then

frosty dock
#

we can add the tag contexts for decks into steamodded i think

orchid thunder
#

Ok how would I do that then

wintry solar
#

use context.buying_card and context.selling_card

orchid thunder
#

I want destroying to count too

wintry solar
#

or hook add_to_deck and remove_from_deck

#

if you put it in update, every card will increase it every frame

tidal steppe
#
-- Green Joker
SMODS.Joker:take_ownership('Green Joker', {
    config = { self.ability.extra.hand_add = 2 }
})

what am i doing wrong here? this crashes complaining about the = should be }
first time attempting take ownership

frosty dock
tidal steppe
#

ahh

frosty dock
#

second that's not valid syntax

#

specifically this ```lua
config = { self.ability.extra.hand_add = 2 }

tidal steppe
#

aight, what is?

frosty dock
#

should be this ```lua
config = { extra = { hand_add = 2 } }

tidal steppe
#

huh

#

ok

frosty dock
#

that's not how lua tables are constructed

#

you can't just put random expressions in

tidal steppe
#

that didnt work, gave 1 mult, then crashed

frosty dock
#

i should know the config structure of groker at this point

tidal steppe
#

all i know is that in the games code
elseif self.ability.name == 'Green Joker' then loc_vars = {self.ability.extra.hand_add, self.ability.extra.discard_sub, self.ability.mult}
and i want hand add to be 2

frosty dock
#
config = { extra = { hand_add = 2 } }
#

too tired for this, imma dip

worthy stirrup
#

hypotheically, can i run the SMODS.Atlas and change the photo for each card or do i just need one big photo with all the cards

tidal steppe
#

ok, thats working, guess i just need to also specify the discard. i should be able to work that out. thanks for the help 🙂

frosty dock
worthy stirrup
#

okay, just checking bc it makes my life easier

#

to be sure, the Atlas and joker's Atlas should be the same

frosty dock
#

yes

worthy stirrup
#

thanks

viscid bough
#

getting this error and i dont know why

#

line 55:```lua
local rchance = pseudorandom('NerdyJoker') * card.ability.extra.c

tidal steppe
#

card.ability.extra.c is nil
do you need self. in front?

orchid thunder
viscid bough
#

line 45 is where i defined it: ```lua
config = { extra = { chips = 50, mult = 10, xmult = 2.5, c = 10, mc = 2.5, xc = 1 } },

viscid bough
#

everywhere else i did card.ability.extra it worked fine

tidal steppe
#

huh

tepid crow
viscid bough
#

reloaded an old one

tepid crow
#

try starting a new one

#

pretty sure config doesn't reset when you reload a run for... obvious reasons

viscid bough
#

it worked! thanks

#

that makes sense

tidal steppe
#

oh ye, i just ran into that myself

dreamy thunder
#

how do i change enchancements of cards?

worthy stirrup
#

how do i do the gray text, for example how Judgment Tarot Card has (Must have room) on it

tidal steppe
#

steamodded has 34 new commits, maybe it has been fixed?

edgy reef
#

Better Calc 2 bugfixes have been merged yea

cerulean rose
#

nope, not yet

tidal steppe
#

aww

cerulean rose
#

its better but i thought there were still issues

#

oh nvm its been fixed now

edgy reef
#

There might be but no more critical issues at least

cerulean rose
#

it wasnt done yet when i last checked a few hours ago

wintry solar
#

I think all the issues from now will be stuff like message and juice up placements being wonky

tidal steppe
#

well thats why i noted 'new' cuz ive been checking often

worthy stirrup
#

is there a page on the wiki for the custom color text for the mult and chips

wintry solar
#

I'll type up some new docs for it tomorrow

worthy stirrup
#

i remember seeing it but i dont know where

worthy stirrup
#

yea, like a list of these, {C:mult}+#1#

#

oh wait

#

im blind

#

but for that, is there a name for the grey text

#

i know the Judgment Tarot card has it for the "Must have room" section

tepid crow
#

I think they're at globals.lua:345?

tepid crow
worthy stirrup
#

ohh, thank you very much

tepid crow
#

you can also just search through localization/en-us.lua and you should be able to find all the ones Thunk uses

worthy stirrup
#

oh right, didnt think of that

sick sparrow
#

made this game-breaking joker

wintry swallow
#

i made a funny challenge

#

amazing how one line of text can completely change everything

viscid bough
#

does this seem too OP?

split copper
#

that does the same as another mod

viscid bough
#

bruh
rlly?

split copper
#

i cant remember the name and ive uninstalled and installed stuff too many times

#

but theres one that takes an extra slot and gives x2 mult iirc

viscid bough
#

aha

#

but i also give +15 mult so im cooler

split copper
worthy stirrup
#

i see theres a way to see what PokerHand the player played but is there a way to see what jokers to player has

sudden dew
#

G.jokers.cards

#

G is a global variable so you can access it at any time

worthy stirrup
#

okay

#

its been a while since ive used Lua, It crashes whenever i press M

SMODS.Keybind{
    key = 'CheckJokers',
    key_pressed = 'm',
  
      action = function(self)
          sendInfoMessage(G.jokers.cards, "Yonkagor")
      end,
}
sudden dew
#

What's the stacktrace for the crash?

worthy stirrup
#

let me grab it rq

rough furnace
#

G.jokers doesn't exist

#

you probably want to check it exists

sudden dew
#

That's crazy cause I'm referencing it a bunch for one of my jokers

rough furnace
#

it doesn't exist all the timne

worthy stirrup
#

so wait, how do i check what joker the player has

rough furnace
#

like on the title screen

sudden dew
#

G.jokers is uninitialized, which is while you're getting an error

worthy stirrup
#

I am in a run, but it does also crash on the title

#

ive tried both

rough furnace
#

is it a different error?

worthy stirrup
#

let me double check

rough furnace
#

oh yeah it seems sendInfoMessage doesn't like tables

worthy stirrup
#

oh right, i should convert that to a string

rough furnace
#

also if you are just testing code you may want to checkout DebugPlus's eval command

worthy stirrup
#

I kind of want to try to keep it as "Vanilla" as i can

rough furnace
#

for development of stuff?

worthy stirrup
#

yea :3

rough furnace
#

ok

worthy stirrup
#

to check, this should work, yes?

SMODS.Keybind{
    key = 'CheckJokers',
    key_pressed = 'm',
  
      action = function(self)
        local temp = G.joker.cards
        sendInfoMessage(table.concat(temp, ", "), "Yonkagor")
      end,
}
#

it didnt

rough furnace
#

tprint or inspect are probably what you want

worthy stirrup
#

okay

sudden dew
#

Print() also accepts tables but it will probably truncate it

wet sand
#

me reading the smods example mods and theyre literally just wrong

zealous glen
#

which one

sick sparrow
#

yup, that's too many jokers (1332/9)
anyway i'm gonna use vaccum cleaner to get rid of fork bombs

tidal steppe
rough furnace
#

there is a help command

tidal steppe
#

oh nice

sudden dew
#

They're mostly less useful than the tab menu sadly

rough furnace
#

I use eval a lot

#

and watch (but I suspect mostly noone else does)

sudden dew
#

Yeah I should watch, it would save a lot of time I'm sure

rough furnace
#

I also want to see if I can make watch joker work with any type of center

tidal steppe
#

eval is very helpful thx

#

is there any doc that outlines the entire object trees of G, args, context?
there is so much simply printing/evaling any is too much

rough furnace
#

context is documented

#

running inspect(value) may result in something a bit more graspable

wet sand
# zealous glen which one

the seal example mod puts the name and text locales in a description variable which doesnt work lol

near iris
#

Does anyone know if there is a way to apply a plasma-like effect using a joker? Looks like the current mult and chips aren't part of context

mellow sable
#

adding a few & gave my seed searcher a 50% speed boost lmao

near iris
zealous glen
sudden dew
lethal pumice
#

hi all!
how do i make a joker move when a card triggers it?
i tried to recreate code from the example mod jokers' walkie talkie 2, but the actual walkie talkie wiggles when the +10 chip +4 mult triggers, while the example mod doesn't, any advice?

elder vapor
#

card:juice_up(0.5, 0.5) iirc

rough furnace
near iris
lethal pumice
near iris
near iris
sick sparrow
#

how to not activate consumable during rounds? (activating the consumable that activates booster pack during blind causes to freak out like this)

sick sparrow
mystic river
#

you're looking for a context i think, though i don't actually know what the specific context you want is called

sick sparrow
mystic river
#

yes
you want can_use to check the context

viscid bough
#

Is there a way to check if any discards have been used at the end of the round? im making a joker that does something based on this and im not sure how you check

viscid bough
mystic river
#

unzip the game's .exe file to get the source code, them look through it to see how delayed gratification does the thing

viscid bough
#

do you know what file joker code is stored in?

karmic kelp
#

working on my first joker... how do I make x2 look all fancy like with other xmult jokers?

viscid bough
#

like "This joker gives {X:mult, C:white}X10{} Mult"

karmic kelp
#

excellent

#

while I'm here I might as well ask how to pick a card from deck The Idol style

viscid bough
#

i think theres some example jokers on the wiki for both checking rank and suit

#

hold on lemme find it

#

check walkie talkie and castle i think

karmic kelp
#

that folder doesn't exist apparently

viscid bough
#

weird, i clicked the link and it also say that

#

did the example mods just disappear?

edgy reef
viscid bough
#

oh so this like just happend

#

i was confused with the fact i still had a tab open to it

karmic kelp
#

aight this should be good food to get most of the way to this joker then

viscid bough
#

nvm i found where the ability code is at

sick sparrow
# sick sparrow how to not activate consumable during rounds? (activating the consumable that ac...

oh my gosh how do i supposed to fix that thing

SMODS.Consumable {
  key = 'spectral_dumber',
  set = 'Spectral',
  loc_txt = {
    name = 'Spectral Pack Ticket',
    text = {
      "Use this card",
      "to get free",
      "Spectral Pack",
    }
  },
  rarity = 4,
  atlas = 'geriolish_1',
  pos = { x = 0, y = 1 },
  cost = 78,
    use = function(self, card, context, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.15,
            func = function()
                local key = 'p_spectral_normal_1'
                local card = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2,
                G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS[key], {bypass_discovery_center = true, bypass_discovery_ui = true})
                card.cost = 0
                card.from_tag = true
                G.FUNCS.use_card({config = {ref_table = card}})
                card:start_materialize()
                return true
            end
        })) 
        return true
    end,
    can_use = function(self, card)
        return not G.GAME.blind.disabled
    end,
}
```this thing breaks too much
karmic kelp
#

so I'm trying to make sense of the very bottom of Castle 2's code... is it basically "extending" Game.init_game_object and SMODS.current_mod.reset_game_globals?

viscid bough
#

Im attempting to make my own legendary joker that gains X0.5 mult at the end of the round if no discards were used, but everytime it scores it just say ERROR on the message, and at the end of the round, it crashes the game. Im getting this error message too:

#

heres my code for the joker:

SMODS.Joker {
    key = "roland",
    loc_txt = {
        name = "Roland",
        text = {
            "Gains {X:mult,C:white}X#2#{} Mult after",
            "defeating blind if no",
            "discards were used",
            "{C:inactive}(Currently {X:mult,C:white}X#1#{C:inactive} Mult)"
        }
    },
    config = { extra = { xmult = 1.0, gain = 0.5 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.gain } }
    end,
    rarity = 4,
    atlas = "R3Jokers",
    pos = { x = 4, y = 0 },
    soul_pos = { x = 4, y = 1 },
    cost = 14,
    blueprint_compat = true,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                Xmult_mod = card.ability.extra.xmult,
                message = localize { type = 'variable', key = 'a_Xmult', vars = { card.ability.extra.xmult } },
                colour = G.C.MULT
            }
        end
        if context.end_of_round and G.GAME.current_round.discards_used == 0 and not context.blueprint then
            card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.gain
            return {
                message = 'Upgraded!',
                colour = G.C.MULT,
                card = card
            }
        end
    end
}
#

Anyone know what this is?

#

i sorta partly copied alot of it of the wiki

#

okay so i fixed the error text in the message but it still crashes

wintry swallow
#

bringing back a demon from the past

edgy reef
#

Ah hell nah

wintry swallow
#

anyone wanted to play on the pre-1.0.1 stakes post update?

no?

sick sparrow
# sick sparrow oh my gosh how do i supposed to fix that thing ```lua SMODS.Consumable { key =...

partitally fixed with AddTag

  key = 'spectral_dumber',
  set = 'Spectral',
  loc_txt = {
    name = 'Spectral Pack Ticket',
    text = {
      "Use this card",
      "to get free",
      "Spectral Pack",
    }
  },
  rarity = 4,
  atlas = 'geriolish_1',
  pos = { x = 0, y = 1 },
  cost = 78,
    use = function(self, card, context, copier)
        --[[G.E_MANAGER:add_event(Event({
            trigger = 'before',
            delay = 3,
            func = function()
                local key = 'p_spectral_normal_1'
                local card = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2,
                G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS[key], {bypass_discovery_center = true, bypass_discovery_ui = true})
                card.cost = 0
                card.from_tag = true
                G.FUNCS.use_card({config = {ref_table = card}})
                card:start_materialize()
                return true
            end
        })) ]]
        add_tag(Tag('tag_ethereal'))
        return true
    end,
    can_use = function(self, card)
        return not G.GAME.blind.disabled
    end,
}
viscid bough
wintry swallow
#

huh did you know the logic for booster packs costing more per stake is still in the game

#

i didn't

wintry swallow
viscid bough
wintry swallow
#

%appdata%\Balatro\mods\lovely\dump

#

it's a copy of the game's source tree with lovely patches applied

sick sparrow
#

how to get every card?

viscid bough
# wintry swallow what i'd do is look at the lovely dump to figure out where it crashed

i checked and found this:

for ii = 1, #effects do
                            --if this effect came from a joker
                            if effects[ii].card then
                                G.E_MANAGER:add_event(Event({
                                    trigger = 'immediate',
                                    func = (function() effects[ii].card:juice_up(0.7);return true end)
                                }))
                            end
                            
                            --If dollars
                            if effects[ii].h_dollars then 
                                ease_dollars(effects[ii].h_dollars)
                                card_eval_status_text(G.hand.cards[i], 'dollars', effects[ii].h_dollars, percent)
                            end

                            --Any extras
                            if effects[ii].extra then
                                card_eval_status_text(G.hand.cards[i], 'extra', nil, percent, nil, effects[ii].extra)
                            end
                        end

but im not quite sure why it thinks that the ii variable isnt a number considering its set to 1

#

wait

#

yeah im stummped

sick sparrow
# sick sparrow how to get every card?

i made it but unstable

SMODS.Consumable {
  key = 'popbob',
  set = 'Spectral',
  loc_txt = {
    name = 'popbob',
    text = {
      "Use this card to",
      "get every cards",
      "(including modded ones)",
      "to your deck",
    }
  },
  rarity = 4,
  atlas = 'geriolish_1',
  pos = { x = 0, y = 1 },
  cost = 78,
    use = function(self, card, context, copier)
        G.E_MANAGER:add_event(Event({
            func = function()
                for h,_ in pairs(G.P_CENTERS) do
                    local card2 = create_card('Jokers', G.jokers,nil,nil,nil,nil, h)
                    card2:add_to_deck()
                    G.jokers:emplace(card2)
                    card2:start_materialize()
                end
            end
        }))
        add_tag(Tag('tag_ethereal'))
        return true
    end,
    can_use = function(self, card)
        return not G.GAME.blind.disabled
    end,
}
rough furnace
#

you should probably check if the set is Joker

sick sparrow
#

didn't expect to be that strong

viscid bough
# viscid bough yeah im stummped

Someone help me here, im drowning in lines of code that im too dumb to understand! I cant fully tell if the issue is on smods end or my end

#

YOOOOO I FINALLY GOT IT TO WORK

#

To think it was just because i needed to redownload smods

#

bruh

#

its scaling the card 7 times 😭

#

got it working fully finally

slow pilot
#

How does one start modding Balatro?

livid tapir
slow pilot
#

1, make.
2, Yes, because mods are fun.

#

Not quite sure which version, admittedly.

#

Well, which I have installed.

livid tapir
# slow pilot 1, make. 2, Yes, because mods are fun.

ok cool!!
To start, you should look at Steamodded's example mods, there's a bunch for whatever types of things you wanna make (poker hands, jokers, decks, etc.)
Then we can look at the wiki for more specific things like what centers are in the first place

livid tapir
#

top right

slow pilot
#

wait, right

#

me forget that

#

one sec

#

1.0.0-Alpha-1301a, if that matters any.

livid tapir
tall wharf
#

just wondering what changed

livid tapir
#

but youre mostly fine ngl so

#

i think youre good to start making your mod

#

any questions about making the mod go here
and you can make your own #1209506514763522108 post for the mod

viscid bough
#

Anyone think this seems like a good legendary?

#

(Ignore the terrible art)

livid tapir
#

also how do all of you get the legendary background art

#

like the lines

viscid bough
#

the idea came from someone on steam. Attempting to follow the whole historical jesters theme with legendarys

viscid bough
#

there you can just copy and paste anything you want to work off of

livid tapir
#

thx

tall wharf
#

that aside i thought the art said poland

#

P.oland to be exact

viscid bough
#

maybe i should thicken the R's line there actually

tall wharf
#

every time i hear Roland i think of the musical instrument manufacturer

viscid bough
#

oooookay so i tested it out and it definitely feels like legendary material. It just needs you to have a bit of mult and its great\

tidal steppe
#

how can i apply sticker(rental) to a joker?

tall wharf
#

oh hello zero

forest hinge
tidal steppe
#
    trigger_effect = function(self, args) -- can maybe do self,context? says john smods
        print("-----------------------------")
        if args.buying_card and args.card.add_to_deck and args.card.ability.set=="Joker" then
            -- print(args.card.label) --key
            -- print(args.card.edition.type) --string
            args.card.set_edition({negative = true}, true)

making negative isnt even working :/

tall wharf
forest hinge
#

I also had a q - is there some way to create a global listener type thing, essentially getting calls to calculate but not tied to having a particular joker, so that I can manage global variables in the background whether or not a particular joker has been bought?

tidal steppe
#

however this is only working on jokers from shop and not packs :/

tall wharf
#

this is how i listen to the calculation 😭 it's janky

crisp coral
#

mmm what's the particular joker in this case

tidal steppe
tall wharf
#

tho i

#

redesigned the quasi connectivity

tidal steppe
#

woo!

tall wharf
#

the joker activation seems a bit

#

too complicated

#

so i went with the non original route and

tidal steppe
#
    trigger_effect = function(self, args)
        -- working with cards from shop but not from packs
        if args.card.add_to_deck and args.card.ability.set=="Joker" then
            args.card:set_edition({negative = true}, true)
            args.card:set_rental(true)
            print(args.card)
        end
    end,

Any idea how to trigger this on jokers bought from packs?

tall wharf
tidal steppe
#

so add_to_deck triggers upon selling ???

livid tapir
#

so do i just unzip the exe (trying to get like textures and stuff

forest hinge
#

yes

livid tapir
#

thx

tidal steppe
#

mod idea: Jokers with gold sticker have a chance to spawn with red seal

storm oar
#

could be fun but also could get pretty crazy

tidal steppe
#

could someone kindly give me an example of Xmult usage in joker. just as i get to that steammodded has removed their example folder :/

#

and oddly enough i havent made any jokers with xmult yet

tall wharf
crisp coral
#

fuck

tidal steppe
#

XD

tall wharf
#

these three feels OP

#

i mean

tall wharf
#

the quasi is kind OP

merry raven
#

Is it possible to do custom card animations?
Not sprite animations, card movements like moving it around, the pulse animations, etc etc

crisp coral
tall wharf
#

don't you need shaders for that

#

mult storage is kinda cool

livid tapir
tidal steppe
#
    calculate = function(self, card, context)
        if context.main then
            local wild_count = 1
            for _, card in pairs(context.scoring_hand) do
                if card.edition.type == 'wild' then
                    wild_count = wild_count + 1
                end
            end
            return {
                -- message = localize { type = 'variable', key = 'a_xmult', vars = { wild_count } },
                Xmult_mod = wild_count
            }
        end
    end

what have i done wrong? the joker just isnt doing anything. just sitting there with silent treatment mockingly XD

timid parrot
#

I believe its context.joker_main

crisp coral
#

wild is not an edition

#

also ^^

tidal steppe
tall wharf
tidal steppe
#

oh enhancement

#

print(card.label)
print(card.ability.effect)
these both print 'Wild Card'

#
    calculate = function(self, card, context)
        if context.joker_main then
            local wild_count = 1
            for _, card in pairs(context.scoring_hand) do
                if card.label == 'Wild Card' then
                    wild_count = wild_count + 1
                end
            end
            return {
                message = localize { type = 'variable', key = 'a_xmult', vars = { wild_count } },
                Xmult_mod = wild_count
            }
        end
    end

Working!

#

or should i change it to X1 per wild card. (min 1)?
its just that X0 is uhh, bad

forest hinge
#

rather than min 1, maybe (Starts at 1X)

#

I'm trying to create the following joker: "This joker gains +4 Mult when you leave a shop without buying anything". I know how I'd check for "buying something" via context in calculate, but the issue is that this card only starts tracking once it's been bought. So for instance, if you bought a Judgement from a shop, then used it and it generated this joker, then left the shop, the joker would think nothing has been bought and would incorrectly trigger.

I figure what I'd need to do here is track the 'haven't bought anything this shop' outside of this joker and somewhere global instead, that way I can just have this joker check it and it'd always be accurate - but I don't know where I'd hook up this sort of 'calculate outside of the context of any specific joker' thing

sturdy compass
#

My mod has officially hit 50 Jokers that fully function

#

Holyyyy

sturdy compass
forest hinge
#

where is this code though?

sturdy compass
#

In calculate

forest hinge
#

this looks like its inside your joker's calculate?

#

but so if you did what I described - buy something, then spawn the joker - it'd think nothing has been bought this shop and trigger, right?

sturdy compass
#

I missed that part of it, however you could hook up a global table variable to the buy button via Lovely patches and have it be cleared every time the shop is exited. Within the calculate you'd just check if the table "== {}" or not

#

Not sure how involved that would be though

rough furnace
#

You could probably just assume that when the joker is created something has been bought

sturdy compass
#

That too

#

That's probably a lot easier lol

rough furnace
#

Alternativly you could use a lovely patch or hook to store the purchase made somewhere in G.GAME and then just check that value

forest hinge
#

it bothers me knowingly allowing an edge case to slip through

merry raven
#

What parts of the source code are responsible for rendering the display bars for Jokers and Consumables? I want to create a brand new display at the red rectangle, it would also help to know what mods do this as well

forest hinge
#

this is my first time hearing of lovely patch, I'll go look into that

sturdy compass
#

They will be your best friend if you wanna do anything with vanilla functions

rough furnace
sturdy compass
#

My guess is a card area

forest hinge
#

oh so this is just straight up using regex to modify source code huh

#

wowie

sturdy compass
#

Basically lol

#

I need to figure out making new card areas at some point too for this Astrology card idea

merry raven
rough furnace
#

yeah card area is the correct term

merry raven
#

Sick

tall wharf
sturdy compass
#

What are those debuffs lmao

tall wharf
sturdy compass
#

Oh I see

#

Redstone is scary

merry raven
rough furnace
#

not sure

#

don't use it

#

but I thought it's abilities had their own area

tall wharf
forest hinge
#

hmm, I shall apply the philosophy of "tweak the design rather than bulldoze source code" and instead say "This Joker gains +4 Mult when you enter and leave a shop without buying anything", implying that the joker needs to witness entering the shop to trigger

sturdy compass
#

There ya go

sturdy compass
tall wharf
sturdy compass
#

Cool idea but goodness just thinking about trying to do that hurts my head

tall wharf
#

just like how quasi connectivity makes you frustrated when you begin redstoning

sturdy compass
#

Lmfao

tall wharf
nocturne garnet
tall wharf
#

_card:juice_up(5,1)

nocturne garnet
#

stop juicing them up so much

sturdy compass
#

Why

nocturne garnet
#

thats alot of juice for one up

mystic river
#

that's enough juice to banter about football with two pioneer probes

tall wharf
#

(the value was 56 yesterday)

forest hinge
#

wait a minute, is there even a context hook for beginning a shop

tall wharf
rough furnace
#

those things have calculations

#

probably want to check G.STATE

rare bobcat
#

Disable suskin and reactivate chad

rare bobcat
merry raven
#

Amazing

tall wharf
#

no more balatro

#

it's minecraft

#

from now on

iron olive
#

does anyone know where the art for the game is stored? i wanted to make a graphical mod that just changes the face art for some of the cards but idrk where to start/get files names and whatnot

tall wharf
#

what's the main scoring loop in the game

merry raven
#

AAAAAAAGH

#

What the FUC

tall wharf
#

i am changing the approach to how i track score

tall wharf
#

MILLIONS MUST MINECRAFT

#

ok but WHAT did you do

tall wharf
#

then resources/textures/?x/