#💻・modding-dev

1 messages · Page 583 of 1

static valley
#

from what I looked at myself, apparently when it tries to add the seal, it's trying to index a nil value, right about here (screenshot taken from where the crash look was telling me to look)

slim ferry
#

oh okay

slim ferry
#

i imagine

#

what is _seal currently?

static valley
# slim ferry i imagine

here's what the seal's code looks like:

SMODS.Seal{
    key = 'smiley',
    atlas = "comedy_seals",
    pos = { x = 0, y = 0 },
    config = {},
    badge_colour = HEX('dc3c92'),
    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            local curr_mult = mult or 1
            local curr_chips = chips or 0
            return{
                message = "Chaos Shift",
                mult = curr_mult + math.random(1, 10),
                chips = curr_chips + math.random(1, 10)
            }
        end
    end,
}
slim ferry
#

what did you put into the joker

#

or whatever it is

#

for the key

lavish elm
#

how to add custom sound to joker

static valley
slim ferry
#

remove the _seal

#

thats only for localization files

static valley
#

ohhhh....

slim ferry
#

with the mod prefix of course

long sun
#

okay new problems

#
  • the extra isn't rotating as if it were attached to the card, but moreso as if it was above it
  • it's not scaled
#

@daring fern sorry i need your help again ;u; what have i done wrong this time

#

(and how can i fix it?)

robust marsh
#

how would I change money earned from leftover hands in the middle of a run

frosty rampart
#

you can probably just change G.GAME.modifiers.money_per_hand? that's what green deck does at least

vale grove
#

just curios how do i make a 50/50 between something good and something bad

#

just an if else?

frosty rampart
#

do you want it to be affected by oops all 6s and any other modded stuff that affects probabilities?

vale grove
#

no just a raw 5050

frosty rampart
#
if pseudorandom('seed') > 0.5 then
  -- good thing
else
  -- bad thing
end

the seed string can be whatever

robust marsh
robust marsh
#

I'm blind

#

ty regardless

frosty rampart
#

no problem

vale grove
#

Iam trying to make a card that checks if you have two kings ( the 1 in 2 part comes later) and i want it to play an audio on my first king and second king, why is this not working?

#

(one issue i just fixed is inconsitent capital M's on mult)

idle plaza
vale grove
#

one systemic issue i just found is that it checks both if statements at once

vale grove
#

oh wait

#

just one if statement that ticks it up

idle plaza
#

Yeah

sturdy compass
#

Does anyone happen to have experience with adding pages to a mod's config page? I have no clue where to start with implementing that

vale grove
#

now how do i make it play two seperate sounds is the real question

idle plaza
vale grove
#

the sounds dont which is what im trying to wrap my head around

idle plaza
#

(One second, my PC froze mid-explanation 💀)

vale grove
#

lol im not in a hurry

#

take ur time twin

#

okay so

#

currently i have this

#

and besides the sound

#

everything works

#

okay so

#

i put the sound checks in the if statement

#

and now they play

#

during the joker scoring screen

#

instead of on the king

#

lol

idle plaza
# vale grove okay so

So, the issue: If context.joker_main is true, context.individual is always false. calculate is a function that is called many times in different contexts, so accounting for this can get complicated.

To start, add a new context.before. This occurs before context.individual, so you can set card.ability.extra.kingCount here, and count the played kings using the same for loop you use currently.

Then, in context.individual, if card.ability.extra.kingCount is 2, you can, say... check if not card.ability.extra.soundCheck then, then play the first sound.else, play the second sound. (This value does NOT need to be set ahead of time, because you're checking if it doesn't exist). Regardless, you can then set card.ability.extra.soundCheck = not card.ability.extra.soundCheck to toggle it between true and false, ensuring that one sound will always play, then the other.

Then, the context.joker_main will exclusively be used to check if card.ability.extra.kingCount is 2, and then return the mults you need. (Which needs to be formatted as a return {} block, which your current code correctly uses elsewhere, but forgets here.

vale grove
#

okay wait

#

not to undermine you but i feel like this can be done less complicated

#

because with this

#

everything works

#

but the sounds dont play during the card triggering phase

#

but during the joker_maini

idle plaza
#

Yes, joker_main is always after individual card contexts, so you won't find an easy solution trying to use joker_main for something that applies individual card messages. Also I think if you play a single King with that code, it'd still say "Two" and then do nothing else.

vale grove
#

but cant i just make a seperate if.context.cardarea

idle plaza
#

Joker Main is only called when context.cardarea is G.jokers

wintry solar
#

that code has all sorts of issues

vale grove
#

everything but the sounds work

idle plaza
#
        calculate = function(self, card, context)
            if context.before then
                card.config.extra.kingCount = 0
                for i = 1, #context.scoring_hand do
                    if context.scoring_hand[i]:get_id() == 13 then
                        card.config.extra.kingCount = card.config.extra.kingCount + 1
                    end
                end
            elseif context.individual and context.cardarea == G.play and card.config.extra.kingCount == 2 then
                card.config.extra.soundCheck = not card.config.extra.soundCheck
                if card.config.extra.soundCheck then
                    return {
                        sound = 'YA_spring_call',
                        message = 'Two!'
                    }
                else
                    return {
                        sound = 'YA_speed_call',
                        message = 'Kings!'
                    }
                end
            elseif context.joker_main and card.config.extra.kingCount == 2 then
                SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
                SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
                if SMODS.pseudorandom_probability(card, 'two_kings_seed', 1, 2) then
                    SMODS.calculate_effect({message = 'Safe', colour = G.C.GREEN}, card)
                    return {
                        Xmult = card.ability.extra.Xmult,
                        mult = card.ability.extra.mult
                    }
                else
                    SMODS.calculate_effect({message = 'LIAR', colour = G.C.MULT}, card)
                end
            end
        end,

@vale grove Try this.

wintry solar
#

this also won't work

#

you only ever need to check the cardarea within the repetition and individual contexts

idle plaza
#

Fixed. Blame SMODS's own wiki for that one.

hardy viper
#

if only the guy who wrote it was around for you make a complaint to him about it

vale grove
#

im here im here

umbral zodiac
vale grove
#

i was just doing something

#

and by something im collecting the sound bytes i need for this joker

wintry solar
#

I bet he'd love to hear those complaints

vale grove
#

LOL

#

when the @.everyone ping dont work

idle plaza
#

<@&1133519078540185692>

slim ferry
#

it requires perms

#

even if it looks like it works

#

which happens regardless of perms

idle plaza
#

And it's not like the spambot cares either way.

vale grove
wintry solar
#

it blanket copied a context check

round lion
#

vscode flags exposed functions with yellow, is it just a oversight on the lsp?

idle plaza
# vale grove okay wait so what was the issue with this?

The SMODS "Calculate Functions" wiki page tells you to use if context.before and context.cardarea == G.play then, which is just incorrect, because the actual expected default cardarea is G.jokers instead.

I've edited the issue out of the code I posted.

wintry solar
#

it's not "incorrect" to do that, it's just not the check you would use for a joker

#

it also doesn't tell you to use anything, it provides an example of how you could check for that context

vale grove
#

(also i moved everything down one for readablility so 429 is now 430)

idle plaza
# vale grove this is what i get from that
        calculate = function(self, card, context)
            if context.before then
                card.ability.extra.kingCount = 0
                for i = 1, #context.scoring_hand do
                    if context.scoring_hand[i]:get_id() == 13 then
                        card.ability.extra.kingCount = card.ability.extra.kingCount + 1
                    end
                end
            elseif context.individual and context.cardarea == G.play and card.ability.extra.kingCount == 2 then
                card.ability.extra.soundCheck = not card.ability.extra.soundCheck
                if card.ability.extra.soundCheck then
                    return {
                        sound = 'YA_spring_call',
                        message = 'Two!'
                    }
                else
                    return {
                        sound = 'YA_speed_call',
                        message = 'Kings!'
                    }
                end
            elseif context.joker_main and card.ability.extra.kingCount == 2 then
                SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
                SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
                if SMODS.pseudorandom_probability(card, 'two_kings_seed', 1, 2) then
                    SMODS.calculate_effect({message = 'Safe', colour = G.C.GREEN}, card)
                    return {
                        Xmult = card.ability.extra.Xmult,
                        mult = card.ability.extra.mult
                    }
                else
                    SMODS.calculate_effect({message = 'LIAR', colour = G.C.MULT}, card)
                end
            end
        end,

Oops, typo'd 'center' instead of 'ability' for the kingCount variable, try this.

sinful crown
#

does anyone know what I'm missing from my code here? I'm actually lost 😭

idle plaza
vale grove
echo parrot
#

--Bloodied - Gains x0.5 mult per card destroyed this ante, resets after Boss Blind
SMODS.Enhancement {
    key = 'bloodied',
    atlas = 'TBOJ_enhancements',
    pos = {x = 0, y = 0},

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

    loc_txt = {
        name = 'Bloodied Card',
        text = {
            [1] = 'Gains {X:mult,C:white}X0.5{} Mult per card',
            [2] = '{C:attention}destroyed{} this ante, resets',
            [3] = 'when {C:attention}Boss Blind{} is defeated',
            [4] = '{C:inactive}(Currently {X:mult,C:white}X#1#{} {C:inactive}Mult)'
        }
    },

    --currently only adds xmult if the card is held in hand
    calculate = function(self, card, context)
        if context.remove_playing_cards and not context.selling_card then
            local destroyed_count = 0
            for i, destroyed_card in ipairs(context.removed) do
                if (destroyed_card.ability.set ~= "Joker") then
                    destroyed_count = destroyed_count + 1
                end
            end
            --tried specifying G.deck, doesn't seem to work like that
            --if context.cardarea == G.deck or context.cardarea == G.hand then
                card.ability.extra.xmult = card.ability.extra.xmult + (0.5 * destroyed_count)
            --end
        end

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

The way I want this enhancement to work is to upgrade every single bloodied card in the deck every time a card is destroyed, but I also want them to only start upgrading *after* they've been added to the deck, so not just a global count of destroyed cards

Would the only way to do this be hooking the remove_playing_cards context to loop through the entire deck and upgrade all bloodied cards individually? I'm sure there's an easier way I don't recognize
idle plaza
sinful crown
#

not like actually

idle plaza
# vale grove okay so this works when two kings are presents, how do i make it still play the ...
        calculate = function(self, card, context)
            if context.before then
                card.ability.extra.kingCount = 0
            elseif context.individual and context.cardarea == G.play then
                if context.other_card:get_id() == 13 then
                    card.ability.extra.kingCount = card.ability.extra.kingCount + 1
                end
                if card.ability.extra.kingCount == 1 then
                    return {
                        sound = 'YA_spring_call',
                        message = 'Two!'
                    }
                elseif card.ability.extra.kingCount == 2 then
                    return {
                        sound = 'YA_speed_call',
                        message = 'Kings!'
                    }
                end
            elseif context.joker_main and card.ability.extra.kingCount == 2 then
                SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
                SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
                if SMODS.pseudorandom_probability(card, 'two_kings_seed', 1, 2) then
                    SMODS.calculate_effect({message = 'Safe', colour = G.C.GREEN}, card)
                    return {
                        Xmult = card.ability.extra.Xmult,
                        mult = card.ability.extra.mult
                    }
                else
                    SMODS.calculate_effect({message = 'LIAR', colour = G.C.MULT}, card)
                end
            end
        end,

Here you go. (joker_main remains unchanged)

wintry solar
vale grove
idle plaza
vale grove
#

i was busy collecting all the visual effects like sprite for the joker so it took a little but im done now

vale grove
sinful crown
echo parrot
sinful crown
#

and yes I know my code sucks I'm learning 💀

frosty rampart
sinful crown
#

oh alright

#

ill see if it works

#

thank you!

#

it works! (again thanks lol)

red flower
willow scroll
#

i may not be smart, why is my log getting spammed with repetition checks (works fine otherwise i believe)

long sun
#

okay one more try at this

#

the scaling isn't working

#

i'm at my wit's end with this one feature 😭

#

here's how this looks

loud summit
#

are you accounting for the card wobble

long sun
#

i have no idea how to make them wobble together ;u;

willow scroll
#

let me find it

long sun
#

oooo??

willow scroll
#

this one

long sun
#

yay thanks :D

idle plaza
willow scroll
vale grove
#

and visual

#

wait

#

lemme see if its something on my end then

#

oh no it does

#

i just had an error somewhere

#

sorry twin

idle plaza
# vale grove sorry twin
            elseif context.individual and context.cardarea == G.play then
                if context.other_card:get_id() == 13 then
                    card.ability.extra.kingCount = card.ability.extra.kingCount + 1
                    if card.ability.extra.kingCount == 1 then
                        return {
                            sound = 'YA_spring_call',
                            message = 'Two!'
                        }
                    elseif card.ability.extra.kingCount == 2 then
                        return {
                            sound = 'YA_speed_call',
                            message = 'Kings!'
                        }
                    end
                end

That's fine. Anyways, I will correct myself one last time here. Originally I had the Two and Kings sound checks immediately after id id == 13 check, but they should be nested inside it. That way, either sound won't get repeated if, say, you play a two-pair with two Kings followed by two other cards.

vale grove
long sun
#

what causes the extra to be skewed, the further left or right it is on the screen?

#

is there a way to match this skew with that of the center?

fair osprey
#

is there a way to modify the chip requirement of a future blind this ante? So if you're about to start the small blind, increase the requirement of the boss blind?

#

Everything I see seems to point towards changing the chips of the blind you're on

faint yacht
#

When setting the blind, check if it's the small blind, then add a flag.

#

And when its' the boss blind, check for that flag, remove it and apply requirement increase.

fair osprey
#

hmmm, I see what you mean - I was hoping to have the blind requirement text update in advance

#

that's the only thing

robust marsh
#

how would one add a dummy center? I wish to do that purely because I wanna add hover tooltips to my decks without linking them to proper centers

static valley
#

how do I make a joker allow you to take more cards from a booster pack? (this is for a legendary)

long sun
#

hi i'm back ^u^ here's another round of "why is this so broken oh my god!"

#

i present:

#

the stretched out sprite here is Normal Face, position 0, 0 on the atlas

static valley
# robust marsh G.GAME.pack_choices

would this work:

    calculate = function(self, card, context)
        if context.open_booster then
            local oldChoices = G.GAME.pack_choices
            G.GAME.pack_choices = oldChoices + 2
        end
    end
long sun
robust marsh
long sun
#

vertical_offset seems to have worked

robust marsh
static valley
#

so...

#

the game crashed the second I tried to check if I even implemented it right in-game

robust marsh
#

what's the crash

static valley
#

oh theres the problem

#

i forgot to add the unlock translation

robust marsh
#

yeag i was gonna say this looks like a localization issue

static valley
#

and now to actually see if it works

robust marsh
#

surely

static valley
#

IT WORKS!!!

robust marsh
#

dope

#

imma go to bed then, goood night : )

stiff locust
#

having trouble with copying cards help

#

it's making ghost consumables and i don't get it

long sun
#

oooOOOOOOOOOoooooooo :3 ghosthug

stiff locust
#

this same code was working on my other joker and I copied it over with an extra condition and now it's broken

idle plaza
#

What's your current code?

stiff locust
#

-# i should probably check if the other one still works

#
G.E_MANAGER:add_event(Event({
                        func = function()
                            local card_to_copy
                            if card.ability.extra.sticker >= 2 then
                                card_to_copy = G.consumeables.cards[1]
                            else
                                card_to_copy, _ = pseudorandom_element(G.consumeables.cards, 'ez')
                            end
                            local copied_card = copy_card(card_to_copy)
                            copied_card:set_edition("e_negative", true)
                            copied_card:add_to_deck()
                            G.consumeables:emplace(copied_card)
                            return true
                        end
                    }))
#

it's mostly the perkeo code from vanillaremade

idle plaza
#

Probably not the cause of the ghosting, but first issue I see is that you automatically copy consumable [1] if there are >= 2 cards, and choose randomly if there's only one.

stiff locust
#

no

#

that's a check tied to the joker

#

it unlocks additional effects when the sticker value is higher (sticker value is tied to the joker's stake completion sticker)

idle plaza
#

Oh I see

stiff locust
#

hence this one makes it always copy the leftmost consumable

#

instead of copying a random one

#

well it's supposed to

#

it's not exactly doing the copying right

static valley
#

btw I made the number of extra cards you can take an internal variable in the joker, so if there's something that doubles the values of a joker, it will double the number of extra cards you can take, which in turn means......

#

this is what happens when I mess around

#

I find out

stiff locust
#

i fixed it

idle plaza
#

What was the issue?

stiff locust
#

i was changing the code of the wrong joker

#

and the correct joker's issue was that the copied card was using a variable called card

#

which was causing issues with calculate(self,card,context)

idle plaza
#

Ah

stiff locust
#

so yeah i did a stupid

#

again

distant junco
#

can someone give me a hand with making a booster pack for my mod

stiff locust
#

what do you want it to do

distant junco
#

jokers in my mod

stiff locust
#

mmh

#

add all your jokers to a pool

distant junco
#

thats done

stiff locust
#

okay so in the booster's create_card section create a joker from the pool

#

that's the only difficult part of it

#

also obligatory #1418332561771593809 plug
this seems like a good place to promote it because it makes packs with jokers from any 1 mod selected randomly (there's a more expensive pack that lets you choose a specific mod)

#

you won't need its systems for anything I just think you might like it

violet void
round lion
#

how do i give blinds variables

stiff locust
#

if you own the jokers, you can use the pools argument inside a joker to do it

#

if you don't own the cards, you can inject them into a pool manually

#

also this is more like SMODS.ObjectTypes which i would recommend using over G.P_CENTER_POOLS for custom pools

round lion
#

i know i can add config extra to a joker

violet void
round lion
#

but how do i do so for a blind

twilit tundra
#

got a hook into level_up_hand, how do i make some code only run if the hand is being levelled up by a planet card, and not by something like space joker

pseudo furnace
#

"attempt to index field 'jewelry_rank_card' (a nil value)" what is meant by this?

mystic river
violet void
stiff locust
#

then it will make a random card from the pool

violet void
#

awesome 💪🏽

stiff locust
#

also

#

its right there

violet void
#

thats for adding a joker I own to a pool no? I found that when you told me about it

stiff locust
#

yeah

violet void
#

all good then

stiff locust
#

if you wanna add someone else's joker to a pool you need to inject it with :inject() and :inject_card()

#

or you can add it to the declaration of the object type manually

#

but then it could cause crashes if that mod isn't loaded so it depends what you need it for

idle plaza
violet void
pseudo furnace
idle plaza
pseudo furnace
idle plaza
ocean sinew
#

then what'll happen

#

you'll choose the card in the collection instead?

pseudo furnace
mystic river
# twilit tundra

i believe you want to check for card.config.center.set == "Planet"

twilit wing
#

is it possible to make abstract classes in balatro modding?

#

like if i have multiple jokers that has a lot of similarities, is it possible to make a abstract_joker and have a bunch of them extend off of it

#

or can lua not do that

unkempt thicket
#

How can i get a card's area when card.area is nil?

idle plaza
static valley
#

coding an actual slot machine as a joker is going to be hell

#

but it will be soooooo worth it

stiff locust
#

is it animated

wispy falcon
stiff locust
#

you never unpaused it did you

wispy falcon
#

I forgot that it seems... But why are all the other things still working?

stiff locust
#

because they're being run before you pause it

#

you put the G.GAME.paused inside an event

#

so it's happening after the context checks

#

something like that

#

tbch i'm spouting bullshit guesstimation

#

also I need to study this code

#

putting pictures and videos in UI boxes is funny

wispy falcon
#

Still softlocked by the way

stiff locust
#

obligatory jokebox plug

#

i make things for the funny because they are funny

#

pictures and videos going in ui boxes is a new toy to put jokes in

twilit wing
stiff locust
#

you don't need that

#

you can use the extend thingy

#

to make a version of SMODS.Joker which already has some preset variables

twilit tundra
#

want to show it upgrading all three hands instead of only showing it upgrading 3oak
like the cryptid/entropy multi-hand planets, for example

twilit wing
stiff locust
twilit tundra
twilit wing
#

great

stiff locust
#

that will make it so when you run SMODS.Joker2nd it uses all the values you put in there and you can add more values

#

it's nice for custom consumable types or anything where you have the same value repeated a bunch

twilit tundra
stiff locust
#

idk about the rest

twilit tundra
#

wouldn't that juice up the planet and not the joker?

stiff locust
#

depends where you run the code

twilit tundra
#

code's being ran in a hook into level_up_hand

stiff locust
#

¯_(ツ)_/¯

#

i guess you could find every instance of the joker to juice them up but that's not exactly

#

worth doing imo

twilit tundra
#

yeah

#

bigger deal for me is showing the other hands being levelled anyways

static valley
#

just a hypothetical, but in theory, is it possible to make a boss blind simulate having high ping?

twilit tundra
#

lag?

umbral zodiac
#

i mean you could add a bunch of nothing events

#

that just make things take longer to happen

twilit tundra
#

yeah you could just actually lag the game

static valley
#

true

umbral zodiac
#

or you could just make Game.draw have like a 1 in 2 chance to not do anything during that boss

static valley
#

that's funny

twilit tundra
#

this is an evil boss blind by the way what the fuck why

umbral zodiac
#

i don't ask questions

wispy falcon
stiff locust
#

it's not an elegant solution but

#

if you rewind the ingame timer

static valley
stiff locust
#

it will fuck up a bunch of the UI, break or delay inputs, and make buttons not work sometimes

#

it can also put you in purgatory

#

probably not a good idea
but a fun one

umbral zodiac
stiff locust
#

yeah it breaks a bunch of shit I have a joker based around it

#

obligatory jokebox plug

violet void
stiff locust
#

don't do both for the same joker

#

your object type should always have 1 card in it at base though

#

make that the default card

#

it'll prevent crashes when it can't spawn any other cards

#

j_joker is a safe one but the cool kids use j_splash as their default nowadays

umbral zodiac
#

the "Cool Kids"

stiff locust
#

the cool kids:

  • me
#

obligatory curator plug

umbral zodiac
#

i would join the cool kids club however i don't think splash being the default for a set of kitty jokers makes a lot of sense

wispy falcon
umbral zodiac
#

theyre known to not like water

stiff locust
#

you could make them shake violently when adjacent to splash

#

and make sounds

#

and then you can put them in the pack and it's funny

wispy falcon
twilit tundra
umbral zodiac
#

maybe a dumb question but how do you get the name of a consumable type via localize()

twilit wing
#

now the code just looks like ur average unassuming joker

#

(whoops accidental reply)

static valley
# static valley coding an actual slot machine as a joker is going to be hell
    calculate = function (self, card, context)
        if context.joker_main then
            -- this is where the hell begins
            local m1 = math.random(0, 4)
            local m2 = math.random(0, 4)
            local m3 = math.random(0, 4)
            local outputs = { "Diamond", "Heart", "Spade", "Club", "7" }

            local output1 = outputs[m1]
            local output2 = outputs[m2]
            local output3 = outputs[m3]

            if m1 == m2 and m2 == m3 then
                if m1 == 0 then
                    -- three diamonds

                elseif m1 == 1 then
                    -- three hearts

                elseif m1 == 2 then
                    -- three spades

                elseif m1 == 3 then
                    -- three clubs

                elseif m1 == 4 then
                    -- three 7s

                end
            else
                -- no matches
                
            end
        end
    end

now to figure out what to do for each payout

umbral zodiac
#

do not use math.random

#

use pseudorandom instead

#

math.random ignores the game seed meaning it'll be different on the same seed

stiff locust
#

you can use math.random if you want

#

but you should keep these things in mind

#

considering it's literally a slot machine it's not a crime to use math.random

static valley
#

im mainly using math.random so that the outcome is different every time

umbral zodiac
#

you can if you want but i think its just a little silly that u are able to savescum a joker

umbral zodiac
static valley
#

true

stiff locust
#

i dont think you can savescum on latest smods

umbral zodiac
#

usually i would recommend only using math.random for visual things

stiff locust
#

(has anyone else been having the issue where exiting the run or game makes you lose your saved run??)

umbral zodiac
#

no 😭

stiff locust
#

what the fuck

#

it's been like this for AGES now

#

I thought everyone was dealing with it

#

how do I even begin to troubleshoot my fucking save clearing when I exit the run

umbral zodiac
#

i think if you couldnt save your runs there would be more uproar

stiff locust
#

ii mean I guess

umbral zodiac
stiff locust
#

i'm not sleeping

#

until I finish gold chie

umbral zodiac
#

complain to someone else and then close discord

idle plaza
#

Which mods are you using?

stiff locust
#

i don't close discord very often

static valley
#

how would I use pseudorandom in this situation then?

umbral zodiac
#

pseudorandom("unique_seed_here", min, max)

#

the unique seed is so that it doesnt interfere with other pseudorandom rolls for other things like card draw order

#

usually a fine idea to just use the joker's name/key

umbral zodiac
stiff locust
static valley
#

alright changed it so it uses a pseudorandom instead

umbral zodiac
#

wonderful

umbral zodiac
stiff locust
#

its 1 in the morning

#

im not going out for a meal

#

i got shit to do

idle plaza
umbral zodiac
stiff locust
#

i really don't feel like testing if runs save with or without selections of mods right now

#

Mod 22 is about 49% done

#

well it's more like 24% done

static valley
#

now how do I have an event display a message?

            G.E_MANAGER:add_event(Event({func = function()
                    play_sound("slotOutput1")

            return true end }))
#

(as I'm trying to have it show each part of the output, delay for a moment, and then showcase the payout)

#

wait i figured it out

fallow breach
#

does anyone know the function called when a card is destroyed

stiff locust
#

oh god

#

help

#

it was NOT supposed to make 300 copies 😭

mystic river
#

me when i forget to make my function return true

iron haven
#

so, can someone give me the base of tarot cards and have 26 of them?

safe dawn
#

what do i make this guy do?

fallow breach
#

hey man did you ever figure this out

devout edge
#

ok i'm having a problem with one of my jokers and i'm wondering how you pull a table from a mod

#

also maybe how you make a table to begin with

#

i know what a table is but i'm not sure how to do it

#

for context i'm modifying the version of marble joker in vanillaremade to make a modded enhancement

signal plaza
safe dawn
signal plaza
#

make him perish..

#

i hate that stupid damn sword!!!!!!

safe dawn
#

:(

#

i spent 2.5 hours on it

static valley
#

so... I got the gambling to work. How can I get the messages relating to what each individual part got to play before the payout?

mild bronze
#

1% chance to insta kill blind due to super coolness
Increase % by 1 per trigger

mild bronze
signal plaza
#

i just hate sword

safe dawn
signal plaza
#

idk honestly

#

I hate his gameplay

safe dawn
#

oh in that way

loud summit
stiff locust
signal plaza
#

i dont wanna sound stupid since i have zero coding experience and i just used this an example to learn the very basics- but enough excuses, is it normal for the unexpected character section to be completely empty? Or does it mean something else?

twilit tundra
#

once again asking how i can get it to visually show the animation of all three hands levelling up instead of only just the one

#

what do i add

red flower
red flower
#

<@&1133519078540185692>

signal plaza
daring fern
fallow breach
#

spill it.

red flower
signal plaza
#

then again i might have went to fast and missed something in the lua

#

i dont think that'd affect the json though

red flower
#

this looks like a problem with the json according to the log

signal plaza
#

it was copied from smods examplejokers reference

#

which is like,, 8 months old

#

not the json the lua

loud summit
#

what is G.GAME.round.resets.blind_choices?

daring fern
loud summit
#

how do you set the blind mid blind without breaking everything

twilit tundra
# red flower what's the code
function level_up_hand(card, hand, instant, amount, ...)
    if next(SMODS.find_card("j_vtude_planetarytravel")) and (card.config.center.set == "Planet" or card.config.center.set == "Star")then
        local last=nil
        local next=nil
        local find=false
        for _,k in pairs(G.handlist) do
            local v=G.GAME.hands[k]
            if find==true and v.visible == true then
                next=k;break
            end
            if k==hand then
                find=true
            end
            if find==false and v.visible == true then
                last=k
            end
        end
            if last~=nil then
                update_hand_text({sound = 'button', volume = 0.7, pitch = 0.18, delay = 0.1}, {handname=localize(hand, 'poker_hands'),chips = G.GAME.hands[hand].chips, mult = G.GAME.hands[hand].mult, level=G.GAME.hands[hand].level})
                ref(card, last, true, amount)
            end
            if next~=nil then
                update_hand_text({sound = 'button', volume = 0.7, pitch = 0.18, delay = 0.1}, {handname=localize(hand, 'poker_hands'),chips = G.GAME.hands[hand].chips, mult = G.GAME.hands[hand].mult, level=G.GAME.hands[hand].level})
                ref(card, next, true, amount)
            end
    end
    local val = ref(card,hand,instant,amount, ...)
    return val
end```
red flower
twilit tundra
#

what else would i even hook

#

or do with this

red flower
#

no i mean what's the effect supposed to be

twilit tundra
#

planet cards also level up the hands next to them in the run info menu (but worded better than that)

#

so venus also levels up two pair and straight

red flower
#

yeah i would patch the usage code for the planets instead

#

and then use level up hand for each hand

twilit tundra
#

how would i make it not apply to modded planets like these then

#

only planets that straightforwardly level up a single hand

clear ocean
red flower
jolly shadow
# clear ocean

you came up with two of the same ideas as me by sheer coincidence FUCK 😭

clear ocean
#

💔

#

well did you make the code for it and not have it broken or something

jolly shadow
devout edge
clear ocean
devout edge
#

should i send a debug log or the code?

clear ocean
#

both for help

clear ocean
red flower
devout edge
#

basically, as far as i understand, the joker i'm making needs to get an enhancement from a table

#

the problem is i don't know how to get it to select a table for my mod's enhancements and/or how to make a table with them

red flower
#

what's the effect of the joker?

devout edge
#

it creates a junk card when blind is selected

#

junk cards are a enhancement in my mod

#

they're basically useless stone cards which some cards make not useless

clear ocean
#

okay shuffle is a joker function, so uhhhhh

#

let me check something

red flower
devout edge
#

also i did not know the m_ part needed to be there

#

many thanks my man!

red flower
#

the vanillaremade wiki has info on this btw

devout edge
#

it has a wiki?

#

good

red flower
#

yes!

clear ocean
#

uh nh is the shuffle method only for jokers and if so is there a way to make it like work for cards like i don't mind re-implanting the function for cards

red flower
#

what

#

like the cardarea shuffle?

clear ocean
#

is that an optional feature as i haven't heard of that

red flower
#

no it's a base game function

#

it works with any card area

clear ocean
#

well G.play.cards:shuffle('aajk') didn't work did i reference it wrong?

clear ocean
red flower
#

G.play.cards is not the area

#

G.play is

clear ocean
#

you got to be kidding me sorry let me test this out

charred widget
#

Hello friends! I've got another joker I want some help with

#

I'm continuing the development of the Necrozma jokers, and I want to implement the other ability for Dusk Mane and Dawn Wings Necrozma

#

They create a negative consumable when the round starts, that being The Sun for Dusk Mane and The Moon for Dawn Wings

#

And I know the code would be very similar to Cartomancer, but what would I have to edit in the code to make it work as intended?

jolly shadow
#

thats Perkeo

#

you can modify perkeo

rocky plaza
charred widget
# jolly shadow you can modify perkeo

actually Cartomancer is more accurate. Perkeo does create a negative consumable but it's only a consumable you have currently, and it's after the shop

rocky plaza
#

with SMODS.add_card() in the table that ur passing in
set key = "c_moon" and edition = "e_negative" or something
and key = "c_sun" for the other
at least i think those are the right keys off the top of my head

charred widget
#

is key and key_append the same thing

rocky plaza
#

no

charred widget
#

what does key_append do in the cartomancer code

rocky plaza
#

key_append just labels the source of the creation

#

doesnt really do anything except for randomization

north brook
#

Can I have help with something simple? I used Jokerforge to make the basic of a consumable, and I wanted to make it so it did something when selecting a specific joker (in this case, the "Joker" joker). This is what it currently looks like. You currently select any single Joker, you use the consumable, it destroys the selected Joker and creates a Perkeo. I want it to only do that when selecting "Joker".

I haven't really done anything in lua before, so please excuse my inability to do it on my own 😅

faint yacht
#
...
if #G.jokers.highlighted == 1 and G.jokers.highlighted[1].config.center.key == 'j_joker' then
...
frosty rampart
#

^

north brook
#

Line 25 I assume?

faint yacht
#

Such should also be duplicated in the can_use function just in case, but yes.

frosty rampart
#

also you'll probably want to use SMODS.destroy_cards(self_card) in place of line 31

#

and yes you want to add the if condition to the can_use function as well, so you don't use it on another joker (or none at all) and try to destroy a card that doesn't exist

north brook
#

So it'll look like this? How do I add the if to the can_use?

#

is it replacing the function(self,card)?

faint yacht
#
return #G.jokers.highlighted == 1 and G.jokers.highlighted[1].config.center.key == 'j_joker'
frosty rampart
#

^ that replaces line 53

north brook
#

time to test :D

#

Thanks y'all btw

faint yacht
#

...though, for that, should do

return G.jokers and G.jokers.highlighted and G.jokers.highlighted[1] and G.jokers.highlighted[1].config.center.key == 'j_joker' and #G.jokers.highlighted == 1

to prevent potential crashes of attempt to index nil value.

frosty rampart
#

if you put the #G.jokers.highlighted == 1 before the check if the highlighted card is joker, then you shouldn't need to check if G.jokers.highlighted[1] exists

north brook
#

Like if I wanted it to spawn a different joker for Lusty, for example?

frosty rampart
#

you're going to need to reorganize some code

north brook
#

that's fine by me

frosty rampart
#

and probably think about setting up a default joker it can spawn if you want it to work with other modded jokers

north brook
#

I think it needs to be fixed anyway because the atlas crashes now

north brook
frosty rampart
#

yea as long as you have some sort of default behavior, it'll make your can_use function much simpler (you can revert it to how you had it in the original screenshot)

north brook
#

coo coo

frosty rampart
#

anyway what's the intended behavior exactly? does every single joker spawn a different joker, or are there big groups of jokers that all spawn one specific joker?

north brook
#

quick question before totally fixing the code? what file is causing this crash?

north brook
loud summit
#

hey uh how do you set a blind mid blind

frosty rampart
north brook
#

Basically I want Joker to go to Perkeo, and everything else is back 1 space (so Wee goes to blueprint, for example)

frosty rampart
#

there should be a table of each card type in collection order somewhere, how else would it be ordered in the collection in the first place lol
anyway i'll need to go check some cryptid code for how to do that, ace aequilibrium iterates through that sort of table for jokers specifically

north brook
frosty rampart
#
use = function(self, card, area, copier)
  -- you don't need to check if you're highlighting exactly one
  -- joker, the can_use function is guaranteeing that already
  local self_card = G.jokers.highlighted[1]
  local key = self_card.config.center.key
  -- this chunk of code gets the index of the joker to
  -- create
  local index = 1
  for i, v in ipairs(G.P_CENTER_POOLS.Joker) do
    if v.key == key then
      index = i - 1
      break
    end
  end
  -- this bit handles the edge case for if you're using
  -- the consumable on default Joker
  if index < 1 then index = #G.P_CENTER_POOLS.Joker end
  -- creating the new card, mostly unedited (but tweaked a bit)
  G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.4,
    func = function()
      play_sound('timpani')
      card:juice_up(0.3, 0.5)
      return true
    end
  }))
  SMODS.destroy_cards(self_card)
  delay(0.6)
  G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.4,
    func = function()
      play_sound('timpani')
      if #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
        G.GAME.joker_buffer = G.GAME.joker_buffer + 1
        local new_joker = SMODS.add_card({ set = 'Joker', key = G.P_CENTER_POOLS.Joker[index].key })
        G.GAME.joker_buffer = G.GAME.joker_buffer - 1
      end
      card:juice_up(0.3, 0.5)
      return true
    end
  }))
  delay(0.6)
end

:3 this replaces the whole use function

north brook
#

:O

#

time to test :D

#

Question, does it loop around? So Joker loops to the back of the collection?

charred widget
#

ok so i was initially going to come back here because i couldn't fix a syntax error but i ended up fixing it anyways

#

but yeah almost all of necrozma's forms are functional

north brook
charred widget
north brook
#

oh

#

lmao

#

I'm just used to out of place conversations lmao

charred widget
#

oh since you seem to be knowledgable about pokemon you may be able to help me with my mod

north brook
#

shoot, what's up?

charred widget
#

well my mod is based around legendary pokemon

#

and there are a few that I still don't have ideas for

#

like mewtwo

north brook
#

is it still within vanilla? like your not adding extra enhancements/editions?

charred widget
north brook
#

Maybe some form of Tarot/Planet manipulation?

charred widget
#

well Solgaleo, Lunala and Necrozma's abilities are tarot/consumable centric

north brook
#

so mewtwo is big smart. So you'd want something that makes player feel big smart.

charred widget
#

well the big thing with mewtwo is that it's a man-made killing machine made from Mew's DNA

charred widget
#

and since there's DNA in Balatro i was thinking Mew could be some sort of upgraded version of it

north brook
#

Glass cards

#

Mew makes sense

#

Mewtwo broke from containment, and glass cards are score killers

north brook
frosty rampart
#

blurgh

north brook
#

it's a failsafe

#

it's random every time

frosty rampart
#

dangit

north brook
#

I mean

#

that still kinda works

frosty rampart
#

is it working for all the other jokers at least?

north brook
#

as far as I have tested, yes. Perfectly

frosty rampart
#

ok good

north brook
#

It also does not bypass eternal, but it doesn't make anything new. That's fine, closer to vanilla that way

#

ok now I gotta make the art cause this rules

#

thanks y'all! I appreciate it

charred widget
#

oh wait dragonite do you want to know what Zygarde's gimmick is

north brook
#

Like in game?

charred widget
#

yeah in my mod

north brook
#

oh you mean your mod

#

yea sure

charred widget
#

I ultra cooked with this one

#

ok so Zygarde always starts at 10% form

#

and 10% creates a Cell consumable when you play a Full House

#

and the cell consumable turns up to 2 cards into Cell cards (which give 71 chips and 8 mult)

#

and when you get 10 cell edition cards in your whole deck, it transforms into 50% form

#

50% converts the first hand of the round into Cell cards, and retriggers the highest ranked cell card twice

north brook
#

Does it convert to 100%

charred widget
#

yes i was about to get into that

north brook
#

my b continue

charred widget
#

when you have 50 cell edition cards in your full deck, it transforms into Complete form

#

and complete gives 2x mult for every cell card played and held in hand

#

I just felt so smart for coming up with the transforming gimmick as you get more cell cards in your deck

north brook
#

That's real cool. And it's a build around

#

And quite honestly, it's very strong when you complete it.

charred widget
#

oh necrozma's stuff is cool too

#

base necrozma doesn't do anything yet because i have no ideas for it

#

but Solgaleo gives 1.5x mult for every Sun consumable held

#

and Lunala gives 1.5x mult for every Moon consumable held

#

and when either of them are next to Necrozma when you exit the shop, it transforms

#

dusk mane creates a negative Sun when the blind is selected, and all Sun consumables give 2x mult

#

and dawn wings does the same but for Moon consumables

#

and when Dawn Wings is next to Solgaleo, or if Dusk Mane is next to Lunala at the end of the shop, it creates Ultra Necrozma

#

and Ultra Necrozma gives 3x mult for ALL CONSUMABLES

#

and mind you legendary pokemon are hard to come by

#

which tbf i might need to add a more reliable way to obtain them if anyone wants to use them in a legit run

signal plaza
daring fern
#

split cairn
#
        if context.individual 
        and context.cardarea == G.hand 
        and not context.end_of_round 
        and SMODS.has_enhancement(context.other_card, "m_steel") then
            local msg1 = finn_quotes[ math.random(#finn_quotes) ]
            if #SMODS.find_card('j_inf_huntress') > 0 then
                return {
                    x_chips = card.ability.extra.huntress ^ 2,
                    message = msg1
                }
            else
                return {
                    x_chips = card.ability.extra.huntress,
                    message = msg1
                }
            end
        end
``` how do i make the message text appear below the joker instead of above the playing cards?
daring fern
split cairn
daring fern
split cairn
north brook
frosty rampart
#

very cool

north brook
#

i'm going crazy this was just working I go and update the art, and now it suddenly crashes

frosty rampart
#

put a comma after the end on the line right before the can_use function starts

north brook
#

programming is weird

#

thank you

jolly shadow
signal plaza
stiff locust
#

I like that it's 1 behind in the collection too

#

most mods put their legendaries near the end of the collection so it doesn't really give you immediate legendary access unless two mods line up such that going back 1 turns it into a legendary

north brook
# jolly shadow jimbo to perkeo speedrun

fun fact, the code is slightly different. Jimbo changes to a random joker. :3

Even if I didn't change it, my mod adds jokers, so you'd just hit the end of my jokers

lavish elm
#
if context.joker_main then
            return{
                card = card,
                Xchip_mod = card.ability.extra.Xchips,
                message = 'X' .. card.ability.extra.Xchips .. " Chips",
                colour = G.C.CHIPS,
                sound = "xmpl_MultiplicativeChips"
            }
        end

why is the sound not working it crashes my game instead

robust marsh
true jasper
#

So you don't need to do that

lavish elm
daring fern
true jasper
robust marsh
#

damn I didn't even know xchips is built in

lavish elm
#

wait so why wasn't it playing with xchip_mod

willow scroll
#

@daring fern got the fake cards working, tysm again!

#

but i do have a question, how could i tweak this so that if i merge two cards their initial states are saved? like if i had a square joker with 8 chips saved how would i transfer that

#

oh hold up mightve found it

willow scroll
#

bruh too long for discord one moment

#
        if card.ability.extra.maxboism_multi_boxes then
            for i, v in ipairs(card.ability.extra.maxboism_multi_boxes) do
                local key = v
                G.maxboism_savedjokercards = G.maxboism_savedjokercards or {}
                G.maxboism_savedjokercards[card.sort_id] = G.maxboism_savedjokercards[card.sort_id] or {}
                if not G.maxboism_savedjokercards[card.sort_id][key] then
                    local old_ability = copy_table(card.ability)
                    local old_center = card.config.center
                    local old_center_key = card.config.center_key
                    card:set_ability(key, nil, 'quantum')
                    card:update(0.016)
                    G.maxboism_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
                    G.maxboism_savedjokercards[card.sort_id][key].ability = copy_table(G.maxboism_savedjokercards
                        [card.sort_id][key].ability)
                    for i, v in ipairs({ "T", "VT", "CT" }) do
                        G.maxboism_savedjokercards[card.sort_id][key][v] = copy_table(G.maxboism_savedjokercards
                            [card.sort_id][key][v])
                    end
                    G.maxboism_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G
                        .maxboism_savedjokercards
                        [card.sort_id][key].config)
                    ```
#
card.ability = old_ability
                    card.config.center = old_center
                    card.config.center_key = old_center_key
                    for i, v in ipairs({ 'juice_up', 'start_dissolve', 'remove', 'flip' }) do
                        G.maxboism_savedjokercards[card.sort_id][key][v] = function(_, ...)
                            return card[v](card, ...)
                        end
                    end
                end
                local partreturn = G.maxboism_savedjokercards[card.sort_id][key]:calculate_joker(context)
                if type(partreturn) == 'table' then
                    totalreturn = SMODS.merge_effects({ totalreturn, partreturn })
                end
            end
            if next(totalreturn) ~= nil then
                return totalreturn
            else
                return false
            end
        end```
#

i assume i pass the values after set ability/update?

daring fern
willow scroll
willow scroll
#

if not ill ask in a bit :clueless:

daring fern
willow scroll
#

or am i misunderstanding something

daring fern
#

Also you would want each value in card.ability.extra.maxboism_multi_boxes to be a table.

#

Which stores the key and card.ability

willow scroll
heavy elm
daring fern
#

Are you trying to do quantum ranks?

heavy elm
# daring fern What is the goal?

i'm just trying to have it so that when i have parrot in the joker roster, any card will work for jokers that require a 2, 4, 6 or 8 (e.g. 8 ball now being able to give tarots on any scored card, wee joker upgrading on any scored card, etc)

daring fern
heavy elm
daring fern
#

But also that's not possible normally, currently and with mod compatibility.

#

Unless you use the ids_op method.

#

Which can break sometimes.

heavy elm
daring fern
#

Also you should be taking ownership.

heavy elm
heavy elm
daring fern
heavy elm
gilded blaze
#

taking ownership of a vanilla object replaces its vanilla behavior

daring fern
#

It justs replaces that values on the center if it is there.

frosty dock
#

it replaces certain aspects of its vanilla behavior, not the entire behavior

#

which of course happens by overwriting values and functions

#

but I'm pretty sure that's what huy meant anyway

gilded blaze
#

e.g. modifying a vanilla joker's calculate nullifies its previous behavior defined in Card:calculate_joker

gilded blaze
#

wha

daring fern
gilded blaze
#

oh I get it

#

💀 takes a bit brainpower tho

#

for modded jokers we don't usually have to strictly return something because they're not originally defined in Card:calculate_joker

frosty dock
#

that part is a bit intransparent tbh

ripe thicket
#

I have this enhancement here and I want to make it scale faster when I have a specific joker. For some reason, no matter if I have the specific joker or not, the enhancement always uses the faster scaling

#

I remember someone telling me a long time ago that SMODS.find_card would be the thing that worked but I might've done something wrong

wintry solar
#

next(SMODS.find_card(...))

daring fern
ripe thicket
#

hm ok

#

so is there a better option for if I'm trying to see if I have a specific joker bought?

willow scroll
gilded blaze
#

next(table) returns nil if table is empty

ripe thicket
#

oh ok yay it works now

frosty dock
# robust marsh glorp

you can just create any center with in_pool = function() return false end, (never appears in-game) and no_collection = true (hidden from collection)

#

really an Other localization entry should be supported there, but as of now it isn't

robust marsh
#

thank you

frosty dock
#

oh it totally is

robust marsh
#

yep

frosty dock
#

there just is no better way as of yet

robust marsh
#

hoping to see something like this in the future

frosty dock
#

i may have wanted to address that before and just forgot

robust marsh
#

no worries

frosty dock
#

not a big thing for sure, would just need to have galdur and CardSleeves also adopt it

manic rune
robust marsh
frosty dock
#

that's even worse practice lmao

#

just need to have two mods do it differently and boom

robust marsh
#

ah

#

yeah nevermind then

#

i'll stick to the safer option

manic rune
robust marsh
#

interesting

manic rune
#

i was able to make it display two tooltips at once too, like this

frosty dock
wintry solar
#

I wonder if for non-center values we should utilise the same method we use for colours and ahve the loc_vars table provide the localize call?

ocean sinew
ripe thicket
#

I wanna add my own joker to the main menu like where the ace of spades is normally. I've tried looking to see how other mods did it but I couldnt find anything

daring fern
ripe thicket
#

sorry but how do I do that 😭

lavish elm
#

hey how do I change rarity weights

loud summit
#

here

rotund sable
ripe thicket
lavish elm
wild berry
#

how can i change the position of a joker in the jokers card area

slim ferry
#

whats the code

lavish elm
#
if context.joker_main then
            return{
                G.GAME.common_mod = 0,
                G.GAME.uncommon_mod = 0,
                G.GAME.rare_mod = 1
            }
        end

currently just a test

slim ferry
#

yeah because its in a return

#

thats why it doesnt work

#

you cant run code in a return without putting a function in it

#

just make it not a return

ashen drift
daring fern
wild berry
#

ty

quartz pendant
#
calculate = function(self, card, context)
        if context.pre_discard and G.GAME.current_round.hands_played == 0 then
            local discard_list = {}
            for _, v in ipairs(G.discard) do
                discard_list[#discard_list+1] = v
            end
            local discard_to_redraw, _ = pseudorandom_element(discard_list, 'discard_retrieve')
            if G.GAME.current_round.discards_used == 0 then
                G.E_MANAGER:add_event(Event({
                        func = function()
                            print("test")
                            G.hand:emplace(discard_to_redraw)
                            return true
                        end
                    }))
                end
         end

Is it possible to redraw cards from the discard pile back into my hand?
I'm not sure if what I did was correct (and the game crashed when I executed this code)

daring fern
#

Also update SMODS

lavish elm
#

it works but there is 2 side effects the effect doesn't go away after selling the joker and for some reason joker descriptions no longer appears

slim ferry
#

well yeah

#

because thats not how passive joker effects work

#

also if descriptions arent appearing then you broke something else

long sun
#

i'm very nearly almost done with Doug Dimmadome's hat :D it's scaled and positioned correctly now

#

the only problem is the shearing not matching the base card

#

it appears to be pivoting about its own centre, and not the centre of the card

daring fern
long sun
#

yepyep

#

that's a good way of putting it

lavish elm
#

so iirc to make a passive joker I need to put what I want in a function and make the effect happen when the check for the joker is true right?

quartz pendant
#

so it’s already in the api

#

(I didn’t even see any of that in the docs lol)

daring fern
# long sun yepyep

That's unfixable to my knowledge, but there is a patch you can do to fix some of it.

long sun
#

i've already applied the patch u suggested a while back

daring fern
loud summit
long sun
#

aw :<

#

i could maybe write a new version of the shader then

slim ferry
slim ferry
#

not a passive effect

long sun
#

i'll try that, and if that doesn't work, i'll just leave it as is

quartz pendant
#

not sure if that’s still an issue now

loud summit
daring fern
slim ferry
#

if you dont check the context then it just does it whenever the joker is calculated at all

loud summit
#

like drawing more cards for booster packs is a passive but you can implement it by checking for blind set context

slim ferry
#

not passively

loud summit
slim ferry
#

also i wouldnt consider anything that happens in calculate to be passive personally

real crown
#

How would I go about making only Tarot cards appear in the shop?
I found that I can set G.GAME.planet_rate to 0, but what about jokers and booster packs? (Arcana only)

loud summit
#

theres a game modifier to disable jokers in shop

slim ferry
#

and for jokers yeah just use the jokerless modifier

real crown
#

Oh right I forgot about that challenge, thank you!

slim ferry
#

yeah

#

kind

#

thats the type of pack

wild berry
#

how can i check when a boss blind is defeated in contexts

real crown
#

How can I add the jokerless modifier to a deck? I saw that it's no_shop_jokers when added to a challenge, but decks don't have a rules field as far as I'm concerned

daring fern
wild berry
#

kkty

real crown
#

Thank you!

lavish elm
#
function rarity_thing()
    if next(SMODS.find_card("j_xmpl_corrupt_joker")) then
        for i = 1, #G.jokers.cards do
            local joker_key = G.jokers.cards[i].config.key
            if G.P_CENTERS[joker_key].rarity == 1 then
                G.common_mod = G.common_mod + 0.05
                G.uncommon_mod = G.uncommon_mod - 0.05
                G.rare_mod = G.rare_mod - 0.05
            end
            if G.P_CENTERS[joker_key].rarity == 2 then
                G.common_mod = G.common_mod - 0.05
                G.uncommon_mod = G.uncommon_mod + 0.05
                G.rare_mod = G.rare_mod - 0.05
            end
            if G.P_CENTERS[joker_key].rarity == 3 then
                G.common_mod = G.common_mod - 0.05
                G.uncommon_mod = G.uncommon_mod - 0.05
                G.rare_mod = G.rare_mod + 0.05
            end
            if G.P_CENTERS[joker_key].rarity == 4 then
                G.common_mod = G.common_mod - 0.05
                G.uncommon_mod = G.uncommon_mod - 0.05
                G.rare_mod = G.rare_mod - 0.05
                G.legendary_mod = G.legendary_mod + 0.05
            end
            return true
        end
    end
    return false
end
#

this no work

loud summit
#

are you calling the function

lavish elm
#

how to do that

slim ferry
#

what do you mean how to do that

#

just like any othjer function???

#

also legendary_mod does nothing because legendary weight is 0 and multiplying that doesnt change that

lavish elm
#

so like I just called it and it will update automatically?

slim ferry
#

no

loud summit
#

if you want to set the rarities on buy youd want to call it in the setup function

slim ferry
#

also usually things will multiply these values which will just break it

#

and currently it also only increases weights and never reverts the changes

loud summit
#

oh tht too

slim ferry
#

wdym

lavish elm
#

0.7 common
0.25 uncommon
0.05 rare

#

also you telling me those are multipliers?

#

I thought this was like raw + 5%

daring fern
ripe thicket
#

I don't

daring fern
long sun
#

heyo! if i send the card's center's VT as an argument to my custom shader, then apply it to the extra sprite, would that work?

real crown
# slim ferry just ban all non-arcana packs by looping over G.P_CENTER_POOLS.Booster and check...

Tried this solution (I don't plan for mod compatibility so I don't want to overkill with hooking), but the other type of packs are still appearing

        G.E_MANAGER:add_event(Event({
            func = function()
                G.GAME.joker_rate = 0
                G.GAME.planet_rate = 0
                for key, pack in pairs(G.P_CENTER_POOLS.Booster) do
                    if (pack.kind ~= 'Arcana') then
                        G.GAME.banned_keys[key] = true
                    end
                end
                return true
            end
        }))
    end```
long sun
frosty rampart
slim ferry
#

oh yeah use G.P_CENTERS[pack] to get the kind

#

i think

frosty rampart
#

in the loop you can just do pack.key to get the key

slim ferry
#

oh ok

real crown
daring fern
#

slim ferry
#

whats the area that contains held tags?

ripe thicket
slim ferry
#

yeah youre overriding the function entirely

#

you need to call the original function in there still

ripe thicket
#

would the original function be just Game:main_menu() ?

daring fern
daring fern
ripe thicket
wild berry
#

how can i make the loc vars able to set the selected hand as a blind proprety

loud summit
#

look at how the base game does it ig

static valley
wild berry
loud summit
#

vanillaremade

wild berry
#

no like

#

in what part

#

i dont see loc vars in the blinds

#

and when they do

#

they dont add propreties

daring fern
loud summit
#

? how does ox do it them

wild berry
#

its literally just a proprety in G.GAME

#

the game does not have current_round.least_played_poker_hand though

loud summit
#

uhhh

#

look at modded blinds then

#

ik ortalabs spike shows the most played hand too

wild berry
#

but does it show the least played one?

loud summit
#

the tax changes the description for its score limiter

#

uhh

ripe thicket
#

yeah no I have 0 clue what im doing 😭

winter flower
#

i know i've asked this before but i still cannot figure it out
how do i make it so that your run ends if you have a joker from my mod

loud summit
wild berry
#

wait

#

i have a better question

#

how can i get a loc var as a variable in calculate

loud summit
#

you call menu_joker

daring fern
loud summit
#

actually it might be a card area

ripe thicket
ripe thicket
#

oh ok

loud summit
#

yea its G.title_top

#

so you just add a card to that cardarea

daring fern
wild berry
ripe thicket
loud summit
winter flower
loud summit
ripe thicket
#

ok yay it finally works!

loud summit
#

yay

ashen drift
#

is there a way to fix custom scoring parameters displaying "?" when playing a hand that contains flipped cards

daring fern
ashen drift
#

this is for before the hand is played, no?

daring fern
ashen drift
#

im reffering to something else

daring fern
ashen drift
#

im sending a video for reference

#

the new operator is created via SMODS.Scoring_Parameter and SMODS.Scoring_Calculation

daring fern
ashen drift
#

bummer

lofty elm
#

hey, anyone know if there's contexts for destroying jokers or consumables? or if it's possible to have stuff trigger off that at all

loud summit
#

i think every destruction effect uses destroy_card

lofty elm
loud summit
#

and you check the contexts area to see which type was destroyed

lofty elm
#

or maybe

#

hm

#

youre prolly right I think I misread that one since I haven't used it

#

well idk this doesn't seem like what I need

#

idk

#

this is just super confusing to me tbh

#

maybe I'll just try stuff and see what happens

daring fern
loud summit
#

what

lofty elm
#

I have a handful of jokers that do that

daring fern
lofty elm
#

non-playing cards in what context sorry

daring fern
lofty elm
#

I'm a little new still so might need more description

manic rune
#

does anyone know where in the code is h_popup rendered?

lofty elm
manic rune
#

for ui specifically

lofty elm
#

or does it just work in both

daring fern
lofty elm
#

ohhhh

#

so just to double check, context.joker_type_destroyed will trigger for both jokers and consumables

lofty elm
#

deal, ty

devout edge
#

how do i make madness not trigger if it has no joker to destroy

#

i'm making a joker like it that, instead of gaining xmult, makes a clone

loud summit
devout edge
#

i mean that would work but how do i check each joker?

#

i am very new to modding balatro

loud summit
#

i mean just check if its eternal or not i think?

devout edge
#

well the thing is it's not just that

#

wait nvm

loud summit
devout edge
#

k

devout edge
#

k

#

wait

#

is there a way for me to just check if the length of the destructable joker list is 0?

loud summit
#

adding # to the start of a list name gets its length

#

#listname

idle plaza
loud summit
#

oh you can call pseudorandom_element with an empty list?

idle plaza
#

Yeah it'll just return nil

loud summit
#

i was worried it would error out if i tried

devout edge
#

cool

devout edge
#

i guess it's the formatting?

#

i probably need to put brackets around it

wintry solar
devout edge
#

the rest is basically just madness but without the scaling

wintry solar
#

You haven’t shown the important bit where you create destructible jokers 😭

devout edge
#

i thought that wouldn't matter since it's basically madness but ok

#

the cut off text is just a then and the end of abominationnation

winter flower
#

game crashes when i actually have a joker from my mod, dunno what to fix here

#

(this is for a blind)

idle plaza
# devout edge

Remove the not 'crynosure... part. That always reads as false

idle plaza
#

G.jokers.cards[i] ~= card already ensures the card won't destroy itself.

devout edge
#

ah

#

well here's the thing

#

i need to make sure the card won't destroy any copies of itself too

idle plaza
wintry solar
#

Then you need to check the key of the card

long sun
#

how can i get the transformation applied to a card from hover and juice and etc.?

#

[this is for a shader]

devout edge
#

ok now they're destroying themselves

#

im gonna see if just having both lines works

idle plaza
devout edge
#

oh

#

thanks