#💻・modding-dev

1 messages · Page 534 of 1

ocean sinew
#

pseudorandom("Better Call Jimbo_Gus Fring_buff") <=card.ability.extra.chance
does this not allow me to manipulate the numerator and denominator easier?

#

and how I would replace it

#

or is it same thing

manic rune
#

if SMODS.pseudorandom_probability(card, "Better Call Jimbo_Gus Fring_buff", base_numerator, base_denominator) then

ocean sinew
#

can we get a lua ast parser into Steamodded?

manic rune
#

base numerator in question is the first number in 1 in 4, while base denominator is the latter

ocean sinew
#

I NEED A LUA AST PARSER

#

AAA

frigid cargo
#
-- Thunderstorm
SMODS.Atlas{
    key = 'atlas_btct_consumeables_Thunderstorm',
    path = 'Thunderstorm.png',
    px = 71,
    py = 95,
}

SMODS.Consumable {
    atlas = 'atlas_btct_consumeables_Thunderstorm',
    key = 'Thunderstorm',
    set = 'Spectral',
    pos = { x = 0, y = 0 },
    loc_txt = {
        name = "Thunderstorm",
        text={
        'Select {C:attention}#1#{} card,',
        '{C:green}#2# in #3#{} chance to apply',
        '{C:dark_edition}Overcharged{}, otherwise',
        '{C:attention}destroy{} the card'
        },
    },

    pos = {x = 0, y = 0},
    order = 99,
    atlas = "atlas_btct_consumeables_Thunderstorm",
    unlocked = true,
    cost = 4,
    hidden = false,
    config = {
        max_highlighted = 1,
        odds = 3,
    },

    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.odds, 'btct_Corrupt')
        info_queue[#info_queue + 1] = {set = "Edition", key = "e_btct_overcharged", vars = {1}, config = {extra = 1}}
        return {vars = {(card.ability or self.config).max_highlighted, numerator, denominator}}
    end,
    
    use = function(self, card, area, copier)
        if SMODS.pseudorandom_probability(card, 'btct_Corrupt', 1, card.ability.odds) then
            local corrupt_card = G.hand.highlighted[1]
            corrupt_card:set_edition("e_btct_overcharged")
            card:juice_up(0.3, 0.5)
        else
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    attention_text({
                        text = localize('k_nope_ex'),
                        scale = 1.3,
                        hold = 1.4,
                        major = card,
                        backdrop_colour = G.C.SECONDARY_SET.Spectral,
                        align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and
                            'tm' or 'cm',
                        offset = { x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and -0.2 or 0 },
                        silent = true
                    })
                    G.E_MANAGER:add_event(Event({
                        trigger = 'after',
                        delay = 0.06 * G.SETTINGS.GAMESPEED,
                        blockable = false,
                        blocking = false,
                        func = function()
                            play_sound('tarot1', 0.76, 0.4)
                        SMODS.destroy_cards(G.hand.highlighted)
                            return true
                        end
                    }))
                    play_sound('tarot1', 1, 0.4)
                    card:juice_up(0.3, 0.5)
                    return true
                end
            }))
        end
    end,
})
}

Can someone give me tips to improve my code? It works right now but i also wanna learn how people can utilize stuff easier.

manic rune
#

shouldnt the delay in events already be accounting for G.SETTINGS.GAMESPEED

#

idk

#

i think this is fine

frigid cargo
faint yacht
manic rune
#

huh

#

idk then

ocean sinew
#

don't use math.random()

#

use pseudorandom()

faint yacht
#

Sorry, math.random() is preferred here.

#

pseudorandom if I want to do some actual gameplay stuff.

manic rune
#

you can use math.random for stuff like random sounds, random events, whatever

#

pseudorandom only really matters for gameplay purposes, yeah

ocean sinew
#

I thought it was gameplay stuff

faint yacht
ocean sinew
faint yacht
#

That function is used only by PCMCIA Card.

solar eagle
#

wat da hell my probability stuff stopped working

solar eagle
#

it was working yesterday fine??

frigid cargo
#

Whats the problem? It just doesnt proc orrrr…?

solar eagle
#

wait

#

hold up

#

i might be soup

ocean sinew
solar eagle
#

Let me double check this .

#

Yeah im soup

#

To make sure blueprint wouldnt trigger i checked for

#

context.no_blueprint??????

#

instead of not context.blueprint

ocean sinew
#

no

solar eagle
#

I may be soup

#

lmaoo

frigid cargo
solar eagle
frigid cargo
#

I code better if its 1am or later

#

The problem is i shouldnt be up at 1am-5am

#

But i still do it anyways

wind steppe
#
create_gacha_button = function()
    local gacha_button = UIBox({
        definition = hpot_gacha_button(),
        config = {type = "cm"}
    })
end
G.FUNCS.hpot_gamble_gacha = function(e)
    print("Let's go gambling!")
end
G.FUNCS.hpot_allow_gacha = function(e)
    if false then
        e.config.colour = G.C.UI.BACKGROUND_INACTIVE
        e.config.button = nil
    else
        e.config.colour = G.C.MONEY
        e.config.button = 'hpot_gamble_gacha'
    end
end
hpot_gacha_button = function()
    local t = {
        n = G.UIT.ROOT, config = {align = "cm", minw = 3.8, minh = 4.6, colour = HEX("00000000")}, nodes =
        {n=G.UIT.R, config={align = "cm", minw = 2.8, minh = 1.6, r=0.15,colour = G.C.GREEN, button = 'hpot_gamble_gacha', func = 'hpot_allow_gacha', hover = true,shadow = true}, nodes = {
        {n=G.UIT.R, config={align = "cm", padding = 0.07, focus_args = {button = 'x', orientation = 'cr'}, func = 'set_button_pip'}, nodes={
            {n=G.UIT.R, config={align = "cm", maxw = 1.3}, nodes={
                {n=G.UIT.T, config={text = localize('k_reroll'), scale = 0.4, colour = G.C.WHITE, shadow = true}},
            }},
            {n=G.UIT.R, config={align = "cm", maxw = 1.3, minw = 1}, nodes={
                {n=G.UIT.T, config={text = localize('$'), scale = 0.7, colour = G.C.WHITE, shadow = true}},
                {n=G.UIT.T, config={ref_table = G.GAME.current_round, ref_value = 'reroll_cost', scale = 0.75, colour = G.C.WHITE, shadow = true}},
            }}
        }}
    }}}
    return t
end

why does the game crash when i run create_gacha_button()

frigid cargo
#

GACHAING MY FAVORITE

wind steppe
frigid cargo
heavy frigate
#

What is NFS?
VanillaRemade mentions NFS in NFS.getDirectoryItems but i cannot find anything about what NFS actually is

wind steppe
#

tldr it helps you load files en masse

solemn shuttle
#

is there a way to easily figure out when a glass card specifically breaks or would i need to hook shatter() or smth

heavy frigate
#

Thanks, and yes i am as i decided to split everything into a separate lua file for my own sanity.
And until now i've been relying on a big table that specifies everything i need to load.

wind steppe
daring fern
solemn shuttle
solemn shuttle
wind steppe
#

check glass joker in vanillaremade

solemn shuttle
#

oh wait yeah LOL

#

forgot that it checks for glass BROKEN not glass KEPT

wind steppe
#

you'd think glass joker triggers off any destruction but it doesn't

#

it's ONLY natural destruction and hanged man

daring fern
solemn shuttle
#

oh ye tru

#

-# thank yall lol :3

azure laurel
#

im having trouble with this tarot, i copy paste the code from vanilla remade but on use the game crashes and i cant tell which is the problem here, someone can help me?

sleek cliff
#

bump?

wind steppe
#

in mod_conv

azure laurel
#

what i should put?

heavy frigate
#

My mod now automatically loads every .lua file fox_dance
So now i can make new stuff without ever touching main.lua again

sturdy compass
#

W

daring fern
azure laurel
daring fern
azure laurel
#

forget it, i think i got it

#

now works yipe

modern kindle
#

remove from deck supports from debuff as well right

red flower
#

yes

modern kindle
#

thanks bestie

stiff locust
#

what function could I hook to activate an effect when a run is won

frigid cargo
#

how do i check if a sprites soul pos is this specific y?

daring fern
rapid stag
#

if lose run, win run. if win run, lose run cirDerp

frigid cargo
#
if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.children.floating_sprite.sprite_pos.y == 4 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 10 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.children.floating_sprite.sprite_pos.y == 5 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 11 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    end

im tryna make the animations change if the sprite soul is a specific y, the problem is the game crashes cause children is nil, how can i fix this?

daring fern
#

It would be Flopprobj.soul_pos.y == number

frigid cargo
#

ahhhh i see

stiff locust
#

how do i check joker rarity again

crystal perch
#

having a bit of trouble getting my card to "soul replace" my other cards. the soul_set is set to the correct set, and soul rate is 100%, so i'm unsure why it's not working

stiff locust
#

is it card.config.center.rarity?

crystal perch
stiff locust
#

cool great

frigid cargo
# daring fern It would be `Flopprobj.soul_pos.y == number`

works now thanks, only problem now is the joker code not changing its sprite

if context.individual and context.cardarea == G.play and context.other_card:get_id() == 14 then
            card.children.floating_sprite:set_sprite_pos({ x = 0, y = 5 })
            return {
                xmult = card.ability.extra.xmult
            }
        end
crystal perch
#

yes

#

and booster pack also opens ChakConsumableType

daring fern
crystal perch
#

is that not on by default?

daring fern
crystal perch
#

then no let me do that

frigid cargo
stiff locust
#

function for exiting shop?

crystal perch
#

context or function?

stiff locust
#

function

crystal perch
#

like, to force you to exit the shop?

stiff locust
#

no

#

a function that runs when you exit the shop

#

i need to hook it

daring fern
crystal perch
#

it still does not appear

stiff locust
daring fern
stiff locust
#

oh okay

rapid stag
#

math.round() doesn't exist?

daring fern
stiff locust
#

math.floor(0.5 + value) does that iirc

rapid stag
#

ahhh

frigid cargo
#
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and context.other_card:get_id() == 14 then
            card.children.floating_sprite:set_sprite_pos({ x = 0, y = 7 })
            return {
                xmult = card.ability.extra.xmult
            }
        end
    end
manic rune
#

does nothing happen or the sprite is gone

frigid cargo
#

nothing happens

manic rune
#

mm

frigid cargo
#

want the function for anim?

manic rune
#

probably not the correct place to use :set_sprite_pos then, i assume

manic rune
#

if its the correct place then it should either change the sprite or completely disappear (choosing a blank spot on the spritesheet)

frigid cargo
#

maybe its cause the animation is always updating?

manic rune
#

oh wait, it is?

#

can you show me that update code

#

thats likely the case

#

yeah its def that update code, i just tried running the code on my end and it works

frigid cargo
#

just know its a big elseif thing cause idk how to code good and i still have to figure out changing variables inside a joker to outside the joker

-- FlopprAnimations
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
    upd(self, dt)
    local Flopprobj = G.P_CENTERS.j_btct_Floppr
    btct_Floppr_dt = btct_Floppr_dt + dt
    if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 1 
            Flopprobj.soul_pos.y = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 2 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 3 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 4 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 10 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 5 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 11 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 6 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 12 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 16 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    end
    for k, v in pairs(G.I.CARD) do
        if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
            v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
        end
    end
end
manic rune
heavy frigate
#

Is there any expected colour to use for emult?

frigid cargo
manic rune
#

usually X:dark_edition,C:white

daring fern
heavy frigate
#

Thanks fox_love2

manic rune
frigid cargo
manic rune
#

shrug

#

its ur code sob

frigid cargo
#

i tried removing the for k, v in pairs(G.I.CARD) do but all it does now is just put it on the proper position but its just on x=0 and not update

manic rune
#

...yes, thats the code that handles the animation

#

sob

frigid cargo
#

😭

#

do you think i can set a boolean variable on the joker and put an if before the for?

manic rune
#

set something in card.ability to tell the update code which y it is at, and animate accordingly

frigid cargo
#

Also how do i access a local variable inside a joker code to outside the joker code? Can i make it global to check it from outside?

manic rune
#

add the variable to card.ability

frigid cargo
wind steppe
#
        G.gacha = G.gacha or UIBox{
            definition = G.UIDEF.gacha(),
            config = {align='tm', offset = {x=0,y=G.ROOM.T.y+11},major = G.hand, bond = 'Weak'}
        }
``` is there anything wrong with this UIBox or is the issue with the definition function
sleek cliff
#

bump? (idk what order to put these in and have them not crash my game

wind steppe
sleek cliff
#

alrighty

drowsy heath
#

Okay so my mod went from okay to cryptid level very fast

sleek cliff
#

now how do I tie this to a table that I have?

drowsy heath
#

I added a card called David, it's legendary but if you get it then the game is over, as it retriggers every card twice

#

I think ik why people don't retrigger jokers now

#

But it's a nice op card the rest of my jokers are tame....

stiff locust
#

how do I get an achievement to unlock itself once its conditions are satisfied

wind steppe
stiff locust
#

returning true doesn't seem to be working?

stiff locust
#

i have all the conditions already done

#

i've done everything and i know it's reaching the achievement code

#

the achievement just isn't getting unlocked for some reason

wind steppe
#

you're sure check_for_unlock is being called?

stiff locust
#

yep

#

i put a print inside the checks in the achievement and it gets there

#

can I not do something like
unga = true
return unga

wind steppe
#

did you unlock all

stiff locust
#

do I need to do return true directly

wind steppe
#

no that should be fine

#

by default achievements wont earn if youve unlocked all

stiff locust
#

I need to set that to true don't I

#

not false.

#

I thought what that did was make it so the unlock all button would or would not unlock your achievement

wind steppe
#

unlock all doesn't unlock achievements it unlocks like. jokers

stiff locust
#

had no idea

wind steppe
#

not much of an achievement if you get it by pressing one button

stiff locust
#

the sprite isn't aligned properly

#

but other than that part I did it

#

it worked

#

achievement sprites are

#

66 x 66 right

drowsy heath
#

is it possible to make a joker buff another of the same pool

#

like say i set something like popcorn with mult loss to say that the mult itself is "cyberwear" then can i have a joker that buffs all jokers that use "cyberwear" as context by 2x

#

so instead of popcorn doing 20+ whenever i had this other joker it would be 40+ at base instead

#

if thats possible....

#

or should i just leave that as a consumable

#

How do I check for a joker being in a pool

#

Like as a check for the calculate

#

Context.other_joker.object_type == ? Would that work

#

Ima try that

heavy frigate
#

Is there any way to change the order of a mod's items in the collection screen outside of load order?

sleek cliff
#

this is new

drowsy heath
#

okay so im just adding a custom rarity but would it automatically st itself to be rarity 5 ? or do i need to define that, the remade doesnt really show that

wind steppe
drowsy heath
#

huh

#

wait

#

like localisation

subtle merlin
#

?

wind steppe
subtle merlin
wind steppe
#
G.UIDEF.gacha_button = function()
    local t = {n=G.UIT.ROOT, config = {align = 'cl', colour = G.C.CLEAR}, nodes={
        UIBox_button({ button = "hpot_open_gacha", label = { "Gamble" }, minw = 5 })
    }}
    return t
end

chat i'm going insane why does this crash on load

subtle merlin
#

that

#

hot potato so i cant look despite wanting to, sorry

wind steppe
frigid cargo
#

how do i access an ability.extra on a function for a joker outside of the joker code?

wind steppe
#

vanilla balatro has a G.UIDEF right

drowsy heath
# subtle merlin

it comes up with yellow lines underneath like something is wrong

drowsy heath
#

ok thank you

drowsy heath
#

wait no weight ?

#

doesnt it need that so it knows how common to come up

wind steppe
#

defaults to 0 afaik

#

the specific rarity here doesn't appear normally

vast bough
subtle merlin
drowsy heath
#

oh ok so just add that if i want

wind steppe
drowsy heath
#

ok thats fine thank you

wind steppe
#

G.UIDEF is real right

#

i feel like i'm going insane

frigid cargo
vast bough
subtle merlin
#

...

daring fern
subtle merlin
#

didnt bepis

#

answer you there

frigid cargo
sleek cliff
wind steppe
#

have the gods simply cursed me

sleek cliff
drowsy heath
#

it still says common in game i dont get what i did wrongggg

wind steppe
daring fern
drowsy heath
sleek cliff
sage crater
sleek cliff
#

I'll remove it ande see what it does

daring fern
#

Remove the {} around pseudorandom_element

sleek cliff
#

Oh, Iwas told to replace all instances of card to that

drowsy heath
#

so would " if context.other_card.config.rarity == 'mm_cyber' then "work

subtle merlin
sleek cliff
daring fern
sleek cliff
#

oh alrighty

#

I read move not remove lol

daring fern
sage crater
subtle merlin
daring fern
drowsy heath
#

is enhancing jokers from a different joker even possible ?

subtle merlin
#

ive done it with editions before

sleek cliff
subtle merlin
#

it should be

drowsy heath
#

like multiplying the base value by 2, i used popcorn as an example but instead of it being +20 it would be +40 if it used instead of mult but a seperate term in he config like cyber

#

im just struggling with it

drowsy heath
#

not something very simple i figured

#

but im trying

#

i just get a crash from a nil context

#

no matter what i do

drowsy heath
#

wait thats a thing

frigid cargo
sleek cliff
#

here we go again

drowsy heath
#

i cant find it

daring fern
drowsy heath
#

used ctrl+f and typed it in but no results

daring fern
drowsy heath
#

in the misc_joker file yeah ?

daring fern
sleek cliff
#

The DoctorPoll is the object type, but I'll change that to the set key

drowsy heath
daring fern
sleek cliff
#

should I be able to change the object_type = "ObjectType"

drowsy heath
#

you do

daring fern
# drowsy heath you do
function SEALS.modify_joker_values(card, modifytbl, exclusions, ignoreimmutable, nodeckeffects)
    if not card or not modifytbl then return nil end
    if card.config.center.immutable and not ignoreimmutable then return nil end
    local cardwasindeck = card.added_to_deck
    if not nodeckeffects and cardwasindeck then card:remove_from_deck(true) end
    exclusions = exclusions or {}
    local ops = {"=", "+", "-", "*", "/", "%", "^"}
    local function modify_value(ref_table, ref_value, isdirectlyinability)
        if type(ref_table[ref_value]) == 'table' and (ignoreimmutable or ref_value ~= "immutable") then
            for k, v in pairs(ref_table[ref_value]) do
                modify_value(ref_table[ref_value], k, false)
            end
        elseif type(ref_table[ref_value]) == 'number' and ((not (exclusions[ref_value] == true or exclusions[ref_value] == ref_table[ref_value])) or not isdirectlyinability) then
            for i, v in ipairs(ops) do
                if modifytbl[v] then
                    ref_table[ref_value] = SEALS.perform_operations(ref_table[ref_value], v, modifytbl[v])
                end
            end
        end
    end
    for k, v in pairs(card.ability) do
        modify_value(card.ability, k, true)
    end
    if not nodeckeffects and cardwasindeck then card:add_to_deck(true) end
end
drowsy heath
#

where do i add the config in which it changes

#

the ref table

#

and ref value is the value im multiplying by im guessing

daring fern
drowsy heath
#

i dont understand any of this and vs code is saying everything about this is wrong what is going on

daring fern
#

Did you put it outside of the joker?

drowsy heath
#

wait i need it outside

#

mb

#

okay i put it outside and change u said after and now its still crying at me

drowsy heath
#

everything

#

feel like ive just been given a newborn that cries all the time

daring fern
# drowsy heath

No, I meant that when you call the function you would do modify_joker_values(card, {["*"] = 2}, {x_mult = 1, x_chips = 1})

drowsy heath
#

oh

sleek cliff
#

yellow is usually just an undefined global but still works (in my experience), red is what needs attention

daring fern
#

You need to keep everything the same except remove the SEALS

drowsy heath
#

ok

#

the line SEALS.perform_operations(ref_table[ref_value], v, modifytbl[v]) when seals is removed it shows yellow under

#

undefined global

daring fern
# drowsy heath the line SEALS.perform_operations(ref_table[ref_value], v, modifytbl[v]) when se...
local function perform_operations(val1, op, val2)
    if op == "=" then return val2 end
    if op == "+" then return val1 + val2 end
    if op == "-" then return val1 - val2 end
    if op == "*" then return val1 * val2 end
    if op == "/" then return val1 / val2 end
    if op == "%" then return val1 % val2 end
    if op == "^" then return val1 ^ val2 end
end

local function modify_joker_values(card, modifytbl, exclusions, ignoreimmutable, nodeckeffects)
    if not card or not modifytbl then return nil end
    if card.config.center.immutable and not ignoreimmutable then return nil end
    local cardwasindeck = card.added_to_deck
    if not nodeckeffects and cardwasindeck then card:remove_from_deck(true) end
    exclusions = exclusions or {}
    local ops = {"=", "+", "-", "*", "/", "%", "^"}
    local function modify_value(ref_table, ref_value, isdirectlyinability)
        if type(ref_table[ref_value]) == 'table' and (ignoreimmutable or ref_value ~= "immutable") then
            for k, v in pairs(ref_table[ref_value]) do
                modify_value(ref_table[ref_value], k, false)
            end
        elseif type(ref_table[ref_value]) == 'number' and ((not (exclusions[ref_value] == true or exclusions[ref_value] == ref_table[ref_value])) or not isdirectlyinability) then
            for i, v in ipairs(ops) do
                if modifytbl[v] then
                    ref_table[ref_value] = perform_operations(ref_table[ref_value], v, modifytbl[v])
                end
            end
        end
    end
    for k, v in pairs(card.ability) do
        modify_value(card.ability, k, true)
    end
    if not nodeckeffects and cardwasindeck then card:add_to_deck(true) end
end
```?
#

Replace everything with that.

drowsy heath
#

it has been tamed

sleek cliff
drowsy heath
#

i still have a problem with my context being nil on the joker itself

#

im just using the line if context.other_card.config.rarity == 'mm_cyber' then and it isnt working

drowsy heath
#

its mainly just unfinished but its saying the context is nil i havnt been able to play with the actual return or anything

#

or do i need to define that this joker is not involved

#

wait no im already doing that nvm

#

should i do it for the start of a round

daring fern
drowsy heath
#

oh woops

#

it normally autofills right

#

dk why it di that

#

other card has a nil value

#

eh but it doesnt

daring fern
drowsy heath
#

does it not here

#

it also is only crashing when i add another card to my hand

#

well joker

#

so am i not giving it the context

#

and then for some reason after it tells me that the context it nil

frigid cargo
#
-- for loop for animation
if Flopprobj.card.ability.extra.flopprTrigger then 
        for k, v in pairs(G.I.CARD) do
            if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
                v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
            end
        end
    end
local Flopprobj = G.P_CENTERS.j_btct_Floppr -- what Flopprobj is

how do i access card.ability.extra.flopprTrigger? like its a function outside the joker so i cant just do card right?

#
-- FlopprAnimations
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
    upd(self, dt)
    local Flopprobj = G.P_CENTERS.j_btct_Floppr
    btct_Floppr_dt = btct_Floppr_dt + dt
    if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 1 
            Flopprobj.soul_pos.y = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 2 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 3 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 4 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 10 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 5 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 11 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 6 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 12 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 16 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    end
    if Flopprobj.flopprTrigger then 
        for k, v in pairs(G.I.CARD) do
            if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
                v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
            end
        end
    end
end

bepis said i could just set a boolean and put the if before the for but i def didnt do it right

subtle merlin
#

what are you animating it by

frigid cargo
#

by the conditions?

#

oh by the y on the spritesheet

subtle merlin
#

im too tired to read through your code, what events do you want it to animate by? You said "we're playing different animations based on different conditions"

drowsy heath
#

if i wanna check context.other_card but that doesnt exist what should else i put to not cause a nil crash

subtle merlin
frigid cargo
drowsy heath
#

im using config.rarity but no matter what i do i always crash when adding another joker

#

even one with a matching rarity

frigid cargo
drowsy heath
#

this is my last project of the night i js need the pain to be over 🤣

subtle merlin
drowsy heath
#

i mean the way im using it , it does

sleek cliff
#

I've put off this mod project for a while because of this stupid Spectral

drowsy heath
#

if context.other_card.config.rarity == 'mm_cyber' then

subtle merlin
subtle merlin
drowsy heath
#

its fine for me tho

#

and i am seeing ur using vs code like i am

#

so whats different and why is mine fine

subtle merlin
drowsy heath
#

its because u havent defined a rarity thats why its red

#

idk then but it has worked before

subtle merlin
#

i feel bad for the people that live here

drowsy heath
#

i used it in a different mod to retrigger specific raritys

#

hold on let me just whack up a retrigger joker with it and check if im going insane

sleek cliff
#

I live in a wonderful society...

subtle merlin
#

one is for playing cards

#

one is for jokers

drowsy heath
#

maybe thats why im cooked

#

other joker is what i should be using

subtle merlin
#

nvm that didnt work either

drowsy heath
#

i mean still worth trying with my joker ig

#

no it wasnt

#

how else can i check the rarity of jokers

frigid cargo
# subtle merlin you aren't getting my question: what are the events that you want the card to an...

so theres 7 animations, anim 1 is booting up so anim 3 4 6 7 will all resort to it after its animation is finished, once anim 1 is finished it resorts to just 1 sigular sprite.
anim 3 4 will be activated after a certain amount of time
anim 2 will be activated cause i change y to their y anim on the sprite sheet but they will go to whatever i change a variable to
anim 5 will be activated cause i change y to their y anim on the sprite sheet but wont stop doing the anim till the round is over
anim 6 7 will be also be activated cause i change y to their y anim on the sprite sheet but they go to anim 1 directly
5.) activated for current score being less than half the blind score and have only one hand
6.) activated for not having an ace in the played hand
7.) activated for having an ace in the played hand
-# (srry theres alot)

subtle merlin
#

that is... very complex

frigid cargo
subtle merlin
#

a lot of for loops and a lot of if statements

frigid cargo
#

real

#

im just tryna figure out how to change y and the anim changes to that one

#

i can do the rest
-# (probably not but eh)

sleek cliff
#

good luck with that, you'll need it

frigid cargo
sleek cliff
subtle merlin
drowsy heath
#

thank you

frigid cargo
#

thank you

frigid cargo
subtle merlin
frigid cargo
subtle merlin
#

Just use that when you want to change it's y

frigid cargo
subtle merlin
#

...
Ever hear of game event manager?

frigid cargo
#

fun fact: nope

subtle merlin
# drowsy heath thank you

i apologize but i can't find anything, you'll need to wait for someone smarter than me to come along (which happens a lot in this channel)

frigid cargo
#

maybe N can help
-# if he was here

subtle merlin
#

N needs to sleep, too

frigid cargo
drowsy heath
#

thats ok ill just head to bed now anyway its just reached 10 to 8 in the morning and i dont feel like working on it rn ive lost hope on ts

subtle merlin
drowsy heath
#

probably will do

#

actually shi i cant go to sleep

#

i have to meet with people in a couple hours

#

i have made a mistake well im off anyway

frigid cargo
#

thank you my goat creature

subtle merlin
#

@drowsy heath update:

drowsy heath
#

How does printing help tho

sleek cliff
#

it tells you if the rarity is working

drowsy heath
#

Idk how that works or how it checks for that specific rarity

#

Ik it's working tho bcoz it shows seperate in the game with the cyber title

subtle merlin
#

this should work on context.other_joker (testing now) but context.other_joker only exists in context.other_joker (i dont get why that is either)

sleek cliff
#

it tells the rarity of that joker when its played (as long as you have debugplus)

drowsy heath
#

Ofc

subtle merlin
#

...

drowsy heath
#

Debug plus my goat when it comes to modding

#

And testing

subtle merlin
#

i used the print to see if config.center.rarity exists...

sleek cliff
#

oh

drowsy heath
#

And I'm guessing not

#

It just dies

#

Bleh

subtle merlin
drowsy heath
#

Oh

#

I didn't read it properly

subtle merlin
#

this exists and is probably what you're looking for, it can only be used in context.other_joker

#

im leaving before i lose it, im sorry i was unable to help you @sleek cliff

sleek cliff
#

I think I'll wait til more people are on tmr to ask for help since theres not a lot of people on rn (at least thats what I see)

drowsy heath
#

Wait but how do I define the rarity

drowsy heath
#

This just says rarity not defining which one

#

I'll figure it out

subtle merlin
drowsy heath
#

I took a 2 month break from coding and came back yesterday I forgot a few things

#

Been busy so I feel like I'm back at square one

candid elbow
#

It all starts with E4

subtle merlin
drowsy heath
subtle merlin
drowsy heath
#

also it says context has a nil value so im just gunna try find something to fix it later coz its rlly starting to get on my nerves coz ik ts possible

subtle merlin
#

Are you in context.other_joker when using that if statement?

drowsy heath
#

yeah same way u wrote it

subtle merlin
#

No, I mean what context is that if statement in?

drowsy heath
#

i think my brain has melted from being awake too long but i should understand what u said yet i dont, ive managed to code over 34 jokers and still get lost when people say things and ive been up too long

subtle merlin
#

that if statement (that i showed earlier) needs to be in this if statement

#

also that's fair, tiredness affects us all

drowsy heath
#

still under the function yeah

subtle merlin
#

example

drowsy heath
#

ahhh okok

#

it didnt crash when i added another joker but when i tried to play a hand and still the same error

#

hold on let me check something tho

#

its the second if statement which causes the crash of nil

#

im officially lost again, well ill leave you to your freedom ill try have a proper crack at this for a few minutes before i get annoyed

subtle merlin
frigid cargo
#
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
        G.E_MANAGER:add_event(Event({
            trigger = "immediate", 
            delay = 0.1, 
            func = function() 
                btct_Floppr_dt = btct_Floppr_dt - 0.1
                if Flopprobj.soul_pos.x > 16 then 
                    Flopprobj.soul_pos.x = 0 
                    Flopprobj.soul_pos.y = 1 
                else
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                end
                return true 
            end
        }))
    end

so uh... my stupidity led me to this. It works! problem is it doesnt stop the elseif (i think) soooo... this event just keeps happening and since it puts it to a different sprite, its just going through the wrong sprites again and again after the proper animation works. mrbeanconfused
(actually right now its wierd, it goes to doing smth wierd then i replenish cards then it goes to normal...?)

subtle merlin
#

wait now im being dumb

frigid cargo
#

i saw that but i couldnt reply cause i was editing the thing

subtle merlin
#

-# oh thank fuck someone smart is here

#

hai dilly!
(i saw u typing)

frigid cargo
#

hi dilly

#

i think i might just do smth else than code 😭 animating is pain

drowsy heath
#

beginning

#

idk what the right spelling is rn

#

but its not multiplying itself and idk why

#

so ima just quickly fix that

frigid cargo
#

i think

drowsy heath
#

at least im not the only one doubting myself

bold sleet
#

Hello. Does anyone that knows UI wizardy know how to get this card area element thing?

subtle merlin
frigid cargo
drowsy heath
buoyant thorn
#

hi
does anyone know how to check what the first card drawn to hand is gonna be for any given seed before the first blind is started?
i tried checking misprint and its code but it just showed me the default 11c in game so i dunno

drowsy heath
#

i tried to do that once

#

i gave up

crisp coral
#

the deck is shuffled when round starts

drowsy heath
#

Yep

#

That's why I cut my losses

#

Well I tried just always viewing the next card drawn and failed that too but that's bcoz I'm stupid

fossil nebula
#

how would i make a timer in boss blind?

placid star
#

the deck draws in reverse order

rotund sable
#

Don't forget to check if G.deck exists

placid star
#

i always forget to check if my cardareas exist before doing arithmetic on them ngl

slim ferry
#

does SMODS.add_card/create_card support an options field like poll_enhancement and poll_seal do

placid star
slim ferry
#

why edition?

placid star
#

idk that's just what I call my variables, for example when I do main ends I just call them local main end =

#

you can call it whatever you like tho ^^

#

in fact you don't even have to assign them to local variables you can call poll eiditon in the add_card

slim ferry
#

?

#

i never said anything about an edition?

placid star
#

ohhh

#

my apologies

slim ferry
#

is there an equivalent for it in those functions

placid star
#

i don't think there's poll enhancement or seal functions unless you create them

slim ferry
#

there are

slim ferry
#

SMODS.poll_enhancement/seal

#

they exist

placid star
#

im assuming you want to put cards in it

#

when I did that I created and assigned the card area out of the nodes with local ca = CardArea... then used ca:emplace()

red flower
#

(a list with pseudorandom_element works too of course)

bold sleet
placid star
modern kindle
modern kindle
bold sleet
#

ok, i got the target the card area thing to work. Now uh... am I doing this right?

#

The card area does say that a card is being added, but there is like, no card.

#

where tf is my card

primal robin
#

Position 20 20 is very out of screen

bold sleet
#

I tried 0 0

#

I do not know how those values work for creating cards

#

And 3 3

#

Nothin'

bold sleet
slim ferry
#

are the pools in G.P_CENTER_POOLS just lists of keys?

bold sleet
red flower
#

you need to hook more functions for a type to work correctly

bold sleet
#

ah

primal robin
#

you missed return in can_highlight btw

red flower
primal robin
#

Also will be better to totally override functions for specific card area rather add even more type checks

bold sleet
#

I have like -15 experience in function hooking.

primal robin
#

You have card area instance, instead hook them, write own ones

bold sleet
#

How would I get my card area to do that huh what?

slim ferry
red flower
onyx sonnet
#

is there a consumable equivalent for context.joker_main?

daring fern
onyx sonnet
#

thanks

modern kindle
#

Hi smt

nocturne aspen
#

does anyone know how to force close a booster pack? im doing something intentionally funky witch means it cant close the normal way by skipping or choosing.

nocturne aspen
#

thank you!

willow scroll
#

i dont think I get drawstep order, or my method of applying an overlay is fucked? I have a drawstep that draws a transparent overlay sprite over the base card, but ive tried every order, and seals still get drawn under the overlay, when i want seals to go over them

#

seals have drawstep order 30, right? well seals look like this with order 29 and 31

#
self.children.sand_overlay = Sprite(self.T.x, self.T.y, self.T.w, self.T.h,
                G.ASSET_ATLAS['maxboism_CustomEnhancements'], { x = 0, y = 0 })
            [...]
self.children.sand_overlay:set_role({ major = self, role_type = 'Glued', draw_major = self })

this is my method for applying the overlay sprite

#

the [...] is the standard hover/click/drag/can collide stuff

cursive gazelle
#

i’m not sure i thought the order was 80 or something for seals

willow scroll
#

then smods source code is lying to me

#

lemme check

cursive gazelle
#

this is how i do it for shader + png

#

But on the back of the card

#

i remember it drawing under the seal when i had 80 order

#

or something idk

willow scroll
#

i just tried 81 and 79 and its still the same

#

its def the way i render the overlay sprite

#

or its a case where alt + f5 doesnt reload everything properly

#

one moment

#

ok no its not that

manic rune
#

ret is something like

mult = 5,
attack_type = {"attack"}

what it does is its supposed to convert a certain percentage of mult into chips, but for some reason its being triggered twice, so if the percentage in question is 25%, its actually giving 5 chips instead

#

help

manic rune
#

i checked and its not running the function twice

#

its something with the logic here and i cant figure it out

cursive gazelle
manic rune
#

yeah, i assumed its, doubling the percentage because its running the function twice, but its not

#

but also, when im running the function outside the joker it works, so idk??

modern kindle
#

hi bepis

manic rune
#

hi dilly

red flower
modern kindle
#

N ♥

red flower
#

hi dilly and wepis

cursive gazelle
#

do i not get a shatout

manic rune
#

a yea, effect_type

red flower
manic rune
#

what Stacked.ismult, Stacked.ischips does is just, checking the index to see if its mult, mult_mod, chips, chips_mod, etc etc

#

the ischips check is just in case theres chips_mod so i can change the message

cursive gazelle
#

Rewrite the whole thing with c#

#

should fix it

red flower
#

is it maybe because youre adding stuff to the table in the middle of an iteration

#

it might work depending on the order pairs goes through it

candid elbow
#

Umm actuwally you can’t because balatro uses the framework smods which is made by lua 🤓

manic rune
#

BUT IN GAME ITS FUCKING 5, IDK WHY 😭

cursive gazelle
#

kee observation , solution ? Just make balatro with c# and include modding support without lovely

candid elbow
#

Kee

manic rune
#

i ran the code inside debugplus' console too, so idfk

red flower
#

i think it might have to do with what i said

manic rune
#

mm

red flower
#

if it inserts chips before mult it might be running mult again

manic rune
#

uh

#

the problem seems to be that its seeing effect_type twice somehow

#

i think ur onto something, maybe i should add the stuff after the for loop?

#

probably something like this

#

OH MY GOD IT FINALLY WORKS

#

thanks N' 3:

modern kindle
#

if im increasing values in a cards ability or ability extra is there a way i can see what value is applied to the denominator argument for the probability vars? im trying to catch cases where odds are in extra in order to not modify those

#

like for example if i have

SMODS.get_probability_vars(card, 1, card.ability.extra.eternal_odds, 'eternifier_eternal')

instead of

SMODS.get_probability_vars(card, 1, 2, 'eternifier_eternal')

does context.denominator still pull the ability in this case?

midnight coyote
#
---@param cards Card[]
---@return table <number|string,number>
function CHAR.FUNC.check_played_rank_deck(cards)
    print('Updating highest played...')
    local cards_played_bleh = {}
    local cards_id_played = {}
    local highest_played_val = 'None'
    local highest_played_id = 1
    local highest_played_num = -2 --why cant i just use a small number? fuck you
    for  k,_ in ipairs(cards) do
        if not cards_played_bleh[cards[k].base.value] then
            cards_played_bleh[cards[k].base.value] = 0
        end
        if not cards_id_played[cards[k].base.id] then
            cards_played_bleh[cards[k].base.id] = 0
        end
        cards_played_bleh[cards[k].base.value] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.value] + cards[k].base.times_played) or 0
        cards_id_played[cards[k].base.id] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.id] + cards[k].base.times_played) or 0
    end
    
    for k,_ in pairs(cards_played_bleh) do
        if cards_played_bleh[k] > highest_played_num then
            print("Highest played val " ..highest_played_val)
            highest_played_val = k
        end
    end
    for k,_ in pairs(cards_id_played) do
        if cards_id_played[k] > highest_played_num then
            highest_played_id = k
        end
    end
    print("Highest played is " .. highest_played_val .. " with an ID of " .. highest_played_id)
    return {rank = highest_played_val, id = highest_played_id}
    
end
#

this is just.. outputting the entirely wrong thing ??

tropic hawk
willow scroll
#

how would I properly give a consumable type a name and description using localization/<locale>.lua?

desert hedge
#

Any way to get Balatro to have a different save folder?
As in; I need to get the Linux version of Balatro to pretend really hard that it should use Steam's emulated C root's save folder

#

A symlink doesn't seem to work

wind steppe
#

how do i get the width and height of the balatro window?

lament agate
#

how do you mess with the screen shake

wind steppe
#

how would i position a button above the deck?

lament agate
wind steppe
lament agate
wind steppe
#

chat UIBox_button does take x and y right

#

<@&1133519078540185692>

#

thank you mods

wind steppe
#
G.UIDEF.gacha_button = function()
    local t = UIBox{definition = {n = G.UIT.ROOT, config = { align = 'cm', colour = G.C.CLEAR, minw = G.deck.T.w, minh = 0.5 }, nodes = {
        { n = G.UIT.R, nodes = {{n = G.UIT.C, config = {align = "tm", minw = 2, padding = 0.1, r = 0.1, hover = true, colour = G.C.RED, shadow = true, button = "hpot_open_gacha", func = nil}, nodes = {
            {n = G.UIT.R, config = { align = "bm", padding = 0 }, nodes = {
                {n = G.UIT.T, config = { text = "Gamble", scale = 0.35, colour = G.C.WHITE}
                }
            }},
        }}}}}},
    config = { major = G.deck, align = 'tm', offset = { x = 0, y = -0.35 }, bond = 'Weak' }}
    return t
end

why does this crash when the ui element is loaded

ivory widget
#

(unsure if this is the right place to ask)
would it be more readable/understandable to have the base mult in the parentheses, or the temporary mult?

jolly shadow
#

I feel like itd be easier to understand if you color-coded the temporary mult

#

and maybe have it like +(20 + 29) Mult

the +s and the () would be red, along with the permanent mult, and maybe have the temporary mult just be orange?

#

🤔

willow scroll
#

anyone who can recommend any tools for making shaders? i wanna try my hand at an edition but i have 0 glsl experience

desert hedge
#

I'm having an issue with running Balatro under Linux
Specifically; when using a Linux version of Love2D, using the latest Github engine version, with a patch to change save directory to /home/reabs/.local/share/Steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro (To match what Windows does)

#

The issue is that it isn't loading saves

#

Or settings

ivory widget
jolly shadow
#

The plus on the inside should also be red I think

wind steppe
#

(hotpot)
||adding a second currency, how would i stop it from going directly to the right of the first on cashout?||

heavy frigate
#

I'm looking for opinions on this.
Is it better to have focused mod (that focuses around a mechanic or specific theme) or a more general kitchen sink mod that has a bit of everything in it?

wind steppe
#

if you have a lot of disorganized ideas id recommend kitchen sink

heavy frigate
#

I'm just undecided right now, i was originally on kitchen sink.
But talking with my girlfriend have made me question if i should steer it back into being more animal themed (and in parts focused around a new poker hand)

red flower
sleek cliff
#

now that more people are awake, anyone able to help me with this?

wind steppe
#

i told you that yesterday

sleek cliff
#

oop, sorgy

rapid stag
#

to me it seems like pool is empty once it gets to the pseudorandom, which makes it return a nil?

#

bump

pure salmon
#

how do i get the key of the current deck?

unkempt thicket
#

How do you add repetitions to only one card?

ocean sinew
#

how to create a cardType Badge?

red flower
unkempt thicket
red flower
#

context.other_card has the card targeted similar to individual

unkempt thicket
#

I see

sleek cliff
lusty glade
#

Hi! i'mwondering how I can make a number in a joker's description dynamically change after x event occurs (like how invisible joker's round count goes up after every round)

anyone could help me please?

red flower
knotty orchid
#

how do I know if a hand is exactly a pair for example

#

is there any context for that?

red flower
#

context.scoring_name*

#

(you need to pair it with a context that has it)

knotty orchid
#

mmm

#

i don't really understand

red flower
#

what part

sturdy compass
#

Wouldn’t you check scoring_name?

red flower
#

yes

#

oops

knotty orchid
#

but

#

for some reason it also triggers with three of a kinds

#
if context.destroying_card and not context.blueprint then
            if context.scoring_name == "Pair"
                and context.scoring_hand[1]:get_id() == 2
                and not context._wildtag_triggered then
                context._wildtag_triggered = true
                card.ability.extra.triggered = true
                G.E_MANAGER:add_event(Event({
                    func = (function()
                        add_tag(Tag('tag_ina_wild_tag'))
                        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
            return true```
lusty glade
red flower
lusty glade
#

oooh I see imma look in there then

#

thank you!

knotty orchid
#

to destroy both cards if 2 2s are played

red flower
#

and give one tag?

#

try this

if context.joker_main and context.scoring_name == "Pair" and context.scoring_hand[1]:get_id() == 2 then
    G.E_MANAGER:add_event(Event({
        func = (function()
            add_tag(Tag('tag_ina_wild_tag'))
            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
if context.destroying_card and not context.blueprint then
    if context.scoring_name == "Pair" and context.scoring_hand[1]:get_id() == 2 then
        return { remove = true }
    end
end
knotty orchid
#

debuff = { is_face = true },
for this, why doesn't this work

#

i think I got it form vanilla remade

red flower
knotty orchid
#

thanks

red flower
#

ill fix it in vremade

willow scroll
#

i might be stupid

Edition = {
            e_maxboism_sepia = {
                name = 'Sepia',
                label = 'Sepia',
                text = {
                    'Balances {C:attention}#1#%{} of chips and mult'
                },
            }
        }

why is the label not showing up? (sepia is a placeholder until I learn how to shader)

#

the name and description show up fine

surreal knot
#

You need to write the labels in the different one

#

misc = {labels = {

knotty orchid
#
calculate = function(self, card, context)
    if context.scoring_hand and context.cardarea == G.play
        and context.other_card == context.scoring_hand[#context.scoring_hand] then
      return {
        chips = context.other_card:get_chip_bonus() * 2,
        card = context.other_card
      }
    end
  end,```
why does this logs a warning about repetition tables?
willow scroll
surreal knot
#

Not in discriptions also

subtle merlin
#

does anyone here have experience writing new pages in galdur?

willow scroll
lusty glade
#

so like #1# will show the first variable?

rocky plaza
red flower
#

yes

lusty glade
#

oooh alr

lusty glade
#

and i;m guessing that if it's not a number it will give 'nil' :0

rocky plaza
lusty glade
#

nice alr alr

#

big thx!

rocky plaza
#

so basically if you access #3# in loc files but ur return {vars = {...}} only has 2 things then #3# will be nil

midnight coyote
#
---@param cards Card[]
---@return table <number|string,number>
function CHAR.FUNC.check_played_rank_deck(cards)
    print('Updating highest played...')
    local cards_played_bleh = {}
    local cards_id_played = {}
    local highest_played_val = 'None'
    local highest_played_id = 1
    local highest_played_num = -2 --why cant i just use a small number? fuck you
    for  k,_ in ipairs(cards) do
        if not cards_played_bleh[cards[k].base.value] then
            cards_played_bleh[cards[k].base.value] = 0
        end
        if not cards_id_played[cards[k].base.id] then
            cards_played_bleh[cards[k].base.id] = 0
        end
        cards_played_bleh[cards[k].base.value] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.value] + cards[k].base.times_played) or 0
        cards_id_played[cards[k].base.id] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.id] + cards[k].base.times_played) or 0
    end
    
    for k,_ in pairs(cards_played_bleh) do
        if cards_played_bleh[k] > highest_played_num then
            print("Highest played val " ..highest_played_val)
            highest_played_val = k
        end
    end
    for k,_ in pairs(cards_id_played) do
        if cards_id_played[k] > highest_played_num then
            highest_played_id = k
        end
    end
    print("Highest played is " .. highest_played_val .. " with an ID of " .. highest_played_id)
    return {rank = highest_played_val, id = highest_played_id}
    
end

could somebody assist me in debugging this function? it just does not return the right thing

surreal knot
lusty glade
midnight coyote
#

but it just completely does not work

clear ocean
midnight coyote
#

this is what it does

rocky plaza
subtle merlin
# red flower larswijn?

oh, maybe, going to be interesting to use cardsleeves as a base as it's far from what i want to do but its a start

rocky plaza
lusty glade
#

because my current code is giving me nil but then its maybe just a typo error lol

rocky plaza
long sun
#

need a wee bit of help

#

i'd like to change a card's suit, but keep what it used to be in a variable attached to it

#

how can i do that? (specifically, obtaining its suit)

red flower
lusty glade
midnight coyote
#

this is false

#

i played 2 sevens prior to running this

red flower
# red flower

should probably have made the arrow the other way around

midnight coyote
lusty glade
#

ty lol

midnight coyote
#

oh wait

#

its this fucking line

red flower
#

oh its the same error lol

midnight coyote
#

gah

#

it still does the same thing

#

wait what

#

it just randomly switched to 2s

#

the id is the same

#

??

lusty glade
red flower
#

oops

red flower
# midnight coyote
cards_played_bleh[cards[k].base.value] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.value] + cards[k].base.times_played) or cards_played_bleh[cards[k].base.value]
midnight coyote
#

oh wait

#

i got it

wind steppe
#

how would i render an image in a uibox?

midnight coyote
#

im not updating highest_played_num

red flower
#

oh yeah

red flower
midnight coyote
#

alright

#

should i do something similar for the ID check or should that stay as is

red flower
#

yes

wind steppe
#

how do i use this to render a sprite in a uibox

red flower
#

object = Sprite(x,y,w,h,...)

#

like this

sonic quail
#

hey, could i perhaps ask for a little help? i have made a joker like blueprint but i cant find the thing that blueprint has with it showing "compatible" and "incompatible" and i cant really figure out how to get it to work.

red flower
midnight coyote
#

okay new problem

#

so now the ID is constantly 1

#

the rank updates just fine now

#

but the ID is always 1

#

which is it's inital value

#

nvm found a fix

#

= instead of >

knotty orchid
#
calculate = function(self, card, context)
    if context.scoring_hand and context.cardarea == G.play
        and context.other_card == context.scoring_hand[#context.scoring_hand] then
      return {
        chips = context.other_card:get_chip_bonus() * 2,
        card = context.other_card
      }
    end
  end,```

Why does this logs a warning about retriggers? And my retrigger jokers crash with this
midnight coyote
#

SMODS.current_mod.optional_features.retrigger_joker must be true

knotty orchid
#

yes

midnight coyote
#

hmm okay

knotty orchid
#

other jokers work perfectly

midnight coyote
#

oh wait this isnt even relevant nvm

knotty orchid
#

but this one logs a warning

#

and crashes

red flower
knotty orchid
#

mmm

knotty orchid
#

how does that work

red flower
#

you know the calculate docs?

#

you should have one of the contexts that are at the top of each code box

#

like context.individual in this case

#

i will make a vremade wiki entry about this

knotty orchid
#

okay

#

thanks mate

willow scroll
#

is there a function to get the poker hand of a given a list of cards? something like SMODS.evaluate but without the hand part?

frigid cargo
#
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
        G.E_MANAGER:add_event(Event({
            trigger = "immediate", 
            delay = 0.1, 
            func = function() 
                btct_Floppr_dt = btct_Floppr_dt - 0.1
                if Flopprobj.soul_pos.x > 16 then 
                    Flopprobj.soul_pos.x = 0 
                    Flopprobj.soul_pos.y = 1 
                else
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                end
                return true 
            end
        }))
    end

so uh... my stupidity led me to this. It works! problem is it doesnt stop the elseif (i think) soooo... this event just keeps happening and since it puts it to a different sprite, its just going through the wrong sprites again and again after the proper animation works. mrbeanconfused
(actually right now its wierd, it goes to doing smth wierd then i replenish cards then it goes to normal...?)

Did i do the event manager wrong or smth?

frigid cargo
#

N’ have you tried putting an event on an animation before?

red flower
#

i dont do animations

#

i barely do return messages

frigid cargo
#

Dang

red flower
#

i am working on one now tho but i still dont know much

frigid cargo
#

I think the main problem on mine is the event changes the sprite after the animation which is what i want, but it continues to change it after like 5 seconds it stops on 1 of 3 options…

lusty glade
#

in the vanilla remade mod, I am searching for the type_key of the Certificate joker named "vremade_certificate_seal" but I can;t seem to find it using ctrl_F (outside of the jokers folder I mean)

anyone knows where I could find it?

red flower
#

what do you mean

#

oh that's a seed for the seal randomization

lusty glade
#

yeee

wind steppe
#
if G.gacha_button then
  G.gacha_button:remove()
  G.gacha_button = nil
end
if G.gacha_machine then
  G.gacha_machine:remove()
  G.gacha_machine = nil
end
``` why doesn't this remove the ui elements G.gacha_button and G.gacha_machine?
lusty glade
red flower
#

no it's an optional unique string to be used as a seed for the seal

wind steppe
#

yup

#

it doesn't reference anything beyond the seal randomization

red flower
#

well and in_pool but yeah

lusty glade
red flower
#

no

lusty glade
#

trully epic then

pure salmon
#

trying to make a deck that doesn't spawn commons. bunco has a patch for this but is there an easier way to do this nowadays?

wind steppe
red flower
#

G.GAME.common_mod = 0?
maybe i don't remember if that was multiplicative or not

midnight coyote
#

how do i get the end of round bonus

midnight coyote
#

for money

pure salmon
#

vanilla seems to do it on the fly

knotty orchid
#
calculate = function(self, blind, context)
        if not blind.disabled then
            if context.debuff_hand then
                blind.triggered = false
                if G.GAME.hands[context.scoring_name].level > 1 then
                    blind.triggered = true
                    if not context.check then
                        return {
                            level_up = -G.GAME.hands[context.scoring_name].level + 1
                        }
                    end
                end
            end
        end
    end```
Why is this crashing at this line:   if G.GAME.hands[context.scoring_name].level > 1 then?
willow scroll
red flower
#

i dont have the code with me rn but it returns multiple values

#

search for it in the vanilla code

wind steppe
#
if G.gacha_button then
  G.gacha_button:remove()
  G.gacha_button = nil
end
if G.gacha_machine then
  G.gacha_machine:remove()
  G.gacha_machine = nil
end

chat why wont these ui elements get removed

wind steppe
knotty orchid
#

how do I access the level of played hand?

pure salmon
#

ok i did it but now it won't change back to normal behaviour when i switch decks

red flower
knotty orchid
#

so why does it crash?

red flower
red flower
knotty orchid
red flower
#

oh uninstall talisman

#

and never install it again

knotty orchid
#

wha

#

JAAJJAA

long sun
#

i have an override for Card:is_suit() that will never return the suit phanta_unknown, however, for displaying the deck, i need this to return that value, so that the cards won't be placed in the row corresponding to their actual suit

knotty orchid
#

I need it for some pows**

red flower
long sun
#

what do i need to patch to fix this?

pure salmon
#

can i not just hook or something instead of taking ownership

red flower
#

you can use take ownership as a hook

pure salmon
#

okay how

#

the api documentation page says basically nothing

red flower
#

you would save the original get_weight in a reference variable

#

like local ref = SMODS.Rarities["Common"].get_weight

#

dunno if it has one by default tho

modern kindle
#

I awaken from my slumber

#

Hello

red flower
#

good morning

modern kindle
#

I shouldn't have napped but frankly I deserved it

wind steppe
#
[[patches]]
[patches.pattern]
target = 'functions/button_callbacks.lua'
position = 'after'
pattern = '''G.shop = nil'''
payload = '''
if G.gacha_button then
  G.gacha_button:remove()
  G.gacha_button = nil
end
if G.gacha_machine then
  G.gacha_machine:remove()
  G.gacha_machine = nil
end
'''
match_indent = true
#

why doesnt this patch do anything

#

it wont remove any uiboxes

knotty orchid
#
                    if not context.check then
                        return {
                            level_up = -to_big(G.GAME.hands[context.scoring_name].level) + to_big(1)
                        }
                    end```
Why does this levels up by 1 the hand instead of decreasing it to 1?
red flower
#

try removing the to_big there

#

it's only for comparisons

knotty orchid
#

I did

#

same thing

red flower
#

hmm

pure salmon
#

uh oh i think this is not the way to do this

red flower
#

it has to be outside the function lol

#

before take_ownership

knotty orchid
rotund sable
knotty orchid
#

I tried without to_big

#

and it didn't work either

rotund sable
#

G.GAME.hands[...].level is a bignum with talisman

#

big_num + int = bignum

#

my workaround for it is wrapping every big_num i return in lenient_bignum()

wintry solar
#

can you show the full function?

knotty orchid
#
calculate = function(self, blind, context)
        if not blind.disabled then
            if context.debuff_hand then
                blind.triggered = false
                if G.GAME.hands[context.scoring_name].level > to_big(1) then
                    blind.triggered = true
                    if not context.check then
                        local level_down = -G.GAME.hands[context.scoring_name].level + 1
                        return {
                            level_up = level_down
                        }
                    end
                end
            end
        end
    end```
#

so with the lenient_bignum i should do lenient_bignum(level_down)

#

?

rotund sable
#

what in the nesting

knotty orchid
#

HAHAHA

rotund sable
#

i hate talisman so much

knotty orchid
rotund sable
#

9 commits just for talisman fixes so far ( in "my" "side" project)

red flower
#

no

red flower
wintry solar
#

it can

#

does doing -bigNum just not work or something?

red flower
rotund sable
#

recently had a crash with talisman where it was returning the big_num

red flower
#

yeah i think it got fixed now?

rotund sable
#

fixed it by wrapping it in the function i mentioned so ¯_(ツ)_/¯

rotund sable
red flower
#

not sure tho i dont test with talisman

rotund sable
#

how old is this

wintry solar
#

old enough to be jank af

rotund sable
#

~month

wintry solar
#

-# they're all jank af shhhh

rotund sable
#

the wizard said so

#

in my experience users don't update talisman ever

solar eagle
#

question, why would the soul egg thingy still be displaying on this - i've take_ownership the soul spectral and overwritten the atlas, pos, and soul_pos

#

(also how do I get it to dance like that)

rapid stag
solar eagle
#

interesting

#

why did localthunk do this 😭

tropic carbon
#

well do you specifically want the delta rune to shake like the Soul does or do you just want the floating sprite like a Legendary Joker

#

oh no wait i'm. i might be stupid

solar eagle
#

unfortunately that is not my goal

tropic carbon
#

wack

wintry solar
#

there is a lot of hardcoded stuff that has been made easily modable by different apis

#

is there a reason you're hard coding texture replacements?

tropic carbon
#

when concepting modded cards/items, do i just have to care about the name and its effect?

#

like is there some bullshit i'm forgetting that i should list

#

not counting category-specific things like joker rarity

red flower
#

price?

tropic carbon
#

that is true

#

i just thought to check the official wiki page for a random card and look at it that way

solar eagle
heavy frigate
#

How do i check how many challenges have been completed?
I thought i found it with G.PROFILES[G.SETTINGS.profile].challenges.tally but just got nil

tropic carbon
#

so it'd be name, effect, rarity (if joker), unlock req, buy price (i assume sell price is pre-calculated rather than having to be coded in manually every time), and then compatibility with blueprint/brainstorm, perishable and eternal stickers

solar eagle
#

sell price is half the buy price

#

there's ways to manually set one, but you don't have to

tropic carbon
#

gotcha, thanks

#

now there shouldn't be anything i missed, right

frigid cargo
#
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
    upd(self, dt)
    local Flopprobj = G.P_CENTERS.j_btct_Floppr
    btct_Floppr_dt = btct_Floppr_dt + dt
    if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 1 
            Flopprobj.soul_pos.y = 0 
        else
            G.E_MANAGER:add_event(Event({
                trigger = "immediate", 
                delay = 0.1, 
                func = function() 
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                    return true 
                end
            }))
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 2 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            if to_base then
                Flopprobj.soul_pos.x = 0
                Flopprobj.soul_pos.y = 7 
                to_base = false
            end
        else
            G.E_MANAGER:add_event(Event({
                trigger = "immediate", 
                delay = 0.1, 
                func = function() 
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                    return true 
                end
            }))
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 3 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 4 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 10 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 5 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 11 then 
            Flopprobj.soul_pos.x = 0 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 6 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 12 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
        end
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 16 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            G.E_MANAGER:add_event(Event({
                trigger = "immediate", 
                delay = 0.1, 
                func = function() 
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                    return true 
                end
            }))
        end
    end
    for k, v in pairs(G.I.CARD) do
        if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
            v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
        end
    end
end

Why does this just happen instead of just going to x=1, y=0?

modern kindle
#

mkv moment

#

do mp4

frigid cargo
#

ok

rapid stag
#

is there a context or function on a joker that's called when the joker is initially created? for example, when it spawns into the shop or booster pack.

solar eagle
#

i think you could use set_sprites for its not intended purpose maybe?

frigid cargo
solar eagle
#

or mayb set_ability

red flower
#

set_ability yeah

rapid stag
#

bump

wintry solar
#

how on earth can you soft lock and still have the event queue running, what does that even mean

tropic carbon
#

honestly if you want to force a run reset just manually game over

tropic carbon
#

that is a thing right

#

like

when blind is won:
  if score // blindReq => 3:
    kill the run lmfao```
frigid cargo
modern kindle
#

i mean you can force gameover regardless but thats not what they want to do

tropic carbon
tropic carbon
modern kindle
#

id assume you could just infinite loop event

tropic carbon
#

that is one way

modern kindle
#

yea i think its poor design to punisht he player for performing well

#

but people have had all sorts of concepts

tropic carbon
#

i mean sure if you want to punish the player for overkill then by all means but maybe don't softlock the run so you have to manually start a new one

modern kindle
#

i mean i dont personally feel like that changes much

#

its not hard to manually start a new run

tropic carbon
#

i guess it's understandable if you expect to be able to still pause the game while it's "softlocked"

#

my concern comes from if you have to alt+f4 the game just to reopen it and keep playing

modern kindle
#

im pretty sure you can still restart through menu and through holding r
times where ive fucked up and the event queue was launching high i was able to

#

unless it was some wacky fluke

tropic carbon
#

oh cool

#

if you do that though you should probably tell the player you can still manually restart in this failstate

#

someone's gonna be stupid enough to think you can only alt+f4 out of it (me being a good example)

modern kindle
#

id assume the player would notice something has gone awry after nothing has happened for awhile
but you are right it should notify them
maybe once its triggered in the desc it can refresh and say that you need to restart your run

frigid cargo
#
if to_base then
                Flopprobj.soul_pos.x = 0
                Flopprobj.soul_pos.y = 7 
                to_base = false
            end

can i still do this inside a function out of the joker even though to_base is set inside the joker code?

red flower
#

imo if the effect soflocks you should only be able to alt+f4 out of it

#

anything else and you're a coward

modern kindle
#

im gonna soft lock you buddy

red flower
#

u can hardlock me

modern kindle
#

😳

frigid cargo
red flower
modern kindle
#

throw in your modprefix modprefix_to_base

frigid cargo
modern kindle
#

or call it modprefix_what_the_fuck

frigid cargo
modern kindle
#

something

#

lmao

tropic carbon
#

anyone got the hex codes for joker rarity? just google sheet housekeeping

red flower
tropic carbon
#

nvm i remembered imagecolorpicker exists

old epoch
#

that sould be it

frigid cargo
heavy frigate
#

Is card.ability only available after fully loading into a game?
Because i'm getting crashes trying to access it from the set_sprites function

red flower
#

card.ability exists after the card is created

frigid cargo
red flower
old epoch
frigid birch
#

is == 'is' in code?

frigid cargo