#💻・modding-dev

1 messages · Page 628 of 1

golden field
#

ah

#

-# i think

lament agate
#

so i do this then?

daring fern
daring fern
golden field
stuck ore
#

How would you spawn in a joker from the joker pool from only one mod prefix?

#

Slash like what would the set be or if theres something else additional

daring fern
stuck ore
#

yep

golden field
#

using my new consumable crashes the game, not sure what is causing this

lament agate
#

if i want to change this to affect Hands instead of Hand sizes, what should i do

golden field
golden field
# daring fern Code?

SMODS.Consumable {
    key = 'beth',
    set = 'blindconsumabletype',
    pos = { x = 1, y = 0 },
    atlas = 'blindcon',
    display_size = {w = 64, h = 64},
    config = { max_highlighted = 1 },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_CENTERS.m_mult
        info_queue[#info_queue + 1] = G.P_CENTERS.m_wild
        info_queue[#info_queue + 1] = G.P_CENTERS.m_glass
        info_queue[#info_queue + 1] = G.P_CENTERS.m_steel
        info_queue[#info_queue + 1] = G.P_CENTERS.m_stone
        info_queue[#info_queue + 1] = G.P_CENTERS.m_gold
        info_queue[#info_queue + 1] = G.P_CENTERS.m_lucky
        return { vars = { card.ability.max_highlighted } }
    end,
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                local enhancement = poll_enhancement('emuismeaningsmile', nil, true, true,
                    { 'm_mult', 'm_wild', 'm_glass', 'm_steel', 'm_stone', 'm_gold', 'm_lucky' })
                local change_card = G.hand.highlighted[1]
                charge_card:set_enhancement(enhancement, true)
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
    end,

    can_use = function(self, card)
        if G and G.hand then
            if #G.hand.highlighted ~= 0 and #G.hand.highlighted <= 1 then
                return true
            end
        end
    end
}
umbral zodiac
golden field
lament agate
umbral zodiac
#

thunk isnt that silly

daring fern
lament agate
#

😭

golden field
umbral zodiac
#

i just got out of the shower like 3 mins ago

#

im sopping wet

lament agate
#

fair

#

alright hold on

#

soggy cat

umbral zodiac
#

i'm soggy cat

daring fern
golden field
umbral zodiac
#

you should actually modify it rather than just setting it , but yeah

lament agate
#

how tho

umbral zodiac
#

[x] = [x] +/- [y]

#

you are just doing [x] = [y] right now basically

lament agate
#

ohhhh

golden field
#

no

golden field
umbral zodiac
#

carp

lament agate
#

so
G.GAME.round_resets.hands = G.GAME.round_resets.hands - card.ability.extra.hands

umbral zodiac
#

yea

lament agate
#

i am so smart

#

thanks

golden field
#

same code and situation, different crash

#
SMODS.Consumable {
    key = 'beth',
    set = 'blindconsumabletype',
    pos = { x = 1, y = 0 },
    atlas = 'blindcon',
    display_size = {w = 64, h = 64},
    config = { max_highlighted = 1 },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_CENTERS.m_mult
        info_queue[#info_queue + 1] = G.P_CENTERS.m_wild
        info_queue[#info_queue + 1] = G.P_CENTERS.m_glass
        info_queue[#info_queue + 1] = G.P_CENTERS.m_steel
        info_queue[#info_queue + 1] = G.P_CENTERS.m_stone
        info_queue[#info_queue + 1] = G.P_CENTERS.m_gold
        info_queue[#info_queue + 1] = G.P_CENTERS.m_lucky
        return { vars = { card.ability.max_highlighted } }
    end,
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                local enhancement = SMODS.poll_enhancement('emuismeaningsmile', nil, true, true,
                    { 'm_mult', 'm_wild', 'm_glass', 'm_steel', 'm_stone', 'm_gold', 'm_lucky' })
                local change_card = G.hand.highlighted[1]
                change_card:set_ability(enhancement, true)
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
    end,

    can_use = function(self, card)
        if G and G.hand then
            if #G.hand.highlighted ~= 0 and #G.hand.highlighted <= 1 then
                return true
            end
        end
    end
}
lament agate
golden field
lament agate
#

i see

daring fern
golden field
#

it's basically reversing the thing you just did

lament agate
#

my plan was to set the player's hand into 1

golden field
daring fern
golden field
#

ah

#

noted

#

IT WORKS THANKS

stuck ore
#

Sorry just curious, would it be possible to create a joker from the pool a specific mod?

            G.E_MANAGER:add_event(Event({
                func = function()
                    if card.ability.extra.count == 3 then
                        card.ability.extra.count = 0
                        local new_card = SMODS.create_card({
                            set = "Joker",
                            no_edition = true,
                        })
                        if new_card then
                            G.jokers:emplace(new_card)
                            new_card:juice_up(0.4, 0.4)
                        end
                    end
                    return true
                end,
            }))```
(This is the code I'm using to spawn the joker)
#

I'm curious about making it to where this can only pull from the pool of one mod, I think it might be something related to the mod's prefix but I'm not sure how to implement it

lament agate
#

how would i prevent joker retriggering itself

stuck ore
#

"and not context.repetition" I'm pretty sure

#

Putting that on the if context statements you don't want retriggered mean those parts won't be retriggered by any including it's own retriggers

lament agate
#

i want to retrigger all played cards

stuck ore
#

I think the issue is that you don't have context.individual

lament agate
#

RIGHT

#

shit

#

😭

#

im so fucking dumb

stuck ore
#

It's hitting itself which honestly I'm totally gonna use in my own mod that seems funny

lament agate
#

:SOBS:

red flower
red flower
#

well that's any retriggers

#

retrigger_joker should be the card retriggering

golden field
#

question: can i set hand size to a specific value, eg. 5

golden field
#

game crashed when i skipped on my custom skip tag

slim ferry
#

the card key youre using doesnt exist, youre probably forgetting the mod prefix from the looks of it

golden field
red flower
golden field
red flower
#

no that's the code

golden field
#

ah

#

so no variables needed got it

red flower
#

it's not a variable either it's a function call

golden field
#

thanks

golden field
#

question: how do i make created cards a certain suit

golden field
pale holly
#

Is there a way to change the money reward from a boss blind during that said boss lind ?

vale grove
#
SMODS.Joker {
    key = 'Rubber_ducky',
    pools = { ["Scalala"] = true, },
    loc_txt = {
        name = 'Rubber ducky',
        text = {
            "Spawns a copy of self at end of round, gaining +5 chips per copy"
        }
    },
    rarity = 1,
    cost = 6,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,
    unlocked = true,
    discovered = true,
    atlas = 'Jokers',
    pos = { x = 1, y = 3 },
    config = {
        extra = { chipgain = 5, chiptotal = 0 },
    },

    loc_vars = function(self, info_queue, center)
        return { vars = { center.ability.extra.chipgain, center.ability.extra.chiptotal } }
    end,
    update = function(self, card, dt)
        local count = 0

        for _, j in ipairs(G.jokers.cards) do
            if j.key == self.key then
                count = count + 1
            end
        end
        card.ability.extra.chiptotal = card.ability.extra.chipgain * count
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chiptotal
            }
        end
        if context.end_of_round and context.main_eval and not card.YA_no then
            local drac = SMODS.add_card({ key = self.key })
            drac.YA_no = true
        end
    end
}

iam trying to make a joker that spawns copies of itself and gains +5 chips for every copy of the joker there is (lets say you have 3 of these you get +15 in total) , however i cant get the chips part of this joker to work

normal crest
#

An easier way to get the count is #SMODS.find_card(self.key)

vale grove
normal crest
#

find_card returns an array of all the found jokers with that key, so it's just getting the length

#

self.key here is the same as putting 'j_modprefix_Rubber_ducky'

pale holly
#
SMODS.Blind {
    name = "boss_strong",
    key = "boss_strong",
    atlas = "pseudoblinds",
    mult = 2,
    pos = { y = 1 },
    dollars = 5,
    loc_txt = {
        name = 'The Strenght',
        text = {
            "X2 Blind Requirement if",
            "scored hand  exceeds it",
        },
    },
   boss = { min = 2 },
   
    boss_colour = HEX('cc702a'),
    
calculate = function(self, card,  blind, context)

 if not blind.disabled then
 if  context.after and SMODS.last_hand_oneshot then
      G.GAME.blind.chips = math.floor(G.GAME.blind.chips * 2)
    G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
    blind:wiggle()
    end
    end
  end
        
}```

i've a crash about context being nil despite context being in the calculate function, not sure what is going on
normal crest
#

your parameters are wrong, should just be function(self, blind, context)

ocean sinew
#

is there a joker triggered context

pale holly
ocean sinew
#

a context for when a joker got triggered

#

like when greedy joker triggers

#

it sends out context.card_triggered
context.card=(the greedy joker)

#

if a diamond card is scored 5 times that context would be sent 5 times

pale holly
#

Ah i see

dark roost
#

is there any scoring context like context.individual, that doesn't count when the card is retriggered? a check like "not context.repetition" would be fine too but I can't find any that work

toxic cave
#

how do i make it properly add a negative joker at the start?

pale holly
dark roost
#

not context.repetition doesn't seem to do anything, idk why

pale holly
#

what's the goal of your joker ?

dark roost
#

retrigger every 4th card scored, not counting other retriggers

#
            and not context.repetition then
            card.ability.extra.cards_left = card.ability.extra.cards_left - 1
        end

        if context.repetition and context.cardarea == G.play then
            if card.ability.extra.cards_left <= 0 then
                card.ability.extra.cards_left = card.ability.extra.retrigger_req
                return {
                    message = localize("k_again_ex"),
                    repetitions = 2,
                    card = card,
                }
            end
        end```
pale holly
pale holly
toxic cave
#

probably should've posted that first

#

im so smart

daring fern
#

Also put it in an event.

dark roost
pale holly
#

you'll be better fusing your context in one go

pale holly
# dark roost ``` if context.individual and context.cardarea == G.play and not context.bl...
if context.individual and context.cardarea == G.play  then
            if not context.repetition and not context.blueprint  then
            card.ability.extra.cards_left = card.ability.extra.cards_left - 1
            elseif context.repetition then
            if card.ability.extra.cards_left <= 0 then
                card.ability.extra.cards_left = card.ability.extra.retrigger_req
                return {
                    message = localize("k_again_ex"),
                    repetitions = 2,
                    card = card,
                }
            end
    end
        end```

you might need to adjust it but it should be something like this
ocean sinew
#

I made quantum ranks into balatro

#

that works

#

without having to add your own compatibility

#

it automatically replaces the card code

#

who wanna see?

pale holly
ocean sinew
#

wait I'll show u

ocean sinew
# pale holly sure

should I launch it in my lib as W.I.P for other people to use and help catch errors (If there's any)

#

there were some cases where it wasn't working

toxic cave
ocean sinew
#

like when it did

#

local b = card:get_id()

#

and

#

if b then

pale holly
#

well put it a video here so we can see what it even does

ocean sinew
#

but then I fixed it by counting variables

pale holly
#
SMODS.Blind {
    name = "bos_clarity",
    key = "bos_clarity",
    atlas = "pseudoblinds",
    mult = 2,
    pos = { y = 3 },
    dollars = 0,
    loc_txt = {
        name = 'The Purity',
        text = {
            "Gives no reward money",
        },
    },
   boss = { min = 1 },
   
    boss_colour = HEX('64d5e6'),
    
    modifiers = function()
        G.GAME.modifiers.no_blind_reward = G.GAME.modifiers.no_blind_reward or {}
        G.GAME.modifiers.no_blind_reward = true
    end,
    
        defeat = function(self)
       G.GAME.modifiers.no_blind_reward = G.GAME.modifiers.no_blind_reward or {}
        G.GAME.modifiers.no_blind_reward = false
       end,
    
disable = function(self)
    G.GAME.modifiers.no_blind_reward = G.GAME.modifiers.no_blind_reward or {}
        G.GAME.modifiers.no_blind_reward = false
    G.GAME.blind.dollars = 5
end,
}```

Could someone help me on this ? My blind is meant to not give any reward money unless disabled, however i'm trying to also give it the text change
for exemple if there's no reward for the blind (like small blind on Red Stake)

and i want it when disabled to change the text to show the appropriate number of dolalrs you get, i've tried to do something but i think i'm wrong on some parts, if someone could help please
ocean sinew
#

I recorded

#

I'mma show

tranquil gull
#

@hidden timber web based bmm lite when 🙏
(basically just the interface to download mods, no utility to enable/disable them)

#

wrong channel but that had a ping

ocean sinew
#

wait

#

I'mma put in streamable

hidden timber
tranquil gull
#

tysm

#

i'm on linux and run the game through love so

ocean sinew
hidden timber
tranquil gull
#

through wine or through löve

ocean sinew
#

any modded jokers I should test with

hidden timber
tranquil gull
#

so through wine

#

so that still wouldn't work for me :p

hidden timber
tranquil gull
#

awesome

hidden timber
#

It‘s looking good so far

pale holly
daring fern
dark roost
# pale holly ```lua if context.individual and context.cardarea == G.play then if...
            if not context.repetition and not context.blueprint then 
                card.ability.extra.cards_left = card.ability.extra.cards_left - 1
            end
            if card.ability.extra.cards_left <= 0 then
                card.ability.extra.cards_left = card.ability.extra.retrigger_req
                return {
                    message = localize("k_again_ex"),
                    repetitions = 2,
                    card = card,
                }
            end
        end```
ok this mostly does what I want it to do, but for some reason it only gives 1 retrigger instead of 2 like I was trying. The exact code block you sent didn't work, presumably because it doesn't pass the context.repetition check
ocean sinew
pale holly
ocean sinew
#

that was hard to make

ocean sinew
#

where you can define if a card count as a specific rank or not

dark roost
#

this could work if I just wanted it to be the card in the 4th position every time, but I want it to carry over between multiple hands, or for example retrigger the 1st and 5th card

ocean sinew
#

It should be working without other people having to add :is_rank to their card

#

because I used a parser to loop through code blocks and replace it so it could act that way

#

still W.I.P

#

but I think should be working w every or most cases

#

atleast I hope so

tranquil gull
ocean sinew
#

print statements going wild 💀

#

I'll have to disable them

tranquil gull
ocean sinew
#

and reenable only If I have to check why smth going wrong

#

what should I do next

#

after quantum ranks?

wooden nexus
#

What am I doing wrong here?

ocean sinew
#

force triggering jokers context

#

except It's not hardcoded

wooden nexus
#

I can't seem to get the sprite for square to go back to normal unless it goes back into the square shape hitbox

ocean sinew
#

that was all thanks to S

#

sad he left balatro modding...

pale holly
# dark roost ``` if context.individual and context.cardarea == G.play then ...

yeah i did expected what i sent wouldn't work out properly, good to know you did figured eventually, and for the repetions of 1 instead of two ..well i'm not so sure, you could either try to create a card.ability.extra.(whatever name you want) set to 2 and then you could do something like *repetitions = card.ability.extra.(whatever name you want) or 2
that or since the repetitions doesn't work since there's no context.repetition active for the other part of your code, that's why i went else at first

i'm no pro at the coding but i suppose you could try experimenting this, at least you're closer to it

ocean sinew
#

I think I know what I'll do next

#

I'mma do force triggering jokers context

#

and joker got triggered context

#

a function to get the context's of when a joker triggers as a table of strings would prolly be very cool and useful too

dark roost
#

I just make it 1 retrigger every 3 cards instead

#

and then I don't have to think

pale holly
dark roost
#

oh wait

#

it plays the retrigger animation but doesn't actually retrigger anything

#

💀

#

that's also why it didn't count them wrong

daring fern
dark roost
#

yeah that's what the original plan was

#

but then we're back to the problem of needing to check whether a card score was from a retrigger or not

slim ferry
#

why dont you do the counter in context.repetition too

#

it triggers once per card

#

so then there wouldnt be the issue anymore

dark roost
#

oh I guess that does make sense

hidden timber
tranquil gull
#

nope

#

i run it directly through love

#

all i'd really need is a way to manually set the mods folder and executable path

hidden timber
tranquil gull
#

nope, but i have it on stesm

#

i run it natively for performance reasons

#

wine has overhead, and proton is wine based

hidden timber
dark roost
# slim ferry so then there wouldnt be the issue anymore
            card.ability.extra.cards_left = card.ability.extra.cards_left - 1
            if card.ability.extra.cards_left <= 0 then
                card.ability.extra.cards_left = card.ability.extra.retrigger_req
                return {
                    message = localize("k_again_ex"),
                    repetitions = 2,
                    card = card,
                }
            end
        end```
Yeah this worked, it was actually so simple
tranquil gull
hidden timber
tranquil gull
#

how so?

hidden timber
tranquil gull
#

thats not what open sourcing is

#

open sourcing would be publishing that code on github

hidden timber
#

Yes, that's right, but I mean "open sourcing" in the sense of the user being able to read the original source code of the program and BMM would enable this

tranquil gull
#

ah

#

if you're worried abt it then the web ui idea would be more than enough for my case

hidden timber
slim ferry
#

I thought it was

hidden timber
slim ferry
#

For doing what exactly

#

Its not like youre enabling anything new

pale holly
#

does anyone know what's the size image for the blinds ?

slim ferry
#

34x34 iirc

pale holly
#

thanks

wooden nexus
#

Bump

versed swan
# wooden nexus

You missed several other parts of the code that target self.ability.name == "Square Joker"; there's also one in an SMODS override of Card:set_sprite

I think these patches should resolve the issue:

wooden nexus
cerulean rose
#

i'm trying to make a subclass of Tag, but for some reason it doesn't appear in G.P_TAGS

SMODS.current_mod.RTD_Tags = {}
SMODS.current_mod.RTD_Tag = SMODS.Tag:extend {
    obj_table = SMODS.current_mod.RTD_Tags,
    obj_buffer = {},
    atlas = "pencil_rtd",
    class_prefix = "rtd",
    set = "RTD Tag"
}

SMODS.current_mod.RTD_Tag {
    atlas = "tags",
    pos = { x = 0, y = 0 },
    config = { type = "new_blind_choice" },
    key = "workshop",
}
#

also can someone send a link to vanillaremade

hushed field
paper gulch
wooden nexus
cerulean rose
#

betalatro

vale grove
#

how do i make a different lose condition

chrome widget
#

Currently for challenges though. I should probably extend it for stakes

vale grove
#

is it that difficult to setup?

#

i know that win setup is very easy because i made wordle that makes you win if you get it right

chrome widget
#

It's basically in two parts. One is that you can patch to disable the default lose condition if you don't want to end the game at Ante 8, and otherwise I have it routing through check_for_unlock to then run a lose condition function on the current challenge

#

Arguably you could do this with mod calculate

vale grove
#

no i dont need a challenge

#

i made this fella

#

and i wanna make it so that if you beat the blind in one hand you lose

hushed field
#

in that case, you can force a loss condition in the calculate

chrome widget
#

Oh well thats not really a lose "condition" I would say. You could just have the blind call the lose behavior

vale grove
chrome widget
#

I've got a helper function hold on

vale grove
#

maybe condition was fautly writing for me

#

im working on something else in the meantime so im kinda locked out XD

hushed field
#
                G.E_MANAGER:add_event(Event({trigger = 'after', delay = 4, func = function()
                    G.STATE = G.STATES.GAME_OVER; G.STATE_COMPLETE = false 
                return true end }))

is how I do it for my mod's joker that has a loss-state associated with it

#

I need to check quickly to see how I handle the joker quip for the loss state

chrome widget
#
local function game_over_handler(win)
    if win then
        win_game()
        G.GAME.won = true
    else
        G.STATE = G.STATES.GAME_OVER
        if not G.GAME.won and not G.GAME.seeded and not G.GAME.challenge then
            G.PROFILES[G.SETTINGS.profile].high_scores.current_streak.amt = 0
        end
        G:save_settings()
        G.FILE_HANDLER.force = true
        G.STATE_COMPLETE = false
    end
end```
hushed field
#

oh, you can literally just set

G.GAME.loss_condition = "ringu"

which allows you to change the quips that jimbo makes, or which joker appears on the end screen

vale grove
#

hold on

#

i might try something funny with that

hushed field
vale grove
#

how funny is it if you lose to a blue shell and get a luigi with a blue shell in hand laughing at you

chrome widget
#

This is far more extendable with jimboquips fwiw

vale grove
#

also another thingy,

#

is it possible to make one sound repeat during the boss blind?

hushed field
#

You can run events as repeated timers, yeah

#

Or use the update function of the blind, depending on what you need

vale grove
#

have you ever played mario kart?

hushed field
#

Yeah

vale grove
#

yk when ur in first place

#

and you get a blue shell thrown towards you

#

you get that warning sound

vale grove
hushed field
#

Check out the joker quip api smods added

urban wasp
vale grove
#
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chiptotal,
                sound = "YA_Rubberducky"
            }
        end

        if context.end_of_round and context.main_eval and not card.YA_no then
            local drac = SMODS.add_card({ key = self.key })
            drac.YA_no = true
            play_sound("YA_Rubberducky")
        end
    end
}

anyone got any clue why this one doesnt work sound = "YA_Rubberducky"
but this one does play_sound("YA_Rubberducky")

arctic spire
#

hi, I need some help for a joker that I'm making. the description of my joker add "Xmult" depending on how many suit a "soul_seal" is apply the. example "1 soul = 2X, 2 soul = X4, 3 soul = X6, etc" sadly the problem is that I don't know how to code a function that detect if "suit" with "soul_seal" apply to it give the amount of "Xmult" it need to give

wind steppe
#

how many of a specific suit your seal is applied to?

#

where though

#

like in full deck?

#

remaining in deck?

#

played?

wind steppe
#

scoring or just played

quasi pike
#

What do I need to put after the joker name here?

wind steppe
quasi pike
#

ohhh, ok

wind steppe
#

also why are you checking for G.consumeables

quasi pike
#

I forgot to say this code is for a deck

wind steppe
#

that doesnt answer the question

#

the check feels unnecessary

#

if theres no reason for it remove it

quasi pike
#

sorry, I'm pretty new making mods and I use a ton of copypaste

quasi pike
quasi pike
wind steppe
#

yes?

#

its a function

#

check smods wiki

arctic spire
# wind steppe scoring or just played

well here a image because I don't how explain this. in this image I played three card which one of them has the soul_seal. this mean that the joker should give you a "Xmult" of 2. again I'm not good a explaining it so, hope this image help

quasi pike
wind steppe
arctic spire
#

well, I think what I should had said that every card played with a seal apply will give a additional x2 mult doesn't matter if it a high card or a pair or a flush. so your example tell me that the king with the seal and two other card with the same seal would give a "X8".

wind steppe
#

wait so does the suit not matter?

#

also i meant the rank two not two cards

arctic spire
wind steppe
#

and even without any seal played it still gives x2 mult?

arctic spire
wind steppe
#

thats what in_pool is for

#

like how lucky cat doesnt appear if you have no lucky cards

#

irregardless you'd want to do something like this

local xmult = card.ability.extra.xmult -- set in your config
for k, v in ipairs(context.full_hand) do
  if v:get_seal() == "your seal's key" then
    xmult = xmult + card.ability.extra.xmult
  end
end
return {xmult = xmult}
distant junco
#

can you debuff hands with jokers?

wind steppe
#

afaik its the same way blinds do it

#

pretty sure they get the same contexts

#

dont quote me on it though

distant junco
#

i tried this and it didnt work

wind steppe
#

oh is that a function

#

i thought there was a context for it

wintry solar
#

the function is for blinds

wind steppe
distant junco
#

ill try that

distant junco
daring fern
#

static valley
#

How would I go about leveling up the most played hand (without spawning its respective planet card)

daring fern
wispy falcon
daring fern
quasi pike
#

Why does this joker scale even if the played hand isn't a High Card

#

??

wispy falcon
daring fern
quasi pike
#

It finally works, thak you!!! I've been trying to end this joker for so long

static valley
#

how do I get a poker hand's level?

daring fern
chrome widget
#

I never noticed this but apparently the sprite drawn for the splash background is this one:

vocal helm
#

What function would I hook to save the last scored rank?

static valley
rigid solar
#

Does anyone have the list of tag contexts?

spiral mural
#

how do i access the return table of a context

daring fern
static valley
daring fern
spiral mural
#

im

#

litterally in calculate_individual_effect

#

???

#

what are you on

spiral mural
faint yacht
static valley
#
                        local copy = G.jokers.cards[pseudorandom("comedy_funny_thing", 1, #G.jokers.cards)]
                        SMODS.add_card(copy)

for some reason it's getting the copy from my deck, and not from the jokers I have

daring fern
static valley
#

one more thing. how can I make sure a sticker can only be applied to jokers?

spiral mural
#

when i play a hand, it skips over all of the playing cards and doesn't affect anything
code:

    if MyDreamJournal.chipmodkeys[key] then
        local return_table = {}
        local op_modification = SMODS.calculate_context({
            modify_chips = true,
            op_number = MyDreamJournal.keysToNumbers[MyDreamJournal.chipmodkeys[key]],
            chips = amount,
            is_demicolon = is_demicolon
        }, return_table)
        amount = return_table.chips
    elseif MyDreamJournal.multmodkeys[key] then
        local return_table = {}
        local op_modification = SMODS.calculate_context({
            modify_mult = true,
            op_number = MyDreamJournal.keysToNumbers[MyDreamJournal.multmodkeys[key]],
            mult = amount,
            is_demicolon = is_demicolon
        }, return_table)
        amount = return_table.mult
    elseif MyDreamJournal.glopmodkeys[key] then
        local return_table = {}
        local op_modification = SMODS.calculate_context({
            modify_glop = true,
            op_number = MyDreamJournal.keysToNumbers[MyDreamJournal.glopmodkeys[key]],
            glop = amount,
            is_demicolon = is_demicolon
        }, return_table)
        amount = return_table.glop
    end```
hidden timber
daring fern
#

vocal helm
#

(I have a global variable and stuff kinda like how idol does it)

daring fern
vocal helm
#

I.e if I played only an Ace, it'd be Ace
Or if I played a straight but put a 6 at the end it'd be a 6

daring fern
vocal helm
#

Okay sweet, I'd hook that?
Where would I find it in the files

daring fern
vocal helm
#

sweet, thanks!

static valley
#
    key = "preOwned_sticker",
    atlas = "comedy_stickers",
    pos = { x = 0, y = 0 },
    badge_colour = HEX("fd5f55"),
    rate = 0.1,
    needs_enable_flag = true,
    should_apply = function(self, card, center, area, bypass_roll)
        -- only applies if the card has values that can be made worse
        return G.GAME.modifiers.enable_comedy_preowned and (card.ability ~= nil) and card.ability.extra
    end,
-- rest of code works

how can I make it so that it 1.) applies less often and 2.) only applies to jokers

vocal helm
#

-# fish

static valley
#

the fish is from another mod I'm just doing a test run with said other mod because why not
-# the mod in question is "Tangents"

daring fern
vocal helm
# daring fern `SMODS.score_card`
local card_score_hook = SMODS.score_card
function SMODS.score_card(self)
    card_score_hook(self)
    if not SMODS.has_enhancement(card_score_hook.card, "m_stone") then
        G.GAME.current_round.j8mod_bookmark_rank = card_score_hook.card.base.value
    end
end
``` this causes it to crash due to indexing local 'context'
i'd imagine it's not as simple as this
daring fern
vocal helm
#

ahh, okay, sweet!

#

thanks!

ocean sinew
#

do Game:start_run() get called when you continue a run?

static valley
#
SMODS.Sticker {
    key = "preOwned_sticker",
    atlas = "comedy_stickers",
    pos = { x = 0, y = 0 },
    badge_colour = HEX("fd5f55"),
    rate = 0.25,
    needs_enable_flag = true,
    should_apply = function(self, card, center, area, bypass_roll)
        -- only applies if the card has values that can be made worse
        return SMODS.Sticker.should_apply(self, card, center, area, bypass_roll) and G.GAME.modifiers.enable_comedy_preowned
    end,
    --sets = {Joker = true},
    apply = function(self, card, val)
        card.ability[self.key] = val
        Comedy_multiplyCardValues(card, 0.75, true)
    end
}

although maybe I'm doing something wrong

ocean sinew
#

localize("e_base","Edition")
why is this returning "ERROR"
??

vale zinc
#

context.discard is called for every card discarded. Is there a context that's called just once, when the Discard button is pressed?

wintry solar
#

context.pre_discard

vale zinc
slender monolith
#

idrk where to ask this but i figured this was good enough, but my game kept crashing after loading the ut/dt mod. and due to discord's limit on messages, i can't send the error log

slender monolith
#

where is the log file?

daring fern
slender monolith
#

alr thank you!

rigid moss
#

Hey guys, can you help me? I'm trying to inject code to functions/state_events.lua so that i can override which glass card breaks. However upon loading it tells me that pattern on target resulted in no matches. For other files code injection works but it struggles with state_events for some reason...

wind steppe
#

youre probably patching after smods

#

which would replace the pseudorandom bit with smods probability systems

slender monolith
wind steppe
#

is talisman on vanilla scoring

#

it has to be for utdr

ocean sinew
#

localize("e_base","Edition")
returns "ERROR"
and localize("e_negative","Edition") also returns "ERROR"
what I'm doing wrong?

#
if edition_name == nil then edition_name = localize("e_base","Edition") end

As in the value of edition_name gets set to "ERROR"

slender monolith
wind steppe
#

also ask in modding-chat not modding-dev

slender monolith
#

ah alr, thank you

#

that worked, thank you so much for the help!

#

out of curiosity and a genuine question; would the other setting besides vanilla work for the ut/dr pack? also what causes it to crash to begin with? i'm interested in game dev and want to analyze these crashes also to pick it out again if it happens in the future

daring fern
rigid moss
daring fern
red flower
rigid moss
red flower
#

yeah

#

or re-take ownership

rigid moss
#

ok, thanks guys! I was really struggling on this one

vocal helm
#

Is there a way to check if the player is leaving a booster pack?

#

not being in one, but getting out of it

daring fern
vocal helm
#

thanks!

edgy reef
#

Need to redo this whole menu at some point but I'll be busy with stuff for the next month at least

vocal helm
#

Is it possible to "fake" setting a blind? i.e. calculate the context of setting a blind for a joker

#

-# I'm working on Modeling Clay and I need it to do that whenever it changes what Joker it's copying

daring fern
frosty rampart
#

do you need it for everything in the game or just a specific joker?

vocal helm
#

just a specific joker

frosty rampart
#

try doing joker:calculate_joker({...}) instead, where joker is the card object of the joker you need to get calculated
(same arguments as what somethingcom gave you)

vocal helm
#

alrighty!

#

stack overflow

#

ah, wait

#

i wasn't trying to copy the effect, i was trying to copy the joker itself, which caused an infinite loop

vocal helm
#
calculate = function(self, card, context)
        -- thanks, somethingcom515 !
        if (context.setting_blind or context.pre_discard) and not context.blueprint then
            card.ability.extra.copying_joker = pseudorandom_element(G.P_CENTER_POOLS.Joker, 'j8mod_modeling_clay').key
            -- vv problem line 
            G.P_CENTER_POOLS.Joker[card.ability.extra.copying_joker]:calculate_joker({
                setting_blind = true,
                blind = G.GAME.round_resets.blind
            })
            -- ^^ problem line
            return {
                message = localize { type = 'name_text', set = "Joker", key = card.ability.extra.copying_joker } .. "!",
                colour = G.C.RARITY[G.P_CENTERS[card.ability.extra.copying_joker].rarity]
            }
        end
        if card.ability.extra.copying_joker then
            local key = card.ability.extra.copying_joker
            G.j8mod_savedjokercards = G.j8mod_savedjokercards or {}
            G.j8mod_savedjokercards[card.sort_id] = G.j8mod_savedjokercards[card.sort_id] or {}
            if not G.j8mod_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.j8mod_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
                G.j8mod_savedjokercards[card.sort_id][key].ability = copy_table(G.j8mod_savedjokercards[card.sort_id]
                    [key].ability)
                for i, v in ipairs({ "T", "VT", "CT" }) do
                    G.j8mod_savedjokercards[card.sort_id][key][v] = copy_table(G.j8mod_savedjokercards[card.sort_id]
                        [key][v])
                end
                G.j8mod_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G.j8mod_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.j8mod_savedjokercards[card.sort_id][key][v] = function(_, ...)
                        return Card[v](card, ...)
                    end
                end
            end
            return G.j8mod_savedjokercards[card.sort_id][key]:calculate_joker(context)
        end
    end,

you'll probably recognize this one

#

-# there's also the very minor issue of scaling Jokers breaking in the description of the card but that's another problem; was going to ask if there was a way to reset/refresh the variables after setting the ability of a card

daring fern
vocal helm
#

i wasn't sure what to use instead of just card, which caused a stack overflow

daring fern
vocal helm
#

so more something like this:

if (context.setting_blind or context.pre_discard) and not context.blueprint then
            card.ability.extra.copying_joker = pseudorandom_element(G.P_CENTER_POOLS.Joker, 'j8mod_modeling_clay').key
            return {
                message = localize { type = 'name_text', set = "Joker", key = card.ability.extra.copying_joker } .. "!",
                colour = G.C.RARITY[G.P_CENTERS[card.ability.extra.copying_joker].rarity]
            }
        end
        if card.ability.extra.copying_joker then
            local key = card.ability.extra.copying_joker
            G.j8mod_savedjokercards = G.j8mod_savedjokercards or {}
            G.j8mod_savedjokercards[card.sort_id] = G.j8mod_savedjokercards[card.sort_id] or {}
            if not G.j8mod_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.j8mod_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
                G.j8mod_savedjokercards[card.sort_id][key].ability = copy_table(G.j8mod_savedjokercards[card.sort_id]
                    [key].ability)
                for i, v in ipairs({ "T", "VT", "CT" }) do
                    G.j8mod_savedjokercards[card.sort_id][key][v] = copy_table(G.j8mod_savedjokercards[card.sort_id]
                        [key][v])
                end
                G.j8mod_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G.j8mod_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.j8mod_savedjokercards[card.sort_id][key][v] = function(_, ...)
                        return Card[v](card, ...)
                    end
                end
            end
            return G.j8mod_savedjokercards[card.sort_id][key]:calculate_joker(context)
        end
        if context.setting_blind or context.pre_discard then
            card:calculate_joker({
                setting_blind = true,
                blind = G.GAME.round_resets.blind
            })
        end

(just moving the calculate_joker function under setting the ability)

daring fern
vocal helm
#

alright, thank you

#

one last thing - as of right now, the joker properly displays what joker it's copying on the side, but the values themselves don't update. is there a way to fix that?

#
info_queue[#info_queue + 1] = G.P_CENTERS[card.ability.extra.copying_joker]

(just doing this as of now)

daring fern
vocal helm
#

damn, awesome!
thank you so much 🙇

#

it doesn't seem to work
(should be +8 chips)

#
loc_vars = function(self, info_queue, card)
        -- super thanks somethingcom515 !
        local center = G.P_CENTERS[card.ability.extra.copying_joker]
        local other_center = SMODS.shallow_copy(center)
        other_center.loc_vars = function(self, info_queue, uncard)
            return center.loc_vars(self, info_queue,
                G.j8mod_savedjokercards[card.sort_id][card.ability.extra.copying_joker])
        end
        table.insert(info_queue, other_center)
        info_queue[#info_queue + 1] = { key = "credits_sharb", set = "Other" }
        return { vars = { card.ability.extra.copying_joker and localize({ type = 'name_text', set = "Joker", key = card.ability.extra.copying_joker }) or 'Nothing', colours = { card.ability.extra.copying_joker and G.C.RARITY[G.P_CENTERS[card.ability.extra.copying_joker].rarity] or G.C.FILTER } } }
    end,

(code0

#

also, I got merry andy, which gave me a permanent -1 hand size
...and then got turtle bean, which gave me a permanent +5 hand size

daring fern
vocal helm
#

wouldn't that mean i'd have to call the removing from deck context (?) before setting the new ability?

#

-# is there even a context for that

daring fern
vocal helm
#

alright

#

that seemed to work, thank you so much!

vocal helm
#

i'll figure this out later

#

sorry for clogging up the chat ^^;;

pastel kernel
#

how do you set ante to 0?

daring fern
pastel kernel
#

how does saved work? (prevent death and set ante to 0)

return {
                    message = localize('k_saved_ex'),
                    saved = 'ph_mr_bones',
                    colour = G.C.RED
                }```
#
    calculate = function(self, card, context)
        if context.end_of_round and context.game_over and context.main_eval then
            ease_ante(-G.GAME.round_resets.ante)
                G.E_MANAGER:add_event(Event({
                    func = function()
                        G.hand_text_area.blind_chips:juice_up()
                        G.hand_text_area.game_chips:juice_up()
                        play_sound('tarot1')
                        card:start_dissolve()
                        return true
                    end
                }))
                return {
                    message = localize('k_saved_ex'),
                    saved = 'ph_mr_bones',
                    colour = G.C.RED
                }
            end
        end
}```
pastel kernel
mystic river
#

is there an easy way to do misprint-style dynatext, or am i going to have to figure out the hard way

spiral mural
elder rune
vale grove
#

How do you make a new consumeable type like a tarot or spectral

daring fern
vale grove
#

thx

vale grove
daring fern
vale grove
#

alr ty

vale grove
daring fern
vale grove
# daring fern No, it's `SMODS.ConsumableType`
SMODS.ConsumableType {
    key = 'Scrumables',
    primary_colour = HEX('fa9629'),
    secondary_colour = HEX('148929'),
    name = " test2",
    loc_text =
         {
         name = 'test1', 
         collection = 'Scrumables', 
         undiscovered = { 
             name = 'test3',
             text = { 'test4' },
         },
     }
}

what am i doing wrong here?
for context the colour does show up but no names or items inside of the consumable type itself

spiral mural
daring fern
#

maiden phoenix
# daring fern

I remember seeing a mod that had a rescoring mechanic, I think Autumn's mod?

golden field
#

question: how do i get the number of times the most played hand has been played

hushed field
# golden field # question: how do i get the number of times the most played hand has been playe...

I use this function to get a list of the most played hands. I added _tally to the return so you immediately get the times played as well, but you can check it for any hand with the G.GAME.hands[key_of_the_hand].played

function get_most_played_hand()
    local _tally
    local _hands = {}
        for k, v in ipairs(G.handlist) do
        if G.GAME.hands[v].visible and (_tally == nil or G.GAME.hands[v].played > _tally) then
            _hands = {}
            _hands[#_hands + 1] = v
            
            _tally = G.GAME.hands[v].played
        end
        if G.GAME.hands[v].visible and (_tally == nil or G.GAME.hands[v].played == _tally) and not G.GAME.hands[v].played == 0 then
            _hands[#_hands + 1] = v
        end
    end

    return _hands, _tally
end
golden field
hushed field
#

What do you mean?

golden field
#

does this code also work on consumables

hushed field
#

Oh, yeah, this is just a helper function. You can call it any time during a run, on anything, and it'll work

golden field
hushed field
#

in neither. It's a function, so you put it in your code somewhere, and then call it using in loc_vars and in use()
local _handlist, _most_played_number = get_most_played_hand()

golden field
hushed field
#

I recommend just making a file for helper functions, but that works, yeah

golden field
hushed field
#

Yes. It will call that function, and return a table object that will be stored in _handlist, that will contain every hand that counts as most played, and an integer in _most_played_number that is how many times those hands have been played.

wispy falcon
#

Quick question, what's the formula to calculate the chance for custom rarity Jokers to show up in the shop?

hushed field
#

there's no consistent one, and it depends on what chances you're going to include. But the vanilla rarities add up to 100, so if the game's chosen a joker as the object to spawn, and your custom rarity has a spawn rate of 0.01, or 1%, then the total chances add up to 101, so there's a 1/101 chance a joker of your custom rarity will be chosen

#

if you add other mods that add their own custom rarity, these changes change, though

wispy falcon
#

Okay, but the base is rarityChance/allRarityChances?

hushed field
#

yes

wispy falcon
#

Okay, thank you :3

golden field
#

question: how do i change the background when opening a booster pack

daring fern
hushed field
vale grove
vale grove
#

i can now put consumeables into it

vale grove
vale grove
#

finally figured it out 🙏

elder rune
#

How would one go about combining sprites together on a joker

hushed field
#

shaders or drawsteps will probably be the way to go, depending on what you're aiming for

elder rune
# hushed field in what sense?

like say I have a handful of sprites for a "right half" and a "left half" for a joker, and when the joker gets created it will choose a random right half and random left half to use

#

and making every combination in an atlas would just take up space and also be pretty infeasable to extend

hushed field
#

Drawsteps definitely work for that! I have a similar system in my mod that uses 64 sprites to construct a roasted chicken. My own approach would be to set the base sprite of the jokers to just an empty card, and then pick the two halves based on information from the joker.

elder rune
#

I've never used drawsteps ever in my life so like how would it work

hushed field
#

i'm checking now to see if the wiki has it documented, haha, give me a sec

elder rune
#

smods.drawstep?

hushed field
#

https://github.com/icyethics/Kino/blob/main/items/Enhancements/superhero.lua

this is code from my own mod where I use it to put a soul sprite on playing cards for an enhancement, for some more examples. Though in your case, I recommend pre-loading the sprites somewhere. I'd first just mess around seeing what you can do, though, because a lot of learning the drawstep is just realizing how things get rendered in the game by seeing it happen

GitHub

a balatro mod for movie dorks. Contribute to icyethics/Kino development by creating an account on GitHub.

elder rune
#

alr

#

Okay I think I get it after snooping around some more

umbral spire
#

why wont this work, it just does nothing...

local function table_contains(table, item)
    local ret = false
    for i=1, #table do
        if table[i] == item then 
            ret = true
            break
        end 
    end 
    return ret
end 
local function choose_random_jokers(amount, seed)
    local chosen_indices = {}
    for i=1, amount do 
        local c = 0
        local function choose()
            c = random(seed, 1, #G.jokers.cards)
            if table_contains(chosen_indices, c) then 
                repeat 
                    c = random(seed, 1, #G.jokers.cards)
                until not table_contains(chosen_indices, c)
            end
        end 
        choose()
        table.insert(chosen_indices, c)
    end 
    local joker_table = {}
    for k,v in ipairs(chosen_indices) do 
        table.insert(joker_table, G.jokers.cards[v])
    end 
    return joker_table
end 
.......
SMODS.Blind {
    .......
    calculate = function(self,blind,context)
        local function debuff_half()
            if G.jokers.cards and #G.jokers.cards > 0 then 
                -- get a random half of G.jokers.cards
                local chosen = choose_random_jokers(math.ceil(#G.jokers.cards/2), 'qerehir124')
                for k,v in ipairs(chosen) do
                    G.GAME.blind:debuff_card(v)
                end
            end            
        end
        if context.setting_blind then 
            debuff_half()
        end
        if context.after then 
            debuff_half()
        end 
    end
}
tired kestrel
#

can anyone tell me how exactly does sticker offsets worked? for something to fix?

umbral spire
tired kestrel
#

the heck-? I tried pixel-size but it also changed the size of the hitbox.

#

I just realized the sticker graphics were already positioned. though I have an idea.

umbral spire
strong plume
#

Crashing on modload; any idea why? Effect intent is 4 in 13 cards drawn are drawn face-down, +mult when the joker is scored

red flower
#

nvm it's this comma

strong plume
#

bluphhhh

#

it's always just one comma haha, ty!

umbral spire
#

this'll pick a random card on purchase right?

    add_to_deck = function(self, card, from_debuff)
        local ids = {14,13,12,11,10,9,8,7,6,5,4,3,2}
        local suits = {'Diamonds','Spades','Hearts','Clubs'}
        local c = pseudorandom('j_thecloset_mike_wazowski' .. G.GAME.round_resets.ante)
        self.config.extra.card_id = ids[c]
        local y = pseudorandom('j_thecloset_mike_wazowski' .. G.GAME.round_resets.ante)
        self.config.extra.card_suit = suits[y]        
    end 

normal crest
#

pseudorandom returns a value between 0 and 1

red flower
#

no, c and y would be numbers between 0 and 1, also you don't want to save things to self because that's the prototype not the card
card.ability.extra.card_id = pseudorandom_element(ids, 'j_thecloset_mike_wazowski' .. G.GAME.round_resets.ante) is what you want

strong plume
red flower
#

also i dont really like this file loading method you have because it makes reading crashlogs harder imo

strong plume
red flower
#

just the if, the then has to be there for the if on the previous line

solid salmon
#

is there a way to get the hand score

strong plume
red flower
solid salmon
#

total score of the hand

red flower
#

there are some entries on getting score on the vanillaremade wiki

red flower
solid salmon
#

ok

tired kestrel
#

I thought of making custom sticker diaplays like this but not sure how this would work to replace the stickers on a single joker

solid salmon
#

can i hook contexts

#

or like

#

add a function

#

where if said context happens

#

then it affects a global variable

ivory field
#

is there any coding resources for balatro/lua

umbral spire
#

YouTube is a good place to look for general lua programming.

vale zinc
umbral spire
#

Unless you're making complex mods, I'd stick to the VanillaRemade and SMODS wiki rather than YT Lua-tutorials

solid salmon
#

guys

#

is it possible to modify a global variable without linking it to a joker

red flower
#

yes

vale zinc
#

Sure it is. Just call it G.GAME.<your_mod_prefix>_your_variable_name.

tired kestrel
red flower
#

i think you would have to change the drawstep that draws the stickers for that joker

tired kestrel
solid salmon
solid salmon
#

but would there be any issue with just

#

adding a context

#

then modifying said variable

wind steppe
#

global mod calculate

vale zinc
red flower
# solid salmon then modifying said variable

I think you need to be more clear on what you want to achieve. If what you mean is "how do I use calculate contexts outside of a joker" then use the global mod calculate like paradox said

tired kestrel
#

the sticker drawsteps?

wind steppe
#

i dont. know

wind steppe
solid salmon
#

ah

wind steppe
red flower
solid salmon
#

like this one?

red flower
tired kestrel
#

alright. sorry if I had to askcause I am slowly going back into modding but I need to re-learn what I had remember once before

solid salmon
#

oh

red flower
#

SMODS.current_mod.calculate = function(self, context)

solid salmon
#

im confused

tired kestrel
#

Now how do I hook it?

wind steppe
#

vanillaremade wiki has a guide on hooks

red flower
#
local sticker_drawstep_ref = SMODS.DrawSteps.stickers.func
SMODS.DrawSteps.stickers.func = function (self, layer)
  if self.config.center_key == "your joker key" then
    -- code
  else
    sticker_drawstep_ref(self, layer)
  end
end
vale zinc
#

Shall you be done soon? I have a big debacle I want sorted out and I don't want to step on your toes while at it.

tired kestrel
#

alright-y then.

red flower
solid salmon
vale zinc
#

I apologize, I didn't mean to be rude.

I've managed to trigger a stack overflow and crash my game through a feature in my mod. It stems from a custom Tarot card of mine, Rebirth, which gives a copy of the run's most-used consumable card. On this particular run my most-used consumable was The Fool, so I activated a Rebirth to grab another copy of The Fool, and then my game seized up and crashed.

I took this up with wingedcatgirl and she said it's 'cause since each one's set to create the other, the two cards try to create infinite info queues, and an attempt to reduce the length of a generated info queue failed, crashing the game as before.

#

Here's a small excerpt from the crash log; it's got thousands of statements just like this one.

(2315) Lua global 'generate_card_ui' at file 'functions/common_events.lua:3143'
    Local variables:
     _c = table: 0x3ad319f0  {order:1, _d:false, unlocked:true, set:Tarot, consumeable:true, _saved_d_u:true, cost:3, discovered:true, effect:Disable Blind Effect, pos:table: 0x3ad31ba0 (more...)}
     full_UI_table = table: 0x3b2a7a30  {badges:table: 0x3b2a79d0, info:table: 0x3bc69120, type:table: 0x3bc69148, main:table: 0x3bc690f8, card_type:Tarot, name:table: 0x3bb04550, box_colours:table: 0x3f6b0da8 (more...)}
     specific_vars = nil
     card_type = nil
     badges = nil
     hide_desc = nil
     main_start = nil
     main_end = table: 0x3cb3c2d8  {1:table: 0x3cb3c318}
     card = nil
     first_pass = nil
     desc_nodes = table: 0x3cb3c190  {1:table: 0x3cb3c870, 2:table: 0x3cb3ca28, 3:table: 0x3cb3cfe0, 4:table: 0x3cb3d188, 5:table: 0x3cb3c2d8, name:The Fool, name_styled:table: 0x3cb40a48 (more...)}
     name_override = nil
     info_queue = table: 0x3cb3c168  {1:table: 0x3b4793b8}
     loc_vars = table: 0x3cb3c698  {1:Rebirth}
     cfg = table: 0x3ad31c00  {}
     (for generator) = C function: builtin#6
     (for state) = table: 0x3cb3c168  {1:table: 0x3b4793b8}
     (for control) = number: 1
     _ = number: 1
     v = table: 0x3b4793b8  {can_use:function: 0x3b479528, loc_vars:function: 0x3b4790b0, _saved_d_u:true, original_key:rebirth, mod:table: 0x3b1bfed8, _u:true, _discovered_unlocked_overwritten:true (more...)}
red flower
red flower
#

you can just upload the file for the log

vale zinc
#

But I can give you a relevant excerpt from Rebirth's code.

local rebirth_c = G.GAME.LAPSEMS_most_used_consumable_that_is_not_rebirth and G.P_CENTERS[G.GAME.LAPSEMS_most_used_consumable_that_is_not_rebirth] or nil
local most_used_consumable_that_is_not_rebirth = (rebirth_c and localize{
    type = 'name_text',
    key = rebirth_c.key,
    set = rebirth_c.set
}) or localize('k_none')
local colour = ((not rebirth_c) and G.C.RED) or G.C.GREEN

if (not (not rebirth_c or rebirth_c.name == 'Rebirth')) then
    info_queue[#info_queue + 1] = rebirth_c
end
solid salmon
#

insert the context?

#

ah

#

got it

red flower
#

loc_vars?

#

or a patch

vale zinc
red flower
#

so loc_vars?

solid salmon
#

is there a context for after the score is totalled?

red flower
#

context.after

vale zinc
# red flower so loc_vars?

See also:

use = function(self, card, area, copier)
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        delay = 0.4,
        func = function()
            if G.consumeables.config.card_limit > #G.consumeables.cards then
                play_sound('timpani')
                SMODS.add_card({key = G.GAME.LAPSEMS_most_used_consumable_that_is_not_rebirth})
                card:juice_up(0.3, 0.5)
            end
            return true
        end
    }))
    delay(0.6)
end,
vale zinc
red flower
#

i didnt reply to that

#

I meant the previous code

vale zinc
# red flower I meant the previous code
loc_vars = function(self, info_queue, card)
    local rebirth_c = G.GAME.LAPSEMS_most_used_consumable_that_is_not_rebirth and G.P_CENTERS[G.GAME.LAPSEMS_most_used_consumable_that_is_not_rebirth] or nil
    local most_used_consumable_that_is_not_rebirth = (rebirth_c and localize{
        type = 'name_text',
        key = rebirth_c.key,
        set = rebirth_c.set
    }) or localize('k_none')
    local colour = ((not rebirth_c) and G.C.RED) or G.C.GREEN

    if (not (not rebirth_c or rebirth_c.name == 'Rebirth')) then
        info_queue[#info_queue + 1] = rebirth_c
    end
    
    local main_end = {
        {
            n = G.UIT.C,
            config = { align = "bm", padding = 0.02 },
            nodes = {
                {
                    n = G.UIT.C,
                    config = {align = "m", colour = colour, r = 0.05, padding = 0.05},
                    nodes = {
                        {
                            n = G.UIT.T,
                            config = {
                                text = ' ' .. most_used_consumable_that_is_not_rebirth .. ' ',
                                colour = G.C.UI.TEXT_LIGHT,
                                scale = 0.3,
                                shadow = true
                            }
                        },
                    }
                }
            }
        }
    }
    
    return {
        vars = {
            card.ability.max_cards
        },
        main_end = main_end
    }
end,
#

wingedcatgirl recommended I limit the info_queue to #info_queue < 10, but to no avail.

red flower
solid salmon
#

print not printing

vale zinc
red flower
red flower
#

so it stops infinite tooltips

lavish elm
#

why is the third so small?

vale zinc
red flower
#

thats how text is formatted

#

you should break it up into more lines

solid salmon
#

its still not printing

lavish elm
solid salmon
umbral spire
#

to replace a joker at an index do you do G.jokers.cards[idx] = card?

red flower
solid salmon
#

1.0.0-beta-1016c

red flower
#

hmm no idea then

vale zinc
umbral spire
# red flower yes

like

local r = pseudorandom('bl_thecloset_ochre_obelisk', 1, #G.jokers.cards) -- random joker index num
local g = pseudorandom('bl_thecloset_ochre_obelisk', 1, 2001) -- random obelisk num
local card = nil 
if g ~= 1 then 
    local obelisk = 'obelisk_' .. g
    local card = SMODS.create_card(key = 'j_thecloset_' .. obelisk)
else 
    local obelisk = 'obelisk'
    local card = SMODS.create_card(key = 'j_obelisk')
end
G.jokers.cards[r] = card

?

vale zinc
#

You know, I could probably use this gimmick to farm Fortune Teller ad infinitum. I should probably forbid that.

tired kestrel
#

I'm having another hard time trying to apply the atlas.

red flower
#

<@&1133519078540185692>

red flower
#

if you want to move all jokers right then you need more logic

red flower
#

the same way

umbral spire
red flower
#

then you need to either destroy that joker or use set_ability to change it

tired kestrel
#

what's giong on?

red flower
#

?

umbral spire
tired kestrel
#

I saw you ping the mods not sure if it was me or not

red flower
#

no lol

#

it was a bot

tired kestrel
#

Oh.

#

Well can't blame cause I was a victim to geting hacked on that and messed me up as pstd triggered on me.

tired kestrel
# tired kestrel this

anyways, I had this issue as I wasn't sure how exactly you can replace the sticker atlas thing.

#

not sure if I'm doing this right.

red flower
#

you have to use your own sprite instead of the G.shared_stickers one

#

i dont really have any examples, sorry

tired kestrel
#

I see.

static valley
#

How do I check when the score catches fire?

umbral spire
#

how do i destroy a random held Tarot?

umbral spire
#

Paperbacks' Ice Cube Joker uses this aswell

slim ferry
#

No, it should be SMODS.calculate_round_score() > G.GAME.blind.chips

umbral spire
#

Doesn't this work fine, though?

slim ferry
#

No, because of SMODS.ScoringCalculation existing now

#

So chips * mult will not always be accurate

umbral spire
tired kestrel
#

I tried to use G.ASSET_ATLAS["stickers_hoylecasino"] and it doesn't find it?

quasi pike
#

how would I make a song play when I'm fighting an specific boss?

tired kestrel
#

why isn't the sticker showing after managing to fix it.

#

letm e show the code.

umbral spire
#

how do i modify probabilities for multiple specific jokers

tired kestrel
hushed field
umbral spire
hushed field
#

If you have control over the jokers, you can use the additional key argument to make it so only specific types of chance are affected

#

What you could also do is just use the odds context and check if those jokers are part of a specific set. If you add 'is_num_Ball = true' to those jokers, you can just check for 'card.config.center.is_num_ball'

harsh belfry
umbral spire
umbral spire
umbral spire
hushed field
#

no

#

just on the joker somewhere

umbral spire
slim ferry
# tired kestrel

Why do you need to seperately draw a sticker on the sprite instead of just making it part of the sprite

hushed field
#

this is an example from my own code. The highlighted line is one I use to check if the joker can be targetted by bullet loading

umbral spire
#
SMODS.Joker {
    key = '1_ball',
    atlas = 'Jokers',
    blueprint_compat = true,
    rarity = 1,
    cost = 5,
    pos = ball_positions[1],
    loc_txt = {
        ...
    },
    unlocked = true,
    discovered = true,
    config = { extra = { odds = 4, rank = 14 } },

    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'thecloset_balls_1')
        return { vars = { numerator, denominator } }
    end,
    ...
}
slim ferry
#

Whats even the goal

umbral spire
#

like

#

ik you said card.config.center.is_num_ball

#

but

#

where is card being referenced?

#

oh nvm

#

;-;

umbral spire
hushed field
#

I'd just hardcode that into your check, honestly. There's definitely ways, but that means either using take ownership, or injecting it before the run starts

umbral spire
#

I've never used that before

hushed field
umbral spire
harsh belfry
hushed field
#

yeah

tired kestrel
#

somehow it crashes when I try to apply eternal sticker

hushed field
#

can you show that line that's crashing?

tired kestrel
#

nvm I think I figured out I just had to include ones like eternal, perishable and rental but for some reason it doesn't show the clear for the base chips upon clearing?

#

nvm I tihnk I managed to figure out

umbral spire
#

this is valid right?
SMODS.create_card(key='thecloset_ball_ball', edition='e_negative')

tired kestrel
# tired kestrel

I think it was because of the caps I ha dthat doesn't render the sticker

#

so if anyone had a crash because of forgotten stickers and such. here's this as a reference.:

#

sorry for the trouble

#

I think it works pretty well in some way like this. though not sure if I were to release this mod so if any mods with thier own specific stickers can be made into this.

quasi pike
#

sorry, how would I make a song play when I'm fighting an specific boss?

tired kestrel
#

Now time to do the other ones just in case

umbral spire
#

how can i make all legendary jokers able to spawn in the shop

#

basically change the weight of the Legendary rarity.

#

for a Voucher.

#

dead chat? 😭

chrome widget
#

Pointing out that no one responded to you in fifteen minutes is a good way to get no one to respond to you ever

ocean sinew
#
if edition_name == nil then edition_name = localize("e_base","Edition") end

why localize("e_base","Edition") is returning "ERROR" what am I doing wrong here?

quasi pike
#

pls speed I need this

#

😢

red flower
red flower
# quasi pike bump

in select_music_track for your smods sound, return a big number when the boss blind is active

quasi pike
#

how do I detect if my boss is active from the smods sound? Is there a way to detect a boss' key?

fossil ermine
ocean sinew
#

this is where the ast classes are defined

#
local function advanced_destroying_logic(ast_root, args)
    args.card_variable = args.card_variable or "card"
    return parser.ast.traverse(ast_root, function (node,parent)
        if parser.ast._call:isa(node) and parser.ast._indexself:isa(node.func) then
            print("found call?")
            print("func:",node.func.expr.name)
            print("key:",node.func.key)
            if node.func.key == "start_dissolve" or node.func.key == "remove" then
            return parser.ast._call(
                parser.ast._var("SMODS.advanced_destroying"),
                parser.ast._var("{card_being_destroyed="..node.func.expr.name..",".."card_destroying="..args.card_variable.."}")
            )
            end

        end
        return node
    end)
end

This is simpler stuff that could maybe help u understand how it works (replacing :start_dissolve or :remove with another function)

#

it only checks for function calls that includes : because of parser.ast._indexself:isa(node.func)

river grail
#

Is there any way to make it so (*temporary) variables are actually named in the crash log code? Or is that just impossible, since they're all local variables?

daring fern
river grail
#

Ah. Guess that's just for loops then

vale grove
#

is it possible to "transform" a joker without removing it and adding a new joker?

#

like i want a consumeable that rerolls either all or one joker havent decided yet into just a completely random one

daring fern
tired kestrel
#

Welp, I think I start to like this detail especially since I thought of like making the stickers into the same style as well but yeah I might explain that later.

main pebble
#

can't get the set_ability() event to trigger for some reason

daring fern
#

Also context.cards_destroyed and context.glass_shattered don't exist.

main pebble
#

i'm using glass joker as reference and i guess it does?

#

what's the right context for checking for glass breaking then

daring fern
#

That is there but it never triggers.

main pebble
#

k thanks

shadow fable
#

question real quick, is there somewhere where there's a list of colors you can use in the text? like the {C:mult} stuff? Also am i able to use hexcodes there? and also also, am I able to use those same color codes in the name of the joker?

red flower
#

also it should be bl_modprefix_key

red flower
shadow fable
#

thank you

quasi pike
distant junco
#

how can i make a voucher like the tarot merchant but for my consumeables

toxic cave
#

what's responsible for triggering all of a blind's effects? is it the calculate or set_blind? (im trying to make a challenge deck where every blind boss beaten has its effects become permanent until the end of the run)

quasi pike
#

):

daring fern
harsh belfry
#

but set_blind is initial setup

#

so you wouldn't need to run it again

#

that being said, you would need to prevent it from reversing that setup in the disable or defeat call

daring fern
quasi pike
errant arrow
#

i give up trying to brute force this...
how do i get a joker to create a consumable? trying to test if one of my jokers will work with creating a consumable.
current code below
it's currently set to try and create The Fool Tarot

#

i have the chance set to 1,1 to have it auto succeed

daring fern
daring fern
errant arrow
#

thank you

daring fern
# quasi pike yes

return G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'b_modprefix_key' and math.huge or false

quasi pike
#

thx!! I'm almost done with the mod and you all are helping me a lot, thanks!!

errant arrow
#

2 things, one of which might be the main issue

  1. image below the text for the joker isn't being rendered.
  2. didn't create the card
#

fixed the text rendering-

errant arrow
#

First image: the full code block
Second image: code to summon The Fool

errant arrow
#

-# will be unresponsive for a moment

toxic cave
daring fern
daring fern
toxic cave
static valley
#

How do I get an image to flash across the screen? (similar to that one joker card in Tangents that randomly flashes Kendrick Lamar on the screen)

#

I plan on making a joker that disables the boss blind when you trigger its effect, and when you do that it shows this image

faint leaf
#

very hard stare

toxic cave
frosty rampart
#

g.game doesn't exist when mods are loaded

slim ferry
#

G.GAME does not exist during load

#

you should create it within the challenge in apply probably

toxic cave
#

alright, but now it doesnt crash and instead soft locks when the challenge is selected

wintry solar
#

your event needs to return true

#

otherwise it will continually run

silver flame
#

Hello everyone, I was trying to make my own mod using Joker forge and all of a sudden this crash message popped up and I have no idea why its crashing the game

#

I have the code here for the joker

ocean sinew
# silver flame

G.P_CENTERS.[card.ability.extra.m_lucky]
should be
G.P_CENTERS[card.ability.extra.m_lucky]

toxic cave
silver flame
#

uh, now its crashing for a different reason

solid salmon
#

is there a way to get the last obtained tag

#

kinda like the fool

frosty rampart
#

you can use the mod calculate function and context.tag_added to update a custom global variable every time you obtain a tag

red flower
#

global mod calculate best feature

solid salmon
#

context.tag.key do i use this?

frosty rampart
#

no, context.tag_added is itself the tag that was added

solid salmon
#

oh

#

wait

frosty rampart
#

so it should be context.tag_added.key

solid salmon
#

so context.tag_added will be the tag itself

frosty rampart
#

yes

solid salmon
#

im confused

#

is there a way to just make 2 double tags before i get the tag

#

wait a minute

#

...

#

thats gonna need a hook isnt it

#

.

frosty rampart
#

you're trying to track the most recently obtained tag, right

solid salmon
#

(im trying to make hit from balatro ball z)

frosty rampart
#

ok yea
so in your mod's global calculate function, during context.tag_added you should save context.tag_added.key to G.GAME.modprefix_latest_tag (or whatever you want to call it, just use your mod prefix to keep it unique). then when the thing that creates the copies happens, it can use G.GAME.modprefix_latest_tag as the key to create the tags

solid salmon
#

like this?

frosty rampart
#

yea that should be good

solid salmon
silver flame
#

@solid salmon do you think you could figure this out (i am very desprite)

solid salmon
#

go to line 45

#

of your buddydimes

silver flame
#

ok

#

the joker makes a lucky card when the shop is exited but that crashes the game because the code says base_card but what would i replace that with to make it work

frosty rampart
# solid salmon

should be mostly good, although there's some special behavior you have to handle for orbital tag. don't remember it off the top of my head

solid salmon
#

dis?

frosty rampart
#

ya that's it

silver flame
solid salmon
#

show code around the area

silver flame
solid salmon
#

remove base_

#

btw i had an issue with making this card create dupes of itself

#

(yes even copying its own edition excluding negative)

silver flame
# solid salmon remove base_

well, it made the card but it applied the edition and seal to the joker itself and the created card was not lucky

solid salmon
#

woah woah woah

#

what do you mean

#

"applied the seal"

silver flame
#

the joker had a seal, a blue one to be exact

solid salmon
#

lemme check the wiki to help ya

silver flame
#

thank you

solid salmon
#

what kind of card did you want to make?

silver flame
#

a lucky card with a random seal and edition

solid salmon
#

ok

static valley
#
-- in ComedyGold.lua: 
-- this is for image loading
ComedyGold.show_img = {}
ComedyGold.img_timer = {}
ComedyGold.images = {}

-- love.draw stuff for image flashing
local drawhook = love.draw
function love.draw()
    drawhook()
    if ComedyGold and ComedyGold.show_img then
        for img, bool in ipairs(G.ComedyGold.show_img) do
            if ComedyGold.img_timer[img] then
                Comedy_show_image(img)
            end
        end 
    end
end

-- in utils.lua: 
-- utility function to load an image
function Comedy_load_image(name)
    local path = (ComedyGold.path .. "assets/custom/" .. name .. ".png")
    local fileData = assert(NFS.newFileData(path))
    local img = assert(love.image.newImageData(fileData))
    return (assert(love.graphics.newImage(img)))
end

-- utility function to flash an image on the screen
-- I recommend setting the timer to 0.5 (it's in seconds)
function Comedy_show_image(name)
    local xScale = love.graphics.getWidth() / 1920
    local yScale = love.graphics.getHeight() / 1080

    if ComedyGold.show_img[name] then
        if not ComedyGold.images[name] then
            ComedyGold.images[name] = Comedy_load_image(name)
        end
        local a = math.min(1, ComedyGold.img_timer[name] * 2)
        love.graphics.setColor(1, 1, 1, a)
        love.graphics.draw(ComedyGold.images[name], 0, 0, 0, xScale, yScale)
    end
end

-- in jokers.lua (for a specific joker's calculate function): 
        if context.debuffed_hand or context.joker_main then
            if G.GAME.blind.triggered then
                G.E_MANAGER:add_event(Event({
                    func = function()
                        G.E_MANAGER:add_event(Event({
                            func = function()
                                G.GAME.blind:disable()
                                if not ComedyGold.images["hard_stare"] then
                                    ComedyGold.images["hard_stare"] = Comedy_load_image("hard_stare")
                                end
                                ComedyGold.show_img["hard_stare"] = true
                                ComedyGold.img_timer["hard_stare"] = 0.5
                                play_sound('comedy_hard_stare')
                                delay(0.4)
                                return true
                            end
                        }))
                        SMODS.calculate_effect({ message = localize('ph_boss_disabled') }, card)
                        return true
                    end
                }))
            end
        end

I got the sound to play, but the image doesn't show. How do I get the image to show?

#

-# I had the image loading stuff be put into a utility function in case I want to do something similar later

solid salmon
#

@silver flame

#

SMODS.add_card { set = "Playing Card", seal = random_seal, edition = random_edition, enhancement = 'm_lucky' }

silver flame
#

: |

solid salmon
#

this should make the card you want

#

oh yeah and

#

local random_edition = poll_edition("modprefix_seed", nil, true, true)
local random_seal = SMODS.poll_seal {key = "modprefix_seed", guaranteed = true}

SMODS.add_card { set = "Playing Card", seal = random_seal, edition = random_edition, enhancement = 'm_lucky' }

#

use this for the card you want

spiral mural
#

how do i randomize where in a altas a spawned card draws from

solid salmon
#

@silver flame put the code i gave in your context and that should do it

#

oh yeah

#

also

#

is there a way to make jokers change their appearance after the right condition

faint leaf
#

i like making really stupid jokers and then i struggle to come up with ideas on what they should do

ocean sinew
faint leaf
#

interesting

#

noted

#

also i did this too this is funny

faint leaf
#

i made it so you can go into infinite debt, but every time you buy something it has a 1 in 6 chance to go extinct

faint leaf
#

that would make it die faster

ocean sinew
#

yeah

faint leaf
#

yeah

remote charm
river grail
#

I doubt this is possible, but I wonder how capable Lua is with image manipulation
I think it'd be extremely helpful if you could build a card just from a few key components, and in-game it'd assemble the card atlas

wind steppe
#

its probably possible

river grail
#

There's probably a library for it

humble pawn
#

Oh boy here we go

river grail
#

I'd take a crack at it, but I'm way too inexperienced to evem research it

#

Bringing this up because for a mod like Sigil, any sort of optimization for making new cards would be wonderful

spiral mural
humble pawn
vale zinc
#

This code never gets called. Can anyone say what I'm doing wrong?

[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "local mod_percent = false"
position = "before"
match_indent = true
payload = '''

--[[
Used by The Altar.
--]]
if (G.GAME.blind.config.blind.key == 'bl_lapsems_altar') and not G.GAME.blind.disabled then
    blind.triggered = true
    print('Blind triggered!')
    if (hand_chips < mult) then
        local amount_to_transfer = math.abs(math.floor((hand_chips * 0.5) + 0.5))
        hand_chips = mod_chips(hand_chips - amount_to_transfer)
        mult = mod_mult(mult + amount_to_transfer)
    else
        local amount_to_transfer = math.abs(math.floor((mult * 0.5) + 0.5))
        hand_chips = mod_chips(hand_chips + amount_to_transfer)
        mult = mod_mult(mult - amount_to_transfer)
    end
    update_hand_text({ sound = 'chips2', modded = true }, { chips = hand_chips, mult = mult })
end

'''
#

I've tested that condition with DebugPlus' eval command and they both evaluate to true when I'm facing The Altar, but the code never gets called!

normal crest
#

so if you go to Mods/lovely/dump/functions/state_events.lua do you see your injected code

faint yacht
humble pawn
#

._.

vale zinc
#

I'm looking at another mod's patch files and I can't identify anything different in structure from my own code.

#

On further inspection, it looks like the desired code wasn't even in the actual target file. My bad!

urban wasp
#

there's some context that's basically on every single game action right?

#

i forget what it is

ionic plaza
daring fern
urban wasp
#

i've done it on accident before which is funny

daring fern
urban wasp
#

it being this

#
    calculate = function(self, card, context)
        if pseudorandom("j_bfs_schro_cat") < 0.5 then
            card.ability.extra.xmult = math.max(1, card.ability.extra.xmult - card.ability.extra.xmult_mod)
        else
            card.ability.extra.xmult = math.max(1, card.ability.extra.xmult + card.ability.extra.xmult_mod)
        end
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult
            }
        end
    end
urban wasp
#

any idea? am i of the stupid?

urban wasp
#

yeah

#

i don't want that

#

i want it kinda like this video from a while back

daring fern
urban wasp
#

that's what i want, yeah

#

i've tried printing; it's just every frame

daring fern
#

There is probably a modded context that is being called every frame.

urban wasp
#

oh it's hpot_destroyed

#

so just if not context.hpot_destroyed i assume

#

or at least for the time being

#

oh my god ignore all this it's not hotpot

#

i'm just stupid and forgot about this context someone else in my team made from earlier

local l_update = Card.update
function Card:update(dt)
    local ret=l_update(self,dt)
    SMODS.calculate_context{
        balatrofusion_update=true,
        updated_card=self,
        balatrofusion_dt=dt,
    }
    return ret
end
#

😭

quasi pike
#

This deck is suposed to revive the player once per run, but it crashes the game if you try to pick it

vale grove
#

Hi everyone, is there a pool for all Consumables thats easy to acces?

daring fern
daring fern
vale grove
# daring fern `G.P_CENTER_POOLS.Consumeables`

Iam trying to make emperor/high priestress but for all consumeables, i took a look at Vanilla remade but they seem to have predefined planets/tarots, can i just change those values to consumeable?

daring fern
vale grove
daring fern
obsidian spear
vale grove
#

while is standing there

#

it shakes while its spawns

#

but i want it to shake if its just standing there

quasi pike
#

how would I make a deck that works like astronomer but for a kind of joker and booster from my mod?

daring fern
toxic cave
tired kestrel
#

I really like how it result is now.

daring fern
# toxic cave i still havent figured it out since yesterday 🥀
for k, v in pairs(G.GAME.BossList or {}) do
    local center, effects = G.P_BLINDS[v], {}
    if context.press_play and center.press_play then center:press_play() end
    if context.debuff_card then local debuff if center.recalc_debuff then debuff = center:recalc_debuff(context.debuff_card, true) elseif center.debuff_card then debuff = center:debuff_card(context.debuff_card, true) end table.insert(effects, {debuff = debuff}) end
    if context.setting_blind and center.set_blind then center:set_blind() end
    if context.debuff_hand and center.debuff_hand then table.insert(effects, {debuff = center:debuff_hand(context.full_hand, context.poker_hands, context.scoring_name, context.check)}) end
    if context.stay_flipped and center.stay_flipped then table.insert(effects, {stay_flipped = center:stay_flipped(context.to_area, context.other_card)}) end
    if center.calculate then local effect = center:calculate({effect = center.config}, context) if effect then table.insert(effects, effect) end end
end
toxic cave
daring fern
toxic cave
#

alright

toxic cave
modest jewel
quasi pike
#

how would I make a deck that works like astronomer but for a kind of joker and booster from my mod?

faint yacht
#

Hook Card:set_cost() and check for G.GAME.selected_back.effect.center.key matching your deck.

toxic cave
faint yacht
#

...I mean, you could.

faint yacht
#

¯_(ツ)_/¯

daring fern
toxic cave
#

well then what do i gotta do then

toxic cave
#

wait i just now noticed you editted it

#

hold on

#

lemme try now

#

well now it doesn't crash and doesn't lag but it also just doesn't persist

daring fern
toxic cave
quasi pike
#

how would make a boss debuff every card except face cards?

faint yacht
#

Use the recalc_debuff function of SMODS.Blind.

tired kestrel
#

How do I lovelypatch a card area?

umbral spire
#

this'll work right? I'm just trying to make a re-usable function because i seem to use this a lot.

    local indices = {}
    local function tbl_contains(tbl, itm)
        for k,v in ipairs(tbl) do 
            if itm == v then 
                return true 
            end
        end 
        return false
    end
    local function pick_unique(seed, pool, taken)
        local out
        repeat
            out = pool[pseudorandom(seed, 1, #pool)]
        until not tbl_contains(taken, out)
        return out
    end
    local function range(start, finish, stop)
        step = step or 1
        local t = {}
        for i = start, finish, step do
            table.insert(t, i)
        end
        return t
    end     
    if not set then
        for i=1, n do 
            local c = 0
            local function choose()
                c = pseudorandom(seed, 1, #area)

                if tbl_contains(indices, c) then 
                    c = pick_unique(seed, range(#area), indices)
                end
            end 
            choose()
            table.insert(indices, c)
        end 
    else 
        local valid_indices = {}
        for k, v in ipairs(area) do
            if v.ability.set == set then 
                table.insert(valid_indices, k)
            end
        end
        for i=1, n do 
            local pick = 0

            local function choose()
                pick = valid_indices[pseudorandom(seed, 1, #valid_indices)]
                if tbl_contains(indices, pick) then
                    pick = pick_unique(seed, valid_indices, indices)
                end
            end

            choose()
            table.insert(indices, pick)
        end
    end 
    return indices