#💻・modding-dev

1 messages · Page 429 of 1

north lodge
#

Why do UI elements interacting with each other have to be so frustrating 😭

turbid maple
#

as a hypothetical example a joker that turns +mult from other jokers into +$

daring fern
turbid maple
#

[[gif of emoji exploding with two arms held up]]

#

how lovely

astral zinc
#

Should be gone now

spice wadi
#

nevermind as soon as i wrote that message

broken cliff
proud ridge
#

i see that vanilla remade uses the card:remove() function to delete cards like icecream and popcorn when they run out. Would there be a way for me to detect that?

finite onyx
#

Hello, does anyone know how to fix this? I have created a folder to store sound assets. I have created SMOD sound and its key, and in (sound = (key name)) an error like this occurs.

mint raven
#

my mod isn't showing up in the game, anyone knows what I might have done wrong? I tried following documentation closely when making this and the tutorial video by bepis looks about the same too

proud ridge
daring fern
proud ridge
#

this randomly started happening when i boot up the game

gaunt phoenix
#

How could I check how many differents suits there is in played hand ?
(Ping me if you answer please)

proud ridge
daring fern
wind steppe
spice wadi
#

how do i move a ui element to be in front of everything else? is it a setting of the uibox, root, or is it to do with how its created

copper thorn
#

hey, im back, and i got a problem, or more of "idk how to this" issue,

i have a legendary card with a texture, but how do i make it show up like the other (perkeo, chicot and ush) mine just shows up as is with the card on top and the char on the bottom

#

or for exemple like the screen above

proud ridge
daring fern
proud ridge
#

it stopped happening before i could debug

wind steppe
proud ridge
#

no the error

copper thorn
wind steppe
#

oh

#

weird

proud ridge
#

mhm

daring fern
copper thorn
broken cliff
#

so you need to have an atlas with 2 cards

copper thorn
#

im on a secondary computer, without moded balatro and haven't got the time to mod it

broken cliff
#

pos is for the background aka your first card

#

the soul_pos is the thing that will be displayed up on the card

copper thorn
#

mmmh mhhhhhh

broken cliff
#

anyways, how would i access this rarity for my joker? putting rarity = "use_uselessrarity" does not work

copper thorn
#

soul_pos = {x = 0, y = 0},
rarity = 4,
pos = { x = 0, y = 1},

like this ?

copper thorn
#

i still can't post photos i think

copper thorn
#

i swapped them it was pos in first

#

for more of the atlas part if needed

broken cliff
broken cliff
daring fern
broken cliff
#

yes

copper thorn
#

i forgor to change it 💀

wind steppe
broken cliff
#

its supposed to be useless

#

but i wanted to add a synergy with letter deck js for fun

copper thorn
broken cliff
#

which makes it less useless tho.

wind steppe
#

ohhhh

thorn basin
#

Does somebody know how to replace a default sound effect of a joker with a custom one?

broken cliff
daring fern
hybrid shadow
broken cliff
daring fern
thorn basin
# broken cliff SMODS.Sound

I mean, I tried like this but it still doesn't work.
I can play the sound directly but it doesn't activate at the exact moment when my joker upgrades...

thorn basin
#

aight imma try like this

broken cliff
thorn basin
daring fern
#

Everytime it is used it will instead be that one.

thorn basin
daring fern
thorn basin
sage crater
thorn basin
daring fern
#

In the return.

sage crater
#

But it’s something like SMODS.take_over

thorn basin
wise terrace
#

Hey, I tried to use quantum enhancements in smods, but it makes the game quite slow, this is the code I used for it:

if context.check_enhancement and context.other_card:get_id() == 2 then
        return {m_wild = true}
end
daring fern
daring fern
copper thorn
#

why is it like this T-T

thorn basin
daring fern
wise terrace
copper thorn
#

it works only when smooting is disabed T-T

wise terrace
formal parrot
copper thorn
formal parrot
#

Lol

copper thorn
#

but i did on krita i can't resize it freely without losing quality :(

daring fern
wise terrace
zealous glen
copper thorn
#

i took the perkeo part of the jokers.png from the files of the game, but it was already in 71x190, and with krita when i resize it to x2 it gets all blurry

hybrid shadow
copper thorn
#

?

#

i ain't a image nerd

zealous glen
copper thorn
#

explain this things to me

zealous glen
hybrid shadow
# copper thorn i ain't a image nerd

when you select image and select scale image to new size, itll ask what resize method to use, itll show up as Auto(Bicubic) but you need to switch it to Nearest Neighbor

copper thorn
#

oh ok

formal parrot
#

Is there a function that closes the game

chrome widget
maiden phoenix
proud ridge
#

ok so i found the function the game uses for food jokers to destroy themselves. its ```lua
G.jokers:remove_card(self)

is that something i can hook onto?
zealous glen
#

Idk

#

Check the wiki

maiden phoenix
daring fern
proud ridge
daring fern
turbid maple
#

hooking card:remove is not viable for their use case because they want to check if a food joker destroyed itself

proud ridge
#

mhm

tall wharf
turbid maple
#

i mean yeah you could have things apply a flag and check it in card:remove or whatever but you get the point

sage crater
tall wharf
#

i wonder if it's luajit2 moment

proud ridge
#

im just not sure how exactly i would hook G.jokers:remove_card(self). My guess is that i will need a global flag and then have my joker check if the flag is changed

turbid maple
#

"food jokers" is not a well defined term and it becomes impossible when you get to cross mod compatibility

#

thats the problem

tall wharf
sage crater
tall wharf
#

LMAO

maiden phoenix
proud ridge
#

i am looking at the base game code and the food jokers dont use card:remove to destroy themselves

#

they use G.jokers:remove_card(self)

turbid maple
#

how do you check a food joker was removed specifically by it expiring

proud ridge
#

unless i am looking in the wrong place

daring fern
turbid maple
proud ridge
#

i am not seeing it in card.lua

proud ridge
#

is self more or less a pointer in this case then?

daring fern
turbid maple
# daring fern It is though?

even if you hard code to check for specific jokers you have no idea if the popcorn ran out or it got killed by dagger unless you patch every single food joker to set a flag and at that point id consider it triggering a custom context instead

#

okay dagger was a poor example because you can actually check that

proud ridge
#

madness?

turbid maple
#

they both set getting_sliced so you can actually check that

proud ridge
#

so i would check for card:remove() and not getting_sliced?

turbid maple
#

youre still gonna hard code things unless you consider mr bones edible

tardy juniper
#

is there a way i can make the game play a custom sound?

pulsar furnace
#

how do i create a ui?

turbid maple
#

as opposed to a yui

proud ridge
#

mr bones uses start_dissolve

daring fern
#

But it does not set getting_sliced

turbid maple
#

and start_dissolve will eventually call card:remove

#

... right?

daring fern
turbid maple
#

im pretty sure theres more destruction methods dont set getting_sliced

proud ridge
#

so i would need to hook onto G.jokers:remove_card(self) since this is only called for food jokers

#

right?

proud ridge
#

unless i am completely misunderstanding smth

daring fern
#

That is called in card:remove()

proud ridge
#

i am very new to this

daring fern
#

So it would trigger twice.

lusty pasture
#

I still am going to treat this as the place to dump crash logs if i don't know the culprit

proud ridge
#

so is there any way i could do this easily?

#

or is this gonna be a pain in the ass

turbid maple
#

i do not see an easy way to implement this

proud ridge
#

is there a way i can detect messages being sent?

#

cuz each food item has a special message it sends when it dies

turbid maple
#

"food joker" is a category that does not exist so trying to handle them specifically is kind of a pain in the ass

daring fern
turbid maple
#

the simplest way would be patching every food joker to trigger a custom context when it expires but that obv doesnt play well with other mods

tall wharf
#

@maiden phoenix i know the issue now

proud ridge
turbid maple
#

yes

maiden phoenix
turbid maple
#

it also gets called when you open your collection and close your collection

#

these things can be checked for obviously

daring fern
tall wharf
#

ui being schewpid

civic elm
#

Can someone explain to me why I have two .lua deck files in the same folder (under the same mod name) and only one of the two decks are loading?

turbid maple
#

did you ever load the file

civic elm
#

Yeah, both should be getting loaded.

turbid maple
#

smods wont load every single lua file it finds it a folder

#

you have to tell it to get loaded

civic elm
#

How do I do that?

turbid maple
#

you have the main lua file you set it in your json

#

that main lua file has to load the others

#

SMODS.load_file

civic elm
#

Main lua file?

turbid maple
#

"main_file" in your json

#

only that file gets loaded by smods

#

that file has to do the job of loading all others

civic elm
#

What is the json?

turbid maple
#

simplest way would be
assert(SMODS.load_file("relativepath/to/luafile"))()

#

uhhh where are you setting your mod metadata

proud ridge
#

so am i sorta just screwed? /gen

civic elm
#

Uh... metadata?

proud ridge
#

cuz im not entirely sure how i can implement my idea

turbid maple
#

information about your mod

#

name of mod the author you know

proud ridge
#

i mean it currently scales whenever one of the food jokers is purchased

civic elm
proud ridge
#

it just might not have the resetting capabiliteis

daring fern
turbid maple
#

okay then look at the "main_file" field

#

that's the file SMODS is loading

proud ridge
#

well currently my joker gains X1 mult for each food joker purchased, i want to make it so the scaling resets whevever a food joker naturally dies (it will be like the food is spoiling)

turbid maple
#

that main file needs to load all the others

wind steppe
proud ridge
#

yes

wind steppe
#

if so you'd need to manually take ownership of every food joker you want compatible

proud ridge
#

I can just scrap the resetting concept

vale beacon
#

is there a guide on making deck texture packs somewhere?

turbid maple
#

it is kind of a weird concept anyway

proud ridge
#

i liked it :/

daring fern
turbid maple
#

well sure its cute but in terms of gameplay it just says you cant keep gros michel around

#

not eternal

#

what am i saying

copper thorn
#

wait ... "gros michel" is cross-language ? not only in french ?

wind steppe
#

gros michel is the name of a banana species

#

same with cavendish

#

gros michel below

copper thorn
#

i knew for vaendish but not for gros michel, go on with your convo sorry

tall wharf
#

@maiden phoenix

maiden phoenix
#

?

tall wharf
#

i fixed it

maiden phoenix
#

nice

tall wharf
maiden phoenix
#

testing it rn

tall wharf
#

vely

#

lovely

maiden phoenix
#

Oh the alignement is funky here

gaunt thistle
#

it's so beautiful

tall wharf
#

@tepid crow i fixed it

tall wharf
civic elm
tall wharf
#

the text is long

primal robin
#

Use maxw for text, game will figure out for you how to scale it

tall wharf
#

ok

#

maxw for text node?

primal robin
#

container

#

Maybe it doesn't work without more advanced technology, I don't remember tbh

signal lotus
#

what im i doing wrong

wind steppe
signal lotus
#

sorry im very new to this stuff

spice wadi
#

in the joker definition

spice wadi
#

there should be a property called loc_vars

signal lotus
viral ember
#

"#20#" makes it sound like you have 20 vars

spice wadi
#

yeah

viral ember
#

do #1#

spice wadi
#

meaning its looking for the 20th variable currently

signal lotus
#

but then how much mult is it supposted to know it has

wind steppe
#

the number between the hashtags isn't actually what the real number is

#

it's which number to access in loc_vars

tall wharf
#

britain

signal lotus
#

oh

spice wadi
#

it knows if you put #1# because itll put the 1st variable from loc_vars there

signal lotus
#

the local vars dont have a number that i see tohugh

spice wadi
#

it does

signal lotus
#

it just says card.ability orer smth does it not

viral ember
#

yea that IS a variable

wind steppe
#

card.ability.extra.mult is a number

spice wadi
#

card.ability.extra.mult corresponds to this

signal lotus
#

oh

#

this makes no sense to me

spice wadi
#

the config of a card is stored in card.ability

wind steppe
#

it's looking for your cards config table, then the extra table, and it checks for mult then (and it finds 20) so it gives you 20

tall wharf
#

@primal robin it works i just needlower num

spice wadi
#

and you usually put all your variables in extra (aka card.ability.extra)

wind steppe
# signal lotus oh

actually hold on go back
how much basic coding experience do you have (doesn't have to be in balatro modding)?

tall wharf
signal lotus
#

no balatro modding experience

spice wadi
#

so if you want a different variable (such as chips, money, etc) you can add another variable there (like chips = 10)

signal lotus
#

I know lua and python though

primal robin
wind steppe
#

k

signal lotus
#

a little bit of lua but im a python dev

wind steppe
#

so card.ability.extra.mult is checking for what's in your joker's config table, in the extra table (within the config table), and then it checks for mult

spice wadi
# tall wharf

if you know UI stuff can i ask some questions (ik dontasktoask but i dont want to bother you cos i have quite a few questions)

tall wharf
#

i am going to sleep

primal robin
#

Maxw for mods's title

signal lotus
spice wadi
primal robin
spice wadi
#

alright who here knows the basics about UIs 😭

tall wharf
#

im going to sleep idc

wind steppe
primal robin
#

fine

#

Good night then

wind steppe
#

ability is an object of card that is the same as config

tall wharf
primal robin
#

Left block obviously bigger than right one

primal robin
#

Because title have 2 lines

spice wadi
wind steppe
#

dont ask why its ability and not config idk either

copper thorn
#

i need help with textures and things like that

signal lotus
#

im just going to copy and paste code from vanilla remade together to make it

wind steppe
copper thorn
#

and i was vague to know if i could ask without interrupting

wind steppe
copper thorn
#

the blank one is x2 frogor to mark it

signal lotus
#

im looking through the source code of various mods, it seems kind of similar to roblox studio which ive done before

#

which amkes sense they are the same language

wind steppe
#

dont see any issues?

#

and it works fine when textures arent smooth?

copper thorn
#

if needed

copper thorn
wind steppe
#

show us the measurements of both images

#

if i had to guess the x2 version is too small

copper thorn
#

for the x2

#

and x1 is 7&x90

#

71*

wind steppe
#

try doubling the height and width of the image in the x2 folder

copper thorn
signal lotus
#

I dont get this snippet, why do they need to calculate the driver tally twice

copper thorn
#

so i put back the old texture and voila i guess

wind steppe
signal lotus
#

why does it need to be there twice

wind steppe
#

it needs to check the driver tally whenever you look at it

#

but also when it scores

signal lotus
#

oh yeah

wind steppe
#

theres probably a faster way to do it but im not smart enough to figure that out

signal lotus
#

this crashes the game why

primal robin
#

syntax error

#

Consider installing lua extension

formal parrot
#

Isn’t closed

#

You can see its red

signal lotus
#

why doesnt this work

#

I play a hand with that joker and it crashes the game

wind steppe
signal lotus
wind steppe
signal lotus
#

nvrm i fixed it

#

ngl balatro modding is easier than i thought

#

pretty much every idea tyou have is in base game so just copy and paste the code change some stuff and boom

modern kindle
#

go on, make the card that plays doom

#

just off vanilla copy

#

:b

gleaming yew
#

How do I make custom suits?

wind steppe
#

does anyone know why my hooks don't work? ```lua
local para_extra_slots = function(self)
return self.ability.para_negativesticker or self.config.center_key == "j_para_cooledwater"
end
local para_card_removal_old = Card.remove_from_deck
local para_card_addition_old = Card.add_to_deck
Card.remove_from_deck = function(self, card, from_debuff)
if para_extra_slots(self) and G.jokers ~= nil and self.area == G.jokers then
G.jokers.config.card_limit = G.jokers.config.card_limit - 1
end
return para_card_removal_old(self, card, from_debuff)
end
Card.add_to_deck = function(self, card, from_debuff)
if para_extra_slots(self) and G.jokers ~= nil and self.area == G.jokers then
G.jokers.config.card_limit = G.jokers.config.card_limit + 1
end
return para_card_addition_old(self, card, from_debuff)
end

this is supposed to make cards with negative stickers and cooled water give +1 joker slot but it does nothing
#

(cooled water will never have the negative sticker)

gleaming yew
#

...i probably shouldve asked if theres like a. template mod thing. like something you should start making a mod with.

#

like how, for lack of a better example, Psych engine has a template for pack.png and pack.json or whatever

subtle merlin
pure salmon
vivid grotto
#

hey anyone here able to help me with this problem? I posted it a while ago but didn't see anyone respond 😭

chrome widget
modern kindle
chrome widget
#

Damn getting called a goddess rules. Thanks dilly

modern kindle
#

:D

wind steppe
#

also can you repaste the images down here

vivid grotto
#

yeah, one second

chrome widget
#

I'm kinda wiped but I'm getting ever, ever closer to finishing this damn mod

#

Almost 100% complete programming Stands aside from one that I still want to do in anticipation of Quantum Ranks

vivid grotto
#

Here are the iamges, let me see if I can get a recording

scarlet imp
#
SMODS.Joker:take_ownership("abstract",
    {
        config = {
            extra = {
                mult = 3
            }
        },
        loc_vars = function(self, info_queue, card)
            return {
                vars = {
                    card.ability.extra.mult,
                    card.ability.extra.mult * (G.jokers and #G.jokers.cards or 0)
                }
            }
        end,
        calculate = function(self, card, context)
            if context.joker_main then
                return {
                    mult = card.ability.extra.mult * #G.jokers.cards
                }
            end
        end
    }
)

just hovering over Abstract Joker is causing the game to crash

wind steppe
tepid crow
vivid grotto
hybrid shadow
wind steppe
#

upload it to youtube or something

vivid grotto
#

wtf

tepid crow
chrome widget
#

Gosh I'm tired. Been working on this mod for about four months and my enthusiasm isn't really waning but I'm certainly feeling it drag on

hybrid shadow
tepid crow
#

hmm that all seems fine

faint urchin
#

why is this saying assertation failed?

spice wadi
#

with a UI element like this, how do i make it like other menu popups? ie its in front of everything, has a transparent backdrop preventing clicking on anything else, and closes with escape

daring fern
spice wadi
scarlet imp
#

alright I'll try that, thx

wind steppe
#

how do i check if a card is being added or removed from the joker slots? (in a hook of Card.remove_from_deck and Card.add_to_deck)
self.area == G.jokers doesnt work

scarlet imp
vivid grotto
scarlet imp
#

if context.card_added and context.card.ability.set == "Joker" then to be clearer

wind steppe
#

idk why that doesnt do anything honestly

#

check midas mask?

wind steppe
scarlet imp
#

ahh ok, idk then. sorry

sturdy compass
#

Does anyone have any good examples of patching/hooking loc_colour? I'd like to move my colors off of a globals.lua patch and handle them better

wind steppe
# daring fern Code?
local para_extra_slots = function(self)
    local slots = 0
    if self.ability.para_negativesticker then
        slots = slots + 1
    end
    if self.config.center_key == "j_para_cooledwater" then
        slots = slots + 1
    end
    --print("extra slots:" .. slots)
    return slots
end
local para_empty_slots = function(self)
    if G.jokers ~= nil then
        --print("empty slots?" .. tostring((G.jokers.config.card_limit - #G.jokers.cards + para_extra_slots(self)) > 0))
        return (G.jokers.config.card_limit - #G.jokers.cards + para_extra_slots(self)) > 0
    else
        return false
    end
end
local para_card_removal_old = Card.remove_from_deck
local para_card_addition_old = Card.add_to_deck
Card.remove_from_deck = function(self, card, from_debuff)
    print("In jokers: " .. tostring(self.area == G.jokers))
    print("Joker existence: " .. tostring(G.jokers ~= nil))
    print("Space:" .. tostring(para_empty_slots(self)))
     if para_empty_slots(self) and G.jokers ~= nil and self.area == G.jokers then
        print("Card has been removed.")
         G.jokers.config.card_limit = G.jokers.config.card_limit - para_extra_slots(self)
    end
    return para_card_removal_old(self, card, from_debuff)
end
Card.add_to_deck = function(self, card, from_debuff)
     if para_empty_slots(self) and G.jokers ~= nil and self.area == G.jokers then
        print("Card has been added.")
         G.jokers.config.card_limit = G.jokers.config.card_limit + para_extra_slots(self)
    end
    return para_card_addition_old(self, card, from_debuff)
end
wind steppe
scarlet imp
wind steppe
#

and remove those slots when theyre removed

daring fern
tepid crow
hybrid shadow
tepid crow
#

and its not crashing in collection, only in run?

vague crest
wind steppe
vague crest
#

assets folder of what specifically?

wind steppe
vague crest
#

because this happens even with my new mod im working on gone 🔥

#

yeah sure lemme grab it

wind steppe
#

besides yours

vague crest
#

off the top of my head i think debugplus, nopeus, and the example jokers mod is enabled

#

plus a couple friends of jimbo additions

#

its referencing paperback and bunco in the error which is crazy to me because theyre not in my mods folder they havent been for a while 😭

vague crest
#

its one of the mods that adds like, smods implementations of a few vanilla jokers, like castle, gros michel, i think runner is in there

wind steppe
#

why do you have it actually installed

#

ur just supposed to look at the code

vague crest
#

great question actually i can remove it

wind steppe
#

also vanillaremade is more complete

vague crest
#

oh wow that seems much nicer also

#

removing it did not fix the crash however

wind steppe
#

can we get a more exact list of the mods?

#

(given the crash im inclined to believe one of the friends of jimbo mod is causing the error)

dense bough
#

Hey sorry to interupt, but I changed the playing card base art, while maintaining the same file name, and now it renders as blank. Any reason why?

vague crest
#

uh yeah sure, is there a way to get the list of enabled mods without having balatro open?

hybrid shadow
wind steppe
#

you can get all mods (enabled or not) though through looking at the mods folder

hybrid shadow
dense bough
#

yes

vague crest
#

im gonna try removing all the foj first and then ill get back to you then because theres like 3 qol things besides that and no acatual mods on

dense bough
#

extracted with 7 zip, replaced and in files it looks fine

wind steppe
#

dont do it like that

dense bough
#

oh how should I?

wind steppe
#

reinstall balatro and smods first

#

to reset

dense bough
#

I don't have smods

scarlet imp
wind steppe
dense bough
wind steppe
#

do not modify the source code thats stupid

#

once you learn smods you should be able to take ownership of SMODS.Rank and SMODS.Suit

dense bough
#

I do have lovely installed however

tepid crow
tepid crow
#

the smallest code possible that still causes a crash

#

that I can just copy-paste into my machine and make it crash

vague crest
#

ok got it to work not sure exactly what i did just kept removing stuff but 👍 thank you friends

wind steppe
#

how many did you actually have anyways

vague crest
#

literally just 3 😭 its fine now that theyre back idk what this was

blazing salmon
#

hi, what's the best way to modify the function of an existing joker?

wind steppe
vague crest
#

thats what im gathering yeah

wind steppe
modern kindle
blazing salmon
gray quartz
#

i fucked up hard by writing all the code for my jokers before doing any of the art cause now i gotta draw 12 more jokers 😭😭😭

shut marsh
#

how do i mod balatro

wind steppe
#
local para_extra_slots = function(self)
    local slots = 0
    if self.ability.para_negativesticker then
        slots = slots + 1
    end
    if self.config.center_key == "j_para_cooledwater" then
        slots = slots + 1
    end
    --print("extra slots:" .. slots)
    return slots
end
local para_empty_slots = function(self)
    if G.jokers ~= nil then
        --print("empty slots?" .. tostring((G.jokers.config.card_limit - #G.jokers.cards + para_extra_slots(self)) > 0))
        return (G.jokers.config.card_limit - #G.jokers.cards + para_extra_slots(self)) > 0
    else
        return false
    end
end
local para_card_removal_old = Card.remove_from_deck
local para_card_addition_old = Card.add_to_deck
Card.remove_from_deck = function(self, card, from_debuff)
    local ret = para_card_removal_old(self, card, from_debuff)
    print("In jokers: " .. tostring(self.area == G.jokers)) -- This is always false
    print("Joker existence: " .. tostring(G.jokers ~= nil)) -- This works as intended
    print("Space:" .. tostring(para_empty_slots(self))) -- This works as intended
     if para_empty_slots(self) and G.jokers ~= nil and self.area == G.jokers then
        print("Card has been removed.")
         G.jokers.config.card_limit = G.jokers.config.card_limit - para_extra_slots(self)
    end
    return ret
end
Card.add_to_deck = function(self, card, from_debuff)
    local ret = para_card_addition_old(self, card, from_debuff)
     if para_empty_slots(self) and G.jokers ~= nil and self.area == G.jokers then
        print("Card has been added.")
         G.jokers.config.card_limit = G.jokers.config.card_limit + para_extra_slots(self)
    end
    return ret
end
```why doesn't this check if a card is being added or removed from joker slots?
obtuse silo
#

is there a way to trigger a sound when opening a pack

wind steppe
wind steppe
shut marsh
#

ok thanks

obtuse silo
chrome widget
daring fern
modern kindle
chrome widget
#

Ugh

#

Can I eat my Chocolate Chunk Brownie Blast from my local Sonic Drive-In first

obtuse silo
modern kindle
hybrid shadow
# tepid crow that I can just copy-paste into my machine and make it crash
SMODS.Consumable:take_ownership('temperance',
 {
  config = { extra = { max = 50, money = 0 } },
  loc_vars = function(self, info_queue, card)
   local money = 0
   if G.jokers then
    for i = 1, #G.jokers.cards do
     if G.jokers.cards[i].ability.set == 'Joker' then
      money = money + G.jokers.cards[i].sell_cost
     end
    end
   end
   card.ability.extra.money = math.min(money, self.config.extra.max)
   return { vars = { card.ability.extra.max, card.ability.extra.money } }
  end
 }
)```
gusty hatch
#

hello I'm new to modding; and i need a lil help with something

wind steppe
gusty hatch
#

i want to playtest my jokers

gusty hatch
#

yes i do

#

but i dont have the command list

wind steppe
#

hold tab

hybrid shadow
gray quartz
#

"help" command

#

and hold tab yeah

gusty hatch
#

OMG TY

thorn basin
#

how can I check if two or more different face cards played have different suits?
I tried like this by adding the "and context.other_card.suit ~= context.other_card.suit" but it it crashes the game.

daring fern
obtuse silo
#

ahhh
patches
never was good with those

wind steppe
#

you could maybe hook it instead

daring fern
gray quartz
#

i remember my days as a youngin where i just set my money to 1 trillion and just kept rerolling the shop cause i didnt know abt the tab menu

obtuse silo
#

i could try to work with patches
the soulsborne games would say it's a bad idea though /j

gusty hatch
#

ok guys I made a thing:

#

but it has no behaviour

wind steppe
gusty hatch
#

lmao yeah

sonic cedar
#

can someone tell me why the function doesn't get called, despite me scoring while the joker's xmult is equal to 0?

wind steppe
hybrid shadow
#

thats what the if statement is doing

gusty hatch
#

so i cant navigate under .

daring fern
sonic cedar
wind steppe
sonic cedar
wind steppe
#

that should fix it

hybrid shadow
gusty hatch
sonic cedar
#

i JUST did this on the LAST joker 😭

gusty hatch
obtuse silo
gusty hatch
#

well, "my" sprite

gray quartz
#

got it

thorn basin
daring fern
gusty hatch
wind steppe
#

how do i check if a card is being added or removed from the joker slots? (in a hook of Card.remove_from_deck and Card.add_to_deck) self.area == G.jokers doesnt work

daring fern
#

It's card.base.suit

thorn basin
#

aight, imma try like this

sonic cedar
#

loc_vars only applies when the card is added to deck right?

#

like visually

daring fern
#

Also card.suit will never not be equal to itself.

gray quartz
#

hold on

wind steppe
#

its in a hook

daring fern
#

Also context.other_card doesn't exist.

thorn basin
wind steppe
sonic cedar
#

i thought you just said it didnt work

gray quartz
#

i fully did not know this game had a hooks system

thorn basin
daring fern
tepid crow
#

that's just how languages in which functions are full objects work

gusty hatch
#

OMG SMOD IS IN DA HOUSEEE

tepid crow
gusty hatch
#

YAAAAAAAAAHHHH

thorn basin
tepid crow
wind steppe
#

how do i check if a card is being added or removed from the joker slots? In a hook of Card.remove_from_deck and Card.add_to_deck. There is no calculate function and I have no context. self.area == G.jokers doesnt work

ionic hill
#

One message removed from a suspended account.

tepid crow
hybrid shadow
gray quartz
obtuse silo
#

this patch stuff is confusing...
i'm looking at the booster repo
and i gather what i'm supposed to do is:
use pattern target card:explode()
and then the payload needs to check that it is my specific booster pack
and then play the sound?

daring fern
tepid crow
hybrid shadow
gusty hatch
thorn basin
# daring fern Yes.

weird, it doesn't upgrade the joker if the face suits are different, but it doesn't crash this time.
It is probably because of the "~=" ?

tepid crow
gusty hatch
#

functional prog is just a philosophy of "not using classes" paradigm

hybrid shadow
gusty hatch
#

more or less

daring fern
#

@thorn basin

tepid crow
thorn basin
daring fern
thorn basin
#

oh

tepid crow
pure salmon
#
calculate = function(self, card, context)
        if context.before and context.main_eval then
            card.ability.extra.scored_suits = {}
        end
        if context.individual and context.cardarea == G.play then
            if context.other_card.base.suit 
            and not card.ability.extra.scored_suits[context.other_card.base.suit] 
            then 
                card.ability.extra.scored_suits[context.other_card.base.suit] = true 
                return {
                    mult = card.ability.extra.mult
                }
            end
        end
    end
end

@signal lotus here you go

daring fern
hybrid shadow
pure salmon
#

config = { extra = { mult = 4, scored_suits = {} } }, here's what's in config

obtuse silo
pure salmon
#

most of the other code is grab bag-specific and boilerplate stuff

thorn basin
tepid crow
gray quartz
daring fern
obtuse silo
# daring fern Perhaps.

i'm looking at the repositories and they all use the .toml file type
do i need to create a separate file?

pure salmon
#

no, for the config.ability.extra calls

signal lotus
#

i know

#

but what is the local var section

#

oh

#

nvrm

#

i just realized

thorn basin
daring fern
hybrid shadow
# tepid crow Hmm... did any other tarots give issues or have you not even looked at other tar...

all of the tarots where the can_use is tied to max_highlighted seem to work in terms of my modifications (ive tested that kind of thing with Death and that worked, havent tested the other ones but theyve been similarly changed in code). WoF was a weird one but i just realized smth else i could do to fix that up a bit. other than that, emperor, high priestess, judgement, and fool have yet to be fully tested

pure salmon
gusty hatch
#

is anyone here mikas?

#

a modder

obtuse silo
gusty hatch
#

their jokers are a lil quirky but design wise i think they are not balanced enough to be fun

obtuse silo
#

or should i stick with just putting the pattern as self:explode()?

long sun
#

hiya! remind me how to check if a playing card has a particular edition?

gusty hatch
#

but they have a very good grip on the modding fr fr

daring fern
long sun
#

cheers ^^

#

mm, then why doesn't this work?

local waxed_cards = {}
      for i = 1, #context.removed do
        if context.removed[i].edition and context.removed[i].edition.key == 'e_phanta_waxed' then waxed_cards[#waxed_cards + 1] = context.removed[i].key end
      end```
daring fern
gray quartz
long sun
#

ah oops -u-

gray quartz
#

hold on

long sun
#

wait, but the length of waxed_cards is 0

gray quartz
#

ep1n is my mod prefix and charred is the edition key

thorn basin
# daring fern What is the goal?

The joker's goal is to check that if two or more face cards (that have different rank and can have the same suit but it must be different rank; for example jack of hearts and queen of hearts is allowed, king of spades and king of diamonds is allowed but jack of clubs and another jack of clubs is NOT allowed ) are played in a poker hand.
If the condition is satisfied, the said joker gains XMult.
Basically faces with same rank and same suit at the same time are not allowed.

long sun
#

wait no, it is working, it's just not returning the message properly -u- sorry to bother!

obtuse silo
gray quartz
daring fern
gentle rain
#

is it possible for a tag to trigger under two different circumstances? currently trying to add a double tag that triggers like normal when getting a tag but dissapears when a blind is selected

sonic cedar
#

can anyone tell me why this triggers twice? like the "cut off the first trigger to trigger it again" type of double trigger

tepid crow
# hybrid shadow all of the tarots where the can_use is tied to max_highlighted seem to work in t...

Yeah it's difficult... some of the tarots like fool or strength are hard and especially modded tarots are difficult. You could do something like this for temperance (you'll have to fill in the if-statement)

SMODS.Consumable:take_ownership('temperance',
 {
    loc_vars = function(self, info_queue, card)
        if ... then
            return { vars = { 2*card.ability.extra, 2*card.ability.money } }
        end
        return { vars = { card.ability.extra, card.ability.money } }
    end,
    use_consumeable = function(...)
        ...
    end
 }
)
vague crest
#

if i have a boolean for if a planet card has been used this round

#

i typed enter too early gonna try that again

gray quartz
#

not sure exactly tho

obtuse silo
vague crest
#

if i have a boolean for if a planet card has been used this round, would i want that where i have it now or in the bottom variable bit in the screenshot? for reference this is the first joker ive done, ive gotten it to scale by 5 mult each round but the gimmick is that it should reset on not using a planet card

sonic cedar
daring fern
vague crest
#

oh so i need a new file for defining variables?

gray quartz
#

thats the most readable, but like i said it runs for every card area, so you can pick any one of them @sonic cedar

vague crest
#

waittt no sorry i see what youre saying 🤭

thorn basin
hybrid shadow
daring fern
pulsar furnace
#

how could i modify this ui?

wintry solar
#

into what?

pulsar furnace
#

uhh

sonic cedar
obtuse silo
pulsar furnace
#

like i want to show diffrent decks

wintry solar
pulsar furnace
#

with a button

#

ok

gray quartz
wind steppe
#

how do i check if a card is being added or removed from the joker slots? In a hook of Card.remove_from_deck and Card.add_to_deck. There is no calculate function and I have no context. self.area == G.jokers doesnt work

sonic cedar
vague crest
#

i think this is the part thats crashing but im not really sure why? its saying to add an extra end but that doesnt actually fix anything it still gives the same error i fear

daring fern
tough temple
#

hello people

thorn basin
tough temple
#

how would get a joker to make a random consumable IF the card played is a 4,2, or ace

#

idk how to get the current hand or how to spawn consumables basically

daring fern
obtuse silo
thorn basin
#

wait

#

maybe I found the solution

daring fern
hybrid shadow
#

all modified tarots seem to be working as intended (if i can get WoF to work)

gusty hatch
#

IM A FUCKING GENIUS

#

IT WERKS

obtuse silo
gusty hatch
#

"If you sell, you get uncommon tag"

#

EZ

daring fern
gusty hatch
#

I got my first joker made sankiu team im very grateful <3

wind steppe
gusty hatch
tough temple
#

small cola can

gusty hatch
#

next one is going to be wine

hybrid shadow
gusty hatch
#

which gives you the rare

gusty hatch
wind steppe
gusty hatch
tough temple
#

hey how do i get access to balatros source code

gusty hatch
#

and its super duper expesiv but yh

gusty hatch
#

from steam files

tough temple
#

thats possible?

gusty hatch
#

ye

vivid grotto
#

Hey guys, how possible do you think this joker would be, the Joker's name is Zalgo
-- Possible Effect: After Boss Blind, Randomly selects 2 non-Zalgo and non-combined jokers and creates a new joker with the
-- same effect as the selected jokers with randomn variation, remove original jokers from poll if in play. ( 3 usages max???)
-- 0.75 to 1.25 range for variation round up for higher then 1, round down for lower then 1. minimum value of 1
-- non-blueprint compatible? only allow blueprint to and brainstorm to only combine with each other?

obtuse silo
wind steppe
gusty hatch
#

Do not modify

wind steppe
#

99 percent of the time theres a better way to do what ur trying to do

gusty hatch
#

but yes you can read its v cool

wind steppe
#

readings unhelpful cause it doesnt use smods

tough temple
#

wdym

#

oh

#

that is so saddening

gusty hatch
#

modding is safer

wind steppe
#

vanillaremade better

daring fern
gusty hatch
#

its wot we do

hybrid shadow
tough temple
#

thank you

#

so much

gusty hatch
#

it has a cat

#

cute

sonic cedar
#

hi aure's cat

wind steppe
obtuse silo
sonic cedar
wind steppe
#

with the catch that you'd have to make 22500 jokers

#

assuming this is the only joker ur adding

wind steppe
#

wait no not quite

wild escarp
#

How would I check the id of a joker in the shop?

obtuse silo
wind steppe
#

21906 jokers

vivid grotto
gusty hatch
#

meh idk it would make negatives a lil redundant

#

game design wise i think its better to just have a chance to make negative with debuff

#

its in most effects the same thing

tough temple
#

would this work?

context.other_card:get_id() == "Ace"
wind steppe
#

maybe you can code like a joker-linking thing or something

wind steppe
#

where if one gets destroyed they both do

tough temple
#

do i put 14 instead?

daring fern
tough temple
#

thx

vivid grotto
# wind steppe 21906 jokers

would it be possible to add another joker's effect to an existing joker? like how you can add chips to a card?

gusty hatch
daring fern
vivid grotto
#

😂

wind steppe
#

unless you mean without the fusion (so unconditionally)

obtuse silo
gusty hatch
vivid grotto
daring fern
wind steppe
#

how do i check if a card is being added or removed from the joker slots? In a hook of Card.remove_from_deck and Card.add_to_deck. There is no calculate function and I have no context. self.area == G.jokers doesnt work

gusty hatch
#

pretty much for each value existing if its non default from the cards and then manually pass all as parameter for the new one

obtuse silo
gusty hatch
#

so a if cascade thats ugly

thorn basin
gusty hatch
#

or a foreach that captures on a list

daring fern
vivid grotto
#

thanks for help tho

gusty hatch
obtuse silo
gusty hatch
#

the thing is that making a negative with debuff is gameplay wise super similar and implementation wise duper simple

wind steppe
gusty hatch
#

@vivid grotto so if you are willing to make that smol adjustment you got yourself a new legendary

#

gg

obtuse silo
thorn basin
worthy stirrup
#

Im trying to have it so the soul card does an animation, but its not moving, the soul is there

daring fern
vivid grotto
gusty hatch
#

but im going to implement some other jokers first

wind steppe
gusty hatch
#

get some practice

gusty hatch
#

@wind steppe could not be possible without chu

#

sankiu

wind steppe
#

if you just want suit and rank then instead of saving face cards as a whole save the suit and rank of any face cards as a table

wind steppe
worthy stirrup
daring fern
spice wadi
#

Same with the question mark react

spice wadi
#

Just saying no or reacting like that without explain at all generally is not helpful

thorn basin
thorn basin
#

...uuuh

wind steppe
tough temple
#

what are collection_rows in consumable types?

daring fern
#

card.sort_id is always different.

#

Also card.playing_card

wind steppe
#

save suit-rank pairs instead of card objects and check for duplicate suit-rank pairs

#

considering they wanted to check for suit and rank

worthy stirrup
#

for example: {2, 1}
x x
x

tough temple
#

so like

obtuse silo
tough temple
#

what does it do im confused

#

it is required?

worthy stirrup
#

i am not sure to be honest

daring fern
wind steppe
thorn basin
wind steppe
#

wow very helpful something

spice wadi
wind steppe
#

hold on let me write pseudocode for my solution

obtuse silo
spice wadi
#

What does the joker do

thorn basin
# spice wadi What does the joker do

Check if 2 or more face cards are entirely different on a played poker hand.
By that I mean that they cannot be the same suit and rank at the same time (like jack of clubs and another jack of clubs).
If there are no same face cards then the joker gains an amount of XMult (currently X1)

obtuse silo
daring fern
# thorn basin then how can I define them?
local faces = {}
local passed
for k, v in pairs(context.full_hand) do
    if card:is_face() then
        if not faces[v.base.name] then
          faces[v.base.name] = true
        else
            passed = true
            break
        end
    end
end
if passed then
    -- gain xmult
end
wild escarp
#

What could I use in Card:set_cost() to look for a specific joker?

daring fern
wild escarp
#

Thanks!

spice wadi
#

This is getting ridiculous 😭

#

I don't want the crypto thanks

#

Thanks mods

wind steppe
#

how do i check for a card's base suit?

daring fern
obtuse silo
daring fern
obtuse silo
obtuse silo
thorn basin
wind steppe
#

I have a solution

#

One sec

hybrid shadow
#

question for future reference, does context.destroy_card tie all of the playing card's attributes (suit, enhancement, etc) to destroy_card?

wind steppe
daring fern
wind steppe
#

isdifferent will be true if there are two different face cards

wind steppe
#

too used to python

daring fern
#

So yes.

thorn basin
daring fern
scarlet spire
#

how can I, on a blueprint-like joker, detect when it copies another joker to decrease a variable?

daring fern
#

Also check if #context.scoring_hand >= 2

scarlet spire
spice wadi
daring fern
spice wadi
#
local blueprint = SMODS.blueprint_effect(card, other_joker, context)
        if blueprint then```
scarlet spire
#

oh, huh

#

I see

spice wadi
#

The function only returns something when there's a trigger

#

I think it's kinda important to note that it really is per trigger
So if it's copying a joker that acts per card (eg 3 mult per diamond card), your variable would be changed once for each card

daring fern
#

Yes, but it won't always return something if there is a trigger.

spice wadi
#

Oh that's interesting, in what cases does that happen

#

And why

vague crest
#

theyre beautiful im clicking my heels together

daring fern
# spice wadi And why

When copying jokers that don't return anything, because they don't return anything.

spice wadi
sturdy compass
spice wadi
vague crest
#

the tuna is by my friend and atlas is mine :3 very proud of them

daring fern
spice wadi
#

No I get that

#

But I also want to detect when a blueprint style card copies a card

#

So if there's any jokers that you know of that don't return anything when triggered, I'd like to know so I can change them to return something

formal parrot
#

Hey modders

#

I have a question

#

How can i make an animated sprite ?

spice wadi
spice wadi
spice wadi
thorn basin
thorn furnace
#

How do I go about adding the little information bubble to the right dance

thorn furnace
#

what would I put in there

wind steppe
daring fern
spice wadi
thorn basin
daring fern
gentle rain
#

is there a variable for how many slots a card (specifically a consumable) occupies?

spice wadi
thorn furnace
# thorn furnace o thanks

If I wanted like a custom information box that wasn't for a specific Joker or enhancement, how would that go

daring fern
thorn furnace
#

o I meant more like custom text
Like if I wanted to use it to explain a mechanic or smth

#

Sorri im bad at explaining things

gentle rain
daring fern
thorn furnace
daring fern
#

You would just do area.config.card_limit = area.config.card_limit + 0.5 when added and do the opposite when removed.

gentle rain
#

ah right

wind steppe
scarlet spire
#

been away from lua for a bit, how can I return SMODS.blueprint_effect alongside other things like messages? is that possible?

#

I'm forgetting basic syntax...

thorn basin
spice wadi
#

However

#

For returning multiple effects in general

daring fern
spice wadi
#

BRO stop with that question mark thing I'm so tired of it 😭

#

Okay looking back at my original code I realise I made a mistake

#

However

#

You can do two things to return multiple effects

#

You can add another return effects table in the extra field

wind steppe
#

If I knew how to make a discord bot I’d detect Something’s question mark reacts and call him out on it

#

I don’t tho

daring fern
spice wadi
#

So like in my earlier example where I put the effects in blueprint, you can put it in blueprint.extra

#

You can also run the function SMODS.calculate_effect

daring fern
#

Then retriggers wouldn't work.

spice wadi
#

Retriggers of what sorry

daring fern
spice wadi
#

Could you expand more on how that would play out in practice
Because I use that function primarily for things like extra messages

wintry solar
#

as long as you do return nil, true retriggers would work fine

#

or return a standard effects table of course

daring fern
scarlet spire
spice wadi
daring fern
#

You need to define it though.

thorn basin
# thorn basin like this?

@wind steppe there's still the problem that the joker upgrades with two equal faces with the same suits and ranks (if I play a pair).

wintry solar
#

you'll be able to use SMODS.merge_effects(...) when the new release is out

rapid stag
#

how do i get the length of a key-based table?

faint yacht
#

Iterate and count up with pairs.

rapid stag
#

cirBlech i guess that's my only option huh

spice wadi
#

This is me asking for my own knowledge but why doesn't using # work for counting these?

wintry solar
#

# finds the highest consecutive index

rapid stag
#

because # only cares about indexed tables

wind steppe
#

What’s in the console when it scores?

wintry solar
#

it doesn't technically count the size of a table

wind steppe
thorn basin
spice wadi
scarlet spire
wind steppe
thorn basin
wind steppe
#

Idk

spice wadi
#

Can you send the full code again

thorn basin
humble elk
#

does anyone know how stuff is cached? Ive changed this config label a couple times and rebooted the game but it isnt reflecting that name change in game
initially i had
get_reps = function(params) dosomething end
which just didnt show in the extra table at all.

repetitions: 1


When i changed the line to
another_label = "another thing"
i get the following. Anyone know how to get the game to recognize the most recent version?
in my joker's config:

        extra = {
            repetitions = 1,
            another_label = "another thing"
        }
    },
... (later)
logger.log(card.ability.extra)
...```
Log:
```INFO - [G] [Example] Table:
repetitions: 1
get_reps: another thing```
wind steppe
spice wadi
# thorn basin

Change the if statement to beif ifdifferent == true then

wind steppe
spice wadi
#

Yeah that

#

It's 2am and I'm on mobile haha

thorn basin
#

I applied both changes and it still has the same problem

#

and still prints nil

spice wadi
#

I'm too tired for this I'm gonna sleep

#

My main recommendation to you is to do a ton of debugging

#

Put print statements in each step

#

Including to print out some of the variables if needed

daring fern
thorn basin
#

I'm gonna go sleep too at this point

#

gonna work on it tomorrow

#

thank you guys still

daring fern
thorn basin
#

I hope I haven't exhausted your patience.
thank you guys still for the help, really appreciated it.

spice wadi
#

Ofc, I hope anything I suggested has helped

vivid grotto
#

hey I am trying to make this rat enchantment that acts as both a steel and stone card, but I want it to convert unscoring cards into rat cards, my current implimentation isn't working, any ideas?

scarlet imp
#

I have this Joker that applies a multiplier to other Jokers' mult effects. I want to make it amplify the mult gain on things like Ride the Bus and Obelisk, and the effect seems to work based on the updated description, but the game crashes every time. I took ownership of Ride the Bus to try and fix the problem, but nothing worked

daring fern
#

Neither does context.scored or card.scored

vivid grotto
daring fern
sonic cedar
lucid owl
#

@signal lotus adding a pool to a joker and indexing said pool (your implementation would slightly differ in how you index)

#

so you could do
pools = { ["Your_Pool"] = true },

#

shit

signal lotus
#

how do i add pools to the mod or is there a way i make them before i add them to jokers or does just adding them to the koker make them exist

vague crest
#

how would i go about removing chips from scored cards?