#💻・modding-dev

1 messages · Page 676 of 1

median veldt
#

ah

#

lmfao

red flower
#

it's a flag in the metadata, it's in the docs iirc

median veldt
#

HOOOLY SHIT

#

all that effort for it to actually be one line of code

#

thank you N

#

you are a lifesaver

rapid stag
#

that's how it is sometimes

median veldt
#

had i looked at the docs like a little closer i probably wouldve seen that

red flower
#

you are lucky because i decided to not use discord this week and i only checked the channel randomly while checking a notif

bright finch
#

for the mod manager should i get exe or msi for windows?

median veldt
#

since when was there a mod manager

bright finch
red flower
#

msi is an installer so i assume the exe is the portable version

#

i dont use it tho

median veldt
#

i didnt even know about this mod manager but i'd assume the exe isn't an inst- yeah what he said

#

i just happened to click on his profile

#

WHY does this have rich presence

naive coral
median veldt
#

which line is 296

naive coral
#

config = { extra

#

etc...

median veldt
#

oh

naive coral
#

its an issue with dividing a variable these i think

median veldt
#

card hasnt been defined yet

naive coral
#

so just ability.extra.chips then?

median veldt
#

just chips i think

red flower
#

no, you need to hardcode it or make chips a separate variable

median veldt
#

oh

#

mmthat makes sense actually

red flower
#

you can't use the chips value because it's defined at the same time

naive coral
#

so where should it go then?

red flower
#

before smods.joker do
local chips = number

#

and then use that for chips and chips gain

#

also chip_message is not necessary there

naive coral
#

will that still scale exponentially tho? the general idea is that it scales off of its previous value

red flower
#

ah

#

no

#

you need to do that in calculate, the config gets computed once when the game boots

thorn ingot
#

Hey guys, super super question.

Do you know if max_ante = is a thing for tags?

red flower
#

no

naive coral
#

ok i think i got it

thorn ingot
#

damn

#
     return (G.GAME.round_resets.ante >= 2 and G.GAME.round_resets.ante <= 3)
end,```
Does this serve for that purpose?
mystic river
#

that would work, yes

thorn ingot
#

omg, thanks. ❤️

median veldt
#

is it possible to cycle through every card you have (including jokers and consumables) or should i just do it manually (like hand, fyull deck, consumables, and jokers)

thorn ingot
#

Cycle as in viewing them like the deck selector or the collection in vanilla?

#

Hold on, I should probably not answer with a question without reading the prior context, haha.
Sorry.

median veldt
#

Cycle as in ipairs

#

No the context hasn't been said lol

#

I'm trying to remove every instance of a certain edition that you have

thorn ingot
#

Oh, I see. Not so sure I've seen that one.

median veldt
#

I'll just do it manually

#

unrelated, is there a function that like. draws the next card

because I have a thing that destroys a card and I feel like it should draw another card in its place

#

since it's not being done during scoring or anything

median veldt
#

oh ok lmao

median veldt
#

can i do a check to see if the game is currently scoring? is that a variable?

scenic steeple
#

so, I see how to change the color, but what about the highlight? like yk how xmult the red is highlight

fading rivet
#

amd then give that node color

rapid stag
#

when the soul tries to spawn a legendary joker, does it check in_pool?
so like if in_pool returns false, it can't spawn that joker

median veldt
#

is it

fading rivet
#

it us the next card in deck

median veldt
#

one small issue
do i need all these values

#

cuz i'm not sure what to set card to because tehres no way self.foobar_reference is a thing

fading rivet
#

it can br any card in deck

median veldt
#

yeah thats what i thought

fading rivet
median veldt
#

is the deck shuffled per se

#

i've never actually looked into it

fading rivet
median veldt
#

kk

median veldt
#

i want to make the ability not usable during scoring

#

as to not break stuff

#

Let Me Guess It Doesn't Work Like This

#

should I use events maybe?

#

i'm also not sure what percent does

fading rivet
fading rivet
median veldt
#

yeah neither thing fixed it

#

Oh wait what am I doing

loud summit
median veldt
#

Yeah ok

#

And that works perfectly

median veldt
loud summit
#

idk

median veldt
#

No it's fine I fixed it

median veldt
#

it WAS this though

silent sail
#

balloon :0

median veldt
#

couldn't find anything in the docs after some skimmin

daring fern
tulip pecan
#

For some reason, after updating SMODS to 1.0.0-beta-1503a, I noticed that anytime I used SMODS.add_card to create a playing card, or whenever my custom booster created cards, they wouldn't show any suit/rank data on them. Is it possible to fix this within my mod, or do I need to backport to an older SMODS version?

rapid stag
#

does anyone remember how string substitution works
i forgot

nvm, figured out a better, if not more janky way to do what i wanna do

rapid stag
#

does pseudorandom_element work on keyed tables and if so, is it possible to get the chosen key from the result?

rapid stag
#

how would you capture that?

local result, key = pseudorandom_element(table)
```?
umbral zodiac
#

yeah

#

any function that returns multiple values can be obtained like that

daring fern
rapid stag
#

what's the simplest and most efficient way to pull two unique pseudorandom_elements from one table nvm thought of a better solution

rapid stag
#

does table.remove(t, 1) work on keyed tables? no

thorn ingot
#

Hey. How do I refer to the total number of cards in deck?

#G.deck.cards does current cards in deck, not what I'm looking for.

#

I found it. It's #G.playing_cards.

Discord's search can be a godsend sometimes.

safe dawn
#

is xchips and exponent built into SMODS? if so, or if not how to I implement it.?

slim ferry
#

Xchips is, exponents are not

#

You can implement them by hooking SMODS.calculate_individual_effect, see how other mods add calculations that way

frosty dock
#

and not supplying both results in no front, both of these should be changed

safe dawn
#

I'm quite terrible at lua coding, and have been reusing vanilla code with modifications.

daring fern
safe dawn
daring fern
flint spindle
#

I'm trying to remake the boss tag so that it disables the boss instead of rerolling it, and it's not working, and I'm pretty sure it's the context.type stuff but idk

#

the way it works is that the tag just stays there until you enter a boss and then it activates and disables it, like selling a Luchador

daring fern
flint spindle
#

TYTYTY

flint spindle
#

one more thing, I'm modifying the voicher tag to make it free and I can't for the life of me figure out how to do it

#

I tried like 8 different things and nothing works and idk what properties vouchers have

daring fern
flint spindle
#

sorry it's not taking ownership, I'm planning to do something else

#

also how do I even hook card:set_cost like what does that mean

#

I feel bad for asking but I'm new to this

daring fern
flint spindle
#

YOU ARE AMAZING

dapper sun
#

how would i supress all normal game inputs?

median veldt
#

Why

dapper sun
#

doing a custom minigame thing that uses base love2d stuff and it breaks if you pause and exit the run while it's active

versed swan
#

I think you set game state to something that's not selecting stuff?

#

Oh, maybe G.CONTROLLER.locks.use = true?

dapper sun
#

ty

versed swan
#

Shit gtg back to work

red flower
#

im not sure if there's a state that stops pausing

rapid stag
# dapper sun doing a custom minigame thing that uses base love2d stuff and it breaks if you p...

i feel like what you should be doing in that case is to make it not break in that circumstance rather than just prevent the player from pausing and exiting the run

i mean sure ig they can just alt f4 if they need to, but

but a hacky way of forcing this could be to do something like

if G.SETTINGS.paused then
  G.FUNDS.exit_overlay_menu()
end

alternatively you can hook G.FUNCS.options and G.FUNCS.go_to_menu and just have them return early when your minigame is active, which is probably better

silent sail
#

thoughts on this? legendary? or give it a big drawback and make it custom rarity?

slim ferry
#

This is fine as rare i think

#

Since you need a ton of hands to get a lot of the really good jokers

median veldt
#

Yeah, rare

limber aspen
#

How do I apply mult/chips from context.before?

red flower
limber aspen
#

Thanks

rapid stag
#

😈

calculate = function(self, card, context)
  if G.STATE == G.HAND_PLAYED then
    return { mult = -1 }
  end
end
red flower
rapid stag
#

pretty much - a silly little idea that i had

sharp jasper
#

why does this happen

#

SMODS.Consumable {
key = 'igoera',
set = 'scarlet',
atlas = 'deconsume',
pos = { x = 1, y = 1 },
loc_txt = {
name = 'Igoera',
text = { '3 selected cards are', 'upgraded to {C:attention}Premium{}' }
},
cost = 3,
config = {},
loc_vars = function(self, info, card)
return { vars = { card.ability.extra } }
end,
use = function(self, card, area, copier)
end
}

#

SMODS.Atlas({
key = "modicon",
path = "icon.png",
px = 32,
py = 32
})

SMODS.Atlas({
key = "dejoker",
path = "dejokers.png",
px = 71,
py = 95
})

SMODS.Atlas({
key = "deconsume",
path = "consumables.png",
px = 71,
py = 95
})

SMODS.current_mod.menu_cards = function()
return { -- This takes any SMODS.create_card parameters
key = "c_deja_vu",
remove_original = false -- This removes the vanilla Ace
}
end

local may = {}
may.items = {
'jokers.lua', 'pokerhands.lua', 'scarlet.lua', 'code.lua'
}

may.lib = {
'recharge.lua'
}

for k, v in ipairs(may.items) do
assert(SMODS.load_file("items/"..v))()
end

for k, v in ipairs(may.lib) do
assert(SMODS.load_file("lib/"..v))()
end

idle plaza
mystic river
#

scale it by 4x instead just to see what happens (this is never actually correct, I'm doing science)

rapid stag
#

what is your pixel art smoothing setting?
off = uses your 1x asset
on = uses your 2x asset

sharp jasper
#

no idea

#

its on

mystic river
#

how this happened, i can't imagine, but that's what this result means

sharp jasper
#

the sprites are correct, but i want to fix it in the code

mystic river
#

there's no error in the code

sharp jasper
#

the sprites are the right dimensions though

#

1x is 710 by 380, 2x is 1420 by 760

mystic river
#

did you make the image bigger, or the canvas?

sharp jasper
#

image

#

i know the sprites are correct

mystic river
#

odd
your code and images are both correct

#

i guess balatro arbitrarily doesn't work for you for no reason

sharp jasper
#

literally 1984

mystic river
#

what precisely did you do when you tried scaling the 2x image by 4x for science?

sharp jasper
#

quadrupled 1x's image size and replaced the 2x image with it

mystic river
#

(this should not fix the problem, but it should at least make it a different problem)

sharp jasper
#

then committed it with vscode

mystic river
#

try doubling the 2x image directly

sharp jasper
#

nothing changed

mystic river
#

okay. at this point i suspect the game isn't looking at the 2x image you think it is for the 2x sprite. test 2 of this hypothesis, scribble randomly over the 2x image

sharp jasper
#

nothing changed

mystic river
#

okay, so that image is straight up not the 2x sprite sheet

round lion
#

i dunno why i nilchecked center.

mystic river
#

what does your asset folder look like?

round lion
#

like actually, is there anything that could warrant nilchecking for center in locvars

sharp jasper
#

when i look at it in vscode it isnt updated correctly, but in file explorer its correct

mystic river
#

is your vscode environment actually operating on the same folder as the one balatro loads from?

#

the appdata mods folder

sharp jasper
#

waitt

#

the 1x and 2x are in a copy in my downloads

mystic river
#

yeah that'd do it. editing the wrong file entirely

sharp jasper
#

i cant edit the image because it "contains system files"

#

in the real folder

mystic river
#

¿

#

what kind of setup do you have where a png is a system file

sharp jasper
#

idk

#

i just took it out of the mod file

#

it worked

#

mr_bones mr_bones mr_bones it was the wrong size

glossy sky
#

hey everyone, I was wondering if anyone knows in which context glass cards get destroyed

long sun
#

i've heard that there's a function that should be used instead of math.random, what function is it?

sharp jasper
long sun
#

i need this for the title screen, so it needs to be unseeded

#

(i assume pseudorandom needs a seed, but i might be wrong)

red flower
glossy sky
red flower
#

do it in after

#

it happens during context.destroy_card which is just before after iirc

glossy sky
#

right that worked. thank you!

wanton jolt
#

if you pick something from a table i believe its pseudorandom_element

long sun
#

ah kay

#

what function runs when continuing a run?

wanton jolt
#

as in to hook or for an individual card

long sun
#

to hook

wanton jolt
#

idk i wanted to hook that earlier but found an alternative

long sun
#

hmm okay ^u^

#

i'll take a look at the UI defs code

wanton jolt
#

its probably next to the one to start a game

red flower
#

but you can also use math.random directly in that scenario

long sun
#

i've tried that, but it's giving me the same number repeatedly

#

do i need to plug in the current time?

red flower
#

you might need to yes

#

to math.randomseed

long sun
#

alright gotcha, thanks ^^

scenic steeple
#

heyyyyy quick little question, how would I have a joker where hearts & clubs are the same suit
-# who doesn't love a weird mixed up half smeared joker

faint yacht
#

Hook SMODS.smeared_check.

daring fern
flint spindle
#

All of the code I have works, but how do I update the blind chips visually after changing the ante scaling? I'm assuming you use some sort of HUD_Blind thing but idk

#

since this is a tag it's outside of a blind, I want to update the chips on all the blinds visually before I enter one (after I enter and leave a blind it works fine)

rapid stag
#

honestly imo smeared should just be made into a calculate call with its own context

inner terrace
#

Is there a way to iterate over the entire localization file using current_mod.process_loc_text?
Most examples assign to specific strings individually

scenic steeple
#

so I've got an idea & am having an immense struggle bus trying to get it to happen, I'm trying to make a joker that makes played debuffed cards give 100 chips & 2.5 xmult, I've gone back to a clean slate now & can't think atm where to start

red flower
#

the animations will happen at a different time tho

flint spindle
#

I'm creating a new polychrome tag that gives polychrome to the next joker you buy instead of just adding it to one in the shop, but I don't really know what the context.type is for this scenario. There might be something else wrong too

red flower
#

i would use your mod's global calculate with context.buying_card and call tag:yep from there

reef bobcat
#

how would i make a joker that copies the ability of a random joker you have every round?

red flower
#

you would also need to decide what you do if the joker is not there anymore

reef bobcat
#

i guess i could have it check on round start

#
        if card.area and card.area == G.jokers then
            local other_joker
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
            end
            local compatible = other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat
            main_end = {
                {
                    n = G.UIT.C,
                    config = { align = "bm", minh = 0.4 },
                    nodes = {
                        {
                            n = G.UIT.C,
                            config = { ref_table = card, align = "m", colour = compatible and mix_colours(G.C.GREEN, G.C.JOKER_GREY, 0.8) or mix_colours(G.C.RED, G.C.JOKER_GREY, 0.8), r = 0.05, padding = 0.06 },
                            nodes = {
                                { n = G.UIT.T, config = { text = ' ' .. localize('k_' .. (compatible and 'compatible' or 'incompatible')) .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.32 * 0.8 } },
                            }
                        }
                    }
                }
            }
            return { main_end = main_end }
        end
    end,
    calculate = function(self, card, context)
        local other_joker = nil
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
        end
        local ret = SMODS.blueprint_effect(card, other_joker, context)
        if ret then
            ret.colour = G.C.BLUE
        end
        return ret
    end
}``` which part of blueprint denotes the position?
red flower
#

it loops until it finds blueprint in G.jokers.cards[i] and then it gets i+1 which is the card to the right

reef bobcat
#

ah ok

scenic steeple
#

fuck fuck what did I do, I was already treading weird waters with reversing boss blinds, then suddenly I've been getting this error, tried a simple step back to something I knew ran fine, but that ain't the fix & I'm worried I've just screwed everything

eager nimbus
flint spindle
flint spindle
#

ok am I doing this right or is this the wrong way to implement global calculate (I'm making the tag give polychrome to the next joker you buy)

#

ok it broke bc I didn't even say what the tag was lol oops

daring fern
flint spindle
#

sorry for sounding stupid but what do you mean by iterating over G.GAME.tags

#

oh I get it

#

thank you lol

#

it's still not working and I'm really sorry for the constant asking for help but I don't know what to do

#

global calculate is something I've never done before

wheat hedge
flint spindle
#

vremade is what I'm using to learn lol

#

I've programmed in other languages but this is my first time with anything lua

daring fern
flint spindle
#

in G.GAME.tags?

#

oh

#

lol that's a dumb mistake

near coral
#

Is it possible to add a badge from another mod for crossmod content

#

Like for the partner badge can you set it to display that badge when it'd otherwise be inaccessible without partner

limber aspen
#

How do I add dynamic line to description? (like ankh adding "removes negative from the copy" when you have a negative joker) I've tried to copy Ankh's loc_vars from vanillaremade but it doesn't work

daring fern
limber aspen
#

Thanks

tulip pecan
#

Is it possible to make all jokers from my mod 2x more common in the shop for a deck? If so, how would I do this, and if not, what are some things I could do to achieve a similar effect?

daring fern
# tulip pecan Is it possible to make all jokers from my mod 2x more common in the shop for a d...
local oldgetcurrentpool = get_current_pool
function get_current_pool(_type, _rarity, _legendary, _append)
    local g, _pool_key = oldgetcurrentpool(_type, _rarity, _legendary, _append)
    if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'b_modprefix_key' then
        for k, v in pairs(copy_table(g)) do
            if v ~= 'UNAVAILABLE' and G.P_CENTERS[v] and G.P_CENTERS[v].set == 'Joker' and G.P_CENTERS[v].original_mod and G.P_CENTERS[v].original_mod.id == 'modid' then
                table.insert(g, v)
            end
        end
    end
    return g, _pool_key
end
```?
frosty dock
frosty dock
flint spindle
#

making a tag that creates 2 other random tags, I can't figure out what I've done wrong

elder rune
#

How would you create a joker where a property of it must be above a threshold (e.g. only Jokers that cost more than 7 or have "immutable" as true)

daring fern
elder rune
#

makes sense

frosty dock
flint spindle
#

TYTY

elder rune
#

oh wait nah I found the solution

elder rune
flint spindle
#

one final thing with this, when the tag is triggered the two tags it produces don't, even if they're supposed to trigger immediately like a garbage tag or something

solemn wharf
#

hi im trying to create a joker that gains mult only when selling jokers (and not other cards) and i tried doing this code but testing it also gains value when selling other cards, any ideas?

hidden aspen
solemn wharf
#

im kinda new to modding and i still dont know a lot of things sry

daring fern
solemn wharf
open moth
#

why are my jokers ignoring the "one card of each max" rule

daring fern
open moth
#

ye

surreal knot
#

That's the answer, they still can appear if spawned with debugplus

#

So in normal run this won't happen

open moth
#

ok

silent sail
#

what mult on a boss blind should i put for a garunteed the soul (inspired by panopticon)

primal robin
frosty dock
distant junco
#

yo anyone here know how to make a texture pack for just one card?

#

ive made the texture pack, but its only for one card so i just want it to only be that one card (standard joker)

slim ferry
#

you should set keys = { "j_joker" } in the AltTexture

#

iirc

distant junco
#

ahh okay

limber warren
#

so whenever you're making a custom context, how can i modify a variable declared in the context?

#

like i have a damaging context but i have something that scales down your damage and it seems to modify stuff locally, but it doesnt actually change the context value

#

and im not really sure how effect tables work or how to implement them properly

red flower
median veldt
#

Would it be possible to like. Exit a blind without cashing out, and mark it as skipped?

#

Also, how do you influence hands per round, permanently and temporarily

median veldt
#

I figured out how to do it temporarily, but not permanently

#

And same with permanent hand size

red flower
rapid stag
#

is it possible to make a gradient with another gradient as a constitutent colour or do you have to do merging stuff

frosty dock
rapid stag
frosty dock
rapid stag
frosty dock
#

yeah

#

you can check the lsp def for things like that

flint spindle
#

I made a tag that creates 2 other random tags, but when it's triggered the two tags it produces don't trigger immediately, even if they're supposed to like a garbage tag or something

rapid stag
#

...do non-gradient colours have colour tables too? how do i distinguish between them

frosty dock
#

a gradient is an extension on this which still has indices 1-4 akin to being a colour, but have additional fields that define their behaviour as gradients

#

the colours table on a gradient is, in turn, a table of an arbitrary amount of colours

rapid stag
#

i see girldmDead i must turbojank my implementation then

daring fern
# median veldt and bunp
G.STATE = G.STATES.BLIND_SELECT
G.STATE_COMPLETE = false
G.GAME.blind:defeat()
ease_chips(0)
G.FUNCS.draw_from_hand_to_discard()
G.E_MANAGER:add_event(Event({
    func = function()
        G.E_MANAGER:add_event(Event({
            func = function()
                G.E_MANAGER:add_event(Event({
                    func = function()
                        G.FUNCS.skip_blind(G.blind_select_opts[G.GAME.blind_on_deck:lower()]:get_UIE_by_ID('tag_'..G.GAME.blind_on_deck).children[2])
                        G.GAME.tags[#G.GAME.tags]:remove()
                        return true
                    end
                }))
                return true
            end
        }))
        return true
    end
}))
rapid stag
#

bump

rapid stag
rapid stag
#

it really specifically does not like trying to draw the new badge with the gradient

#

ohhhhhhhhhhh

#

figured it out girldmDead nope, nvm. i'm just gonna implement this a different way

rapid stag
#

ok so the lesson here is to just not try and create gradients during runtime

#

don't do that

tulip pecan
#

I have a problem with my consumable set. My set has two rarities, which I use to make some cards more rare than others. However, these consumables can be added and removed from the pool at any time, meaning if all consumables from rarity 1 are unavailable, then the shop will spawn jimbos in their place, instead of defaulting to rarity 2, which is what would be left. I understand that this is to keep rarer cards from becoming too common, however this is not how I want the set to work. can I disable this?

red flower
vocal cliff
#

Does anyone have tips on where I should start with coding in Lua? This is my first time going into coding fully, I'm not completely clueless but it sure feels like I am at times lol, looking at some of this stuff is overwhelming so I just need a specific place to start at

#

Like any recommended tutorials/guides

sturdy compass
#

For Lua as a whole no, but for Balatro modding there's a pretty decent guide here #1349064230825103441

#

I've also been working slowly on a video guide for balatro modding so hopefully that becomes of use when its finished too

vocal cliff
sturdy compass
#

happy to help

tulip pecan
#

Is it possible to change the weights of booster packs mid-game? I've attempted to change the weight of a booster pack of mine using the un-commented code shown (which equates to ~20,000 for testing purposes), and nothing changes. However, when I manually set it as shown to 9,999 it shows up effectively 100% of the time, which makes me think that it doesn't update the weights automatically

naive coral
#

where on the smods docs is talisman compat/power mult located? i saw it once and im having trouble finding it right now

sturdy compass
#

emult is a smods feature now

naive coral
#

fr? where is it documented?

sturdy compass
#

as for talisman, just use Amulet instead, as it does not require specific compat usage

#

Looks like it isn't for somereason, but I believe you can just use emult as a return key for power mult

rapid stag
naive coral
#

where is the talisman compat located anyway? more people use talisman anyway

#

i dont think it is, it just shows error and no changes on a joker

sturdy compass
#

am I stupid??

#

cuz this could very easily be the case

red flower
tulip pecan
#

🫡

red flower
#

it's not in the docs let me add it real quick

tulip pecan
#

i may have just missed it

red flower
#

nah it just isnt there

tulip pecan
#

oh fire

sturdy compass
#

I could've sworn it was added at some point lmfao

red flower
naive coral
#

probably

#

yeah\

#

ty bro

red flower
#

i should replace talisman with amulet there

naive coral
red flower
#

just emult
emult_mod will not have a message

naive coral
#

i see

#

ty

red flower
#

youre missing quotes here btw

naive coral
#

it seems to work anyway

#

the text i assume u mean?

red flower
#

yes

naive coral
#

it still works so uhh, aint broke dont fix?

red flower
#

i can assure you that wont work

#

so it either didnt save or its doing another strange lua behavior that will break the description

naive coral
#

t

#

misclick

#

ohh its there

#

just copy and paste didnt pick it up?

#

idk man

red flower
#

lol

naive coral
#

windows 11 - now with added vibe coding!

#

(and 6 quintillion bugs)

#

also whats the standard color for expontential mult in most mods?

#

keep it red or was it purple?

idle plaza
#

Purple

naive coral
#

just X:purple works, or do i need to define it

idle plaza
#

Just checked and it's actually X:dark_edition

red flower
#

yeah its dark edition

rapid stag
naive coral
#
    key = 'GreenSquare',
    loc_txt = {
        name = 'Green Square',
        text = {
            "{X:purple,C:white} ^#1# {} Mult, Increases by {X:purple,C:white} ^#2# {}",
            " Mult after boss blind"
        }
    },
    config = { extra = { emult = 1.2, emult_mod = 0.4 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.emult } }
    end,
    rarity = 4,
    atlas = 'Modtest',
    pos = { x = 2, y = 0 },
    cost = 20,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                emult = card.ability.extra.emult,        
            }
        end
        if not context.blueprint and context.end_of_round and G.GAME.blind.boss and context.main_eval then
            card.ability.extra.emult = card.ability.extra.emult + card.ability.extra.emult_mod
            return {
                message = '{X:purple,C:white} Upgrade!{}',
            }
        end
    end
}```
this is my joker, any idea why the #2# part shows up as nil? i thought it was there in the config.extra, and it correctly scales after beating the boss
idle plaza
naive coral
#

oops mb

#

ty

rapid stag
#

bump

red flower
#

so i can search

rapid stag
# red flower can you copy the patch here
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''create_option_cycle({options = loc_options, w = 5.5, cycle_shoulders = true, curr_suit = _suit, opt_callback = 'change_collab', current_option = current_option, colour = G.C.RED, focus_args = {snap_to = true, nav = 'wide'}}),'''
position = "at"
payload = '''
create_option_cycle({options = loc_options, w = 5.5, cycle_shoulders = true, curr_suit = _suit, opt_callback = 'change_collab', current_option = current_option, colour = G.C.SECONDARY_SET.UIDefault or G.C.RED, focus_args = {snap_to = true, nav = 'wide'}}),
'''
times = 1
match_indent = false```
rapid stag
#

...right. i need to patch that girldmDead

#

it works! girldmMunch

...does anyone know where the collection's tag and blinds cyclers are created?

red flower
naive coral
#

how should i go about making a joker that scales its mult off of jokers of a certain type, do i add jokers to a pool and then do it there? what if i wanted to add vanilla jokers?

red flower
naive coral
#

ty

#

and is the default just any joker?

#

does it have to be something special

red flower
#

the default is whatever joker (or card) it should give when you have all of them without showman

vale zinc
#

Where in G (i.e., eval G.<???>) is the information for Challenge Decks stored?

red flower
vale zinc
#

What'd you use to search for that, is that through GitHub?

#

(Also, it is working; eval G.CHALLENGES[1] returns The Omelette's information.)

red flower
#

i just have the smods and lovely folders in my workspace

vale zinc
#

I only have Notepad++, but I coded a simple Python program to search through all files in a directory for a given phrase. It goes a little something like this:

What directory would you like to search in?: <directory/goes/here>
What string are you searching for?: <string_goes_here>
----------
Found in file://C:/Users/path/to/file/that/string/is/found/in.txt
----------
#

I didn't know where ever to start looking, though, and thought someone in this channel might know.

quick scarab
#

Roxy kinda finished I just need to make a signature

ionic gust
#

you should get vscode if you have notepad++ lol

naive coral
red flower
#

you need to iterate through G.jokers.cards and check each one for the pool

naive coral
#

how would i do that?

red flower
#

how to iterate or how to check the pool?

naive coral
#

obv thru a loop, but what to check

red flower
#

(joker.config.center.pools or {}).KryptonGreen

tulip pecan
#

How do make this not overwrite the cards already banned in the challenge?

rapid stag
#

include the cards that were already banned

tulip pecan
#

is there a way to import them? or do I have to manually re-ban everything?

rapid stag
#

probably manually

#

although a way to add banned cards to existing challenges might be interesting

red flower
#

you would need to access SMODS.Challenges.key.restrictions and merge the lists

versed swan
#

does anyone have a good way of changing which ranks jokers target? at least when it comes to jokers that hardcode targetted ranks

#

(which i assume is 90% of modded jokers that target ranks)

timid zinc
#

how do i offset a message's position?

timid zinc
versed swan
#

dang, that's what im doing rn, and it works but i cant help but feel it's super scuffed

timid zinc
#

that's the closest thing i could think of without editing other joker's contexts which is very scuffed

umbral zodiac
#

you could hook card:get_id() if you aren't already

sturdy compass
versed swan
median veldt
#

if I were to steal the code from Oops would running that code affect the probabilities forever

#

or would it affect it just for the round (this is what I want)

sturdy compass
#

Forever

versed swan
#

im reading through friend group stuff since friend of mine helped with this problem and i realized that my dumbass didn't pick up on what is essentially my friend's suggestion to hook card:get_id()

#

also realizing im not using get_id() enough

median veldt
vale zinc
#

This code-snippet is in my utility/functions.lua file, to confirm if these functions can be called immediately after they're defined. Why aren't they?

LAPSEMS.recursive_list_maker = function(list_to_use, end_of_list)
    --[[
    k_lapsems_list_and = "#1# and #2#",
    k_lapsems_list_or = "#1# or #2#",
    k_lapsems_list_recursive = "#1#, #2#",
    --]]
    if not LAPSEMS.contains({'and', 'or'}, end_of_list) then
        end_of_list = 'and' -- defaults to "and"
    end
    
    if #list_to_use == 1 then
        return list_to_use[1]
    elseif #list_to_use == 2 then
        return localize{
            type = 'variable',
            key = 'k_lapsems_list_' .. end_of_list,
            vars = {
                list_to_use[1],
                list_to_use[2]
            }
        }
    else
        return localize{
            type = 'variable',
            key = 'k_lapsems_list_recursive',
            vars = {
                table.remove(list_to_use, 1),
                LAPSEMS.recursive_list_maker(list_to_use, end_of_list)
            }
        }
    end
end
print('test: ' .. LAPSEMS.recursive_list_maker({1, 2, 3, 4}, 'or'))
-- Should print "1, 2, 3 or 4"
median veldt
#

Oh actually I can't even steal from this code

sturdy compass
median veldt
#

No it's a custom thing

#

I have a button that does an effect
You can only use it once a round

#

Except for this effect which is infinite but you pay money to use it

sturdy compass
#

I’d set some sort of global variable, funnel it into mod_probability thru mod calculate, and then reset the var at the end of the round also with mod calculate

median veldt
#

I could also just make a copy of Oops that gets deleted at the end of the round except that's stupid

#

Do Jokers that aren't in G.jokers still trigger I have a stupid fucking idea

#

Nevermind actually I'm not going to do that

versed swan
versed swan
median veldt
#

im so sorry LMAO

#

those last two messages (now deleted) were meant for another server LFMAO i wasnt watching where i was typing

versed swan
lost lily
vale zinc
#

I'm making a Challenge Deck that has only a limited selection of Boss Blinds, and I want the custom-rule localization text to read "All Boss Blinds are #1#", with that variable being a string of all the permitted Boss Blinds.

naive coral
#

is it possible to make a timer countdown on a joker description countdown while hovering over it? it stays at one value until i hover off and on it again

median veldt
idle plaza
# vale zinc It's no localization error, I can input that function statement and it works wit...

No that's almost definitely a localization error. Nothing else would just let you print "ERROR' like that.

I don't know for sure, but if you're only seeing this error in this specific context, it's possible that the mods' lua files are loaded before localization files. Try running this print statement with a version of the function that outputs raw strings, without localize() calls.

vale zinc
versed swan
#

Oh wait, I see the issue now

#

SMODS is loading the main file, which loads ??? which loads utility/functions.lua, which runs the print function - all of which occurs before localization is loaded

#

Print function occurs before localization Ioading - so localize is called before localization is loaded - which causes ERROR because localize is trying to refer off of an empty localization table at that point in time

vale zinc
#

So how do I load the localization files before anything else?

versed swan
#

Afaik you kinda can't, or at least you'd need patching of major SMODS loading processes (not fun)

idle plaza
#

You were just trying to test the function to begin with, right? You're likely off just calling the function later instead.

vale zinc
idle plaza
vale zinc
idle plaza
flint spindle
#

how do I do take_leadership for joker descriptions? I'm trying to override matador

vale zinc
flint spindle
#

oh you just add the new description with the rest of the object?

#

ok sick

thorn ingot
#

I would have the take ownership on a different file and keep the new description on the localization file.
It helps a lot to keep things organized.

flint spindle
#

good idea

flint spindle
#

I was overriding all the tags with new ones (most of which work fine), but the speed tag gave me this error when I tried to view its description text

#

sorry for the massive dump of information

daring fern
flint spindle
#

to the take_ownership function?

#

like with the other variables?

#

oh you mean replacing i

#

gotcha

#

nope that failed

#

:(

#

I can also send the additional context if that helps

daring fern
flint spindle
#

oh ok

thorn ingot
#

is the brace below Tag in your localization a bug? I don 'think there should be one there

flint spindle
daring fern
thorn ingot
#

oh, I see. Thanks.

flint spindle
#

I made a new tag that creates 2 other random tags, but when it's triggered the two tags it produces don't trigger immediately, even if they're supposed to like a garbage tag or something

thorn ingot
#

I believe that is a bug of the base game. Seen it quite a bit in mods.

I don't know if there is a solution.

flint spindle
#

dang

wintry solar
#

You need to call the trigger

eager nimbus
#

wotdefok am i doing wrong its like right back to balanced gamemode when i try to set it to elation: unleashed then exit the config menu and enter it back
local mod = SMODS.current_mod
mod.config = mod.config or {gamemode = "Balanced"}
SMODS.load_mod_config(mod)

mod.config_tab = function()
return {
n = G.UIT.ROOT,
config = { align = "cm", padding = 0.05, colour = G.C.BLACK, r = 0.1 },
nodes = {
create_option_cycle({
label = "Gamemode",
options = {
"Balanced",
"Elation: Unleashed"
},
ref_table = mod.config,
ref_value = "gamemode",
w = 4
})
}
}
end

lusty marten
#

Are there any way to mod Balatro on phone (Android)?

tidal hemlock
#

its against that platform's tos

hasty mist
#

is there a wiki page for the smods operator api?

daring fern
hasty mist
#

Thanks, i could not find it for the life of me

#

aw fuck is there a new way of loading files in smods now

#

my old system is no longer functional

hasty mist
#

oh wait

#

is this channel no longer for programming help?

#

it's been ages since I've been here

red flower
#

it is

#

support is for playing

hasty mist
#

oh i see

#

gotcha

wintry solar
hasty mist
#

this basically

wintry solar
#

I’m not aware of a reason this wouldn’t work anymore

hasty mist
#

the missing comma oh my god

#

been about half a year since i wrote any code

#

sorry

wintry solar
#

Oh yeah that’ll do it

hasty mist
#

that it will

#

i am tired

pastel kernel
#

how do you check for each unique card modification(enhancement, edition, seal) in deck?

slim ferry
#

Doesnt ascensio have something like this you could look at

#

Exotic drivers license iirc

pastel kernel
#

what's number.exp

lyric wadi
#

how do i change the buy price of a card but like not in config

dreamy thunder
#

like egg?

#

editing its sell cost i mean

lyric wadi
#

no that's the sell price

dreamy thunder
#

no i know

lyric wadi
#

i wanna change it's buy price

dreamy thunder
#

like egg but for buy price

lyric wadi
#

i suppose

dreamy thunder
#

well you can change its cost in its ability table iirc

lyric wadi
#

yeah but is that table editable at runtime

dreamy thunder
#

there is also G.GAME.inflation but thts for all items in shop

dreamy thunder
pastel kernel
#

Revo, what’s number.exp

lyric wadi
#

like a joker that, for example, start off costing $20 but gets $2 cheaper each time you see it and don't buy it

#

that kinda functionality

dreamy thunder
lyric wadi
#

im generalising what im trying to do in case i can use it for something else later

#

but now i sound like im being cagey about it

dreamy thunder
#

you could save the new cost to a variable and set it as that when it appears

lyric wadi
#

im still perfecting Imposterous the buy price and it being always uncommon gives it away

#

so can you just chage self.cost or is that a read only value at that point

dreamy thunder
#

it might not even be in an ability table i was guessing

dreamy thunder
#

running card:set_cost() would reset it though

#

i think?

#

no nvm

red flower
lyric wadi
#

how often is it ran

#

cuz for my purpose i think it's fine since i need it only to display in shop to disguise it

red flower
#

well if you buy that one voucher it will update

rigid solar
#

How would I create a cardarea that doesn't draw the rectangle or the X/Y, but still renders the cards in it? I tried some stuff but everything I tested that hides the rectangle also hides the cards 🤔

lyric wadi
#

i think im okay with that, it's an uncommon situation that they appear together and when they do the player gets an extra clue to tip them toward realising something is wrong

red flower
lyric wadi
#

very intentional game design

pastel kernel
#

issues lie within the commentslua SMODS.upgrade_poker_hands{ from = card, parameters = { "chips", "mult"}, level_up = false, hands = "",-- most played poker hand func = function (base, hand, param) return base -- ^^ cm end }

red flower
#

there's a snippet in vanillaremade wiki for most player poker hand

red flower
#

no, the wiki

pastel kernel
#

o

#

do i keep the high card

red flower
#

that's just the default in case it doesn't find anything but in most cases it doesn't matter

pastel kernel
#

cool

#

ok now about tetration.

hidden notch
#

Is there a way to get Text with Color out of the v_dictionary? (Or are the any Alternative ways)
Example Entry that I want to reference;```
[...]
v_dictionary = {
SEMBY_next_test = "Next in {C:attention}#1#{}"
},
[...]

I have a Text-Box/Joker and want to be able to Switch a Single Line in it with multiple other Lines that have Different Colors and Values
primal robin
#

Unless you parse a line manually w/ SMODS.localize_box(loc_parse_string(..))

hidden notch
#

Well, I'm gonna take a look at that then lewxen_ok

pastel kernel
#

how do you tetrate in lua?

slim ferry
#

talisman and amulet have functions for it

#

otherwise you get to manually recreate it via a function yourself

pastel kernel
#

so you can just write return base ^^ cm?

slim ferry
#

no

#

function

#

idk what its called but there is a function for it

#

oh its a method

#

BigNum:arrow(arrows, operand)

pastel kernel
#

so i return Bignum?

slim ferry
#

what

#

well you need to convert the base to bignum to use arrows

#

i assume thats what you mean

pastel kernel
#

i'm just trying to return a value bigger than the original

#

so

#

i'm guessing i put 2 in arrows

slim ferry
#

yeah

pastel kernel
#

and base in operand

slim ferry
#

to_big(base):arrow(2, amount)

#

no operand is whats to the right of an operation

slim ferry
pastel kernel
#

ok so operand is cm

slim ferry
#

yea

pastel kernel
#

is number.exp a pre-existing function in amulet

#

wait, math.exp?

slim ferry
#

math.exp returns e^x

pastel kernel
slim ferry
#

oh i assume the amulet one is a regular exponent

pastel kernel
#

this is what it looks like in ascensio```lua
function Number.exp(a, b)
return Number.toBig(a):pow(b)
end

slim ferry
#

though you shouldnt need that here since this doesnt scale multiplicatively like drivers license exotic

turbid kindle
#

Boss Blind Jokers

Defeating a Boss Blind adds its Legendary Joker to the shop for $30. This card does not take up a shop slot. These cards can also be obtained via soul cards.

Trapper (The Hook)
After each hand, discard 2 random cards from your hand.
Discarded cards gain a random Edition and Steel.

Cattleman (The Ox)
When you play your most played hand, lose 10% of your money and gain that amount as +Mult.
10% chance this card gains XMult equal to 25% of that amount.

Tenant (The House)
Your first hand each blind is drawn face down.
Each flipped scoring card gains +Chips equal to its rank and +1 Mult when scored permanently.

Warden (The Wall)
Blind requirement is reduced by 8% of its base value per hand played.
Blind requirement cannot go below 56% of its original value.

Stagecoach (The Wheel)
1 in 8 cards are drawn face down.
If a flipped card is played and does not score, it becomes Negative and gains +4 Mult when scored permanently.

Strongman (The Arm)
When you play a hand:
If it is your most played hand, nothing happens.
Otherwise, reduce its level by 1 and increase your most played hand level by 1.

Knight (The Club)
All Clubs are debuffed.
If your first hand contains only debuffed cards, held cards gain chips equal to that hand’s total Chips permanently.

Mermaid (The Fish)
After each hand, draw cards face down.
If all cards played are face down:
Level up that hand twice
This card gains X1.15 Chips permanently.

Seer (The Psychic)
Hands must contain exactly 5 cards.
Unscored cards grant +Mult equal to their rank and trigger their Seals and Enhancements.

Mercenary (The Goad)
All Spades are debuffed.
When another card or Joker would be debuffed, destroy a Spade in hand to prevent it.

Sailor (The Water)
Start each blind with 0 discards.
For each discard removed this way, gain:
+0.75 XMult
+1 Hand Size (this blind only)

slim ferry
#

oh its

#

wait what

#

ok

turbid kindle
#

Assassin (The Window)
All Diamonds are debuffed.
If a debuffed card is played and does not score, transform it into a random scoring card with a random Seal or Edition.

Aristocrat (The Manacle)
-1 Hand Size.
If you beat a blind without discarding, gain +1 permanent discard.

Supervisor (The Eye)
You cannot play the same hand type twice per blind.
At end of blind, all hands played this blind gain +1 level per hand played.

Vocalist (The Mouth)
You may only play one hand type per blind.
If you do not discard this blind, when blind ends:
Level up your most played hand
Gain $1 per level of that hand

Gardener (The Plant)
Face cards are debuffed.
All numbered cards count as the same rank (Ace)

Alchemist (The Serpent)
After each play or discard, draw 5 cards.

Architect (The Pillar)
Cards played earlier this ante are debuffed.
When you play a debuffed card, create a copy with a random Enhancement or Edition.

Doctor (The Needle)
You may only play 1 hand.
All remaining hands become discards.
No discard limit.
Gain +1 Hand Size per removed hand.

Intellectual (The Head)
All Hearts are debuffed.
When discarding a debuffed card, adjacent non-Edition cards have a 50% chance to gain Negative or become debuffed this blind.

Dentist (The Tooth)
Lose $1 per hand played.
After defeating a Boss Blind, gain triple the money lost this ante.

#

Pyromaniac (The Flint)
Base Chips and Mult are halved.
All +Chips, +Mult, and XMult effects are doubled.

Revolutionary (The Mark)
All but 1 card are drawn face down.
Each scoring card grants:
+2 XMult
+5 Mult
X2 Chips

Dagonet (Amber Acorn)
All jokers are shuffled face down each blind. Each joker's positive values are doubled and all negative effects are removed.

Folly (Verdant Leaf)
All cards are debuffed until selling 2 jokers this ante.
After selling 2 Jokers this ante:
Replace them with Negative copies of random Jokers you own

Jasper (Violet Vessel)
Reduce Blind requirements by 8% per Joker owned (max 96%).

Cicero (Crimson Heart)
Each hand, a random Joker is disabled.
If this disables Cicero:
At end of blind, increase all Joker values by 50% each time this happens.

Clopin (Cerulean Bell)
1 card is always selected.
If you discard a non–High Card hand, destroy those cards.
If played, the selected card gains:
+2 Mult per card destroyed
+0.2 XMult per card destroyed

slim ferry
#

bruv

turbid kindle
#

I apologize for the wall, I know you two were talking

#

I've been writing this in here for awhile, I am genuinely sorry

pastel kernel
#

exotic drivers license uses this x_mult = Number.exp(card.ability.extra.base, cnt)

turbid kindle
#

Generally just want people's thoughts on the jokers I made here

slim ferry
slim ferry
#

since this channel is for dev help

turbid kindle
#

Ouh, my apologies then, I'll go do that

pastel kernel
#

oh wait, aphi said adds

#

idk

#

is it?

slim ferry
#

probably add 1 to that

#

so it doesnt start at ^^0

pastel kernel
#

so the thing drivers license uses in ascensio is mod_count, and it's set to 0, so i'll just set that to 1

slim ferry
#

well

#

no

pastel kernel
#
--thanks ascensio
local function count_mod()
    local mod_count = 0

    if G and G.deck and G.deck.cards then
        for _, card in ipairs(G.deck.cards) do
            -- edition
            if card.edition then
                mod_count = mod_count + 1
            end
            -- seal
            if card.seal then
                mod_count = mod_count + 1
            end
            -- enhancement
            if next(SMODS.get_enhancements(card)) then
                mod_count = mod_count + 1
            end
        end
    end

    return mod_count
end```
slim ferry
#

thats the count of how many modifiers there are

#

i presume

#

yeah

pastel kernel
#

so then cnt + 1?

slim ferry
#

just add 1 to the totaled amount

pastel kernel
#

oh

#
((card.ability.extra.cm * cnt) + 1)```
slim ferry
#

i would assume so

pastel kernel
#

i should probably add an "if not 0.33" somewhere

slim ferry
#

what

#

you mean like

#

count ~= 0

pastel kernel
#

or if not < 0.99

#

so it doesn't accidentally fuck up your poker hand

slim ferry
#

well you can just check count > 0 instead then

#

though count shouldnt ever be less than 0 anyway

#

or check if total > 1 i guess

pastel kernel
#

mod_count > 1?

slim ferry
pastel kernel
#

i think count_mod() > 0 is valid?

slim ferry
#

count_mod isnt a function

#

but yeah

#

assuming you use whatever your own variable name is

pastel kernel
#

did you scroll u-

slim ferry
#

oh

#

well

#

better to store the count from count_mod once

#

and then use it in the check and level up

#

so you dont count them once every time

pastel kernel
#

also drivers license uses local cnt = count_mod(), so maybe cnt > 0?

slim ferry
#

yes thats

#

what i have been saying

slim ferry
pastel kernel
#

i pray this workslua calculate = function (self, card, context) local cnt = count_mod() if context.before and (cnt > 0) and not context.blueprint then local _handname, _played = 'High Card', -1 for hand_key, hand in pairs(G.GAME.hands) do if hand.played > _played then _played = hand.played _handname = hand_key end end local most_played = _handname local cm = ((card.ability.extra.cm * cnt) + 1) return { message = localize("k_upgrade_ex"), colour = G.C.DARK_EDITION, func = function() SMODS.upgrade_poker_hands{ from = card, parameters = { "chips", "mult"}, level_up = false, hands = most_played, func = function (base, hand, param) return to_big(base):arrow(2, cm) end } end } end if context.end_of_round and context.main_eval or context.forcetrigger then SMODS.add_card({ key = "c_familiar", area = G.consumeables }) end end,

slim ferry
#

i would assume it does

#

you probably want to set a custom StatusText parameter so it doesnt say just the addition for the animation

#

StatusText = "^^"..cm

pastel kernel
#

in func or upgrade_poker_hands

slim ferry
#

in upgrade_poker_hands

pastel kernel
#

With caps?

slim ferry
#

yes

pastel kernel
#

i should've seen this coming considering not even drivers license exotic works

slim ferry
#

can you show the count_mod function

#

it should be something like this

pastel kernel
#

scroll up

slim ferry
#
function count_mod()
    seen = {}
    for _, c in ipairs(G.playing_cards) do
        local ed = c.edition and c.edition.key
        local seal = c:get_seal()
        local enh = SMODS.get_enhancements(c)
        if ed then seen[ed] = true end
        if seal then seen[seal] = true end
        for _, key in ipairs(enh) do seen[key] = true end
    end
    return #seen
end
#

it should be smth like this

#

for unique modifiers

#

in full deck

pastel kernel
#

so i got rid of the cnt > 0 and it works, but literally no change in poker hand whatsoever

faint yacht
lyric wadi
#

can you change card.rarity

#

would that fuck things up

faint yacht
#

Either add

local mods = 0
for _, mod in pairs(seen) do
  if mod then mods = mods + 1 end
end
return mods

or do table.insert instead of setting values in seen directly.

pastel kernel
#

i'm not gonna sleep until i get this over with

#

it's 12AM here btw

pastel kernel
faint yacht
#

Pretty much.

pastel kernel
#

it does not check for enhancements

#

local enh = SMODS.get_enhancements(c)

--or

local enh = next(SMODS.get_enhancements(c))

slim ferry
#

It should not be next

pastel kernel
#

alr

#

idk how it doesn't check for it tho

slim ferry
#

try for key in pairs instead of for _, key in ipairs

#

I forget how exactly the get_enhancements return is structured

pastel kernel
#

i also wanna change the leveling color of the status text

#

also this only affects chips, idk why mult doesn't upgrade too

#

ok enhancement checking works

slim ferry
#

idk about the upgrade problems

#

It should work just fine

#

And i dont think custom colours can be set for the statustext since its part of a vanilla function

pastel kernel
#

ok nvm i was just blind

#

god i love this placeholder

#

ok now i need to set up the spectral spawning.

#

how's this?lua if context.end_of_round and context.main_eval or context.forcetrigger then local itemtray = { "c_familiar", "c_grim", "c_incantation" } SMODS.add_card({ key = itemtray[math.random(#itemtray)], area = G.consumeables }) end end,

umbral zodiac
#

math.random 🥀

pastel kernel
slim ferry
#

Who

#

Use pseudorandom_element bro

pastel kernel
#

his name forgotten months after the coveted 900n1's Gamblepack was unveiled 🥀

lyric wadi
#

ok but like outside of particles there's like few reasons to use math.random

slim ferry
#

Okay but you should still use pseudorandom functions for gameplay related things yeah

pastel kernel
#

i'll change it

lyric wadi
#

unless you explicitly want to allow savescumming

limber warren
red flower
pastel kernel
#
            local itemtray = {
                "c_familiar",
                "c_grim",
                "c_incantation"
            }
                local g = pseudorandom_element(itemtray, "busterb_hedera")
            SMODS.add_card({key = g, area = G.consumeables, edition = "e_negative", key_append = "minos"})
            end```
#

oh wait i forgot to change the append

#

does this work?

limber warren
red flower
limber warren
#

i see

#

i know this is a dumb question, but what would you put in as the flag for this function to work? in the game dumps, im seeing that theres a loop that iterates through a separate smods function but im not really doing that

viscid talon
#

guys im so stupid idk how to fix this

#
-- Plea Deal
SMODS.Joker({
    key = "pleadeal",
    config = { extra = { card.ability.extra.d_size } },
    loc_txt = {
        ["name"] = "Plea Deal",
        ["text"] = {
            {
                "{C:red}Discards{} are added to {C:attention}hand size{}",
            }
        },
    },
    pos = { x = 4, y = 7 },
    cost = 9,
    rarity = 3,
    blueprint_compat = false,
    eternal_compat = false,
    perishable_compat = true,
    unlocked = true,
    discovered = false,
    atlas = "CustomJokers",

    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.d_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.d_size)
    end
})```
#

WHAT DOES THIS MEAAAAAN woesuke

limber warren
#

change card to self and see if it works

slim ferry
#

...no

slim ferry
#

shouldnt you be having d_size = some number

viscid talon
#

idk i just got this from drunkard's code

slim ferry
#

that

#

definitely isnt drunkard code?

viscid talon
#
-- Drunkard
SMODS.Joker {
    key = "drunkard",
    blueprint_compat = false,
    rarity = 1,
    cost = 4,
    pos = { x = 1, y = 1 },
    config = { extra = { d_size = 1 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.d_size } }
    end,
    add_to_deck = function(self, card, from_debuff)
        G.GAME.round_resets.discards = G.GAME.round_resets.discards + card.ability.extra.d_size
        ease_discard(card.ability.extra.d_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.GAME.round_resets.discards = G.GAME.round_resets.discards - card.ability.extra.d_size
        ease_discard(-card.ability.extra.d_size)
    end
}
slim ferry
#

drunkard is just d_size = 1 in the center def

#

yeah

viscid talon
#

i think i should be using g.game.round_discards or smth

#

but idk how that works

slim ferry
#

It says it there

viscid talon
#

o

#

wait so how do i tie the hand size to discards? wont it just give me +1 hand size instead

slim ferry
#

idk this is kind of a wierd effect to implement

#

Idk how i would go about this

umbral zodiac
#

maybe when you select a blind it gives +discards hand size and when you discard it gives -1 and at end of round it also just subtracts discards from hand size

viscid talon
#

hm

#

maybe i should revamp it altogether

viscid talon
#

that was the intent at least

red flower
#

you need to hook it

limber warren
#

Is it cool if we discuss it in dms?

red flower
#

no

limber warren
#

Ok

#

How do I exactly accomplish hooking it?

red flower
#

how to hook a function in general or how to do it with this specific one?

limber warren
#

Generally, im kind of a noob when it comes to modding lmao sorry

red flower
limber warren
#

Ill look into this, thank you

#

:)

red flower
#

the function itself is easy, you just update the context.something with whatever you return (flags)

limber warren
#

so would i call this in the context.X function or whenever the SMODS.calculate_context function is called?

viscid talon
#

i have another funny error

#
-- Tarot Ritual
SMODS.Joker({
    key = "ritual",
    config = { extra = { discards = 5, tarot = 1 } },
    loc_txt = {
        ["name"] = "Tarot Ritual",
        ["text"] = {
            {
                "Create a {C:dark_edition}Negative{} {C:tarot}Tarot{} card",
                "if {C:attention}5{} cards are discarded",
                "at the same time"
            }
        },
    },
    pos = { x = 6, y = 7 },
    cost = 9,
    rarity = 3,
    blueprint_compat = false,
    eternal_compat = false,
    perishable_compat = true,
    unlocked = true,
    discovered = false,
    atlas = "CustomJokers",

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.discards, card.ability.extra.tarot } }
    end,

    calculate = function(self, card, context)
        if context.first_hand_drawn then
            local eval = function() return G.GAME.current_round.discards_used == 0 and not G.RESET_JIGGLES end
            juice_card_until(card, eval, true)
        end
        if context.discard and not context.blueprint and
            G.GAME.current_round.discards_used <= 0 and #context.full_hand == 5 then
            return {
                G.E_MANAGER:add_event(Event({
                    func = function()
                        SMODS.add_card {
                            set = 'Tarot',
                            edition = 'e_negative'
                        }
                        G.GAME.consumeable_buffer = 0
                        return true
                    end
                }))

            }
        end
    end
})
#

So, this code mostly works - there's just one small snag

#

It creates five Negative tarots rather than one

#

idk how to fix this

#

like what are we even doing here 😭

rapid stag
#

if so, it probably created one per card. context.discard occurs for each individual card discarded

viscid talon
#

yeah i discarded five cards

#

oops

#

how do i make it so it creates 1 tarot if 5 cards are discarded (similar to faceless joker)

rapid stag
#

i remember seeing a simiilar thing happen a short while ago, lemme see if i can find the solve

#

unless N beats me to it

red flower
#

context.pre_discard and #context.full_hand == 5?

rapid stag
#

found it

viscid talon
#

gotcha

rapid stag
#

N's solution probably works as well

#

idk which would be better

red flower
#

depends on where the animation should be played

viscid talon
#
            if context.other_card == context.full_hand[5] then
                return {
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            SMODS.add_card {
                                set = 'Tarot',
                                edition = 'e_negative'
                            }
                            G.GAME.consumeable_buffer = 0
                            return true
                        end
                    }))
                }
            end
        end
    end

so i do this?

#

oops i got an error

#
        if context.first_hand_drawn then
            local eval = function() return G.GAME.current_round.discards_used == 0 and not G.RESET_JIGGLES end
            juice_card_until(card, eval, true)
        end
        if context.discard and not context.blueprint and G.GAME.current_round.discards_used <= 0 and #context.full_hand == 5 then
            return {
                G.E_MANAGER:add_event(Event({
                    func = function()
                        SMODS.add_card {
                            set = 'Tarot',
                            edition = 'e_negative'
                        }
                        G.GAME.consumeable_buffer = 0
                        return true
                    end
                }))

            }
        end
    end
``` current state of the code before adding the snippet
rapid stag
#

i was gonna say, can you even return an event like that inside the joker return table

viscid talon
#

i dont know

red flower
#

you shouldnt but it should still work

red flower
#

line*

viscid talon
#

nvm i think i fixed it

#

nvm

#

now when i discard, it does nothing

#
-- Tarot Ritual
SMODS.Joker({
    key = "ritual",
    config = { extra = { discards = 5, tarot = 1 } },
    loc_txt = {
        ["name"] = "Tarot Ritual",
        ["text"] = {
            {
                "Create a {C:dark_edition}Negative{} {C:tarot}Tarot{} card",
                "if {C:attention}5{} cards are discarded",
                "at the same time"
            }
        },
    },
    pos = { x = 6, y = 7 },
    cost = 9,
    rarity = 3,
    blueprint_compat = false,
    eternal_compat = false,
    perishable_compat = true,
    unlocked = true,
    discovered = false,
    atlas = "CustomJokers",

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.discards, card.ability.extra.tarot } }
    end,

    calculate = function(self, card, context)
        if context.first_hand_drawn then
            local eval = function() return G.GAME.current_round.discards_used == 0 and not G.RESET_JIGGLES end
            juice_card_until(card, eval, true)
        end
        if context.discard and not context.blueprint and context.pre_discard and #context.full_hand == 5 then
            return {
                G.E_MANAGER:add_event(Event({
                    func = function()
                        SMODS.add_card {
                            set = 'Tarot',
                            edition = 'e_negative'
                        }
                        G.GAME.consumeable_buffer = 0
                        return true
                    end
                }))
            }
        end
    end
})```
#

current state of the code ^

umbral zodiac
#

context.pre_discard runs when you discard not but for each card

#

just use that

#

without any other of the checks (keep and not context.blueprint tho)

red flower
#

the full_hand part is also needed

#

just remove context.discard

rapid stag
#

yes, pre_discard and discard are separate contexts

umbral zodiac
viscid talon
#

?

red flower
#

do you want it to be for the first discard only?

viscid talon
#

no

red flower
#

then remove and G.GAME.current_round.discards_used <= 0

viscid talon
#

oke

#

would i remove if context.first_hand_drawn then local eval = function() return G.GAME.current_round.discards_used == 0 and not G.RESET_JIGGLES end juice_card_until(card, eval, true) end too

red flower
#

yes

viscid talon
#

oke

#

random question, how do i change the cat to an icon of my own? i know ruby did something like that for her mod

slim ferry
#

ruby did that as a personal edit to her smods copy

#

not part of entropy

#

and that was just a copy of the loading bar with different text, image and colour below it

lament roost
#
[manifest]
version = "1.0.0"
dump_lua = true
priority = 1

[[patches]]
[patches.pattern]
target = '=[SMODS HotPotato "Perkeocoin/ads.lua"]'
pattern = '''tutorial = ad.config.tutorial,'''
position = "after"
match_indent = true
payload = '''
    velocity = ad.config.velocity,
'''```
im trying to patch into hotpotato but no patch folder is being created in lovely and nothing is happening in game (i tried print as well)
any ideas why?
rapid stag
viscid talon
#

oop

#

trying to make a challenge and its not working

#
-- Magic Ritual
SMODS.Challenge {
    key = 'magicritual',
    jokers = {
        { id = 'j_hatch_ritual', eternal = true, edition = 'negative' },
        { id = 'j_merry_andy', eternal = true, edition = 'negative' },
    },
    loc_txt = {
        ['name'] = 'Magic Ritual',
        ['unlock'] = {
            [1] = 'Unlocked by default.'
        }
    },
    modifiers = {
        { id = 'hand_size', value = 9 },
    custom = {
            { id = 'no_shop_tarots' },
        },
    restrictions = {
        banned_cards = {
                { id = 'p_arcana_normal_1', ids = { -- Boosters
                    'p_arcana_normal_1', 'p_arcana_normal_2',
                    'p_arcana_normal_3', 'p_arcana_normal_4',
                    'p_arcana_jumbo_1', 'p_arcana_jumbo_2',
                    'p_arcana_mega_1', 'p_arcana_mega_2', }
                },
                { id = 'j_8_ball' }, -- Jokers
                { id = 'j_superposition' },
                { id = 'j_vagabond' },
                { id = 'j_hallucination' },
                { id = 'j_cartomancer' },
                { id = 'v_tarot_merchant' }, -- Vouchers
                { id = 'v_tarot_tycoon' },
            },
            banned_tags = {
                { id = 'tag_charm' },
            },
        },
    }
}
#

for starters, ritual isnt eternal (it should be)

#

second, the hand size isn't 8, it's still 7 for some reason

#

thirdly, it still has tarots in store

frosty rampart
#

yea if you want to ban all tarot cards you have to. ban each tarot card
check paperback, it has a few challenges based on the minor arcana that ban regular tarots

viscid talon
#

oop oke

#

wait so if i ban every tarot card, would tarot ritual still work

frosty rampart
#

you can still manually create them yes, it's just getting them randomly that'll be stopped
i think there's also something else you should do to stop excess jimbos from popping up, but it's been a while since i made those challenges

viscid talon
#

maybe ill just keep the hand size as is

frosty rampart
#

ok yea you have to hook game.start_run, check if self.GAME.modifiers.no_shop_tarots is true, and then set the tarot_rate

viscid talon
#

cup, wand, sword, pentacles,,,

#

idk how to word this

frosty rampart
#

yea the minor arcana suits
paperback has challenges based on each suit

viscid talon
#

if challenge = "magic trial" then self.game.tarot_rate = 0 ?????

frosty rampart
#

so you see where your challenge definition has custom = { { id = "no_shop_tarots" } }? that means that, while the challenge is active, G.GAME.modifiers.no_shop_tarots is true. in the Game.start_run function, self is G, so you'd check if self.GAME.modifiers.no_shop_tarots is true, and if it is, then you set the tarot_rate

frosty rampart
#

idk lmao

frosty rampart
viscid talon
#

how would i write an apply function

fading rivet
#

any idea why my text wont appear?

generate_gameplay_ui = function(self)
        local ret = {}
        local SCALE = 1
        for rowi, row in ipairs(self.ability.grid) do
            table.insert(ret, {n=G.UIT.R, nodes={}})
            for coli, cell in ipairs(row) do
                local color = {G.C.GREY, G.C.BLUE}
                color = color[(rowi + coli) % 2 + 1]
                table.insert(ret[#ret].nodes, {n=G.UIT.C, config = {align="cm",padding=0.1,outline=1,outline_colour=darken(color, 0.1), minw=1,minh=1,maxw=1,maxh=1,colour=color}, nodes={
                    --{G.UIT.T, config={scale=1,text="testing",colour=G.C.RED}}
                    {G.UIT.T, config={scale=0.2,text=cell.mine and "!" or (cell.number == 0 and "" or cell.number), colour=G.C.RED}}
                }})
            end
        end
        return ret
    end
#

the text is generated in the UI table

frosty rampart
viscid talon
#

ohhh

viscid talon
#

WHY ARE YOU NOT ETENRALLLLLL

viscid talon
#

ui stuff is beyond me

#

also tarots still show up

#
-- Magic Ritual
SMODS.Challenge {
    key = 'magicritual',
    jokers = {
        { id = 'j_hatch_ritual', eternal = true, edition = 'negative' },
        { id = 'j_merry_andy',   eternal = true, edition = 'negative' },
    },
    loc_txt = {
        ['name'] = 'Magic Ritual',
        ['unlock'] = {
            [1] = 'Unlocked by default.'
        }
    },
    restrictions = {
        banned_cards = {
            { id = 'p_arcana_normal_1', ids = {     -- Boosters
                'p_arcana_normal_1', 'p_arcana_normal_2',
                'p_arcana_normal_3', 'p_arcana_normal_4',
                'p_arcana_jumbo_1', 'p_arcana_jumbo_2',
                'p_arcana_mega_1', 'p_arcana_mega_2', }
            },
            { id = 'j_8_ball' },     -- Jokers
            { id = 'j_superposition' },
            { id = 'j_vagabond' },
            { id = 'j_hallucination' },
            { id = 'j_cartomancer' },
            { id = 'v_tarot_merchant' },     -- Vouchers
            { id = 'v_tarot_tycoon' },
        },
        banned_tags = {
            { id = 'tag_charm' },
        },
        apply = function(self)
            G.GAME.tarot_rate = 0
        end
    },
}
``` the code at current
viscid talon
#

on a standard run, it's finite for some reason

tall wharf
#

vro forgor n =

fading rivet
#

nvm aiko figured it out

frosty rampart
viscid talon
#

manual time

red flower
viscid talon
#

idk 😭

red flower
#

take it out

viscid talon
#

oke

fading rivet
#

hmm yes
minesweeper

viscid talon
#

oh turns out it isnt eternal compatible for whatever reason

#

fixed

#

huh, new bug discovered

#

a LOT of jokers in 1.6.0 were not eternal compat

#

anyways tarots still show up even when the rate is outside

red flower
#

can i see the current code

viscid talon
#

i just got back hold on

#

oh my god

#
-- Magic Ritual
SMODS.Challenge {
    key = 'magicritual',
    jokers = {
        { id = 'j_hatch_ritual', eternal = true, edition = 'negative' },
        { id = 'j_merry_andy',   eternal = true, edition = 'negative' },
    },
    loc_txt = {
        ['name'] = 'Magic Ritual',
        ['unlock'] = {
            [1] = 'Unlocked by default.'
        }
    },
    restrictions = {
        banned_cards = {
            { id = 'p_arcana_normal_1', ids = {     -- Boosters
                'p_arcana_normal_1', 'p_arcana_normal_2',
                'p_arcana_normal_3', 'p_arcana_normal_4',
                'p_arcana_jumbo_1', 'p_arcana_jumbo_2',
                'p_arcana_mega_1', 'p_arcana_mega_2', }
            },
            { id = 'c_fool' }, -- tarots (dear god i had to do this manually fuck that)
            { id = 'c_magician' },
            { id = 'c_high_priestess' },
            { id = 'c_empress' },
            { id = 'c_emperor' },
            { id = 'c_heirophant' }, -- (sic)
            { id = 'c_lovers' },
            { id = 'c_chariot' },
            { id = 'c_justice' },
            { id = 'c_hermit' },
            { id = 'c_wheel_of_fortune' },
            { id = 'c_strength' },
            { id = 'c_hanged_man' },
            { id = 'c_death' },
            { id = 'c_temperance' },
            { id = 'c_devil' },
            { id = 'c_tower' },
            { id = 'c_star' },
            { id = 'c_moon' },
            { id = 'c_sun' },
            { id = 'c_judgement' },
            { id = 'c_world' },
            { id = 'j_8_ball' },     -- Jokers
            { id = 'j_superposition' },
            { id = 'j_vagabond' },
            { id = 'j_hallucination' },
            { id = 'j_cartomancer' },
            { id = 'v_tarot_merchant' },     -- Vouchers
            { id = 'v_tarot_tycoon' },
        },
        banned_tags = {
            { id = 'tag_charm' },
        },
    },
}```
#

i tried putting the apply function outside and it still didnt work

#

so then i try this

#

it still doesnt work

#

curiously strength is the only tarot to show up

#

WHATS GOING ON 😭

#

everytime i refresh i still get strength

#

what even is this error

#

this happens when i buy strength too

#

i might just delete this challenge

#

STRENGHT IS ALSO THE ONLY TAROT THAT SPAWNS

#

😭 IM CACKLING

red flower
#

same thing would happen if you ban every joker or planet but for their defaults

viscid talon
#

oops

daring fern
lament roost
# daring fern Couldn't you just hook `save_ad`?

like this?

save_ad = function (ad)
    return{
        key = ad.config.key,
        id = ad.config.id,
        offset = ad.alignment.offset,
        position = {x = ad.T.x, y = ad.T.y},
        scale = ad.config.scale,
        tutorial = ad.config.tutorial,
        velocity = ad.config.velocity,
    }
end```
daring fern
lament roost
#

i see

#

if you dont mind me asking how would i do the same for this

[[patches]]
[patches.pattern]
target = '=[SMODS HotPotato "Perkeocoin/ads.lua"]'
pattern = '''for key, ad in pairs(G.GAME.hotpot_ads) do'''
position = "after"
match_indent = true
payload = '''
    ad.T.x = ad.T.x + ad.config.velocity.x
    ad.T.y = ad.T.y + ad.config.velocity.y
    if ad.T.x > screen_border[3]-ad.T.w then
        ad.config.velocity.x = -ad.config.velocity.x 
    elseif ad.T.x < screen_border[1] then
        ad.config.velocity.x = -ad.config.velocity.x
    end
    if ad.T.y > screen_border[4]-ad.T.h then
        ad.config.velocity.y = -ad.config.velocity.y 
    elseif ad.T.y < screen_border[2] then
        ad.config.velocity.y = -ad.config.velocity.y
    end
'''```
#

(i know the code could be better ill get to that once i get it to patch in)

daring fern
lament roost
slim ferry
#

what is the file called that this is in

lament roost
#

ads_replace.toml

slim ferry
#

and what is the folder its in called

lament roost
#

i patched something else from another mod and it worked fine its just hot potato thats the issue

lament roost
slim ferry
#

oh okay

lament roost
#

im just confused because i seem to be doing everything for hot potato right

slim ferry
#

check the log if theres anything about not finding a patch pattern

daring fern
lament roost
daring fern
lament roost
daring fern
lament roost
#

nvm

#

(i'm also overwriting the create_ads function but i probably shouldnt be i'd assume)

slim ferry
#

if you override the create_ads function that removes the patch pretty much doesnt it

#

since it wont use the patched function anymore

lament roost
#

im not patching create ads

#

its a different function

daring fern
lament roost
#

well you see i tested everything in the original file and it worked completely fine

final jewel
#

if context.discard and context.other_card == G.discard.cards[1] how do I check for the first discarded card

lament roost
#

either i messed up in in translating it to my mod or the patches just dont work 😢

analog slate
#

so..... how do i use context variable??

daring fern
final jewel
#

oh neat

analog slate
#

mainly to know if a played card has a certain type like hearts

daring fern
red flower
analog slate
#

alright so now i need to understand the basics of the SNOWBALLER CARD

#

so like how do i add the score part

#

also what is card_eval_status_text

#

and how do i use it

red flower
#

the example you might be looking at seems old

flint spindle
#

I just recieved this error out of nowhere, I would add more clarification but sadly I don't know what I changed to cause this to happen. Does anybody know what kinds of bugs would cause this to pop up?

flint spindle
#

👍

red flower
#

also why are you playing with vanillaremade on 😭

flint spindle
#

that's what I'm using lol

#

this is my first mod

red flower
#

ahhh

flint spindle
#

and I wanted to make a mod that just rebalances the game

red flower
#

then this is the correct channel

flint spindle
#

so might as well just use a mod that recreates it 1-to-1 and tweak

red flower
#

this looks like a deck creator issue

#

the mod doesnt work anymore

#

use debugplus to test

flint spindle
#

huh that's weird

#

This error occurred while I was playing on a version of the Green deck I modified with take_ownership and it crashed after I finished the Big Blind just before the money calculations

#

lemme turn off deck creator and see if it still crashes

red flower
#

it hasnt been updated in a long time so it has random crashes

flint spindle
#

ok that makes sense

#

kinda unfortunate, it's a dope mod

#

ok yeah it didn't crash that time

#

thx

lament roost
flint spindle
#

I'll just remake all the custom decks manually instead of using the mod then

daring fern
daring fern
lament roost
rapid stag
#

🤔 i'm thinking about a deck effect that guarantees new cards on shop reroll (i.e. if you were in the shop and you see the base joker for sale, when you reroll, there will under no circumstances be a base joker in the rerolled jokers)

my thoughts of how to accomplish this are to hook Card:in_pool and have that check against a variable i set up in G.GAME and populate via context.reroll_shop in current_mod.calculate, but i'm not sure what timing of anything would facilitate my effect. does current_mod.calculate come before Card:in_pool?