#💻・modding-dev

1 messages · Page 461 of 1

red flower
#

i think i might add all the missing things to vanillaremade today

obtuse silo
#
  if G.jokers[x].joker.edition and G.jokers[x].joker.edition.key = "Negative" then
    --insert effect--
end

does that work or do i just refer to the joker as G.jokers[x].edition?

red flower
#

the syntax has more problems than that

#

let me write it down

regal bridge
#

whatta i need ta do

midnight coyote
#

how does vanilla ride the bus check its total increment

#

😭

stiff quiver
#

can someone explain to me why the thing in joker_main works but the thing in before doesnt ```lua
if context.joker_main then
print("AAA")
return { message = "AAAAAAAAAAA"}
end
if context.before and context.cardarea == G.play then
print("1")
end

it genunely just feels like smods hates me
formal parrot
red flower
stiff quiver
red flower
midnight coyote
#

i need to see it's variables

#

i dont need it done to smods spec

#

i need to see how the base game does it

red flower
#

search for it in the code?

midnight coyote
#

what file would i look into

red flower
midnight coyote
#

interesting

#

okay

#

i think i see what to do

wintry solar
#

What’s the reason for specificsllly needing the vanilla way?

midnight coyote
#

im probably gonna have to patch this in 🫠

midnight coyote
#

so i needed to know how the game handled it

#

im modifying vanilla jokers rn

#

lovely patching saves the day

#
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '''local last_mult = self.ability.mult'''
position = 'after'
match_indent = true
payload = '''
    if last_mult >= 25 then
        CHAR.FUNC.overclock_proc({card=self,key="j_charcuterie_metro_lines"})
    end
'''
#

works

#

wonderful

obtuse silo
red flower
#

#G.jokers.cards

obtuse silo
#

ah

#

same error

red flower
#

i didnt actually look at the error give me a sec

red flower
obtuse silo
#

it's the exact same but line 471 is now for i=1, #G.jokers.cards do

red flower
#

oh

#

G.hand:change_size

#

with a :

obtuse silo
#

dunno how i didn't pick that one up
i literally already have a joker that adds hand size

serene granite
#

im trying rly hard to make a joker that has text that dynically updates as the joker scales, but im struggling to make the text update, any advice? i looked at the Vampite example joker but im not quite getting there

tawdry oriole
#

i'm trying to make it so a tag has a certain chance to generate a joker in shop and while the "generating a joker" part works i can't figure out the probability one - if it does fail, it shows "nope!" but retries until it generates a joker. how would i make it so it doesn't retry?

red flower
#

tag:nope()

gilded blaze
#

there might be things you wouldn't understand right away, I recommend looking at other mods' code first:

  • hook Game:init_game_object() and add your own variable to track hands played per ante
  • hook Game:update_hand__played(dt) and increment your variable here (make sure it only happens once because this method is called every frame during a hand scoring)
  • depending on how you define your per ante logic, hook the correct function (e.g. ease_ante if any ante change resets the count)
  • finally, in your blind's set_blind function, transfer the extra value to G.GAME.blind.chips (do the math yourself)
    another thing: if you intend to have the blind update its required score when you're facing it, even more hooks are needed
tawdry oriole
#

^ trying something out rn

#

oh is it really just

#

😭

red flower
#

yeah

tawdry oriole
#

damn my bad

regal bridge
#

is a start

rugged pier
#

Would dynatext help here?

serene granite
#

how do i write it out in code on discord without it looking like a text block

red flower
#

dynatext is mostly to do animated text or stuff like misprint that has preset values

#

```lua
```

rugged pier
serene granite
#

i did it wrong oops

gilded blaze
#

like, it has no relation whatsoever

serene granite
#

ughhh

regal bridge
red flower
#

`

#

that one

serene granite
#

ohhh

#
        extra = {
            xmult = 1.0,
            xmult_gain = 0.2
        }
    },

    loc_txt = {
        name = "Frog",
        text = {
            '{X:mult,C:white}+{V:1}{} Mult per {C:spades}Spade{} destroyed',
            '{C:inactive}Current Mult: {X:mult,C:white}X{V:2}{}'
        }
    },

    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                string.format("%.1f", card.ability.extra.xmult_gain),
                string.format("%.1f", card.ability.extra.xmult)
            }
        }
    end,```
red flower
serene granite
#

ohhhhhhhhh

red flower
#

{V:1} is for color

serene granite
#

only for color?

red flower
gilded blaze
#

your showdown blind idea is just too overwhelming for a starter

serene granite
#

thank you for all the help, ill work on it !

wind steppe
#

how would i check (in an unlock condition) if ive beaten a specific deck on gold stake?

stiff quiver
#

this return isnt returning the xmult part because of the function after, how would i fix it? ```lua
return {xmult = card.ability.extra.xmult, func = SMODS.destroy_cards(context.other_card)}

tall wharf
#

i think @wintry solar forgor to update stable branch

formal parrot
red flower
stiff quiver
#

thanks both of you!

formal parrot
#

Me when i give hits so you try to fix it an learn instead of giving solutions LMAO

red flower
#

that makes it so the card is destroyed after the xmult message

gleaming yew
#

in the uh
deck skin example
what is the icon thing for?

tawdry shale
#

not sure why but when you open the game, the first card is an ace of spades in the middle of the balatro logo and starts shuffling through cards, whenever it changes from the ace to another card, i get this error:
card.lua:268: attempt to index local 'center' (a nil value)

pale holly
#
    key = "solSister",
        loc_txt= {
        name = 'Sol Sister',
        text = {
        "{C:green}#1# in 7"
    }
},
    --atlas = 'Maidenregalia',
    pos = { x = 0, y = 0 },
    rarity = 2,
    cost = 6,
    pools = {["pseudoregamod"] = true},
    
    unlocked = true,
    discovered = false,
    blueprint_compat = false,
    eternal_compat = true,
    perishable_compat = true,
    
        config = { extra = { odds = 7, additional = 0} },

    loc_vars = function(self, info_queue, card)
        return { vars = { G.GAME and G.GAME.probabilities.normal or 1 , card.ability.extra.odds } }
    end,

    calculate = function(self, card, context)
    local prayluck = 0
     if context.using_consumeable and not context.blueprint then
     if context.consumeable.ability.set == "Tarot" then
    prayluck = prayluck + 1
    elseif context.consumeable.ability.set == "Spectral" then
    prayluck = prayluck + 2
        end
        end
        
        if context.end_of_round and context.game_over and context.main_eval then
            if pseudorandom('cymbal_solSister') < G.GAME.probabilities.normal + prayluck / card.ability.extra.odds then
            prayluck = 0
                return {
                    message = "Prayers answered.",
                    saved = 'The prayers have been heard.'
                }
            end
        end
    end
}```

Hey so i've 2 questions :
How do i make the loc_vars to update the probability depending of my prayluck ? (right now prayluck does increase the probabilities of my joker but won't update it in its description)

And how do i make the Saved part NOT saying 'saved by Mr bones' ?
red flower
#

right now prayluck does increase the probabilities of my joker but won't update it in its description

does it? I don't think the logic there will work at all

And how do i make the Saved part NOT saying 'saved by Mr bones' ?

return a localization key to an entry in your localization file

#

what's actually happening is that
G.GAME.probabilities.normal + prayluck / card.ability.extra.odds
will always be
G.GAME.probabilities.normal + 0 / card.ability.extra.odds
which is equal to G.GAME.probabilities.normal

#

pemdas stuff

tawdry oriole
#

is there a way to do the opposite of forced_key (in a booster) and create anything but a certain rarity?

pale holly
red flower
#

local variables reset every time you call calculate so it wont keep the value

pale holly
#

Ah damn

#

Is there any way to make the idea i have still work or something ?

red flower
red flower
tawdry oriole
red flower
#

probably

tawdry oriole
#

i'll try that then

sour garden
#

is there an easy way to count the number of tarot cards you have in your consumables? i've been able to count the total amount of consumables, but the documentation for checking for tarots that i've found only applies when using or creating them

pale holly
red flower
sour garden
#

thank you omg

pale holly
regal bridge
#

what are all the contexts/

red flower
snow vale
#

is there any way to redirect destroying cards? (like, if the ceremonial dagger is about to destroy a card, it destroys a different joker instead)

red flower
#

I think you can do that with the new destroying context

pale holly
snow vale
red flower
#

i would wait a couple of days for the release tho

snow vale
#

hmm ok

#

ill delay that ability then

wintry solar
#

The new context would allow it to be blocked, I guess you could destroy a different card within it too

red flower
#

yeah thats what i was thinking

snow vale
#

also how can i make a joker that gains mult when any joker is destroyed?

red flower
#

also with the new context :3

solemn shuttle
#

been digging around but couldn't find any examples off the top of my head, but is there any way to have it so an enhancement can't be debuffed?

i.e.

Enhancement Name
X1.5 Mult
Immune to debuffs
Rare Enhancement Custom badge I made here at the bottom etc etc
manic rune
red flower
manic rune
#

oh that exists??

red flower
#

yes

manic rune
#

sob

solemn shuttle
pale holly
#

I had to tweak a bit the loc_vars in order to properly display the odds with prayluck, but it works now ! Thanks again !

snow vale
#

can the context context.destroy_cardbe used with jokers?

red flower
#

no

tawdry shale
#

do only jokers have the ability to save runs?

#

like i'm thinking about making a seal that does the same thing that mr bones does

#

a seal that if it's the last hand and the total is less than the blind requirement, it'll take the first scored card of the hand, save the run but also remove the seal from the card

red flower
#

tested in a blind and it worked so i dont see why a seal wouldnt

#

you might need to enable the discard optional area tho

tawdry shale
sonic cedar
#

is pseudorandom only a straight range, or can i make it select only the odd numbers of a given range?

like if i said (1,10) can i make so it only picks 1, 3,5, 7 or 9?

manic rune
#

SMODS.current_mod.optional_features = { cardareas = {discard = true}} maybe?

red flower
#

but idk maybe not

manic rune
red flower
#

thank you bepis for being good at math

manic rune
#

i wish i could say the same for myself

sonic cedar
manic rune
#

its a number

sonic cedar
#

ok true lmao

#

thanks guys

formal parrot
gleaming yew
#

How do I put multiple deck skins into one Lua?

manic rune
#

...why is that in return

tawdry oriole
#

not too sure why that crashes

manic rune
#

SMODS.modify_rank, i mean

sonic cedar
manic rune
#

wha

#

and it works when its in there??

sonic cedar
#

idk either???

sonic cedar
snow vale
#

peak new context

sonic cedar
gleaming yew
#

I've tried multiple ways of that

manic rune
#

try assert(SMODS.modify_rank(context.other_card, rand))

sonic cedar
#

bet

manic rune
#

put it outside return btw

feral cove
#

hi guys how diabolical is it to use math.random instead of pseudorandom for a heavy seed dependent game like balatro

manic rune
#

id abuse reentering the run until i get the good rng

gleaming yew
#
}

SMODS.DeckSkin {
    key```
and
```    },
    key```
with it being continued after that
sonic cedar
normal crest
manic rune
#

doesnt look like it, no

sonic cedar
#

nice

feral cove
tawdry oriole
#

how would you even replace a math.random(val1, val2) with pseudorandom?

feral cove
#

math.random chance to get 3 effects all of which are bad

normal crest
#

pseudorandom(seed, min, max)

manic rune
#

srockw beat me to it

gleaming yew
manic rune
#

yeah, what they said

modern kindle
#

👋

sonic cedar
#

hi dilly

manic rune
#

hi dil

modern kindle
#

Hi hi

pale holly
#

okay so i've used a localization file to make my string but, how do i actually make it work ? i've tried like on the right but didn't work

sonic cedar
#

and then different skins go in palettes is what it looks like

manic rune
gleaming yew
#

well

#

one per suit

#

that match

manic rune
#

god whats with vencord making it so the reaction notification is x10 slower

normal crest
manic rune
#

yall no

pale holly
normal crest
#

also the key "j_cymba_solSister" can be anything you want

#

I'd recommend putting your mod prefix in the key so that there aren't any conflicts

manic rune
#

i hate each and every one of you. :3

feral cove
#

I'm trying to remake vanilla decks

the first one, being red deck is called scarlet deck but im having trouble thinking of ideas to make it interesting does anyone here have any ideas (I'll credit you)

manic rune
#

+1 discard when a hand is played

#

idk

pale holly
feral cove
red flower
pale holly
feral cove
#

I only started asking again til now

normal crest
pale holly
#

ah alright, thanks

#

i just really never used the localisation before so this is why, was expected saved could be edited too

modern kindle
manic rune
#

sob

#

also dil, the fact that u made shaders automatically puts u above me

#

:3

modern kindle
#

I dont think so

#

Lmfao

manic rune
#

now take over yggdrasil so i can finally rest, thanks

modern kindle
#

My shaders arent even that kool

sonic cedar
#

i forget if pseudorandom skips the min or the max

modern kindle
#

They're like 3% epic

manic rune
#

it doesnt skip

modern kindle
#

You however are like 20573857272929% epic

sonic cedar
manic rune
#

😭 nowhere close, but thanks

manic rune
sonic cedar
sonic cedar
modern kindle
copper thorn
#
calculate = function(self, card, context)
        if not context.end_of_round and context.individual and context.cardarea == G.hand then
            local temp_mult, temp_ID = 1, 1
            local clenched_card = nil
            for i=1, #G.hand.cards do
                if temp_ID <= G.hand.cards[i].base.id and G.hand.cards[i].ability.effect ~= 'Stone Card' then temp_mult = G.hand.cards[i].base.nominal; temp_ID = G.hand.cards[i].base.id; clenched_card = G.hand.cards[i] end
            end
            if clenched_card == context.other_card then
                if context.other_card.debuff then
                    return {
                        message = localize('k_debuffed'),
                        colour = G.C.RED,
                        card = card,
                    }
                else
                    return {
                        h_Xmult = 2 * temp_Mult * 2,
                        card = card,
                    }
                end
            end
        end
    end
}```

what the heck did I do wrong ?
sonic cedar
modern kindle
sonic cedar
copper thorn
#

where ?

#

maybe a missclick or smth like that i suppose

sonic cedar
#

In your return

copper thorn
#

istg if that's the issue

#

ima kill mickey mouse tonight

sonic cedar
#

it’d be really funny

copper thorn
#

indeed

#

it was it...

#

quick question (i hope)

how do i make a joker not sellable

snow vale
#

why isn't this joker creating another joker?

red flower
modern kindle
#

Hi N

gilded blaze
obtuse silo
#

alright
is there a context for a joker being added?
And I mean, not this joker, i mean like
if a different joker is added

copper thorn
#

where dafuck do i put the card: ?

red flower
snow vale
tawdry shale
red flower
snow vale
red flower
sonic cedar
#

oh someone posted it alr

copper thorn
sonic cedar
#

yeah just remove the sticker part 😭

red flower
sonic cedar
#

return false

copper thorn
#

im just lost wth do i put and where ?

snow vale
red flower
#

it says mad_dumy

#

is that intentional

snow vale
#

wdym?

red flower
snow vale
#

yeah

#

it's the joker's key

#

oh wait

#

nvm

#

😭

#

ok yeah typo

copper thorn
#

isn't that just sweet ?

#

100% no crashes, made by profesionnals

tight hull
#

hello, quick question, is there a way to change a sound by a mod and not modifying the game files?

snow vale
snow vale
#

sure u can

#

just that you take ownership of the sound

tight hull
#

i cant find any mods that do that so idk how to

snow vale
#

or whatever

#

i didnt touch replacing sounds

#

ask someone good

copper thorn
gilded blaze
#

if you're aiming to replace the bgm instead of sfx, there's a way

tight hull
#

what is bgm?

gilded blaze
#

background music

tight hull
#

oh

#

i wanted to change the whoosh sound for smth else

frigid cargo
#

whenever i add a booster pack or voucher it is WIDE, do i have to use sprite sheets to not make this happen?

copper thorn
#

and dumb beginner questions, how do i know my variable ? and how do i check for my joker ?

obtuse silo
red flower
#

context.card.ability.set == "Joker"

tight hull
copper thorn
#

thanks...

tawdry oriole
#

i'm trying to make a wraith-like consumable that creates uncommon cards from my joker pool and it starts out okay-ish but three jokers in it starts generating random jokers of all rarities

red flower
#

rarity = "Uncommon"

#

rarity numbers work different in create card

tawdry oriole
obtuse silo
red flower
obtuse silo
#

so far it just checks if a card is being added and if the card is a joker

obtuse silo
#

ah

tawdry oriole
copper thorn
red flower
tawdry oriole
#

i'll try it out

red flower
copper thorn
#

what syntax errror did i make ?

red flower
#

you put it inside the joker definition, dont do that

#

this goes outside of everything

copper thorn
#

fuck

maiden phoenix
#

Also no , after can_sell_card

red flower
#

also you're using [ instead of ( it seems

#

also Card:can_sell_card with a :

copper thorn
#

i thougt it was [ with the writing

maiden phoenix
#

And a "then" after the if cond

red flower
#

lol

maiden phoenix
copper thorn
#

so like this ?

red flower
#

without that comma at the end but yes

copper thorn
#

and in the jokers def i put

sellable = true/false

red flower
#

no

copper thorn
#

???

red flower
#

return false inside the if condition

maiden phoenix
#

What are you trying to achieve? Make the card unsellable?

tawdry oriole
maiden phoenix
#

Add return false in the if block

red flower
tawdry oriole
tight hull
maiden phoenix
#

Actually idk if the func is a return or if its button config

tawdry oriole
#

well the main crash is a bad argument to ipairs apparently

red flower
#

it's a return

maiden phoenix
#

Cant check

tawdry oriole
#

i'll look into it

maiden phoenix
#

Ty N

copper thorn
#

where do i put the return false exactly i fell like i can't understand anything ?

maiden phoenix
#

Between the "if" line and the "end" below it

copper thorn
#

'k thanks

copper thorn
#

but likethe entire thing is outside of anything, is it okay ?

red flower
#

yes

uneven bobcat
#

how does one deal with jokers not being joker sized? either the sell/buy part of the ui is stretched and weird or the actual joker is stretched to fit, i gotta be missing something simple

#

modding on none sleep

red flower
#

that will be called when the game calls card:can_sell_card

copper thorn
#

so if i need another joker to be unsellable i just copy it and change the joker check ?

red flower
copper thorn
#

i don't wanna complicate things, if it works, it works no matter how ugly it is

red flower
#

rather than ugly it's to avoid future problems but ok

sonic cedar
#

where the heck is k_blabla_ex stored??

red flower
tight hull
obtuse silo
maiden phoenix
#

You can make it look simpler by having it this way

local awak_unsellable = {
    ["j_awak_ca"] = true,
    ...
}

if awak_unsellable[self.config.center.key] then

so that your code looks better and all you have to do to add a new entry is add it to the table

copper thorn
#

i can still sell it T-T

red flower
sonic cedar
# red flower localization?

so then which is the “saved by mr. Bones” part? like what if i wanted it to say a different joker’s name

maiden phoenix
#

If ... or chains are an eyesore

open tapir
#

hey guys just incase if you are wondering how to play videos on balatro

#

basically

open tapir
#

make a file called resources or videos or whatever you wanna call it

#

make your video file a .ogv

#

put the video in

red flower
obtuse silo
sonic cedar
faint yacht
open tapir
sonic cedar
copper thorn
red flower
#

no

#

it's cra not ca

faint yacht
open tapir
#

here’s the code!

red flower
#

is that an ad skip 😭

copper thorn
open tapir
#

fuck

#

yeah

#

there we go

novel thistle
#

Can anyone help me understand why my voucher does not seem to exist in game?

red flower
#

remove the = in the first line

novel thistle
#

oh you right

#

thx

copper thorn
#

ima bother y'all one last time, but i can't get the grey line under the glitchy text

open tapir
# open tapir use this code

wanna make it play when a joker is sold? i have no idea how! search up a mod with this code!! i stole the ad code from yahi!!

obtuse silo
#

is there also a context for if an edition is added/removed?

red flower
copper thorn
#

like this ?

red flower
# copper thorn like this ?

In computer science, pseudocode is a description of the steps in an algorithm using a mix of conventions of programming languages (like assignment operator, conditional operator, loop) with informal, usually self-explanatory, notation of actions and conditions. Although pseudocode shares features with regular programming languages, it is intende...

copper thorn
#

bro hit me with the wikipedia page

#

amen

primal robin
red flower
regal bridge
#

what kind of code would I set up in the main file to load all the jokers with a setup like this

obtuse silo
#

ah
just cause with how i'm testing my joker
it's not adding the hand size when the a joker is added, but turns negative
i probably need to add some sort of check between current hand size and the benefit but it would probably involve collateral with other hand size decreasing things (Merry Andy, Ouija, etc.)

regal bridge
#

having everything in the main file gets cumbersome

#

so I wanna split it apart

red flower
regal bridge
#

o

#

thanks

red flower
#

splitting is good, but that cryptid-like set up is too complicated for most mods

rancid flare
#

can anyone help me I need to change a G.GAME variable after an hand as been played

obtuse silo
tawdry shale
#

i'm trying to make it so that the deck of playing cards is checked once a round is over and removes a specific seal from the first card it finds but it removes more than one

red flower
rancid flare
# red flower elaborate?

somthing like that but at the end of each played hand instead of each round (code from the ExampleJokersMod)

red flower
red flower
#

yes

tawdry shale
#

gotcha

copper thorn
#

@red flower like this ?

tawdry oriole
#

this STILL doesn't work and i'm at a loss of solutions

red flower
copper thorn
#

ok

red flower
#

i dont know how to explain it better sadly

copper thorn
#

and idk how to understand it better too x)

red flower
rancid flare
tight hull
#

re-asking my question since I sill dont know, how to use create_replace_sound

red flower
rancid flare
#

okay thx perfect

obtuse silo
#

does context.update just check every frame? is there even a context.update?

#

i just want something to adress discrepancies

red flower
#

no but there's an update function that checks every frame yes

obtuse silo
#

ah good
i'll use that then

copper thorn
red flower
#

i mean i cant help without doing the code myself

#

and honestly i dont want to lol

copper thorn
#

fair enough

#

but could you please tell me what synthax error i made x=)

red flower
#

this comma shouldnt be there

copper thorn
#

uh uhhhhhh

red flower
#

theres maybe something else i cant see in the screenshot

tawdry oriole
#

awesome news: after looking at other mod's codes i've managed to actually make it work but the jokers don't actually count and go in the joker slots?

red flower
#

G.jokers:emplace(card)

tawdry oriole
#

right thank you

copper thorn
#
SMODS.Joker{
    key = "know",
    loc_txt = {
        name = "{C:dark_edition}The Forgotten One",
        
    },
    atlas = "sm",
    soul_pos = {x = 0, y = 1},
    rarity = "awak_know",
    pos = { x = 0, y = 0},
    cost = 50,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,
    config = { extra = { max = 100, min = 0.1 } },
    loc_vars = function(self, info_queue, card)
        local r_mults = {}
        for i = card.ability.extra.min, card.ability.extra.max do
            r_mults[#r_mults + 1] = tostring(i)
        end
        local loc_mult = ' ' .. (localize('k_mult')) .. ' '
        main_start = {
            { n = G.UIT.T, config = { text = '  X', colour = G.C.MULT, scale = 0.32 } },
            { n = G.UIT.O, config = { object = DynaText({ string = r_mults, colours = { G.C.RED }, pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.5, scale = 0.32, min_cycle_time = 0 }) } },
            { n = G.UIT.C, config = { padding = 0.15}, nodes = {
            { n = G.UIT.T, config = { text = ' Dimensions shift, reality itself trembling under a weight unseen.', colour = G.C.DARK_EDITION, scale = 0.32 } },
            { 
                n = G.UIT.O,
                config = {
                    object = DynaText({
                        string = {
                            { string = 'rand()', colour = G.C.JOKER_GREY }, { string = "#@" .. (G.deck and G.deck.cards[1] and G.deck.cards[#G.deck.cards].base.id or 11) .. (G.deck and G.deck.cards[1] and G.deck.cards[#G.deck.cards].base.suit:sub(1, 1) or 'D'), colour = G.C.RED },

                        ``` (i had to cut it it was too long for discord and to big for a screenshot)
tepid crow
#

too few }s

#

try indenting your code properly and you should be able to see the issue

obtuse silo
copper thorn
red flower
#

what are you trying to do?

regal bridge
#

how do I make my modded jokers auto-discoverd

red flower
obtuse silo
red flower
#

hmm yeah thats a bit complex

#

i would try doing it in contexts if you can but if you want to do it in update then you would need to check if it's in the joker area

rancid flare
#

is it possible to add a function that can be used in any part of the game ?

red flower
#

yes

#

just make it global

obtuse silo
humble matrix
#

i've got my own custom booster pack to show up in game but im wondering how i would get it to choose only jokers from my mod. does anyone know how i could do this?

red flower
faint yacht
obtuse silo
faint yacht
#

SMODS.calculate_context({editionchange = true, targetcard = self, targetedition = edition}) in the hook.

#

Something like such.

frigid cargo
#
        if context.cardarea == G.play and context.repetition and not context.repetition_only then
            if context.other_card:is_suit("Hearts") then
                return {
                    message = localize("k_again_ex"),
                    repetitions = card.ability.extra.repetitions,
                    card = context.other_card
                }
            end
        end
    end```
how do i make it so the joker itself also shakes when the card said "Again!"
obtuse silo
faint yacht
red flower
red flower
humble matrix
#

oh

#

im stupid lol

tight hull
tawdry shale
# tawdry shale here?

okay so i tried adding that but it didn't work so then i tried doing this, and it removes the seal of the last scored card with the specific seal before the round ends

frigid cargo
tawdry shale
#

it works but then when i try it again the next round, it doesn't remove any seals

tight hull
#

what does adding local in front of the code do?

red flower
red flower
red flower
# humble matrix

no, the earlier syntax was correct
the keys have to be like j_modprefix_key = true

frigid cargo
obtuse silo
#

yeah
so like
j_modprefix_canny cat = true,
etc,

tawdry shale
red flower
tawdry shale
#

alright that sounds good

plush depot
#

trying to enter a cryptid run with suit deck (hearts) and infinity sleeve on white stake

red flower
humble matrix
faint yacht
# obtuse silo i really don't know how to do hooks it is arcane sorcery for me sorry to bother ...
local set_edition_ref = Card.set_edition -- set up reference.
function Card:set_edition(edition, immediate, silent, delay)
  SMODS.calculate_context{edition = edition, card = self} -- execute context call.
  set_edition_ref(self, edition, immediate, silent, delay) -- call original function.
end

-- in the Joker
if context.card and context.card.ability.set == 'Joker' and (context.edition == 'e_negative' or context.edition.negative) and not (context.card.edition or context.card.edition.negative) then -- check if target edition is Negative and the given Joker is not negative...
  -- add hand size
elseif context.card and context.card.ability.set == 'Joker' and context.card.edition and context.card.edition.negative and not (context.edition == 'e_negative' or context.edition.negative) then -- check if target edition is NOT Negative and we are Negative...
  -- deduct hand size
end
#

-# Take with a grain of salt-

humble matrix
#

now the game is spawning cards

#

but its all fuckin jimbo

#

i think i can fix this ez

tight hull
#

how do i find whats the object key?

obtuse silo
tawdry shale
tight hull
#

uhh, what did I do?

candid sleet
#

anyone know what i missed here? trying to set up custom decks with smods.back but i'm not entirely sure what i'm doing

humble matrix
candid sleet
humble matrix
calm kiln
#

is it ethical to scower every mod on the modding wiki to see if any jokers have a similar effect to a joker im making if im not going to release it? I have no clue how i would implement the ability since i have no idea what to do beyond the basics

modern kindle
#

i mean yea you can look at how people do stuff, if you take their code directly you should probably ask them

chrome widget
#

What's the best list of all enhancements, including modded enhancements?

calm kiln
#

ok

normal crest
#

if they don't, ask

chrome widget
#

I guess I'll give an opposing voice here and say stealing is cool so you should do it because that's how you learn

modern kindle
#

im also for it but its just a rule in here at least that you need express permission
so i figured it wouldnt hurt to state it

normal crest
modern kindle
#

thats also true

calm kiln
#

yeah, im not gonna release it i just want to see if the idea in game

modern kindle
#

private mods may as well be free game

chrome widget
#

Yeah like I don't even believe in intellectual property of public code. You're basically asking to be absolved of thoughtcrime

#

Thoughtcrime is not real, do what you want

modern kindle
#

but im thinking of crime right now

#

whatcha gonna do smt, gonna report me? (also hi)

normal crest
#

would you be okay with that

drowsy heath
#

im so confused why is a vanilla joker is causing a crash when my consumable that only effects my coffee jokers is used

#

the joker in question was onyx agate

normal crest
#

what is the crash exactly?

chrome widget
drowsy heath
#

hold on let me get it bak up

drowsy heath
daring fern
normal crest
# drowsy heath

Ah, some vanilla jokers don't have extra as a table, but rather a number

#

so you should do the same check you do in can_use with type

drowsy heath
#

huh

#

ohh

#

wait

drowsy heath
#

no im lost

chrome widget
#

I only see Glass and Lucky taken ownership of, so does that mean they're the only two that fall under SMODS.Enhancement?

normal crest
fallow breach
#

hello gentlemen does anyone have any resources on how to start adding custom sprites/jokers

chrome widget
#

Oh! Thanks!!!

fallow breach
#

i've looked online and couldn't find any good guides

drowsy heath
daring fern
fallow breach
#

also i'm using balatro mod manager because it's the easiest, but for testing my own mods i assume i'll want to download steamodded + lovely separately right

chrome widget
#

Yep yep!!

fallow breach
#

cool thanks

humble matrix
calm kiln
#

ive looked at litterally every mod on the modding wiki and nothing is at all like my idea's ability : (

calm kiln
#

To make played steels count as held in hand

calm kiln
#

i checked that code and there were dev notes saying steel woudlnt work with it

obtuse silo
#

i suck with hooks
could someone help me make it so that the added hand size updates when a card is given an enhancement

humble matrix
faint yacht
calm kiln
snow vale
#

any idea why the card wont respawn if i destroy it using a vanilla joker (aka ceremonial dagger), but it does respawn if i destroy it using a modded joker?

daring fern
daring fern
humble matrix
#

oh you gotta be kidding me

calm kiln
daring fern
calm kiln
#

ive added it

#

now what

obtuse silo
daring fern
# calm kiln ive added it

Then put something like this in it: ```toml
[manifest]
version = "1.0.0"
dump_lua = true
priority = -1

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if context.cardarea == G.hand and context.main_scoring then"
position = "at"
payload = "if (context.cardarea == G.hand or context.cardarea == G.play and next(SMODS.find_card('j_modprefix_key'))) and context.main_scoring then"
match_indent = true

faint yacht
calm kiln
faint yacht
random sleet
#

at automatically overwrites i think, doesnt it?

daring fern
faint yacht
#

And, honestly, this does sound like something I've already have done currently.

calm kiln
#

it does?

obtuse silo
faint yacht
red flower
faint yacht
snow vale
#

how can i give a card a sticker?

obtuse silo
candid sleet
#

why is this not creating etheral tags after boss blind?

calm kiln
red flower
calm kiln
obtuse silo
#

i see

snow vale
daring fern
midnight coyote
#

when i use set_ability on a joker does it keep its original card.ability.extra table

midnight coyote
#

hmm

daring fern
midnight coyote
#

how could i save those values

midnight coyote
#

im working on overclocks

obtuse silo
midnight coyote
#

and i want certain scaling jokers to keep their scaling

faint yacht
# calm kiln would it be easy to port that into a joker?

...the way I do it doesn't involve calculate on the Joker actually doing it - instead, I have hooked SMODS.calculate_main_scoring and check for context.cardarea == G.hand, then iterate on cards in other playing card areas. In your case, you'd have to just check for and iterate over context.full_hand, then SMODS.score_card(card, context).

daring fern
# snow vale bump

Because jokers don't calculate when getting removed if card.getting_sliced is true

daring fern
#

So the modded jokers you are testing with aren't setting that.

snow vale
#

how can i make so it doesnt affect this specific joker?

daring fern
snow vale
#

the context?

calm kiln
daring fern
snow vale
#

it was that simple

#

and how do i check when it isn't sold?

daring fern
humble matrix
snow vale
humble matrix
daring fern
humble matrix
#

k

mild grove
#

I tried to make a Joker that spawns Negative playing cards but the game crashes when i select a blind

red flower
#

also k_plus_negative_card doesnt exist unless you define it

obtuse silo
mild grove
humble matrix
faint yacht
normal crest
humble matrix
midnight coyote
normal crest
red flower
obtuse silo
red flower
obtuse silo
#

thank you :}

humble matrix
snow vale
#

how can i make so if i win a blind i actually dont win it and your score resets to 0?

normal crest
#

inside your object type

red flower
humble matrix
red flower
#

i still don't fully understand how to inject things into objecttypes

normal crest
normal crest
red flower
#

what's cards for then

normal crest
#

idk it seems unused by smods

red flower
#

weird

normal crest
#

wait nvm

#

I was looking at the wrong thing

humble matrix
normal crest
#

maybe you have your mod prefix wrong

#

and cards worked all along

humble matrix
red flower
#

no, do you have a --- PREFIX?

normal crest
#

I think if you're using headers it takes the first 4 letters of your mod id

#

you should really be using json metadata tho

humble matrix
#

oh

normal crest
#

so cards would work fine

mild grove
faint yacht
covert bough
#

is there a way to mod on phone? if so can somebody help

red flower
humble matrix
#

(this isnt with the inject card stuff btw)

faint yacht
#

👍

vast night
#

Hi. I've been searching for a long time, but i just cant figure it out. How can i check if the defeated blind is a boss blind, when hooking Blind.defeat (not in a calc func)

red flower
#

G.GAME.blind.boss

self.boss probably also works there but I'm not sure

vast night
#

another q

#

i have never done a completely custom ui in balatro (liike i've done it in extra_tabs and config) so how could i make it so instead of going directly to the shop after defeating the boss blind, show another screen first (with a countdown)

red flower
#

that's something i need to figure out myself haha

#

the UI part of it should be all the same (see the UI guide in the docs if you haven't) the problem is messing with G.STATE

#

which probably isn't that hard but idk how

frigid cargo
#

i really dont know why this is happening, does anyone know why?

rich dragon
mild grove
#

@frigid cargo Try doing this in the settings and see if it helps

vast night
#

it has a custom screen afaik

frigid cargo
red flower
#

what's your atlas definition

frigid cargo
#
SMODS.Atlas{
    key = 'MegaGeoPackCraig',
    path = 'MegaGeoPackCraig.png',
    px = 71,
    py = 95,
}
red flower
#

is the image 71x95

frigid cargo
red flower
#

dunno then

frigid cargo
#

ill try respriting

formal parrot
viral ember
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.chips } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if not context.other_card:is_face() and not context.other_card:get_id() == 10 then
                return {
                    chips = card.ability.extra.chips
                }
            end
        end
    end

No matter what it never gives the chips?

#

am I stupid?

fluid burrow
#

I have a question: how do you remove the debuff from a card that previously had a debuff?

viral ember
#

you could check vampire

frigid cargo
viral ember
#
        if context.before and context.main_eval and not context.blueprint then
            local enhanced = {}
            for _, scored_card in ipairs(context.scoring_hand) do
                if next(SMODS.get_enhancements(scored_card)) and not scored_card.debuff and not scored_card.vampired then
                    enhanced[#enhanced + 1] = scored_card
                    scored_card.vampired = true
                    scored_card:set_ability('c_base', nil, true)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            scored_card:juice_up()
                            scored_card.vampired = nil
                            return true
                        end
                    }))
                end
            end

            if #enhanced > 0 then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain * #enhanced
                return {
                    message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
                    colour = G.C.MULT
                }
            end
        end
        if context.joker_main then
            return {
                xmult = card.ability.extra.Xmult
            }
        end
    end,

#

this is vampire's code (kinda, it's vanillaremade but still)

red flower
viral ember
#

oh

#

I see

#

that explains a lot honestly

#

thanks so much! 😊

formal parrot
#

Thats a pretty good question

red flower
#

SMODS.debuff_card(card, false, "source")

fluid burrow
#

"source" what does it mean?

red flower
fluid burrow
#

mmm

covert bough
#

ok i got balatro on pc how i mod

limber blaze
#

does anyone know how i can go about allowing gaps of more than 1 for straight calculation (i actually would prefer it to be any amount of gaps not just hardcoded to 2)

viral ember
covert bough
#

ty

covert bough
#

wh yis brainstorm mod crashin my game

obtuse silo
#

How would I create a restriction for a challenge that limits the total amount of money you can hold?

mild grove
#

So How do i properly create an Atlas that works with both Sprite smoothing on and off?

Do i need like two different Atlases? Like a 1x Atlas and 2x Atlas?

red flower
#

yes

mild grove
#

alright, i'll just wing it

red flower
#

x2 just needs to be double x1

obtuse silo
#

yeah
the way i do it personally is by drawing each card at 1x scale, then when i'm ready to export, create the 2x atlas by doubling the width and height of the image

tepid crow
obtuse silo
mild grove
#

ah alright

daring fern
#

It should be function ease_dollars(mod, instant)

obtuse silo
#

and as for the function's contents?

obtuse silo
viral ember
#

How would I select a random card in my deck?

red flower
#

pseudorandom_element(G.playing_cards, "seed")

#

G.deck.cards if you want the current deck

viral ember
#

oh sick

#

I couldn't remember the name lol

#

thanks again!

daring fern
obtuse silo
#

so
something like this?

daring fern
obtuse silo
#

so
how would I go about checking the current challenge?

daring fern
obtuse silo
#

how would I go about setting a custom rule?

#

actually wait

daring fern
obtuse silo
#

yeah i realised
now how to reference the value in the hook

#

because
i'm setting the money limit value to 10 in the custom ruling
how do i reference the value?

obtuse silo
daring fern
#

G.GAME.modifiers.money_limit

obtuse silo
#

i see
thank you

#

this just prevents me from getting money altogether, i should probably re-add the condition as an "and" condition

daring fern
#

return ease_dollars_ref(mod, instant)

obtuse silo
#

ah

#

thanks again!

chrome widget
#

Trying to do a joker that changes the values of Glass Cards upon being picked up. I'm having trouble getting it to work and I assume it's because SMODS takes ownership of it?

G.P_CENTERS.m_glass.config.extra = card.ability.extra.glass_break

for _, v in pairs(G.I.CARD) do
    if v.config and v.config.center and v.config.center.key == 'm_glass' then
        sendDebugMessage('updating glass cards')
        v.ability.extra = card.ability.extra.glass_break
        v.ability.x_mult = card.ability.extra.glass_mult
    end
end```
#

I keep getting strange results, such as how after selling it, it only resets the chance value but not the xmult value

#

is there something weird about config.Xmult?

frigid cargo
#
card.ability.extra.steelmult = (((shapecount * card.ability.extra.steelmult_gain)/10)+1)
        if context.individual and context.cardarea == G.play and
           SMODS.has_enhancement(context.other_card, 'm_steel') then
            if context.other_card:is_suit(card.ability.extra.suit) then
            return {
                chips = card.ability.extra.chips,
                xmult = card.ability.extra.x_mult
            }
            else 
            return {
                xmult = card.ability.extra.steelmult
            }
        end

how do i make it so if its steel and is a diamond suit card, it returns x_mult and steelmult

long sun
#

hiya! i'm trying to call this function in my script, outside of any functions:
ArtBox.add_collectible('m_phanta_ghostcard', { atlas = 'phanta_PhantaCollectables', pos = { x = 0, y = 0 }, soul_pos = { x = 1, y = 0 }})
however, ArtBox doesn't seem to exist yet at this stage. how can i call it when this function exists?

#

[the function is part of another mod]

long sun
#

okie doke! thanks :D

normal crest
#

Oh I didn't see the if statement

#

thought you were referring to the G.GAME.modifiers["money_limit"] part

sand sandal
#

i finally did it

#

there is no sprite because uh

#

i can't draw

#

yet another gacha themed mod for balatro, coming uh, soon?

narrow pendant
#

How do you make decks?

daring fern
gilded blaze
# obtuse silo would this be correct?
local ed = ease_dollars
function ease_dollars(mod, instant)
    if G.GAME.modifiers.money_limit and type(G.GAME.modifiers.money_limit) == "number" then
        mod = math.min(mod, G.GAME.modifiers.money_limit-to_number(G.GAME.dollars))
    end
    ed(mod, instant)
end

to_number simply returns its only argument if Talisman is not installed

#

I've been working on a mod that satisfies both non-Talisman and Talisman players
it's in my blood now lmao

sonic cedar
#

does changing the suit of a card apply to context.playing_card_added? i'm trying to set up a joker that triggers an effect if all cards of a certain suit in your deck become a certain other suit

sonic cedar
#

aw

#

is there a context i can use?

red flower
#

i dont think so

sonic cedar
#

double aw

#

you got any ideas of what i could do instead?

unborn bay
#

you could add your own context

gilded blaze
#

that's a bit hard

sonic cedar
#

yeah i was thinking about that but how would i even do that for something like this

gilded blaze
#

aka "you got rid of an entire suit"

tall wharf
#

hi

sonic cedar
sonic cedar
gilded blaze
#

isn't that simply "when a card changes suit to a certain suit"

sonic cedar
# gilded blaze even if it's just one?

like if i just have one diamond and i change it to a heart, the conditions are met
however, if i DESTROY that diamond the effect won't apply, because now it's not
"hearts is all that's left because i turned all my cards into hearts" it's "hearts is all that's left because i took out everything else"

sonic cedar
gilded blaze
#

hook Card:change_suit and SMODS.change_base

#

Ortalab does something similar like that

sonic cedar
#

do you remember what it is so i can see how they did it?

gilded blaze
#
local card_change_suit = Card.change_suit
function Card:change_suit(new_suit)
    local change = self.base.suit ~= new_suit
    card_change_suit(self, new_suit)
    if not change then return end
    local scaling_joker = SMODS.find_card('j_ortalab_mill')
    for _, card in pairs(scaling_joker) do        
        card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.gain
        card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize{type = 'variable', key = 'a_xmult', vars = {card.ability.extra.xmult}}})
    end
end

local smods_change_base = SMODS.change_base
function SMODS.change_base(card, suit, rank)
    local change = suit and card.base.suit ~= suit
    local card = smods_change_base(card, suit, rank)
    if change and not Ortalab.harp_usage then
        local scaling_joker = SMODS.find_card('j_ortalab_mill')
        for _, card in pairs(scaling_joker) do        
            card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.gain
            card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize{type = 'variable', key = 'a_xmult', vars = {card.ability.extra.xmult}}})
        end
    end
    return card
end
#

this is how Mill scales its Xmult when a card changes suit

#

just do your check there

frigid perch
#

Hii, back, sorry, this might be like, a very simple thing but I'm silly and Very new to coding
I asked this earlier and the consensus was just to add an "Add to Deck" thing
So it's for Cavendish, and Cavendish doesn't Have an Add To Deck thing

    key = "cavendish",
    add_to_deck = function(self, card, from_debuff)
        play_sound('Wake_up_Cyn', 0.7, 0.55)
    end,
}```
Would this be correct to have in the main.lua file?
The sound is spelled exactly as the .ogg is in the assets/sounds folder
Like, is it really this simple?
gilded blaze
#

because the check only runs when a card changes suit, you don't have to worry about destroying card accidentally triggering the effect

sonic cedar
#

ahhhh

frigid cargo
#
card.ability.extra.steelmult = (((shapecount * card.ability.extra.steelmult_gain)/10)+1)
        if context.individual and context.cardarea == G.play and
           SMODS.has_enhancement(context.other_card, 'm_steel') then
            if context.other_card:is_suit(card.ability.extra.suit) then
            return {
                chips = card.ability.extra.chips,
                xmult = card.ability.extra.x_mult
            }
            else 
            return {
                xmult = card.ability.extra.steelmult
            }
        end

how do i make it so if its steel and is a diamond suit card, it returns x_mult and steelmult

frigid perch
gilded blaze
frigid perch
#

I'll try this, thank you

gilded blaze
#

replace modprefix with your actual mod prefix

frigid perch
#

Yeah in this case it's homies 👍

#

I will report back

#

Works, thank you!

#

Learning, learning

#

And it appears when it's supposed to

#

Thanks so much!!

fluid burrow
frigid cargo
# fluid burrow What should the joker do?

it give chips and xmult per diamond card scored, and it also gives a different xmult if card scored is steel. My friend wants the two xmult to activate at different times and not together when a diamond steel is played

frigid cargo
fluid burrow
#

I think there is a syntax error

frigid cargo
#

huh?

fluid burrow
#

`

frigid cargo
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.x_mult, localize(card.ability.extra.suit, 'suits_singular'), card.ability.extra.steelmult } }
    end,
    calculate = function(self, card, context)
    local shapecount = 1
    for i = 1, #G.jokers.cards do
        if G.jokers.cards[i].config.center.pools and G.jokers.cards[i].config.center.pools.Shape then
            shapecount = shapecount + 1
        end
    end
    card.ability.extra.steelmult = (((shapecount * card.ability.extra.steelmult_gain)/10)+1)
        if context.individual and context.cardarea == G.play and
           SMODS.has_enhancement(context.other_card, 'm_steel') then
            if context.other_card:is_suit(card.ability.extra.suit) then
            return {
                chips = card.ability.extra.chips,
                xmult = card.ability.extra.x_mult
            }
            else 
            return {
                xmult = card.ability.extra.steelmult
            }
        end
        elseif context.individual and context.cardarea == G.play and context.other_card:is_suit(card.ability.extra.suit) then
            return {
                chips = card.ability.extra.chips,
                xmult = card.ability.extra.x_mult
            }
        end
    end
}```
heres the entire code
fluid burrow
#

card.ability.extra.steelmult = (((shapecount * card.ability.extra.steelmult_gain) / 10) + 1)

if context.individual and context.cardarea == G.play and
SMODS.has_enhancement(context.other_card, 'm_steel') then
if context.other_card:is_suit(card.ability.extra.suit) then
return {
chips = card.ability.extra.chips,
xmult = card.ability.extra.x_mult
}
else
return {
xmult = card.ability.extra.steelmult
}
end
end

frigid cargo
fluid burrow
#

i dont know how apply code mode

frigid cargo
#

` three of this

#

on start and end

midnight coyote
#
function CHAR.FUNC.reset_bunker_suit()
    local _suits = CHAR.FUNC.check_suits_deck()
    local picked_suit = pseudorandom_element(_suits,pseudoseed("pfjpjfio9wejfpjaurgbhtphivg" .. os.time()))
    CHAR.G.current_bunker_suit = get_key_for_value(_suits,picked_suit)
end

does anyone know why this would disproportionatly pick spades or is the game just fucking with me

#

because it keeps picking spades

#

until i remove every spade

#

from the deck

#

then it stops

#
CHAR.FUNC.check_suits_deck = function()
    local cards_of_suits = {}
    for  i=1,#G.playing_cards do
        if not SMODS.has_no_suit(G.playing_cards[i]) then
            cards_of_suits[G.playing_cards[i].base.suit] = (cards_of_suits[G.playing_cards[i].base.suit] or 0) + 1

        end


    end
    return cards_of_suits
end
fluid burrow
#

`card.ability.extra.steelmult = (((shapecount * card.ability.extra.steelmult_gain) / 10) + 1)

if context.individual and context.cardarea == G.play and
SMODS.has_enhancement(context.other_card, 'm_steel') then
if context.other_card:is_suit(card.ability.extra.suit) then
return {
chips = card.ability.extra.chips,
xmult = card.ability.extra.x_mult
}
else
return {
xmult = card.ability.extra.steelmult
}
end
end
`

#

it should work like this

midnight coyote
#

this is what it returns

#

when there arent any spades

#

i surely have to just be unlucky right

frigid cargo
midnight coyote
#

ok

tall wharf
#

card area

midnight coyote
#

i am afraid

sonic cedar
midnight coyote
gilded blaze
midnight coyote
#

oh

#

you sold it

#

why is it lagging so much

sonic cedar
#

aikoyori mod

#

inevitable

gilded blaze
#

a bunch of random contents, suitable for mod hoarders

midnight coyote
#

i just hard crashed

#

good god

gilded blaze
#

not to mention their self-insert legendary

#

that gets stronger the more mods are installed

tall wharf
#

i don't know

tall wharf
gilded blaze
midnight coyote
#

ok it always just picks one suitt

#

something has to be fucked with my random

tall wharf
viral ember
gilded blaze
midnight coyote
viral ember
#

oh alr

tall wharf
viral ember
#

log _suits before you use it

tall wharf
#

it's called Playbook

midnight coyote
#

the behavior of the function is known to me

viral ember
#

me thinks that's the problem

midnight coyote
#

it returns a table of every suit in the full deck

#

ive tested this

#

multiple

#

times

#

but ill give it a shot

gilded blaze
viral ember
#

👍

gilded blaze
#

so I got confused there

midnight coyote
#

oh

#

all the values are identical

#

that makes alot of sense actually

#

i used a function that would grab a key from a value

#

but i never accounted for the fact that in a 52 card dec

#

all the values would be identical

#

so it would probably just pick one

#

good old UD

#

love it

viral ember
#

glad I could help lol

midnight coyote
#

so technically speaking i should probably salt the numbers in the table when i get them back

#

probably just add a random number from 0 to 1

#

i dont need the number of cards in the deck, so its worthless to me to keep them 'accurate'

viral ember
#

why is it nil

#

it shouldn't be nil

#

it never returns

midnight coyote
#

hit control S for me

#

always get the stupid things out of the way first

#

catches me all the time lol

viral ember
#

it wasn't tha

#

it auto saves

#

BUT

midnight coyote
#

ah

chrome widget
viral ember
#

I looked in the collections and it was working

gilded blaze
#

it works in collection but not in game?

#

huh

#

that's weird

viral ember
#

I think because I changed it from chips to mult without making a new one it forgot to set

#

YEP

#

these ones work

#

xd

frigid cargo
#

what does Xmult_mod do?

chrome widget
#

the _mod versions of keys allow you to supply unique messages

#

whereas x_mult/Xmult automatically shows a message for xmult

frigid cargo
#

ah i see thanks

unborn bay
#

technically you don't really need to that anymore with the introduction of xmult_message and remove_default_message

gilded blaze
#

some vanilla jokers still use the _mod counterparts to print the exact same thing as non-ones

#

which is funny because thunk

frigid cargo
#

how can i return 2 different variables of xmult one after another

midnight coyote
#

works like a charm now

chrome widget
midnight coyote
unborn bay
#

y not extra table

midnight coyote
tropic timber
#

hi everyone! sorry if this is a kind of basic question, but ive been staring at the wiki and examples for a bit too long now and cant figure out what im doing wrong :/ i'm making my first mod, right now i just have one joker and i want to test what i have so far. but steamodded doesn't register the mod and im not sure why :O balatroheart any help is greatly appreciated

unborn bay
#

calculate_effect isn't gonna work for every situation

midnight coyote
#

ah hm

#

thats what i wouldve done

daring fern
viral ember
#

also the description references 2 variables (#1# and #2#) but you've only given it card_limit in the local variables

midnight coyote
#

i didnt know that was a thing

#

;-;

#

sorry

frigid cargo
chrome widget
#

Nothing immediately jumps out at me

tropic timber
viral ember
#

can we see the metadata

chrome widget
#

Does it print anything in the console about failure to load the mod?

gilded blaze
tropic timber
tropic timber
chrome widget
#

You're probably missing a metadata field

#

oh

#

'prexfix'

gilded blaze
#

that too

#

💀

#

so many broken things

tropic timber
gilded blaze
#

now your mod loads but the game crashes

viral ember
#

"NAME.json"

gilded blaze
#

change the variable in loc_vars

#

it's indexing a nil field because of typo

viral ember
#

guys 1 thing at a time, the metadata is failing

tropic timber
gilded blaze
#

that should be it

#

the game should load your mod but it would also crash

tropic timber
chrome widget
#
"badge_colour": "32A852",
"badge_text_colour": "FFFFFF",
"display_name": "Cardsauce",```
#

Some other fields you would need I think

tropic timber
#

it's loading now! yay! and hasn't crashed yet :D thank you all for the help

gilded blaze
#

but it shouldn't be G.consumeables.config.card_limit

#

your joker's variables seem to be the ones related to probability

tropic timber
#

and hey! there's the crash! at least it's loading now 😅

gilded blaze
#

do vars = {card.ability.extra.plan_chance, G.GAME.probabilities.normal}

gilded blaze
#

like I said, set the variable to something else

tropic timber
gilded blaze
#

this is how Purple Seal works

#

it uses a buffer variable

#

you don't have to create your own, just use what Purple Seal uses