#💻・modding-dev

1 messages · Page 576 of 1

rotund sable
#

I literally bolded hook but ok

wispy falcon
rotund sable
#

I'm not sure if that'll work btw

#

Just a guess

wispy falcon
#

By the way, is it a trend that so many people only have a letter as a name? I swear it's getting more and more

rotund sable
#

:clueless:

fair osprey
#

Hey, trying to make a patch - I feel like the logic for this is pretty simple, so Idk why it's not doing anything.

The injected function is "Card:get_end_of_round_effect" at line 1040 in "card.lua". It's supposed to create a tag when a blue seal is triggered.

wispy falcon
rotund sable
#

No idea but I see no reason why that would be the case

slim ferry
#

its for literally everything

wispy falcon
#

Where are lovely logs again?

violet void
#

Does anybody know why the other DebugPlus files don't appear for patching with Lovely when launching Balatro with --dump-all? It doesn't let me patch core.lua from DebugPlus specifically (I need to change the behaviour for using ctr + c on a unhandled type of card)

frosty dock
violet void
#

its not anywhere in the lovely dumps

frosty dock
#

it's loaded as a lovely module called debugplus.core

#

you should be able to target that buffer name

wispy falcon
#

How do I get this value that's in scored_card in SMODS.calculate_effect?

violet void
frosty dock
#

so... lovely modules just straight up can't be patched? I'd say they must have some other buffer name, but if they don't get dumped, they clearly don't

#

@gaunt thistle care to explain?

pseudo furnace
#

The error message said '823: bad argument #1 to next', what is it that I am fixing?

slim ferry
#

next takes a table

#

not a string

#

what you currently put in is a string

pseudo furnace
#

The next(...) part of the condition is used by Seance though, why does it work there?

slim ferry
#

what is card.ability.extra.poker_hand here?

pseudo furnace
#

I put in 'Royal Flush'

slim ferry
#

okay then that would be because royal flush isnt actually its own hand

#

its just straight flush but it displays a different name

pseudo furnace
#

So I have to do an extra check for it?

slim ferry
#

yea, just check straight flush and then if all the cards are rank 10 or higher

pseudo furnace
#

Alright, thanks!

gaunt thistle
#

I'll need to look into it tomorrow to determine how hard a fix will be

#

@rough furnace

pseudo furnace
#

For reference, the code is still broken at the same part

red flower
#

did you restart the run before testing?

pseudo furnace
#

Double checking atm

#

Yep, still a " bad argument #1 to 'next' "

wispy falcon
#

How do I use SMODS.calculate_effect()?

red flower
wispy falcon
# red flower for what

I'm trying to hook it to see if I can get the chips a joker gives and then double that using a consumable

red flower
#

SMODS.calculate_effect({ chips = 10 }, card) is how you usually call it but I couldn't tell you how to hook it to do what you want

wispy falcon
#

Yeah, right now I have this but it doesn't feel like it's getting me somewhere

function SMODS.calculate_effect(effect, scored_card, from_edition, pre_jokers)
    -- Code before

    local ret = calculate_effect_ref(effect, scored_card, from_edition, pre_jokers)

    -- Code after

    local chips_value
    local best_match = nil

    if scored_card and scored_card.ability and scored_card.ability.extra then
        for k, v in pairs(scored_card.ability.extra) do
            print(k)
            if string.find(k:lower(), "chips") then
                -- Priority: exact match
                if k == "chips" then
                    best_match = v
                    break
                end
                -- else the closest
                best_match = best_match or v
            end
        end

        scored_card.ability.extra.best_match = best_match
        print(scored_card.ability.extra.best_match)
    end

    return ret
end```
red flower
#

i believe modifying joker values is an affront to God so i can't really help with this kinda stuff sorry

#

i would use a library like cryptlib maybe, no need to reinvent the wheel

wispy falcon
slim ferry
#

What are you even trying to do actually

red flower
slim ferry
#

Increasing joker chips via a consumable can mean a lot of things

red flower
#

giving it foil would be the funniest answer

slim ferry
#

Peak

wispy falcon
# slim ferry What are you even trying to do actually

I'm trying to make a consumable that can be used on Jokers and doubles their chips values. So the Joker would usually give +20 and after the consumable it would give +40. After another consumable it would give +80 and so on, permanently

slim ferry
#

Probably possible but not while actually keeping the description accurate for the joker

wispy falcon
slim ferry
#

You'd have to do some post_trigger shenanigans to change the chips amounts based on some hidden counter in the joker that increments when the consumable is used i imagine

red flower
#

idk if it allows filtering by value types, probably not

wispy falcon
frosty rampart
#

yea like i mentioned earlier, value manipulation is particularly tricky if you're trying to edit a specific value, because there's no way to control what the variable name is

frosty rampart
wispy falcon
frosty rampart
#

close. each mod has to be in its own set of quotes, not all in one

wispy falcon
frosty rampart
#

...you also need to install the mod

wispy falcon
#

I did

frosty rampart
#

then you didn't do it right, because it's not in the mods list in the crash log

wispy falcon
frosty rampart
#

🤷‍♀️ maybe you need to set your mod's priority to be after cryptlib's? (higher number loads later)

wispy falcon
#

Found the problem

wispy falcon
#

Anyways, where do I find all the functions that cryptlib has?

frosty rampart
#

in the cryptlib files
you just have to read the code

#

but the stuff in manipulate.lua is probably what you're looking for, since that's all the value manipulation stuff

wispy falcon
#

I'm currently readin through that and I don't really understand what I put for args

frosty rampart
#

yea the documentation isn't the greatest. args should be a table, see what the function grabs out of it
asking in the cryptid server seems like a good idea too

rough furnace
# gaunt thistle <@517371142508380170>

I tried fixing it and couldn't figure it out. There's a weird chain of dependencies that you need to call the original. You can probably solve it pretty easy because you know how to modify the architecture much easier than I can and idk how rust works

wooden nexus
#

It crashes when i hover over diet cola

wooden nexus
wispy falcon
#

Can you send me the link to the mod, please?

faint yacht
vapid flume
#

probably a silly question someones asked before, but is it possible/how do i replace a vanilla joker/edit it? can that be done?

faint yacht
vapid flume
#

oh thank you lmao

wispy falcon
vernal path
#

i mean its just part of a hook

#

and you can find any card you like

faint yacht
#

SMODS.find_card looks for Jokers, really.

vernal path
#

its the old find_joker that doesnt

faint yacht
#
if _type == 'jokers' then
    local t = {G.jokers, G.consumeables, G.vouchers}
    -- TARGET: add your own CardAreas for joker evaluation
    return t
end

Oops, yeah.

wispy falcon
#

Okay, I have this now. How do I make it work?

SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)

    local pulsar = SMODS.find_card('c_cstorm_pulsar')
    if next(pulsar) and amount then
        for i = 1, #pulsar do
            amount = amount * pulsar[i].config.halfDouble
        end
    end
    local ret = calcindiveffectref(effect, scored_card, key, amount, from_edition)
    if ret then return ret end
end


SMODS.Consumable {
    key = "pulsar",
    set = "Spectral",
    config = { max_highlighted = 1, halfDouble = 1.5 },
    atlas = "jokers_SPACEHOLDER",
    discovered = false,
    unlocked = true,
    pos = { x = 0, y = 0 },

    calculate = function(self, card, context)

    end,

    can_use = function(self, card)
        if G.jokers.highlighted and (#G.jokers.highlighted == 1) and G.jokers.highlighted[1] then
            return true
        end
    end,

    use = function(self, card, area, copier)
        
    end

}```
faint yacht
#

Though, for actually applying the value modifier to a specific Joker by a consumable, you'd probably want to set a special variable on said Joker and then check for it in the SMODS.calculate_effect hook itself, then check for the chips or chip_mod in the effect table that's passed to it, then alter the amount and remove the special variable set by the consumable.

#

-# Just my tired thoughts.

wooden nexus
#

create_card('Joker', G.jokers, nil, 1, nil, nil, nil, 'uncommon')

#

is the 1 supposed to be the rarity?

wispy falcon
faint yacht
#

...actually, as scored_card is usually the actual "source", I guess only the SMODS.calculate_individual_effect could work? You'd just need to check the key for the chips or chip_mod.

faint yacht
faint yacht
#
if key == 'chips' and scored_card.ability.extra.pulsaractive then
  amount = amount * scored_card.ability.extra.pulsaractive
end
gusty iron
#

how would i check how many cards in the deck have a certain enhancement

frosty rampart
#

check vanillaremade code for one of the vanilla jokers that do exactly that

gusty iron
#

...forgot which one that was.

wispy falcon
# faint yacht ```lua if key == 'chips' and scored_card.ability.extra.pulsaractive then amoun...

So like this?

SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)
    local pulsar = SMODS.find_card('c_cstorm_pulsar')
    if next(pulsar) and amount then
        for i = 1, #pulsar do
            amount = amount * pulsar[i].config.halfDouble
        end
    end

    if key == 'chips' and scored_card.ability.extra.pulsaractive then
        amount = amount * scored_card.ability.extra.pulsaractive
    end

    local ret = calcindiveffectref(effect, scored_card, key, amount, from_edition)
    
    if ret then return ret end
end```
gusty iron
#

i havent played vanilla in a WHILE

frosty rampart
# gusty iron ...forgot which one that was.

i did too lol. might be stone joker?
i know it's not lucky cat, glass joker, or golden ticket
cloud 9 is also helpful, although it doesn't demonstrate checking the enhancement, only the looping through the deck part

faint yacht
#

Remove the SMODS.find_card portion entirely and, instead, in the use function of consumable, make it set the .ability.extra.pulsaractive on it.
-# Not sure how to remove it though, oop.

faint yacht
frosty rampart
#

right, steel

gusty iron
#

and how would a clone a card?

#

WAIT I CAN CHECK

#

CRYPTID!!

wispy falcon
# faint yacht Remove the `SMODS.find_card` portion entirely and, instead, in the `use` functio...

Okay, so overall like this?

SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)

    if key == 'chips' and scored_card.ability.extra.pulsaractive then
        amount = amount * scored_card.ability.extra.pulsaractive
    end

    local ret = calcindiveffectref(effect, scored_card, key, amount, from_edition)

    if ret then return ret end
end


SMODS.Consumable {
    key = "pulsar",
    set = "Spectral",
    config = { max_highlighted = 1, halfDouble = 1.5 },
    atlas = "jokers_SPACEHOLDER",
    discovered = false,
    unlocked = true,
    pos = { x = 0, y = 0 },

    calculate = function(self, card, context)

    end,

    can_use = function(self, card)
        if G.jokers.highlighted and (#G.jokers.highlighted == 1) and G.jokers.highlighted[1] then
            return true
        end
    end,

    use = function(self, card, area, copier)
        card.ability.extra.pulsaractive = true
    end

}```
#

And then card.ability.extra.pulsaractive = false somewhere

faint yacht
#
if G.jokers.highlighted and (#G.jokers.highlighted == 1) and G.jokers.highlighted[1] then
  G.jokers.highlighted[1].ability.extra.pulsaractive = true
end
#

You could do the removal of that special variable right after the amount is changed...

if key == 'chips' and scored_card.ability.extra.pulsaractive then
  amount = amount * scored_card.ability.extra.pulsaractive
  scored_card.ability.extra.pulsaractive = nil
end
wispy falcon
#

Okay, I'm gonna try that out now

faint yacht
#

Or move it outside of that if block... mess around.

wispy falcon
faint yacht
#

Then just .ability.pulsaractive instead.

wispy falcon
faint yacht
#

You can set scored_card.ability.pulsaractive to be the desired multiplier instead.

wispy falcon
#

Okay, for some jokers it does change the value but it doesn't stay. Like after it gave that bigger amount of chips it goes back to the earlier amount

wispy falcon
faint yacht
#

If you want the value change to persist, depending on for how long, you may need extra work much like Cryptid's own value influencing.

wispy falcon
faint yacht
#

If the change is permanent, you can directly just set the .chips variable on the Joker itself... although, keep in mind that some may not store their chips result like that.

wispy falcon
faint yacht
#

-# Mood.

wispy falcon
faint yacht
#

Some store it differently, be it .extra.t_chips or directly as .extra.

wispy falcon
#

But still in key.ability?

faint yacht
#

Yeah.

wispy falcon
#

Adding them did not make a difference...

        amount = amount * 1.5
        scored_card.ability.pulsaractive = nil
        scored_card.ability.extra.chips = amount
        scored_card.ability.extra.t_chips = amount
        scored_card.ability.extra = amount
    end```
faint yacht
#

If you want the change to persist, modify the values in the use of consumable... then there'd be no need for the hook.

sly snow
#

attempting to make a joker that posseses an ability to do something along these lines
anyone got any clue on how i could progress with this idea ?

vernal path
#

it would be a good idea to actually write it down, rather than using pictochat to send it here

winter flower
#

is it too complex to make it so that this blind will only give 1 dollar,
no matter what joker you have or what deck you're on?

sly snow
#

if im making myself clear enough here

vernal path
#

Uuuuhhhhh i think so? The order in which you are doing it is quite strange and would require some extra work if its possible, compared to doing regular retriggers.

daring fern
sly snow
#

well then

clear ocean
#

woops shouldve posted it here

sly snow
daring fern
wooden nexus
#

Is there a suit gate in the same fashion as an enhancement gate?

daring fern
wooden nexus
sly snow
#

there's definitely a better way of putting it but this is the best i can currently do

daring fern
sly snow
#

yeah, i believe so

hollow mango
#

thats a crazy idea

#

awesome

daring fern
# sly snow yeah, i believe so
if context.repetition and context.cardarea == G.play then
    local my_pos
    for i, v in ipairs(context.scoring_hand) do
        if context.other_card == v then
            my_pos = i
            break
        end
    end
    if #context.scoring_hand-my_pos > 0 then
        return {repetitions = #context.scoring_hand-my_pos}
    end
end
```?
wooden nexus
daring fern
wooden nexus
#

wdym you don't understand?

#

I'm trying to code mostly with lovely

#

I don't wanna have to make a joker all the way at the end just so i can have in_pool

turbid frigate
#

Hello! I'm still relatively new to modding, but I've spent the last few days trying to understand the documentation on how config menus work, and I just can't seem to understand it. I was wondering if someone could help me with my menu where it has a toggle that says "Weston Mode" which is default to off and then when toggled, switches the sprite of a joker. Is this easy to implement?

daring fern
wooden nexus
#

i'm trying to avoid for the most part

#

But yes, I'm not using SMODS to create the joker

daring fern
wooden nexus
#

Because I found the code for enhancement gate with smods

                    add = nil
                    for kk, vv in pairs(G.playing_cards) do
                        if SMODS.has_enhancement(vv, v.enhancement_gate) then
                            add = true
                        end
                    end```
#

I can then make one for suit and then do that

wooden nexus
#

oh

#

duh

#

it's late lol

charred widget
#

If I wanted to create a negative consumable at the beginning of a round, how would i do that?

sly snow
daring fern
#

No, it would be SMODS.add_card({edition = 'e_negative'})

wooden nexus
#
    add = nil
    for kk, vv in pairs(G.playing_cards) do
        if vv:is_suit(v.suit_gate) then
            add = true
        end
    end```
#

What's wrong here?

clear ocean
clear ocean
#

what's the joker's name and such

sly snow
clear ocean
#

well what's the code

clear ocean
wooden nexus
# wooden nexus ```elseif v.suit_gate then add = nil for kk, vv in pairs(G.playing_cards...
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''elseif v.enhancement_gate then
                    add = nil
                    for kk, vv in pairs(G.playing_cards) do
                        if SMODS.has_enhancement(vv, v.enhancement_gate) then
                            add = true
                        end
                    end
'''
position = "after"
payload = '''elseif v.suit_gate then
                    add = nil
                    for kk, vv in pairs(G.playing_cards) do
                        if vv:is_suit(v.suit_gate) then
                            add = true
                        end
                    end'''
match_indent = true
frosty rampart
clear ocean
#

DANG it not again

daring fern
sly snow
#

yeah

#

1
3, retriggers 1
5, retriggers 1, retriggers 3

#

and whatnot

clear ocean
#
  • one for spawning one of each of the stuff so if you only want lets say the planned editions, boss blinds, or stickers you can do that
  • one for balancing
  • one for item-specific joker support
  • one for miscellaneous (like the title screen and if i do add soul-like or animated jokers, have an option to have it static
daring fern
# sly snow yeah
if context.individual and context.cardarea == G.play then
    local cards = {}
    for i, v in ipairs(context.scoring_hand) do
        if context.other_card == v then break end
        table.insert(cards, v)
    end
    if next(cards) then
        return {func = function()
            for i, v in ipairs(cards) do
                SMODS.score_card(v, {cardarea = G.play})
            end
        end}
    end
end
```?
sly snow
#

can't tell if this is an issue with the way i appended the code or if it's something else

daring fern
#

daring fern
#

Also, install the Lua extension.

sly snow
#

upon scoring

daring fern
sly snow
crystal perch
#

how would i get the key of the opened booster pack when the player opens a booster pack

daring fern
crystal perch
#

thank you

daring fern
sly snow
#

typist, debugplus and sticky fingers (+ steamodded and my own, of course)

daring fern
clear ocean
#

maybe visibility?

sly snow
crystal perch
#

anyone have any idea why the game is crashing when i open a booster from a func called within my joker? this joker is supposed to open another booster of the same type when you skip a booster a certain amount of times per round, yet i'm getting this crash. the crash doesn't happen when the new booster materializes, it happens when it opens
here's the joker's code:

calculate = function(self,card,context)
        if context.open_booster and not context.blueprint then
            card.ability.extra.booster = context.card.config.center.key
        end
        if context.skipping_booster and card.ability.extra.time > 0 and not context.blueprint then
            card.ability.extra.time = card.ability.extra.time - 1
            CHAK_UTIL.open_booster_pack(card.ability.extra.booster)
            return {
                message = "Again!",
                colour = G.C.FILTER
            }
        end
        if context.end_of_round and not context.blueprint then
            card.ability.extra.time = card.ability.extra.times
            return {
                message = "Refreshed!",
                colour = G.C.FILTER
            }
        end
    end

and here's the func for opening a new back

--- Creates and opens the specified booster pack
--- @param pack_key string
function CHAK_UTIL.open_booster_pack(pack_key)
  local booster = SMODS.create_card { key = pack_key, area = G.play }
  booster.T.x = G.play.T.x + G.play.T.w / 2 - G.CARD_W * 1.27 / 2
  booster.T.y = G.play.T.y + G.play.T.h / 2 - G.CARD_H * 1.27 / 2
  booster.T.w = G.CARD_W * 1.27
  booster.T.h = G.CARD_H * 1.27

  booster.cost = 0
  booster.from_tag = false

  G.FUNCS.use_card { config = { ref_table = booster } }
  booster:start_materialize()
end
#

this booster pack func has worked before btw, so idk why it's acting up now

#

it does materialize a new booster of the same type btw

clear ocean
#

uh is there a way to make this compact

frosty rampart
#

two columns

clear ocean
#

orange or blue?

frosty rampart
#

no like
you see how you have all your G.UIT.R nodes inside a single G.UIT.C node
after the first G.UIT.C node, make a second G.UIT.C node and move half of the G.UIT.R nodes to the second G.UIT.C node
(R stands for Row and C stands for Column)

clear ocean
#

would you prefer either alphabetical or having them in sets like the consumables on one row

#

and i do plan on adding other stuff like suits

#

for consumables i think for minor tarot either just put that in arcana packs or just make it where if you enable minor tarot it enables the boosters

queen meadow
#

how would i guarantee a jimboquip?

daring fern
queen meadow
#

so like just use infinity

#

🔥

bold gyro
#

hey anyone familiar with ui stuff, i've added a button to my joker, but for some reason it gets rid of the sell button. what's causing this?

lament agate
#

is it possible to take ownership of every Joker

true jasper
lament agate
true jasper
frosty rampart
#

definitely possible, but there's potentially a better way to implement whatever you're trying to do

jolly shadow
#

me when I take ownership of all Joker so I can super mog my balatro

true jasper
lament agate
#

in which lua

#

or toml

daring fern
true jasper
lament agate
lament agate
frosty rampart
lament agate
#

if you remember of course

umbral zodiac
umbral zodiac
#

i am so sorry that i have dyslexia

#

that's a lie i don't

lament agate
#

die sexy

chrome widget
#

@robust marsh So sorry this took so long, I was moving into a new house

You just set score_invisible = true on any blind definition object you want to hide the score for. The result is what you see in the video

robust marsh
#

THANK YOU FOR DOING THIS STILL

chrome widget
#

It does properly reset after the blind is beaten, though it may still require some finessing? Since it shows the flash of the pure chip scores when it recreates them as expected (to fit regular blind behavior) + the entry on the round eval

#

The latter easy to fix if you gimme a sec, but the former requires a design decision

robust marsh
#

i'll add this in a bit, also i'll credit you accordingly for it

chrome widget
#

shrug idrc about a credit

#

would you want to replace "score at least [requirement]" with smth like "KILL BOSS"

#

Otherwise the round eval row would look a little empty

robust marsh
#

is there a possibility of removing the Reward: $$$$$ box

chrome widget
#

Sure. Does it not reward you?

robust marsh
chrome widget
#

Ah. Then Ic ould probably just center the blind chip icon and then make it larger with the extra space from the removed round score section

robust marsh
chrome widget
#

Only issue is, again, the UI reset once the boss itself is cleared

robust marsh
#

but so far this is awesome

chrome widget
#

Since it'd be a more obvious "snap" back to the default UI

robust marsh
chrome widget
#

Im already using my own version so no

robust marsh
#

oki, then it's not needed

chrome widget
#

hmmmmmm ok gimme a sec to test this

robust marsh
#

alrighty !

lavish elm
#

is there a way to change the effects of the main 150 jokers?

true jasper
lavish elm
lament agate
#

how do you make it so that the joker doesnt occupy a slot without using negative

slim ferry
#

extra_slots_used = -1 (i think)

chrome widget
lucid owl
robust marsh
#

UI is scary

chrome widget
#

I'm in bed now so I can't do much til tomorrow for changes

robust marsh
#

no worries

#

thank you for the help regardless :)

chrome widget
#

What still needs work?

robust marsh
#

I think i fixed it

#

the defeat boss text doesnt appear, but that is okay

lavish elm
#

how to add references in your joker description eg. putting the word Joker and it shows the description of Joker(Jimbo) too in a smaller description window

true jasper
#

I'll get a link rq

mystic river
#

append the center to info queue, if you just want a center description

true jasper
mystic river
#

literally just

info_queue[#info_queue+1] = G.P_CENTERS.j_joker

would work as described

#

of course if you're trying to info queue a different thing other than a center, it becomes more complicated than that

lavish elm
#

something like that

slim ferry
#

yes thats what was just described

true jasper
true jasper
slim ferry
#

is THIS your card?

lavish elm
#

oh ok I am new to modding so I will be asking some dumb questions

lavish elm
slim ferry
#

yeah ik

lament agate
slim ferry
#

yeah

lament agate
slim ferry
#

wtf

#

damn

dire marlin
#

did anyone know how to make enhancement can be override with another enhancement so the card can have multiple enhancement?

lavish elm
#

so I want to make joker description work like misprint but the problem is I don't know how to create a ref table with a ref value so I want to know:
1- wth is a ref table and a ref value
2- how to make them
3- how to make the random numbers in a certain range

slim ferry
#

misprint doesnt need ref table/value to work

#

generally you dont need that unless youre doing something very complex

slim ferry
#

more like quantum enlagcements..... am i right chat...

daring fern
daring fern
lament agate
#

thanks

robust marsh
#

is there a way to check when another joker's calculate is triggered? Or when their effects are triggered. Either of the two

slim ferry
#

context.post_trigger?

robust marsh
lavish elm
#

ok did a few tweaks but how do I make it so it works with this
text = {
"{X:mult,C:white}X#1#{} Mult"
}

#

currently it is giving me nil

slim ferry
#

return { vars = { ... } } in loc_vars

lavish elm
#

do I just return{vars = {main_start = main_start}}?

slim ferry
#

main_start is a seperate thing

#

Also if youre doing something like misprint you dont need a description, the entire thing is the main_start for vanilla misprint

robust marsh
#

is #G.jokers.cards the number of jokers in the joker area, just for clarification

lavish elm
robust marsh
lavish elm
#

so is it like this return {main_start = main_start, vars = {main_start}}?

slim ferry
#

Without the vars

lavish elm
#

anything works with me but I find it easier with the vars

slim ferry
#

putting a main_start in vars doesnt do anything

lavish elm
#

so I can't do it with vars?

slim ferry
#

No, main_start is just a ui element that gets put at the start of the description

#

I would just copy the vanillaremade misprint thing and tweak the values for what youre doing

lavish elm
#

but I don't know how to give it that Xmult UI

slim ferry
#

Just change the one from misprint to use X instead of + and then give it a different background and text colour

#

Misprint doesnt actually have a description at all, its just the main start

lavish elm
#

yeah how do I the background that is the problem that I have with the mainstart

slim ferry
#

Go to the smods ui guide and scroll down to see if you can find some text background colour in the parameters

#

If its not there then youll probably have to make another uibox that the text is inside if for the colour

mossy anchor
#

where do ig et cryptid

glass scaffold
slim ferry
#

you spelled other_consumable correctly

#

it should be context.other_consumeable

robust marsh
#

caino

slim ferry
#

also same with message card, you accidentally spelled consumable correctly there too

cursive gazelle
robust marsh
#

i meann

slim ferry
#

colour isnt wrong

robust marsh
#

colour is correct

#

yeag

cursive gazelle
#

I’m not falling for the British propaganda

robust marsh
#

heirophant

slim ferry
#

color is just as wrong as colour

cursive gazelle
#

Funny

slim ferry
#

thats because your phone is american english

#

smh

glass scaffold
#

Thanks for helping, it's fully working now

cursive gazelle
#

Remember to not type correctly next time

slim ferry
#

modding momento

ashen drift
#

remember lads balatro is canadian

cursive gazelle
#

Why’s it not in French by default then

slim ferry
#

because they speak multiple languages in canada..?

ashen drift
#

canadian english is a whole nother language

cursive gazelle
#

They speak multiple languages in all countries of the world

slim ferry
#

also english is usually the default language for games

glass scaffold
#

This isn't correctly setting reroll cost to $1, anyone know what's wrong?

daring fern
glass scaffold
daring fern
glass scaffold
lyric maple
#
        if context.after and not context.blueprint then
            local wild = {}
            for _, scored_card in ipairs(context.scoring_hand) do
                if SMODS.has_enhancement(context.other_card, "m_wild") and not scored_card.debuff and not scored_card.daniyared then
                    wild[#wild + 1] = scored_card
                    scored_card.daniyared = true
                end
            end
            SMODS.destroy_cards(wild)
        end

trying to make a joker which destroyes all wild cards scored

glass scaffold
#

how do I do that? (please tell me I don't need a hook / patch)

slim ferry
#

In a calculate????

glass scaffold
lament agate
#

in a cargo box?

glass scaffold
dusk gale
#

hey guys new here, does there exist documentation of game object G, seen it used like "G.jokers.cards" or "G.play"

#

just wondering what other fields it has

rotund sable
#

There was this

glass scaffold
#

So I change the value (which assuming is G.GAME.current_round.reroll_cost = card.ability.extra.final_cost) in redeem, then somehow set it again in the calculate function?

dusk gale
daring fern
glass scaffold
#

With this code, what exactly do I need to add or change to get this working?

glass scaffold
wild berry
#

how to get all the jokers of a mod?

daring fern
wild berry
#

kty

lament agate
lavish elm
#

is there a python fstring equivalent in lua?

robust marsh
daring fern
wild berry
lament agate
daring fern
lament agate
#

whats for playing cards?

daring fern
lament agate
#

it worked for me

daring fern
lament agate
#

ahh

#

whats the right one then

daring fern
lament agate
#

i see

lament agate
lavish elm
#

what does G.C.Background and its insides C D L do?

red flower
#

its the colors of the background

lavish elm
#

yeah but what does C D L mean? and what is the background for?

red flower
#

it's the background when you play a game, idk what C D and L mean specifically but they're the different colors used

lavish elm
#

{ n = G.UIT.O, config = { object = DynaText({ string = r_chips, colour = G.C.CHIPS, pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.5, scale = 0.32, min_cycle_time = 0 }) } },
why is the color still RED

red flower
#

dynatext doesnt take a single colour, i takes a colours table

lavish elm
#

how to tell the game that all suits are equal something like the smeared joker effect

red flower
wild berry
#

how can i make a joker i just created negative

#

i mean

#

like

#

manually spawned with SMODS.add_card

red flower
#

SMODS.add_card { ... , edition = "e_negative" }

wild berry
#

ohhh

#

ok thanks

lavish elm
#

local card_is_suit_ref = Card.is_suit
function Card:is_suit(suit, bypass_debuff, flush_calc)
local ret = card_is_suit_ref(self, suit, bypass_debuff, flush_calc)
if not ret and not SMODS.has_no_suit(self) and next(SMODS.find_card("joker_key")) then
return true
end
return ret
end
it is not working why?

red flower
#

i'm assuming joker_key is your joker's key?

#

like j_modprefix_key

lavish elm
#

yeah

red flower
#

no idea then that looks correct

iron steeple
#

hey is there a way to have a deck give jokers additional effects? i'm trying to do something more specific but for example would there be a way to have a deck give jokers x1.5 mult in addition to their effects (like them being polychrome, but this would stack with polychrome)

i don't think i can really override context.individual for jokers here, as that would replace the already existing xmult they have. i did try something with context.other_joker that seemed to work but the issue is it overrides normal other_joker effects so it breaks baseball card.

is there a way to add my own context to calculate jokers after scoring and give that 1.5x?

lavish elm
red flower
#

it shouldnt be, but try to see if removing them fixes it

red flower
maiden phoenix
iron steeple
maiden phoenix
#

Np 👍

wild berry
#

how can i get a joker's edition

cursive gazelle
#

Card.edition

wild berry
#

kkty

#

is it nil if it has no edition?

red flower
#

yes

wild berry
#

alright

lavish elm
#

ok so I hovered over the :is_suit and it told that :is-suit is a duplicate field -> boolean|nil

red flower
#

yes because youre hooking it, thats normal

lavish elm
#

ok bc now it crashes at Card.lua bc it tried to index a nil value so situation got worse

#

ok nevermind no more crash

#

but it still doesn't work

red flower
#

like i said it should be j_<your mod prefix>_simple joker

#

in find_card

lavish elm
#

ohh ok now I get it thanks

#

ok now it works

wispy falcon
#

How do I make a spectral appear more in spectral packs and in the shop when playing ghost deck, if the player has a specific joker?

wild berry
#

whats the reason behind this appearing

red flower
lavish elm
#

ok a side effect is that they become debuffed with any of those boss blinds how do I make not do that

red flower
wispy falcon
red flower
#

my suggestion would be not to do that effect but maybe someone else has a solution

wispy falcon
#

Okay

red flower
wild berry
#

ohh

stiff locust
#

theoretically you could recreate the entire spectral pool and replace it with your own which has some cards at a changed rate

red flower
#

no unless you add rarities or you do something hacky

stiff locust
#

but the wiki said you can

#

oh no it needs rarities

#

yeah

#

i guess not

red flower
#

i mean i know there are some things you can do with in_pool to simulate this but idk how it would be and it sounds very jank

wild berry
red flower
#

show the entire thing

wild berry
daring fern
wild berry
#

oh

daring fern
#

Also it would be {message = "Reset!"}

wild berry
#

yeah its an old one i made, thats an oversight i left

#

and this?

daring fern
wild berry
#

ah

#

also, is there a reason why my booster packs never appear in the shop?

wispy falcon
#

Shouldn't this if be true when I use the consumable on the joker?

        if G.jokers.highlighted and (#G.jokers.highlighted == 1) and G.jokers.highlighted[1] then
            if G.jokers.highlighted[1].key == "j_cstorm_ethereal_joker" then
                G.jokers.highlighted[1].ability.extra.chips = G.jokers.highlighted[1].ability.extra.chips * self.config.fullDouble
            else
                G.jokers.highlighted[1].ability.extra.chips = G.jokers.highlighted[1].ability.extra.chips * self.config.halfDouble
            end
        end
    end,```
#

Or does G.jokers.highlighted[1].key not exist?

daring fern
wispy falcon
#

Thank you

iron steeple
#

is there a context for determining when cards (specifically jokers) are destroyed? there's selling_card that works for when they're sold but i'm looking for one for destroyed cards (for example by ceremonial dagger)

daring fern
wispy falcon
#

And why do I get the crash "attempt to index field 'extra' (a nil value)" here?

        if G.jokers.highlighted[1].config.center.key == "j_cstorm_ethereal_joker" and SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'cstorm_plusar_ethereal') then
            return true
        end
        return false
    end```
daring fern
wispy falcon
#

Can I just use G.jokers.highlighted[1]?

daring fern
iron steeple
wispy falcon
#

Okay, either I am extremely lucky or my SMODS.get_probability_vars(G.jokers.highlighted[1], 1, self.config.odds, 'cstorm_plusar_ethereal') doesn't work properly

lament agate
#

where would i put no_collection = true

#

in config?

daring fern
wispy falcon
lament agate
#

ah okay

red flower
wispy falcon
# daring fern Code?
    key = "pulsar",
    set = "Spectral",
    config = { max_highlighted = 1, halfDouble = 1.5, fullDouble = 2, odds = 10000 },
    atlas = "jokers_SPACEHOLDER",
    discovered = false,
    unlocked = true,
    pos = { x = 0, y = 0 },

    can_use = function(self, card)
        if G.jokers.highlighted and (#G.jokers.highlighted == 1) and G.jokers.highlighted[1] and G.jokers.highlighted[1].ability.extra.chips ~= nil then
            return true
        end
    end,

    use = function(self, card, area, copier)
        if G.jokers.highlighted and (#G.jokers.highlighted == 1) and G.jokers.highlighted[1] then
            if G.jokers.highlighted[1].config.center.key == "j_cstorm_ethereal_joker" then
                G.jokers.highlighted[1].ability.extra.chips = G.jokers.highlighted[1].ability.extra.chips * self.config.fullDouble
            else
                G.jokers.highlighted[1].ability.extra.chips = G.jokers.highlighted[1].ability.extra.chips * self.config.halfDouble
            end
        end
        if G.jokers.highlighted[1].config.center.key == "j_cstorm_ethereal_joker" and SMODS.get_probability_vars(G.jokers.highlighted[1], 1, self.config.odds, 'cstorm_plusar_ethereal') then
            SMODS.add_card { key = "c_cstorm_pulsar", area = G.consumeables}
        end
    end,

}```
red flower
red flower
#

it's SMODS.pseudorandom_probability when you want to do an effect

#

SMODS.get_probability_vars is for loc_vars

iron steeple
# red flower i think it should be?

SMODS.calculate_context({joker_type_destroyed = true, card = self}) still seems to be called only when getting_sliced is set to true in the latest version, but i'll update steamodded and test it in a sec

red flower
#

it is

#

those cards were updated to use getting_sliced

iron steeple
#

ah there are updates that assign it to destruction events yes, neat

wintry swallow
#

Any clue where I would get started on making basic modification to the game? Like changing joker sprites and values?

red flower
#

youre passing a string

#

i think you got the arguments wrong because that function adds the seed

violet oasis
#

Denominator is the max chance. If it's 1 in 4, 1 is the numerator and 4 is the denominator

wispy falcon
red flower
#

yeah you're missing the seed

wild berry
red flower
wispy falcon
#

What should the identifier be? The key?

red flower
#

you can omit it

#

it uses the seed

rotund sable
red flower
#

well duh

rotund sable
#

I mean it's quite obvious but yk

lavish elm
#

local card_is_suit_ref = Card.is_suit
function Card:is_suit(suit, bypass_debuff, flush_calc)
bypass_debuff = true
local ret = card_is_suit_ref(self, suit, bypass_debuff, flush_calc)
if not ret and not SMODS.has_no_suit(self) and next(SMODS.find_card("j_xmpl_simple joker")) then
return true
end
return ret
end
ok why does not bypass the debuff or does it do something else?

daring fern
#

hearty mesa
#

why is my config tab doing this

function SMODS.current_mod.config_tab()
    local config_nodes = {n=G.UIT.ROOT, config = {align = "cm", colour = G.C.L_BLACK, minw = 4, minh = 4}, nodes = {
        {n = G.UIT.C, config = {align = "cm"}, nodes = {}}
    }}
    config_nodes.nodes[1].nodes[1] = create_toggle{
        label = "Does Don Quixote do the funny?",
        ref_table = lcb_config,
        ref_value = "don_is_funny"
    }
    config_nodes.nodes[1].nodes[2] = create_option_cycle{
        label = "Limbus Pack Music",
        w = 6.3,
        scale = 0.9,
        options = {
            "Extraction Theme",
            "Abnormality Extraction Theme",
            "Oh Crab, So Crab",
            "La Mancha Carnival",
            "A Midspring Night's Dream 2",
            unsuspicious_text,
        },
        opt_callback = "lcb_switch_pack_music",
        current_option = lcb_config.limbus_pack_music
    }
    config_nodes.nodes[1].nodes[3] =
    {n = G.UIT.C, config = {align = "cm", padding = 0.1}, nodes = {
        {n=G.UIT.C, config={align = "cm", padding = 0.1, r = 0.1, hover = true, colour = G.C.UI.TEXT_INACTIVE, button = 'lcb_go_to_github', shadow = true, w = 1, h = 1}, nodes={
            {n=G.UIT.T, config={scale = 0.3, text = "This Mod's Github", align = "cm"}},
        }},
        {n=G.UIT.C, config={align = "cm", padding = 0.1, r = 0.1, hover = true, colour = G.C.GREEN, button = 'lcb_go_to_download', shadow = true, w = 1, h = 1}, nodes={
            {n=G.UIT.T, config={scale = 0.3, text = "Scrollable Descriptions Download", align = "cm"}}
        }}
    }}
    return config_nodes
end
#

(i mean the big space on the right side btw)

red flower
lavish elm
#

ok how to bypass the blind debuff?

#

ok how to check for a specific boss blind?

slim ferry
#

context.debuff_card allows you to return prevent_debuff = true to prevent the card from being debuffed

lavish elm
#

it works thanks

wild berry
#

why doesnt this work?

#

doesnt even print

slim ferry
#

because it only debuffs cards in the hand

wild berry
#

oh

#

because i want to debuff it when its drawn

slim ferry
#

and debuffs are only calculated at the start of the round, when the cards are in your deck

robust marsh
#

mm how would i make it so a joker gets dissolved as soon as it's put into the joker area? I'm asking specifically for that because I also want it to do something else but I wanna figure out how to pull this off first

red flower
#

destroy it in add_to_deck

robust marsh
#

alrighty

#

wait

#

i'm like

#

talking about all jokers

#

this is deck specific

slim ferry
red flower
#

destroy it in an add_to_deck hook

slim ferry
#

because theyre still going to be debuffed once drawn

robust marsh
#

oh

#

i forgot i can just do that gg

red flower
#

or in the context for added cards

robust marsh
#

thank you

wild berry
#

but still, the point is that it doesnt work

slim ferry
#

change the cardarea to G.deck

wild berry
#

it worked, ty

daring fern
slim ferry
#

oh true

#

make the cardarea ~= G.jokers

wild berry
#

done

lament agate
#

@frosty rampart yo

lavish elm
#

how to disable retriggering in jokers?

slim ferry
#

i think you can add and not context.retrigger_joker or something along those lines to a check to make it not be retriggered

frosty rampart
steady smelt
#

how do I add the description of a specific owned joker to info_queue? like, not that joker's description in general, but the one that's actually owned

adding lucky cat's description to info_queue always shows it currently at x1, but i want it to reflect the currently value of an owned joker

#

for example i have a lucky cat that's at x4, and another joker copying it and i want to add the x4 lucky cat description to its info_queue, but it always displays in the info_queue at x1

slim ferry
#

info_queue[#info_queue+1] = { set = "Joker", key = <card>.config.center.key, config = <card>.ability }

gilded goblet
#

wtf? you can do that?

slim ferry
#

yeah, if you do the center it does the base config but if you do this you can just put anything as the config

#

such as that of an existing card

#

the only difference is that it wont have recursive tooltips (so the lucky cat tooltip wont have the lucky card tooltip added on as well)

steady smelt
#

i'm definitely doing something wrong

slim ferry
#

uhhhhhhhhhhhhhhhh

robust marsh
slim ferry
steady smelt
#

why are so many people a letter and then an apostrophe

robust marsh
#

M'

steady smelt
#

checking it might be my fault

steady smelt
#

maybe i should go ahead and claim mine

slim ferry
#

K'

gilded goblet
slim ferry
#

i accidentally started it

#

because N called be H once as a joke

steady smelt
#

info queue is

#

forgery_c is

local forgery_c = G.GAME.current_round.forgery_joker.card or nil
daring fern
steady smelt
#

i mean evidently you can

slim ferry
#

it wont save

steady smelt
#

i have a save load function

#

it does

slim ferry
#

oh okay

steady smelt
#
MANIFOLD.funcs.reset_forgery_joker = function()
    G.GAME.current_round.forgery_joker.card = nil
    local valid_forgery_jokers = {}
    if #G.jokers.cards > 0 then
        for k, v in ipairs(G.jokers.cards) do
            if v.config.center.blueprint_compat and v.config.center.key ~= 'j_manifold_forgery' then
                valid_forgery_jokers[#valid_forgery_jokers+1] = v
            end
        end
    end
    if valid_forgery_jokers[1] then 
        local forgery_joker = pseudorandom_element(valid_forgery_jokers, pseudoseed('manifold_forgery'..G.GAME.round_resets.ante))
        G.GAME.current_round.forgery_joker.card = forgery_joker
    end
end

this actually sets the target

#

i can only imagine the config is lost somewhere

robust marsh
stiff locust
#

can UI boxes display images

steady smelt
#

i guess i could make a separate var to save the current target's config and get that?

#

assuming nothing else stupid is wrong

slim ferry
#

i mean just putting the ability in there should work i imagine

#

unless some variable names change or smth

steady smelt
#

oh is it bc i'm setting only forgery_joker.card

#

that's probably it

#

so it's pulling the config from nil which was the initialized value

#

or

#

wait no that should work still right

slim ferry
#

forgery_joker.card is the card though so the ability should still exist

steady smelt
#

yeah

#

are we sure it should be config = <card>.ability? and not <card>.config or ability = something

slim ferry
#

im fairly sure

#

since thats where the center config values get copied into

steady smelt
#

im gonna print forgery_c and see if there's stuff

#

it did in fact print stuff

slim ferry
#

is there also an ability table

#

in there

steady smelt
#
ability: Table:
  extra: 0.25
  h_chips: 0
  hands_played_at_create: 0
  mult: 0
  h_x_chips: 1
  perma_mult: 0
  order: 91
  +29 more values.
#

yeah

slim ferry
#

hmmmmmmmmmmmm

#

i feel like that should work

steady smelt
#

is there documentation for info_queue?

red flower
#

no other than the fact it exists

steady smelt
#

yippee

#

feels like a trend

red flower
#

the trend is that most of vanilla is undocumented

hardy viper
#

you put centers in it and the game magically converts them to info boxes

red flower
#

too many joker loadouts

slim ferry
#

wtf is Loadouts

slim ferry
#

ohhh that

hardy viper
#

yeah

fiery bronze
#

Is it possible to mod changes into the source code in a way? Like making your own unofficial "patch"/update to the game

robust marsh
#
local old_add_to_deck = Card.add_to_deck
function Card:add_to_deck(from_debuff)
    old_add_to_deck(self, from_debuff)
    if G.GAME.selected_back.effect.center.key == "b_tdec_tainted_zodiac" then
        if self.ability.set == "Joker" then
            self:start_dissolve()
        end
    end
end

How would i check key_append here? I tried snooping around for it and couldn't find the exact thing i'm looking for

steady smelt
#

does anything in vanilla pass through info_queue config/abilities?

fiery bronze
#

Like, say I wanted to change how a base game joker functions. Is that possible?

slim ferry
#

you can use hooks or patches

red flower
fiery bronze
#

neat

slim ferry
#

hooks are a bit more limited but more likely to be compatible with other mods

red flower
#

you might also use take_ownership for that

slim ferry
#

patches can do like anything

red flower
steady smelt
#

wish i had that instead of fully teaching myself how patches work

robust marsh
steady smelt
#

still never used a hook and only ownership in very jank ways

fiery bronze
#

Time to learn

#

Thanks

red flower
#

i never used patches in like my first 8 months of coding

steady smelt
#

i definitely way overuse them but it works

#

and idrc about other mod compat

hardy viper
#

didn't lovely patches always have documentation

red flower
#

yeah

steady smelt
#

probably, i'm just dumb and illiterate

#

apparently vanilla passes config in some cases through to info_queue with vars = ...

#

i, think

red flower
#

yes

hardy viper
#

ive seen that before idk what the idea of it is

red flower
#

for things with set Other it works at least

steady smelt
#

config does feel like it should work tho

#

unless info_queue just doesn't take that

red flower
#

it does, sometimes

red flower
#

custom info_queues are very janky

#

what are you trying to do

red flower
red flower
#

yeah no idea

robust marsh
#

but i don't know how to check for it

red flower
#

add_to_deck is too late

robust marsh
#

ah

red flower
#

you have it as an argument in get_current_pool and create_card

#

you can just add a flag to the card tho

steady smelt
robust marsh
steady smelt
#

even tho ability is def not nil

red flower
#

yeah someone was trying to do something similar but had the same problem

#

idk what the solution is

steady smelt
#

helpful

robust marsh
red flower
#

it doesnt help that vanilla is very hardcoded

#

and the names for the fields used in loc_vars are sometimes different for no reason

robust marsh
#

I tried adding a flag to the card but it still gets dissolved immediately

red flower
#

show code

robust marsh
#
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    func = function()
                        local crafted_card = SMODS.add_card {
                            set = "Joker",
                            rarity = totalvalue_rarity,
                            key_append = "crafted_by_bag"
                        }
                        crafted_card.is_crafted = true
                        return true
                    end
                }))

local old_add_to_deck = Card.add_to_deck
function Card:add_to_deck(from_debuff)
    old_add_to_deck(self, from_debuff)
    if G.GAME.selected_back.effect.center.key == "b_tdec_tainted_zodiac" then
        if self.ability.set == "Joker" and not self.is_crafted then
            self:start_dissolve()
        end
    end
end

Both r in separate files, i put them together for this

red flower
#

oh yeah makes sense

#

use SMODS.create_card and then add it and emplace it yourself

robust marsh
#

alright

glacial topaz
#

Hi, does anyone know how I would set a hotkey for a mod up so that it can work off of a controller's button press?

red flower
#

i hook Controller:button_press_update for one of my mods

robust marsh
#
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    func = function()
                        local crafted_card = SMODS.create_card {
                            set = "Joker",
                            rarity = totalvalue_rarity,
                            key_append = "crafted_by_bag",
                        }
                        crafted_card.is_crafted = true
                        G.jokers:emplace(crafted_card)
                        return true
                    end
                }))

This worked, thank you N :)

red flower
#

youre not adding it to deck

robust marsh
#

huh

red flower
#

crafted_card:add_to_deck()

robust marsh
#

oh i

#

i forgot i have to do that

glacial topaz
robust marsh
#

otherwise the add to deck wont trigger for the respective joker

#

thank you

robust marsh
#

now i have to add crafting recipes lol this will be so fun

stiff locust
#

new UI code crash

#

any UI peoples in chat

#

I pretty much copied my code from the working UI to make a new one, changed the layout and it stopped working

#

forgot to send code whoops

#
G.FUNCS.overlay_menu({
            definition = create_UIBox_generic_options({
                no_back = true,
                contents = {
                    {
                        n = G.UIT.C,
                        config = { minw = 10, minh = 10, padding = 0.15, align = "cm", colour = G.C.GREEN },
                        nodes = {
                            {
                                n = G.UIT.R,
                                config = { minw = 1, minh = 0.2, padding = 0.15, align = "cm" },
                                nodes = {
                                    { n = G.UIT.T, config = { text = localize("k_jkbx_QH_title"), colour = HEX("FFFFFF"), scale = 0.8, shadow = true, align = "cm" } }
                                }
                            },
                            {
                                n = G.UIT.R,
                                config = { minw = 1, minh = 0.3, padding = 0.05, align = 'cm' },
                                nodes = {
                                    Jokebox.create_uibox_button('QH_shutdown', localize("k_jkbx_shutdown"), 3, 1,
                                        G.C.GREEN),
                                    n = G.UIT.R,
                                    config = { minw = 1, minh = 0.2, padding = 0.15, align = "cm" },
                                    nodes = {
                                        { n = G.UIT.T, config = { text = localize("k_jkbx_shutdown_desc"), colour = G.C.GREEN, scale = 0.8, shadow = true, align = "cm" } }
                                    }
                                }
                            }
                        }
                    }
                }
            })
        })
        G.OVERLAY_MENU:recalculate()
#

it still looks awful in discord because of text wrapping

gusty compass
#

does anyone happen to know what is the reason behind this crash?

slim ferry
#

show the code first

#

that would help

gusty compass
#

the whole thing right?

slim ferry
#

yeah

gusty compass
slim ferry
#

also when did the crash happen

gusty compass
#

i dont have a good idea when

slim ferry
#

well what were you doing when the crash happened

gusty compass
#

testing and debugging

slim ferry
#

well yes but

#

in the game

#

what did you do before the crash

gusty compass
#

at first i thought it was the Uno joker since each time it crashed, Uno was in my joker slots

#

before i was just playing around with the jokers

#

test sake and all

slim ferry
#

also you dont use math.min anywhere so i dont think its your mod thats crashing

#

unless its some game function that uses it

gusty compass
#

yea, im not sure why but it decides to crash now and not earlier

fiery bronze
#

How does one make a joker convert cards to an enhancement (kinda like how midas mask does)

slim ferry
#

have you looked at midas mask in vanillaremade

fiery bronze
#

no I should

#

lemme look

gusty compass
#

but yea it might be internally, and im not really certain how i can fix this since it happens even if i sold my modded jokers and kept vanilla ones

slim ferry
#

if it happens without any of your mods content it might be related to some hook youre using ig

#

if you have any hooks

gusty compass
#

does this count? ```lua -- Hook the new parameter, why is this not documented bruh
local Sr_Ref = Game.start_run
function Game.start_run(self, args)
local Ret = Sr_Ref(self, args)
SMODS.set_scoring_calculation("GG_powerCalc")
return Ret
end

#

welp there goes formatting

slim ferry
#

i mean that is a hook

#

but it doesnt crash on run start so i doubt its the cause

gusty compass
#

yea it hooks the SMODS.Scoring_Calculation and seems to be the only hook here

slim ferry
#

also what is that comment lol

gusty compass
#

idk

#

i cant format for the life of me

slim ferry
#

no but like why that comment

gusty compass
#

oh wait you meant that

slim ferry
#

what isnt documented

gusty compass
#

hooking the SMODS.Scoring_Calculation

#

its not documented in the wiki

slim ferry
#

i mean youre hooking Game.start_run here

#

also SMODS.Scoring_Calculation is relatively new so no docs yet

gusty compass
#

yea

#

but in term, yea i have no idea why this bug occurs

#

since it works fine for the first few antes

#

and it just dies on around the 3rd ante

slim ferry
#

also you dont need to hook start_run for this, you could instead just do

SMODS.current_mod.reset_game_globals = function(run_start)
  if run_start then
    SMODS.set_scoring_calculation("GG_powerCalc")
  end
end
gusty compass
#

i will test that rq

slim ferry
#

generally should have the same effect as a start_run hook except itll be more clear if it caused the crash or not

gusty compass
#

yea it connects the scoring calc, but the bug still occurs

#

even discarding seems to crash it 😔

#

should i try disabling my mod and see if it has the same effect?

slim ferry
#

probably yea

fiery bronze
#

I feel dumb for asking but what is ipairs

slim ferry
#

it loops over the integer-indexed values of a table

#

in order

#

pairs is the same but it goes over everything in no particular order

slim ferry
fiery bronze
#

Ah, so does that mean that full_hand is a table?

slim ferry
#

yeah

fiery bronze
#

ohhhhhh

#

(lwk i'm new to LUA and am figuring it out as I go lol)

slim ferry
#

ipairs can be used on like, any cardarea to loop through it

fiery bronze
#

makes sense

#

luckily It's not my first language or anything, I know C# and Python to an extent

slim ferry
#

also because lua tablea are funny, for example, if you play one card, context.full_hand[1] will be the exact same thing as G.play[1]. i assume you already coded as if this was the case but you probably didnt really think about it i imagine

wintry solar
gusty compass
#

Hold on

slim ferry
fiery bronze
#

alr

#

what about loc_vars? I have a guess as to what it does but i'm curious

slim ferry
#

it can also pass colours allowing for dynamic colours

gusty compass
#

pretty sure the scoring calc code was the same as before

wintry solar
#

Get rid of the type check

slim ferry
#

main_end and main_start are a thing which can be useful at times

#

and the info_queue is for adding tooltips to a card

wintry solar
#

I am 95% sure that is the problem

gusty compass
#

alr

modern kindle
#

Eremel my friend
Good to see you

fiery bronze
#

it has the same look as one

slim ferry
#

yeah, its a table of centers and tables with localization arguments

#

thats also why just changing the info_queue argument actually affects the info_queue outside of the function without returning, because lua tables are just awesome like that

fiery bronze
#

centers?

slim ferry
#

all of these things

fiery bronze
#

ah

bold sleet
#

what the FUCK is userdata

slim ferry
#

theyre basically, well, the main part of the card. theres also a front, which is the sprite for a cards rank and suit, and a back which is the back sprite of a card

#

theres like a vanillaremade thing on this

fiery bronze
#

ah alr

#

thanks

chrome widget
gusty compass
#

I'm pretty sure it worked for the first crash

wintry solar
modern kindle
gusty compass
#

Alr lemme fetch it rq

#

Btw it references the code block that had the type condition

#

Yea for a split sec I see that the Scoring_Calc parameter shows "?" And doesn't want to reveal

red flower
modern kindle
wintry solar
gusty compass
#

theres the crash btw

gusty compass
wintry solar
#

Hmmmm

gusty compass
#

I might know why it happens tho

#

You know how Chips and Mult show "?" upon selecting a face down card?

chrome widget
#

Hi Dilly! Hi N'!

#

Hi Eremel!

red flower
#

hi winter!!

#

how are you doing

chrome widget
#

Moving

gusty compass
#

The power scoring calc doesn't seem to exit "?" on scoring when the card is revealed, so it attempts to do Chips × Mult ^ "?" (String)

chrome widget
#

I have been busy setting up stuff for move so haven't done much modding recently myself. I now live with these two weirdos

willow scroll
#

ok i might be dumb how do i use SMODS.merge_effects() in conjunction with two SMODS.blueprint_effect()?

wintry solar
willow scroll
#

im doing some chicanery again but i can assure you if i return return1 or return2 instead of a merge that works just fine

gusty compass
#

Yea I get you, also if I can't rely on using a type() to determine whether it is not a number, do you have any suggestions?

red flower
willow scroll
red flower
#

no

willow scroll
#

no?

red flower
#

you're missing {}

willow scroll
#

wait only the {}?

#

or both?

#

({})

wintry solar
red flower
willow scroll
#

i may be smart :clueless:

#

thanks

gusty compass
#

I see, so should I consider only using Chips and Mult if Power is not valid

#

Instead of just stopping a return, I could have two returns inside an if else?

wintry solar
#

Just do something like return mult * chips below the check

fiery bronze
#

trying to figure out how to make certain cards count as an enhancement. My first instinct was to look at pareidolia, but I can't understand what the code for it is doing 😭

gusty compass
#

Alr I'll give that a shot

red flower
fiery bronze
slim ferry
red flower
slim ferry
#

quantum enlagcements.... 😨

fiery bronze
#

oh that's cool

wintry solar
#

They’re not cool

#

We don’t like quantum enhancements

red flower
#

true

gusty compass
#

😨

chrome widget
#

Quantum Enhancements are cool but they're jank and finicky by design

#

And I admittedly am looking forward to Quantum Ranks too 👉 👈

red flower
#

quantum suits when

gusty compass
#

New smods update fr

#

Jk

slim ferry
fiery bronze
#

where am I putting this codewise

red flower
#

anywhere

slim ferry
#

anywhere that gets loaded

red flower
#

dont put the entire thing just the features you want

fiery bronze
#

Do I put it in the joker file?

slim ferry
gusty compass
#

Yea the power calc is "?" during scoring

carmine chasm
#

I started modding and I don't know what to put into the folder of my mod. I watched a tutorial and the files they linked have been changed a lot so what should I do?

gusty compass
#

There's a good wiki for it

cursive gazelle
#

1 lua file
1 json file

carmine chasm
red flower
#

check the basic mod part if you dont care about the set up

slim ferry
willow scroll
#

okay blueprinting two common suit cards together doesnt work

#

however two jimbos work

gusty compass
red flower
#

tomato and tomato soup..

slim ferry
#

😨

gusty compass
#

Oh boy

slim ferry
#

cardinal sin

carmine chasm
cursive gazelle
#

Canned tomato soup

carmine chasm
#

or is my blood?

slim ferry
#

he is made of your blood

#

i think

willow scroll
gusty compass
#

Converging pathways 😭

carmine chasm
#

😭 😭 😭 😭

willow scroll
#

certified chicanery

gusty compass
#

I'm having a hard time believing this is not coincidental

#

So uh, wheres tin can

#

Or aluminium

cursive gazelle
#

Both ended up changing

gusty compass
#

Crazy

hearty mesa
#

is there a way to make a card undebuff itself? im trying to make a joker's effect that debuffs itself for 1 hand

carmine chasm
#

what's different with the id and Name in the .json file?

vale grove
#

hey y'all one very simple and probably very stupid question.
iam making a balatro mod for me and friends right now and currently it doesnt show up in the mods tab in balatro itself. Iam following a tutorial and feel asthough i havent missed any steps,

gusty compass
cursive gazelle
vale grove
cursive gazelle
vernal path
vale grove
cursive gazelle
vale grove
#

i have no experience in lua nor am i very experienced programmer

carmine chasm
#

ok nthanks

gusty compass
#

It's mainly data that the modloader uses to describe your mod

cursive gazelle
hearty mesa
gusty compass
#

this is my metadata file if you need an example{
"id": "Gooodsoups_Garbage",
"name": "Gooodsoups' Garbage",
"author": ["Gooodsoups"],
"description": "Adds random jokers and jinkies to make your balatro experience horrendous!",
"prefix": "GG",
"main_file": "main.lua",
"badge_colour": "8201B4",

"dependencies": [
    "Talisman (>=2.5)"
]

}

cursive gazelle
#

This is a mod example that adds jokers , it should help

vale grove
#

ah the tutorial iam following is just outdated then

gusty compass
#

yea it might

slim ferry
#

id is just an internal identifier for the mod

gusty compass
#

smods now uses one json and a minimum of one lua file

vale grove
#

also another quick question what is the prefix used for?

carmine chasm
slim ferry
gusty compass
#

use UJ if you want

vernal path
carmine chasm
slim ferry
#

no

gusty compass
#

not really

carmine chasm
#

ok

hearty mesa
gusty compass
#

since smods just uses prefixes to separate mods and avoid clashes

#

as far as i know

slim ferry
#

its just a thing that gets added to your object keys between the base key and class prefix

carmine chasm
#

ok

vale grove
gusty compass
#

i dont think so

#

its mainly cosmetic

cursive gazelle
#

Just put a random color

hearty mesa
vernal path
slim ferry
#

trvth nvke

hearty mesa
gusty compass
vernal path
#

hook like, update, or final scoring step context

#

or you can patch it, idc

hearty mesa
#

oh context

#

nvm

carmine chasm
#

is it enough

gusty compass
#

the json contains your metadata right

carmine chasm
#

yes

gusty compass
#

yea it should show up i think

carmine chasm
#

ok thanks

vale grove
#

currently its just in my main 😭

vernal path
#

you shouldnt be defining you mod in a lua file anymore

gusty compass
#

its in a json now

vernal path
#

thats old stuff, put it in a json

hearty mesa