#💻・modding-dev

1 messages · Page 618 of 1

slim ferry
#

hello

#

SMODS.current_mod.calculate

#

= function(self, context)

dense fulcrum
#

does that have to be a hook, or is it as simple as you're writing it?

pale holly
#

bump

slim ferry
daring fern
pale holly
#

I'm not sure how i could access it since my game crash imediatly without any usual error screen

slim ferry
#

lovely/log in mods folder

pale holly
daring fern
# pale holly
if context.modify_ante and context.ante_end and G.GAME.round_resets.ante >= G.GAME.win_ante then
    return {modify = (G.GAME.win_ante-1)-G.GAME.round_resets.ante}
end
pale holly
#

alright thanks

#

Thanks it works properly

dense fulcrum
slim ferry
#

yeah because

#

context.main_scoring only calculates for playing cards that have been scored

dense fulcrum
#

im having a hard time figuring out which context im meant to be using then

#

@slim ferry forgot to ping reply

slim ferry
#

individual?

dense fulcrum
slim ferry
#

context.individual

dense fulcrum
#

ah, oki

#

I'll try it :3

#

ty!

heavy hare
#

would anyone know why i would be getting a file not found main.lua error, or a sprite issue indicated from the stack trace? the animated sprite that's being inited has a non-null W and H

#

i haven't changed anything for months and apparently the mod has just stopped working from the flame_handler Moveables in the hand scoring UI

candid acorn
#
        local seal = nil
        local edition = nil
        local enhancement = nil

        for i = 1, math.min(#G.hand.highlighted, self.config.max_highlighted) do
            _card = G.hand.highlighted[i]

            if _card.seal and seal == nil then
                seal = _card.seal
            end
            if _card.edition and edition == nil then
                edition = _card.edition
            end
            if _card.enhancement and enhancement == nil then
                enhancement = _card.enhancement
            end
        end

        for i = 1, math.min(#G.hand.highlighted, self.config.max_highlighted) do
            _card = G.hand.highlighted[1]

            G.E_MANAGER:add_event(Event({func = function()
                _card:set_seal(seal)
                _card:set_edition(edition)
                _card:set_ability(enhancement)
                return true
            end}))
        end
    end```
when i use this consumable, only one card gets the effects, and also for some reason the enhancement part doesnt work. does anyone know why?
daring fern
candid acorn
candid acorn
# daring fern Code?
    key = 'idol',
    set = 'Tarot',
    config = {max_highlighted = 3},

    loc_txt = {
        name = 'Idol',
        text = {
            'Select up to {C:attention}#1#{} cards.',
            'They all gain eachothers {C:blue}Seals{},',
            '{C:attention}Enhancements{}, and {C:attention}Editions{}'
        }
    },
    cost = 3,
    atlas = 'ConsumablesPlus',
    pos = {x=0,y=0},

    loc_vars = function(self , info_queue, card)
        return { vars = { (card.ability or self.config).max_highlighted } }
    end,

    use = function(self, area, copier)
        local seal = nil
        local edition = nil
        local enhancement = nil

        for i = 1, math.min(#G.hand.highlighted, self.config.max_highlighted) do
            _card = G.hand.highlighted[i]

            if _card.get_seal() and seal == nil then
                seal = _card.get_seal()
            end
            if _card.edition and edition == nil then
                edition = _card.edition
            end
            if SMODS.get_enhancements(_card)[1] and enhancement == nil then
                enhancement = SMODS.get_enhancements(_card)[1]
            end
        end

        for i = 1, math.min(#G.hand.highlighted, self.config.max_highlighted) do
            _card = G.hand.highlighted[1]

            G.E_MANAGER:add_event(Event({func = function()
                _card:set_seal(seal)
                _card:set_edition(edition)
                _card:set_ability(enhancement)
                return true
            end}))
        end
    end
}```
daring fern
candid acorn
#

in the if?

#

or when i try to set it

daring fern
candid acorn
#

Ooooo

#

I didn't see sorry

#

still idk why only one card gets the effects

long sun
#

how do i modify probabilities with a Joker?

daring fern
long sun
#

i'd like its modifier to be assessed in before, and removed in after

daring fern
long sun
#

what are its returns?

daring fern
long sun
#

👍

pale holly
#
for i = 1, #G.deck.cards do
if context.joker_main then
if G.deck.cards[i]:is_suit("Hearts") then
SMODS.destroy_cards(card, nil, nil, true)
        return {
            message = "Adieu !"}
            end
            end
            end

i'm close to get but trying to make the joker destroy all heart cards in the deck, rn just messed and made itself vanish instead lol
help would be appreciate thanks

daring fern
pale holly
#

thanks again

vale zinc
#

How do I get variables from config = {} to show up within the in_pool() specification?

slim ferry
#

self.config?

vale zinc
#

That did the trick.

#

Does context.card.ability.consumeable really determine whether or not a certain card is a consumable? I have a SMODS.curent_mod.calculate() function that goes off of if context.selling_card and context.card.ability.consumeable, but it apparently doesn't activate.

vale zinc
# daring fern Yes.

And does context.consumeable.config.center.key specify the name of the consumable card being sold?

vast night
#

bumping again

vale zinc
# vast night bumping again

I looked in Crimson Heart's code for guidance, and it uses <id_used_for_joker>.ability.crimson_heart_chosen to debuff a Joker.

vale zinc
daring fern
spare elk
daring fern
# spare elk
banned_cards = function()
    local banned = {}
    for k, v in pairs(G.P_CENTERS) do
        if v.set == 'Voucher' then
            banned[#banned+1] = {id = v.key}
        end
    end
    return banned
end
shell timber
#

wouldnt that still generate blanks

daring fern
hushed field
#

Yeah defaults cannot be banned

slim ferry
#

i mean even then

#

blank does nothing

#

though its probably more efficient to just set voucher slots to 0

spare elk
#

oh i didnt know you could change voucher slots, that sounds like what i need

vast night
candid acorn
daring fern
candid acorn
#

so how can i make it work?

daring fern
candid acorn
#

yes but then it will always be the first one as you said?

candid acorn
#

ok?

#

ok it works now thx

prisma loom
#

what is to_big and why it is nil?

#

and how to fix that

sour garden
#

to_big is a thing that the talisman mod uses

#

the way talisman stores numbers is by converting them to tables

#

generally a lot of functions are incompatible with them, but if you're not specifically working with talisman, then you can define these somewhere in your code and it should(?) work

local to_big = to_big or function(num)
  return num
end
local to_number = to_number or function(num)
  return num
end
prisma loom
#

it scored = or > the required chips

daring fern
prisma loom
#

okak

#

ic

vale zinc
#

Anything that I put in SMODS.current_mod.calculate() doesn't execute. What do I do?

prisma loom
#

Is it inherently incorrect?

slim ferry
# prisma loom

you probably want to be checking context.end_of_round and context.main_eval

#

instead of checking blind requirement

#

and joker main

vale zinc
# daring fern Code?

Within my utility/functions.lua file there is:

SMODS.current_mod.calculate = function(self, context)
    -- My code is in here
end
vale zinc
#

Yes, of course! And I was told that SMODS.current_mod.calculate was like an invisible Joker card that's always being held no matter what.
Also, everything else in the file works without a hitch.

prisma loom
slim ferry
#

yeah

#

thats probably easier

prisma loom
#

thanks!

vale zinc
sour garden
#

i have a deck that's supposed to unlock when you have gold stake stickers on 10 or more jokers. i might've implemented this wrong, but i'm not sure what i've done wrong

  check_for_unlock = function(self, args)
      if G.P_CENTER_POOLS["joker"] then
        local count = 0
        for k, v in pairs(G.P_CENTER_POOLS["joker"]) do
          if get_joker_win_sticker(v.config.center) >= 10 then
            count = count + 1
          end
        end
        if count >= 10 then
          unlock_card(self)
        end
      end
    end,
sour garden
wraith jolt
#

Those anyone know if the moder behind Jokers Evolve still active?

daring fern
wraith jolt
vale zinc
normal crest
#

Where are you putting that code

vale zinc
# normal crest Where are you putting that code

At the very end of my utility/functions.lua file, which has a bunch of useful functions such as checking if a table contains a specified value, determining whether or not a played hand contains a certain rank, and so on.

broken rivet
#

how would i get these tags to show description boxes when hovered?

normal crest
slim ferry
vale zinc
# slim ferry what is the code inside of the function?

It's meant to keep a table of every consumable card that's been sold in the run.

SMODS.current_mod.calculate = function(self, context)
    G.GAME.LAPSEMS_consumables_sold = G.GAME.LAPSEMS_consumables_sold or {}
    if context.selling_card and context.card.ability.consumeable then
        if not (LAPSEMS.contains(G.GAME.LAPSEMS_consumables_sold, context.card.config.center.key)) then
            G.GAME.LAPSEMS_consumables_sold[#G.GAME.LAPSEMS_consumables_sold + 1] = context.card.config.center.key
        end
    end
end
slim ferry
#

have you tried putting prints at different parts to see where it goes wrong?

vale zinc
slim ferry
#

it should show up in the debugplus console

#

just make sure to turn off "Only show commands" in the debugplus config

dapper sun
#

how do i make destroying cards outside of a calculate function do the context stuff like context.remove_playing_cards

slim ferry
#

either use SMODS.destroy_cards (calculates the context automatically) or use SMODS.calculate_context to manually do it

dapper sun
#

ty

#

it works yippee

vale zinc
slim ferry
#

do any of the other functions in the same file load?

slim ferry
#

do you return anywhere outside of a function in the file?

daring fern
normal crest
#

replace modid with your actual mod id

daring fern
daring fern
vale zinc
normal crest
#

that means the function exists, so it should be getting called

normal crest
#

are you in the main menu tho

#

you should start a run

vale zinc
normal crest
#

try selecting the blind

vale zinc
#

Still nil.

#

It's nil even after I've beaten the Small Blind.

#

And even after I've beaten the first Ante, nothing changes.

normal crest
#

okay idk, try eval SMODS.Mods.Lapsems:calculate({})

vale zinc
#

Since there's the code to initialize the table if it doesn't already exist, I should se something like this:

vale zinc
normal crest
#

the message you have in your function

vale zinc
normal crest
#

Are you defining the function twice in your code or something?

vale zinc
#

No, I've only defined it once!

mystic river
#

you didn't type this and not save your changes, right?
I've done that a non zero amount of times

vale zinc
#

Nope, I've saved it all.

normal crest
#

cus I can't think of any other reason if you have it saved

daring fern
vale zinc
normal crest
#

removing that one should fix it then

vale zinc
#

I've done just that, and I've got it sorted out!

#

Now it's telling me that cards_to_select is a nil value!

    --[[
    Code adapted from The Emperor.
    --]]
    use = function(self, card, area, copier)
        local cards_to_select = G.GAME.LAPSEMS_consumables_sold
        for i = 1, math.min(card.ability.max_cards, G.consumeables.config.card_limit - #G.consumeables.cards) do
            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 = table.remove(cards_to_select, math.random(1, #cards_to_select))})
                        print('Card taken from cards_to_select!')
                        card:juice_up(0.3, 0.5)
                    end
                    return true
                end
            }))
        end
        delay(0.6)
        cards_to_select = nil
    end
normal crest
#

remove cards_to_select = nil

#

the events happen after the code runs

vale zinc
#

Wouldn't that leave cards_to_select's value floating around in memory?

daring fern
normal crest
#

^ after there are no more references to it, in this case after the events run

#

actually, not even, since cards_to_select is by itself a reference to consumables_sold

slim ferry
#

its a local variable anyway

normal crest
#

well anyway, you don't need to do = nil for this

vale zinc
#

Using The Prisoner takes cards out of the G.GAME.LAPSEMS_consumables_sold pool, which I wanted to avoid by stuffing them in a cards_to_select table. What do I do?

slim ferry
#

dont use table.remove

normal crest
#

cus cards_to_select isn't a copy of the table, it's just a reference to the same one

slim ferry
#

doing x = <table> makes x reference the same table, rather than copying over the values

normal crest
#

you can use balatro's copy_table function to make a copy if you want

#

local cards_to_select = copy_table(G.GAME.blah blah blah)

#

also you probably wanna use pseudorandom instead of math.random so your random number stuff is seeded

obtuse silo
#

?

daring fern
#

You need to iterate over context.full_hand

jovial wave
#

quick question how would I go about setting the upcoming boss blind to a specific one?

daring fern
jovial wave
mystic river
#

if you're doing it before the ante in question, G.GAME.perscribed_bosses[ante number] = "bl_modprefix_key"

orchid thunder
#

i forgot can i just debuff a voucher or do i have to code that in

daring fern
orchid thunder
#

like the way a bossblind might do cards

daring fern
bleak shore
#

hi everybody , can someone explain to me why it didn't work ? i think i don't realy understand what context.card do

when i play a card the game crash and tell me that the context.card is nil

mystic river
#

you want context.other_card

bleak shore
# daring fern What is the goal?

when you discard my joker flip and then when you play a card the value of the card stack on the joker , when the face of the joker is front and you play a card it add all of the chip he have and reset to 0

#

so i need to get the value of the card i played when he is face down

mystic river
#

context.card only exists in a small handful of contexts; in this case you want context.other_card

bleak shore
#

okay thank you !

daring fern
brave blade
#

Does anyone know what the animation speed on the blind chips is?

vale zinc
#

Is there any functional difference between these two statements?

table[#table + 1] = element
table.insert(table, element)
rocky plaza
#

no

#

not really

slim ferry
#

table.insert is slower

#

in terms of performance

#

i dont think the difference is that big tho

vast night
#

im confused

slim ferry
#

well table.insert is meant to insert values into the middle of number-indexed tables and shift over all elements appropriately

#

so it like does a bunch of extra checks for that

#

if youre adding to the end itll still do all those checks but just do nothing

#

or well itll do more stuff than the table[#table+1] thing

vast night
novel violet
#

hey gang - I'm wanting to create a new type of "tag" that will ideally in the future be distinct from the ingame tags, but right now i'm just using SMODS.Tag for proof-of-concept's sake
what would be a good way to make a tag do something when cards are scored? right now i have it to where a custom tag gets consumed after the scoring hand is played, but i can't really think of a great way to access the scoring hand let alone add mult from the SMODS.Tag apply function, so I imagine it'd have to be another way, and I'm not sure where to go from there ;P

red flower
#

indexing table is also another operation

slim ferry
vast night
red flower
#

in reality it doesn't matter

slim ferry
novel violet
#

:O

#

haven't heard of that! thank you, i'll look into that

vast night
slim ferry
#

well the calculate stuff is probably elsewhere

#

but idk where that is

slim ferry
vast night
#

while we're at new card types: I'm in search of having a function to be able to create a ui card element (not a new class/type) so i can have it be able to render a background, a sprite + a soul sprite from an atlas and convert it to an ui element. does anything like that already exist?

slim ferry
#

also basically anything referencing providence can usually be ignored since thats related to a voucher

obtuse silo
#

isn't there a way to upgrade a hand by more than one level in one fell swoop?

slim ferry
#

yeah

#

amount parameter in the level up function

normal crest
#

how would it be faster

wind steppe
#

im inclined to trust eris with an explanation more than somethingcom "let me react when i dont know something instead of just saying that" 515

normal crest
#

and they deleted it

#

rip

#

put the table in a local variable?

obsidian spear
#

sorry for the extremely late ping, but what does it do and how does it work

vast night
#

oh hi paradox :)

normal crest
#

I'd think the biggest slowdown is the actual function call itself not the indexing of table, so while that would make it faster I doubt it's faster than getting the length and adding one

#

i guess you could test it by trying to insert like 10 million elements

#

and see what's faster

slim ferry
wind steppe
unkempt bronze
#

Bit of confusion: yahimod doesn't seem to have a file like the 'load the mod's files' file like my mod has. Considering how much of my boss code is ripped from that, do I load both files at once along with everything or do I wait until the boss is called?

wind steppe
#

the file loading code is at the bottom of core.lua btw

hardy vessel
#

Made an effect that swaps the sprite of joker, but it doesn't save on a reload, so I'm trying to make sure it does. However, I keep getting an error on a reload... extra is apparently nil.

load = function(self, card, card_table, other_card)
        local atlas_x = 0
        if card.ability.extra.flip == 0 then
            card.ability.extra.flip = 1
            atlas_x = 1
        else
            card.ability.extra.flip = 0
            atlas_x = 0
        end
        card.children.center:set_sprite_pos({x = atlas_x, y = self.pos.y})
    end
daring fern
hardy vessel
#

Okay, what would be the best way to save values to get the sprite I want?

unkempt bronze
#
    key = "corporate_entity_overlord",
    path = "1472583690.png",
    px = 128,
    py = 128
}

SMODS.Blind {
    name = "boss_quiz",
    key = "boss_quiz",
    atlas = "corporate_entity_overlord",
    pos = { y = 0 },
    dollars = 7,
    mult = 2,
    boss = { min = 1 },
    loc_txt = {
        name = "The Splapp",
        text = {
            "Answer an impossible question",
        }
    },

    boss_colour = HEX('cd93e12'),

    recalc_debuff = function(self)
        quizLoad()
    end,

    defeat = function(self)
        endDino()
    end,

    disable = function(self)
        endDino()
    end,
}```
Code
daring fern
unkempt bronze
#

anything else?

daring fern
unkempt bronze
daring fern
unkempt bronze
#

ah. so change SMODS.atlas to SMODS.atlas_table too?

unkempt bronze
daring fern
unkempt bronze
#

Is it just a number?

hardy vessel
daring fern
unkempt bronze
#

So I could just set it to 1?

daring fern
unkempt bronze
#

I just want it to work right now, not be flashy and shiny

unkempt bronze
# daring fern Yes, if you don't want your blind to have the shine.
    key = "corporate_entity_overlord",
    path = "1472583690.png",
    frames = 1,
    px = 128,
    py = 128
}

SMODS.Blind {
    name = "boss_quiz",
    key = "boss_quiz",
    atlas = "corporate_entity_overlord",
    atlas_table = 'ANIMATION_ATLAS',
    pos = { y = 0 },
    dollars = 7,
    mult = 2,
    boss = { min = 1 },
    loc_txt = {
        name = "The Splapp",
        text = {
            "Answer an impossible question",
        }
    },

    boss_colour = HEX('cd9e12'),

    recalc_debuff = function(self)
        quizLoad()
    end
}```
Something(com515) like this?
unkempt bronze
final valley
solid salmon
#

GUYS

#

MY CHALLENGE JOKER kinda doesnt work

unkempt bronze
#

Start from the top, what's the intention of it and waht's the code?

solid salmon
#

it just wont generate needle joker

daring fern
daring fern
solid salmon
#

then

#

how do i prevent them from being in shops and being created from jud

daring fern
#

Also it would be not args or (args.source ~= 'jud' and args.source ~= 'sho')

sharp arch
#
        if not blind.disabled then
            if context.press_play then
               G.GAME.blind.chips = math.floor(G.GAME.blind.chips + G.GAME.blind.chips * 0.25)
                            G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
                blind.triggered = true 
                G.E_MANAGER:add_event(Event({
                    trigger = 'immediate',
                    func = (function()
                        SMODS.juice_up_blind()
                        G.E_MANAGER:add_event(Event({
                            trigger = 'after',
                            delay = 0.06 * G.SETTINGS.GAMESPEED,
                            blockable = false,
                            blocking = false,
                            func = function()
                                play_sound('tarot2', 0.76, 0.4)
                                return true
                            end
                        }))
                        play_sound('tarot2', 1, 0.4)
                        return true
                    end)
                }))
                delay(0.4)
            end
        end``` I need help trying to figure out how to get a card's enhancement when played, specifically to increase blind requirments per one found
#

this si just a placeholder

sweet nimbus
#

Did you find a solution to this? I'm having the same problem

daring fern
sharp arch
#
        if context.round_eval and G.GAME.last_blind then
            G.E_MANAGER:add_event(Event({
                func = function()
                    add_tag(Tag('jabong_tag_luchatag'))
                    play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
                    play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
                    return true
                end
            }))
        end
    end,``` this is good code if i want to make a tag after every blind defeated
daring fern
stuck ore
#

So yes I did find a way to make it work, basically I had the joker set a local variable as 1 then change when hand was played to be the same a G.GAME.dollars because G.GAME.dollars can't be updated mid hand which is what I wanted (Btw the reason why I have it set as / 3 is because I didn't want to adjust my numbers while still having X1.5 work):
if context.individual and context.cardarea == G.play and not context.repetition then if card.ability.extra.current_dollars == 1 then card.ability.extra.current_dollars = G.GAME.dollars / 3 end
Then in the function to trigger and give money I had it multiply the local variable that is G.GAME.dollars by my multiplier (1.5) you could also just do it or (0.5):
if context.other_card:is_suit("Diamonds") then card.ability.extra.current_dollars = card.ability.extra.current_dollars * 1.5 card.ability.extra.current_dollars = math.floor(card.ability.extra.current_dollars * 10) / 10 end if context.other_card:is_suit("Diamonds") and context.other_card:is_suit("Spades") then card:juice_up(1,0.5) return { card:juice_up(1,0.5), message = "X1.5", colour = G.C.MONEY, extra = { ease_dollars(card.ability.extra.dollars * card.ability.extra.current_dollars), extra = { xchips = card.ability.extra.xchips } } }

#

Also the xchips is because this specific trigger is for a wild card that trigger two different effects, one spades and one diamonds

stuck ore
daring fern
#

Also you should be returning dollars.

stuck ore
#

idk when I tried it was finicky

daring fern
#

Also you can just use G.GAME.dollar_buffer

stuck ore
#

I've used various different forms of returning dollars in the mod I"m working on this is just what I know works for this and I didn't wanna give false information, I just know this works because this is what I made

daring fern
stuck ore
#

???

daring fern
stuck ore
#

other returns work though

daring fern
stuck ore
#

like ease_dollars or dollars.card.extra.dollars, sorry for the slow response im eating tacos

daring fern
stuck ore
#

Lemme try

#

Fair enough something isn't working right I'll look into that, also for anybody looking into this the logic of how the money scales works I'm just an idiot on making the return work

#

I understand my flaw in the logic, basically because I have used ease_dollars in various things that timing isn't important in, that when I applied it to the triggers since it doesn't use the same return (G.GAME.dollar_buffer) it doesn't interact correctly with other things that make money, thanks for letting me know

dapper sun
#

does anyone know who the high contrast version of my custom FoJ face cards aren't using the high contrast number cards?

unkempt bronze
#

Okay, the boss is up, but the buttons aren't.

#
  G.splapp_config = G.splapp_config or {}
  local disbuff = function()
      if G.GAME.blind == splapp then
        G.GAME.blind:disable()
    end
  G.FUNCS.DT_lose_game = function() 
    if G.STAGE == G.STAGES.RUN then 
        G.STATE = G.STATES.GAME_OVER; G.STATE_COMPLETE = false 
    end 
end

 local t = {n=G.UIT.ROOT, config = {align = 'cm', r = 0.1}, nodes={
      UIBox_dyn_container({
      {n=G.UIT.R, config={align = "cm", padding = 0.05}, nodes={
        {n=G.UIT.R, config={align = "cm", padding = 0.05}, nodes={
          {n=G.UIT.T, config={text = "HOW MANY HOLES IN A POLO?", scale = 0.25, colour = G.C.WHITE, shadow = true}}
        }},
       {n=G.UIT.R, config={align = "cm", padding = 0.15}, nodes={
        {n=G.UIT.C, config={align = "cm", padding = 0.15}, nodes={
          UIBox_button{ label = {"One"}, button = "DT_lose_game", minw = 1.7, minh = 0.4, scale = 0.35},
          UIBox_button{ label = {"Two"}, button = "DT_lose_game", minw = 1.7, minh = 0.4, scale = 0.35},
        }},
        {n=G.UIT.C, config={align = "cm", padding = 0.15}, nodes={
          UIBox_button{ label = {"Three"}, button = "DT_lose_game", minw = 1.7, minh = 0.4, scale = 0.35},
          UIBox_button{ label = {"Four"}, button = disbuff, minw = 1.7, minh = 0.4, scale = 0.35},
        }}
          }},
      }}
    }, true)
  }}
  return t
end
end```
Could be because I'm missing a few things at the top, but I don't know what is
chrome widget
dapper sun
#

oh

chrome widget
#

alternatively, set hc_default = true

dapper sun
#

thanks

chrome widget
#

which on a given palette will use default hc cards for unchanged cards if you don't specify them in the atla

thorn pumice
dapper sun
#

little faces?

thorn pumice
dapper sun
#

ah

thorn pumice
#

i am entirely forgetting the term for it

dapper sun
#

they'll be in my mod once i update it

thorn pumice
#

what mod where to get

#

🥹

dapper sun
#

but i'm also respriting the left one

thorn pumice
#

they’re so cuteee

dapper sun
thorn pumice
#

hooray

dapper sun
#

here's her current joker art for reference

thorn pumice
dapper sun
#

tyyy

keen widget
#

thoughts?

charred widget
daring fern
charred widget
daring fern
rigid pebble
keen widget
#

:P

#

common because i need the player to actually find it

rigid pebble
#

well developing is a strong word

keen widget
#

do not hate on my proficient use of the forge of jokers

rigid pebble
keen widget
#

this is what we in the indestry call "Shits and giggles"

novel violet
#

hey gang, I made a mechanism using SMODS.current_mod.calculate to apply +5 Mult to context.other_card when a certain tag is present & then juice it up -- just a prototype for a feature that'll probably eventually be distinct from tags! however i've deduced that it is very specifically SMODS.calculate_effect that causes the deck to juice up in a very strange way for some reason? i'm not sure if it's because it thinks other_card is the deck yet somehow applies +Mult to the scoring card directly or if it's both?? lmaoooo either way how do i get the deck to stop doing that without a card argument from the calculate func? :3c

    if context.individual and context.cardarea == G.play then
        for i = 1, #G.GAME.tags do
            if G.GAME.tags[i].key == "tag_spm_fireburst" then
                G.E_MANAGER:add_event(Event({
                    func = (function()
                        G.GAME.tags[i]:juice_up()
                        return true
                    end)
                }))
                SMODS.calculate_effect({mult = 5}, context.other_card)
                return true
            end
        end
    end
#

oh volume warning potentially

#

also i have no idea why it's scoring before the chips, but like, i don't super hate it OMEGALUL i am curious if there's a way to queue it after chips and before other scoring mechanisms like editions and enhancements, though

urban wasp
keen widget
#

what for good sir?

urban wasp
#

BOY OH BOY I SURE DO LOVE ^1.5 MULT ON A COMMON JOKER 💔

daring fern
# novel violet oh volume warning potentially
if context.individual and context.cardarea == G.play then
    local effects = {}
    for k, v in pairs(G.GAME.tags) do
        if v.key == "tag_spm_fireburst" then
            table.insert(effects, {mult = 5, message_card = context.other_card, juice_card = v})
        end
    end
    return SMODS.merge_effects(effects)
end
keen widget
novel violet
#

yah i was about to say, return wouldn't quite work iirc but i didn't even think of table.insert(effects, ...)

#

tysm

#

i'll try that rn

#

beautiful, it works! :D

versed swan
#

<@&1133519078540185692>

daring fern
#

reef belfry
#

first time working with labels, how do you change its color 😭

reef belfry
#

under the localization?

daring fern
reef belfry
#

ohhh tnx ✌️

#

what if it was on a joker though

#

like a sub catgory

#

is it just the same?

daring fern
reef belfry
#

how does one make those then (i.e the sticker stuff without actually having a sticker)

reef belfry
#

tnxx

gaunt folio
#

ngl kinda proud of this concept what do yall think

keen widget
#

can anyone who understands lua tell me why my game crashed please?

hybrid iris
#

im at my fucking wits end so im coming here for help

#

does anyone here know how quantum ranks work 😭

#

im doing something Very similar but simpler

#

and there's this one last bit of code that refuses to work

daring fern
hybrid iris
#

so, it's quantum suits in a sense?

#

well, okay ddjkfhsdfkjhsdf

daring fern
hybrid iris
#

nonono

#

its like, suits are used as their own rank

#

for specifically x of a kinds

daring fern
hybrid iris
#

no but like 😭

#

its its own separate thing

#

i guess

mystic river
hybrid iris
#

im, not asking how to use them, moreso just,, the theory behind them?

daring fern
mystic river
#

the theory is that they let a card have additional ranks

hybrid iris
#

the theory as in, math and code theory

#

like.
gosh this is hard to explain

wind steppe
#

the theory is that theres a function like is_suit

#

but for ranks

#

the issue is its hard as fuck to do straight detection with

hybrid iris
#

yeahhh fair

wind steppe
#

its literally just quantum suits and quantum enhancements and straights are the only thing in the way

hybrid iris
#

oooh

wind steppe
#

what if they were gay and they were pairs instaed

hybrid iris
#

okay thats good, maybe ill just look into how the branch worked

mystic river
hybrid iris
#

cause im just figuring out how quantum pairs works

mystic river
#

no, because those are jokers, not playing cards

hybrid iris
#

for my own specific non-rank and non-suit thing

daring fern
hybrid iris
#

im making my own game overhaul

#

where colors count as ranks and pairs and

#

its,,, a lot to explain

reef belfry
#

finally did it

#

that was my first time taking on patches

hybrid iris
#

NO BUT LIKE

#

sdkfjhsdfkjh its not either suits or ranks

#

its colors

#

😭

daring fern
hybrid iris
#

basically a custom hand system that allows for quantum colors and ranks for pairs thatu ses an entirely different algorithm from base game

#

yes its a lot and yes its probably not worth it

hybrid iris
#

yes

#

that is what im doing

#

and in fact

#

what im asking for help with

#

Because im trying to figure out how quantum ranks work on a Code Level

timid parrot
# reef belfry finally did it

I think -$5 in yellow text is the proper formatting but otherwise interesting card. Tho I wonder if a constant tax (say, $2) would be better. I suppose it's just feel and playtesting

hybrid iris
#

SO instead im just going to look there

#

later

daring fern
reef belfry
timid parrot
#

ah

reef belfry
#

I havent made any jokers for this yet

vale zinc
#

Within get_blind_amount(), how do I tell if the blind in question is a Boss Blind?

mystic river
#

you don't
it's getting the base amount for the ante

hybrid iris
daring fern
hybrid iris
#

you arent great for conversation huh

daring fern
#

plucky berry
#

does anyone know why negative mult is not showing up in the ui with this code? still functions it just shows up blank

#

this is what i'm tryna do

plucky berry
#

this should be -something x -something

daring fern
plucky berry
candid acorn
#
            card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain

            return {
                message = 'Upgraded!',
                colour = G.C.MULT,
                card = card
            }

end```
for some reason the game crashes at the first line of this code
daring fern
candid acorn
#

oh

#

bruuuh

#

i was looking at the code for constellation

#

i didint see that

#

the jokers are gruped

#

like there is a bunch of jokers inside of if context.using_consumeable

#

and then they have separate conditions for themselves

#

tysm

surreal mason
#

Yeah, the update's ass lmao

tall wharf
#

me when i decide to reply to someone exactly 3 months later for some reason

dapper sun
#

dphb moment

sonic cedar
#

good afternoon

daring fern
# sonic cedar
local oldunlockcard = unlock_card
function unlock_card(card)
    local g = oldunlockcard(card)
    if card.key == 'j_modprefix_key' then discover_card(card) end
    return g
end
sonic cedar
#

there he is 🗣️

#

my goat stays winning

#

-# standing_bowing_lady standing_bowing_lady standing_bowing_lady standing_bowing_lady standing_bowing_lady

foggy ginkgo
#

Yatta

unkempt thicket
#

<@&1133519078540185692>

neat plover
#

how do i check if a joker is on the left of the current one

daring fern
neat plover
daring fern
neat plover
#

okay thanks!

abstract oasis
#

Hi ! I'm new to modding and I'm struggling with the ability part of jokers. Could someone help ?

slim ferry
#

state your issue to start

neat plover
#

someone know how to get sell value i forgor

abstract oasis
#

yes sorry

daring fern
neat plover
neat plover
neat plover
slim ferry
#

replace otherjoker with another card object

abstract oasis
#

I'm just trying to make an xmult joker but when I try to have access to anything in "card.ability.extra", it crash my game with the error "attempt to index field 'extra' (a nill vallue)"

slim ferry
#

what does the card config look like

abstract oasis
#
SMODS.Joker {
  key = 'joker2',
  loc_txt = {
    name = 'Joker 2',
    text = {
      "{X:mult,C:white}x#1# {} Mult #2#"
    }
  },
  config = { extra = {Xmult = 10.0, oui = 1} },
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.Xmult, card.ability.extra.oui } }
  end,
  ...```
slim ferry
#

you likely dont have the values stored inside an extra

#

oh

daring fern
abstract oasis
#

yes but I think it's supposed to be

abstract oasis
neat plover
#

but like, i wanna get the sell value of the joker to the left of this one

abstract oasis
#

that's might be that

daring fern
neat plover
#

thanks!

abstract oasis
#

How can I place a Joker in my deck by default for testing ?

abstract oasis
#

thanks

neat plover
#

@daring fern for some reason, the code you provided seems to not be working

#

its detecting an error on the second line of the code

#

wait

#

this one: sell_cost = G.jokers.cards[k-1].sell_cost

normal crest
#

try if v == card and k > 1

neat plover
#

😄 it worked

#

thank

daring fern
#

dapper sun
#

how do i check if my joker is being held in the joker tray thingy

slim ferry
#

if card.area == G.jokers?

dapper sun
#

oh ty

#

<- stupid

mossy anchor
#

my lovely patch appears to be not even loading at all

#

im trying to patch another mod and ive tried putting it in lovely folder in my mod and even lovely.toml

#

i see no logs about my patch

bold sleet
#

Is there a way to do this but with the card:shatter effect instead of the default one?

bold sleet
#

idk, my lovely patches didn't work because the code I was trying to patch was already being patched by something else before.

red flower
bold sleet
#

ah

mossy anchor
sharp arch
#

how would i have a blind check for enhenaced cards on press play?

faint yacht
bold sleet
#
if context.before then
  local found = false
  for _,v in ipairs(G.hand.cards) do
    if v.config.center.key ~= 'c_base' then found = true end
  end
  if found then
    -- Your logic here
  end
end

That's my best guess. I have never coded a blind in my life, so the context might be wrong.

mossy anchor
# daring fern Code?
[manifest]
version = "1.0.0"
dump_lua = true
priority = 1

[[patches]]
[patches.pattern]
target = '=[SMODS Yggdrasil "code/loot_system.lua"]'
pattern = '''
    {
        card_key = "j_misprint",
        recipe = {
            {"cs", "cs", "cs"},
            {"cs", "me", "cs"},
            {"cs", "cs", "cs"},
        },
        config = {
            amount = 1,
            immediate_emplace = true,
            specific_area = "jokers"
        }
    },
'''
position = 'after'
payload = '''
    {
        card_key = "ygg_mat_ygg_soul_fragment",
        recipe = {
            {"goi", "goi", "ast_h"},
            {"cs", "cs", "cs"},
            {"cs", "cs", "cs"},
        },
        config = {
            amount = 1,
            unique = true
        }
    },
'''
match_indent = true
bold sleet
faint yacht
sharp arch
#

thanks

bold sleet
#

Not sure it will work, but it's worth the shot

bold sleet
#

god fuckign dammit

daring fern
#

Also it's not next(SMODS.get_enhancements(v))

bold sleet
#

ty

#

<@&1133519078540185692>

bold sleet
#

(discounting the missing parenthesis)

daring fern
bold sleet
#

hold on

#

fix 33

daring fern
bold sleet
#

shrug

daring fern
mossy anchor
#

oh

sharp arch
#
        if not blind.disabled then
                if context.before then
                    local found = false
                        for _,v in ipairs(G.hand.cards) do
                         if not next(SMODS.get_enhancements(v)) then found = true end
                                end
                            if found then
                          G.GAME.blind.chips = math.floor(G.GAME.blind.chips + G.GAME.blind.chips * 0.25)
                            G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
                             end
                end
             
                blind.triggered = true 
                G.E_MANAGER:add_event(Event({
                    trigger = 'immediate',
                    func = (function()
                        SMODS.juice_up_blind()
                        G.E_MANAGER:add_event(Event({
                            trigger = 'after',
                            delay = 0.06 * G.SETTINGS.GAMESPEED,
                            blockable = false,
                            blocking = false,
                            func = function()
                                play_sound('tarot2', 0.76, 0.4)
                                return true
                            end
                        }))
                        play_sound('tarot2', 1, 0.4)
                        return true
                    end)
                }))
                delay(0.4)
            end
 end,
   
}``` ok now my blind is triggering per animation HELP
daring fern
sharp arch
daring fern
sharp arch
#
        if not blind.disabled then
                    if context.before then
                    local found = false
                        for _,v in ipairs(G.hand.cards) do
                         if not next(SMODS.get_enhancements(v)) then found = true end
                                end
                            if found then
                          G.GAME.blind.chips = math.floor(G.GAME.blind.chips + G.GAME.blind.chips * 0.25)
                            G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
                              blind.triggered = true 
                G.E_MANAGER:add_event(Event({
                    trigger = 'immediate',
                    func = (function()
                        SMODS.juice_up_blind()
                        G.E_MANAGER:add_event(Event({
                            trigger = 'after',
                            delay = 0.06 * G.SETTINGS.GAMESPEED,
                            blockable = false,
                            blocking = false,
                            func = function()
                                play_sound('tarot2', 0.76, 0.4)
                                return true
                            end
                        }))
                        play_sound('tarot2', 1, 0.4)
                        return true
                    end)
                }))
                delay(0.4)
            end
                             end
                        end
             
              
 end,
#

so this is good

daring fern
sharp arch
cursive halo
#

is it possible to have the hand score as a Three of a Kind if a high card is played, and cards turn into 7s?

#

shoot is this the wrong chat for this lol

daring fern
cursive halo
#

works beautifully now

agile gazelle
#

How would you make this compatible with other suits? It's supposed to give +20 mult if all cards held in hand are the same suit

#

like modded suits

frosty rampart
#

just save the first card's suit, and if any other card held in hand doesn't match the first card's suit then it's false. otherwise it's true

dapper sun
#

how do i hook into a joker's calculate function (NOT taking ownership)

#

or should i patch

#

idk

loud summit
#

i think its like

#

you go to the center pools and get the key

#

then hook it the normal way?

dapper sun
#

ok

daring fern
loud summit
#

G.P_CENTER_POOLS.Joker[full_key]

daring fern
loud summit
#

? whats the diff

daring fern
loud summit
#

oh

dapper sun
#

how do i change a joker's atlas position?

loud summit
#

update pos ig

dapper sun
#

i've only done it for the center before but i wanna do it for specific cards

daring fern
loud summit
#

i think youd need a custom draw step

dapper sun
#

ty

loud summit
#

oh

blazing helm
#

what would be the best way have blinds have higher rewards in a challenge? im trying to make a challenge that x3 the reward. at the moment im overwriting Blind:set_blind and using blind.dollars = blind.dollars * G.GAME.modifiers.blind_reward_mult but this is very buggy and just doesnt work right so i wanna ask if there is a different/better way of doing this?

daring fern
blazing helm
#

patch?

chrome widget
#

Welcome back to another episode of Vivi's insane UI code

dapper sun
daring fern
dapper sun
#

ty

pastel kernel
#

how do you add legendary jokers into the shop

daring fern
rich comet
#

Is there a way by looking at the crash log to figure out which mod or mods causes the crash

frosty rampart
#

if it's not in a lovely patch, then yea it should usually be able to tell you which mod the crash happened in (and the file, and even the line number)
depends on the crash tho, sometimes it's crashing because modded code is sending improper arguments to a vanilla function and that means you might have to dig through the stack trace a bit

#

just post the crash tho, easier to have more eyes on it

rich comet
dapper sun
#

balatro+?

#

you have the fabled balatro plus?

pastel kernel
#

i tried looking for how get_current_pool works in smods

#

in the mod

#

modloader*

rich comet
dapper sun
#

i think you have a different balatro+ to the one i'm thinking of

pastel kernel
#

god, where do they keep the definitions

dapper sun
#

more importantly tho, i have no idea what mod's causing it sorry

daring fern
frosty rampart
rich comet
frosty rampart
dapper sun
#

how would i add smtn to this to a mod config

#

wait i found create_option_cycle(args)

pastel kernel
dapper sun
#

i still dunno where to find documentation on mod config screens tho

tepid crow
#

doesn't smods have a page dedicated to that

dapper sun
#

can't find it

pastel kernel
dapper sun
#

i found the page for ui but not one for mod config

urban wasp
#

isn't there something to instantly win a blind

tepid crow
#

the button in the debugplus tab screen?

pastel kernel
#

and ; i believe

#

i'm struggling just trying to read

urban wasp
dapper sun
#

found out it's bc it's in the The Mod Object page

GitHub

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

tepid crow
#

Ah

#

confusing

dapper sun
#

how do i use create_option_cycle

#

it just says it takes an args table

#

oh i found an example i think

tepid crow
#

see the source code for implementation, and check the source code or other mods for usage

dapper sun
daring fern
pastel kernel
north brook
#

ok guys i feel like im going crazy and it's over something dumb

I'm trying to make a baseball card but for negatives. what would I put for the "context" if to check for negative (currently this is checking for rares)

daring fern
pastel kernel
#

hmm

daring fern
north brook
pastel kernel
dapper sun
#

how do i fix this

dapper sun
#

i've already figured that out dw

daring fern
dapper sun
#

that showed me the w thingy

#

which is exactly the problem i'm having

mystic river
#

yeah that

urban wasp
#

ignore the if true then but why does this not immedaitely end the round when this blind is selected i just took it from debugplus and feel like it should work

set_blind = function(self, reset, silent)
    if true then
        G.FUNCS.DT_win_blind = function()
            G.GAME.chips = G.GAME.blind.chips
            G.STATE = G.STATES.HAND_PLAYED
            G.STATE_COMPLETE = true
            end_round()
        end
    end
end,
daring fern
pastel kernel
urban wasp
#

😭

daring fern
dapper sun
#

how do i get a joker's edition

#

wait i think i've done it before

daring fern
dapper sun
#

ty

urban wasp
pastel kernel
urban wasp
# daring fern Put it in another event.

like literally

    if true then
        G.E_MANAGER:add_event(Event({
            trigger = "after",
            delay = 1,
            func = function()
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 1,
                    func = function()
                        G.GAME.chips = G.GAME.blind.chips
                        G.STATE = G.STATES.HAND_PLAYED
                        G.STATE_COMPLETE = true
                        end_round()
                        return true
                    end
                }))
                return true
            end
        }))
    end
end,
daring fern
# pastel kernel

It needs to be outside of a joker and you're missing 2 inputs.

daring fern
urban wasp
#

for the cards to be drawn back to deck as if the round had actually ended

#

like you enter blind -> any effects that happen at like end of round (e.g. gold cards and stuff) -> draw cards back -> all that

unkempt thicket
urban wasp
unkempt thicket
#

The cards they are the same from High card

urban wasp
#

it's just the very popular high card deck skin

unkempt thicket
#

They are from an anime

urban wasp
#

i just find it funny that you randomly come in here and go "high card deck skin!"

unkempt thicket
#

Cause the anime is cool

pastel kernel
#

took a small break, i got it out of the joker

daring fern
lyric maple
#

how do i make a custom language

pastel kernel
normal crest
urban wasp
#

i want to make it so that if the played poker hand is a flush, cards get upgraded by +50 chips when scored but it just crashes
this is a blind btw

calculate = function(self, blind, context)
    if next(context.poker_hands["Flush"]) then
        if context.individual and context.cardarea == G.play then
            context.other_card.ability.perma_bonus = (context.other_card.ability.perma_bonus or 0) + self.config.chips
            return {
                message = localize("k_upgrade_ex"),
                colour = G.C.CHIPS
            }
        end
    end
end,
red flower
pastel kernel
#

umm

hybrid iris
urban wasp
pastel kernel
reef belfry
#

how does someone go around about removing the shaders on a booster pack object

urban wasp
pastel kernel
#

cause i don't know what i'm doing

daring fern
#

chrome widget
pastel kernel
chrome widget
#

What do you want the rate to be

pastel kernel
chrome widget
#

Then you can replace it with 1/20

pastel kernel
#

poll < 1/20?

urban wasp
#

basically a bump but this is happening when selecting my blind

calculate = function(self, blind, context)
    if next(context.poker_hands["Flush"]) and context.individual and context.cardarea == G.play then
        context.other_card.ability.perma_x_mult = (context.other_card.ability.perma_x_mult or 1) + self.config.xmult
        return {
            message = localize("k_upgrade_ex"),
            colour = G.C.MULT,
        }
    end
end,
#

i want it to upgrade played cards if the played hand is a flush

daring fern
urban wasp
#

is that not exactly what i did?

daring fern
urban wasp
#

THE ORDER MATTERS?!

#

oh my god how did i

#

okay thank you

umbral zodiac
mossy anchor
#

how do i replace .png files in a mod from another mod

#

i want to replace assets/2x/complete_ygg_mat_atlas.png from yggdrasil

#

but im pretty sure lovely patches are only txt

daring fern
mossy anchor
#

how do i do that

mossy anchor
stuck ore
#

func = function() G.E_MANAGER:add_event(Event({ func = (function() SMODS.add_card { set = 'Tarot', } G.GAME.consumeable_buffer = 0 return true end) })) end,
So I've got this for generating a random Tarot but how would I make a specific tarot like Justice

pastel kernel
#

why do you write it like that

stuck ore
#

Idk thats how I got it from someone else

#

Oh if you mean like visually in discord its because I can't remember how to do the cool thing and make it look nice with lua

pastel kernel
pale holly
#
    calculate = function(self, card, context)
    if context.main_scoring and context.cardarea == G.play then
        local new_total = math.floor(G.GAME.dollars * self.config.extra.dollar)
        local gain = new_total - G.GAME.dollars
        ease_dollars(gain, true)
        
        return {
                    message = "x1.25$",
                    colour = G.C.MONEY
                    }
    end
end,

    replace_base_card = true,
    no_rank = true,
    no_suit = false,
    any_suit = true,
    always_scores = false

Trying to make my Enhancement give x1.25 $ of the current money but it wont' work out properly when i play more than one of them (if i play 5 of them it only give x1.25 $ of the current money once and before normally scoring),

mossy anchor
bleak shore
#

is there a way to know if a lucky card is triggered ?

violet oasis
bleak shore
violet oasis
wicked heron
#
       if context.starting_shop then
            for i = 1, #G.GAME.tags do
                if G.GAME.tags[i]:apply_to_run({ type = 'new_blind_choice' }) then break end

            end
        end

This code causes all the booster tags to overlap - is there a way to make each tag wait until the previous tag is resolved?

floral flicker
#

Hello, when I buy my voucher, I always get the same crash. Here is the crash log (message.txt) and my voucher.

SMODS.Voucher{
    key="displayset",
    loc_txt={
        name = "Display Set",
        text = {
            "{C:gold}+#1#{} Booster Pack",
            "in the shop"
        }
    },
    config = {
        extra = { booster_slots = 1 }
    },
    cost = 10,
    loc_vars = function(self, info_queue, center)
        return { vars = { center.ability.extra.booster_slots } }
    end,
    redeem = function(self)
        G.GAME.modifiers.extra_boosters =(G.GAME.modifiers.extra_boosters or 0) + center.ability.extra.booster_slots
        SMODS.add_booster_to_shop()
    end
    
}```
pale holly
floral flicker
pale holly
#

oh yeah happened to me before, usually when copy pasting the function you tend to forget
oh and if center won't work, replace all centers by card (card.ability, (self ,info_queue, card), etc..

pale holly
# stuck ore `` func = function() G.E_MANAG...
SMODS.add_card{ set = 'Tarot', key = 'c_wheel_of_fortune',skip_materialize = false,}```
in this case it's for wheel of fortune, you just need to replace by the key of justice that must be c_justice or smth like that
daring fern
# pale holly bump

return {dollars = (G.GAME.dollars+(G.GAME.dollar_buffer or 0))*(card.ability.extra.dollar-1), dollar_message = {message = 'X'..card.ability.extra.dollar..localize('$'), colour = G.C.MONEY, sound = 'coin3'}}

pale holly
daring fern
pale holly
# daring fern No, it's `card.ability.extra.dollar`
config = { extra = { dollar = 1.25}},
        loc_vars = function(self, info_queue, card)
        return { vars = {card.ability.extra.dollar  } }
    end,

    calculate = function(self, card, context)
    if context.main_scoring and context.cardarea == G.play then

return {dollars = (G.GAME.dollars+G.GAME.dollar_buffer)*(card.ability.extra.dollar-1), remove_default_message = true, message = 'X'..card.ability.extra.dollar..localize('$'), colour = G.C.MONEY}
    end
end,```

same error but i did kept card.ability.extra.dollar and changed it in config
daring fern
#

Also it's return {dollars = (G.GAME.dollars+(G.GAME.dollar_buffer or 0))*(card.ability.extra.dollar-1), dollar_message = {message = 'X'..card.ability.extra.dollar..localize('$'), colour = G.C.MONEY, sound = 'coin3'}}

pale holly
#

I did figured i had to replaced the G.Game.dollar_buffer by this, but thanks it works now

pastel kernel
#

i'm sorry for not working on this for long enough (i fell asleep)

daring fern
# pastel kernel i'm sorry for not working on this for long enough (i fell asleep)
local oldgetcurrentpool = get_current_pool
function get_current_pool(_type, _rarity, _legendary, _append)
    if _type == 'Joker' and _append == 'sho' then
        local poll = pseudorandom('rarity'..G.GAME.round_resets.ante.._append)
        if poll < (1/20) then
            _legendary = true
        end
    end
    return oldgetcurrentpool(_type, _rarity, _legendary, _append)
end
pastel kernel
#

oh so that's how you do it

#

but, how do i make this part of my jimbo joker?

daring fern
pastel kernel
#

right above return oldgetcurrentpool?

daring fern
pastel kernel
#

which if?

daring fern
pastel kernel
#

oh right under function get_current_pool?

rugged crown
#

is it possible to override Small Blind object? can I make it where its like the boss blind of being different each ante somehow?

slim ferry
#

you can change any blind position to any other blind, though changing a non-boss to a boss and vice versa doesnt work very well by default so you need patches to make it work as expected

pastel kernel
#

jimbo works as intended

#

now i need to fix the issue that is asriel spawning multiple fucking astros

#

I feel like i should know how to make this check if there's atleast one astro then disable completely.```lua
remove_from_deck = function(self, card)
if not G.CONTROLLER.locks.selling_card then
SMODS.add_card{ key = "j_busterb_astro", edition = 'e_negative', stickers = {'eternal'}, force_stickers = true }
end
end

#

This should work, right?lua remove_from_deck = function(self, card) local nomoreastros = 0 if not G.CONTROLLER.locks.selling_card and not nomoreastros >= 1 then SMODS.add_card{ key = "j_busterb_astro", edition = 'e_negative', stickers = {'eternal'}, force_stickers = true } nomoreastros = nomoreastros + 1 end end

daring fern
pastel kernel
#

This time it’s an update function

#

currently it's this onelua update = function(self, card, dt) if G.jokers then for _index, _joker in ipairs(G.jokers.cards) do if _joker.config.center.key ~= 'j_busterb_joker' then Blockbuster.manipulate_value(_joker, "jkrvm", card.ability.extra.valuemodification) end end end end,

daring fern
pastel kernel
#

You should ask ice, he’s the one who developed the api

pastel kernel
daring fern
pastel kernel
#

Actually the values are static, I tried it myself.

daring fern
pastel kernel
#

Idk how but it is

pastel kernel
# daring fern You would do it in `add_to_deck` and `context.card_added`
add_to_deck = function(self, card, from_debuff)
  if context.card_added then
    if G.jokers then
        for _index, _joker in ipairs(G.jokers.cards) do
          if _joker.config.center.key ~= 'j_busterb_joker' then
          Blockbuster.manipulate_value(_joker, "jkrvm", card.ability.extra.valuemodification)
          end
        end
      end
    end
end,```
daring fern
pastel kernel
daring fern
frosty rampart
#

add_to_deck does it once to all the cards the player already has upon acquiring this joker, context.card_added does it once to each card the player acquires after this joker

pastel kernel
#

acquiring another jimbo does this apparently

#

i really want to change the way asriel spawns an astro

neat plover
#

first time trying to make an edition with a spectral card, and i cant see it in the menu for some reason

daring fern
neat plover
#

cant see the spectral card and the edition

daring fern
neat plover
plucky berry
#

guys how would i make a custom challenge rule that multiplies blindsize by dollars owned?

neat plover
#

ok @daring fern i fixed it

#

nvm

daring fern
plucky berry
#

this multiplies or adds?

daring fern
plucky berry
frosty rampart
#

it needs to be in a calculate function

plucky berry
#

attempt to index local 'context' a nil value

frosty rampart
#

for challenges, the calculate function is just function(self, context)

plucky berry
#

oh okay

#

i'll test it

neat plover
#

how do people even make shaders

frosty rampart
#

math and coding

neat plover
#

they look so hard to comprehend

rigid pebble
#

Ye

#

Because they are

frosty rampart
#

they're written in GLSL, the opengl shader language. there are some good resources out on the internet for how it works

#

the example shaders in the smods examples repository can also be helpful (one of them is particularly documented with comments, ionized.fs iirc)

thorn basin
#

I made an enhancement that gains Xchips or Xmult when held in hand.
The problem is that when I create said enhancement it starts endlessly gaining said amounts even if a hand hasn't been played.
How can I fix this?
(maybe by putting another context in the first if but I don't remember which one it was...)

frosty rampart
#

yea you need another context
probably context.before, context.main_scoring, or context.after, depending on the timing you want

#

(context.before upgrades it before any scoring, context.main_scoring upgrades it when a steel card would score, and context.after upgrades it after all the scoring is done)

thorn basin
frosty rampart
#

does the poker hand cycle or is it always high card? i assume the latter

daring fern
frosty rampart
#

ok

Level up played High Cards and retrigger
all played cards 4 times.
1 in 20 chance to set money to be negative
or immediately lose the run
thorn basin
#

many thanks you both!

urban wasp
#

any reason why this doesn't work at all?

if context.setting_blind and (context.blind == "bl_small" or context.blind == "bl_big") then
    return {
        dollars = -card.ability.extra.dollars1,
        colour = G.C.RED
    }
end
slim ferry
#

context.blind isnt a thing afaik

urban wasp
#

oh i'm dumb

slim ferry
#

or if it is its probably a table

#

and not a key

#

just check G.GAME.blind.config.blind.key

#

iirc

urban wasp
#

so just replace the context.blinds with that?

slim ferry
#

yes

urban wasp
#

ok thank you

slim ferry
#

or just

#

not G.GAME.blind.boss

#

since mods might replace small/big blinds

urban wasp
#

no buddy that won't work

#

heh

#

anyway bye

slim ferry
#

what

shell timber
#

are you like adding new types of blinds or something

urban wasp
daring fern
urban wasp
#

so context.blind is a thing

#

💔

slim ferry
#

well i said

#

if it is a thing its probably a table

mystic river
#

context.blind:get_type() ~= "Boss", even

stiff locust
#

gifs are blocked >:(

daring fern
#

context.blind is not a blind, it is the center.

stiff locust
#

G.GAME.blind.config.blind.key gives you the key doesnt it

vale grove
#
    config = { extra = { mult = 0, dollars = 0, mult_mod = 2, dollars_mod = 1, odds = 4 } },

loc_vars = function(self, info_queue, card)
    info_queue[#info_queue + 1] = G.P_CENTERS.m_lucky

    local lucky_tally = 0
    if G.playing_cards then
        for _, playing_card in ipairs(G.playing_cards) do
            if SMODS.has_enhancement(playing_card, "m_lucky") then
                lucky_tally = lucky_tally + 1
            end
        end
    end
    local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds)
    return {vars = { card.ability.extra.mult_mod * lucky_tally,  card.ability.extra.dollars_mod * lucky_tally, numerator, denominator } }
end,

i cant get the chance to appear accurately

#
            "has a {C:green}#3# in #4#{} chance to become a lucky card",
#

i have this and it just doesnt work idk why( it says 1 in 4 accurately but obtaining an oops all sixes doesnt make it go to 2 in 4)

normal crest
#

it looks correct to me, are you sure you saved the file

vale grove
#

yeah

#

ive been trying many things and just nothing works

normal crest
#

does oops work with other jokers that have probabilities

vale grove
#

yes

#

thats the weird part

#

i use two other jokers and it just doesnt seem to work

vale grove
#

i just put a test in there and it doesnt work

normal crest
#

maybe you're writing in the wrong file

vale grove
#

another issue

    if suit_card:is_suit('Diamonds') then
        local dollars = (G.GAME.dollars or 0) + (G.GAME.dollar_buffer or 0)
        local xmult_factor = math.floor(dollars / card.ability.extra.dollars)
        result.Xmult = xmult_factor > 0 and (card.ability.extra.Xmult_mod * xmult_factor + 1) or 1
        result.message = "earth"
        result.colour = G.C.SUITS.Diamonds

    elseif suit_card:is_suit('Spades') then
        result.mult = card.ability.extra.mult
        result.message = "Air"
        result.colour = G.C.WHITE

    elseif suit_card:is_suit('Clubs') then
        result.chips = card.ability.extra.chips
        result.message = "Water"
        result.colour = G.C.CHIPS
    end

    return result

when i have smeared and play spades and clubs only the spades apply, how do i make that work?

normal crest
#

using elseif means it will only enter through one of those conditions

vale grove
brave blade
normal crest
#

well you can do 3 different if statements, but what do you even want it to do when you play a wild card for example

#

cus if you just make it separate conditions rn only the last one met will actually matter

vale grove
#

okay so for example

#

playing smeared would trigger diamonds and hearts(hearts is before round so doesnt matter) or spades and clubs

#

wild cards would trigger all 4

brave blade
#

I think that's quite a bit more complicated then if you want it to show multiple messages

vale grove
#

maybe

normal crest
#

I think you want something like this

local effects = {}

if is diamonds then
  effects[#effects + 1] = {
    Xmult = something,
    message = "Earth",
    colour = something
  }
end

-- the rest of the if statements the same as above

return SMODS.merge_effects(effects)
daring fern
#
local effects = {}
if suit_card:is_suit('Diamonds') then
    local result = {}
    local dollars = (G.GAME.dollars or 0) + (G.GAME.dollar_buffer or 0)
    local xmult_factor = math.floor(dollars / card.ability.extra.dollars)
    result.Xmult = xmult_factor > 0 and (card.ability.extra.Xmult_mod * xmult_factor + 1) or 1
    result.message = "earth"
    result.colour = G.C.SUITS.Diamonds
    table.insert(effects, result)
end
if suit_card:is_suit('Spades') then
    local result = {}
    result.mult = card.ability.extra.mult
    result.message = "Air"
    result.colour = G.C.WHITE
    table.insert(effects, result)
end
if suit_card:is_suit('Clubs') then
    local result = {}
    result.chips = card.ability.extra.chips
    result.message = "Water"
    result.colour = G.C.CHIPS
    table.insert(effects, result)
end

return SMODS.merge_effects(effects)
daring fern
vale grove
#

yeah that works

#

ty sm

rigid solar
#

Is it possible to check if a mod of higher priority is loaded? afaik SMODS.can_load only checks priorities under ours

normal crest
#

what would be the goal

rigid solar
#

creating a joker compatible with multiplayer, but multiplayer has a crazy high priority

wind steppe
#

you can just make the number even higher

rigid solar
#

thx

rigid solar
#

can't seem to make the message transmission properly work anyway
one game does send the message but the other seems to never receive it

#

is there a possiblity that the multiplayer servers filter messages that aren't from the base mod

spring lantern
#

tryna copy trib and sock at the same time but only the one on the left gets triggered

daring fern
spring lantern
#

thanks i'll try this

#

had to fix a couple small things but it worked ty

rugged crown
#

I wanna see if its possible to basically overhaul the playing cards into something else is that possible?

rugged crown
wind steppe
#

yes its possible

#

you need enhancements that dont show rank or suit

rugged crown
#

i see thats a cool way to do it I just was curious the implentations with playing cards and if it could be adjusted

#

not like mod send excactly just how it changed playing cards but i get what you mean

unkempt thicket
rugged crown
unkempt thicket
#

Yea it's got code and stuff though I'm not sure if it's publicly available, i'd ask the post's creator.

vale zinc
#

This thing's effect doesn't apply retroactively. Any pointers?

[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "self.sell_cost = math.max(1, math.floor(self.cost/2)) + (self.ability.extra_value or 0)"
position = "at"
payload = '''
local results = SMODS.find_card('j_lapsems_refund')
if (#results > 0) then
    self.sell_cost = math.max(1, math.floor(self.cost * results[1].ability.extra.sale_increase)) + (self.ability.extra_value or 0)
else
    self.sell_cost = math.max(1, math.floor(self.cost/2)) + (self.ability.extra_value or 0)
end
'''
match_indent = true

# Also, the card's `sale_increase` is set to 1.
clear ocean
#

a theme update might be "store credit"

slim ferry
#

you should probably just hook Card:set_cost

#

and then set the cost of all owned jokers in add_to_deck

#

and remove

clear ocean
#

like when i buy old video games and home media usually unless it doesn't work you can only just like exchange it out for another thing or get store credit

vale zinc
slim ferry
#

thats a patch

#

not a hook

clear ocean
#

also usually at least the mom and pop stores you go to its usually better to get the store credit instead of a cash refund as you get more and usually you are already there to get something if that makes sense

slim ferry
#

oh fuck :mister bones:

wind steppe
#

i would fuck mister bones

slim ferry
#

ok

clear ocean
#

oh fuck! i want to get off mr bones wild (card) ride

slim ferry
#

what about ascensio mr bones

wind steppe
slim ferry
#

good

vale zinc
#

Getting back on topic, I patched rather than hook 'cause I wanted to override the game's code of halving buy price to produce sell price under all other circumstances.

#

And would I need to add add_to_deck() and remove_from_deck() functions too?

slim ferry
#

a hook can do that too though

#

well you need to reset the cost of all cards in add/remove from deck anyway

#

wait no

#

uhhh

#

fuck

#

nvm

vale zinc
#

Yeah, that could specify something that was bought for $5 instead sell for $4.

#

Also, is your profile image a Dalek?

slim ferry
#

no

#

its a frog

#

which i shittily edited

slim ferry
vale zinc
#

D'you think I could combine a hook and a patch?

slim ferry
#

no reaosn i think

#

but you should still loop over G.I.CARD and set the cost of everything when the card is added or removed

#

to make it apply retroactively

#

and also go away when you get rid of it

slim ferry
#

no

#

in the card

vale zinc
#

In add_to_deck()?

slim ferry
#

yes

vale zinc
#

And remove_from_deck() too?

slim ferry
#

yes

vale zinc
#

One more thing for now: is there any significance to the patch files' names, or can I name them whatever I please?

slim ferry
#

as long as they are in a folder named lovely the name doesnt matter

vale zinc
#

Does remove_from_deck() get called after the relevant card is removed? I want to check first thing that #SMODS.find_card('j_lapsems_refund') <= 0, so that the card's ability is binary, like Showman and Shortcut.

slim ferry
#

it gets called after its removed

#

you shouldnt need to check if there is another copy since thats already checked in the patch

vale zinc
#

Any pointers, @clear ocean?

daring fern
#

chrome widget
#

Another day of hotfixes

rigid pebble
slim ferry
#

He would

wind steppe
rigid pebble
#

buh

solid salmon
#

hey guys

#

how do i make it so that a joker gives +mult everytime a stone card is scored?

frosty rampart
#

vanillaremade is a great resource
check e.g. any of the jokers that give +mult every time a [suit] card is scored, and then swap the suit condition with checking for if the currently scored card is stone

daring fern
crimson marlin
#

what is my balatro doing...... (guys I dont think 'not' and '==' are arithmetic 😭) The error is coming from the variable named showdown

crimson marlin
daring fern
crimson marlin
#

OOOH I SEE IT

#

pluh

#

this is the line causeing error

#

Ill send full dump

daring fern
crimson marlin
#

huh, I must've removed a check for that by mistake lol

crimson marlin
#

alr I fixed it :D (twas one line of code 😭)

#

yippie my balatro is balatroing again

proper wyvern
pale holly
winter flower
#

oh my god this isn’t modding chat

tight pumice
#

Having issues with trying to make a joker that works if you discard five cards of a required suit

#

Core logic happens in here

#

Am I misinterpreting how G.GAME.current_round.discards_left works

#

Here is the crash if this adds any additional context

wind steppe
tight pumice
#

Ur right but somehow that wasn't the only issue

wind steppe
#

ctrl c ctrl v here

tight pumice
#

It stopped crashing, it just doesn't work logically now

#

There's this too, maybe something is wrong here

wind steppe
#

trash_suit seems to inconsistently be a table or a string

#

whats the issue anyways

tight pumice
wind steppe
#

also in the loop it checks for trash_card

tight pumice
#

I think I see what you mean

tight pumice
#

Nothing is breaking anymore, but it isnt giving the spectral card when meeting the requirements

#

Looks like this now

wind steppe