#💻・modding-dev

1 messages · Page 685 of 1

fading rivet
#

if so, add xmult or xchips to the calculate return table

dusty fractal
#

i think they want it to be specifically when they're next to eachother

#

right?

fading rivet
#

oh if you want them to be next to eacher

#

iterate through G.joker.cards

#

if the card found is the left or right one, check if the one to the right or left is the other card, if so, do extra stuff

#

if not, break

elder yoke
#

there are definitely mistakes in here but i don't know how to fix it.

elder yoke
fading rivet
fading rivet
elder yoke
#

i noticed that

fading rivet
#

and don't literally use yourmodprefix

elder yoke
#

Oh-

#

i thought it was necessary for it to work

fading rivet
#

like for me it would be j_foobar_miku

#

or j_akyrs_lagtrain for aiko

elder yoke
#

okay so like this?

fading rivet
elder yoke
faint yacht
#

SMODS.find_card, rather.

tacit peak
#

i tried to make a deck skin mod but it doesent show any of the textures in the deck skins menu. is this because i used the "enhanced" set? i didnt know which one means a deck skin so i assumed this was it

elder yoke
fading rivet
elder yoke
#

ok

#

alright i got good news and bad news. the good news is the game doesn't crash anymore, the bad news is that no xmult gets applied

#

heres the code of both cards.

#

@fading rivet sorry for pinging you again

slim ferry
#

youre finding "TheRightSide" when the key you put for the joker is "The_Right_Side"

elder yoke
#

Ah ty

#

lemme fix that then

#

Ey it works!

#

Alright, now to apply it to the other one

#

IT WORKS!

#

alr i wanna thank u guys so much for helping me out with this

ancient mango
#

is there a guide for dependecy formating

granite jay
#

Anyone know how to make it so legendary jokers can appear in the shop?
Cos this doesn't work fsr

slim ferry
#

the key would be "Legendary" and not 4

granite jay
#

trying that now

slim ferry
#

also idk if take ownership will work? i recall there being some jank

granite jay
#

It doesn't, ugh.

bold eagle
#

I'm currently trying to make a joker that has a chance to destroy played cards, and I think I've mashed together too many jokers from vanilla remade to understand whats going on any more so I need some help

#
local counter = 0
        if context.destroy_card and context.cardarea == G.play and not context.blueprint then
            for _, pcard in ipairs(context.scoring_hand) do
                if SMODS.pseudorandom_probability(card, 'zwp_rot', 1, card.ability.extra.odds) then
                    counter = counter + 1
                    SMODS.destroy_cards(pcard)
                    
                end
            end
            
            
        end
        if counter > 0 then
            return{
                message = "Rotted"
            }
        end
#

all of this withing calculate obviously

daring fern
silent sail
#

can someone tell me how to fix this code? currentyl it works but if i try it with a full hand it removes play size, confuing stuff


local oldhighlight = Card.highlight
function Card:highlight(is_higlighted)
    local g = oldhighlight(self, is_higlighted)
    if SMODS.has_enhancement(self, 'm_baggutro_ghostcard') and not is_higlighted and self.area == G.hand and self.config.baggutro_ghostcard_enabled then
        self.config.m_baggutro_ghostcard_enabled = false
        SMODS.change_play_limit(-1)
    end
    return g
end

local oldaddhighlighted = CardArea.add_to_highlighted
function CardArea:add_to_highlighted(card, silent)
    if SMODS.has_enhancement(card, 'm_baggutro_ghostcard') and self == G.hand and not card.config.baggutro_ghostcard_enabled then
        card.config.baggutro_ghostcard_enabled = true
        SMODS.change_play_limit(1)
    end
    return oldaddhighlighted(self, card, silent)
end

local oldcardarearemovecard = CardArea.remove_card
function CardArea:remove_card(card, discarded_only)
    if Card.is(card, Card) and card.config.baggutro_ghostcard_enabled then
        card.config.baggutro_ghostcard_enabled = false
        SMODS.change_play_limit(-1)
    end
    return oldcardarearemovecard(self, card, discarded_only)
end
bold eagle
#

like, not every played card but it rolls for each one

bold eagle
#

sweet

#

thank you so much

fading rivet
frosty dock
solemn wharf
#

hiii im working on a joker that creates a negative soul card every time a lovers card is sold, but for some reason this error appears, could anyone help me?

frosty dock
#

it does have context.card

solemn wharf
#

yes but there is no context.selling_consumeable right?

#

i mean how can i write it

daring fern
solemn wharf
#

oooh right

#

sorry im still new to modding

#

yep that works thanks so much

#

ok now i got a new error, this happens when all the 3 lovers cards have been sold and the game is trying to create the negative soul card

#

so this part of the code

#

:/

normal crest
granite jay
solemn wharf
normal crest
#

You should do that before the events

solemn wharf
#

ok i set it to 0 and now it works

#

thanks so much

#

:)

ancient mango
#

why did it crash

fading rivet
#

I just know one of the cards lets legendaries appear on shop

granite jay
#

Deck of equillibrium?

fading rivet
#

thats in cryptid

#

but yeah that works too

fast moss
#

im getting this error and im not sure why, it stemmed from me attempting to add this joker and rarity (let me know if you need anything else to help solve)

#

and if i ignore the rarity and just set it to legendary, this happens when i play a hand

rapid stag
#

does anyone know a way to get negative cards to appear in the deck?

frosty dock
#

you also don't need to have a separate pool for your rarity

fast moss
#

oooohhhhhhhh okay lemme try that in a sec

fast moss
primal robin
#

Why collection_loc_vars exist only for blinds WHAT A HELL DUDE

slim ferry
#

because

#

Blinds are the only thing that need it

#

Well they dont really but thunk decided to do that

#

The whole blind collection is janky anyway

frosty dock
#

blinds aren't cards so they're of course weird

primal robin
#

bruh

#

How I supposed to extend vanilla joker loc_vars then

#

like I want keep vanilla one but just alter collection

#

theres no way I need literally copy vanilla loc vars, this sucks like hell

frosty dock
#

i think you can grab the vanilla loc vars result somehow

#

however i don't remember how

primal robin
#

man, what a lame, what a hell

#

Anyway... erm

frosty dock
#

local vars, main_start, main_end = card:generate_UIBox_ability_table(true)

#

there

primal robin
#

what a hell s this MP match btw

#

that's crazy

frosty dock
#

that is insane

primal robin
#

looks like someone really suck at UI

#

So like this will work right?

frosty dock
primal robin
#

Umazing

fast moss
#

its the best feeling ever

flint spindle
#

how do you modify the rarity of the Soul? Either with a joker or voucher or tag or anything

frosty rampart
#

you have to use a patch i think, last i check it was very hardcoded

#

iirc not even taking ownership of it works

flint spindle
#

dang

flint spindle
#

Is there a way to check if a specific voucher is redeemed, like some function that returns a boolean maybe?

true jasper
flint spindle
#

TYTY

#

last thing, how do I get the cost of the current booster pack when I'm in context.skipping_booster?

flint spindle
#

TYTY

flint spindle
#

I'm trying to make a voucher that does the showman thing when redeemed, but this doesn't do anything. Somehow, this voucher doesn't do anything, and Showman still does the effect despite me overriding it and removing the function there. How is this even possible

daring fern
#

Also it should be v_modprefix_key

bold eagle
#

do modded tarots have the same weight as vanilla ones?

frosty rampart
#

by default, yes. but if you opt into the new weight system (it's an optional feature), you can set individual consumables to be rarer or more common than usual

bold eagle
#

ooh

#

how do i do that

#

or will it break other mods

frosty rampart
#

won't break other mods, don't worry. it's an optional feature only because it adds more calculation contexts that might be heavy on performance, so smods will only do that for mods that actually need it
just enable the object_weights optional feature, and then add weight = X to whatever object you want to define
10 is the default weight
https://github.com/Steamodded/smods/wiki/Weight-System

GitHub

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

bold eagle
#

cool, thanks

flint spindle
daring fern
bold eagle
#

wdym by that

daring fern
# bold eagle wdym by that

The cards that show up will be different from the cards that show up on the same seed without object_weights enabled.

bold eagle
#

ah

#

gotchu

#

thats probably fine

daring fern
flint spindle
#

how?

#

sorry if I keep asking for stuff this has just been really frustrating

#

but like I have no clue what entails "patching" something like that

#

do you just mean like overriding it or going into smods and changing it?

#

or something else?

flint spindle
#

Holy shit thank you

vivid mesa
meager oracle
#

is there any documentation on emult? its not in the normal attributes tab

daring fern
meager oracle
#

oh mb i thought someone said it was baseline now

#

are you perchance making a kamsandwich mod

silk latch
meager oracle
#

eh close enough

silk latch
#

but Hybrid is there

silk latch
#

I tried to make this blind remove enhancements from played cards by just copying shit from Vampire, but it's not doing anything.

sturdy compass
#

You would likely hook SMODS.add_to_pool and check if an object is from your mod (if prototype_obj.mod and prototype_obj.mod == 'YourModID' something along those lines)

This is a little advnaced for a new modder though

fringe oxide
#

why are my cards going the wrong way?

near coral
#

How do you change the selection limit on a specific blind

daring fern
near coral
#

So basically when selecting blind enact the change_play_limit to 3 but change it back to 5 upon defeating it or losing

#

Is that right or am I missing something

daring fern
near coral
#

Alright

tulip pecan
#

How do I give a message to every joker in the joker area? This is my current code that currently does nothing, and so I'm sure I just don't know how to set up events properly

function Uma_Tact_refresh()
    for k, v in ipairs(G.jokers.cards) do
        if v.config.center_key == "j_uma_tact" then
            v.ability.extra.current = (G.GAME.uma_global_counts.spread + G.GAME.uma_global_counts.bloom) * v.ability.extra.increment

            G.E_MANAGER:add_event(Event({
                func = function()
                    return {
                        message = "test message",
                        card = v
                    }
                end
            }))

        end
    end
end
daring fern
grizzled tide
#

does anyone know how to hook onto loc_vars? I'm not too familar with hooking SMODS.Joker functions

tulip pecan
analog geode
#

any ideas how to get the level of the lowest level hand?

daring fern
near coral
#

Is it possible to pin every joker to their current position, the pinned thing says the leftmost specifically and I wanna know how strict it is

daring fern
near coral
#

So it has nothing to do with the pin thing?

daring fern
near coral
#

Okay

#

Makes sense since it's only ever used for one challenge

coral flume
#

How do I get the consumeable currently being used?

daring fern
coral flume
daring fern
coral flume
#

Ah cheers

#

This crashes because the random element is returning nil. any idea why?

  local planet_pool = get_current_pool('Planet')
  local planetchoice = psuedorandom_element(planet_pool, "seedyseedseed")
#

I GOT IT

#

I can't spell lol

frosty dock
#

psuedorandom

coral flume
#

Yehhhh I just went, "hey wonder if i'm spelling this wrong" and low and behold

ancient mango
analog geode
coral flume
#

I'm trying to make a card return to hand if played. Is there a way to do this?

daring fern
coral flume
#

You legend

sly heron
daring fern
sly heron
#

Thx, it works

glacial idol
#

Hey guys— where can I get my mod uploaded to BMM? I found the BMM index form, but when adding the release .zip GH link I get an error asking me to “use a download link”

Is there any other form / alternative way?

distant junco
split saddle
#

I want to make a texture pack that replaces the tarot artwork. How can I change the tarot's atlas to mine?

sly heron
vale grove
#

whats the correct way of making a consumeable only usable when in a blind?

rapid stag
#

regardless, the correct way would be to ensure that can_use only ever returns true during the precise conditions that you want to use it.

vale grove
#

i know but im not sure what the correct way to check if youre in a blind or not for a consumeable

#

bcs i want this consumable to halve the current blind score needed

rapid stag
#

hmmm

vale grove
#

ive already looked up how to do it for a joker bcs a mod i like does something similar

#

but directly translating that to consumeable logic doesnt work sadly

rapid stag
#

well if you're using the newer releases of steamodded, that specifically should be easy by using 0.5 xblindsize in the consumable's use function

vale grove
#

uhh

#

i updated like a week ago

#

i had issues with levelling that was fixed in newer versions so i decided to update it

vale grove
silk latch
vale grove
rapid stag
# vale grove how does blind size work?

from what i understand, it's basically the same as chips/mult/xchips/xmult/etc. that jokers do

you could probably do smth like SMODS.calculate_effect({ xblindsize = 0.5 }, card) in your consumable's use function?

vale grove
#

oh that actually works

#

wowie

#

but im still a little confused on how to get the can_use correctly

rapid stag
#

is during a blind the only condition where you want the consumable usable?

vale grove
#

every consumable ive looked at from other stuff has a different context check which makes sense

rapid stag
#

you could probably trry

can_use = function(self, card)
  return G.STATE == G.STATES.SELECTING_HAND
end
vale grove
#

yeah that works

#

thanks\

slim ferry
rapid stag
#

right, forgot about that. return that from your can_use function instead

elder yoke
#

Can anyone please help me? I have been making a joker that gives xmult if the poker hand is a high card, but instead it will always give xmult for every poker hand. Does anyone know how to fix this?

vale grove
#

if context.joker_main and context.scoring_name == 'High Card' then

#

try that

vale grove
#

ye

#

thats what I use for something similar

elder yoke
#

alright, let me see if it works

#

No it still applies it to all joker hands

elder yoke
vale grove
#

nws nws

#

idk you could try simplifying it a little bit

#

like why do you have card.ability.extra.type?

elder yoke
vale grove
elder yoke
#

Im still trying to learn code so i didn't know what each line of code exactly does.

vale grove
#
        if context.before and not context.blueprint and context.scoring_name == 'High Card' then
#

i just have this

#

which then triggers a line that scales itself with chips mult and xmult

#
        if context.joker_main then
            return {
                chips = card.ability.extra.chips,
                mult = card.ability.extra.mult,
                Xmult = card.ability.extra.Xmult
            }
        end
#

and then this block which actually applies it all

#

so im not entirely sure why your stuff doesnt work

elder yoke
#

Should i send some footage of the card in action?

#

maybe that could help

vale grove
#

well you just said it always triggers right?

elder yoke
#

Yes

vale grove
#

id say try to simplify it

elder yoke
#

How do i do that?

vale grove
#

remove everything that isnt necessarry for a MVP (minimal viable product)

#

basically id say

vale grove
#

remove mult

#

if youre only doing xmult

#

in the loc_vars

#

wait

elder yoke
#

wait wait

vale grove
#

i just realised you have two loc_vars?

elder yoke
#

i just realised that to...

#

this is the second time something like this has happened-

vale grove
#

haha no worries

#

we all make mistakes

#

but to help simplify

    config = { extra = {
        chips = 6,
        mult = 7
    },

    },
    loc_vars = function(self, info_queue, center)
        return { vars = { center.ability.extra.chips, center.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chips,
                mult = card.ability.extra.mult,
                message = 'MANGO',
                sound = 'YA_Mango',
                colour = G.C.MULR
            }
        end
    end

heres an exmple of something i use

#

ignore the corny joke

#

but

#

if you do something very simple liek this

#

and change the context check to have lua context.scoring_name == 'High Card'

#

i think that would work

vale grove
#

Ive had that tyoo

#

since it's inception

#

its part of the code now

slim ferry
#

amazing

vale grove
#

I think if I remove that I'll explode

elder yoke
#

alright i am not sure if this is correct so if it's not please let me know what i need to fix

vale grove
#

you don't need chips

#

and the "Lua" was me typing something incorrectly

#

oh and change center ability extra mult to xmult

grizzled tide
#

is there a function to set the soul sprite? I know there's set_sprite_pos for the regular card sprite

elder yoke
slate turtle
#

hey is any1 willing to help me iwth a sprite

vale grove
#

yeah I think so

elder yoke
#

okay, let me see if it works

#

It works!

#

tysm so much for the help! (and putting up with my stupidity-)

vale grove
#

nah dw

#

I remember when I was in your shoes a few months back

elder yoke
#

I've been trying to make my own little mod so being able to ask here for help has saved me a lot.

slate turtle
silk latch
#

I tried to make effectively a boss blind version of Vampire, but it's not working for some reason? Am I missing something?

vale grove
#

I was/am in the exact same boat

#

Im making an inside joke mod for my college

elder yoke
#

oh so for friends and classmates?

vale grove
elder yoke
#

That's pretty cool, i hope they enjoy it!

vale grove
vale grove
elder yoke
split saddle
#

i'm just waiting for someone who could know the answer to read my message ig

vale grove
#

and I will release It publicly after removing their faces from the sprites

#

to not dox anyone

elder yoke
#

I am actually trying to make a TF2 mod! I saw there wasn't a mod for it so decided why not make one for it?

vale grove
#

oh hell yeah

elder yoke
#

You actually just helped me fix the code for the direct hit joker!

vale grove
#

I was considering doing something similar but for persona

#

one of my favorite game series

#

and i still might but I'll have to see

#

I'm def gonna wait until 1.1 for that

elder yoke
#

these are the jokers i got finished rn! (This is a test mod i use for testing thats why there are Cotl cards in there to)

vale grove
#

the spies are really funny

#

or

#

spy

elder yoke
#

U mean the red and blue ones?

vale grove
#

yes

#

are there any other spies?

elder yoke
#

I like all 3 of them, i think i did pretty well on them! Did get some advice on the spy coat and it def looks better then the old versions

elder yoke
vale grove
#

I'm not looking forward to spriting my mod for the public version

#

def my worst quality

elder yoke
#

Those 2 spies actually work together in an fun way! one gives chips and the other mult, but when together they give xchips and xmult!

elder yoke
#

i believe you can make some good card art!

vale grove
#

none of the art I currently have is made by me lmao

elder yoke
#

actually i got a question i want to ask regarding a joker card idea i got.

vale grove
#

I have some art friends who usually do it for me

#

sure

elder yoke
vale grove
#

i have this one

#

thats cloverpit inspired

elder yoke
# vale grove sure

Okay, so i want to make a joker that gives +2 chips for each chips obtained from playing cards. so if you play an ace you gain +22 chips once all playing cards are used in hand.

elder yoke
vale grove
#

i think

#

you can just get the id and do it X2

#

bcs ace ID = 11

#

so if you do something card_chips = card:id X2

#

that should work

#

although

#

that line i just typed wont work

#

bcs thats not how to correctly call it

#

but that idea should work

elder yoke
#

Okay then, i wanted to just know if it was possible but thanks!

vale grove
#

oh with programming

#

usually the sky is the limit

#

i have a deck that allows you to play the daily wordle

elder yoke
#

the joker would be for the black box, though i do not have the card art for it yet.

vale grove
#

yeah

elder yoke
#

tbh that's kind of funny

vale grove
#

its one of my proudest creations

#

im really happy with how it turned out

elder yoke
#

tbh u should've called it "Joker with a typewriter"

vale grove
#

hmm

#

i could do thta

elder yoke
#

cus funny

frosty rampart
#

i love how many times people have independently made "wordle in balatro"

elder yoke
#

Actually i have one more question!

#

how would you share your mods with github exactly?

elder yoke
#

i want it to share it with someone so they can try it themselves.

vale grove
elder yoke
elder yoke
vale grove
vale grove
frosty rampart
# vale grove oh really?

off the top of my head ellestuff has a wordle joker (using canvassprite to render on the joker and it reads your keyboard), and aikoyori's shenanigans has wordle as a boss blind (because the mod lets you attach letters to your playing cards)

vale grove
#

im honestly really happy with how mine works

#

allowing you to actually play it

#

fetching the daily wordle

#

and then taking the first letter of your joker and using as if youre actually playing

vale grove
meager oracle
#

does anyone know why this doesnt work 😭

            G.E_MANAGER:add_event(Event{
                        func = function()
                            play_sound('prefix_musictrack')
                            return true
                        end
            })
        end```
idle plaza
meager oracle
#

its not

#

thats js like

#

yknow

#

for formality

idle plaza
#

You do need to put your mod's actual prefix in the string for whichever custom sound you're calling.

meager oracle
#

i know its js for discord 😭

idle plaza
#

Anyways, is that your whole calculate function? Or is there more before that? This little snippet of code looks fine as long as the correct string is in the play_sound call.

idle plaza
meager oracle
#

yeah its the only thing in calculate

#

it gives an attempt to perform arithmetic on field 'dt' [a nil value] error

idle plaza
#

Could you show a screenshot of the actual error message?

meager oracle
#

trying to get the txt file but discords being weird

idle plaza
#

Okay, so I'm getting an idea of what's going wrong here. This file is actually supposed to be music, is that correct? It seems like music isn't meant to be played through play_sound

Have you looked through https://github.com/Steamodded/smods/wiki/SMODS.Sound ? Because determining when a music track is or isn't meant to be played, should be controlled within select_music_track(self) in your music's SMODS.Sound table.

meager oracle
#

oh okay

#

yeah i missed that part

#

ty

idle plaza
#

yw

rapid stag
#

how do i get the current stake cirThink

long sun
#

how can i get a list of all deck centers?

#

[besides looping through G.P_CENTERS]

#

[if that's possible]

frosty dock
split saddle
#

I want to make a texture pack that replaces the tarot artwork. How can I change the tarot's atlas to mine?

long sun
long sun
#

^^^^^^

#

[malverk is so handy]

#

[[handy is so cartomancer]]

#

[[[cartomancer is so malverk, bringing us full circle]]]

frosty dock
#

lmao

split saddle
#

ok i'll check it out

frosty dock
#

[[[cartomancer is so galdur]]]

#

[[[[galdur is so malverk]]]]

split saddle
#

ty

long sun
#

[talisman is somewhere else on the graph doing its own thing]

frosty dock
#

(insert joke about talisman being mid)

rapid stag
frosty dock
#

set a flag when the stake is applied and check that

rapid stag
#

oh right, stakes apply previous stakes

umbral zodiac
#

stakes → steaks

rapid stag
frosty dock
rapid stag
# frosty dock yeah

...SMODS.GameObject.apply or SMODS.Stake.apply? girldmDizzy
-# although probably apply_to_run cirLost

ancient mango
#

can someone help me figure out what theses would do ( and what to call them)
also if you overlay both thats just makes normal jimbo

normal crest
frosty dock
#

actually I should check something

frosty dock
#

flags are still preferred for uniquely applying an effect for the stake elsewhere

silk latch
maiden phoenix
maiden phoenix
frosty dock
#

I guess that means I do more than I don't

wintry solar
#

no you don't more than you do

frosty rampart
frosty dock
wintry solar
#

but every don't contains a do, no?

#

or does it not find partial matches?

frosty dock
#

nah it doesn't count partial matches

wintry solar
#

why does it find this one

frosty dock
#

because it's weird

#

verb forms normally count but contracted negations maybe don't?

#

yeah that checks out

#

i can a lot more than i can't, apparently

silent sail
#

can someone tell me whhy this still gets destroyed when eternal?

candid walrus
#

where can i find the code thats run when the start run button is clicked after selecting deck ect

frosty dock
candid walrus
#

tyyyy

fading rivet
#

how do I get the ante's boss blind

#

nvm i found it

slate turtle
#

question is an

#

y1 here willing help me w/ some sprites for my mod

warped leaf
#

I could be willing

fading rivet
#

How do I set a variable when a run starts?

silk latch
slim ferry
#

unrelated to it not working but you should just use card.vampired instead of a new variable

#

since vampired is already used pretty much everywhere to check if a card is going to have its enhancement removed

gilded narwhal
#

hey is there a defined context for when a card is enhanced to a specific enhancement

frosty rampart
#

no, but you can use context.setting_ability with some extra checks

rapid stag
#

aure, give context.setting_ability before and after ability tables of the set card and my life is yours!

#

-# i could probably make that happen myself though, i just wanted an excuse to do this bit

frosty rampart
#

i mean
you do get the after, through context.other_card

#

any particular reason you need the before?

rapid stag
#

i have a joker that increases the given dollar value of gold cards, but when you set ability, it resets the entire ability table, so normally you can't combo that joker with smth like midas mask, which is part of the intent of that effect

the way i solve this is via a patch that makes midas mask only make face cards that aren't already gold cards, gold cards, but it's not a fix that i'm particularly happy with cirBlech

frosty rampart
#

did you see context.unchanged exists in context.setting_ability

#

so you can avoid applying the increase if you're converting a gold card to a gold card

rapid stag
frosty rampart
#

see if midas mask changed a gold card to a gold card
you can do that. with context.unchanged.

#

along with checking if context.new is "m_gold"

wintry solar
#

nah they can't access the old values

frosty rampart
#

i guess i'm just not getting the issue, sorry lol

wintry solar
#

joker scales gold card to +4, later midas mask changes +4 gold to +3 gold, no way to set back to +4

rapid stag
#

wait, this looks like it would be a really easy PR, now that i take a sec to look

would it not be appropriate to make the old_center here accessible as part of the context table?

daring fern
rapid stag
#

if i increase a value in the ability table of an instanced card, and try to enforce that change by trying to access that prior value before it gets reset via set_ability, i can't do that via the prototype centre

wintry solar
#

you can't do that with the old center either

rapid stag
#

i see. so the only option would be to do something like put copy_table(self.ability) into a local variable and pass that as part of the context table?

sharp mural
#

hello chat i know NOTHING about modding or coding but i made a card skin pack (just replaces default faces + number card colors) using a mod template. but i was trying to make it so it added a new card skin so i could do high contrast and low skins (and looked at other card packs to see what lua code they used) and i got in the game!! but 1. it wont change the number card colors to my new skin? 2. it adds a gradient to hc cards which ik is in the game code already but id like it not to be if possible. does anyone know anything about why its doing this (#1) or how i can stop it doing this (#2)

silk latch
fading rivet
#

Anyone know why passing in data for an infoqueue via {set = "custom_set", key = "custom_key", vars = {some table}} results in a name displaying but not a description, but it does work if I do this for vanilla objects?

#

it wasn't even working with the Other set

near pagoda
sturdy compass
#

It looks actually pretty close to good, but I would move the check to start juicing after you add to the "destroyed" variable instead of its own context

near pagoda
#

Makes sense just changed it

#

Oh shi your youtube tutorial helped me a lot i just realized who you are!

formal vessel
#

so the smods wiki shows the sounds for the soundtracks, but i dont see the other sounds like xmult, gaining a tag, etc, does anyone have a list of those sounds

faint yacht
formal vessel
#

thx

silk latch
rapid stag
#

i've been bashing my head into a wall with this. it keeps occasionally eating editions/seals and i can't work out for the life of me why. so far it seems to consistently be holographic as the clip shows.

help girldmDead

near coral
#

How is it that mods with custom non-boss blinds don't make the ante go up when defeated

near coral
# near coral How is it that mods with custom non-boss blinds don't make the ante go up when d...
SMODS.Blind({
    key = 'tinyblind',
    atlas = 'BZR_Blinds',
    pos = {x=0, y=1},
    --boss_colour = HEX('00b99f'),
    config = { boss = false },
    mult = 0.75,
    dollars = 2,
    small = {min = 1},
    ignore_showdown_check = true,
    in_pool = function(self)
        return false --G.bizarrtro.is_running
    end,
    set_blind = function(self)
        self.boss = false
        --G.GAME.blind.boss = false
        G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 1.0,
                blockable = false,
                func = (function()
                    G.GAME.blind.boss = false
                    G.GAME.round_resets.blind.boss = false
                    G.GAME.last_blind.boss = false
                    return true
                end)
            }))
    end
})

--[[SMODS.Blind:take_ownership('bzr_tinyblind', {
    key = 'tinyblind',
    atlas = 'BZR_Blinds',
    pos = {x=0, y=1},
    --boss_colour = HEX('00b99f'),
    mult = 0.75,
    dollars = 2,
    small = {min = 1},
    ignore_showdown_check = true,
    in_pool = function(self)
        return G.bizarrtro.is_running
    end,
    set_blind = function(self)
        self.boss = false
        --G.GAME.blind.boss = false
        G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 1.0,
                blockable = false,
                func = (function()
                    G.GAME.blind.boss = false
                    G.GAME.last_blind.boss = false
                    return true
                end)
            }))
    end
})]]
#

Here is one from my mod, it for some reason makes the ante go up when defeated despite me seeing what I believe is stuff meant to not do that

wintry solar
#

Have you done any patching to make this work?

primal robin
mystic river
primal robin
#

This thing hard to time properly

formal vessel
#

so ive got this joker that gives x1 mult when hearts are played, how do i make it play the xmult sound and show the X1 Mult thingy above the card on trigger

daring fern
wary moth
#

How would one customize the process the way the game interprets what poker hand you are playing?
Such as the Four Fingers and Shortcut effects, but, doing your own custom stuff, like, "all hands are pairs" for example

daring fern
formal vessel
#

i assume i change colour = colour to smth else, but idk to what

wary moth
wintry solar
daring fern
formal vessel
silk latch
#
SMODS.Blind {
    key = 'supernova',
    atlas = 'mannpowerblind',
    pos = {
        y = 11
    },
    boss = { min = 3, max = 10 },
    boss_colour = HEX('ED712B'),
    calculate = function(self, blind, context)
        if context.before and not context.blueprint then
            local enhanced = {}
            for _, scored_card in ipairs(context.scoring_hand) do
                if next(SMODS.get_enhancements(scored_card)) and not scored_card.debuff and not scored_card.vampired then
                    enhanced[#enhanced + 1] = scored_card
                    scored_card.vampired = true
                    scored_card:set_ability('c_base', nil, true)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            scored_card:juice_up()
                            scored_card.vampired = nil
                            return true
                        end
                    }))
                end
            end
        end
    end
}

help it doesn't work

lyric wadi
#

is there a way to manipulate the rarity value of a card

silk latch
#

wait no it does

silk latch
#

it just doesn't do editions and shit

lyric wadi
#

like not the rarity tag value, but like actually changing the weight of it getting polled

#

i wanna make a card slightly more common than the common rarity without defining a new rarity and shifting everything around, if that's possible

daring fern
lyric wadi
#

and can that value be manipulated or is it a static config

daring fern
mystic river
lusty marten
#

How to change the rank of the first discarded card to ante?

#

ex: K --> ante 13

daring fern
# lusty marten ex: K --> ante 13
if context.discard and #context.full_hand == 1 and context.other_card == context.full_hand[1] and G.GAME.round_resets.ante <= SMODS.Rank.max_id.value and G.GAME.current_round.discards_used == 0 then
    local rank = 'Ace'
    for k, v in pairs(SMODS.Ranks) do
        if v.id == G.GAME.round_resets.ante then
            rank = v.key
        end
    end
    return {func = function() SMODS.change_base(context.other_card, nil, rank) end}
end
lyric wadi
#

when enabling optional feature, can you enable it specifically for objects that utilise it, or is it just enabled as a mod setting for the entire mod

mystic river
#

it's for the entire mod
it doesn't really work otherwise

lusty marten
lusty marten
# daring fern Yes.

Thanks for the confirmation. to be more specific, i'm trying to make the joker transform the first discarded card's rank to the ante level (if it has only 1 card on the first discard)

#

is it posible?

#

ex: the first discard is K , so the ante will go to 13

lyric wadi
#

aw man

#

but then it's gonna create rng parity :(

daring fern
frosty dock
gilded blaze
#

you asked for the first discarded card's rank to become ante number according to the example, but the other way around in the actual description

lusty marten
gilded blaze
#

we share the same mother tongue btw balatrojoker

#

heck, even the same first name

teal grotto
#

how do i make a joker like

#

draw something on the screen

lusty marten
#

how can the jimbo speak when player choosing mode to play?(Like choosing mode on Cryptid mod)

bright crane
#

Is there a way to create a booster pack so that it only contains a subset of a certain consumeable type? An example using Vanilla Tarots would be having a booster where the pool is only the tarots that give enhancements, without creating a separate consumeable type

sly heron
primal robin
#

6 screenshots of code in notepad++ is crazy

primal robin
#

I'm working on it

formal vessel
#

how do i do a description w/ multiple lines "description": "This mod adds random ideas I have",

lyric wadi
#

what are the args in juice_up

#

is it x scale and y scale

#

or like scale and rotation

hardy vessel
#

How can I get the x and y pos that a joker uses for its atlas sprite?

rapid stag
#

<@&1133519078540185692>

true jasper
primal robin
rapid stag
#

thank you! i'll see if this solves my issue

primal robin
#

also I'm pretty sure that noFlipping check should be applied for each card individually and not for consumeable right

sly heron
primal robin
#

@rapid stag is things going well now?

rapid stag
#

haven't looked into it yet, i've been tending to other things girldmDead

primal robin
#

Okay

#

feel free to dm me if you want/need help

near coral
fading rivet
near coral
#

Big blind

fading rivet
#

okay

fading rivet
#

then you need to patch things like this to also check for you blind

near coral
#

There is no instance of blind: get_type in the blind's code

fading rivet
fading rivet
#

that was the wrong reply

near coral
#

Blind.boss is false but there isn't any instance of blind:get_type in there

fading rivet
near coral
#

For the sake of saving time can you fiddle around with the code to find out if all that works

#

Seeing as my coder operates daily rather than immediately

silk latch
#

I have this blind (and a version that just discards the selected card) but neither one actually does anything

near coral
fading rivet
#

no I can't tell you what im doing

#

sorry

#

jame stuff

near coral
#

It'd be better if you use an example that isn't confidential

fading rivet
#

i don't have an example that isn't confidential 😭

fading rivet
#

if you wait a month or so I can help smiles

near coral
#

Since you can't reveal details

near coral
fading rivet
near coral
#

Alright

fading rivet
#

tell him to look into the cash_out button_callback and the end_round state_event

near coral
#

So in short:
Include blind:get_type()
Include these 2 things in the images
And look into the cash_out button_callback and the end_round state_event

fading rivet
#

👍

near coral
fading rivet
near coral
#

Oh

fading rivet
#

not blind.lua

near coral
fading rivet
#

"functions/state_events.lua"

near coral
#

Oh I didn't see that part

fading rivet
#

the other is also there

#

idk where get_type is defined

#

a full file search of lovely/dump should find it

wintry solar
#

you also need to fix all the saving stuff too

fading rivet
#

the what

near coral
wintry solar
#

iirc the game will get confused where you are if you quit and reload

fading rivet
#

oh

#

okay I need to test that frick

near coral
#

By the way why does a code block take up the whole line when I do it but when others do it it doesn't

near coral
#

s

#

s

#

Oh wait

fading rivet
#

lmao

near coral
#

Nvm

fading rivet
#

yeah

near coral
#

I've been doing 3 on each side instead of 2

fading rivet
#

wait does this work (2)

#

one works btw

#
-- 3 is for a full code block
local with = "color support"

2 or 1 are for snippets

near coral
#

a

#

a

#

2 and 1 are identical

fading rivet
#

so what if you do this mid line

#

oh it jsut breaks

#

FRICK

near coral
#

Unrelated to that, a boss blind I have forces a card to never be selected, and it works normally but when using better mouse and gamepad's right click hold it still gets selected

subtle wing
#

So I'm working on a modded deck skin, and it works just fine in-game

But is there a way to give a single mod unique names for each suit? Like, instead of having a deck skin with a collective name for every suit

near coral
daring fern
near coral
#

Ok

daring fern
# near coral Ok

Also you should be doing showdown = true in boss instead of checking every ante.

near coral
#

Alright

#

Right now the showdown blinds aren't relegated to specific antes, I'm planning on adding them all first and then fixing up the minor stuff

fading rivet
#

blind.boss.showdown is used in other places

near coral
#

I'm saying that I'm planning on adding all the bzr blinds and then correcting the minor details like minimum ante and showdown check before a public release

subtle wing
#

This is what it does right now

#

I had the description point to a table, but I just need to get loc_txt to read from a specific item in the table

versed swan
#

loc_txt values should be a string; not sure what description is besides a table, but you access an item in it with description[key] where key is a key in the table, could be a number or specific string

subtle wing
#

Would sharing the lua file help clarify things?

versed swan
#

you could, but i just wanna see like where description is used, where it's defined etc

subtle wing
versed swan
#

Yeah you'd do like description[1] or description[3] etc, depending on which suit to use - note that in Lua the first item in the table is indexed 1

subtle wing
#

This is what the rest of that deckskin script looks like

versed swan
#

ohhh wait i see now

normal crest
#

In the for loop you can use the index which you currently have as _ and just put description[i]

#

Assuming you rename it to i

versed swan
#

^^ yea

#

As long as suits and descriptions are kind of "lined up" in terms of suits, that should work

subtle wing
#

Worked! Thanks a bunch

normal crest
#

Did you check that it enters the if statement

silk latch
#

i don't even know how to check that

normal crest
#

Wait, I know, it's because your timer logic is in the calculate function

#

Calculate isn't called repeatedly all the time

#

If you wanna do stuff on a timer you probably should use the update function instead

silk latch
#

which works how

normal crest
#

update is called every frame

#

So you'll have to change your timer logic a bit

silk latch
#

how many FPS is balatro typically run at?

normal crest
#

Actually blinds don't seem to have an update function, so you'll prob have to make a hook for it

normal crest
idle plaza
# silk latch how many FPS is balatro typically run at?

You won't have to worry about that because dt in function Game:update(dt) (which you'll have to hook to get your blind to work) is the amount of time in seconds since the last update. So, you can your timer to start at 0 and add dt to itself in the loop until you reach a set number of seconds.

versed swan
#

What's the function that's basically generate_card_ui but for hovering over tags?

silk latch
normal crest
#

@silk latch this is how to make the hook (the G.nxkoo_dies isn't part of it, that was just that person's code)

#

you'll have to filter for your blind specifically, iirc it's if G.GAME.blind and G.GAME.blind.config.blind.key == 'bl_prefix_key'

silk latch
#

okay but how do I make the injection itself

rapid stag
rapid stag
#

~~alright, question. i'm looking into making a mechanic where i sorta "restart the ante" as part of a consumable mechanic (that can't be used during a blind, obviously)

so for example, if you've beaten the first one or two blind and either you encounter this in the shop (most likely via spectral pack) or you just have it in your consumables area during the shop

the desired effect i would want to have, would be to put progress back to the first blind of that ante (so once you're back in blind selection, you would be choosing whether to start or skip the first blind) and reroll both skip tags~~

#

...how do i do that cirLost

#

nvm, decided on something else

naive coral
#

how do i check if a specific joker is currently owned?

sturdy compass
naive coral
#

does card key include the mod prefix

daring fern
naive coral
#

ty

coral flume
#

Any way to change the color of the message in return?

wary moth
timid zinc
#

is there a function for after a playing card is scored?

wary moth
#

its for when a card is scored

pastel kernel
#

how do you make this level up all hands? ```lua
SMODS.upgrade_poker_hands{
from = card,
parameters = { "chips", "mult"},
level_up = 1,
hands = context.scoring_name
}

gilded blaze
#

don't specify hands

true jasper
wild patrol
#
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('timpani')
                local card = SMODS.add_card { set = 'Joker', key = 'j_perkeo' } and SMODS.add_card { set = 'Joker', key = 'j_chicot' } and SMODS.add_card { set = 'Joker', key = 'j_yorick' } and SMODS.add_card { set = 'Joker', key = 'j_triboulet' }
                    if card then
                        if #G.jokers.cards >= G.jokers.config.card_limit then
                        card:set_edition({ negative = true }, true, true)
                        end
                    end
                card:juice_up(0.3, 0.5)
                return true
            end```
trying to make this spawn all the legendaries, but if the spaces are full turns them negative sorta works but only makes triboulet negative is it possible to do it like this or do I need to make an individual E_MANAGER for each one?
normal crest
#

You should use a for loop within the event

wary moth
#

Is it possible to remove joker instances from your jokers, store them somewhere, and put them back later as is?

normal crest
#

Yeah that's what the game does when you continue a run after all. Using the save and load methods of Card

#

Something like

G.GAME.prefix_my_saved_joker = joker:save()

-- then to put them back
local loaded_joker = Card(0, 0, G.CARD_W, G.CARD_H, G.P_CENTERS.j_joker, G.P_CENTERS.c_base)
loaded_joker:load(G.GAME.prefix_my_saved_joker)
gilded blaze
#

I use this to save/load an arealess card

wild patrol
#

what's the best way to do the odds in the text description

#

I did it before but the odds are not visually shown to increase with stuff like opps

gilded blaze
#

show the card's loc_vars

wild patrol
#
        name = '50/50',
        text = {
            '{C:green}#1# in #10#{} chance to get all {C:legendary}Legendary{} {C:attention}Jokers{}',
            'or',
            'Crash the game'
        }
    },```
gilded blaze
#

I asked for loc_vars, not loc_txt

#

that's not 1 in 10 chance either

#

you're asking for variable #1 and #10, not the number 1 and 10

wild patrol
#

I already have the chances done I guess I just need to make a proper loc_vars then

#

I see

#

well it's sorta working now

#
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'c_ttv_5050')
        return { vars = { numerator, denominator } }
    end,```
#

can't get the 10 to appear for whatever reason

#

I fixed it

#

well now the odds visual update but the odds don't internally update

pastel kernel
wild patrol
#

well I figured it could help as a balance tarot to help against chat comands plugging jokers

#

plus the crash screen is funny

#
    key = '5050',
    set = 'Tarot',
    pos = { x = 0, y = 0 },
    config = { extra = { odds = 10 } },
    loc_txt = {
        name = '50/50',
        text = {
            '{C:green}#1# in #2#{} chance to get all {C:legendary}Legendary{} {C:attention}Jokers{}',
            'or',
            'Crash the game'
        }
    },
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'c_ttv_5050')
        return { vars = { numerator, denominator } }
    end,
    cost = 3,
    unlocked = true,
    discovered = true,
    hidden = false,
    can_repeat_soul = false,
    atlas = 'CustomConsumables',
    use = function(self, card, area, copier)
        if SMODS.pseudorandom_probability(card, 'group_0_f5a4b0f7', 1, card.ability.extra.odds, 'c_ttv_5050', true) then
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('timpani')
        for _, joker in pairs({ 'j_perkeo', 'j_chicot', 'j_yorick', 'j_triboulet' }) do
            local card = SMODS.add_card({ set = 'Joker', key = joker })
            if #G.jokers.cards >= G.jokers.config.card_limit then
                card:set_edition({ negative = true }, true, true)
            end
        end
                return true
        end
        }))
        else
            G.E_MANAGER:add_event(Event({
                        error("Skill Issue Crash")
                    }))
                end
            delay(0.6)
        end,
    can_use = function(self, card)
    return true
    end
}```
#

any reason why the odds wouldn't update

#

still uses 1/10 even with like 5 opps making the odds 32/10

gilded blaze
#

your text was #1# in #10# chance

wild patrol
#

if I put #10# it returns nil?

gilded blaze
#

because it's asking for the 10th variable

#

you only provide 2

wild patrol
#

i'm not following here

gilded blaze
#

just put #2#

#

smh

slim ferry
#

#2# gives the second value

wild patrol
#

oh

slim ferry
#

the number is entirely unrelated to the actual number itself

#

because the number can change which is kind of the whole point of doing it

gilded blaze
#

it's simply the array index of the value you provided in vars

wild patrol
#

ok which is correct #1# in #2# or #1# in #10# that's what's confusing me rn

slim ferry
#

The former

gilded blaze
#

the latter was your choice, which is wrong

wild patrol
#

and shouldn't the denominator be card.ability.extra.odds in SMODS.get_probability_vars

gilded blaze
#

if it's correct in the first place, why are we even correcting it

wild patrol
#

Like the text is working fun it's just the odds are not updating for increasing the odds

#

like if I put 5 oops and increase the odds to 32/10

#

it'll do the crash instead of spawning the jokers even tho it's well over odds

gilded blaze
#

what is this:

SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'c_ttv_5050')
and
SMODS.pseudorandom_probability(card, 'group_0_f5a4b0f7', 1, card.ability.extra.odds, 'c_ttv_5050', true)

#

the seed keys are not matching

wild patrol
#

so just missing the seed in the first one

gilded blaze
#

make up your mind
it's either c_ttv_5050 or group_0_f5a4b0f7

wild patrol
#

so change c_ttv_5050 in SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'c_ttv_5050') to group_0_f5a4b0f7

#

or just remove SMODS.pseudorandom_probability(card, 'group_0_f5a4b0f7', 1, card.ability.extra.odds, 'c_ttv_5050', true)?

gilded blaze
#

why true at the end

#

it prevents oops from working on this card

#

also I was wrong there 😭
the seed key is fine, you provided an identifier

#

it's just true at the end preventing modification by oops tho

wild patrol
#

no sure why the true is there

#

I guess whatever I was using for reference had it

#

i'll remove it see what happens

#

yup that was it

wary moth
#

If I wanted to add to some global value passively while you own a joker, but, I want it to change the amount it adds on certain conditions, how could I guarantee that it works consistently?
For an example, if I had a joker that was:

+1 Hand Size per Rare Joker you own
What would be the best way to do that?

daring fern
wary moth
# daring fern If you want to guarantee it then you would have to use the `update` function.

I tried having a local variable that remembers how it changed hand size on add_to_deck and remove_from_deck, and checked for any changes that it needed to apply and do so on any calculate. But that didn't seem to completely work
There are sometimes when a joker could spawn in that it wouldnt add the value it needed, or, when I duplicated it obviously the value got copied as well

#

An update function sounds useful though
How do I set that up? Is it a hook onto some method?

daring fern
# wary moth An update function sounds useful though How do I set that up? Is it a hook onto ...
add_to_deck = function(self, card, from_debuff)
    card.ability.extra.hand_size = 0
    for k, v in pairs(G.jokers.cards) do
        if v:is_rarity('Rare') then
            card.ability.extra.hand_size = card.ability.extra.hand_size+1
        end
    end
    G.hand:change_size(card.ability.extra.hand_size)
end,
update = function(self, card, dt)
    local count = 0
    for k, v in pairs(G.jokers.cards) do
        if v:is_rarity('Rare') then
            count = count+1
        end
    end
    G.hand:change_size(count-card.ability.extra.hand_size)
    card.ability.extra.hand_size = count
end,
remove_from_deck = function(self, card, from_debuff)
    G.hand:change_size(-card.ability.extra.hand_size)
end
gilded blaze
#

I wouldn't call G.hand:change_size every frame

#
if count ~= card.ability.extra.hand_size then
    G.hand:change_size(count-card.ability.extra.hand_size)
    card.ability.extra.hand_size = count
end
daring fern
gilded blaze
#

calling G.hand:change_size(0) most of the time feels redundant

wary moth
gilded blaze
wary moth
#

Yeah not by blueprint, but something like, ankh for example
Or I suppose theres some worry about other mods, like cryptid, "modifying" the value thats not meant to be modified

#

Like on "double values of joker" effects

gilded blaze
#

ankh adds a new copy, which in turn calls add_to_deck again for the new card

wary moth
daring fern
wary moth
daring fern
wary moth
#

Ohhhhh gotchaa, alright thank you

pastel kernel
#

how do you make it so that leveling up all poker hands using SMODS.upgrade_poker_hands doesn't feel like a waste of time? (some people might find it terribly slow to wait for all poker hands to finish leveling up)

gilded blaze
#

set instant field to true

#

that's how Black Hole does it in the first place, replacing the generic level up effect with its custom one

lusty marten
#

How can I create a draggable UIBox like the Ante/Money HUD and which function should I hook to subtract a value every time a hand is played?

next timber
#

how would i make a consumable force discard held cards when used?

plain apex
#

i doubt i could get much help here but i have a boss blind that uses the players microphone if balatro can determine they have one and this mechanic works well but for some people it messes up their audio is there a way i could fix this?

next timber
#

does this not check their mic every single update tick until it finds one

#

that might not be great

plain apex
#

i mean yeah the goal is that it'll only show up IF it can find your mic

daring fern
plain apex
#

and that your mic can pick up audio

#

is a funny mechanic

lyric wadi
plain apex
lyric wadi
#

can it do pitch detection

#

singstarlatro

plain apex
#

uh idk i haven't messed with it that much lol

lyric wadi
#

boss blind where it's just a karaoke machine

#

and if you get below 80 points you lose

#

the rhythm game part was already made by someone else so with this you can complete the guitarlatro hero mod

plain apex
#

y'all could def try to mess with it but it apparently messes up some peoples audio lol

pastel kernel
#

hey guys

#

how do you take_ownership again?

plain apex
#

which i would like to find a fix for (it doesn't personally affect my audio but probably not good to have as a bug)

next timber
#

wait there's already a rhythm game blind? damn

#

my idieas,,

plain apex
next timber
#

peak

lyric wadi
#

jhow

lusty marten
#

How can I create a draggable UIBox like the Ante/Round/Money and which function should I hook to subtract a value every time a hand is played?

plain apex
#

fortlatro really be doing alot here lol

pastel kernel
#

how do you make this so that it checks if the counter is a multiple of 100 or somethinglua G.GAME.judgementcounter == 100

slim ferry
#

G.GAME.judgementcounter % 100 == 0

fading rivet
pastel kernel
#

so i never learned it fully

fading rivet
#

when you started division, did you do stuff like

30 / 4 = 7 Remainder 2

pastel kernel
#

i meant modulus specifically

slim ferry
#

it just gets the remainder

pastel kernel
#

yea i figured

fading rivet
pastel kernel
#

i just thought it was excess

#

dawg```lua

SMODS.current_mod.calculate = function (self, context)
G.GAME.judgementcounter = 0
if context.using_consumeable and context.card.config.center.key == "c_judgement" then
G.GAME.judgementcounter = G.GAME.judgementcounter + 1
if G.GAME.judgementcounter % 100 == 0 and not next(SMODS.find_card('j_busterb_hedera')) then
SMODS.add_card{key = "j_busterb_hedera", edition = "e_negative", stickers = {'eternal'}, force_stickers = true}
end
end
end

#

idk how to get this to "spawn hedera when you use judgement 100 times"

fading rivet
#

do G.GAME.judgementcounter = G.GAME.judgementcounter or 0

pastel kernel
hushed stump
#

Hi people

#

I'm looking at the SMODS wiki

#

And I saw SMODS.PokerHand

#

modify_display_text caught my attention. This question might be obvious or stupid but does it actually change the poker hand you're going to play, or is it just the text? What would it be useful for if it actually just changes the text and not the poker hand?

#

If so, is there a method to change the poker hand?

slim ferry
#

just the text

#

its for stuff like straight flush changing to royal flush in vanilla

#

there isnt anything for changing to an entirely different hand since this should be handled in said other hand

hushed stump
#

I'm trying to make that you can choose the poker hand you'll play if multiple ones are available

slim ferry
#

oh i see

hushed stump
#

I assume I just need to re order the available poker hands table?

slim ferry
#

youll probably need to do a bunch of patching into where poker hands are calculated

hushed stump
#

game.lua?

slim ferry
#

both to get a table of available poker hands for the selection and to actually change the selected hands

hushed stump
slim ferry
#

idk where it is, i imagine G.FUNCS.get_poker_hand_info is what you should look at

hushed stump
#

However, it might be a "duplicate"/non applicable to the game itself

slim ferry
#

I mean like a table of specifically the hands that can be formed with the currently selected cards

#

rather than just all hands

fading rivet
true mortar
#

is there a way to override eternal incompatabillity

fading rivet
#

like what are you trying to do

true mortar
#

i want to have a joker that applies eternal to other jokers but when appying to a joker like gros michel the sticker is applied but the joker is still sellable

fading rivet
#

hmmm

#

likely need a hook or patch

true mortar
#

wierd thing is: many other mods with eternal applies (Cryptid, Ortolab) all ignore this

#

the only joker that does something similar is the translucent joker from cryptid that apllies a custom sticker to a spawned joker

#

thing is that only works on spawning a joker

rapid stag
dapper sun
#
SMODS.upgrade_poker_hands({
    hands = "High Card",
    parameters = {mult = 69, chips = 420} -- Test Values
})```what am i doing wrong
frosty rampart
# dapper sun ```lua SMODS.upgrade_poker_hands({ hands = "High Card", parameters = {mu...

parameters just controls which scoring parameters get upgraded, you can't pass numbers like that. it's mostly useless unless you have a mod that adds custom scoring parameters
you should do this instead

SMODS.upgrade_poker_hands {
  hands = "High Card",
  func = function(base, hand, parameter, level_up)
    if parameter == "chips" then
      return 420
    end
    if parameter == "mult" then
      return 69
    end
  end
}

i know that's not the most convenient, maybe i'll add similar functionality to what you originally typed

dapper sun
#

ty

faint yacht
#

-# Should probably also add the * level_up.

wary moth
#

Is there a way to set the reroll price to $0 at any moment?
Like, lets say as a consumable card effect for example

I tried to do something like this looking at the vanilla rework mod and copying what D6 does, but it doesnt seem to work properly

frosty rampart
frosty rampart
# dapper sun ty

each return statement should also include * level_up in case something is hooking/overriding the way things level up (e.g. a joker that makes hand level ups twice as powerful)

dapper sun
#

ok

#

would i also be able to use this to add a second level up after the normal one?

faint yacht
#

Doing the same call, with only defining the "High Card" in hands will do a normal upgrade.

dapper sun
#

?

#

i mean make it trigger after a normal level up

#

without it also triggering itself

faint yacht
dapper sun
#

ty

slim ferry
#

The returned value is what will be the new value for that parameter

frosty rampart
#

fuck right my bad

#

damn i'm rusty

faint yacht
#

base + stuff

dapper sun
#

ty

wary moth
frosty dock
frosty rampart
#

G.GAME.current_round.reroll_cost = 0 will set the next reroll to 0, and then adding G.GAME.current_round.reroll_cost_increase = 0 to the effect will make it act like d6 tag

frosty rampart
#

dammit
ok it's not always passed, should be level_up or 1 in that case

dapper sun
#

okay

frosty rampart
#

i'm sorry this function kinda stinks 😭 it made sense to me when i implemented it

dapper sun
#

well it works for what i'm using it for

#

actually

#

level_up doesn't work at all

#

just tested it with an orbital tag

#

wait nvmd i'm dumb lol

#

that's on me

frosty rampart
#

phew
glad it's working

dapper sun
#

i'd just misunderstood how the level_up argument works lol

#

that's all

wary moth
# frosty dock are you looking for the effect of D6 tag where reroll cost starts at 0, or more ...

I wanted to reset the reroll cost back down to 0$, the next price being 1$
Sort of like a D6 but might not happen at beginning of shop

I just figured out how to do it through trial and error, I had to mix what the vanilla remake does for the D6 tag along with what Meta mentioned

I had to do either this:

G.GAME.current_round.reroll_cost = 0
G.GAME.current_round.reroll_cost_increase = 0
G.GAME.round_resets.temp_reroll_cost = 0

Or this:

G.GAME.current_round.reroll_cost_increase = 0
G.GAME.round_resets.temp_reroll_cost = 0
calculate_reroll_cost(true)

Any other combination of or removing of these lines did not work

#

ty all for the help!

hushed stump
#

Can I just watch all the values from a table in a convinient way?

hushed stump
frosty rampart
# rapid stag bump
for _, v in ipairs(G.GAME.applied_stakes) do
  if SMODS.stake_from_index(v) == "stake_black" then
    -- whatever you need
    break
  end
end

it'll be better to just check for the modifier that the stake applies, if that's possible (e.g. for black stake it's just if G.GAME.modifiers.enable_eternals_in_shop then)

rapid stag
#

that makes sense

frosty rampart
frosty dock
frosty dock
hushed stump
frosty dock
#

oh ok, that's not what I thought you meant by watch then. no need for metatables there.

#

you'd want to place a UIBox somewhere and update it whenever poker hand gets evaluated

hushed stump
#

Usually in other games relying on C++ I just used an ImGui menu

vale grove
#

a while back i tried to make a joker that changed your langauge upon obtaining it but it didnt really work, does anyone know if any new smods versions changed anything?

hushed stump
#

look at how the game changes language

hushed stump
vale grove
hushed stump
#

there you have the code that runs when the game is started with lovely, SMODS and all mod's lovely patches applied

frosty dock
#

changing language usually entails reloading a bunch of stuff

vale grove
#

ive tried it before and it fucked up alot of things

#

but that was back in september

#

happen to know if anything changed since then

frosty dock
#

i don't think so, reloading item prototypes in the middle of a run still calls for trouble

hushed stump
frosty dock
#

it should be possible to reload localization without anything else but you'd have to figure that out

hushed stump
#

for this particular reason

vale grove
frosty dock
#

it's probably not necessary, maybe you can hack something together with saving the run, changing language and then reloading it? that's the way things would normally go if you wanted to change language during a run

vale grove
#

G.SETTINGS.language = 'en-us'
ive found this

#

but if i remember correctly that didnt work

frosty dock
#

G.FUNCS.change_lang is what gets called when changing language in-game

primal robin
#

there's no way to implement dynamic loc change because loc_txt exist and other mods exist

frosty dock
#

technically there is a way if you implement localization-only injection, but there's little good reason for that

primal robin
#

I mean everything is possible, just little use for it

frosty dock
#

also i'll just ignore that injection has always been a terrible name for what smods calls it

vale grove
#

i feel as thought this might be a little too difficult for me

#

the only 2 impressive things ive done is allow you to play the daily wordle and fetch someones steam hours

frosty dock
hushed stump
#
if SMODS.displaying_scoring then
    inspect(G.FUNCS.get_poker_hand_info(G.play.cards))
end
frosty dock
hushed stump
frosty dock
#

inspect just produces a string, you'd still have to print it

frosty dock
#

but debugplus stringifies tables better than inspect does

hushed stump
#

alr

teal grotto
#

how do you make a joker that makes specific ranks also count as others

frosty dock
#

this is a proposed smods feature that is still in review, there's a lot to consider behind something like that

frosty rampart
#

in particular, calculating if a played hand is/contains a straight becomes very complicated

daring fern
teal grotto
#

so...

#

i'm confused

frosty rampart
#

the code that somethingcom just linked you is a partial implementation of the multirank stuff you wanted, but it's fairly unstable because it expects other mods to check card ranks in a specific way (not a totally unreasonable expectation, but the pattern matching could probably still fail in some cases) and it also doesn't fully support poker hand calculation as far as i'm aware

teal grotto
#

well i'll take it

daring fern