#💻・modding-dev

1 messages · Page 638 of 1

viscid talon
#

does anyone know how to make a challenge that only allows one boss blind to show up

red flower
#

change_base

red flower
iron breach
#

main.lua:1970: [SMODS wath_mod "jokers.lua"]:235: attempt to index field 'wath_mod_rainbow_joker' (a nil value)

#

is this a syntax error

red flower
#

no

#

thats the value being nil

lunar urchin
#

im getting a simular crash "game.lua:1432 attempt to index global 'pokermon_config' [a nil value]

#

can someone help?

red flower
#

this is probably your pokermon folder being nested

lunar urchin
#

what does that mean?

viscid talon
#

idk what that means

red flower
#

what part

iron breach
red flower
#

oh

#

are you calling reset_wath_mod_rainbow_joker anywhere

iron breach
#

i basically just copied the ancient joker code and edited the effect so i think it has to be a syntax error i made while modifying it

#

i have tried like 3 different ways to manually set wath_mod_rainbow_joker but it still says it's a nil value

red flower
#

can you show me your current code including reset_game_globals

iron breach
red flower
#

can i see reset_game_globals too

#

also this is not what i meant, i meant using the local suit line in calculate

iron breach
red flower
#

did you read the comment on vanillaremade..

iron breach
#

i see

red flower
iron breach
#

still not working even after adding the global reset script

tight pumice
#

If I want to check for the presence of a specific modded joker, can I check for the key “prefix_jokerkey” or does that not work

red flower
red flower
tight pumice
#

Missing the j, got it

iron breach
tight pumice
#

I’m taking ownership of the blue seal to modify it, part of what I want to do involves making it not perform its usual function but it seems like overriding the calculate function just adds to it rather than replacing it. Is there a way for me to modify its usual calculate function?

mystic river
#

normally I'd say change its internal name (not key)
but i think seals are an exception to that piece of vanilla logic

red flower
tight pumice
#

I was worried that might be the case, I think I approached my implementation from a bad starting point

red flower
#

no that makes sense

#

its just that this is something missing in smods

tight pumice
#

Basically I’m making a guy that makes it so blue seals give negative planets

#

I implemented it by taking ownership of the blue seal, but since I’m not replacing the calculate but adding to it, they just end up making the negative planet as well as the normal planet

red flower
#

you can hook create_card and check if it uses seed blusl :3

tight pumice
#

Interesting may

#

Okay*

#

So the card creation knows that it’s coming from a blue seal

red flower
#

yes

tight pumice
#

Sounds like I can skip taking ownership entirely which is probably the best practice

red flower
#

i would say take ownership is usually best practice

#

this is just easier and take ownership is janky in this case exactly

tight pumice
#

Good to know moving forward, this was my first time using take ownership so I wasn’t really sure what the limits were

red flower
#

in theory smods should unhardcode this to make take ownership work properly

candid arch
red flower
candid arch
#

also i wanted to ask what SEALS was in this context? i know its related to the mod, but i dont know what i would replace it with if i put it in my code.

mystic river
#

global table that seals on everything stores stuff in, such as those functions

#
SEALS = {
 get_ids = function()
 -- this is SEALS.get_ids
 end
}
tight pumice
#

Trying to figure out how to hook SMODS.add_card for the blue seal thing but struggling to find documentation for add_card and how to access stuff like the seed thing to detect if the card was created by a blue seal

red flower
#

the seed is the key append

harsh belfry
#

yeah add_card is a utility function for modders

#

the game itself doesn't use it

tight pumice
#

The key thing should be all I’m missing then

#

the key is “blusl”?

harsh belfry
tight pumice
#

Yeah I mean key append

#

Trying to do it like this

#

First time doing any sort of hook thing so I could easily be going about it wrong

#

Is there a specific location I should be putting the hook?

slim ferry
#

you should probably be hooking create_card

#

idk if key_append is stored after

tight pumice
#

I couldn't find that one, is it not under Card

slim ferry
#

no

#

because it isnt a method

#

its just a global

tight pumice
#

I see

#

Alright let me try that

#

How I tried to implement it

#

Somehow, all it managed to do is make it so blue seals give random planets when the joker is present

#

I managed to code my way into making a joker that reverts blue seals to their prebuff state

#

Oh ignore this I already see an issue

red flower
#

i see several issues

#
local create_card_ref = create_card
function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
  local card = create_card_ref(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
  if next(SMODS.find_card("key")) and key_append == "blusl" then
    card:set_edition("e_negative")
  end
  return card
end
tight pumice
#

Yeah it's making more sense. I am very very curious on how exactly whatever I did the first time led to the blue seals acting that way

red flower
#

because you removed all the arguments

#

specifically forced_key where the planet key is passed

tight pumice
#

Can't get the key_append to work, figuring out through debug prints that it isn't working but the joker check is. Tried "key_append == "bluesl"" and "card.key_append == "bluesl"" Simple mistype

candid arch
mystic river
#

i mean yes, you would need to actually copy the code to get a copy of the code

candid arch
#

ughghhfghfj maybe i shouldnt bother

#

i dont understand any of this code

tight pumice
#

I stop coding for a month and all of a sudden it's like I'm relearning how to speak English

candid arch
#

🙂‍↕️

tight pumice
#

I need to make some more jokers and get the gears turning again

#

Thanks for the help the negative planet joker works now, hopefully now I can properly hook things in the future when it comes up

brisk tree
#

is there a way to check if your last action was either playing a hand or a discard?

#

Should be very easy to code but wanted to know if that already exists somewhere so I don't repeat code

long sun
#

is there a better way of doing this? this also doesn't work if any +mult comes after it

#

this is trying to balance by a %

#

[i can't find what AiJ does because it uses a custom return]

red flower
red flower
#

git

long sun
#

i could to be fair

#

was wondering if there was an undocumented SMODS thing mostly

red flower
#

not for this no

brisk tree
#

I just did this, even if it's very dirty

#

Also is saving anything in G going to cause issues other than possibly causing issues with other mods?

red flower
#

that's how i would do it

primal robin
#

afaik you can return balanced = true or smth like this to o plasma deck effect

red flower
red flower
brisk tree
red flower
#

it's like a custom plasma

mystic river
primal robin
#

I thought it does support number value for balanced

mystic river
#

I'll check but i don't think so

primal robin
#

no it itsnt, hm

#

implement number in it shouldnt be much effort right

red flower
#

i dont think so

mystic river
#

relatively, yeah, should be easy

#

the main thing you'd have to do is
decide what it would mean to balance over 100%

primal robin
#

maybe just clamp it in 0 < n < 100

#

maybe optionally allow -100 < n < 100

#

This kind of effect present in mp challenge

#

Where balance actually destabilize

hushed briar
#

anyone know of a mod that extends SMODS.Center or similar that i can look at as reference?

rigid solar
#

From the key of a blind, how can I access to the blind itself? Like say I have bl_club and I want to know if this blind is a showdown boss or not (most likely by checking blind.boss.showdown, but the problem is getting the blind object)
edit: G.P_BLINDS[key]

daring fern
#

rigid solar
#

K new question
I want to add a keybind to my mod but I want the user to be able to change the key. How do I do that in my config menu? I know Handy has keybinds that we can change but the code it all over the place I don't understand shit 💀 and i don't know any other mod that lets you change keybinds

#

after that i just set key_pressed = SMODS.current_mod.config.key in the SMODS.Keybind, but i need a config menu for that to begin with

dapper sun
#

anyone know why the contents of G.GAME.elle_popup_shops[shop].data aren't saving?

-- Init game hook - initialize game variables
local igo_hook = Game.init_game_object
function Game:init_game_object()
    local g = igo_hook(self)
    
    -- Add shops here
    g.elle_popup_shops = {
        -- Rebecca Shop
        rebecca = {
            default_reroll = 4, -- Reroll cost when shop resets
            reroll = 4, -- Actual reroll cost
            reroll_cost = 2, -- Cost increase amount
            reset_on_open = true,
            data = {}, -- This isn't saving for some reason???
            first_open=true
        },
        
        -- [[BIG SHOP]]
        spamton = {
            reset_on_open = true,
            default_reroll = 4, -- Reroll cost when shop resets
            reroll = 4, -- Actual reroll cost
            reroll_cost = 2, -- Cost increase amount
            data = {},
            first_open=true
        }
    }
    return g
end```for context, it's a table that contains tables that contain `:save`d cards
#

_ _ i'm going out for a few days, i'll worry abt this once i get back

rigid solar
#

yeah true

#

still have to make a config menu for that tho and idk how 💀

daring fern
dapper sun
#

i'm doing the same thing that i was doing before i refactored the code to fit multiple shops

#

and it was working fine before

#

i know it's going into the table just fine bc the contents persist when closing and opening the shop

#

it only disappears when exiting the run and going back in

#

but other things like the reroll cost persist

warm solar
#

how do i get a hands current mult?

dapper sun
soft cave
#

I have created a patch for latest version of balatro
that removes junk code
and optimizes images and font
to use less file size
i doubt i can post it on GitHub though

slim ferry
#

You definitely cant

sturdy compass
#

Oh yeah definitely not

primal robin
#

also this patch will make game not compatible with most mods for sure

golden field
#

why does the halving get undone immediately when a card is scored

SMODS.Seal {
    key = 'flint',
    atlas = 'wacleseals',
    pos = { x = 11, y = 1 },
    badge_colour = HEX("e56a2f"),
    config = { extra = { xmult = 2 } },

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.seal.extra.xmult } }
    end,

    calculate = function(self, card, context)
        if context.before and context.cardarea == G.play then
            mult = mod_mult(math.max(math.floor(mult * 0.5 + 0.5), 1))
            hand_chips = mod_chips(math.max(math.floor(hand_chips * 0.5 + 0.5), 0))
            update_hand_text({ sound = 'chips2', modded = true }, { chips = hand_chips, mult = mult })
        end
        if context.main_scoring and context.cardarea == G.play then
            return {
                xmult = card.ability.seal.extra.xmult
            }
        end
    end
}
primal robin
#

because you need actually update chips and mult

#

Youre doing it only visually

daring fern
wanton jolt
#
SMODS.Atlas {
    key = "LBPHC",
    path = "LBPHC.png",
    px = 71,
    py = 95,
}

SMODS.Atlas {
    key = "LBPLC",
    path = "LBPLC.png",
    px = 71,
    py = 95,
}

SMODS.DeckSkin {
    key = "LBP",
    suit = "Spades",
    loc_txt = "LittleBigPlanet",
    palettes = {
        {
            key = 'lc',
            ranks = {'Jack', 'Queen', "King"},
            display_ranks = {"King", "Queen", "Jack"},
            atlas = "LBPLC",
            pos_style = 'ranks',
        },
        {
            key = 'hc',
            ranks = {'Jack', 'Queen', "King"},
            display_ranks = {"King", "Queen", "Jack"},
            atlas = "LBPHC",
            pos_style = 'ranks',
            colour = HEX("1E2C30"),
        },
    },
}
golden field
#

question: how do i stop this from unflipping the card when selecting it

        if card.facing == 'front' and context.cardarea ~= G.play then card:flip() end
        if card.facing == 'back' and context.cardarea == G.play then card:flip() end
        if card.facing == 'front' and context.after and context.cardarea == G.play then card:flip() end
mystic river
#

change the second if to an elseif

#

what's happening is the first if flips the card, then the second one checks its facing, it's facedown, and it flips it

wanton jolt
# wanton jolt ```lua SMODS.Atlas { key = "LBPHC", path = "LBPHC.png", px = 71, ...
INFO - [G] 2025-12-30 02:58:03 :: ERROR :: StackTrace :: Oops! The game crashed
[SMODS _ "src/utils.lua"]:3255: attempt to concatenate local 'atlas_key' (a boolean value)
Stack Traceback
===============
(1) Lua local 'handler' at file 'main.lua:612'
        Local variables:
         msg = string: "[SMODS _ \"src/utils.lua\"]:3255: attempt to concatenate local 'atlas_key' (a boolean value)"
         (*temporary) = Lua function '?' (defined at line 31 of chunk [SMODS _ "src/logging.lua"])
         (*temporary) = string: "Oops! The game crashed\
"
(2) LÖVE metamethod at file 'boot.lua:352'
        Local variables:
         errhand = Lua function '?' (defined at line 598 of chunk main.lua)
         handler = Lua function '?' (defined at line 598 of chunk main.lua)
(3) Lua field 'create_sprite' at Steamodded file 'src/utils.lua:3255'
        Local variables:
         X = number: 5.68212
         Y = number: 2.93309
         W = number: 2.45854
         H = number: 3.30146
         atlas = nil
         pos = table: 0x33d94fe8  {y:0, x:2}
         atlas_key = boolean: false
         (*temporary) = C function: assert
         (*temporary) = nil
         (*temporary) = string: "SMODS.create_sprite called with invalid atlas key: "
         (*temporary) = boolean: false
         (*temporary) = number: 151
         (*temporary) = table: 0x33fd8958  {click_offset:table: 0x33aab498, children:table: 0x33e13ed0, sprite_pos:table: 0x337d2bb0, T:table: 0x33df0368, offset:table: 0x33db2280, role:table: 0x33de2918 (more...)}
         (*temporary) = number: 2.70674
         (*temporary) = string: "attempt to concatenate local 'atlas_key' (a boolean value)"
(4) Lua method 'set_sprites' at Steamodded file 'src/overrides.lua:1744'
        Local variables:
         self = table: 0x33ab1510  {click_offset:table: 0x33f9fbe0, palette:table: 0x33d91de8, children:table: 0x33dcd7f0, ambient_tilt:0.2, parent:table: 0x33feb108, alignment:table: 0x33d666b8 (more...)}
         _center = nil
         _front = table: 0x33fb35f8  {lc_atlas:cards_1, pos:table: 0x33fb36e8, value:King, hc_atlas:cards_2, name:King of Spades, suit:Spades}
         _atlas = nil
         _pos = table: 0x33d94fe8  {y:0, x:2}
         (*temporary) = table: 0x33dcd7f0  {front:table: 0x33fd8958, center:table: 0x33d65550, back:table: 0x33de8588, shadow:table: 0x33df8800}```
#

crashes when loading custom skin, says there is no atlas key?

mystic river
#

then you have additional problems to solve, which i am unable to divine from the tiny out of context code snippet you have provided

lament agate
#

how would i add

#

sell button

#

to playing cards

golden field
# mystic river then you have additional problems to solve, which i am unable to divine from the...

here's the entire code ig

SMODS.Seal {
    key = 'fish',
    atlas = 'wacleseals',
    pos = { x = 4, y = 0 },
    badge_colour = HEX("3e85bd"),
    config = { extra = { chips = 11, prepped = nil, upgraded = nil } },
    loc_vars = function(self, info_queue, card)
        return { vars = { 
            card.ability.seal.extra.chips
        } }
    end,

    calculate = function(self, card, context)

        if card.facing == 'front' and context.cardarea ~= G.play then card:flip()
        elseif card.facing == 'back' and context.cardarea == G.play then card:flip() end
        if card.facing == 'front' and context.after and context.cardarea == G.play then card:flip() end

        if context.press_play then
            if context.cardarea == G.hand then
                card.ability.seal.extra.prepped = true
            end
        end

        if context.to_area == G.hand and card.ability.seal.extra.prepped then
            context.other_card.ability.perma_bonus = (context.other_card.ability.perma_bonus or 0) + card.ability.seal.extra.chips
            card.ability.seal.extra.upgraded = true
        end

        if context.setting_blind or context.hand_drawn then
            card.ability.seal.extra.prepped = false
            if card.ability.seal.extra.upgraded then
                card.ability.seal.extra.upgraded = false
                return {
                    message = localize("k_upgrade_ex"),
                    colour = HEX("3e85bd"),
                }
            end
        end

        if context.end_of_round then 
            card.ability.seal.extra.prepped = false
        end

    end,
}
wanton jolt
#

I dont understand why the mod crashed when it tried loading the sprite

golden field
#

how do i fix this

#
            tcg_ox_seal = {
                name = "The Ox",
                text = {
                    "test",
                },
            },
gilded blaze
# golden field how do i fix this
descriptions = {
    Other = {
        tcg_ox_seal = {
            name = "The Ox",
            text = {
                "test",
            },
        },
    },
},
misc = {
    labels = {
        tcg_ox_seal = "The Ox",
    },
},
gilded blaze
#

it's stated in the docs btw

soft cave
wanton jolt
#

Does anyone have an idea on why it crashes when i switch to my custom 3-card) deck skin?

SMODS.Atlas {
    key = "LBPHC",
    path = "LBPHC.png",
    px = 142,
    py = 190,
}

SMODS.Atlas {
    key = "LBPLC",
    path = "LBPLC.png",
    px = 142,
    py = 190,
}

SMODS.DeckSkin {
    key = "LBP",
    suit = "Spades",
    loc_txt = "LittleBigPlanet",
    

    palettes = {
        {
            key = 'lc',
            ranks = {'Jack', 'Queen', "King"},
            display_ranks = {"King", "Queen", "Jack"},
            atlas = "LBPLC",
            pos_style = 'ranks',
        },
        {
            key = 'hc',
            ranks = {'Jack', 'Queen', "King"},
            display_ranks = {"King", "Queen", "Jack"},
            atlas = "LBPHC",
            pos_style = 'ranks',

            colour = HEX("1E2C30"),
        },
    },
}
gilded blaze
#

atlas in SMODS.DeckSkin must include your mod prefix iirc

#

here's mine as an example, sgt is the mod prefix

wanton jolt
#

oh my god

#

it was that

gilded blaze
#

wrong atlas size (you put 1x in 2x)

#

lmao

wanton jolt
#

i think i multiplied by 2 the size

#

thank you so much

wanton jolt
gilded blaze
#

add field hc_default

wanton jolt
#

hc_default = true, right

#

cuz i did that

#

ugh its not the same color as the other cards

gilded blaze
#

then I have no idea

wanton jolt
#

uhhh i just reduced the base skin contrast by 25%

#

hc default is for the unchanged cards

sturdy compass
wanton jolt
gilded blaze
wanton jolt
#

wow awesome thanks

#

how about like a highlight text

#

kinda like that

golden field
#

how do i fix this

#

-# happens when i play a card with that seal

daring fern
golden field
#

wrong image fuck

daring fern
golden field
#

ok all of a sudden it ain't working

SMODS.Seal {
    key = 'eye',
    atlas = 'wacleseals',
    pos = { x = 4, y = 1 },
    badge_colour = HEX("4b71e4"),
    config = { extra = { xmult = 1, eye_gain = 0.25 } },

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.seal.extra.xmult, card.ability.seal.extra.eye_gain } }
    end,

    calculate = function(self, card, context)
        if context.before and context.main_eval and G.GAME.hands[context.scoring_name] and G.GAME.hands[context.scoring_name].played_this_round then
            card.ability.seal.extra.xmult = 1
            return {
                message = localize("k_reset"),
                colour = HEX("4b71e4")
            }
        end

        if context.before and context.cardarea == G.play and not G.GAME.hands[context.scoring_name].played_this_round then
            card.ability.seal.extra.xmult = card.ability.seal.extra.xmult + card.ability.seal.extra.eye_gain
            return {
                message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.seal.extra.eye_gain } },
                colour = HEX("4b71e4")
            }
        end

        if context.main_scoring and context.cardarea == G.play then
            return {
                xmult = card.ability.seal.extra.xmult
            }
        end
    end
}
#

-# supposed to gain xmult before scoring

#

-# it just does nothing

#

update: i found a fix

#

...which was to REWRITE THE FUCKING CODE AND DERIVE IT FROM A JOKER THAT DOES A SIMILAR THING 😭

sturdy compass
#

Hopefully this makes the lives of people who use custom cardareas way easier

vale crow
#

Is there a function similar to SMODS.merge_lists but instead of making a list of cards that are in EITHER of the lists, it makes a list of cards that are in BOTH lists?

gilded blaze
sturdy compass
#

Lmfao

golden field
#

chat how do i make a new deck

wanton jolt
#

wdym new deck

golden field
wanton jolt
#

as in a red deck or as in deck skin

golden field
wanton jolt
#

oh yeah, blindside at home

golden field
#

-ish

wanton jolt
golden field
#

ehhhhhhh

wanton jolt
#

u have to change the config itself

#

hi, send lua

daring fern
#

sage crater
#

in my mod, my code basically just iterates through all the cards and changes them after instantiation

#

dunno if that’s standard or even the best way of doing it, but oh well

#

here’s my code for a mult deck:


SMODS.Back {
    key = "multDeck",
    atlas = "Deck",
    pos = {
        x = 0,
        y = 0
    },
    loc_txt = {
        name = "Mult Deck",
        text = {"{C:MULT}+4{} mult", "Added cards also get changed"}
    },
    apply = function(self)
        G.E_MANAGER:add_event(Event({
            func = function(self)
                for _, _card in pairs(G.playing_cards) do
                    _card:set_ability('m_mult')
                end
                return true
            end
        }))
    end,
    calculate = function(self, card, context)
        if context.playing_card_added then
            for _, _card in pairs(context.cards) do
                _card:set_ability('m_mult')
            end
        end
    end
}
daring fern
sage crater
#

like is it the context or something?

sleek valley
#
loc_vars = function(self, info_queue, card)
    info_queue[#info_queue+1] = G.P_SEALS.wip_burned
    local numerator, denominator = SMODS.get_probability_vars(card, card.ability.extra.burn_num, card.ability.extra.burn_denom)
    return { vars = { numerator, denominator } }
end,
calculate = function(self, card, context)
    if context.after and context.cardarea == G.jokers then
        for _, scored_card in ipairs(context.scoring_hand) do
            if SMODS.pseudorandom_probability(card, 'wip_flame', card.ability.extra.burn_num, card.ability.extra.burn_denom) then
                scored_card:set_seal("wip_burned")
                return {
                    message = localize('k_burn'),
                    colour = G.C.SUITS.Hearts
                }
            end
        end
    end
end

im trying to make a joker that's supposed to give scored cards a seal but it only applies to one card per scored hand when i debug

red flower
sleek valley
#

Ah
Well im trying to make it based on a 1 in 5 chance for every card, so is there any way to do that?

red flower
#

don't return in the loop

#

if you want a message for each card then you can use SMODS.calculate_effect({message = localize('k_burn'),colour = G.C.SUITS.Hearts}, card) but it needs to be in an event for the correct timing

sleek valley
#

tyyyyy :3

vale zinc
#

Do modded hands like Spectra get stored in evaluate_poker_hand(), or is there somewhere else where they all end up while a hand is calculated?

red flower
#

if you need the current hand outside an object i would recommend just getting it with mod calculate

vale zinc
red flower
vale zinc
red flower
#

functions don't store things

vale zinc
round lion
#

i have locvars like this, but when i instantly crash instead when entering the shop.

#

i might be stupid

red flower
red flower
#

that's in G.handlist

vale zinc
round lion
#

the crash was from me calling the config table "ability"

vale zinc
# red flower that's in `G.handlist`

I mean that, say, a Straight Flush or a Straight Spectrum would be bumped down to a Straight, a Full House to a Two Pair, and a High Card would go unaffected.

round lion
red flower
vale zinc
#

And how do I call that context from within a patch that's not within the SMODS.Blind{} code?

red flower
#

why are you doing it in a patch

vale zinc
#

So it happens 'fore any other hand-scoring calculation is done.

red flower
red flower
vale zinc
#

Or just the next one down that's also in context.poker_hands?

red flower
#

(well all of them are in poker_hands but the next non-empty one)

vale zinc
#

I also want these hands to have the Chips/Mult of the next-lowest-down hand type. Do I just run G.FUNCS.get_poker_hand_info(G.play.cards) a second time?

red flower
#

that context that i linked does that

slim ferry
#

how does steamodded make it so the wheel boss blind displays denominator changes? vanilla localization doesnt allow for it and i cant seem to find it in SMODS code or localization

daring fern
wraith jolt
#

Is there resources pac, with all the codes from the vanilla Jokers?

#

Because trying to figure the Odd and Even mechanic

daring fern
slim ferry
#

Do the duplicate edition descriptions without formatting in v_dictionary ever even get used?

hushed briar
#

anyone know of a mod that extends SMODS.Center or similar?

naive agate
#

how can I debuff all cards besides face cards for a boss blind

daring fern
naive agate
#

cheers

long sun
#

what's the best way to remove some ranks from the deck? [i'm working on a deck, not a joker]

#

like config.no_faces but more loose

daring fern
long sun
#

gotcha 👍 thanks

white hull
#

how can i add a variable to G.GAME that'll get made on every new run so i can use it in functions later?

slim ferry
#

use SMODS.current_mod.reset_game_globals function and check run_start

faint yacht
#
SMODS.current_mod.reset_game_globals = function(run_start)
    if run_start then G.GAME.thegremlin = {} end
end

as example.

white hull
#

i see

#

where do i put this tho? if i want it to always be present?

#

just in the main lua file so this code always runs?

slim ferry
#

put this anywhere where the code would run yeah

white hull
#

i see, thanks!

naive phoenix
#

is there any way to check if a deck skin is currently being used?

keen hinge
#

how does pos_style = ‘rank’ work and how is it different from ‘suit’?

#

is rank just any cards that i want?

random basin
#

finished the base mahjong custom hand, now I need to figure out if I can implement custom rewards and bonuses based on the yaku of a hand instead of just making more mahjong hand variants as seperate poker hands

#

ex. golden joker's extra cash but gained from scoring a specific custom hand variation

#

ok so I found the logic for to do list, how would I implement it as a constant game state instead of being tied to the joker object?

white hull
wanton jolt
#

suit is according to a suit

#

and deck is for 52

#

collab by default does the face cards iirc

random basin
#

I forget if todo list actually puts down royal flush or not

random basin
#

mahjong

wanton jolt
#

oh

#

are u gonna change the cards

#

so that theres a mahjong deck

random basin
#

yeah I'll eventually make the honor tiles

#

and the mahjong deck will start with the increased selection and hand size

wanton jolt
#

i got an idea

random basin
#

sure

wanton jolt
#

not related

#

but u making ur mahjong

#

and my mom pestering me with facebook invites

#

scrabble balatro

keen hinge
wanton jolt
#

yes

keen hinge
#

how would the sprites be laid out?

wanton jolt
#

an atlas of 4 to 1

#

ratio

keen hinge
#

i see

#

thanks

wanton jolt
#

np

keen hinge
wanton jolt
#

yeah but u have to add the ace i guess

keen hinge
#

got it

short fulcrum
#

I've got a joker that's supposed to disable the boss if the first discard of the round is a single card with a seal, but when the ability is triggered the game crashes. It only started doing that after I added the part at the bottom to juice the joker up. I'm going a bit mad trying to fix it when I'm probably just missing something obvious

red flower
short fulcrum
#

ok, I'll report back in a sec

red flower
#

wait no its this message i think

short fulcrum
#

oh what about it

red flower
#

no idea but the discarded card is nil for some reason

short fulcrum
#

weird

#

I'm very new to this so forgive me if I sound foolish

#

still trying out what you said anyway

red flower
#

i would try removing that message too

short fulcrum
#

oh awesome it worked

#

thank you

#

weird that was it though

red flower
#

maybe it removes the card before the message but that shouldnt happen normally

short fulcrum
#

yeah it's weird

ashen adder
#

im trying to patch this line in better_calc.toml in smods:

if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and scoring_hand[i]:can_calculate() and SMODS.pseudorandom_probability(scoring_hand[i], 'glass', 1, scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then

i have this in my toml file:

pattern = "if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and scoring_hand[i]:can_calculate() and SMODS.pseudorandom_probability(scoring_hand[i], 'glass', 1, scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then"

but then it says in the log:

WARN - [♥] Pattern 'if SMODS.has_enhancement(scoring_hand[i], \'m_glass\') and scoring_hand[i]:can_calculate() and SMODS.pseudorandom_probability(scoring_hand[i], \'glass\', 1, scoring_hand[i].ability.name == \'Glass Card\' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then' on target 'functions/state_events.lua' for pattern patch from Cryptid\lovely\Probability.toml resulted in no matches

What is going on here??

red flower
#

also i think glass cards are taken ownership of

#

yeah i dont see that smods patch apply in my dump

ashen adder
red flower
#

yeah no the issue is what i just said

#

what's the goal here

ashen adder
#

im trying to fix the cryptid's glass stake

#

so in glass stake it should treat every card like glass so it can break but with just lower probability

red flower
#

well no idea how cryptid does it but that's the destroy code i just linked

ashen adder
#

oh i see

#

so i should patch it instead?

red flower
#

you can yes, or take ownership of it

#

what's the issue with the stake

ashen adder
#

well, in the toml file it just references the outdated smods line

slim ferry
#

It gives a chance for cards to break after scoring right?

ashen adder
#

and also i think it just hasnt been updated to the newest smods probability thingy

ashen adder
red flower
#

oh i see the code

slim ferry
#

Im pretty sure it could just use stake calculate now that thats a thing

#

If the goal is just to destroy cards

red flower
#

targeting glass cards is not going to work

ashen adder
slim ferry
#

And to force cards to shatter you could set a flag on the card right before destroying and check for that in a hook to whatever smods function checks if a card should shatter

red flower
#

Card:shatters

#

if it's a stake you can just set it to always true for the stake

slim ferry
#

Well then it would also affect card destruction that isnt from the stake

red flower
ashen adder
#

ughhh bruuuh i see
and here i was thinking that it would be an easy fix 🥲

#

well thanks anyway guys <3

red flower
#

it's not hard, give me a sec

from reading the code i assume only playing cards are destroyed right?

ashen adder
red flower
# ashen adder i mean yea its prob not super hard but its late tho so i think imma just go to s...

something like this

local glass = {
    object_type = "Stake",
    name = "cry-Glass Stake",
    key = "glass",
    pos = { x = 2, y = 2 },
    atlas = "stake",
    applied_stakes = { "cry_ruby" },
    modifiers = function()
        G.GAME.modifiers.cry_shatter_rate = 30
    end,
    shiny = true,
    order = 21,
    colour = HEX("ffffff8f"),
    calculate = function(self, context)
        if context.destroy_card and context.cardarea == G.play and G.GAME.modifiers.cry_shatter_rate
            and SMODS.pseudorandom_probability(self, 'cry_shatter', 1, G.GAME.modifiers.cry_shatter_rate) and not SMODS.is_eternal(context.destroy_card) then
            card.cry_glass_trigger = true
            return { remove = true }
        end
    end
}

local smods_shatters_ref = SMODS.shatters
function SMODS.shatters(card)
    return card.cry_glass_trigger or smods_shatters_ref(card)
end
red flower
#

you could make this more global by moving the calculate to SMODS.current_mod.calculate if other things use that modifier in the future

ashen adder
#

also, speaking of broken cryptid stakes there's azure stake, which is supposed to take away 20% off of joker values but it uses cryptid's misprintize lib and upon the first look it wasn't really obvious to me what went wrong there so i just kinda gave up on it for now 🫠

red flower
#

oh dont ask me about misprintize i refuse to deal with that

ashen adder
red flower
#

my jokers stay with their values intact as Thunk intended

slim ferry
ashen adder
slim ferry
#

I mean i dont see any issues with it

#

Card.set_ability is the same function that sets all the base values

#

So thats the perfect place to apply the azure stake modifier

ashen adder
#

huh alright i'll look into it ig, thanks

#

i just didn't even really look that deep into it i kinda just skimmed through it, trying to understand

vale zinc
#

This isn't reevaluating the played hand like I want it to. Whenever I select/deselect a card, the innermost code-block activates, but I want it to only kick in when the hand is played. What do I do?

LAPSEMS.next_lowest_valid_hand = function(table_of_hands, allotted_decreases )
    local allotted_decreases = allotted_decreases or 1
    local number_of_decreases = 0
    local final_product = nil
    local forbidden_hands = {'High Card', 'None'}
    
    for i = 1, #G.handlist do
        current_hand = G.handlist[i]
        if #table_of_hands[current_hand] > 0 then
            number_of_decreases = number_of_decreases + 1
            final_product = current_hand
            if number_of_decreases >= allotted_decreases then
                return final_product
            end
        end
    end
    
    return final_product or (forbidden_hands[1] or 'High Card')
end
calculate = function(self, blind, context)
    if not blind.disabled then
        if context.evaluate_poker_hand then
            blind.triggered = true
            blind:wiggle()
            
            replace_scoring_hand = LAPSEMS.next_lowest_valid_hand(context.poker_hands)
        end
    end
end
red flower
vale zinc
candid arch
#

how do i detect if a card was retriggered?

candid arch
#

?

#

i'm trying to make a joker that adds half of a base card's chips to the joker when that card gets retriggered

river grail
#

Is it possible to add a dummy playing card that doesn't show up in the UI, only for calculation purposes?
I want to do a calcaulation for a tarot card without making my code super redundant, and I feel like having a dummy card be created for the purpose of it sounds like a decent option.

#

What's going on in the code:

  • A copy of the selected card is created and its suit is changed into... say a spade.
  • The selected card is "merged" with the dummy card, to keep consistency with the rest of my code.
  • The dummy card is deleted

I plan on having all this behind the scenes so the dummy card doesn't actually.. exist when playing.

There's probably a better way of doing this, but I don't know how.

river grail
#

Kind of. Just something behind the scenes that doesn't have card randomly appear out of nowhere, if that makes sense

#

lowkey im scared this is super obvious and i should just read the manual

harsh belfry
#

what do they use

river grail
harsh belfry
#

not really vanilla does it all the time

daring fern
harsh belfry
#

also you could just

#

allow your functions to take suit and rank

#

instead of a card

river grail
# daring fern What do your functions do?
---@param card1 table | Card
---@param card2 table | Card
---@return table
--- Returns the combined rank table of two cards.
CARDMERGE.MergeRankTables = function(card1, card2)
    local rankTable1 = CARDMERGE.InitRankTable(card1)
    local rankTable2 = CARDMERGE.InitRankTable(card2)

    return MergeTables(rankTable1, rankTable2)
end

function MergeTables(table1, table2)
    local output = {}
    for key, _ in pairs(table1) do
        output[key] = true
    end
    for key, _ in pairs(table2) do
        if not table1[key] then
            output[key] = true
        end
    end
    return output
end```
harsh belfry
#

what does CARDMERGE.InitRankTable do

river grail
#

sanitization

harsh belfry
#

let me see

river grail
#
---@param card table | Card
---@return table
--- Returns the rank table of a card.
CARDMERGE.InitRankTable = function(card)
    if not card:rank_table() or card:rank_table() == {} then
        if SMODS.has_no_rank(card) then
            return {}
        else
            local output = {}
            output[card:get_id()] = true
            return output
        end
    end

    return card:rank_table()
end```
harsh belfry
#

a solution is really close i just don't know what the output format is lmao

#

what is rank_table 💀

river grail
#

card:rank_table() jusr returns card.ability.rank_table

#

😭

harsh belfry
#

anyway what i'm getting at is this

daring fern
harsh belfry
#

you can check if that card input in InitRankTable is an object with suit and rank

harsh belfry
river grail
daring fern
harsh belfry
#

and whatever is needed for proper output

river grail
#

oh wait

#

i think you're onto something

harsh belfry
#

and then any card can be a rank and suit object instead

daring fern
river grail
#

this is just outright cursed

#

but yeah i figured it out

harsh belfry
#

beautiful

river grail
#

i was overcomplicating it WAY too much

harsh belfry
#

i have indirectly contributed to this mod two times now

#

probably because this is really cool

river grail
#

i should credit you in the mod desc

#

for helping

round lion
#

is making a new context just calling a different value on calculate_joker

harsh belfry
#

do it on calculate_context

#

SMODS.calculate_context

#

also make sure to do SMODS.calculate_effect on the return value

#

if you want return tables to work

daring fern
harsh belfry
#

you seem to be correct

#

also why are you just always here

round lion
#

this stuff is making my head hurt

daring fern
#

lusty marten
#

i wanna code a free reroll shop joker , how can i code it?

#

and a joker that can make all suits to 1 suit

daring fern
reef belfry
#

What part of the code in this creates the area where you can click the logo? im clicking the middle of the R and its still processing it 😭
(I only took the code from someone else...)

#

furthermore, this is the area the logo occupies, so its not like the sprite has that big of dead space in it

storm kraken
#

holy peak

sturdy compass
#

My logo code spreads further more

#

Also middle of the R? Like the gap?

reef belfry
#

actually at the y axis it isnt that bad

#

but like

#

on the x axis it stretches longer than the O

#

but its not the same with the left side

#

its still bigger

sturdy compass
#

I’m not entirely sure what might be going wrong here

#

Tho I’m surprised 12 is your base scale value since mine is 6 and appears far larger

reef belfry
#

for some reason its extremely small

#

even though its the same size (i adjusted the logo size accordingly to what i saw)

sturdy compass
#

Are you using any patches for this? My version does but I don’t remember if Thunder did too

reef belfry
#

oh yeah if its any help, the transformation of the logo is a bit jagged (like the movement wasnt centralized)

sturdy compass
#

What are you doing in the push/pop patch? That seems to be the most significant variable and I can’t quite seem to understand it

reef belfry
#

I really just copied it since I have 0 clue how this actually works right now...

sturdy compass
#

😭

reef belfry
#

ok! i figured it out!! tnx

chrome widget
#

Gonna poke in here as well, is there anyone here that knows a decent amount about Balatro text inputs that I could bounce off fixing some really annoying UI bugs with?

hidden notch
#

I'm probably not able to help ya' but I'd be interested to hear about the Bugs lewxen_Noblewoman_Laugh

stiff locust
#

obligatory curator plug

cunning bison
#

Any tips for improvement?

primal robin
#

so sick but maybe even too much, very high res in comparision to vanilla artstyle

#

aside of that, fire

cunning bison
bold sleet
#

Bit too much, yet, it looks great.

#

Keep a copy of the original if you are going to simplify it. Just because uh...

gilded blaze
#

that's gonna make downscaling to 1x a true goofy experience (cough cough that Exotic joker from Cryptid that draws entire deck to hand when Blind is selected cough)

cunning bison
primal robin
#

fix letters a bit and still so fire

cunning bison
daring fern
#

grim jacinth
#

Hey guys, I have a mod idea but I don't have much time to develop it, I mainly do Game Design, does anyone want to collaborate?


Also, DM me if you're interested to join me on a game project. I've got some of the game design ready. I'll be using Monogame framework with C#. It's a 2D platformer, there's more details if anyone is interested, just DM me. Looking mainly for programmers, maybe game designers, artists and sound designers.

junior tapir
#

Maybe not fixing that is a cost I am willing to pay, the fade effect is epic on its own

hidden notch
#

How does one rescore a joker?
I was thinking about this one, I mean... As far as I understand, you technically want a Red-Seal effect... Right??
The Joker scores, with it's Eddition and Enhancement and all, and then it just does it again right after (right?)

daring fern
slim ferry
#

isn't that what Card.calculate_joker does?

#

unless that doesnt repeat joker retriggers but i kinda would expect it to

tired kestrel
daring fern
cunning bison
hidden notch
daring fern
primal robin
#

Wait SMODS.Blind doesnt have update function????

tired kestrel
cunning bison
#

nope, I made it

tired kestrel
#

Ah. alright cause I remember seeing sometinhg like that is that someone on reddit made a concept of third tier vouchers that somehow the art looked like mixels and well not fit for balatro style which I ended up remaking those into the faithful balatro style or if the art of the third vouchers would look like if they are in balatro: #🎨・fan-art message

#

but honestly glad to know that you made the art and you're improving it

#

cause I thought when I saw the mixels I thought you got it from a reddit post that had those mixels

#

so anyways, good job!

cunning bison
#

Another one, done with the art for now tho, soo much work

wild berry
#

how can i make a proper cardarea

brittle peak
#

Who want to buy basmati fried rice

hidden notch
# daring fern It doesn't include retriggers.

I mean at this point I'm just looking at the Joker-Section from "state_events.lua" -> "evaluate_play" in my Lovely-Dump
Best thing you could do is to grab that section and rewrite it for one Joker and put that into a function
I'm currently testing it a bit and that approach seems to work fine.. I kinda can't help any further than that, sorry :/

cunning bison
# wild berry how can i make a proper cardarea
local my_card_area = CardArea(  
    x_position, y_position,           -- Position on screen  
    width, height,                    -- Dimensions  
    {                                 -- Configuration table  
        card_limit = 5,               -- Maximum cards  
        type = 'custom',              -- Area type  
        highlight_limit = 1,          -- Max highlighted cards  
        card_w = G.CARD_W,            -- Card width  
        card_h = G.CARD_H             -- Card height  
    }  
  )

Try adding something like this to your start_run override, doesnt do much without any supporting functions but it gets you a place you can emplace cards into

brittle peak
#

Who want to Bur fried rice

wild berry
#

how do i calculate context on a custom card i have (extended from SMODS.Center)

ashen adder
#

thanks mods ahah

spiral mural
#

oh my god brah 💔

#

who is FALLING for these scams

wanton jolt
#

holy shit mr beast???

#

i guess qatar doesnt pay enough frowny fazce

stoic void
#

I W4nt 0n3 MiLlI()n RoBux mR B3Ast PLs

#

or whatever little kids say

spiral mural
#

can i have 2 robux

#

and a fries

wanton jolt
#

NO!

slim ferry
wild berry
#

thank you

ashen adder
#

alright so i have this code here in the glass stake and the problem is
that the probability procs way too much than it should and also
sometimes the glass break effect happens and sometimes just the regular card destroy effect

calculate = function(self, context)
        if context.destroy_card and context.cardarea == G.play and G.GAME.modifiers.cry_shatter_rate then
            for i = 1, #G.play.cards do
                if SMODS.pseudorandom_probability(self, 'cry_shatter', 1, G.GAME.modifiers.cry_shatter_rate) and not SMODS.is_eternal(context.destroy_card) then
                    G.play.cards[i].cry_glass_trigger = true
                    return { remove = true }
                end
            end
        end
    end,
local smods_shatters_ref = SMODS.shatters
function SMODS.shatters(card)
    return card.cry_glass_trigger or smods_shatters_ref(card)
end

^code in the override file

#

anyone have any ideas?

slim ferry
#

you shouldnt be doing a for loop

#

context.destroy_card already happens individually for each card

spiral mural
ashen adder
# slim ferry you shouldnt be doing a for loop

i see
i just didnt understand how to then reference the card because
in the original code that 'N wrote:

local glass = {
    object_type = "Stake",
    name = "cry-Glass Stake",
    key = "glass",
    pos = { x = 2, y = 2 },
    atlas = "stake",
    applied_stakes = { "cry_ruby" },
    modifiers = function()
        G.GAME.modifiers.cry_shatter_rate = 30
    end,
    shiny = true,
    order = 21,
    colour = HEX("ffffff8f"),
    calculate = function(self, context)
        if context.destroy_card and context.cardarea == G.play and G.GAME.modifiers.cry_shatter_rate
            and SMODS.pseudorandom_probability(self, 'cry_shatter', 1, G.GAME.modifiers.cry_shatter_rate) and not SMODS.is_eternal(context.destroy_card) then
            card.cry_glass_trigger = true
            return { remove = true }
        end
    end
}

local smods_shatters_ref = SMODS.shatters
function SMODS.shatters(card)
    return card.cry_glass_trigger or smods_shatters_ref(card)
end

theres a problem that "card" is a nil reference

slim ferry
#

yeah it should be context.destroy_card.cry_glass_trigger

ashen adder
errant fulcrum
#

Anyone know if there's a way to change an atlas through the config menu?

wanton jolt
#

wdym

errant fulcrum
#

Like could I do something like

SMODS.Atlas{
    key = 'Jokers', --atlas key
    path = function(self,args)
      return config.alternate_sprites
    end,
    px = 71,
    py = 95
}

To be able point to a different image in the atlas while the game is open

wild berry
wanton jolt
#

like a switch case i guess?

#

or if u can put "n" as part of your key

#

have something that changes "n"

wild berry
errant fulcrum
wild berry
wanton jolt
#

post full crash log

wild berry
#

where is it dumped

#

nvm

#

whats the issue here

wanton jolt
#

try changing ur trinket key to CJmod_gold

wild berry
#

same result

wanton jolt
#

your reddit gold is pointing to something that doesnt exist

wild berry
#

its meant to be a custom center

#

how can i fix that

gilded blaze
wild berry
#

wdym?

gilded blaze
#

G.localization.descriptions.Trinket is nil

#

if you're using localization files, it's easy to add entries like this:

descriptions = {
    Trinket = {
        trk_CJMod_gold = {
            name = "Reddit Gold",
            text = {
                "{C:money}+#1#{} blind payout",
            },
        },
    },
},

however, if you insist on using loc_txt field on each of your object, then the following snippet is needed:

SMODS.current_mod.process_loc_text = function()
    G.localization.descriptions.Trinket = {}
end
wild berry
#

ok thanks

#

game load now, ty!!

junior tapir
#

anyone know how I could redeem a voucher, say when joker's conditions meet

red flower
#

(you can ignore the random part)

candid arch
#

how do i detect if a card was retriggered? i wanna make a joker that scales in chip value whenever cards get retriggered

chrome widget
#

Let me roll out of bed

wild berry
#

i made my custom center but why wont it get moved to the correct cardarea (its meant to be the one at the right)

#

and why is it stretched

daring fern
wild berry
#

oh right, thanks

#

i just came back to modding so i forgot a bit of stuff

fluid chasm
#

is there a way to find if the current booster pack is celestial?

daring fern
wild berry
#

same code, i just removed the emplace and added the area key in the add_card

#

its this:
SMODS.add_card({set="Trinket", area = G.trinkets})

candid arch
#

i dont understand how calculate_context works. can i use it to detect if a card was retriggered?

#

i looked in here but i still dont really get it

GitHub

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

candid arch
#

what can i use that for?

#

im still unsure how to use it

round silo
#

what is up mod development, how do i mod the game

#

im being fr cuh

round silo
#

too much text, gimmie it in 10 words

frosty rampart
#

modding balatro cannot be summed up in just ten words

round silo
#

thats what a bad modder would say

shell timber
#

like as in making or playing mods

round silo
#

makin mods

shell timber
#

ill give it a try but it wont be helpful

#

nvm its impossible

worldly silo
#

@queen crescent

frosty rampart
#

you have to learn a whole programming language and how to properly reference documentation + reference materials like VanillaRemade

queen crescent
#

GOD DAMNIT

round silo
#

i know how to program blud i just dont know how to put that in balatro

lavish otter
stoic void
queen crescent
#

i forgot to lock him in there 😭

frosty rampart
round silo
#

can you sum it up in 5 emojis

stoic void
frosty rampart
round silo
#

ahhh now i get it

#

☝️ smiley_face

chrome widget
#

I don't get the last one, the inverted chevron

#

I also don't know the exact meaning of the alembic emoji even though I've seen it around

stiff locust
#

japanese symbol for beginner

#

its like a symbol for learner drivers in japan i think?

round silo
#

はい

frosty rampart
#

yea the last one is literally just beginner, something something everyone starts somewhere
and ⚗️ looks like 🥀

stiff locust
#

mostly known for being a super long text to speech input

#

magnifying glass tilted right is also popular

spiral mural
#

🔎

#

its just mag_right

#

how do i see what scaling a joker would give without actually scaling it

stiff locust
#

save the original value, scale it, then measure the difference, then unscale it

#

im spitballing here

stiff locust
#

i dont think we have future sight for joker values gng

spiral mural
#

the issue with the joker is

#

actually let me just show you it

#

it displays what the scaled payout is instead of the actual payout

#

well

#

the actual value

#

because the actual payout is what the scaled payout would be

chrome widget
# spiral mural

Imagine using this to make all the consumables green #ShillingMyMod

chrome widget
#

Oh wait I can't post sendhimtotheprincipalsofficeandhavehimexpelled gif because I'm oppressed in this server

elder rune
#

Localthunk is oppressing us

#

#savebalatroserver

normal crest
#

you can send the gif if instead of sending a link you upload the file

chrome widget
#

Success

#

Sorry this was entirely because I saw "dream journal"

candid arch
#

this code is trying to get the chips from a card that was retriggered and add them to a joker. i'm using a custom context that was patched in (seen in 2nd image) but it doesn't trigger when in an if statement with context.individual. how do i get this to work?

candid arch
spiral mural
chrome widget
#

I have code on both sides that's meant to replace the value of the slider or text input when one is changed. The slider example is here:

#

But often times when I do this replacement, the cursor/input position gets dealigned in the process (if the change changes the number of active digits in the ref value), which then results in, say, selecting the text input and only being able to change the second digit

#

And before I added a thing to set a minimum number of letters in the text input, it was even worse, because sometimes it wouldn't let me tab all the way to the right because the ref value was two digits and it clamps the position to the length of the ref value

#

I have a full helper function I made specifically to try to do this as basically "change the value and then call transpose" but even it seems faulty

primal robin
#

looks scary

rocky plaza
#

I'm lookin at vanilla remade and i see that sometimes, nil, true is returned instead of not returning
It says its for joker retrigger purposes but is doing this type of return necessary for non-joker effects

harsh belfry
rocky plaza
harsh belfry
#

i don't know if thats being retriggered

frosty rampart
#

it might be helpful for post trigger stuff I think

harsh belfry
#

true

frosty rampart
#

like context.post_trigger might not fire if the calculate doesn't return

harsh belfry
#

depends on if you want things to be able to posttrigger on your calculate

wintry solar
#

I don’t think mod calc functions can be retriggered or post triggered

#

I could be wrong though

chrome widget
stiff locust
#

that sounds like it would solve the problem

chrome widget
#

I have something similar for a separate text input, though I still encounter some of the cursor offset problems

candid arch
#

how do i get the chip value from a card that was retriggered? im hooking into insert_repetitions to try and find the card that retriggered, and then get the chip value from it.

right now im testing it by printing the card's chip value, and it does it when patching it but NOT when hooking it fsr

#

is there something i'm doing wrong?

candid arch
#

anyone there?

wind steppe
#

you're overwriting insert_repetitions (without smods)

candid arch
#

ohhh

candid arch
#

sry for late response

candid arch
#

sadly i got another problem

red flower
#

same

sturdy compass
#

We all have problems

primal robin
#

for choosing cards for criteria most common rank I need check card.base.nominal? Because rn I'm checking card.base.value jangschna

red flower
#

value is correct

white hull
#

if i wanna take money from the player, do i need to use the money buffer?

#

i see the tooth in vanilla remade just uses ease_dollars() without involving the buffer

#

is that fine?

wraith jolt
#

I am trying to figure out what be the proper codding for a Joker that looks for hands (pair, fullhouse exc) made using pairs

#

Is it similar to the color sin jokers code or may looking something too complicated

candid arch
#

okay i figured out what caused the problem but not how to solve it

wraith jolt
#

Because trying out to make Jokers that trigger on Even and Odd values

candid arch
#

so im hooking SMODS.insert_repetitions to try and get the chip value of a retriggered card, but this only seems to work when the card is retriggered by a red seal, NOT when a joker (sock, hack, etc.) retriggers it!

#

i know this because ive been printing the chip value in the original function and it only returns a non-zero value when retriggered by red seals

#

is there a better way to get the chip value of any card that gets retriggered? this has been bugging me literally all day 😭

hushed briar
#

am i doing something wrong with this? i want these to use the undiscovered sprite of vouchers

SMODS.UndiscoveredSprite {
    key = "Deal",
    prefix_config = { atlas = false },
    atlas = "Voucher",
    pos = { x = 8, y = 2 },
}```
daring fern
#

Also you can't put cards in G.GAME

red flower
candid arch
#

i thought global variables had to start with G.GAME

loud summit
#

hi so im having a weird issue

#

basically if i discard a card in the final_scoring_step then hooking G.FUNCS.draw_from_play_to_discard to draw it to hand makes it draw the cards face down

white hull
loud summit
#

despite specifying "up" in the draw carsd call

candid arch
white hull
#

you can probably put effect_card.base.value into your variable and then use that in your joker

candid arch
random egret
#

How would I modify a vanilla joker when I obtain a specific modded joker?

eternal lake
#

(context: we're trying to make a legendary joker that prevents others from resetting (ex: hit the road))

loud summit
#

hi so how would you prevent a card from being flipped temporarily?

candid arch
#

how do you update the chips on a card that had its rank changed right before being scored?

#

i have a joker that Strength-Tarots scored cards before the hand is scored, but they still score with their old chip values before the strength upgrade

candid arch
red flower
#

try removing the event

candid arch
#

i copied this almost 1-1 from the vanillaremade strength tarot code

#

except i removed the deselect function at the end and changed the select context to scoring_hand

red flower
#

does that affect my answer

candid arch
#

seems like it'd affect this pretty majorly in ways i dont understand

#

ill give it a shot though

red flower
#

well i do understand

candid arch
#

i trust you

red flower
#

it will fuck up the animation tho

candid arch
#

should i remove all the events from this code

candid arch
red flower
#

just the modify rank one for now

candid arch
#

thats what i was worried about ^^"

red flower
#

if there's a way to do the animation it will be by delaying the sprite change rather than using an event, but i don't know if there's functionality for that at the moment

candid arch
#

that's unfortunate

red flower
#

ok it's not documented but modify_rank has a way to delay the sprites it seems

candid arch
#

ooh really?

#

how so

red flower
#

the third argument has to be true, but i dont know if it does it automatically or you need to change the sprite manually

candid arch
#

looks like it

#

how do you manually change the sprites?

red flower
#

playing_card:set_sprites(nil, playing_card) it looks like

#

you would put that in the event

candid arch
#

oh awesome, thank you!

#

what argument do you put in nil?

red flower
#

nil

candid arch
#

weird

#

lemme give it a try

red flower
#

playing_card:set_sprites(nil, G.P_CARDS[playing_card.config.card_key]) maybe

candid arch
#

like this?

red flower
#

yes but you shouldn't use context in an event

#

save it to a local variable beforehand

candid arch
#

oh like in the set_sprites() function?

red flower
#

all of the context.scoring_hand[i] inside the event

candid arch
#

it's like that in vanillaremade

red flower
#

there's no context in tarots

#

so no

candid arch
#

fair enough

#

what does config.card_key refer to

red flower
#

it's the key for the card as rank_suit

candid arch
#

yayyy it works, thank you so much for your help!

short fulcrum
#

is there a way to change what the blueprint compatibility ui looks like? instead of it saying "compatible" and "incompatible" with a coloured background, I want it to say different things with no background

candid arch
#

also @red flower if youre still available, is there a way to get the chip value from a retriggered card? ive been strugglign with that all day today and moved onto another joker to work on after failing to make it work

short fulcrum
#

I only ask because I tried toying with it myself and even the smallest edit makes it say "ERROR"

red flower
candid arch
#

no worries, thanks for all the help! ^^

short fulcrum
#

oh wait, would that change what it looks like for all jokers that use it? (blueprint, brainstorm, etc) I only want it to look different for a specific joker

red flower
short fulcrum
#

I'm just wondering how (or if) that can be avoided

red flower
#

wait i forgot G.FUNCS.blueprint_compat exists

#

you can hook that and change the values when it's copying your card

short fulcrum
#

when I tried to change where it said "compatible" and "incompatible" that's what made it say "ERROR"

red flower
#

ohh then you wanted the latter lmao maybe i didnt ask the question correctly

short fulcrum
#

oh yeah sorry

red flower
short fulcrum
#

sorry for the shoddy visual

spiral mural
red flower
#

localize looks for k_compatible in the localization file

short fulcrum
#

ok cool, I'll try that out, thanks

#

I'll report back if it doesn't work or I'm too lost

gilded blaze
# spiral mural

loc_vars is called whenever you hover a card to show its description, and that's not how SMODS.scale_card is supposed to be used I believe

spiral mural
#

not even the full system

#

just the modifying part

gilded blaze
#

you're also passing a non-Card object

#

in this case an empty table

spiral mural
#

it also breaks if i pass card if i remember

#

yup

gilded blaze
#

SMODS.scale_card is a lot more complicated than you think

spiral mural
#

well i need to predict what it does

spiral mural
#

i see nothing that should fall apart and crumble

gilded blaze
#

that's what I meant

#

looking at SMODS.scale_card alone isn't enough to understand the problem

spiral mural
#

local ret = obj:calc_scaling(_card, card, initial, scalar_value, args)

#

is like the one place i can see causing a problem

#

mostly because its the one place actually using card

gilded blaze
#

see?

spiral mural
#

besides args.ref_table = args.ref_table or card.ability.extra

#

also the scaling message thing

gilded blaze
#

a card is still needed to display attention text

spiral mural
#

the real question is why it runs correctly the first time

#

then fucks up

gilded blaze
#

what are you trying to do exactly

spiral mural
#

the card seemly poisons the well affter being displayed

spiral mural
#

for the player of course

spiral mural
#

payout is ran after scaling

gilded blaze
#

huh

spiral mural
#

full joker code

gilded blaze
#

so you're trying to scale the payout

spiral mural
#
SMODS.Joker {
    key = "green",
    atlas = "awesomejokers",
    rarity = 2,
    blueprint_compat = false,
    eternal_compat = true,
    perishable_compat = false,
    discovered = true,
    cost = 6,
    pos = { x = 2, y = 4 },
    config = { extra = { dollars = 0, scale = 1 } },
    loc_vars = function(self, info_queue, card)
        -- the player might be fooled if its not a scale above what its currrently
        local fake_table = {
            ["dollars"] = card.ability.extra.dollars,
            ["scale"] = card.ability.extra.scale
        }
        SMODS.scale_card(card, {
            ref_table = fake_table,
            ref_value = "dollars",
            scalar_value = "scale",
            no_message = true
        })
        return { vars = { card.ability.extra.scale, fake_table["dollars"] } }
    end,
    calculate = function (self, card, context)
        if context.end_of_round and context.main_eval then
            SMODS.scale_card(card, {
                ref_table = card.ability.extra,
                ref_value = "dollars",
                scalar_value = "scale",
                no_message = true
            })
        end
    end,
    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end
}
#

golden joker if it was awesome

#

you probably don't need 40% of this 🪱

gilded blaze
#

uh

#

so the joker scales on hover

#

I'm still confused

spiral mural
#

not really

#

fake_table

#

the table shows the present's future

gilded blaze
#

ah

spiral mural
#

well its supposed to be altered to show it

gilded blaze
#

you want this joker to show the proper future value when a calc_scaling joker is present

spiral mural
#

yea

#

which my mod has one

#

and other mods too probably

gilded blaze
#

what breaks here

spiral mural
#

i tested it

#

after hovering over it

#

all calc_scaling breaks

#

or perhaps

#

the calc_scaling on the joker breaks

gilded blaze
#

in what way

#

unexpected value?

spiral mural
#

no return value

#

presumely

#

i would have to do a smods patch to really see what's going on

#
    calc_scaling = function(self, card, other_card, initial_value, scalar_value, args)
        if scalar_value > 0 and not args.dont_repeat then
            return {
                override_scalar_value = { -- this will override the scalar_value
                    value = scalar_value*2, -- set the scalar_value to X
                    -- other calculation return keys accepted here, timing is before the scaling event
                },
            }
        end
    end
#

this is the calc_scaling im testing with

#

the args.dont_repeat is from old code

#

doens't hurt nobody

gilded blaze
#

tbh I have never used calc_scaling

#

not all mods need one, for balancing purposes of course

spiral mural
#

calc_scaling could be getting overwritten

gilded blaze
#

no return value huh

#

so it shows nil at where the future value is supposed to be

spiral mural
#

no i added

#

prints in

#

prints just

#

stopped running

#

i disabled some mods

#

seems to be a

#

mod incompatibility 😨

gilded blaze
#

ouch

spiral mural
#

im betting aiko

#

so updating their mod then testing

#

never mind i have the latest version

#

not them

#

hmm

#

stocking stuffering

#

i'll update that

round lion
#

is there any alternatives for a while true?

frosty rampart
#

i mean
what's the goal exactly

round lion
#

eliminate repeats from a random picker so i don't have to use a giant list full of every individual valid card number

cerulean rose
#

happy 13th month smods

edgy reef
#

We're back in the building again

candid arch
#

how do i automatically debuff jokers if they're to the left of a specific joker (and rebuff them when they aren't to the left of that joker)?

#

currently the code doesn't automatically make the jokers to the left of the joker debuffed, and it takes two hands (1 to make them visually debuff, and 2 to show the debuffed jokers don't trigger)

#

how can i make them debuff and undebuff automatically depending on their position to the eldritch joker?

candid arch
#

is there a context that triggers constantly whenever the game is active that makes this work?

wind steppe
#

not a context but look into the update function

#

SMODS.Joker

candid arch
#

oh thank you\

spiral lichen
# candid arch

i know this is unrelated but what did jimbo do to deserve that 😭

candid arch
#

saw toomuch

#

i think i somehow actually figured this out

#

YESSS i figured it out!!!

subtle hawk
#

Chat what are the variables for chip requirement texts on blind select screen

spiral lichen
candid arch
#

it was beautiful

wind steppe
candid arch
#

looks outside
🫠

candid arch
#

i think messing with update() broke the entire game

#

i was trying to debuff jokers to the left of the eldritch, and undebuff jokers to the right of it

#

in real time

#

is there a simpler/less jannk way to do this xD

wind steppe
#

hook Card:stop_drag maybe?

candid arch
#

does that do what it sounds like it does

#

in my head i wanted this joker to function as an easy way to debuff whichever jokers you needed at a certain time

#

so if you arent able to drag it i feel like that takes some of that purpose away

chrome widget
#

Tbh I would suggest doing this with something that updates only when the joker's position updates

candid arch
#

oh?

chrome widget
#

Because SMODS.debuff_card sets a permanent flag

wind steppe
chrome widget
#

So you don't need to do it every frame

candid arch
#

ohhhhh

candid arch
#

uhhh

candid arch
chrome widget
#

Go to bed

#

Everything is simpler when you've slept

candid arch
#

ill try anything once

#

/hj

#

ill see you guys later, might try the stop drag thing tmrw!

daring fern
#

ashen adder
slim ferry
#

does it just do nothing

ashen adder
#

yea, looks like

short fulcrum
#

I'm trying to make a joker that removes the effect of Steel Cards so they don't give their mult, I'm assuming it would use the take_ownership function but I'm not sure what to do to get rid of an effect

wind steppe
#

<@&1133519078540185692>

short fulcrum
#

did what I say break a rule?

candid arch
#

nah there was a scam account

short fulcrum
#

ah I didn't see that

mystic river
#

they get deleted very fast

candid arch
#

is there a context or flag or something for whenever a run is opened (including continuing a run)?

mystic river
#

i don't believe there's a context

#

you can give an item a load() function though

short fulcrum
#

I know Throwback has something like that as an unlock condition maybe? I'd assume so at least

#

but I don't know that much

mystic river
#

depending on what you want it to interact with, you might have to put the result in an event so that the thing loads first

candid arch
#

i havent used it before

mystic river
#

it runs when the game is loaded

candid arch
#

oh good!

mystic river
candid arch
#

that check_jokers_left_of_eldritch function is in main.lua

mystic river
#

okay so. you only need to put it in an event if you want it to interact with something that hasn't loaded yet

candid arch
#

ahh whoops

#

^^"

mystic river
#

the event would start by returning false if the thing hasn't loaded yet

#

that way it would wait until the thing loads

candid arch
#

do all of the jokers load at the same time

mystic river
#

no idea

#

try it and see

candid arch
#

ahh by taking the check_jokers_left_of_eldritch() out of the event?

#

lemme try

#

yeah that broke it jfdsk

#

it actually DID work when it was in the event which is nice

short fulcrum
random basin
#

what is the correct way of writing this apply function to call SMODS.change_play_limit() and increase the play limit from default to 14?

    key = "mahjong_red",
    pos = { x = 0, y = 0 },
    config = { discards = 1},
    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.discards } }
    end,
    apply = function(self, back)
        G.GAME.SMODS.change_play_limit(9)
    end
}```
pastel kernel
#

might need to fix this```lua
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
if i > 1 then
Cryptid.manipulate(G.jokers.cards[i+1], { value = card.ability.extra.vm })
SMODS.calculate_effect({ message = "X" ..card.ability.extra.vm, colour = G.C.FILTER, instant = true}, card)
end
if i < #G.jokers.cards then
Cryptid.manipulate(G.jokers.cards[i-1], { value = card.ability.extra.vm })
SMODS.calculate_effect({ message = "X".. card.ability.extra.vm, colour = G.C.FILTER, instant = true}, card)
end
end
end

random basin
#

how would I add cards to G.playing_cards in the event function?

#

similar to the checkered deck code but instead of swapping suits adding extra copies of each card and some other cards

#

unless G.playing_cards is a table and I can just directly append to it but that doesn't seem right

soft cave
short fulcrum
#

I'm trying to make steel cards not give mult when a specific joker (mechsupport) is owned, I've got this code for that but they're still giving mult regardless. I have kind of frankensteined the code together so maybe there's just something I'm missing?

SMODS.Enhancement:take_ownership('m_steel',
    {
        loc_vars = function(self, info_queue, card)
            if not ((function()
                for i, v in pairs(G.jokers.cards) do
                    if v.config.center.key == "j_mysingingjokers_mechsupport" then
                        return true
                    end
                end
            end)()) then
                return { vars = { card.ability.h_x_mult } }
            end
        end
    },
    true
)
shut kite
#

Hey, quick question for anyone... I want to start building a mod that introduces a joker that increases the playable hand size from 5 to 6. (This would introduce the concept of having 6 of a kind, flush 6, and split houses which I'd implement later) However I'm struggling to find what file actually controls that aspect of the game. It has to exist somewhere but I just don't know where to look, or if it's even accessible. Any ideas?

random basin
#
SMODS.Back {
    key = "mahjong_red",
    pos = { x = 0, y = 0 },
    config = { discards = 1 },
    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.discards} }
    end,
    apply = function(self, back)
        G.E_MANAGER:add_event(Event({
            func = function()
                SMODS.change_play_limit(9)
                return true
            end
        }))
        local suits = {'S','C','D','H'}
        local ranks = {'2','3','4','5','6','7','8','9','10','J','Q','K','A'}
        for i=1,3 do
            for _, suit in ipairs(suits) do
                for _, rank in ipairs(ranks) do
                    G.E_MANAGER:add_event(Event({
                        trigger = 'after', delay = 0.05,
                        func = function()
                            local card = SMODS.add_card({set = 'Base', area = G.deck, suit = suit, rank = rank})
                            return true
                        end
                    }))
                end
            end
        end
    end
}```
round lion
#

whats the timers for anyway

hardy vessel
#

Working with tags and I have a system in place for tags that have different kinds of effects (postive, negative, etc) and I'm trying to create a consumable that can remove a specific group of tags. In this case, negative (or bad). The removal works just fine, but I'm having trouble setting the can_use of the consumable to work when you have any negative tags. This is what I have currently.

    can_use = function(self, card)
        for i = 1, #G.GAME.tags do
            if G.GAME.tags[i].config.tag.kind == 'negative' then
                return true
            end
        end
    end  
random basin
#

anyone have a good example of a custom playing card implementation?

candid arch
#

is it possible to add a gradient to a mod badge?

primal robin
#

Few mods do this

slim ferry
#

iirc

candid arch
#

i have this in main.lua but it's not replacing the placeholder color with a gradient

harsh belfry
#

oof

candid arch
#

whats up

harsh belfry
#

don't do that in the update loop at all

#

i don't know if you need to wait for loading

#

but doing it in the update loop fucks internal state

#

SMODS.current_mod changes for each mod

candid arch
#

..really???

#

dang

candid arch
harsh belfry
#

but ALSO

#

update isn't even a function you can hook

#

Game.update and love.update is