#💻・modding-dev

1 messages · Page 606 of 1

nova sleet
#

I have purchased Balatro on Steam

#

It begins

obsidian spear
#
local function bear5check(card) -- possibly my messiest script
    delay(2)
    local continue = false
    local checks = {{bool = false, other_card = nil}, {bool = false, other_card = nil}}

    for _, v in ipairs(G.jokers.cards) do
        if v.config.center.key == "j_tngt_dingaling" then
            print("dinaling")
                checks[1].bool = true
                checks[1].other_card = v

            if checks[2].bool then
                checks[1].other_card:remove()
                checks[2].other_card:remove()
                        
                SMODS.add_card {
                    key = "Bitters_BEAR5",
                }

                break
            end

        elseif v.config.center.key == "j_Bitters_goldding" then
            print("golden")
                checks[2].bool = true
                checks[2].other_card = v

            if checks[1].bool then
                checks[1].other_card:remove()
                checks[2].other_card:remove()
                        
                SMODS.add_card {
                    key = "Bitters_BEAR5",
                }

                break
            end
        end
    end
end

why does this being called from add_to_pool or from context.card_added cause it to ignore the card that was just added, even with delays it doesnt work (and yes i know why now) but i dunno how to get around this problem

broken rivet
#

bear 5

swift arrow
obsidian spear
coral grotto
#

is it possible to completely change a playing card into a randomly picked new card? i know of create_playing_card but can't seem to get it to work for my purposes

coral grotto
#

tried that, didn't seem to work

#

could be a problem with the outer function

#

here's what i have

for k, v in pairs(context.full_hand) do
  if v.debuff then
    G.E_MANAGER:add_event(Event({
      delay = 0.4,
      func = function()
        SMODS.change_base(v, pseudorandom_element(SMODS.Suits, 'test'), pseudorandom_element(SMODS.Ranks, 'test'))
        v:juice_up(0.3, 0.5)
        return true
      end
    }))
  end
end
#

the juice_up seems to be going through but not the change_base

#

ok never mind i missed the part that said to wrap it in an assert() and am seeing the error

obsidian spear
#

why does

        self:remove()

not remove the card and instead resulting in a crash?

#

and how do i fix it

wind steppe
#

card:remove() i think

#

pretty sure self is the card's center

#

(assuming this is a calculate function)

obsidian spear
#

@wind steppe uhhh

#

i mean it kinda was a calculate func but it was a local function called from calculate

daring fern
smoky flax
obsidian spear
# daring fern Code?

local function bear5check(card) -- taken from joker forge dont @ me
    if (function()
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i].config.center.key == "j_tngt_dingaling" then
                    print(G.jokers.cards[i])
                    G.jokers.cards[i]:remove()
                    print("Found Dingaling")
                    return true
                end
            end
        return false
    end)() then
        -- print(self)
            card:remove()
        G.E_MANAGER:add_event(Event({
            func = function()
                SMODS.add_card({key = "j_Bitters_BEAR5"})
                return true
            end
        }))
    end
end```
wind steppe
#

you should also be removing it in an event i believe

gaunt folio
#

this doesnt work, what am i doing wrong iwth my code?

#

im obviously not doing something right

daring fern
gaunt folio
#

thanks

copper perch
#

Would Smods have anything close to function SMODS.content.set_debuff(card)? I was told to reference Bunco, and this would seem to be as close to my answer as I can but Smods isn't accepting it, for obvious reasons

daring fern
copper perch
#

All I know is Bunco has function BUNCOMOD.content.set_debuff(card)

daring fern
copper perch
#

Ahhh, okay

copper perch
daring fern
copper perch
#

I did as debuff, for example, and still had a red line

frosty rampart
#

SMODS.current_mod.set_debuff isn't a function you call
it's a function you define, and the game will automatically handle it by calling the function during regular gameplay

unkempt bronze
#

How do I check for if there's a certain amount of a consumable?

#

(not for the overall number of consumables, but for a specific set and for a specific number)

frosty rampart
#

loop over G.consumeables.cards, check each card for if it's what you're looking for, and increment a counter by 1 if it is

daring fern
unkempt bronze
copper perch
frosty rampart
#

that's not what i'm talking about

copper perch
#

I'm confused what I'm looking for then

frosty rampart
#

hang on i'm trying to find an example

#

this is how paperback makes it so that the new Sleeved enhancement can never be debuffed

#

this is code just in the main file of the mod, not inside any other definitions

unkempt bronze
normal crest
frosty rampart
#

probably

#

idk why i did it that way

normal crest
#

definitely should if you can

unkempt bronze
#
    key = 'lhc',
    atlas = "My_Way_and_The_Highway",
    rarity = 3,
    pos = { x = 3, y = 1 },
    cost = 10,
    blueprint_compat = false,
    calculate = function(self, card, context)
        if #SMODS.find_card('c_xiferp_Element') == 2 then
         local el_sum = 0
         for _, xiferp_Element in ipairs(G.consumeables) do
              el_sum = el_sum + xiferp_Element.element_no
              SMODS.destroy_card(xiferp_Element)
             end
         if context.after then
             if el_sum <= 106 then
                local element_cards = {}
                for k, v in pairs(G.consumeables.cards) do
                     if xiferp_Element.element_no == el_sum then
                     table.insert(element_cards, v)
                    end
                end
             SMODS.create_card(element_cards)
        end
        end
     end
end
}```
Card appears, but not fusing the cards it's intended to fuse (nothing happens)
faint yacht
#

I use it.

copper perch
frosty rampart
#

yea see what ali just posted

copper perch
#

Yup, just saw lol

copper perch
frosty rampart
#

it should be "m_DRY_oddity"
other than that, you're done

copper perch
#

So will need nothing secondary? Just this

frosty rampart
#

yep

copper perch
# frosty rampart yep

Won't need to call that anywhere?? Sorry, its just weird that I've only needed to do it once lol

frosty rampart
#

again
SMODS/the game calls it frequently during the regular gameplay loop

copper perch
#

Got it, shall test now

unkempt bronze
#

May I have some help?

frosty rampart
unkempt bronze
#

Well, anywhere you can point me to help with that?

frosty rampart
frosty rampart
# unkempt bronze Well, anywhere you can point me to help with that?

to be more specific, "looping through [table]" means doing for i, v in pairs(table) and doing something on v in the loop (v will be each element of table)
you should be able to figure out how to check if a card is an element card. use the documentation and vanillaremade, i believe in you

lucid owl
#

would there be a more efficient way to note down every single suit/rank combo played in a run aside from literally just a gigantic fucking table

frosty rampart
#

i doubt it

unkempt bronze
# frosty rampart to be more specific, "looping through [table]" means doing `for i, v in pairs(ta...
    key = 'lhc',
    atlas = "My_Way_and_The_Highway",
    rarity = 3,
    pos = { x = 3, y = 1 },
    cost = 10,
    blueprint_compat = false,
    calculate = function(self, card, context)
    local element_cards_held = 0
    for i, v in pairs(G.consumeables.cards) do
      if SMODS.consumeable.xiferp_Element == true then
        element_cards_held = element_cards_held + 1
      end
    end
      if element_cards_held == 2 then
         local el_sum = 0
         print(el_sum)
         for _, xiferp_Element in ipairs(G.consumeables) do
              el_sum = el_sum + xiferp_Element.element_no
              SMODS.destroy_card(xiferp_Element)
            end
         if context.after then
             if el_sum <= 106 then
                 SMODS.add_card { set = 'xiferp_Element', element_no = el_sum }
              end
        end
     end
end
}```
gonna see if this works
lucid owl
unkempt bronze
#

Attempting to field 'consumeables'

frosty rampart
#

you need a context check for your calculate function

unkempt bronze
#

The game says the error is inif SMODS.consumeable.xiferp_Element == true then

frosty rampart
#

my statement still stands but it's not the cause of this crash
have you considered that what you're trying to do in that line is completely nonsensical

unkempt bronze
#

Any better way to put what I'm trying to do?

frosty rampart
unkempt bronze
#

Uhhuh

frosty rampart
#

think about what the specific table you're looping through is

#

and what each element would be

#

and then think about what you want to do to each element

#

and do it to v

unkempt bronze
#

oh. we're doing the check on v

unkempt bronze
frosty rampart
#

you're getting closer at least

#

but that's not how you check if a card is of a specific set

unkempt bronze
#

if context.post_joker then (also, context)

frosty rampart
#

again, read some documentation and check vanillaremade for similar situations

unkempt bronze
#

what do I put for it?

frosty rampart
#

when do you want this code to trigger?

unkempt bronze
#

after the round

frosty rampart
#

so go check the Calculate Functions documentation on the smods wiki for a context that happens at the end of the round

unkempt bronze
#
      if G.consumeables.cards.ability.set == 'xiferp_Element' then
        element_cards_held = element_cards_held + 1
      end
    end```
#

Almost there, I think

frosty rampart
unkempt bronze
#

Oh. Woops

#

The code I took that from went

#
                 if G.jokers.cards[i].ability.set == 'Joker' then joker_count = joker_count + 1 end
             end```
(Abstract Joker)
unkempt bronze
frosty rampart
#

you can figure it out

unkempt bronze
#

I might stick with Abstract Joker

#

(for this part)

frosty rampart
#

sure that works fine

#

it's just a matter of preference/code style

unkempt bronze
#

I just wanna see if it works, the preference is just getting the spaghetti edible.

unkempt bronze
#

except for if G.consumeables.cards.set == 'c_xiferp_Element' then which aren't counting

frosty rampart
#

slow down and think about what that line means

#

G.consumeables.cards is a table containing all the player's consumables

stiff locust
#

gifs are blocked

frosty rampart
#

so you see how G.consumeables.cards.set is meaningless, right?

unkempt bronze
#

ah.

frosty rampart
#

i want to be sure you genuinely understand why it's meaningless

unkempt bronze
#

Because I am looking at a set of a set?

frosty rampart
#

no

#

because set is a property stored in an individual card's ability table
and you're not even looking at an individual card right now

unkempt bronze
#

okay.

frosty rampart
#

so think about how you're getting an individual card

unkempt bronze
#

...I'm not

frosty rampart
#

you can figure out how you would get one
it's literally right in front of you, whether you're using the loop structure i suggested or looking at vanillaremade abstract joker

unkempt bronze
#

ability.set?

frosty rampart
#

yes, but on what

unkempt bronze
#

cards[i]

frosty rampart
#

give it a try

unkempt bronze
#

sorry about all that

#

uh.. still not working...

frosty rampart
#

i'm trying to teach you fundamentals in problem solving and software development, it's gonna take a while lol
but the flipside is that ideally you come away with a better idea of how to figure out how to do what you want to do in the future, and therefore ask less questions in here in the long run :3

unkempt bronze
#

That's a bold mission statement, but alright then.

#

The set is supposed to be 'modprefix_key' right?

frosty rampart
#

i'd much rather do that than just write all the code for you and you learn nothing and the pattern keeps happening

frosty rampart
unkempt bronze
#

I'm using print(the_thingy) for it, and it says 0

frosty rampart
#

you're probably printing the wrong thingy

#

but i don't know that because i don't know what thingy you're printing

unkempt bronze
#

must be altering the wrong thingy

#

cuz I'm printing the right thingy that's supposed to start at 0

frosty rampart
#

ok, then that's unrelated with what i suggested

#

you asked if a value was supposed to be a certain thing, and i told you how to go find what that value is

unkempt bronze
#

I'm trying to do trial and error bug fixing, as you're teaching me

#

it works, it does sum to 2

#

1 + 1 = 2

#

hooray, I've passed preschool!

#

now to part two of three of the code: the adding element numbers.

#

It's breaking again. Okay, work this through. Wait. sell_cost isn't set in the jokers directly...

#

Oh. There's my issue.

#

Now how do I fix it?

#

Idk, Imma bed down.

unkempt bronze
#

where's it set?

lucid owl
#

what are you looking to do

unkempt bronze
#

add two element card numbers together

#

currently they're on the same sort of setup as cost on normal jokers

lucid owl
#

so you're trying to make their sell cost lower?

unkempt bronze
#

I was hoping to use swashbuckler, but it does sell_cost, which isn't a variable and is based of cost ppresumably directly

unkempt bronze
lucid owl
#

wdym add two element card numbers together

unkempt bronze
#

unrelated in the point of what I'm aiming to do

unkempt bronze
#

want me to send an example element?

lucid owl
#

so you're trying to basically combine two consumables together?

unkempt bronze
lucid owl
#

okay well i don't get what the end goal of adding atomic numbers is

unkempt bronze
#

here, imma post an element as example

#
SMODS.Consumable {
    key = "helium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 15, y = 0 },
    unlocked = true,
    discovered = true,
    element_no = 2,
    can_use = function(self, card)
      return true
    end,    
    loc_txt = {
        name = 'Helium',
                text = {
                    'Adds +5 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_nobelgas_chips = (G.GAME.xiferp_nobelgas_chips or 0) + 5            
    end      
}```
See the element_no? that's what I'm trying to add together.
lucid owl
#

would you not set that as a config variable

unkempt bronze
#

hm. I can

lucid owl
#

if it is a config variable, just add those together

unkempt bronze
#

would that make adding them together easier?

lucid owl
#

you would be able to index it pretty easy

unkempt bronze
#

so making elements of certain numbers will be easier?

lucid owl
#

just (card).config.element_no or something similar

lucid owl
unkempt bronze
lucid owl
#

assuming nothing changes its config externally it should be easily accessible

unkempt bronze
#

beautiful.

lucid owl
#

if i get what you're saying

unkempt bronze
lucid owl
#

honestly i don't know

#

either way having it defined in the card config should be easier

unkempt bronze
#

okay. so how do I set el_sum = el_sum + xiferp_Element.element_no to only read the config variable?

#

it is just el_sum = el_sum + xiferp_Element.config.element_no?

#

cuz it didn't see to work

#

imma come back to this later.t

granite jay
#

Oh hey that's what I'm looking for!

yoinks code

stoic void
#

This isnt working
The local text says its description

daring fern
stoic void
#

Ill try that out

#

it works thx

#

Got foil twice in a row

#

but its cool

plucky berry
#

why do they have pronouns

stoic void
#

Card pronouns api

stiff quiver
#

How would I change the playing cards appearance?
what I want to do is a deck that at some point in the run changes the deck skin, but I dont want to make those cards a deck skin

stiff quiver
#

or probably none of the ones I said considering my guesses are always wrong lmao

daring fern
stiff quiver
daring fern
stiff quiver
#

thanks for the help

ashen drift
#

why is my main end not showing up

daring fern
ashen drift
#

oh right

#

grand

hybrid iris
#

genuinely dont understand the API for objecttypes

#

how do you use ConsumableType.create_UIBox_your_collection(self)???

#

how do you get the table FOR the consumable type

slim ferry
#

idk what it does but the collection page is already done automatically

hybrid iris
#

oh i know im making a custom menu for it

slim ferry
#

oh ok

hybrid iris
#

thats why im using it

#

which is also why i Dont Get It
ksdhfsdkfjhsf

slim ferry
#

well you need to have a create_UIBox_your_collection field on the consumabletype

#

and then in there return a uibox (see ui page)

hybrid iris
#

I do??? i thought since its an API method it would do it automatically

#

yeesh okay nevermind ill have to do it manually again then

#

ALSO how do I call on the consumabletype
like genuinely how do i access it

slim ferry
slim ferry
hybrid iris
#

ive never gotten it
is it like
SMODS.ConsumableType[key]

#

I SEE

#

What the hell why doesnt it say that on the wiki page 😭

#

oh well thank you so much

upper garnet
#

Hey yall, I haven’t started coding yet but if a joker gave X5 mult if 5 cards with the same enhancement are scored, would you say it’s an uncommon or rare joker?

slim ferry
#

rare probably

#

feels most similar to the hand type Xmult jokers which are also rare

jade scarab
#

yea

umbral spire
#

how do you get your mod on BMM (balatro mod manager) or something?

umbral spire
real crown
#

How can I make Legendaries appear in the shop?

ashen drift
#

where is the code handling the Y coordinate changes when i select a card

solid salmon
#

chat how do i add colors

ashen drift
#

local color = HEX("hex code without the hashtag at the start")

solid salmon
#

would i be able to use it anywhere?

ashen drift
#

if you make it a global yes

solid salmon
#

so global color = HEX(insert hex code)

ashen drift
#

lua doesnt have a global keyword so you can just remove the global at the start

solid salmon
#

oke

real crown
#

How can I access elements of the shop? E.g.: check if an offered card is a Joker, and if it is, do something with it?

ashen drift
#

i reccomend to put it in G.C for simplicity

solid salmon
#

and assign it as a color for "miracles"

ashen drift
#

G.C.MIRACLES = HEX("ff99dd")

#

you still have to register the color for whatever you want it to do yourself

solid salmon
#

and how do i use it

ashen drift
#

i mean you can use it in a lot of ways

solid salmon
#

like in local text and messages

ashen drift
#

oh

#

specifically this part

hallow slate
#

How would I check if a card was copying another card like Blueprint or Brainstormd oes

ashen drift
#

i think you can just hook SMODS.blueprint_effect for the majority

red flower
umbral spire
#

ah.

red flower
red flower
# umbral spire ah.

I wouldn't worry about it my mod is based on copyrighted material and it's there

real crown
ashen drift
#

n

red flower
#

goldenleaf

ashen drift
#

can you assist me

red flower
#

depends

ashen drift
#

on?

red flower
#

the problem

ashen drift
#

sorry i thought you saw it i guess i shouldntve assumed that

red flower
ashen drift
#

thanks

ashen drift
#

hm

#

so modifying card.T.y does nothing

#

weird

#

im probably doing something wrong

hallow slate
#

Best way to play sound upon joker trigger

solid salmon
#

how do i make the tooltip for the sun

ashen drift
#

i have no idea on how to make it hold though

latent perch
#

ooh yeah, I've struggled with this before too

ashen drift
#

share your wisdom

latent perch
#
local center = Moveable(10, 5, 1, 1)
center:hard_set_T(10, 5, 1, 1)
for _, pcard in ipairs(cards) do
  pcard:set_alignment({major=center, bond="Weak"})
end
#

I did this

#

but this is pretty weird and probably far from the best way to do something like this

#

(I am moving cards to a specific point on screen)

#

you might be able to instead just set the alignment on each card to be bond="Weak"

#

without creating a Moveable

ashen drift
#

perhaps

hallow slate
ashen drift
#

i am NOT familliar with balatro code lol

latent perch
#

what are you trying to do btw?

ashen drift
#

trying to make the cards stay injogged

#

also bond = weak did not work :/

latent perch
ashen drift
#

wdym

latent perch
#

what do you mean by 'making the cards stay injogged'

ashen drift
#

making their positions slightly lower

latent perch
#

I see

ashen drift
#

ideally permanantly until uninjogged

latent perch
#

well actually then you should probably look into lovely patching the function N' mentioned above, CardArea:align_cards()

ashen drift
#

ill try doing something

#

i barely understand the func

latent perch
#

specifically changing this according to the card's state

real crown
#

What's the issue with my create_card? It completely breaks fool even though it shouldn't be affected as it's not in the "Joker" set, so in that case it should just return whatever it was trying to create in the first place

ashen drift
#

so theoretically could i check if card.injoggen exists and add an value to y if it does?

latent perch
ashen drift
#

grand

#

thanks

latent perch
#

np! hope it works :)

latent perch
real crown
ashen drift
#

okay this isnt doing anything, do i need to call anything to make it display?

slim ferry
latent perch
ashen drift
#

yes

latent perch
#

hmm

#

maybe take a look at the lovely dump of the cardarea.lua file

ashen drift
#

its here

real crown
ashen drift
#

this is how im setting injog

#

the variable says injogged jokers because im an imbicile and forgot what i was coding for a minute

#

but its playing cards

latent perch
#

my intuition tells me to check whether hoveredcard is actually the right thing

#

no idea if that's the problem though

ashen drift
#

ill check

#

its exactly hoveredcard

latent perch
#

hmmmmmmm

latent perch
#

check the block below

ashen drift
#

bruh

#

sob

latent perch
#

the patch should still work though I think

#

like the pattern target should be the same

#

in theory

#

actually nvm

ashen drift
#

what

latent perch
#

card.T.y = self.T.y + self.T.h/2 - card.T.h/2 - highlight_height + (G.SETTINGS.reduced_motion and 0 or 1)*0.03*math.sin(0.666*G.TIMERS.REAL+card.T.x) + math.abs(0.5*(-#self.cards/2 + k-0.5)/(#self.cards))-0.2

card.T.y = G.hand.T.y - 1.8*card.T.h - highlight_height + (G.SETTINGS.reduced_motion and 0 or 1)*0.1*math.sin(0.666*G.TIMERS.REAL+card.T.x) + math.abs(1.3*(-#self.cards/2 + k-0.5)/(#self.cards))^2-0.3

#

above line is the booster pack alignment

#

below line is the regular hand alignment

#

the patch needs to target the lower line

ashen drift
#

alright

latent perch
#

wait other way around lmaop

ashen drift
#

ik

#

yoo its working

#

thanks

latent perch
#

yay :D

charred widget
#

Hi friends. Today I've got something unrelated to my own mod, it's with the game itself

#

There's this weird thing that's been happening, where two things are supposed to happen at the same time, but instead happen one after another

#

One instance of this is with gold seals

#

The gold seal displays "$3" when it's played, but it only gives me the $3 after it's displayed, when they're supposed to happen at the same time

#

Does anyone have a shred of an idea of what's going on?

native bone
#

That is how it has always been. Why is this even a problem?

#

Actually, I dont want to gaslight you, so maybe just verify game files and try again

charred widget
#

Another one is with Cavendish

#

Normally, it says "extinct" and the card disappears at the same time, but i've been seeing it do one after another. is it possible I've just been working with some QoL mod?

frosty rampart
#

smods has changed some timings iirc
i feel like I remember hearing about money timings being weird a while back, and I figure cavendish timing is related to some combination of the new probability API + the food jokers having different destruction effects than vanilla

charred widget
#

ok

#

well there's one more thing that's definitely not normal

#

you know how when the game boots up with the animation of the cards flying into the center

#

and there's like 3 or 4 audio tracks with sound effects that overlay on top of each other

#

well when i've been booting up the game those audio tracks have been going one at a time

#

and it's delaying the rest of the game audio from even playing

charred widget
#

any way for me to fix it?

faint yacht
#

No idea. ¯_(ツ)_/¯

charred widget
#

heck

wintry solar
charred widget
#

1.0.0-beta-0827c

wintry solar
#

Update it

#

Problems will be solved

charred widget
#

oh there's a new update?

wintry solar
#

Maybe not the audio one, I’ve not heard of that before

#

Yeah we are on 1016 now

charred widget
#

how often is smods updated?

frosty rampart
#

ideally about once a month I think?

wintry solar
#

It depends on how busy I and the rest of the team are

#

I strive for a fortnightly release schedule in an ideal scenario

slim ferry
#

Fortnite 🤯

umbral spire
#

how do i play a sound at mod/assets/sounds/sound.ogg?

if i just do play_sound('sound') it'll crash with Could not open file resources/sounds/portal.ogg. Does not exist.

#

ik i could just put it in resources/sounds/ but is it possible to play it from elsewhere?

faint yacht
#

You're supposed to register the sound, then use the modprefix_key as input for play_sound.

umbral spire
#

oh

faint yacht
#

SMODS.Sound({key = "duck", path = "duck.ogg"}) would be assets/sounds/duck.ogg... and as my prefix is toga, the full string is toga_duck.

umbral spire
#

after i played a hand it crashed? (im tryna make it where at the end of hand it changes all played cards into a random rank and suit)

native bone
daring fern
umbral spire
#

whats psuedorandom_element do?

daring fern
frosty rampart
daring fern
umbral spire
daring fern
umbral spire
#

alr thanks

umbral spire
daring fern
frosty rampart
#

and that's a format suitable for use in change_base :)

umbral spire
#

ah

#

so like this?

daring fern
umbral spire
#

oh mb

#

when can i detect the end of hand, but before they get discarded?

native bone
daring fern
native bone
#

I test

native bone
#

It placed it in the Joker slot, interesting

daring fern
native bone
#

I fixed it though

umbral spire
#

whats that?

#

-# i mean when is it true

#

i want it to change all played cards after all of the cards finished playing (end of playng card).

daring fern
umbral spire
#

so when is context.full_hand true?

#

do i do?

daring fern
umbral spire
umbral spire
#

anyone? 😭

#

like this?

wheat rapids
#

I need this joker to give X0.5 mult per 10 in the full deck but I can't get it work 😭

#

Like the art and joker are in game, but it doesn't detect any of the 10s for some reason

#

-# srry about the quality on the image

elder rune
near coral
frosty rampart
#

have you considered checking how cloud 9 works in vanillaremade
(if card.rank == 10 is not the correct way to count 10s i'm pretty sure)

#

also your return table is overcomplicated, you can just return { xmult = total_mult } and it'll handle the message automatically for you

wheat rapids
#

Ohh I'll try looking for cloud 9

#

Thanks about that

near coral
#

Ground 8

wheat rapids
#

Didn't think of that before

near coral
#

Air 7

heavy elm
#

for SMODS.add_card, is there a way to exclude a rarity or pull from multiple different rarities? i want it to create a card that is specifically either common or uncommon

prisma loom
#

Folks, is anyone here familiar with shaders?

near coral
#

What even are shaders

wheat rapids
#

The ones used for Foil, Holo and Poly

#

I think

prisma loom
near coral
#

Oh

prisma loom
near coral
#

Why base look like that

prisma loom
#

its Vintage

near coral
#

Oh

zealous glen
unkempt thicket
charred widget
#

smods is acting up

#

none of my mods are loading

#

i updated smods and now it's just vanilla balatro

#

wait

#

no i fixed it

#

ok the mods are loaded now but it's doing the thing where the audio tracks for the intro are all playing one at a time

prisma loom
#

+make overexposed corner less bright

prisma loom
near coral
#

What do people even use to code things in

lucid owl
lucid owl
near coral
# lucid owl vscode

I wanna try modding in a simple blind, I make simple ones so one of mine should be enough

#

However I have no experience coding

lucid owl
#

learn the basics of lua, check smods blind documentation, see how vanillaremade implements vanilla blinds

near coral
#

Idk how to do any of that

lucid owl
# heavy elm oh ty :)

the pseudorandom_element() part just selects either common or uncommon at random, you can set that to a single string for a guaranteed rarity

lucid owl
#

we can't handhold ya the whole time

jade scarab
#

where can i find the github for vanilla remade or whatever the mod that's used for examples is

daring fern
zealous glen
jade scarab
#

thanks

near coral
zealous glen
#

The SMODS Shader examples have a golden shader with a sheen comprised of sharp stripes

lucid owl
jade scarab
#

yea

near coral
#

It's like trying to make someone learn perfect english without telling them the rules

lucid owl
#

we're not directing you to specific resources because they're incredibly easy to find yourself

#

you can google these things easily

prisma loom
# zealous glen What kind of sheen exactly?

Like Negative/Booster packs but in a way so that the colors themselves are not affected since I ran into a problem that the Negative sheen makes certain colors on certain Jokers reflect light (sheen wave) while I need the sheen waves to go over any colors on Joker equally without "highlighting" certain parts/colors

#

See this card? I need a sheen wave (like on Negative) to go over the joker when you hover over it BUT without "highlighting" certain colors with the sheen

#

(you see how sheen wave highlights only the background)

#

or just makes that color reflect sheen more effectively

#

idk how exactly does this work

#

just describing what I see

prisma loom
#

Sharp stripes look a bit awkward

prisma loom
#

for whatever reason

near coral
prisma loom
#

It doesnt look as cool when it happens to other editions

#

including mine

near coral
#

Oh

#

Also is coding for this game done in a text file or some other file type

lucid owl
#

.lua files

near coral
#

ah balatrojoker

prisma loom
#

iirc

near coral
prisma loom
near coral
prisma loom
near coral
jade scarab
#

from what i know from how people organize code i'd put the blinds in their own file or folder

near coral
#

Ok

wintry solar
prisma loom
unkempt bronze
#

Does anyone know how sell_cost is set?

#

wait, I think I found it... self.sell_cost = math.max(1, math.floor(self.cost / 2)) + (self.ability.extra_value or 0) from Astronomer joker

prisma loom
wintry solar
#

Oh it’s just not doing the hologram sprite properly I see what you mean

native bone
#

I dont know why this Joker isnt doing any of it's effects. It is supposed to do a version of the Blue, Purple ,Gold, Green ,and Azure Seals randomly whenever a card with a Red Seal is triggered.

daring fern
near coral
#

What's the tool people use to test specific things

#

Like giving themselves specific jokers or going to specific blinds for testing purposes

native bone
#
Modded Balatro Wiki

DebugPlus is a mod by WilsontheWolf which both reenables Balatro's built-in debug mode and adds several additional debug features. It only requires Lovely, but will take advantage of some Steamodded features if present.

near coral
#

I found debugplus by wilsonthewolf and debugplusplus by jogla

native bone
native bone
wind steppe
near coral
#

Ok

wind steppe
#

i've heard good things about debugplusplus but it needs debugplus anyways afaik

#

and also it's not really necessary

near coral
#

Also how do I connect blind code to visual assets

wind steppe
#

is this about Cryptid's The Clock

near coral
#

No I mean how do I connect a blind's design to its code

wind steppe
#

what are you trying to do

near coral
#

Add a test blind (first time)

wind steppe
#

you're just trying to make a blind?

near coral
#

Yes

#

So I can study it

#

For more blinds

wind steppe
#

copy something from vanillaremade

#

and change it to suit your needs

near coral
#

How do I grab the code exactly

#

Is it accessible from github

wind steppe
#

you're looking for src/blinds.lua

weary grail
#

does anyone know any resources for learning how to mod

wind steppe
weary grail
#

ok thanks

near coral
#

I copied the code of the goad is this good for a blind that'll debuff lower ranks

daring fern
near coral
daring fern
near coral
#

I replace "debuff" with that?

ocean sinew
#

orange cat what do yall think?

daring fern
near coral
ocean sinew
daring fern
near coral
#

o

#
SMODS.Blind {
    key = "Test",
    dollars = 5,
    mult = 2,
    calculate = function(self, blind, context)
    if context.debuff_card and (context.debuff_card:get_id() >= 2 and context.debuff_card:get_id() <= 5) then
        return {debuff = true}
    end
end
    pos = { x = 0, y = 13 },
    boss = { min = 1 },
    boss_colour = HEX("FFFFFF")
}```
fluid steppe
#

anyone know where text movement is defined and how i'd make my own?

#

actually this is probably a basegame thing not a smods thing

#

i could look on my own

red flower
fluid steppe
#

yeah

#

like uh

red flower
#

there's a new smods feature for that in the last update lmao

fluid steppe
#

oo ok

#

is it on the wiki yet?

red flower
#

its SMODS.DynaTextEffect but there are no docs yet no

umbral zodiac
#

is there a way to make a sprite w/o a shadow (or draw it without one, if its part of the dissolve shader i dont remember)

red flower
fluid steppe
fluid steppe
#

oh you mean like

umbral zodiac
#

its not a card its just a sprite itself

fluid steppe
#

yeah then love2d draw hopefully should work

umbral zodiac
#

trying to make a censor-like drawstep layer

fluid steppe
#

oh

#

uh

umbral zodiac
red flower
#

do sprites have shadows by default?

sharp arch
#

whi is it green

umbral zodiac
#

they appear to

fluid steppe
umbral zodiac
#

unelss i fucked up somehting when i copy+pasted my halo drawstep code

red flower
umbral zodiac
red flower
#

i do think this is part of the soul sprite code

fluid steppe
#

jabon

red flower
#

but i have soul sprites without shadows

sharp arch
umbral zodiac
#

hold on

fluid steppe
#

it being green shouldnt matter

umbral zodiac
#

im still running from when i didnt have the censor in ignored keys

#

let me see if just adding it fixes it

fluid steppe
#

so dw

sharp arch
fluid steppe
#

ah

umbral zodiac
#

yea no it just has the shadow

red flower
umbral zodiac
#

im ggonna assume the bottom one

#

me when i am wrong

sharp arch
frosty dock
daring fern
sharp arch
frosty dock
#

whoops I didn't even read up far enough to see that

sharp arch
#

also the crytpic crash fixed cuz i cant fucking code

thorn pumice
sharp arch
#

scaling for exponential mult Is emult_mod right?

slim ferry
#

Emult_mod for no message, emult for automatic message and sound

north cove
#

I’m currently using SampleJimbos as a framework for the mod I’m working on. Is there a better framework to use than this?

slim ferry
#

what is samplejimbos

fluid steppe
#

VanillaRemade exists

north cove
slim ferry
#

it has everything from vanilla remade with smods api

north cove
#

Do you guys know how to get Visual Studio to recognize smods and do that thing where it auto fills and lets you know if there’s errors?

#

I forget what that’s called

north cove
#

I see

unkempt bronze
#
    key = 'lhc',
    atlas = "My_Way_and_The_Highway",
    rarity = 3,
    pos = { x = 3, y = 1 },
    cost = 10,
    blueprint_compat = false,
    calculate = function(self, card, context)
    if context.end_of_round then
        local element_cards_held = 0
        for i = 1, #G.consumeables.cards do
          if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
         element_cards_held = element_cards_held + 1
       end
     end
     print(element_cards_held)
    if element_cards_held == 2 then
        local el_sum = 0
        for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
            if xiferp_Element ~= card then
              el_sum = el_sum + xiferp_Element.el_number
              SMODS.destroy_card(xiferp_Element)
            end
        print(el_sum)
        end
         if context.after then
             if el_sum <= 106 then
                 SMODS.add_card { set = 'xiferp_Element', element_no = el_sum }
              end
        end
     end
end
end
}
local card_set_elno_ref = Card.set_elno
function Card:set_elno()
    card_set_elno_ref(self)
    if next(SMODS.find_card("j_xiferp_lhc")) then
        if self.ability.set == 'xiferp_Element' then
        self.el_number = math.max(0, self.element_no)
    end
end
end```
#

Thought I hooked it right

slim ferry
#

you cant hook functions that dont exist yet vro

#

thats just called making a function

unkempt bronze
#

Oh. Well, how do I do I what I'm trying to do? (have the game read the element_no stat of the element cards that have it?)

slim ferry
#

just do that in the joker

#

also you should put additional values in card.ability, otherwise they won't get saved

unkempt bronze
#

of the element cards or the joker?

slim ferry
#

the element cards

#

also the issue isnt even with the function because you arent using it anyway, youre just adding values that dont exist (that being Card.el_number)

native bone
#

Does anyone know the syntax to SMODS.psuedorandom_probability?

unkempt bronze
slim ferry
unkempt bronze
#

I'm setting it just for this

slim ferry
#

and where are you doing that

unkempt bronze
slim ferry
#

if you put values in the center, they will be in card.config.center.<value key>

fluid steppe
slim ferry
unkempt bronze
slim ferry
#

no

#

thats just card.ability.extra.element_no

unkempt bronze
#

Would that work for summing?

slim ferry
#

...yes?

#

its still a number that exists

unkempt bronze
#

good!

unkempt bronze
slim ferry
#

you put whatever card youre checking the number for

chrome widget
#

Hotfixes galore.....

prisma loom
#

Folks, can someone quickly check my code?

#

I feel like I missed some small error

slim ferry
#

edition values are stored in card.edition

#

so card.edition.extra.money_gain (i think?)

prisma loom
slim ferry
#

also what is it meant to do

prisma loom
#

(check the docs!)

#

smh

slim ferry
#

ah ok

#

so its like to the moon but edition?

prisma loom
#

but kinda yeah

slim ferry
#

to the moon is also capped by the interest cap lol

prisma loom
#

I always thought it was just 1$ per 5$ you have

#

with no cap lol

#

mb mb

slim ferry
#

well anyway

#

the context check should be context.end_of_round and context.main_eval or context.playing_card_end_of_round

prisma loom
#

hmmmm

slim ferry
#

because playing cards use different contexts for end of round effects

prisma loom
#

ic ic

wheat rapids
#

How do I make a joker detect if I have another specific Joker

slim ferry
#

next(SMODS.find_card("<joker key>"))

wheat rapids
#

Thanks

unkempt bronze
#

Okay, now the last part: to make a card with element_no = el_sum

#
                 SMODS.add_card { set = 'xiferp_Element', element_no = el_sum}
              end```
setting xiferp_Element.ability.extra.element_no breaks the game.
slim ferry
#

loop over G.P_CENTER_POOLS.xiferp_Element and check each center's config.extra.element_no

#

then create the first one with a matching number

unkempt bronze
#

for _, card in G.P_CENTER_POOLS.xiferp_Element do
[check config.extra.element_no]
if xiferp_Element.ability.extra.element_no = el_sum then
SMODS.create_cards(that matching card)
end

#

like that?

prisma loom
slim ferry
#

also its still SMODS.add_card

unkempt bronze
#

overall, is it right?

slim ferry
#

should work

slim ferry
#

though idk if cardarea check is needed

unkempt bronze
slim ferry
#

?

#

what?

#

where?

unkempt bronze
#

in the code I wrote up

#

for _, card... there and at the end

long sun
#

is there a function similar to is_face for number cards?

unkempt bronze
native bone
slim ferry
long sun
slim ferry
#

and if you dont want aces to count check them seperately

long sun
#

also what about modded ranks?

slim ferry
#

no such thing as a specific function for it

#

cards are face cards or not code wise

long sun
#

unfortunate

slim ferry
#

there arent any other categories

native bone
#

It would be pointless lmao

#

not is_face does the trick just fine

long sun
slim ferry
native bone
slim ferry
#

no thats a spectral card

long sun
#

also yes

unkempt bronze
slim ferry
#

its still SMODS.add_card

#

SMODS.add_card{ key = card.key }

unkempt bronze
#

good. then Imma test it

unkempt bronze
slim ferry
#

??

#

for what? where? why?

unkempt bronze
#

is key the set key?

slim ferry
#

no?

#

then it would be set = card.set

#

not key

wheat rapids
#

What could be the problem here? I'm trying to make it detect a joker then self destroy
Sorry for the quality on the image

unkempt bronze
slim ferry
slim ferry
#

why would you be setting a key

#

its literally just what i typed

unkempt bronze
wheat rapids
slim ferry
#

yes

slim ferry
#

card is the center, the key in there is just the key of the card

unkempt bronze
slim ferry
#

you should probably stop thinking that the game would arbitrarily do something entirely differently

unkempt bronze
red flower
prisma loom
#

hmmm

slim ferry
#

you should be returning dollars = <number>

prisma loom
prisma loom
slim ferry
#

also currently its like scaling the value when you probably just want to calculate the interest directly

prisma loom
#

so its just the interest at the end of the day

slim ferry
#

you can just do return { dollars = math.floor(math.min(G.GAME.dollars, G.GAME.interest_cap)/5))*G.GAME.interest_amount }

unkempt bronze
#
                 for _, card in G.P_CENTER_POOLS.xiferp_Element do
                    if xiferp_Element.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end
              end```
didn't work, nothing got made.
slim ferry
unkempt bronze
#

oh.

prisma loom
slim ferry
#

then just remove the *G.GAME.interest_amount

unkempt bronze
prisma loom
slim ferry
#

like the card that you defined in the for loop mayhaps

unkempt bronze
slim ferry
#

you're already only looping over those cards

unkempt bronze
#

-# and in the race to be stupid, I'm setting all new kinds of pace...

#

Still not creating

#
                    if card.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end```
Nothing's wrong here... I don't think
slim ferry
#

is there actually a card that has the given sum of element numbers

unkempt bronze
#

yeah, it's 53+53=106, both of which have the code for this

native bone
unkempt bronze
native bone
#

It should trigger if a card with a Red Seal is scored, but that does not seem to happen

slim ferry
#

it should be context.other_card:get_seal() == "Red"

slim ferry
unkempt bronze
#
             if el_sum <= 106 then
             print(el_sum)
                 for _, card in G.P_CENTER_POOLS.xiferp_Element do
                    if card.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end
              end
        end```
slim ferry
#

try printing before that check then

native bone
#

I'm at a loss, and I am just going to scrap it

slim ferry
#

the issue is that it should be context.individual

#

not context.main_scoring

native bone
#

Allright, I'll bite

unkempt bronze
#

<= should mean less than or equal to and 106 = 106

slim ferry
#

where is el_sum created

unkempt bronze
#

Just moments and lines prior

native bone
slim ferry
#

could you just show the full code

unkempt bronze
#
    key = 'lhc',
    atlas = "My_Way_and_The_Highway",
    rarity = 3,
    pos = { x = 3, y = 1 },
    cost = 10,
    blueprint_compat = false,
    calculate = function(self, card, context)
    if context.end_of_round then
        local element_cards_held = 0
        for i = 1, #G.consumeables.cards do
          if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
         element_cards_held = element_cards_held + 1
       end
     end
    if element_cards_held == 2 then
        local el_sum = 0
        for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
            if xiferp_Element ~= card then
              el_sum = el_sum + xiferp_Element.ability.extra.element_no
              SMODS.destroy_cards(xiferp_Element)
            end
        end
        print(el_sum)      
        if context.after then
             if el_sum <= 106 then
                 for _, card in G.P_CENTER_POOLS.xiferp_Element do
                    if card.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end
              end
        end
     end
end
end
end
}```
Anything?
slim ferry
#

doesnt appear to have any issues

unkempt bronze
#

It's just not making the card it's supposed to be making

#

Maybe it was SMODS.create_card

slim ferry
#

SMODS.add_card is the same but it does a bunch of stuff automatically

#

also you previously you put a print that showed that the issue is with the <= 106 check

unkempt bronze
#

So what's wrong with that line

slim ferry
#

if i knew i wouldve told you

unkempt bronze
#

Might be the fact the contexts are off.

slim ferry
#

no because if the contexts were off it wouldnt get there

#

or at least not at the correct moment

unkempt bronze
#

Nope, changed it and the game snapped.

slim ferry
#

whats line 291

unkempt bronze
#

well, deleted it

slim ferry
#

also why is your mod id 276327632763

#

lmfao

unkempt bronze
#

it's the for loop

unkempt bronze
slim ferry
unkempt bronze
#

ipairs(G.P_CENTER_POOLS.xiferp_Element) what it's looking for?

slim ferry
#

yes

unkempt bronze
#

ah got it

elder rune
unkempt bronze
slim ferry
#

well i wasnt expecting that to be it tbh

#

also you didnt actually tell me it was crashing so i assumed it just didnt do anything

unkempt bronze
#

the other times it wasn't

#

It might be cuz I had config.extra and not ability.extra

slim ferry
#

you should check if (card.config.extra and card.config.extra.element_no == el_sum) then probably

slim ferry
unkempt bronze
#

we are checking cards, aren't we?

slim ferry
#

the objects in G.P_CENTER_POOLS are prototype objects, not actual cards

#

the things in there are exactly what goes into SMODS.whatever (with prefixes added to the key)

#

+some extra information ig

unkempt bronze
slim ferry
#

why not

unkempt bronze
#

it just says it's not required in lua.

slim ferry
#

well you can remove them then

#

it wont change anything

unkempt bronze
#

testing now

#

no crash, but no creation

#

put it in exactly as it is, it prints 106.

#

no cards get made with element_no 106

weary grail
#

are boss blinds 32x32 or am i tweaking

thorn basin
#

made a joker that makes cards with a certain enhancement give +5 Mult and after scoring set them to another enhancement.
Unfortunately the game gives me error in the if scored_card:has_enhancement and it's says it's a nil value.
how can I fix this?

elder rune
daring fern
thorn basin
elder rune
#

SMODS.has_enhancement(context.other_card,"m_SM_dirt_card")

thorn basin
elder rune
#

Might've been me who wrote it incorrectly idk

#

Oh wait yeah

#

context.other_card doesn't exist 24/7. Should be scored_card for your occasion

wheat rapids
#

How to make a joker detect the poker hand you played?

daring fern
wheat rapids
#

So like context.scoring_name('Five of a kind')

#

Or am i wrong?

daring fern
weary grail
#

does this look enough like a cherry?

frosty rampart
#

not bad, but I think the stem should be more curved and the cherries themselves probably shouldn't be touching
also feels a little off center rn

weary grail
#

ok

#

im cheeks at drawing

elder rune
weary grail
#

yeah

#

ill only get better if i try

elder rune
#

Yup

urban wasp
weary grail
#

ok

thorn basin
weary grail
#

omg ur right

#

the image might be a bit small

#

how do i make that spritesheet with the reflectivity

slim ferry
weary grail
#

thank you

ocean sinew
weary grail
#

ok i finished the art

vernal seal
daring fern
vernal seal
vernal seal
daring fern
vale grove
#

do you guys think its possible to make a joker scale with how loud your game is?

unkempt bronze
#
                 for _, card in ipairs(G.P_CENTER_POOLS.xiferp_Element) do
                    if card.config.extra and card.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end
              end
        end```
What part of this isn't making cards?
unkempt bronze
vale grove
hybrid iris
#

do objecttypes remove repeat items from the pool

lean whale
#

in localisation file, spectrals use c_prefix_key right?

unkempt bronze
#

yeah

unkempt bronze
lean whale
#

i'm getting "Missing required parameter for spectral declaration: key" error,

unkempt bronze
#

did you set the key?

#

did you set it right? (modprefix_key)

lean whale
#

oh ok I see my mistake

#

cool it works now

bold gyro
#

hey y'all, i'm trying to make a custom button for a joker, but it doesn't show up when a controller input is active. where should i look to solve this?

local use_and_sell_buttonsref = G.UIDEF.use_and_sell_buttons -- code based from Lobotomy Corporation's use_and_sell_buttons hook
function G.UIDEF.use_and_sell_buttons(card)
    local t = use_and_sell_buttonsref(card)
    if t and t.nodes[1] and t.nodes[1].nodes[2] and card.config.center.key == 'j_picubed_ambigram' then
        table.insert(t.nodes[1].nodes[2].nodes, 
            {n=G.UIT.C, config={align = "cr"}, nodes={
                {n=G.UIT.C, config={ref_table = card, align = "cr", maxw = 1.25, padding = 0.1, r=0.08, minw = 1.25, minh = 1, hover = true, shadow = true, colour = G.C.UI.BACKGROUND_INACTIVE, one_press = true, button = 'do_ambigram_swap', func = 'ambigram_active'}, nodes={
                    {n=G.UIT.B, config = {w=0.1,h=0.6}},
                    {n=G.UIT.T, config={text = localize('k_picubeds_swap'),colour = G.C.UI.TEXT_LIGHT, scale = 0.55, shadow = true}}
                }}
            }}
        )
    end
    return t
end
jade scarab
#

what's the usual structure for smods projects

red flower
red flower
jade scarab
#

can you quick-reload mods while you test them

red flower
#

no

jade scarab
#

ic

true jasper
wheat rapids
#

How do I make a Joker show a message, like the gross michele saying "Extinct!"

red flower
azure laurel
#

someone knows how to debuff jokers?

wheat rapids
red flower
unkempt bronze
#

@red flower why isn't my code working?

#
                 for _, card in ipairs(G.P_CENTER_POOLS.xiferp_Element) do
                    if card.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end
              end```
everything is defined to where it should be..
red flower
#

please don't tag me for stuff unless it's relevant to me or we are in a conversation already

unkempt bronze
#

sorry.

normal crest
wheat rapids
#

Do you guys think this code is good? Im trying to make it detect that im using five of a kind and it gives Xmult at the end too

unkempt bronze
# normal crest What's your full code
    key = 'lhc',
    atlas = "My_Way_and_The_Highway",
    rarity = 3,
    pos = { x = 3, y = 1 },
    cost = 10,
    blueprint_compat = false,
    calculate = function(self, card, context)
    if context.end_of_round then
        local element_cards_held = 0
        for i = 1, #G.consumeables.cards do
          if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
         element_cards_held = element_cards_held + 1
       end
     end
    if element_cards_held == 2 then
        local el_sum = 0
        for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
            if xiferp_Element ~= card then
              el_sum = el_sum + xiferp_Element.ability.extra.element_no
              SMODS.destroy_cards(xiferp_Element)
            end
        end     
        if el_sum <= 106 then
                 for _, card in ipairs(G.P_CENTER_POOLS.xiferp_Element) do
                    if card.config.extra.element_no == el_sum then
                        SMODS.add_card{ key = card.key }
                    end
              end
        end
     end
end
end
}```
The first two if parts are fine, they work already as I want them to (check for two element cards, adds their numbers, destroys them both)
#

It's making the last part, the element that is the sum, the part I'm stuck on

normal crest
unkempt bronze
#

it's the if card.config.extra.element_no == el_sum then that doesn't

unkempt bronze
normal crest
unkempt bronze
#

Sometimes. Some other times, when I change it around, it breaks the game

normal crest
#

Do you have a crash log

unkempt bronze
#

I have one of a change I made, that made that line if xiferp_Element.config.extra.element_no == el_sum then

#

here's a more usual error

unkempt bronze
normal crest
# unkempt bronze

From this, it's probably because you have consumables that don't have the extra.element_no property

unkempt bronze
normal crest
#

What is line 291 of Jokercode.lua

unkempt bronze
#

in which version?

normal crest
#

The latest crash you sent

unkempt bronze
#

if card.config.extra.element_no == el_sum then

#

Each of the cards I'm using it on have element_no set in config.extra

normal crest
#

is xiperf_Element a consumable type you created

unkempt bronze
#

xiferp, and yes

normal crest
unkempt bronze
#

I'm making a joker that takes two and merges them, for lack of words, into another

unkempt bronze
# normal crest that error is cus one of those consumables you created doesn't have the element_...
SMODS.Consumable {
    key = "hydrogen",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 14, y = 0 },
    unlocked = true,
    discovered = true,
    config = { extra = { element_no = 1 }},  
    can_use = function(self, card)
      return true
    end,    
    loc_txt = {
        name = 'Hydrogen',
                text = {
                    'Destroys one random card and',
                    'adds +5 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_flike_chips = (G.GAME.xiferp_flike_chips or 0) + 5            
        local card_to_destroy = pseudorandom_element(G.hand.cards, 'random_destroy')
        SMODS.destroy_cards(card_to_destroy)
    end      
}```
Here is the exact card i'm using for the testing
#
SMODS.Consumable {
    key = "helium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 15, y = 0 },
    unlocked = true,
    discovered = true,
    config = { extra = { element_no = 2 }},
    can_use = function(self, card)
      return true
    end,    
    loc_txt = {
        name = 'Helium',
                text = {
                    'Adds +5 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_nobelgas_chips = (G.GAME.xiferp_nobelgas_chips or 0) + 5            
    end      
}```
And here is the exact card i'm trying to make
normal crest
#

Was the crash log you sent from a previous version or something

unkempt bronze
#

just a moment please

unkempt bronze
normal crest
#

The error on that code in on line 292

#

what was it when the crash happened

unkempt bronze
#

SMODS.add_card{ key = card.key }

#

Should make the card it found

unkempt bronze
normal crest
unkempt bronze
normal crest
#

just anything besides card, whatever you want

unkempt bronze
#

now it breaks earlier again, all I did was change line 293 and it breaks at line 291

normal crest
#

Well you had to change what was previously card to the new name inside the loop

normal crest
#

wdym what do, I just said it

unkempt bronze
#

change it back to card?

#

The error says "tried to index 'extra'"

normal crest
#
for _, element in ipairs blah blah then
  if element.config.extra.element_no == el_sum then
    SMODS.add_card { key = element.key }
  end
end
unkempt bronze
#

just that? just the key, no mod prefix?

normal crest
#

there was no mod prefix in your original code either, what are you talking about

unkempt bronze
#

there was, xiferp is the prefix

normal crest
#

are you referring to the part I just replaced with "blah blah"? If so, I just didn't want to type what was there

unkempt bronze
#

no, xiferp_Element. modprefix_set.

normal crest
#

No idea what you're talking about, try my code and let me know if it still crashes

unkempt bronze
normal crest
#

I know your code is just that, I just changed the name of the loop variable from card to element because it might be the issue, I'm not sure tho

#

It shouldn't be but who knows at this point

unkempt bronze
#

if it does then I thank you. If not... I'll still thank you.

#

it isn't. line 291 is stated as the issue, STILL

normal crest
#

What is your current code

unkempt bronze
#
    key = 'lhc',
    atlas = "My_Way_and_The_Highway",
    rarity = 3,
    pos = { x = 3, y = 1 },
    cost = 10,
    blueprint_compat = false,
    calculate = function(self, card, context)
    if context.end_of_round then
        local element_cards_held = 0
        for i = 1, #G.consumeables.cards do
          if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
         element_cards_held = element_cards_held + 1
       end
     end
    if element_cards_held == 2 then
        local el_sum = 0
        for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
            if xiferp_Element ~= card then
              el_sum = el_sum + xiferp_Element.ability.extra.element_no
              SMODS.destroy_cards(xiferp_Element)
            end
        end     
        if el_sum <= 106 then
                for _, element in ipairs (G.P_CENTER_POOLS.xiferp_Element) do
                    if element.config.extra.element_no == el_sum then
                       SMODS.add_card { key = element.key }
                  end
                end
        end
     end
end
end
}```
#

end is the same as you had it

#

if element.config.extra.element_no == el_sum then is line 291

#

the eternal issue. Is there anything that does what I'm trying to do but better?

normal crest
#

Can you open the debugplus console and type eval G.P_CENTER_POOLS.xiferp_Element and show what it says

unkempt bronze
#

shows em as they are