#💻・modding-dev

1 messages · Page 640 of 1

limber aspen
#

Is there a context for jokers changing in any way? (changing order of jokers, adding jokers, removing jokers)

lusty marten
#

how can i do that?

loud citrus
#

is there a way to change how many cards you draw when opening a booster pack? effect tided to the booster itself

wild patrol
#

Is there anything in the smod wiki to show how to place or add to the ace on the main menu

lusty marten
loud citrus
lusty marten
wild patrol
#

Is talisman required to do it? I thought cryptid mod did it

#

Isn't talisman just for making sure the score can go higher

loud citrus
#

i mean for code, nothing you must use with

wild patrol
#

I just wanna tinker with the idea or replacing it or just adding some next to it

loud citrus
#

i see

lusty marten
wild patrol
#

What line would it be located at in the base game I guess I could just look see how it's done myself

loud citrus
#

instead of your hand size a fixed amount

lusty marten
loud citrus
#

blast

lusty marten
gilded blaze
maiden phoenix
#

Idk if there's a context for leaving a booster in general (I know there's one for skipping)

maiden phoenix
#

Oh nice

wintry solar
#

You can probably use this too

gilded blaze
#

so

wintry solar
#

Just need to check if you’re in the booster state

gilded blaze
#

if context.drawing_cards and G.STATE == G.STATES.SMODS_BOOSTER_OPENED then?

#

nice

wintry solar
#

Something like that yeah

#

I have not tried this though, I could be misremembering

limber aspen
#

Is there a context for jokers changing in any way? (changing order of jokers, adding jokers, removing jokers) I'm trying to do joker that debuffs near jokers

subtle crown
#

How do I make a balatro fangame?

limber aspen
#

Read modding rules

subtle crown
limber aspen
subtle crown
#

Which rule?

umbral zodiac
#

literally the first one which you would see if you read them

upper quarry
#

are you sure you're correct?

umbral zodiac
upper quarry
#

aah

#

fair fair

compact shuttle
#

hi, I need help with creating my first mod pack, I am using fedora linux instead of windows so I cant really find a guide.
does anyone maybe know a bit and can help me?

subtle crown
daring fern
#

limber aspen
compact shuttle
short fulcrum
#

I'm trying to make a Boss Blind that debuffs cards held in hand before the hand starts scoring, and removes the debuffs after scoring. I believe the debuffs themselves work, but I'm not sure how to make the cards visually look debuffed with this setup

SMODS.Blind {
    key = "gears",
    dollars = 5,
    mult = 2,
    pos = { y = 5 },
    boss = { min = 4 },
    atlas = 'MySingingBlinds',
    boss_colour = HEX("a3a3a3"),

    calculate = function(self, blind, context)
        if blind.disabled then return end

        if context.before then
            for _, card in ipairs(G.hand.cards) do
                if not card.played_this_hand then
                    SMODS.debuff_card(card, true, 'gears')
                    card:juice_up()
                end
            end
        end

        if context.after then
            for _, card in ipairs(G.hand.cards) do
                SMODS.debuff_card(card, false, 'gears')
            end
        end
    end
}
red flower
short fulcrum
#

alright I'll try that

#

ok I made it into an event, it almost works but when the hand finishes and the debuffs are removed it never moves on after that so the game becomes stuck

        if context.after then
            G.E_MANAGER:add_event(Event({
                func = function()
                    for _, card in ipairs(G.hand.cards) do
                        SMODS.debuff_card(card, false, 'gears')
                    end
                end
            }))
        end
red flower
#

return true

#

or the event wont end

short fulcrum
#

oh yeah of course

#

forgot to add that

#

awesome it works, thank you

limber aspen
# compact shuttle Well I successfully downloaded it already and I can run mods on it, however, whe...

I personally started with https://www.youtube.com/watch?v=Zp-4U5TlbxY , it explains most basic things, also https://github.com/nh6574/VanillaRemade/ is pretty useful to see code to vanilla jokers, tarots, etc.

STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.

https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...

▶ Play video
GitHub

Contribute to nh6574/VanillaRemade development by creating an account on GitHub.

limber aspen
# elder rune just use SMODS.debuff_card

I am using that already but when I use it without a context it crashes without a crash log, it works when I set a context (I tested it with context.reroll_shop)

compact shuttle
#

Thanks blueprint blueprint 🙏🏾

elder rune
limber aspen
rotund sable
#

would there be a way to check a vanilla joker rarity other than number? or do i have to just use a map
rn im trying to do something like this

#G.jokers.highlighted > 0 and G.jokers.highlighted[1].config.center.rarity == "common" 

-# (yes this is for jokerforge and leaving it as a string would help a bunch)

#

also welcome back 👋

rotund sable
#

damn i forgot about this thing

#

Thanks Somethingcom <3

#

helpful as always

wild patrol
#

The only difference is the game runs through proton

#

Just need to find you something to write in

wraith jolt
#

And I not been able to figure what did wrong

red flower
#

the video is kinda old

candid acorn
#

@slim ferry anything on how to use the :extend() function?

#

or maybe a page in the wiki?

slim ferry
#

not that i know of

candid acorn
#

idk if it has one

#

alr ill try to figure it out

slim ferry
#

however what it does is create a new object class with the values you put into the table of the function as the new default values

#

which you can do a lot with

#

a good first step is probably to see what class youre best off extending for what youre trying to make

lilac trail
#

What was the name of the "vanilla modded" github repo? I forgot it, but I plan to pin it once you guys send it over

lilac trail
#

thx much

candid acorn
slim ferry
#

yes

candid acorn
#

hmmm

slim ferry
#

though usually if youre creating some type of card its better to extend the basic SMODS.Center

#

since those have basically all the same features as the individual center classes

candid acorn
#

im like trying to make keywords so that in the game object you can do keywords = {} and it will get some effects/ premade things from based of what is there

#

so you can put like keywords = {'hewnk} and then the cad will automatically have another button under the sell button for something

#

and idk if i should use :extend() hooks patches or multiple

slim ferry
#

what is exactly the end goal? are you just making jokers or something different entirely

candid acorn
#

i want to add an extra param to consumeable/joker cards, and based on that param, automatically add extra functionality to the card, like buttons, or just mechnics, that would be too long to copy/paste on every card that would have them

slim ferry
#

for buttons you can try looking at the system that entropy uses, which just allows jokers to have a use and can_use function like consumables

wraith jolt
slim ferry
#

though for everything else youre probably best extending, i do this in my own mod for stuff like consumables that are mostly the same code-wise with one slight difference so i dont have to copy and paste the same function into all of them

#

you can also use that to create default functionality similar to vanilla consumables

candid acorn
slim ferry
#

so its like

#

an additional modifier for jokers?

candid acorn
#

wydm by modifier

slim ferry
#

like editions and stuff

candid acorn
slim ferry
#

hmm

#

well you can probably do it with a Card.calculate_joker hook then

#

by checking the effects of all the keywords on the joker after the main calculation

candid acorn
#

ok thx ill try to do it

limber aspen
#

Do hooks only work outside of a SMODS.Joker{}? I want to create hook for Node:stop_drag() to trigger a joker.

slim ferry
#

well yeah

#

hooks are a permanent change to a function so they have to be seperate

short fulcrum
#

This Boss debuffs all cards held in card, then removes the debuffs after scoring is finished. I don't want the debuffs to be removed if the hand defeats the blind (so Gold Cards, Blue Seals, etc don't trigger at end of round) but for the life of me I can't figure it out

SMODS.Blind {
    key = "gears",
    dollars = 5,
    mult = 2,
    pos = { y = 5 },
    boss = { min = 4 },
    atlas = 'MySingingBlinds',
    boss_colour = HEX("a3a3a3"),

    calculate = function(self, blind, context)
        if blind.disabled then return end

        if context.before then
            for _, card in ipairs(G.hand.cards) do
                if not card.played_this_hand then
                    SMODS.debuff_card(card, true, 'gears')
                    card:juice_up()
                end
            end
        end

        if context.after then
            G.E_MANAGER:add_event(Event({
                func = function()
                    for _, card in ipairs(G.hand.cards) do
                        SMODS.debuff_card(card, false, 'gears')
                        card:juice_up()
                    end
                    return true
                end
            }))
        end
    end
}
#

I feel like the solution is really simple as well so I feel like an idiot for not being able to find it

slim ferry
#

try removing the debuff in defeat by iterating over G.playing_cards

#

that happens much later than other stuff

short fulcrum
#

that would remove all the debuffs after everything else (and will be added when I figure out the current problem) but right now I need to figure out a way for the cards to stay debuffed if the hand wins the blind

slim ferry
#

well

#

that is the way to do that

short fulcrum
#

I'm sorry, I'm not sure if I understand (I'm still very new to this)

slim ferry
#

defeat runs much later so itll keep the cards debuffed until after all the end of round effects trigger

short fulcrum
#

yes but the trigger in context.after would still run, wouldn't it? that would clear the debuff earlier than I want

slim ferry
#

remove the trigger in context.after then

short fulcrum
#

but I still want that trigger to occur after every hand that didn't beat the blind

#

all I need is a way to see if a hand will win the blind that will turn that trigger off

wintry solar
#

It might help if you explain what the effect is rather than asking vague questions about trigger timings

short fulcrum
#

I already explained it above, the boss debuffs all cards held in hand when a hand is being scored, and after scoring is finished the debuffs are removed. Right now the issue I'm facing is that end of round effects like Gold Cards are still triggered because it isn't detecting if the hand has won the blind

#

I have figured out a sort of solution by adding the below code, but the issue with that is that the debuff is removed and then added on a moment later, which looks clunky

        if context.end_of_round then
            for _, card in ipairs(G.hand.cards) do
                SMODS.debuff_card(card, true, 'gears')
            end
        end
white hull
#

hey y'all, how can i draw specific cards from deck to hand? nvm i got it

wild patrol
#

anyway to fix this

#

Every custom booster pack I make has this

red flower
random basin
#

custom cards are not rendering in my poker hand preview

            {'bm_Wi_E', true}, {'bm_Wi_S', true}, {'bm_Wi_We', true}, {'bm_Wi_N', true}, {'bm_D_R', true}, {'bm_D_G', true}, {'bm_D_Wh', true}},```
#

I assume I need the prefix

red flower
random basin
#

works

smoky holly
#

im running into a mild issue, i have a context.discard where i have a joker scale in a similar manner to ramen. it runs just fine, but it doesn't run as fast as ramen does and i can't seem to find out what ramen's doing differently

round lion
#

how am i mean tto make a objectclass anyway

umbral zodiac
#

oh wow the embed is Me

#

you dont have to read the whole thing obv i just wanna make sure that i fixed the problem generally

frosty rampart
#

that's two giant cat github embeds now 🔥

wintry solar
#

I am 95% sure it's just the stuff in v_dictionary

umbral zodiac
#

im distraught

#

is it problematic to remove the tables from the other things at least

wintry solar
#

I don't believe so

umbral zodiac
#

then i lowkey might just merge it anyway

#

assuming it doesnt crash on boot

#

yea no it does i guess ill just restart and apply it only in v_dict

#

whoever did the chinese localization PLEASE WHY DID YOU FORMAT IT

red flower
#

based

sturdy compass
#

based

white hull
#

are legendary jokers i make automatically excluded from the shop pool?

umbral zodiac
#

shop? yes

#

they spawn as normal legendary jokers would in vanilla

#

if you want to make them not spawn the soul, or only spawn on certain conditions, consider using an in_pool function for them

white hull
#

so only from soul cards

umbral zodiac
#

only from anything that spawns legendary jokers intentionally

#

so the soul in vanilla, or anything from other mods that spawns legendaries

#

but nothing that just picks a random joker

white hull
#

yeah makes sense, thank you

sturdy compass
smoky holly
#

i do not

umbral zodiac
red flower
#

install smods 0.9.8

umbral zodiac
#

that was actually not worth any of my time because cryptid sucks and i had limited time today which is now up but what fucking ever

wintry solar
#

thanks lily ❤️

umbral zodiac
#

sure

sturdy compass
# smoky holly i do not

That’d do it then. Ramen has this too, but it looks like it’s missing from VanillaRemade. Lemme find an example rq

smoky holly
#

ahh do the messages have a default delay that is overridden by setting it yourself?

white hull
#

code from the lovely dump

if self.ability.name == 'Ramen' and not context.blueprint then
    if self.ability.x_mult - self.ability.extra <= 1 then 
        SMODS.destroy_cards(self, nil, nil, true)
        return {
            card = self,
            message = localize('k_eaten_ex'),
            colour = G.C.FILTER
        }
    else
        SMODS.scale_card(self, {
            ref_table = self.ability,
            ref_value = "x_mult",
            scalar_value = "extra",
            operation = "-",
            message_key = 'a_xmult_minus',
            colour = G.C.RED,
            message_delay = 0.2,
        })
        return nil, true
    end
end
sturdy compass
smoky holly
#

oh i didnt notice you two were the

#

you and the other contributors to vremade have been a blessing to our work, thank you

sturdy compass
#

o7

smoky holly
#

hmm does it only work with scale_card?

red flower
#

no, you can add delay = num to the return

smoky holly
#

oh i used message_delay

#

silly me

sturdy compass
#

Yeah scale_card is a tiny bit different

smoky holly
#

it works!

#

thank you

white hull
#

yay!!

red flower
#

fixed it on vremade

sturdy compass
#

Should we update vremade to use scale_card? Or is that a lil more of an advanced feature we let devs learn themselves

red flower
#

no

#

i think it makes the code harder to read

smoky holly
#

that's just for other jokers that alter scaling to reference, right?

red flower
#

yes

smoky holly
#

ok cool

frosty rampart
#

i think having a comment about it next to relevant scaling jokers might be nice
much like e.g. marble joker has the big comment with "just use this code if you don't care about the animation"

umbral zodiac
frosty rampart
#

hive mind
🐝🧠

frosty rampart
#

? i just ctrl-f'd for scale_card and there's nothing in jokers.lua

red flower
frosty rampart
#

a

wild patrol
# red flower
    key = 'twitch_pack_1',
    loc_txt = {
        name = "Twitch Pack 1",
        text = {
            [1] = 'A booster pack with {C:purple}Twitch{} Jokers.'
        },
        group_name = "ttv_boosters"
    },
    config = { extra = 3, choose = 1 },
    atlas = "CustomBoosters",
    pos = { x = 1, y = 0 },
    group_key = "ttv_boosters",
    discovered = true,
    loc_vars = function(self, info_queue, card)
        local cfg = (card and card.ability) or self.config
        return {
            vars = { cfg.choose, cfg.extra }
        }
    end,```
red flower
wild patrol
round lion
#

how do i make a G.GAME table anyway

violet oasis
#

I saw in the changelog for the latest SMODS that animated textures are now supported for all Atlas types. Can anyone confirm if this works with the balatro key? Whenever I try to set it as ANIMATION_ATLAS, it reverts back to the vanilla sprite.

I even checked in SMODS.Atlas.obj_table.balatro and the path and everything is as I set up, but it's still showing the vanilla sprite.

white hull
#

like if run_start then G.GAME.yourtable = {}

wintry solar
violet oasis
umbral zodiac
#

is there any existing way to find the amount of times a specific playing card has been played or should i just track it myself

umbral zodiac
#

awesome

random basin
#

how do I use add_round_eval_row() ?

#

essentiallly what i'm trying to do is this:

SMODS.PokerHand {
    key = "Straight Flush",
    ...
    modify_display_text = function(self, cards, scoring_hand)
        local royal = true
        ...
        if royal then
            -- TODO: ADD BONUS CASH ROW TO END ROUND
            return 'vremade_Royal Flush'
        end
    end
}```
red flower
#

you can't add a cash row there

random basin
#

can I queue an event or do I just have to send a variable elsewhere to be picked up when it reaches the correct context

red flower
#

latter

pastel kernel
#

How do you give a joker a use button?

red flower
# red flower latter

but keep in mind that function is also not good for that since it also triggers on selection

red flower
random basin
# red flower latter

best way to implement this would probably be to copy most of the logic from todo list joker, however idk how to make a joker effect something that just lasts an entire run constantly, do I need to write a custom object?

red flower
random basin
#

.current_mod or [mod_prefix]

red flower
#

current_mod

#

literally

pastel kernel
red flower
random basin
#

thank you wiki devs 😭

red flower
random basin
pastel kernel
random basin
red flower
#

that will be straight flush

#

the only way to grab it in contexts is in context.evaluate_poker_hand

pastel kernel
#

i forgot how to do this ```lua
if context.card.config.center.key == "j_busterb_isaac" then

#

can i replace true with can_use(...) or is that not possible```lua
local can_use = true

red flower
#

yeah

red flower
pastel kernel
#

wait, do i have to write multiple of these just to add multiple abilities?

red flower
#

do you mean multiple buttons or multiple jokers

pastel kernel
#

i was trying to copy the way entropy went about giving jokers button abilities

red flower
#

you can give the jokers use and can_use functions and check those yes

pastel kernel
#
SMODS.calculate_effect({ use(self, card) }, card)
red flower
#

that's not a piece of code that makes sense

random basin
#

yeah most likely I'll have to split up all the poker hands into their own objects
not terribly difficult but will add a ton of clutter and would make creating jokers that synergize more difficult

gaunt folio
#

what can i do to modify a jokers values? Cryptid doesn't seem to have what i'm looking for, although I'm probably not looking in the right spot

#

like double or something

daring fern
wraith jolt
#

I am getting so frustrated trying to link a Joker with it sprite

#

I just can't comprehend what doing wrong this time

#

SMODS.Joker {
key = "png_joker",
blueprint_compat = false,
rarity = 1,
cost = 4,
pos = { x = 0, y = 0 },
config = { extra = { h_size = 2 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.h_size } }
end,
add_to_deck = function(self, card, from_debuff)
G.hand:change_size(card.ability.extra.h_size)
end,
remove_from_deck = function(self, card, from_debuff)
G.hand:change_size(-card.ability.extra.h_size)
end,
}

#

This what using but if I try adding Atlas to it, it instantly crashes it

#

What is the solution here can anyone explain it to me

rocky plaza
wraith jolt
#

Using

rocky plaza
#

can i see the code where you defined the atlas

wraith jolt
#

yes, stupid fat hands won't move fast enough

rocky plaza
#

if its crashing when you add the atlas target for the joker, you probably screwed something up within the atlas

wraith jolt
#
  • Png.Joker
    SMODS.Joker {
    key = "png_joker",
    blueprint_compat = false,
    rarity = 1,
    cost = 4,
    atlas = 'jokers',
    pos = { x = 0, y = 0 },
    config = { extra = { h_size = 2 } },
    loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.h_size } }
    end,
    add_to_deck = function(self, card, from_debuff)
    G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
    G.hand:change_size(-card.ability.extra.h_size)
    end,
    }
#

that all I am using and the sprite name joker

#

I watch the video how to make joker that what they said

rocky plaza
wraith jolt
#

Nope I didn't

#

so that it

rocky plaza
#

That would be why

wraith jolt
#

and where do I add that one

rocky plaza
#

so at the top of the file

wraith jolt
#

omg this enough to drive someone to drinking

#

ok let me try again

rocky plaza
# wraith jolt ok let me try again

For reference, heres what a Joker atlas should look like

SMODS.Atlas({
      key = "placeholder",
      px = 71,
      py = 95,
      path = "placeholder.png",
})
#

replace placeholder with a more apt name

wraith jolt
#

ok let try this now

rocky plaza
wraith jolt
#

you lost me there

rocky plaza
#

the code

wraith jolt
#

oh it work I see

rocky plaza
#

ah

wraith jolt
#

wait but where do I add the text for the Joker information

#

before the atlas or after it?

rocky plaza
#

anyways im tired so im heading to bed

#

this is pretty basic stuff though so if you're still confused there will most definitely be people here that can help ya while im away sleeping

urban wasp
#

USE A LOCALIZATION FILE

#

ok bye

river grail
#

looking at you, sr. nacho

wraith jolt
#

Guys is there anyone else awake?

#

It late way too late I do this tomorrow

naive agate
#

how can I debuff all jokers except the leftmost one during a boss blind?

daring fern
pastel kernel
#

can i really just add use and can_use to a joker and a use button will magically appear onto a joker?

pastel kernel
#

how does entropy do it

dapper sun
#

by coding in its own use button support

#

my mod's use button code is a modified version of the lobcorp mod's use button code

daring fern
#

wild patrol
#
    if is_on_cooldown() then return end
    if G.STAGE ~= G.STAGES.RUN or not G.GAME then return end
        level_up_hand(nil, nil, false, -1)
        play_sound('ttv_fart_sound1', 1)
end```

working on this the level down all hands part works everything works but the moment it finishes leveling down all hands it crashes with an error in common_events.lua 507 with a nil value looking there it's just an end statement
maiden phoenix
wild patrol
maiden phoenix
#

Why not do a reverse black hole instead?

wild patrol
#

tried that

#

this is the closes i've got to work lmao

#

do I need to add update_hand_text()?

#

is that maybe why it crashes?

#

nope taht didn't work crashes lol

maiden phoenix
#

Can you go into your Mods/lovely/dump/functions/common_events and show whats at around that line?

#

(Wow english is hard this morning)

wild patrol
#

oh I was looking in the balatro.exe's lua

#

might be why I can't find the reason lol

maiden phoenix
#

The dump contains everthing, with applied lovely patches from all mods and smods

wild patrol
#
        trigger = 'immediate',
        func = (function() check_for_unlock{type = 'upgrade_hand', hand = hand, level = G.GAME.hands[hand].level} return true end)
    }))```
#

looks like this is my issue

maiden phoenix
#

Its hard without my pc, if you dont figure it out until 8 hours ping me

wild patrol
#

i'll tinker around

#

i'm not excatly an expert at lua

#

I'm a if it works it works

#

Duck tape and glue

normal crest
#

can u send the crash log

#

duck tape is funny tho

wild patrol
#

crash log

wild patrol
normal crest
#

isn't that cus you're passing nil to it

#

so hand is nil

wild patrol
#

so it's more so related to level_up_hand(nil, nil, false, -1)

normal crest
#

I'd say so

wild patrol
#

let me tinker see

normal crest
#

try using the smods function to level up instead

#

i guess actually, can you send the entire level up function in your dump

#

nvm

wild patrol
#
    G.GAME.hands[hand].level = math.max(0, G.GAME.hands[hand].level + amount)
    G.GAME.hands[hand].mult = math.max(G.GAME.hands[hand].s_mult + G.GAME.hands[hand].l_mult*(G.GAME.hands[hand].level - 1), 1)
    G.GAME.hands[hand].chips = math.max(G.GAME.hands[hand].s_chips + G.GAME.hands[hand].l_chips*(G.GAME.hands[hand].level - 1), 0)
    if not instant then 
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2, func = function()
            play_sound('tarot1')
            if card then card:juice_up(0.8, 0.5) end
            G.TAROT_INTERRUPT_PULSE = true
            return true end }))
        update_hand_text({delay = 0}, {mult = G.GAME.hands[hand].mult, StatusText = true})
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.9, func = function()
            play_sound('tarot1')
            if card then card:juice_up(0.8, 0.5) end
            return true end }))
        update_hand_text({delay = 0}, {chips = G.GAME.hands[hand].chips, StatusText = true})
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.9, func = function()
            play_sound('tarot1')
            if card then card:juice_up(0.8, 0.5) end
            G.TAROT_INTERRUPT_PULSE = nil
            return true end }))
        update_hand_text({sound = 'button', volume = 0.7, pitch = 0.9, delay = 0}, {level=G.GAME.hands[hand].level})
        delay(1.3)
    end
    ]]
    G.E_MANAGER:add_event(Event({
        trigger = 'immediate',
        func = (function() check_for_unlock{type = 'upgrade_hand', hand = hand, level = G.GAME.hands[hand].level} return true end)
    }))
end```
#

assuming this is it

normal crest
#

is the entire function commented out besides that final part

#

Or is there stuff before the commented out part

wild patrol
#

I'm not sure 507 is the G.E part

#

and the commented out is the last part before that

normal crest
#

is there stuff before --[[

wild patrol
#

yes

normal crest
#

is it too long

wild patrol
#
    amount = amount or 1
    SMODS.upgrade_poker_hands({
        hands = hand,
        func = function(base, hand, parameter)
                return base + G.GAME.hands[hand]['l_' .. parameter] * amount
        end,
        level_up = amount,
        from = card,
        instant = instant
    })```
#

talking about this before it

normal crest
#

oh okay, well that makes sense

#

idk if that's an issue with smods or another mod

wild patrol
#

I guess I could disabled every other mod see what happens

#

doesn't seem mod related\

normal crest
#

can you redownload latest smids

#

Smods

#

It seems the issue was fixed 7 days ago

#

Wait no

#

I misread

#

The issue was brought 7 days ago

#

Assuming passing nil as a hand is an intended use

wild patrol
#

if I cahnge the nils to anything it still crashes

#

I'll probably push it into the repo I got going let the main guy I got coding take a look later lol

normal crest
#

the 2nd nil is the issue

#

the function wants it to be a valid hand name

wild patrol
#

is there a a list of hands as like a local thing

#

Maybe that's waht it's looking for a list of hands

#

I put poker_hands in thought it worked but still crashed

maiden phoenix
#

Cant you just do
SMODS.upgrade_poker_hands({level_up = -1}) instead of calling level_up?

#

Idk if its this one or smart_level_up I forgot the difference between the two

maiden phoenix
#

Neat

wild patrol
#

hours gone for 1 line of code

maiden phoenix
#

I love sucessful blind support

normal crest
wild patrol
#

I guess for context working on a twitch chat intergration mod

normal crest
#

just a side effect of it using the upgrade_poker_hands function

wild patrol
#

with some friends

#

I saw the twitch blind mod

#

and liked the idea

#

but wish chat could be more interactive with fucking with ur game

#

still very early but it's functional

wild patrol
#

I tried the wiki couldn't find this mentioned anywere

#

or is it just trial and error and looking for the functions in lovely dumps

storm kraken
#

hm
how would i check if somebody selected a card in a pack

#

somebody?? i meant the player

maiden phoenix
storm kraken
#

a better way to word this would be how would i check when the pack is supposed to end and go back to the regular shop

maiden phoenix
wild patrol
#

really wish the wiki was more documented

#

especially when me dumb

normal crest
#

that function specifically was mentioned in a discussion in the smods github repo

maiden phoenix
#

Everyone wants the wiki to be better but nobody wants to write the wiki 😅

wild patrol
#

Everyone wants change but nobody wants to do it

#

THe law of the internet

normal crest
maiden phoenix
wild patrol
#

unfunny joke incomming for the mod

red flower
#

i wonder how many outdated jokes there are in the oldest shitpost mods by now

limber aspen
#

Is it possible to determine average color of card with shader?

wild patrol
#

what do u guys think so far of this mod

#

forgot to show off the soul and wheel additions

#

but they are both trolls

#

wheel never procs and soul just says pranked

#

the twitch commands are about midway through

#

still very unfinished but it'll get there eventually

#

Any fun suggestions for commands?

primal robin
#

How are you reading the chat?

wild patrol
#

From the code my friend made it uses irc connection

#

Nut shell you put ur name into the box in the configuration menu

#

And it looks for keywords in ur chat

primal robin
#

irc instead of websocket you say

wild patrol
#

I guess it's websocket

#

I think he mentioned that to

#

I dunno

#

I didn't make that part of the code

primal robin
#

How he implemented wss in lua then

wild patrol
#

I've just been adding to the commands

#

And fiddling with jokers

primal robin
#

Does your mod has repo? I want to look at this part specifically

wild patrol
#

Pretty sure works similar to how the twitch blinds mod was made

red flower
#

i wonder who made twitch blinds

primal robin
wild patrol
#

I just wanted it to have more abilities to screw with the streamer

#

And yeah it does use socket connection

#

Just checked

primal robin
#

I interested in wss implementation specifically

#

Because ws is no longer supported

wild patrol
#

I'll have to ask them when I get the chance

#

The repo will be public once I feel like it's good enough for people to use

#

UI is ass for where u put ur name in and not even sure how rate limits will handle

#

Mod idea is similar to that one Mario 64 ROM had where people in chat could type a command to mess with everything in-game

#

But trying to implement jokes that could help battle against chat

#

It's just throwing shit in rn with no real balancing

pastel kernel
# wild patrol

what does the soul copy have that makes it different from the original soul

wild patrol
#

When u use it just say pranked and plays a fart sound

pastel kernel
#

so it's a fake soul

wild patrol
#

Essentially yeah

#

Not sure if I want it to appear in spectrals or make it a command

#

Either or seems funny

candid acorn
#

if i extend the SMODS:Joker class, will the new class be considered a Joker, or a separate Type with Joker as its base? tbh because of the lack of documentation i dont understand the :extend function that well

#

or like will it be just a joker with some more features, and be considered a joker by the game, so it will appear as a joker in the shop and collection, or will it be a different type of object that just behaves like a joker

#

or am i getting something wrong about this

normal crest
#

when you extend you copy everything the Joker class have

#

and you can overwrite stuff

#

Joker itself extends from Center

candid acorn
normal crest
#

Depends on what you overwrite

#

But if, let's say you wanted to have jokers that all have the same calculate function

#

You could extend Joker and overwrite calculate only, then use the new class to make jokers

candid acorn
normal crest
#

no, you're overwriting, so only the calculate function defined last would run

candid acorn
#

oof

normal crest
#

what you can do is make the calculate function in the new class use a different function within the object inside

#

so for each joker you create with the new class you'd define like my_calculate = function blah blah then inside the calculate you'd call self.my_calculate blah blah

candid acorn
#
  run my code
  new_calculate()
end```
#

smth like that?

normal crest
#

when you call extend you'd do

MOD_OBJECT.Something = SMODS.Joker:extend {
  calculate = function(self, card, context)
    -- your generic joker code
    self:my_calculate(card, context)
  end
}

MOD_OBJECT.Something {
  my_calculate = function(self, card, context)
    -- specific joker code
  end
}
candid acorn
#

ok tysm i was trying to figure this out for some time really thx

normal crest
#

glad to help

smoky holly
#

how would one get a joker to draw cards into your hand?

red flower
#

SMODS.draw_cards(number)

smoky holly
#

would this screw up the timing of other jokers if i used it here

#

i. should put an actual number

red flower
#

you dont need to draw cards if you increase hand size

#

it does it automatically

smoky holly
#

well the hand size was increasing during scoring

#

so they werent drawing immediately

red flower
#

what you did wont either

smoky holly
#

m

red flower
#

i dont remember if draw_cards has events in it

candid acorn
#
    required_params = {
        'key',
        'loc_txt',
        'lvl_costs',
    },
    inject = function() end
})```
red flower
candid acorn
#

Also the thing being saved to the SMODS table is a result of me not knowing what to do and just doing random things it was saved to my own table before

red flower
candid acorn
#

I suspected that the file might not be loaded i didint realise that would be the issue with it being loaded after lol

edgy mountain
#

how do i get the index of highlighted cards in reference to their position in the whole hand?

red flower
#

loop through the whole hand and check its position

edgy mountain
red flower
#

card.highlighted

edgy mountain
#

huh

#

weird that i didnt find it looking through the code

smoky holly
#

what would i put in if i wanted to emplace a specific tarot card?

#

i have this for a random tarot, would i need to change 'Tarot' to be the specific name?

red flower
smoky holly
#

yeah i figured it was gonna be somewhere in there

#

thank you

#

do i have to use add_card or can i use emplace?

red flower
#

remove create_card, emplace and add_to_deck and justuse SMODS.add_card instead

smoky holly
#

what's the difference?

red flower
#

it's one line

#

you dont have to do nil, nil, nil, etc

#

and it gets any smods fixes in the future if there are any

smoky holly
#

i see, do i still need consumeable_buffer?

red flower
#

yes, if it's during scoring

smoky holly
#

and then if i just wanted a random tarot i could use SMODS.add_card('Tarot') ?

red flower
#

SMODS.add_card { set = 'Tarot' }

smoky holly
#

ah ok

#

thank you thank you

#

now here's smth strange

the trigger order between these is wrong despite them having, at least from what i can tell in vremade, the same blind_setting context

red flower
#

cartomancer uses an event inside an event

smoky holly
#

ah

smoky holly
#

ok im looking at showman in the vremade and im a little lost

im assuming SMODS.showman is a steamodded-specific function to allow showman-like effects

red flower
#

yes

smoky holly
#

so find card checks to see if you have showman? and then what defines what can appear multiple times specifically?

red flower
#

yes, SMODS.showman runs once for every card that can be spawned and if it returns true then it can repeat

smoky holly
#

oh

#

so to swap this out to only want one specific card from appearing

red flower
#

is it a specific effect that makes that card appear in multiples or does the card have that by default

smoky holly
#

the card has an effect on itself that causes it to appear in multiples, but it's not on by default

red flower
#

you can use it's own in_pool function for that

#

return true, { allow_duplicates = true } when the effect is active

smoky holly
#

oh that's. really easy huh

#

exactly like this then

red flower
#

yes
that will be on at all times tho

smoky holly
#

oh

#

what,

harsh belfry
#

set by the joker def

#

or Actually

#

why don't you just use SMODS.find_card

smoky holly
#

ah, in the in_pool?

harsh belfry
#
in_pool = function () return true, { allow_duplicates = next(SMODS.find_card("YOUR_JOKER_KEY")) } end
#

like this i would think

#

if your joker is found (currently obtained) it will be the value of allow_duplicates

#

it is truthy and as such duplicates should be allowed

smoky holly
#

ahh smart

primal robin
#

nope, table needs to be second argument

harsh belfry
primal robin
#

you need return true, { allow_duplicates = ... }

harsh belfry
red flower
harsh belfry
#

what that code does is allow duplicates if you have at least one of the joker

smoky holly
#

that only allows duplicates if you have a copy, yeah?

red flower
#

oh i thought it was like an activated effect not a passive

ember locust
#

Any idea how to give a joker a custom rarity that would not join the regular or legendary joker pools but can be only be summoned by either a consumable or a joker event/effect? Doesn't have to be the exact trigger, just that it would be seperate from every other joker pools

red flower
#

SMODS.Rarity

maiden phoenix
#

Yea you can make your own rarity and set the weight to 0 (I think it is by default)

ember locust
#

Thank you very much

smoky holly
#

god i wish there was an easier way to see if this works besides rerolling 200 times

harsh belfry
#

devious things can be done with this function

smoky holly
#

can i input that into debugplus?

harsh belfry
#

yes

#

gained is however many more cards you want

#

in shop

#

don't put too many though lmao

smoky holly
#

command didnt work

harsh belfry
#

oh yeah thats an eval

#

if you didn't know

#

thats just a function thats available to use in code

smoky holly
#

i have shop size at a good number so

#

ok after 285 rerolls im just gonna assume i have the key wrong

harsh belfry
#

lmao

#

i had a similar effect

smoky holly
#

do i need to add the j_ and mod prefixes to the key?

harsh belfry
#

it takes a while

smoky holly
#

so it should...

smoky holly
# smoky holly

does the mod prefix having underscores in it affect it at all

harsh belfry
smoky holly
#

would it affect the same shop it's bought from?

red flower
#

yes

smoky holly
#

or do i go to a new shop

red flower
#

add a print to the in_pool to see what next(SMODS.find_card(..)) outputs

smoky holly
#

what do i replace .. with

red flower
#

what you have

#

i just didnt want to write the whole thing

smoky holly
#

its printing nil rn on one reroll

red flower
#

then the key is probably wrong

smoky holly
#

wait do i need to move return true to the bottom?

#

the key would be j\_[mod prefix]\_[joker key], yeah?

harsh belfry
#

yes

#

your mod prefix would be j_o_y, right?

smoky holly
#

yes

#

so i have the key exactly right

red flower
#

can i see the whole code for the joker

smoky holly
#
local silly_band = SMODS.Joker {
    key = "silly_band",
    atlas = "jokers",
    pos = {
        x = 9,
        y = 0
    },
    unlocked = true,
    discovered = false,
    rarity = 2, -- Uncommon
    cost = 6,
    blueprint_compat = false,
    eternal_compat = true,
    perishable_compat = true,
    in_pool = function(self, args)
        print(next(SMODS.find_card("j_j_o_y_silly_band")))
        return true,
        { allow_duplicates = next(SMODS.find_card("j_j_o_y_silly_band")) }
    end
    
}

silly_band.config = {
    extra = {
        xmult = 1.5,
        xmult_per_copy = 1.5
    }
}

silly_band.loc_vars = function(self, info_queue, card)
    local config = card.ability.extra

    return {
        vars = {
            config.xmult_per_copy,
            config.xmult
        }
    }
end

silly_band.calculate = function(self, card, context)
    local config = card.ability.extra

    if G.jokers then
        local copy_count = 0

        for _, joker in ipairs(G.jokers.cards) do
            if joker.label == card.label then
                copy_count = copy_count + 1
            end
        end

        config.xmult = config.xmult_per_copy * copy_count
    end

    if context.joker_main then return { xmult = config.xmult } end
end
#

we're still working on getting all this stuff into the SMODS.Joker so ignore that

red flower
#

can you get the joker and do eval SMODS.find_card("j_j_o_y_silly_band") in debugplus

#

also hover it and do eval dp.hovered.config.center.key

smoky holly
red flower
#

only that?

smoky holly
#

yes

red flower
#

not j_j_o_y_silly_band?

smoky holly
#

nope

red flower
#

lol

#

then thats the key

smoky holly
#

damn

red flower
#

smods might be removing the j_?

#

i would tell you to remove the underscores but then you will conflict with my mod :3

smoky holly
#

the underscores in the prefix was not my decision

#

hooray!

#

thanks yall for your patience

wintry solar
#

It’s because when it goes to add the type prefix it already sees j_ so it assumes it’s already prefixed

smoky holly
#

man i wish it was easier to keep track of when i need certain prefixes and when its added automatically

red flower
#

it's almost always needed except when defining a new object

loud citrus
#

How would I make it so if money was gained, I can modify that value to increase or decrease to it?

Bunco has 2 jokers that do this but it uses it's own custom context.

loud citrus
#

hook? (unfamiliar with hook)

daring fern
loud citrus
#

OH

short fulcrum
#

is it possible to make a blind directly contribute towards the final score? I'm trying to make a blind that gives X100 Mult (just to test stuff out, the value is irrelevant) after all other scoring concludes

#

I don't want to go ahead and try to make it before learning it's not as simple as I hope it is

daring fern
short fulcrum
#

I'll try that out

#

awesome it works, thanks

red flower
#

it's new

random basin
# random basin how do I use ``add_round_eval_row()`` ?

I still don't really get how it works

    local temp_payout_flag = false
    if context.before and (next(context.poker_hands['bm_Tanyao']) or next(context.poker_hands['bm_Pure Double Chi'])) then
        temp_payout_flag = true
        return {
            message = 'One Han!',
            colour = G.C.RED
        }
    elseif context.round_eval then
        if temp_payout_flag then
            add_round_eval_row({dollars = 1, bonus = true, name='name'})
        end
    end
end```
wintry solar
#

temp payout flag will never be true when you check for it

#

You reset it to false every time the function is run

loud citrus
red flower
#

you cant change it no

wintry solar
#

Something you can check

#

But you can ease dollars in this check

loud citrus
#

okay, this is extremely helpful!

random basin
#

a bit harder since this is not in a joker object

wintry solar
#

I wonder if the calc dollar bonus function works in mod objects

red flower
#

i didnt add it but i dont see why it cant be

random basin
#

why is pitch even in the round eval

#

lets go

umbral zodiac
#

does anyone know why my hover ui is doing this
i have 2 very very similar elements, the first one works, the second does not, and i dont know why
will send some code snippets in a sec

#

hover func set for the one that works and doesnt respectively

#

and both hover functions look like this, just with different uiboxes and positioning

function G.FUNCS.hover_upgrade_blind(e)
    if not e.parent or not e.parent.states then return end
    if (e.states.hover.is or e.parent.states.hover.is) and (e.created_on_pause == G.SETTINGS.paused) and not e.parent.children.alert then
        e.parent.children.alert = UIBox {
            definition = create_UIBox_hover_upgraded(),
            config = { align = "tm", offset = { x = 0, y = -0.1 },
                major = e.parent,
                instance_type = 'POPUP' },
        }
        play_sound('paper1', math.random() * 0.1 + 0.55, 0.42)
        play_sound('tarot2', math.random() * 0.1 + 0.55, 0.09)
        e.parent.children.alert.states.collide.can = false
    elseif e.parent.children.alert and
        ((not e.states.collide.is and not e.parent.states.collide.is) or (e.created_on_pause ~= G.SETTINGS.paused)) then
        e.parent.children.alert:remove()
        e.parent.children.alert = nil
    end
end
#

nvm i guess i just had to do some more paranoia checks

random basin
# random basin lets go

going with a different implementation- instantiating a special tag that will peform the payout (that way I can rename the row to whatever I want and control the rewards a bit better)

getting this crash```lua
SMODS.current_mod.calculate = function(self, context)
if context.before and next(context.poker_hands['bm_Tanyao']) then
G.E_MANAGER:add_event(Event({
func = function()
add_tag(Tag('tag_bm_tanyao'))
play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
return true
end
}))
end
end

SMODS.Tag {
key = "tanyao",
pos = {
x = 2,
y = 1
},
config = {
dollars = 25
},
loc_vars = function(self, info_queue, tag)
return {
vars = {tag.config.dollars}
}
end,
apply = function(self, tag, context)
if context.type == 'eval' then
tag:yep('+', G.C.GOLD, function()
return true
end)
tag.triggered = true
return {
dollars = tag.config.dollars,
pos = tag.pos,
tag = tag
}
end
end
}

#

game crashes during round eval/redeeming tag

#

oh wait it might be condition missing

viscid talon
#

hai i need help figuring out a specific joker

#

i cant find anything on vanillaremade that helps me turn the face cards into twos

#

also it costing $100 is bc i wanted to prevent myself from buying it LMAO thats not the actual price trust me

wintry solar
#

when do you want it to change?

viscid talon
#

it functions identically to pareidolia

#

except it counts every face card as a two

#

(me when i use defaced + wee joker)

wintry solar
#

oh count as a two, not actually change them

viscid talon
#

yeah

wintry solar
#

we don't have quantum rank support

viscid talon
#

WHAT

#

gulps

wintry solar
#

you can do a load of jank patching but it wont work with other mods

daring fern
# viscid talon gulps
local oldcardgetid = Card.get_id
function Card:get_id()
    if next(SMODS.find_card('j_modprefix_key')) and not SMODS.has_no_rank(self) and SMODS.Ranks[self.base.value].face then
        return 2
    end
    return oldcardgetid(self)
end
spiral mural
#

quantum ranks are next week

viscid talon
#

:o oooo

wintry solar
#

that snippet will make it no longer count as whatever it actually is

viscid talon
#

no wonder i was struggling with this lmao

#

so i have to change the ability of the joker then 😔

daring fern
viscid talon
daring fern
viscid talon
#

how do i make a hook again 😭

#

oh wait

#

i have to put it outside the joker

#

lol

#

i replace "j_modprefix_key" with "j_hatch_key" right

#

hatch being my mod prefix

daring fern
viscid talon
#

oke

#

im a tad rusty

#

ok uh it doesnt work

#

the code rn

daring fern
viscid talon
#

oh odd

#

idk why i wrote the key like that lol

#

ive never done that before

#

hmmm, so... it kinda works? it does trigger wee, however...

  • its still affected by the plant
  • it returns a standard amount rather than the 2 chips its supposed to
dense fulcrum
frosty rampart
viscid talon
#

ahh i see

#

thats cool

#

ill keep it as is then

daring fern
smoky holly
#

how would i go about making separate messages between this joker taking money and scaling mult?

edgy swan
#

hi, I have decided to learn how to mod, I have been following a guide on youtube by someone called "doomie" .
after a bit of following the guide I have had to open my game and see the new mod in the game, but I couldnt find it in the mods tab, nor could I find the joker in the collection.
can anyone please help me a bit figuring out what the problem is?

red flower
dapper sun
#

why isn't the context.after triggering

calculate = function(self, card, context)
    -- Start Retriggering
    if context.before then
        local hasAce = false
        local has4 = false
        for _, v in pairs(context.full_hand) do
            has4 = has4 or v:get_id() == 4
            hasAce = hasAce or v:get_id() == 14
        end
        
        if has4 and hasAce then
            card.ability.extra.trigger = true
            return { message = localize("elle_41_activate"), colour = G.C.BLUE }
        end
    end
    -- Retrigger
    if card.ability.extra.trigger then
        local ret = SMODS.blueprint_effect(card, G.jokers.cards[#G.jokers.cards], context)
        if ret then ret.colour = G.C.BLUE end
        return ret
    end
    -- Stop Retriggering
    if context.after then
        card.ability.extra.trigger = false
    end
end```
red flower
dapper sun
#

yes

#

i have it changing sprite when it's true so ik it def is

red flower
#

then it returns before it gets there

dapper sun
#

ah

#

i see now

#

ty

edgy swan
# red flower may i see what you have

as of now the code is this:

--- STEAMODDED HEADER
--- MOD_NAME: Example Joker
--- MOD_ID: EXAMPLEJOKER
--- MOD_AUTHOR: [elial1]
--- MOD_DESCRIPTION: An example mod on how to create Jokers.
--- PREFIX: xmpl

------------MOD CODE -------------------------

SMODS.Atlas{
key = 'Jokers', --atlas key
path = 'Jokers.png', --atlas' path in (yourMod)/assets/1x or (yourMod)/assets/2x
px = 71, --width of one card
py = 95 -- height of one card
}
SMODS.Joker{
key = 'derek', --joker key
loc_txt = { -- local text
name = 'Derek',
text = {
'When Blind is selected,',
'create a {C:attention}Joker{}',
'{X:mult,C:white}X#1#{} Mult'
}
}
}

------------MOD CODE END----------------------

#

I also have an assets file with 2 photos

#

but I didnt really get deep into that one

red flower
#

where do you have this in your folders

also the video is really outdaed and i would recommend checking out newer stuff

edgy swan
#

I dont really know thats just a video my friend who managed to create a mod sent me

stoic void
#

Don’t you need a .json file? Or is it just convenient
If so does tomer have one

red flower
#

old smods used a header which is still supported but deprecated

edgy swan
#

I'm not aware of a .json file

red flower
#

i have no idea what the problem might be

dense fulcrum
#

I suppose old header is good for small mods, still sets up bad habits tho

red flower
#

it also doesnt have newer configs

edgy swan
#

thank you very much!
sadly I do have to go now so I'll try it out in a bit.

stoic void
#

A JSON file

red flower
#

the link i said recommends that yes

round lion
#

i think trying to add decksleeves is gonna make me grt a snyeurism

red flower
#

sleeves are just decks

#

whats the issue

round lion
#

trying to call register crashes at the loader

#

no info givem at all in the reason

red flower
#

wdym register

#

are you on smods 0.9

round lion
#

it says it works in the lsp

red flower
#

that hasnt been a thing for years

#

you just do SMODS.Object { ... } and thats it

frosty rampart
red flower
#

hi meta how are u

frosty rampart
#

hi n! doing pretty good, just got registered for my final semester of my bachelor's degree

now that stone-verhaul's released, i've got a new secret mod idea cooking up, and i'm gonna try to work on my art skills while high roller is still waiting on my smods pr to be closed

#

how are you?

red flower
#

nice!!

#

im doing fine, still not in the mood for continuing my mod these days lol

frosty rampart
#

totally understandable lmao
glad you're alright at least

short fulcrum
#

is there a way to make a blind reward display custom text? I have a blind that is supposed to give $20, but it makes the blind really wide and look bad, so I'd just like to replace it with "$20" if that's possible

red flower
short fulcrum
#

ah ok, I still have very little experience with patching, but I'll see if there's anything I can figure out

red flower
#

search for 'ph_blind_reward' in the code to find the places the reward is used

#

idk if there are others

short fulcrum
#

ok thanks, I'll have a look

hushed briar
#

should i hook the functions of cards i take ownership of or will it still run the base function if i define a new one

wraith jolt
#

I am trying to figure out how to implement the code of the Arm blind, where decreases poker hands, but only with even poker hands, like pair, two of a pair, and four a kind

#

but turning into a joker

#

which already quite complicated in my limited coding experience

#

calculate = function(self, blind, context)
if not blind.disabled then
if context.debuff_hand then
blind.triggered = false
if G.GAME.hands[context.scoring_name].level > 1 then
blind.triggered = true
if not context.check then
return {
level_up = -1

#

I know this is the arm but how I turn that into a Joker ability not a blind

frosty rampart
hushed briar
#

gotcha 👍

umbral zodiac
#

how many hooks can i make before i run out of memory challenge

frosty rampart
wraith jolt
#

calculate = function(self, card, context)
if context.debuff_hand_then and

#

calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() <= 10 and
context.other_card:get_id() >= 0 and
context.other_card:get_id() % 2 == 0 then
return {

#

hmm something like this?

frosty rampart
#

???

#

i said context.before, not context.individual

#

and you need to check if #context.scoring_hand % 2 == 0, not if a card's individual rank is even or odd

wraith jolt
#

Ok let me try again

#

sorry for being infuriatingly slow

#

calculate = context.before (self, card, context)

#

right then

#

#context.scoring_hand % 2 == 0

#

if context.debuff_hand_then and

#

or the other way around?

frosty rampart
#
calculate = function(self, card, context)
  if context.before then
    if #context.scoring_hand % 2 == 0 then
      return { level_up = -1 }
    end
  end
end

note that this will also level down high cards played with 2 and 4 cards if you have splash

wraith jolt
#

Thank you very much that very interesting that it will do that, I need to get better codding this

#

ok it didn't like it

#

key = "png.joker",
blueprint_compat = true,
rarity = 1,
cost = 4,
text = {
'Increase hand size by 2,'
atlas = 'png.Joker'
pos = { x = 0, y = 0 },
config = { extra = { h_size = 2 } },
calculate = function(self, card, context)
if context.before then
if #context.scoring_hand % 2 == 0 then
return { level_up = -1 }
end
end
end
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.h_size } }
end,
add_to_deck = function(self, card, from_debuff)
G.hand:change_size(card.ability.extra.h_size)
end,
remove_from_deck = function(self, card, from_debuff)
G.hand:change_size(-card.ability.extra.h_size)
end}

#

What did I position wrong

frosty rampart
#

you can wrap a code block in two sets of three tick marks (this character: `) to format it like code, that helps make it easier to read

like this
#

anyway without the crash i can't say for sure, but you appear to be missing a closing bracket after the text
and a comma after the atlas
and a comma after the calculate function's end

wraith jolt
#

see thank you for teaching me that

#

so wrap like this

#
    key = "png.joker",
    blueprint_compat = true,
    rarity = 1,
    cost = 4,
    text = {
        'Increase hand size by 2,'
    atlas = 'png.Joker'
    pos = { x = 0, y = 0 },
    config = { extra = { h_size = 2 } },
    calculate = function(self, card, context)
    if context.before then
    if #context.scoring_hand % 2 == 0 then
      return { level_up = -1 }
    end,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size } }
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size)
    end} ```
frosty rampart
#

not the quote mark ', the tick mark `

#

if you have a qwerty keyboard it's probably to the left of the 1 key

wraith jolt
#

found it

#

there we go

#

and this the error message I get

frosty rampart
#

yea this is an issue with how you set up in the joker in general, not my calculate code
i assume you have a line that's just SMODS.Joker { before the first line you sent here?

wraith jolt
#

yes you are correct

#

how should I adjust it

frosty rampart
#

the missing comma after the atlas and the missing closing bracket for the text are a good place to start

wraith jolt
#

ok

wraith jolt
# frosty rampart the missing comma after the atlas and the missing closing bracket for the text a...
    key = "png.joker",
    blueprint_compat = true,
    rarity = 1,
    cost = 4,
    text = {
        'Increase hand size by 2',
    }
    atlas = 'png.Joker',
    pos = { x = 0, y = 0 },
    config = { extra = { h_size = 2 } },
    calculate = function(self, card, context)
    if context.before then
    if #context.scoring_hand % 2 == 0 then
      return { level_up = -1 }
    end,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size } }
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size)
    end,}```
#

Better?

frosty rampart
#

almost
you also need a comma after the closing bracket for text that you just added

wraith jolt
#

this new error

#
    key = "png.joker",
    blueprint_compat = true,
    rarity = 1,
    cost = 4,
    text = {
        'Increase hand size by 2',
    },
    atlas = 'png.Joker',
    pos = { x = 0, y = 0 },
    config = { extra = { h_size = 2 } },
    calculate = function(self, card, context)
    if context.before then
    if #context.scoring_hand % 2 == 0 then
      return { level_up = -1 }
    end,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size } }
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size)
    end,}```
frosty rampart
#

oop wait I see now
you need two more ends after the return statement in the calculate function

wraith jolt
#

omg that was nightmare to calculate

#

thanks you that insane

#

I should be able to use this code for my other even and odd jokers

gaunt folio
#

It disables the cards being stationary if I use Chicot or Luchador, but not when defeated. why won't it move when defeated? What am I missing?

red flower
gaunt folio
#

Ah.

red flower
#

its not a good idea to set stuff in calculate without a strict context check

naive agate
#

though what exactly needs to be fixed in this case

red flower
#

setting the global to true in a strict context check

#

like in setting_blind or something

naive agate
#

like this?

#

ok it works

faint urchin
#

Is it possible to reset the effect of a tarot card after the end of a blind? I assume I can hook the end of blind function but I'm not sure what that is or if I can do this in the use function of a tarot card without a hook

daring fern
#

limber aspen
#

What's the context for self being drawn? I'm trying to do enhancement that copies other card's rank and suit, but when I change original while copy isn't in hand it does not sync so I want to sync when copy is being drawn

#

Or maybe a way of card being triggered when its not in hand?

pulsar hawk
#

i mean context.hand_drawn and context.other_drawn look like the places to start

daring fern
candid acorn
#

how can i make my class that is extended from SMODS.Joker class appear in the collection/be treated as a joker by the game?

#

using set='Joker' and obj_table = SMODS.Jokers doesnt seem to do it

gaunt phoenix
#

Hi everyone, is there a way to make discarded cards go back in deck ? For a joker or for a boss, I only need one of them (please ping me)

candid acorn
#

thats my best guess, but as i said idk exactly

#

but i think theres a context for discarding cards cuz trading card has to use something thats a good place to strat

gaunt phoenix
#

Hmmm yes that could work

daring fern
gaunt phoenix
hushed field
#

Anyone who's set up Cryptid crossmod know how to make it only load if Cryptid itself is loaded, rather than Cryptlib?

daring fern
hushed field
#

nevermind, found the CryptLibNoCryptid variable to check for

hushed field
gaunt phoenix
limber aspen
#

How do i make card.config.variable (Added externally) not reset on exit to menu? When I load run it just resets to nil

daring fern
limber aspen
#

Hmm I'll try

#

Thanks

hushed field
#

Are there any issues with x chips crashing on the latest smods

wintry solar
hushed field
#

forgot I had that enabled after fixing a compatibility bug

gaunt phoenix
#

I'm trying to make a clean flip animation, just like tarot cards in vanilla.

People are talking a lot about Vanilla Remade for understanding, but I can't manage to figure it out.. Could someone help me and try to explain me how to make a tarot-like animation on a card ? (pls ping me)

#

(for example, what is "mod_conv" ?)

hushed field
# gaunt phoenix (for example, what is "mod_conv" ?)

mod_conv is an argument you can put onto a tarot consumable, and takes the key of an enhancement. Every tarot card that turns cards into an enhanced cards shares code, so they just check to see if the mod_conv field is given

#

What type of card are you trying to make?

gaunt phoenix
#

A modded enhancement

#

should I do something like mod_conv([key]) ?

hushed field
#

no, no, mod_conv is a field and just takes a key, it's not a function you call

#

Can you give a bit more details on what you're trying to do? Are you just adding a tarot that creates your modded enhancement?

gaunt phoenix
#

I'm trying to make a modded consumable to enhance 2 cards into a modded enhancement, just like The Magician or The Empress

#

and I struggle on the animation part

hushed field
#

Ah, yeah. I can still explain how the flip animation works, but you won't need it

daring fern
hushed field
#

What you're missing is that the code already has a built-in way to just make that happen. The reason there's seemingly no code in those vanilla remade tarots is because there's a default format that those tarots need, and they just do it automatically. You only need to make sure there's a correct mod_conv field and max_highlighted field in their config table

#

Where max_highlighted is the amount of cards it works on, and mod_conv is the key for your enhancement

gaunt phoenix
#

oooh okay

#

Seems easier explained like that ;;

#

thanks !

hushed field
#

Vanilla Remade is a very good tool, but just looking at the code will only give you reference, not explanation, yeah, haha

wintry solar
#

This is a brilliant explanation Ice

stiff locust
#

vanilla remade's hanged man crashed when i tried to use it but other than that yeah its pretty solid

hushed field
#

The vanilla remade wiki is also very handy to check out, btw, but I see that there's no explanation of how to use mod_conv to just have that functionality immediately accessible

red flower
#

vanillaremade includes the code to change the enhancements manually with animations btw

hushed field
#

It's the block that's commented out, no? I think eyes sometimes glaze over that a bit, haha, but it's good its in there

red flower
#

yeah

gaunt phoenix
#

It worked perfectly, thanks

primal robin
#

goddamnit, UI moment

smoky holly
#

how do i change the atlas position of the sprite when it triggers?

#

or i guess, what variable would i reference

daring fern
smoky holly
#

thank you

naive reef
#

not sire what the lua? equivalent is of max ont

primal robin
#

damn hes so right

slim ferry
#

theres like two lua max values

#

theres math.maxinteger which is the largest before float loses whole number precision (iirc) and math.huge which is infinity

naive reef
#

does lua have/use ints at all?

#

or is it far enough abstracted it doesn’t matter

slim ferry
#

i mean kind of i think but it just automatically switches between them

#

there is a type function but it just returns "number" for both

naive reef
#

ah

#

so “number” goes to infinity it just loses precision slowly?

slim ferry
#

pretty much yeah

#

its just kind of always a float

#

the distinction doesnt matter much outside of vscode which will show the exact value of known integers but not display the values of other numbers

naive reef
#

can number be used as a boolean?

slim ferry
#

yeah

#

anything that isnt false or nil in lua will act as true

naive reef
#

0 is true?

slim ferry
#

yeah

naive reef
#

😭

slim ferry
#

it would kinda be annoying if it wasnt

#

tbh

#

since often values will be set as x = x or some number

#

so if 0 acts as false there that would be very inconvenient

naive reef
#

hm i see

#

quite different language than i’m used to

#

i mostly do c and java for context

jolly yarrow
#

So I am using Joker Forge and I want my Joker to destroy all Jokers with the Economy Type, add their sell value and store their functions inside my Joker. Is it possible to make this using Joker Forge? And if it is then how can I do it?

#

Doesn't seem like the Joker types are present in the editor.

red flower
#

wdym by joker types

slim ferry
#

i assume the wiki types

#

which

#

arent a thing code wise

#

so this isnt possible to make in general, joker forge or not

#

at least not at the moment

wind steppe
#

i think jokerforge lets you define types they just dont do anything

#

could be wrong though

slim ferry
#

well thats SMODS.ObjectType

#

which are referred to as pools in jf

#

and not types

wind steppe
#

no im thinking of something else

#

hold on

#

its not type its "effect" apparently

#

but you can see it as nil here implying sometimes its not nil

slim ferry
#

oh

#

like the unused vanilla thing

#

theres probably a good reason you cant check it since i dont think every vanilla joker even has that

spiral mural
#

what are all of the jokers in the base game that use mod_mult

hushed field
#

seems like a good question that ctrl-f can solve, haha

#

not sure if there's a list

spiral mural
#

i could do something a biit more hacky

#

by just replacing mod_mult if its from a vanilla joker

hushed field
#

what are you trying to do?

spiral mural
#

ok so

#

this won't modify the message that follows

#

it will modify the amount added though

slim ferry
#

hardcoded messages moment...

spiral mural
#

yea :P

slim ferry
#

also

#

every vanilla joker uses mod_mult right

spiral mural
#

💔

slim ferry
#

because the automatic messages are an SMODS thing afaik

spiral mural
#

well i can't erase every message sent through from a vanlla joker

#

even if it has mult in it because of scaling jokers

hushed field
#

No, right?

#

Oops, didn't mean to reply there

spiral mural
hushed field
#

I have some code in Kino that just turns every mod_mult into mult, so it's passed to the smods system

#

I've never encountered issues stemming from that

#

But I could for sure be missing something

slim ferry
#

anything that uses mod stuff to avoid the default message wont like that

spiral mural
#

just limit iti

#

to all of the vanilla jokers

hushed field
#

in which case you can limit it to vanilla jokers

#

which i think my code does, but i'm not sure

#

i haven't touched it in aaaages, haha

red flower
spiral mural
#

ok but what if their mod was awesome and not lame...

#

and there was some use cases where mod_mult is awesome..

hushed field
#

it's part of a bigger hook in my code, but I just disable the vanilla messages this way. I don't check for source mod, which I'm gonna add for safety, but it's been rare enough that I've not ever noticed or have had reports of any issues coming from it. It's just code that's part of a function Card.calculate_joker(self,context) hook

wintry solar
#

there is an ever so slight distinction between chips and chip_mod

#

I'm not aware of it the difference propagates across to the mult versions, I haven't bothered to check

short fulcrum
#

I'm trying to patch in a custom string to the dictionary

b_crop_custom_reward="$20"

but when I call for it it just returns "ERROR"

#

I tested it by calling for one of the already existing entries and it works fine, so it's something to do with this

#

does the prefix matter?

hushed field
#

what do you mean patch in a custom string?

short fulcrum
#

sorry if I'm not using the right terminology, I mean I'm adding a new entry to the dictionary so it can be called by the localize function

#

don't know why it broke the lines up like that

hushed field
#

How's your dictionary set up? It might be easier to help if we have some code snippets!

short fulcrum
#

oh can you create your own dictionary? I was patching it into the one in Balatro's source code

#

didn't know you could make your own

#

how would I go about that

red flower
short fulcrum
#

I did try and use my own localization file initially but I didn't know how to make it work

#

for context I'm trying to change the blind reward text for a specific boss blind

#

oh wait I see it in the wiki

#

ok I guess I'll try do that

#

though what's the difference between dictionary and v_dictionary? should I use one over the other?

red flower
#

v_ is for entries with variables (#1# etc)

short fulcrum
#

ah okay, the normal one should suffice

slim ferry
#

why does my game not like this gradient... it crashes because compare number when nil whenever its displayed

slim ferry
#

what

#

wdym

red flower
#

oh sorry i misread the color

#

i didnt see it was rarity and i thought you were indexing a color

hushed field
slim ferry
#

actually isnt G.C.RARITY[4] just G.C.PURPLE

red flower
#

no

slim ferry
#

fuck

#

well idk what to do then

red flower
#

can you copy it here so i can test

short fulcrum
slim ferry
#

i forgot

#

to do SMODS.Gradient

#

😭

#

my bad gang

hushed field
short fulcrum
#

its gimmick is that you lose $10 every hand played, but the reward is $20, so it encourages builds that can beat it in one hand

hushed field
#

Oh, I've never seen a modded blind mess with the payout there! I'd have to look into the code to see how you'd set that up, as I'm not sure Blinds have a build in way to change that 🤔 I see why you were looking into patches, haha

short fulcrum
#

I've seen people ask the question in here before but they went unanswered

red flower
#

its hardcoded to repeat the $ symbol