#💻・modding-dev

1 messages · Page 177 of 1

frosty dock
#

but really it should get fixed on talisman's end

lavish lake
past forge
#

are stonce cards in the back normal cards or they keep being stone?

manic rune
#

them on their way to assassinate anyone who reports the aforementioned bug:

frosty dock
#

the first thing you should try to do about an issue with another mod is update it

manic rune
#

how much does update have an impact on framerate

frosty dock
#

it can tank performance if you're not careful

manic rune
#

^2 mult every frame

#

:3

#

i see, thanks

ionic timber
#

what exactly is the area argument supposed to be in the use function of a consumable ? because

"if area == G.booster_pack then" doesn't seems to be true even when the consumable is in a booster pack , or "if not area == G.consumeable" also doesn't work, so how exactly do I check if it's in a booster pack ?

lavish lake
manic rune
#

i think gros michel have smt similar to that

frosty dock
manic rune
#

the Safe! and Destroyed!(?), i think

frosty dock
past forge
#

doesnt work

manic rune
#

huh

#

wait a bit, let me try myself

ionic timber
# frosty dock The area would be G.pack_cards or G.consumeables

maybe I'm just doing this wrong, but I want one specific consumable to be placed in the consumable slot if it's obtained in a booster pack, is there an easier way to do this than verifying if it's in a booster pack ? because verifying with G.pack_cards or G.consumeables just doesn't work unfortunately

lavish lake
frosty dock
#

you cna change the card where it displays with message_card

lavish lake
prisma loom
#

Asking here cuz mb its some complicated issue:

fickle quail
ionic verge
#

oh yeah it is different from antimatter

#

nice

hushed field
past forge
#

that blank stone card is giving me headache

#

im going to take a nap

wintry solar
#

Blank stone cards are my jam, what’s the issue?

past forge
#

my joker is supposed to turn face cards into stone cards

#

but before they turn into stone cards, they are white

wintry solar
#

Ah yes I know this issue

past forge
#

they keep turning into stone cards so is just an aesthetic issue

wintry solar
#

I should probably fix this on the backend rather than giving you the workaround

prisma loom
past forge
#
SMODS.Joker {
    key = 'medusa',
    subtitle = "Art and idea by Toyrapple",
    loc_txt = {
        name = 'Medusa',
        text = {
            "This Joker gains {X:mult,C:white}X#2#{} Mult per scoring {C:gold}Face card{}", 
            "played and turns them into {C:gold}Stone cards{}",
            "{C:inactive}(Currently {X:mult,C:white}+#1# {C:inactive}Mult)"
        }
    },
    config = { extra = { xmult = 1, scaling_factor = 0.2 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.scaling_factor } }
    end,
    rarity = 1,
    atlas = 'ToyrappleCollection',
    pos = { x = 2, y = 1 },
    cost = 2,
    calculate = function(self, card, context)
        card.ability.extra.xmult = card.ability.extra.xmult or 1
    
        if context.before and context.cardarea == G.jokers then
            for i = 1, #context.scoring_hand do
                if context.scoring_hand[i]:is_face() then
                    card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.scaling_factor
                end
            end
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.RED
            }
        end
    
        if context.individual and context.cardarea == G.play then
            for i = 1, #context.scoring_hand do
                if context.scoring_hand[i]:is_face() then
                    context.scoring_hand[i]:set_ability(G.P_CENTERS.m_stone, nil, true)
                    context.scoring_hand[i]:juice_up(0.3, 0.3)
                end
            end

            return {
                mult_mod = card.ability.extra.xmult,
                message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } }
            }
        end
    end
}

This is the code

#

i tried adding delays, event manager, etc

#

nohing seems to work

wintry solar
#

Let’s leave it as a, when you update smods later it will just work as intended

past forge
#

i updated it this morning

#

il do it again tho

prisma loom
#

We are doing basically the same thing

#

hahaha

past forge
#

even the 0.2 xmult

prisma loom
#

Ikr

#

That's some serious star alignment

prisma loom
#

It's fully finished

past forge
#

if you are that kind i would thankfully use it

wintry solar
past forge
opal spade
#

its so nice being able to do this w/o having to rewrite half of state_events.lua

hushed field
past forge
turbid maple
#

ah yes the jimbo two pair

opal spade
opal spade
# opal spade im back on my bs

i still need to rewire joker_main so playable jokers do it as their scoring (rn they do it as part of the actual joker_main so the timings are kinda messed up) + cover all the places that break when u have jokers reacting to things intended for playing cards

#

and also adding ways to change how jokers are treated by mechanics intended for playing cards bcos sinful jokers not counting as their respective suits is kinda not right imo

prisma loom
#

I don't quite understand where should I put this py file

#

Where main.lua is located?

#

Or in assets folder

ionic verge
past forge
#

or observatory

opal spade
ionic verge
#

damn

opal spade
# past forge or observatory

if it were old calc planet cards would give x1.5 mult on held and on play, although observatory way rewritten for new calc so i'd need to check how it'd work

#

i think it would stay the same with the difference of the effect relying on an off-screen observatory voucher card entity rather than coming directly from the cards themselves

frosty dock
#

new calc observatory uses context.other_consumeable with the main card being the off-screen voucher

#

previously it just hijacked the joker_main calc, which wouldn't allow for planets to have other joker-like effects at the same time

edgy mountain
#

this crashes the game
its supposed to generate a negative perishable joker

frosty dock
#

(keep the rarity if you want it to only spawn common jokers)

#

(the issue is the edition)

edgy mountain
frosty dock
#

you can check in the definition of the P_CENTERS table in the game's code, it has all the keys

edgy mountain
frosty dock
#

it should be stickers = { 'perishable' }, mb

ionic timber
#

ok nvm I'm just stupid

weak brook
#

hey @frosty dock saw you talking in here about retrigger_joker like 3 hours ago. got a question about that as well by coincidence

it works with joker-like abilities that consumables have right?

#

seems like it should from the code i've looked at but this doesnt work for some reason

    if context.retrigger_joker_check and context.other_card ~= card then
        if context.other_card.ability.set == "Stand" then
            return {
                repetitions = card.ability.extra
            }
        end
    end
end```
manic rune
#

how do you use a localization file?

frosty dock
weak brook
#

yeah i put this in the top of my main.lua after i noticed you saying you had to that

SMODS.current_mod.optional_features = {
    retrigger_joker = true,
    post_trigger = true,
}
frosty dock
#

i don't see what shouldn't work then

weak brook
#

im checking to see if maybe the set check screwed it up

#

no even with this it doesnt work

if context.retrigger_joker_check and context.other_card ~= card then
        return {
            repetitions = card.ability.extra
        }
    end
#

does it not apply to abilities that use certain contexts?

maiden river
#

did this ever happen btw?
no presure if not

weak brook
#

trying to get it to retrigger this one since it seems like the only stand we've currently implemented in cardsauce that makes sense to retrigger

if context.before and not card.debuff and G.GAME.current_round.hands_played == 0 then
    local diamonds = G.FUNCS.csau_all_suit(context, "Diamonds")
    if diamonds then
        ease_hands_played(1)
        return {
            card = card,
            message = localize('k_plus_hand'),
            colour = G.C.BLUE
        }
    end
end
#

hmm think thats the issue actually yeah

#

seems like the calculate code cant retrigger abilities in the before context

wintry solar
weak brook
maiden river
wintry solar
weak brook
# wintry solar every context is retriggerable

im not so sure, check above. the second to last code block i sent is a joker that i'm trying to get to retrigger abilities of a joker-like consumable, which is the code in the latest code block

#

doesnt retrigger

#

dunno why exactly

#

hm yeah i was mistaken in that the code for the before context does allow retriggers, i see that now

#

but still, what i'm trying to do doesnt work for some reason

wintry solar
#

wheres the retrigger coming from?

wintry solar
#

like what type of card

weak brook
#

its just a general "all cards of this type retrigger once"

#

i set it to all for testing purposes

#

but in the abilitiy it should filter for card type of "Stand"

#

which is a new consumable type we're making for cardsauce

#

but only consumable in name and where its located in slots, its basically a joker

uneven bobcat
#

anyone know what the context for using a specific tarot card would be

wintry solar
#

so a joker that retriggers consumables calc functions?

weak brook
#

yes exactly

wintry solar
#

what area is it in?

weak brook
#

consumables

#

the retrigger joker is in jokers, but the card that should be retriggered is in consumables

wintry solar
#

it calculates normlly, right?

weak brook
#

yeah it works fine

wintry solar
#

oh I see it

#

have yopu just testesd that one card?

weak brook
#

the stand?

wintry solar
#

yeah

weak brook
#

yeah it works

sturdy compass
#

Hey, I'm trying to check if the ante's boss blind is a showdown boss. Here's what I've tried but with no dice

weak brook
#

this general issue still is not solved though

wintry solar
weak brook
#

yeah i did try that, and it works

#

it seems that the code works up until the return, think whatever is going wrong is beyond that return

#

oh shit

#

it works now

#

somehow

#

hang on i need to test some more

#

huh. i have no idea what changed here but this code works now for some reason

  if context.retrigger_joker_check and context.other_card ~= card then
        send("hi")
        if context.other_card.ability.set == "Stand" then
            send("wow")
            return {
                repetitions = card.ability.extra
            }
        end
    end
bold sleet
#

Hello. Uh, how do I retrigger cards (like hanging chad, for example)?

prisma loom
#

Is something wrong? The outlines didnt get fixed

#

I have python and pip installed

weak brook
#

🤔

frosty dock
maiden river
weak brook
#

yeah but that makes the timing off

night pagoda
hushed field
maiden river
night pagoda
#

It should tell inside if it even processes sprites

graceful magnet
#

looked at how Burnt Joker and The Arm do level ups and level downs of hands, and am trying to incorporate those into a card that decreases the most played hand's level by 1 while increasing the least played hand's level by 2, but it's getting hung up on the second for loop trying to do the comparison and I'm not quite sure why (line that errors darkened for ease)

wintry solar
prisma loom
weak brook
night pagoda
prisma loom
#

I had to edit it via Notedpad

night pagoda
#

Did you install pillow?

#

the path looks correct at least

graceful magnet
prisma loom
graceful magnet
#

oop yep

bold sleet
night pagoda
# prisma loom yes!

okay something must be wrong because it worked before for other people
can you insert input('blablabla') at the end of the script and launch it like that?

viscid field
#

wait, does it count as copyright infringement if you rewrite the game but share the XOR'd result of your rewrite and the balatro exe
because you technically still have to buy the game

night pagoda
#

yeah it doesn't matter

prisma loom
#

Whats next?

night pagoda
#

it's so the console window doesn't close after running the script

#

anything in the console?

prisma loom
#

oh wait

#

I have 2 pythons

#

3.9

#

and 3.11

#

3.11 opens it

night pagoda
#

let me check which one I'm using

prisma loom
#

opened it with 3.11

graceful magnet
night pagoda
#

yeah the one I'm using is 3.10, it should be fine

prisma loom
#

Everythings clean af now!

#

THANKS!

night pagoda
#

🫡

prisma loom
#

Do other ppl have to run it too?

#

when they install this mod

night pagoda
#

you can also drag the 1x sprites individually into the script and it will fix them without the need to reupscale everything

#

nope it only changes the pngs in your mod

#

I use the script constantly, so I added it to my windows' context menu and it saves me a few clicks without the need to find the script every time I add or edit a sprite

dire palm
manic rune
# dire palm

im guessing the moment you played your hand, the game already locked on calculating the 5 3s

#

so even if you turn them into Ks, the game still sees those cards as 3s

surreal kernel
#

How do I detect the suit of G.playing_cards?

manic rune
#

{Hearts, Clubs, Diamonds, Spades} are the suits btw

surreal kernel
#

Ok I'm doing it wrong elsewhere then cause I did it that way hmm

#

Thank you

dire palm
manic rune
#

i actually dont know myself, sorry, you can try finding mods which do that though

surreal kernel
#
    update = function(self, card, dt)
        if G.playing_cards then
            for _, v in pairs(G.playing_cards) do
                if v:is_suit() == "Diamonds" then
                    card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
                end
            end
        end
    end,
#

What should I change there? Can't get it to work

#

Trying to get a joker to give x amount of mult per diamond in deck

manic rune
#

so first of all, dont use update, its pretty unnecessary

inside loc_vars, you can put something like:

card.ability.extra.Xmult = 1
for i,v in ipairs(G.playing_cards) do
  if v:is_suit() == "Diamonds" then
    card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
  end
end
return {...}
#

uh wait

#

why does it look like that 😭

#

there

surreal kernel
#

Thank you

#
    loc_vars = function(self, info_queue, card)
        card.ability.extra.Xmult = 1
        for i,v in ipairs(G.playing_cards) do
             if v:is_suit() == "Diamonds" then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
              end
        end
        return {vars = {card.ability.extra.Xmult, card.ability.extra.Xmult_gain}}
    end,
#

Like this?

manic rune
#

mhm, i believe so

surreal kernel
#

Hmm doesn't seem to work either

manic rune
#

ok so another idea, put that inside calculate with no context, like

calculate = function(self,card,context)
        card.ability.extra.Xmult = 1
        for i,v in ipairs(G.playing_cards) do
             if v:is_suit() == "Diamonds" then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
              end
        end
end
#

if only im better at coding, i wouldnt have to make multiple takes like this 💔

surreal kernel
#

Don't worry I'm worse lmao

#

You're really helpful ❤️

#

Hmmm not working either

#

Tried adding if context.before then before it and neither

#

Let me try printing

prisma loom
#

what does above_hand param means?

wintry solar
surreal kernel
#

Doesn't seem to work either

unkempt thicket
#

for some reason this edition code is triggering twice

manic rune
#

what is it supposed to do?

surreal kernel
manic rune
#

oh wait

#

ohhhh

#

i realized whats wrong

manic rune
#

i just realized it, im sorry

#

if v:is_suit("Diamonds") then

surreal kernel
#

That did it!

#

Tysm!

wintry solar
prisma loom
#

So I have a modded poker hand but I want to add extra functionality to it which is "Upgrade [this poker hand] for each Stone card scored this Ante" +10 chips". Here's my code rn:

    "stone_ocean",
    stone_ocean = {
        name = "Stone Ocean",
        above_hand = "Three of a Kind",
        text = { "5 Stone cards" },
        visible = false,
        chips = 50,
        mult = 1,
        l_chips = 10,
        l_mult = 0,
        example = {
            { "S_2", true, "m_stone" },
            { "S_2", true, "m_stone" },
            { "S_2", true, "m_stone" },
            { "S_2", true, "m_stone" },
            { "S_2", true, "m_stone" }
        },
    },
}

local handparts = {
    "stone_ocean",
    stone_ocean = {
        func = function(hand)
            if #hand < 5 then return {} end
            local ret = {}
            local stones = 0
            for i = 1, #hand do
                local v = hand[i].base.value
                -- Skip anything we can't interpret (for whatever reason)
                if v then
                    -- The "Base" of a Castle is comprised of three face
                    -- cards of any ranks
                    if hand[i].ability.name == "Stone Card" and stones < 5 then
                        stones = stones + 1
                        table.insert(ret, hand[i])
                    end
                end
            end
            if stones >= 3 and #ret >= 5 then
                return { ret }
            else
                return {}
            end
        end
    }
}```
#

this functinality is supposed to be on a Planet card itself

#

Has someone ever done Planet card effects with extra effects?

#

i could use a reference

hushed field
hushed field
#

cryptid's neutron star upgrades once for every previous neutron star. There's probably logic in there that's handy to see for you

prisma loom
#

thanks

silver turret
#

hi so is it just not possible to add smodded strings to a language in a mod

#

got this error on load

Oops! The game crashed:
[SMODS _ "src/utils.lua"]:191: 159456:3370: '<eof>' expected near '='

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1410d-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
    1: CZ Balatro by WolfPlay013, ProkopLoronz [ID: CZBALATRO]
Lovely Mods:
smoky talon
#

is there a way to detect when the date changes? I'm trying to make a knee surgery joker that self destructs when the date changes to tomorrow lol

red flower
#

I think it's os.date

silver turret
#

oh lmao i guess i missed that

#

i keep on forgetting that this technically is not json

#

so it doesn't warn me for stuff like that

#

ty!

smoky talon
#

i tried creating a new variable at the start that tracks the date when you start the game so that i can detect chanegs in it, but it crashes when i open it.

maiden river
#

os.date is a function

smoky talon
#

ah, what is the best method of doing this then

maiden river
#

you could also look at that clock mod to see how they use it

frosty dock
#

can you show the surrounding lines?

maiden river
#

true

#

john smods strikes again

smoky talon
#

gorbcount is for something else and the print is just to see when it starts what it has for the variable, havent gotten that far yet

frosty dock
#

and line 10 has a trailing comma

smoky talon
#

that fixed it

frosty dock
#

you can do multiple assignments but not comma-separated statements

smoky talon
#

thanks so much

#

how do i do the print function for real? i did it for something before but forgot

frosty dock
#

you just need parentheses

#

they can be omitted on function calls in two cases only

fluid pecan
#

how do i change the deck of a challenge to one from cryptid? do i just do:

deck = {
        type = "equilibrium",
    },
```?
frosty dock
frosty dock
fluid pecan
frosty dock
frosty dock
#

there's no good reason for that and steamodded just fills names with keys

fluid pecan
#
    name = "cry-Equilibrium",

this one right? or do i need to add b_?

#
local equilibrium = {
    object_type = "Back",
    name = "cry-Equilibrium",
    key = "equilibrium",
    order = 3,
    config = { vouchers = { "v_overstock_norm", "v_overstock_plus" }, cry_equilibrium = true },
    pos = { x = 0, y = 1 },
    atlas = "atlasdeck",
}

full code for reference:

sturdy compass
frosty dock
prisma loom
#

Do I import poker hands like this?

silver turret
frosty dock
silver turret
#

yeah lemme dm you

prisma loom
frosty dock
#

it sure works but it doesn't do anything

smoky talon
#

im trying to figure out how the date function works in the clock mod but cant seem to figure it out

prisma loom
#

other content didnt crash my game when imported but this does for some reason

smoky talon
#

its only mentioned once in the whole thing

frosty dock
smoky talon
#

this is the only time its mentioned in any of the clock mod files

fluid pecan
prisma loom
# frosty dock more likely the file you're importing has an error then

Is this the right way to make a poker hand via SMODS? Cryptid and other mods I found use some other strange methods

    key = stone_ocean,
    name = "Stone Ocean",
    above_hand = "Three of a Kind",
    text = { "5 Stone cards" },
    visible = false,
    chips = 50,
    mult = 1,
    l_chips = 10,
    l_mult = 0,
    example = {
        { "S_2", true, "m_stone" },
        { "S_2", true, "m_stone" },
        { "S_2", true, "m_stone" },
        { "S_2", true, "m_stone" },
        { "S_2", true, "m_stone" }
    },
    evaluate = function(hand)
        return hand.stone_ocean
    end,
    func = function(hand)
        if #hand < 5 then return {} end
        local ret = {}
        local stones = 0
        for i = 1, #hand do
            local v = hand[i].base.value
            -- Skip anything we can't interpret (for whatever reason)
            if v then
                -- The "Base" of a Castle is comprised of three face
                -- cards of any ranks
                if hand[i].ability.name == "Stone Card" and stones < 5 then
                    stones = stones + 1
                    table.insert(ret, hand[i])
                end
            end
        end
        if stones >= 3 and #ret >= 5 then
            return { ret }
        else
            return {}
        end
    end
}```
bold sleet
frosty dock
frosty dock
bold sleet
#

Alright, thanks you.

ionic verge
#

source, me at least twice

frosty dock
frosty dock
#

you're setting the key to the global var stone_ocean

#

which is not defined, so there is no key

#

you need that to be a string

prisma loom
#

omfg

#

I forgot ""

frosty dock
#

I did not pay attention to that because code display is ass on mobile

prisma loom
#

my bad

vivid solstice
#

hey, whats the mod that allows for you to spawn tarot cards and jokers from your collection?

obtuse silo
#

debug ?

vivid solstice
#

Which debug? Debug plus or?

prisma loom
frosty dock
#

its visibility is set to false, so it doesn't appear until you play it

prisma loom
#

it doesnt appear when I select the poker hand

ionic verge
prisma loom
#

neither when I play it

#

or after I played it

frosty dock
#

oh I see your eval logic is flawed

#

you're only inserting stones to ret

#

so it'll only find something when you play 5 stones

tired marsh
#

What file are the basegame jokers and their calculate functions under? for the life of me I can't find it

#

I want to steal the popcorn and ice cream code

frosty dock
#

evaluate has different args

#

(parts, hand)

versed basin
# prisma loom like this?

something to consider unless if im crazy, won't stones and #ret be the same value? The stones >= 3 and ret >= 5 condition will only ever be true if the ret has 5 (or more) stones in it

frosty dock
#

you need it if you're gonna add the faces to it like the comment says

prisma loom
#

ahhh

prisma loom
#

I dont understand

red osprey
#

evaluate = function(parts, hand)

#

Unrelated, random Joker idea:

Student (Common) - Whenever you score a hand that doesn't clear the blind, this gains +1 Mult

prisma loom
red osprey
#

You were missing the "parts, "

frosty dock
#

as I said, that's a "read the docs" moment

vivid solstice
#

i dont know how to activate the card, as in how to make it usable,

prisma loom
frosty dock
#

where

native raft
#

Hello trying to figure out the outline issue can't seem to get the script to work right?

prisma loom
night pagoda
native raft
#

ah maybe the pillow thing

night pagoda
#

Yeah you need pillow and need to check if yours python version is around 3.10 - 3.11

frosty dock
# prisma loom

you're inserting into parts and returning a table of the number of stones

native raft
#

using a future version, and don't have pillow, I'll work on that

past forge
#

is there any guide on file structure? i want to make my own localization messages but dont know how or if i have to do it in main.lua or where

frosty dock
# prisma loom

I feel like you lack some amount of understanding about coding, you should work on that

past forge
#

and how to access another files from main.lua

frosty dock
#

for loading other files, use SMODS.load_file

#

Usage: assert(SMODS.load_file('path/to/file.lua'))(), where that path is relative to your mod's main folder

prisma loom
frosty dock
# past forge perfect

note this isn't what you should do for localization strings. refer to the wiki page I sent for that

night pagoda
#

Speaking of localization files, I was trying to do the deckskin palettes today and this seems super scuffed (screenshot is from a localization file): How am I supposed to add a palette to a deckskin without worrying that some other mod's localization won't overwrite it?

frosty dock
prisma loom
#

:(

frosty dock
#

you're right, it's super scuffed

night pagoda
#

I was expecting it to check for a key, and not an index; had a lot of tries to even make it visible

#

and the fact that hc & lc already claimed first two places didn't help

frosty dock
#

maybe it's easy enough to just statically redirect lc/default and hc to 1 and 2 and make the rest use keys

#

wait I think I'm just dumb

#

I don't think there's this kind of restriction at all

#

maybe my brain is a bit fried

prisma loom
past forge
#

so if i paste my localization messages like this:

return {
    descriptions = {
        Back={},
        Blind={},
        Edition={},
        Enhanced={},
        Joker={},
        Other={},
        Planet={},
        Spectral={},
        Stake={},
        Tag={},
        Tarot={},
        Voucher={},
    },
    misc = {
        achievement_descriptions={},
        achievement_names={},
        blind_states={},
        challenge_names={},
        collabs={},
        dictionary={},
        high_scores={},
        labels={},
        poker_hand_descriptions={},
        poker_hands={},
        quips={},
        ranks={},
        suits_plural={},
        suits_singular={},
        tutorial={},
        v_dictionary={},
        v_text={},
    },
}
``` at the top of my main.lua will it work?
#

i just want to make the messages on the cards

frosty dock
#

read the wiki page properly

#

localization gets a separate file (per locale)

past forge
#

i meant localization.lua instead of main.lua 🤦‍♂️

past forge
frosty dock
past forge
#

touché

#

im bad at reading

left lance
#

What wiki are y'all referring to? I'm new to balatro modding and have many questions, but don't wanna be a bother to folks

ionic verge
past forge
frosty dock
#

"fun fact: 98% of Balatro players can't read"

ionic verge
#

so if 98% can read balatro players cant

frosty dock
ionic verge
#

real

hardy viper
#

98% of players read balatro can't...

hushed field
#

wait so what does the 98% reference??

frosty dock
#

Players% of 98 Balatro can't read

past forge
maiden phoenix
#

The real question is who are the 2%

past forge
frosty dock
past forge
#

since colours and colors and the "caino" ability

frosty dock
#

gluttenous joker my beloved

maiden phoenix
#

tbh colours and colors is arguable

frosty dock
#

isn't the game pretty consistent with using the bri'ish spelling?

maiden phoenix
#

steam'odded

graceful magnet
#

So I managed to make the card increase the lowest hand level by 2 and decrease the highest hand level by 1

However, once it completes a full cycle of this, increasing every hand once, the next time it activates it crashes, what's going on?

#

not entirely sure what conclusion to draw from where I'm being directed (this being the crash error line)

past forge
#

Okay about the localization:

Should i have one file named localization.lua or a folder named Localization and all the files like the balatro source code?

maiden phoenix
past forge
#

okay

graceful magnet
maiden phoenix
vivid solstice
#

i have no clue what im doing, would this tarot card work?

frosty dock
#

no

#

that's a whole feckin for loop inside a loc_vars return table

graceful magnet
past forge
#

isnt this a valid localization table?

#

im trying to refer it like this in the main.lua

#

but it gives ERROR

past forge
#

😭

frosty dock
#

you see messages here anywhere?

stray warren
#

It's not messages, I know that much

frosty dock
#

cause i certainly don't

#

it's misc.dictionary for accessing it the way you're trying to

prisma loom
#

what's the issue here?

past forge
#

hahhaha

prisma loom
#

Docs say that return { hand } if all cards score

past forge
stray warren
#

v_dictionary has variable values inside

frosty dock
tired marsh
#

How thick should the borders of my joker art be?

vivid solstice
#

i think its 2pixels but you can check the pinned messages in the fan art section to make sure

past forge
tired marsh
#

bet

vivid solstice
#

was checking the docs for ages but I still dont know how to make this tarot card work

#

im trying to make it work like world or sun

smoky beacon
#

How do I make a mod

maiden phoenix
versed basin
smoky beacon
#

I have no idea what I'm doing

#

Could anyone hop in vc and walk me through it? I have plenty of ideas for jokers and such but no clue on the code side

maiden phoenix
#

If you got no coding knowledge it's gonna be very hard

past forge
smoky beacon
#

Would anyone wanna like Collab on a mod?

#

I have ideas

past forge
#

just ideas?

smoky beacon
#

And artwork

#

For a joker

#

But can make more

past forge
#

okay, so you want to learn how to make mods or you want your joker ideas/art to be made in-game?

smoky beacon
#

Stuff in game

past forge
#

im currently working with a guy that gives me the art and we come with ideas, and i code the jokers because im still learning an practicing

smoky beacon
#

Would you like some more ideas? :3

past forge
#

yeah, why not

#

you can dm me if ypu want

versed basin
#

I see a lot of references in mods and the example mods to the G object, but I can't seem to find any documentation on it aside from the event queue? Is there anywhere I can find the properties of this object?

maiden phoenix
#

You can find everything related to G in the game.lua file

versed basin
normal crest
#

Mods/lovely/dump

maiden phoenix
normal crest
#

if you extract the exe you will be missing everything smods adds with lovely patches

versed basin
#

ahhhh i see! thank you both!

maiden phoenix
past forge
#

I have no idea why the joker_main never triggers

normal crest
#

because you defined those variables inside the calculate function

past forge
#

i tried to do it in the context.before

maiden phoenix
#

two_suits will reset to false each calculate call

normal crest
#

before a hand is scored, your calculate function will be called with context.before first, and then context.joker_main later

#

each time it's called, two_suits will be set to false

past forge
#

i see

normal crest
#

you can put your entire logic in joker_main

vivid solstice
normal crest
#

there error says you did something along the lines of c.something and c was nil

vivid solstice
#

well it doesnt look like it
heres my code for help

normal crest
#

and where does c come from

#

you never defined it

glad osprey
#

how do i check if a card is in the consumables area

normal crest
#

card.area == G.consumeables

glad osprey
#

ty

versed basin
#

once again, thank you SDM_0 and srockw! i'm looking through the dump and im finally seeing things like cardarea and card which also weren't well defined in the smods wiki* before :D

maiden phoenix
past forge
#

now it works but just adds mult and not chips

#

also, is there a way to display 2 messages, one after the another?

maiden phoenix
#

Which smods version do you use?

past forge
maiden phoenix
#

try replacing chips_mod and mult_mod by chips and mult respectively

glad osprey
#

why isnt the card un-debuffing

past forge
#

it even does the message on its own

#

thank you so much

maiden phoenix
normal crest
glad osprey
#

i dont want to remove all debuffs just delayed

#

which is the only one im adding

normal crest
#

Oh wait

#

if the joker is debuffed its calculate function isn't called

glad osprey
#

wat

unkempt thicket
#

Do i have the context wrong? (it's suppose to give money once after the end of round, it instead triggers multiple times and sometimes just delaminations)

glad osprey
#

but it worked for verdant

normal crest
#

you're trying to remove the debuff from your own joker

maiden phoenix
glad osprey
past forge
#

en of round is before the cashout

unkempt thicket
#

oh i should clarify its a enhancment

maiden phoenix
#

Oh

normal crest
past forge
#

oh okay so like golden cards

maiden phoenix
#

add and context.main_eval

#

maybe

glad osprey
unkempt thicket
normal crest
#

what is "before"

glad osprey
#

with a different similar sticker i made

#

joker disabled until a joker is sold

normal crest
#

The sticker was on the joker?

glad osprey
#

yes

unkempt thicket
maiden phoenix
#

try debugging context see which returns true

normal crest
# glad osprey yes

it looks like stickers on jokers are calculated even when they're debuffed, but not on other cards

#

presumably to prevent you from, for example, selling an eternal joker when it's debuffed, or not losing $3 on a debuffed rental

past forge
#

is there a way to check if a scoring card has any enhancement, edition or seal?

frosty dock
jovial harness
#

For a joker, would this add 1 to totalHand if it's an ace, 2-10, adds number, face cards, ignore it?

glad osprey
#

good lord its notepad ++

maiden river
#

is there a way to make a run start at a higher ante?

#

my mod makes the first antes way too easy lmao

maiden river
plush cove
jovial harness
past forge
#

i guess i make a possibility with math.random the dice wont take effect on it??

bold sleet
#

hello, again, how does one change the rank of a given card to an arbitrary rank?

#

also, when using context.repetition, how do I access the other card? (playing card)

maiden river
bold sleet
#

yummers

bold sleet
maiden river
bold sleet
#

so context.other_card:SMODS.change_base()?

frosty dock
#

excuse me what

#

assert(SMODS.change_base(context.other_card, <suit>, <rank>))

bold sleet
#

12 am coding yay

frosty dock
#

leave suit as nil when just changing the rank

maiden river
#

john smods strikes again

plush cove
#

okay so I'm trying to make a Joker that sacrifices itself if another Joker is supposed to instead, and I have one idea of how to make it, but it's a very specific method

i could add in patches that specifically target Mr. Bones and Cavendish

but I want to have broader compatibility with other mods, so what's the best way I can target self-destructing Jokers (that don't have inherently diminishing value, like Ramen, Ice Cream, Popcorn, etc)

unkempt thicket
#

How can I send a debug message of the current context in a given situation?

versed basin
# maiden river is there a way to make a run start at a higher ante?

I just started skimming through the source code so this is likely incorrect however there is this function that eases the ante, and in the source code the Hieroglyph and Petroglyph vouchers both use the ease_ante function as well as ```lua
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante-center_table.extra

frosty dock
jovial harness
#

Is there a calculate() context for if a playing card is retriggered? I have a joker that's counting up the total value of numbered cards via if context.individual and context.cardarea == G.play and not context.blueprint then but there's a bug when a playing card is triggered more than once.

prisma loom
#

Tried another iteration of 5 stones hand still aint working

#

any ideas why?

chrome prawn
#

for some reason whenever I try to play this custom poker hand the game doesn't score the queen it's suppose to check for
does someone know how to fix this

uneven bobcat
#

could anyone help me with something silly

#

i am creating a joker that activates whenever you use a tarot card that is NOT the fool and somehow i have not figured this out yet

#

mostly just the Not Fool part

ionic verge
#

so im setting up localization for the first time and i just want to confirm, i dont need to initialize it through my main.lua file, right?

versed basin
uneven bobcat
#

thank you :D

versed basin
#

np!

frosty dock
#

-# key supremacy

versed basin
#

It may be superior, but nothing is funnier than unending if/else name checks

frosty dock
#

why yes there is something funnier

versed basin
#

oh?

frosty dock
#

you can make a completely different card behave like a vanilla card in certain aspects just by giving it that name

versed basin
#

wait, oh my

frosty dock
#

like giving something the name 'Wee Joker' makes it wee-sized

ionic verge
#

does all of this need to be in G.localization or is it good as is?

versed basin
#

with this knowledge, i will make the most reliable balatro mod that will surely stand the test of time of updates

ionic verge
#

cool

ionic verge
#

now to cut this down to what im actually using

#

to survive the onslaught of updates you must be fluid like them, like water

versed basin
#

don't worry i have a healthy fear of updates breaking everything

chrome prawn
versed basin
chrome prawn
#

yeah

#

the game recognizes that I'm trying to play the custom hand

#

but it just doesn't score the queen

versed basin
#

that is odd

tired marsh
#

Is there something similar to breakpoints in vs code that I can use to step by step go through my function to see if its doing what I want it to

#

My joker is doing all of the stuff it needs to do initially, but its a food joker so it should be decaying over time

#

And I don't think its doing that

novel dagger
#

Silly question: How do you make a joker just give 6X mult

jovial harness
fallen vigil
#

how do i round a number down

versed basin
fallen vigil
#

thanks so this would be correct to round the equation in () down?

versed basin
#

looks like it!

fallen vigil
#

thank you appreciate it ^^

#

is there a way to make a joker only able to be purchased once per game?

red flower
unkempt thicket
#

what's the better calc version of eval_this?

fallen vigil
jovial harness
#

Is there a way to make a legendary joker that can't be found through The Soul?

red flower
fallen vigil
red flower
#

I don't think so

fallen vigil
#

it seems to still be showing up

scarlet spire
#

where can I find a list of all of the text color codes?

red flower
#

globals.lua has all the colors but the localization colors are in misc_functions inside loc_colour()

fallen vigil
#

i rewrote it and it seem to be working so user error ig

ionic verge
#

how would i localize messages?
(i.e the 'message =' stuff in calculate)

#

would i just do it like vanilla or nah?

bold sleet
#

the thing is not doing the thing god it is 3 am

unkempt thicket
jovial harness
#

Is there a way to set custom colours for a joker name?

ionic verge
#

...
can you do {C:whathaveyou} in the name part?

jovial harness
#

Like beyond {C:red} tags, I'm looking to do a specific hex code unfortunately

ionic verge
#

i think you have to define your own color

#

unfortunately i dont know how youd do that

jovial harness
#

{C:HEX(3EFFCC)} doesn't give 3EFFCC for the joker name unfortunately

ionic verge
#

no i mean like

#

elsewhere

#

set it up as a G.COLOUR thing or something

jovial harness
#

Nah, that makes sense, I'll look into that

red flower
ionic verge
#

so will that work without any more input?

#

i presume that'd go in one of these?

unkempt thicket
#

yea, in a localization file you can have stuff like that

ionic verge
#

got it

unkempt thicket
#

with vars too

ionic verge
#

mhm

random sleet
#

holy shit its snow

left lance
#

Looking through the wiki; am I just dumb or is there no section on applying editions to jokers? I'm trying to make a custom joker that is always negative. I see the wiki/documentation on how to make new editions or update weighting of current editions, but not about fixing/forcing a joker to have that edition

celest olive
#

(assuming youre using steamodded)
could you do something like

set_ability = function(self, card)
  card:set_edition({negative = true}, true)
end,```
vague pendant
#

Is there an easy way to see what badges a card has?

undone flicker
#

what would I need to call in a custon deck (SMODS.back) to give a specific joker at the start of a run?

vague pendant
#

probably SMODS.create_card({...})

undone flicker
#

perfect, I'll look into it

#

and that's under the apply function?

vague pendant
#

yeah

hardy viper
#

so no calling

#

check the code for some other mods deck

undone flicker
#

nevermind, found kuso-mods which has a bunch of good sample decks

spare elk
red flower
#

you should update steamodded and lovely

hardy viper
#

ancient mods folder

random sleet
#

prehistoric lovely version

spare elk
#

i... cannot uninstall the old lovely to update it

#

"access to folder refused, you need an autorisation from DESKTOP-07ROSI0/[my name] to modify this folder"

#

thats... concerning

#

no wait im an idiot i still had balatro running in the background

#

we're good

hardy viper
#

okay cool

spare elk
#

alright what does this mean now

rough furnace
spare elk
#

what

red flower
# plush cove bump

I don't think this is possible without explicit cross mod compatibility

spare elk
red flower
#

i would try removing everything from the mods folder and installing everything again

fallen vigil
#

how do i set the sell price of a joker

spare elk
spare elk
merry condor
#

that's to set the buy price

spare elk
#

oh

#

hm

red flower
nova finch
#

how do i make a joker that upgrades when a boss blind's ability triggers? i referenced the code I have off of matador but it isnt doing anything

fallen vigil
red flower
#

im on my phone so i dont remember the exact names

local set_cost_ref = Card.set_cost
function Card:set_cost()
set_cost_ref(self)
self.sell_cost = 0
end

#

obviously you would add whatever value instead of 0 and check if it fulfills whatever conditions you want

merry condor
#

Gosh, I'm sorry to contribute another question to the already existing sea of them, but I'm experiencing a crash when the game attempts to call the "juice_up" function from within the "juice_card" function (functions/common_events.lua:1238: attempt to call method 'juice_up' (a nil value)) and I'm not really sure what's causing it or how to fix it. Here is the code from within the scoring section of my joker definition, I mostly took it straight from Midas Mask. As far as I can tell, it functionally changes the suit from hearts to spades pretty OK but then it crashes when it reaches the last card in the line.

#

Since it (seems?) goes through "v:change_suit" ok as it changes the suits, maybe it's the message part of the last segment?

#

For more context, the offending function and line in lovely seems to be this

#

I haven't been able to track down what chain of events is causing this or why it is misbehaving

spare elk
undone flicker
#

how do you use the create_card() function to create a specific modded joker?

red flower
spare elk
#

did both

red flower
#

weird

undone flicker
#

perfect thanks

spare elk
#

first with only cryptid but it crashed with smods so i removed the negative priorities from there too

red flower
#

i mean thats probably not the issue

spare elk
#

actually wait why are the lovely negative priorities so bad when a bunch of other mods have those and they dont cause issues

red flower
#

yeah i think you have something installed wrong

#

or maybe a bad version of something

spare elk
#

oh wait is this the uhh

#

whats it called

#

refactor shenanigans

red flower
#

maybe that's why I asked if just smods worked

spare elk
#

yeah refactored or not it still hates negative priorities

undone flicker
#

hate to be back so soon but, how would I spawn the joker at the start of a run from a deck, I tried using the apply function and spawning a card, but it seems it tries to do that before the area is loaded which returns a nil and I get a
"attempt to index local "area" [a nil value]"
crash

gaunt thistle
spare elk
gaunt thistle
#

you need to update lovely

spare elk
#

same error on the latest lovely i can find

gaunt thistle
#

let me see your logs

spare elk
#

logs as in..?

chrome prawn
gaunt thistle
#

in your mods folder. lovely/logs, share the latest one

unkempt thicket
#

The game claims I am comparing a table and var, when did G.GAME.dollars become a table. also, what do I use instead?

gaunt thistle
#

your version is ancient

spare elk
#

this is the one i just downloaded

gaunt thistle
#

that is the most recent, yes, but your log doesn't indicate that you've installed it

spare elk
#

thats odd

gaunt thistle
#

did you follow the install guide referenced to in that release?

spare elk
#

yep that appears to have done it

#

thank you!!!

gaunt thistle
#

np!

gaunt thistle
#

initially

spare elk
#

i just thought it went like every other mod and you just needed to put it in the mods folder

#

it had been a while since i last installed lovely :p

gaunt thistle
#

I was just wondering how you ended up with that version catHeyHello

tall wharf
#

i should make a second guide to install Balatro mod

gaunt thistle
#

the more the merrier

spare elk
fallen vigil
#

how do i set the card in context.buying/selling_card to the joker initiating it and not the joker being sold/bought

gaunt thistle
#

you likely have some ancient mod files kicking around

#

and when I say uninstall I mean "completely delete, not overwrite"

spare elk
#

yeah dont worry i already do that

gaunt thistle
#

gotcha

scarlet spire
#

I'm tired so I'm probably missing something obvious, but this calculate function (on a seal) is supposed to check if the card is in the hand but unscoring, but it doesn't seem to work. any ideas on what's going wrong here?

undone flicker
#

is there a rightmost equvalent to the "pinned" sticker?

spare elk
#

nope, nothing

#

maybe my indexing is wrong? i dont think so, since the other atlases work well

plush cove
spare elk
#

your guess is as good as mine

#

these were some of the first lines of code i made for this mod

#

lemme try removing it

nova finch
#

I'm trying to make a joker that works like mr bones, and I'm using code from mr bones. is there a way to do it to make it not say the 'saved by mr. bones' text?

spare elk
undone flicker
#

How could I force a joker to always be rightmost?

lavish lake
#

How do I loop through all played cards in a hand, check if any cards rank is 4, and then retrigger it?

plush cove
#

and just modify it a bit

scarlet spire
#

the smods example jokers mod has a sock and buskin reimplementation that should be pretty easy to convert to 4s instead of face cards

spare elk
#

wait the smods example jokers still exist? i couldn't find them last i checked

rose dragon
jovial harness
lavish lake
# plush cove check the code for Hack

I got a crash and here's my code:

SMODS.Joker {
    key = "letter_d",
    loc_txt = {
        name = "D",
        text = {
            "Retrigger each played {C:attention}#1#{}"
        }
    },
    config = { extra = { cardRank = 4 } },
    rarity = 2,
    atlas = "alphabet_atlas",
    pos = { x = 0, y = 0 },
    loc_vars = function (self, info_queue, card)
        return { vars = { card.ability.extra.cardRank } }
    end,
    calculate = function (self, card, context)
        if context.other_card:get_id() == card.ability.extra.cardRank then
            return {
                repetitions = 1,
                card = card
            }
        end
    end
}
jovial harness
spare elk
#

wow thanks

#

thought for sure the example jokers were lost media

jovial harness
#

Nah, if they were I'd be SOL, haha

scarlet spire
#

oops, hit enter too soon

#

you're not actually checking for a context as far as I'm aware

lavish lake
#

I got soul in a test run....

scarlet spire
#

see this calculate function from the example sock and buskin

lavish lake
jovial harness
#

How does loc_color() work? Been trying to figure out how to get a custom colour for joker names through looking at cryptid code but it just isn't clicking in my head

normal crest
#

Can you change the text color of the badge on a sticker

faint yacht
# nova finch I'm trying to make a joker that works like mr bones, and I'm using code from mr ...

A Lovely patch is required for custom text instead of "Saved by Mr. Bones"... something like I had done with https://github.com/TheOneGoofAli/TOGAPackBalatro/blob/main/lovely.toml ... then set G.GAME.current_round.usesavedtext = true & specify string with G.GAME.current_round.savedtext = "customtext". Crude patch, but works.

GitHub

A personal timewaster project that is a mod for Balatro. - TheOneGoofAli/TOGAPackBalatro

chrome widget
#

Looking to see if anyone can help me with sprite positioning for a thing. I need these sprites to glowing outline sprites to overlay atop their respective parents, but I'm not sure i fully understand how the nested coordinates for the movables/nodes work?

#

It looks like they're all starting in the top left (the largest outline is 153 pixels wide to 95 pixels of the yellow joker beneath, so it feels like I should just be able to offset the position somehow, but my experiments to do so always seem to lead to weird results

#

Can anyone advise?

chrome widget
#

Okay I think I figured it out kinda? It's not super self explanatory but "offset" isn't actually set anywhere normally when you create a sprite/moveable, and setting the transform position directly even if it's a weak bond will cause the offset to be reset automatically. I think you need to call set_alignment()

limpid halo
#

Do jokers spawned with DebugPlus still show up in the shop?

desert ore
#

yes, I believe so. iirc it's happened to me when debugging a joker

limpid halo
#

okay awesome, no weird shop bug for me

desert ore
#

anybody know if it's possible to make a joker that's larger than standard size? If there's an example of it, I'd love to know which mod

lethal mural
#

it wont add the sticker

desert ore
plush cove
#

heya! i'm trying to make a joker that guarantees a gros michel or cavendish in the next shop if the player doesn't already have one

this is how much progress I've made (creating_store_joker is a custom context), and while the card spawns, it's not buyable and it appears on top of one of the buyable cards

what's the best way to fix this?

#

worst case scenario I can always just add a custom tag, but I really want to see if it's possible to just do it within the code

normal crest
#

You forgot to emplace it

#

Unless create_card does that automatically

#

I can't remember

lethal mural
#

i cant figure out why my sticker wont add

rose dragon
lethal mural
#

ok so the sticker itself works

#

but for some reason create_card wont add it

plush cove
normal crest
# normal crest bump

solve it with a lovely patch targetting badges[#badges + 1] = create_badge(localize(v, "labels"), get_badge_colour(v)) on UI_definitions.lua, for anyone else looking to do the same on a sticker

lethal mural
#

is there any way to add legendaries to the pool in create_card without making it ONLY legendaries

scarlet spire
plush cove
lethal mural
# lethal mural

figured this out
it seems create_card is incompatible with modded stickers so you have to add it directly to the card using SMODS.Stickers

scarlet spire
#

probably two?

#

I think the table is of the card being played

#

too big to really tell anything, the console is really limited

plush cove
#

isnt "card" usually used to refer to the joker itself?

scarlet spire
#

this is on a seal, so card refers to the card it's on

#

since iirc self is the seal

#

does the debugplus console dump anywhere?

#

doesn't seem like it

random sleet
#

lovely's console log should contain it?

#

i think ( i dont think :3 )

scarlet spire
#

okay it does

#

okay it prints the data of the same card twice when just playing the card itself (so it scores)

#

which, is correct

#

it DOESN'T print when playing it unscoring, so. that means it's not running that code at all, which is ALSO correct

#

so that means isinhand is false

#

so WHY doesn't the if trigger???

cerulean rose
#

vscode lua extension really doesn't like hooks

#

shows a warning on every single one

scarlet spire
#

okay huh. the calculate function doesn't even try to run if the card is unscoring

#

I didn't know that worked like that?

#

literally not even this will work

#

which I guess makes sense, but hmm

lavish lake
#

Hmm guys what should the joker "F" do in my mod? There's not much context behind the name, but I need at least some idea that is balanced and creative

random sleet
#

yea youd need to add unscored cards to the calculation routine

scarlet spire
#

this just means I need to add a new calculate context when the appropriate conditions are met, right

#

or is there something more to adding them to the calculation routine

vital rapids
#

Hi autumn

random sleet
#

so youd actually be patching how the game scores cards while calculating a played hand which is different

lavish lake
random sleet
#

search through..... i forget if its functions/common_events.lua???

scarlet spire
#

i've been looking through, scoring is in state_events I believe

random sleet
#

ah oops

random sleet
#

look for where smods adds the hook for -- TARGET: Add your own ...

#

for card scoring

scarlet spire
#

cryptid has an unscoring context patch for this file, but the code it's looking for in the pattern doesn't seem to exist in newcalc smods

random sleet
#

somewhere around there you might be able to make it have a context for unscoring cards

#

sorry im not at my pc rn just kinda going from memory haha

scarlet spire
#

found this, but it's in what appears to be joker code

lavish lake
cerulean rose
lavish lake
spring lantern
#

any of yall got a link to the example jokers mod repo? can't find it anymore :(

lavish lake
spring lantern
#

cheers

lavish lake
normal crest
lavish lake
normal crest
#

well yes I just picked a random number

#

what's your code so far?

lavish lake
# normal crest what's your code so far?
SMODS.Joker {
    key = "letter_f",
    loc_txt = {
        name = "F",
        text = {
            "Destroyed cards give {C:money}#1#${}"
        }
    },
    config = { extra = { money = 3 } },
    rarity = 2,
    atlas = "alphabet_atlas",
    pos = { x = 1, y = 0 },
    loc_vars = function (self, info_queue, card)
        return { vars = { card.ability.extra.money } }
    end,
    calculate = function (self, card, context)
        if context.destroy_card then
            return {
                ease_dollars(card.ability.extra.money)
            }
        end
    end
}
normal crest
#

that's the wrong context for what you're trying to do

#

that's for your joker destroying cards

#

you want to use this

lavish lake
#

And the ease_dollars bit? Is it also incorrect?

normal crest
#

if you ran that I believe you'd get 3 dollars per card played

cerulean rose
#

yup

lavish lake
normal crest
#

that's unexpected

#

but still, you're using the wrong context

lavish lake
scarlet spire
#

in state_events

normal crest
lavish lake
normal crest
#

that doesn't crash?

lavish lake
#

I havent tested

normal crest
#

i think it'll crash

#

anyway

#

cards_destroyed is not defined there, you can access them in context.removed

#

if you return inside a for loop you will not finish looping through all cards

#

you will return on the first element always

lavish lake
lavish lake
normal crest
#

well if context.removed contains all destroyed cards

#

then you just get the length of that and multiply by your money

lavish lake
normal crest
#

No

#

within context.remove_playing_cards you have access to context.removed which is a list of the destroyed cards

lavish lake
cerulean rose
#

ye

lavish lake
#

Ok it works but now I wonder why the amount is 72 even though I set it to 3

normal crest
#

Start a new run

stiff locust
#

is there a way i can check what language the game is set to

normal crest
#

G.SETTINGS.language

stiff locust
#

like would it be G.SETTINGS.language == "French" or G.SETTINGS.language = "Francais"

normal crest
#

if you wanted to check for french you do G.SETTINGS.language == 'fr'

#

they're language codes

stiff locust
#

oh

#

alright

normal crest
#

these are all of them it seems

stiff locust
#

i was just about to ask if there was a place that has all of them

#

thanks

normal crest
#

game.lua:958

cerulean rose
#
SMODS.Joker({
    key = "commie",
    rarity = 2,
    pos = { x = 3, y = 3 },
    atlas = "jokers",
    cost = 9,
    blueprint_compat = false,
    calculate = function(self, card, context)
        if context.before and not context.blueprint then
            local targets = {}
            local target_total = 0
            for k, v in ipairs(context.scoring_hand) do
                if SMODS.Ranks[v.base.value].is_numeric then
                    table.insert(targets, v)
                    target_total = target_total + v.base.nominal
                end
            end
            if #targets > 0 then
                local ranks = {}
                for k, v in pairs(SMODS.Ranks) do
                    if v.is_numeric then
                        table.insert(ranks, v)
                    end
                end
                table.sort(ranks, function(a, b) return a.nominal < b.nominal end)
                target_total = target_total / #targets
                local target_rank = ranks[#ranks]
                for k, v in ipairs(ranks) do
                    if target_total < v.nominal then
                        if k <= 1 then
                            sendErrorMessage("Mathematical paradox detected! Aborting calculation...", self.key)
                            return { message = "ERROR" }
                        else
                            target_rank = ranks[k - 1]
                            break
                        end
                    end
                end
                G.E_MANAGER:add_event(Event({
                    func = function()
                        for k, v in ipairs(targets) do
                            SMODS.change_base(v, nil, target_rank.key)
                        end
                        play_sound("gong", 0.94, 0.3)
                        play_sound("gong", 0.94 * 1.5, 0.2)
                        play_sound("tarot1", 1.5)
                        return true
                    end
                }))
                return { message = localize("k_balanced"), volume = 0, colour = { 0.8, 0.45, 0.85, 1 } }
            end
        end
    end,
})

this joker plays generic1 when more than one number card is scored?

spring lantern
#

(it starts at 1.2x i just upgraded it a bunch before this hand

quasi comet
#

im trying to make a joker that gives x3 mult when the whole hand is enhanced; but it triggers as long as 1 card in the hand is enhanced right now, i think the issue is im not sure how to check if a card is not enhanced

bold sleet
#

help, why be shit not working?

#

How do I access the other card?

paper zealot
past forge
frosty dock
#

but also why context.repetition

bold sleet
#

ah

#

Because I need stuff to re-trigger.

quasi comet
past forge
quasi comet
#

weirdly enough it was working fine but now its giving me random center = nil stuff ? ? ?

past forge
#

Honestly im pretty new also so im not sure why that happens

paper zealot
stiff locust
#

gives X3 mult if game language is set to spanish

spring lantern
#

LOL

#

that's heat

paper zealot
#

Haha, great

past forge
#

🇪🇸

frosty dock
#

Who's Paul?

past forge
#

i dont know

frosty dock
#

none of y'all get that reference lmao

past forge
spring lantern
#

apparently held in hand ability jokers don't get retriggered when using the repetitions return 😭

frosty dock
#

they should

#

what are you retriggering and how?

vale lake
#

sorry to interupt but does anyone know why G.hand.cards is empty here?
edit: nvm this was fixed in a steammodded update, putting this here in case anyone else is confused here

spring lantern
#

but on this new jimbo i made it's just doing nothing

bold sleet
past forge
#

Is there any SMODS function to add a random enhancement, edition or seal to a card?

#

cant find it in the docs

spring lantern
#

i think there's poll_edition, poll_enhancement etc

#

that returns a randm edition enhancement etc and then you just apply it to the card

#

found em

frosty dock
#

I dont have telepathic powers

spring lantern
#

cant find poll_edition but im using it in a joker of mine

frosty dock
spring lantern
#

last time i had an issue because my smods was mega outdated, but now i'm on 1410d

#

which i think is pretty up to date or should be

#

gonna check git jic

frosty dock
#

that's a few days out of date, no changes since then to retriggers

spring lantern
#

gonna pull the latest updates anyway

past forge
#

one thing ive learned is that you can never have the latest version

fallen vigil
#

is there an easy way to make this work how i want it to

spring lantern
#

so you're creating the card, now what

frosty dock
#

use SMODS.add_card

fallen vigil
spring lantern
#

oh right

#

lol

fallen vigil
frosty dock
#

it provides an interface that doesn't suck (it takes a single table instead of 7 arguments with 4 nils) and does the emplacing and adding to deck for you

#

for the randomness

fallen vigil
#

oh i already used create card on like over 10 cards 🥲

frosty dock
#

you can make a SMODS.ObjectType with all the jokers this pool should be able to spawn

fallen vigil
#

how do i do that

frosty dock
#

you start by reading the docs

plush cove
fallen vigil
frosty dock
spring lantern
#

just double checked, updating smods changed nothing unsurprisingly, gonna have to check what's going on...

frosty dock
#

not sure then, it should work

#

either way I can't follow what's going on in the video, there's too much unnecessary stuff going on

plush cove
spring lantern
#

tru lmao let me just do a less overwhelming example

frosty dock
plush cove
#

would it make sense to do for the shop?

spring lantern
#

okay so this confirms it's not the blueprint mime silliness that's messing up the retrigger logic

#

ima go take a shower and come back to this

past forge
#

So if i want a 1 in 4 chance to add a random seal to a card it should be something like card.SMODS.poll_seal(*some random seed*, stdseal, 0.25, false) ?

frosty dock
plush cove
# frosty dock no

alright, ty for the teensy bit of insight though! good to know my code's not totally hacky 😅