#💻・modding-dev

1 messages · Page 602 of 1

red flower
#

for removing use table.remove with the index returned by pseudorandom_element (local value, index = pseudorandom_element(table, seed))

copper perch
#

and where would I wanna do this at, because I have multiple Jokers that destroy playing cards

red flower
#

in the place you showed earlier? if you don't understand the concept of what I said I don't think I can help much

copper perch
#

I mean would I need to make the list for each Joker, or would 1 time in the code for all the jokers work and I can call on the list whenever

red flower
#

you need to make it for each joker unless you don't want any of them to pick the same card in which case what i said doesn't work

copper perch
#

None could hit the same

red flower
#

then you can add a flag when you pick to the cards (i think destroy_cards might already add getting_sliced idk) and make a list of the cards in hand without that flag. then do the part that i said with table.remove for the second destruction

copper perch
#

Sorry about all the questions but how would I go about making a flag? LUA code is new to me so I have little idea what I'm doing honestly...

red flower
#

playing_card.this_is_a_flag = true

#

this will persist until you reload the game but because you're destroying them immediately after it doesn't matter

copper perch
#

got it

wet chasm
#

would you make it where every new instance of a joker says that variable to false then

#

or would it not persist

#

i have no idea how lua works

red flower
#

if you mean at the beginning then no, fields in a table start as nil which is the only other falsy value alongside false so they don't need to be initialized

copper perch
copper perch
#

and I'm assuming i can change 'this_is_a_flag' to anything

red flower
#

yes

#

well, anything the game or other mods don't use

#

so i would recommend adding the mod prefix

wet chasm
#

its good to use snake case notation

#

for clarity

wicked leaf
#

how do you increase hands permanently?

#

G.GAME.Hands?

mystic river
#

check what grabber does

lavish elm
#

card.ability.perma_x_mult = (card.ability.perma_x_mult or 1) * 2
why doesn't this work?

faint yacht
#

I'd understand if this was an enhancement... but if this is triggered from a Joker, context.other_card.ability.perma_x_mult.

lavish elm
faint yacht
#

🤔

lavish elm
daring fern
lavish elm
sudden crest
#

This might be a bit of an arbitrary question, but how difficult would it be to make a mod that only edits numbers and text?

slim ferry
#

would be pretty simple

#

localization files from mods override vanilla localization by default so thats pretty easy

lavish elm
#

how to add an effect that happens after scoring and I mean a permanent effect that happens after scoring

faint yacht
#

Do said effect addition with context.after.

lavish elm
daring fern
long sun
#

what's wrong with my code? i want this consumable to convert all selected cards into the suit of the rightmost, but it's not the rightmost sometimes

#

death does it like this

#

wait no uhm

#

no that should be fine — there's a #G.hand.highlighted in there but it's not causing it

daring fern
long sun
#

ah, thanks ^^

red river
#

is it possible to display multiple images (souls) on a joker?

long sun
#

@daring fern game crashed, complaining about hand_sorted being nil

daring fern
long sun
#

ohhhhhhhhh

#

oh i see ;u; my mistake

queen crescent
#

@maiden phoenix ik you did xBlindSize but is there a way to do hyperBlindSize

lavish elm
daring fern
maiden phoenix
queen crescent
#

okie

lavish elm
floral flicker
#

Hello, i keep carshing when i try applying a seal to a playing card with a spectral card.

floral flicker
# daring fern Code?

SMODS.Consumable{
key = "spec_aegis",
set = "Spectral",
atlas = "v3",
pos = {x = 0, y = 1},
unlocked = true,
discovered = false,
cost = 4,
config = {
extra = { maxselect = 1 }
},
loc_txt = {
name = "Aegis",
text = {
"Gives the selected card",
"the {C:spectral}Silver Seal{}"
}
},
loc_vars = function(self, info_queue, card)
info_queue[#1116390750314307698_queue + 1] = { key = "sl_silver_seal", set = "Other", vars = {} }
return { vars = {
colours = { HEX("bec6d5") },
card.ability.extra.maxselect
}}
end,
can_use = function(self, card)
return #G.hand.highlighted == card.ability.extra.maxselect
end,

use = function(self, card, area, copier)
    for i = 1, #G.hand.highlighted do
        local highlighted = G.hand.highlighted[i]
        play_sound("tarot1")
        highlighted:juice_up(0.3, 0.5)
        highlighted:set_seal("sl_silver_seal")
    end
end

}

daring fern
floral flicker
#

Work perfectly, I was adding the _seal as I needed to add it everywhere else. Thx a lot.

lavish elm
daring fern
flat cypress
#

I want to make a deck that starts you off with every vanilla combination of seal, enhancement, and edition (and then another deck for modded ones too), but I haven’t made a deck before. What does the code to set this up even look like?

#

I have a feeling five nested for loops (rank, suit, enhancement, edition, seal) will be pretty unoptimal

daring fern
slim ferry
#

i imagine it would probably not be great for your pc

#

aikoyori's shenanigans has a challenge that starts you off with 20X the normal cards and it already freezes for a bit when opening the deck preview

red flower
lavish elm
#
JAS.calculate = function (self, context)
    if context.after then
        if not G.GAME.big_num_mult then
            return{}
        else
            return{
                xmult = G.GAME.big_num_mult
            }
        end
        print(G.GAME.big_num_mult)
    end
end

it is not even going through the after context

slim ferry
#

you should use context.final_scoring_step

#

for scoring

#

also make sure the value is actually set

red flower
#

the print is not going to do anything after a return also

lavish elm
#

ok I will try it now

#

it works now thanks

flat cypress
lavish elm
#

how to set the joker slots to infinite?

daring fern
lavish elm
warm gyro
#

I would like to make it so when you redeem the voucher a joker "evolves" into a different one, could someone please help

daring fern
warm gyro
slim ferry
#

SMODS.find card -> list of cards with matching key, used in the pairs loop here
v:set_ability -> turns the current card in the loop into the card with the specified key

warm gyro
#

alright thank you

elder rune
#

How do you check if you have a specific mod on

slim ferry
#

next(SMODS.find_mod("<mod id>"))

#

if you just want to make specific objects not load you can also add a dependencies field to the object

#

which is a table of mod ids

elder rune
#

no I want to make a consumable not load if you have talisman because it crashes otherwise

#

basically anti-crossmod

daring fern
elder rune
#

okay I got it to work

warm gyro
#

How can I add a picture to the little round thing next to my mod in the mod manager?

slim ferry
#

make an atlas with the key modicon

warm gyro
slim ferry
#

32x32

warm gyro
warm gyro
slim ferry
#

you also need a 2x version

warm gyro
#

How can I make a joker not show up in the collection screen?
I did thi sbut it still showed up

daring fern
warm gyro
#

ahh

warm gyro
slim ferry
#

{T:} is only for hover tooltips on deck descriptions

#

for anything else you should use info_queue in the card's loc_vars like so:
info_queue[#info_queue+1] = G.P_CENTERS[<some key>]

#

you can also use G.P_SEALS or G.P_TAGS, or just make it a table to be passed into localize (i think)

warm gyro
#

so in the key section I would put the key of the thing I want to describe in the tooltip?
Or do I need to make a new thing that defines what the tooltip says?

#

My joker I want to be described in the tooltip is called Ye

slim ferry
#

that would work yes

warm gyro
slim ferry
#

is the key of the joker Ye?

warm gyro
#

this is the Ye joker so far

slim ferry
#

is your mod prefix also exactly YZY

warm gyro
#

yes

slim ferry
#

oh nvm wait

#

it has to be j_YZY_Ye

warm gyro
#

ahh

#

thank you so much :)

long sun
#

omg hai sadcube ^^

knotty compass
#

heyaa! what would be a check when card is drawn? im making enchancement that does stuff on being drawn!

long sun
#

ooooooo pleading i don't know but that sounds awesome

#

i was thinking hand_drawn maybe?

#

but that's for all the cards

#

if you need it to be individual that won't work

knotty compass
#

yeeh

#

maybe could loop through drawn cards to check if its the one?

unkempt bronze
#

When I open up my modded pack, I have to use the cards and can't hold them for later.

slim ferry
#

add select_card = <cardarea> to the pack definition

unkempt bronze
#

where?

slim ferry
#

SMODS.Booster

unkempt bronze
#

and what replaces <cardarea>

slim ferry
#

the key of a cardarea as a string

#

probably 'consumeables' for your case

unkempt bronze
#

thank you

languid canopy
#

hello i dont understnad why it happens, can someone help ?
its supposed to create 2 epic jokers and remove 1 joker slot (ping me pls)

daring fern
languid canopy
#

woops thanks

warm gyro
#

How do i check how many times I have a specific card type in my full deck?

#

enhanced card type

red flower
warm gyro
slim ferry
#

use vanillaremade

warm gyro
slim ferry
#

you can but vanilla joker code is wierd because its all in one hardcoded function that handles every joker

#

plus vanillaremade also highlights best practices and such

#

rather than being a complete 1:1 recreation, its remade in a way thats how mods should do it

warm gyro
#

alright thanks

flat cypress
#

how do I actually code it so my starting deck is every combination of vanilla ranks, suits, seals, enhancements, and editions? Because I think I would rather die than hardcode this 11'700 times in Joker Forge

red flower
#

dont use jokerforge?

#

also i would recommend asking jf questions in the jf discord

flat cypress
red flower
#

oh

#

but didnt you already said what you need to do before?

#

thats why im confused

#

just do some nested loops

flat cypress
#

I know it’s some sort of nested for loop, but I don’t know how to set up the variables and stuff. I know the destination and the road but not which exits to take

red flower
#

i would recommend asking step by step then, just saying that makes it seem like you want the whole code made for you

flat cypress
flat cypress
#

are the vanilla enhancements and stuff already in a list or table somewhere with Smods or do I have to define that manually?

long sun
#

hihi :3 i'd like my booster to do something special for the first card it summons, and something different for the second, and something different for the third

#

is there any way to do that?

red flower
red flower
long sun
#

ah great! thanks ^u^

warm gyro
#

whats that prefix thing for enhancements? like the j_ thing

flat cypress
prisma loom
#

Hi, folks! Question: how do I make it so the highlighted part of the code triggers 2nd (after the upper part of code)? Currently its vice-versa:

prisma loom
#

Im not very familiar with code structure rules

flat cypress
frosty rampart
prisma loom
#

kk

prisma loom
#

hmmmmm

wintry solar
prisma loom
frosty rampart
#

oh you need to put the code that creates the destroyed_hands table in the event too, my bad
because you draw the extra card(s) in an event, so they aren't actually drawn until after that event runs (which is after the calculate finishes)

next timber
#

ok i had to go afk before i could get an answer to this last night but. why does no sound play here. this is in the calculate function of an edition and value is not 1 because it's returning xmult that itn't 1

warm gyro
#

think you need play_sound, no?

slim ferry
#

returning a sound works too

frosty rampart
#

no, you can return sounds and it should work like that

slim ferry
warm gyro
#

yea I tried that and for me it didn't work either

frosty rampart
#

yes

wintry solar
#

returning a sound only works on a custom message iirc

prisma loom
#

hmmmmm

wintry solar
#

try using SMODS.draw_cards(number) instead

#

I don't think it will make a difference but it might

prisma loom
#

👌

wintry solar
#

alternatively, put the draw code outside of an event

prisma loom
#

even with the destruction part either in or out of the event as well

#

that too didnt matter

#

how it looks rn:

#

but draw always happens first before destruction for some reason

#

wierd stuff

long sun
#

why are my consumables so sparkly 😭

flat cypress
red flower
long sun
#

for the booster?

red flower
#

yes, in create_card

long sun
#

awesome ^^

#

will try that

#

not working ;u;"

red flower
#

may i see the code

long sun
#

this is one of the functions that creates specific kinds of Hanafuda

#

ah

#

wait no i see

#

;u;

#

wrong position

stoic void
#

silly billy

long sun
#

:3 hehe

#

i also don't get why this isn't working properly

#

i tried it with and without the second line, but no luck

#

it's being called like so

#

the particles are fixed btw :D

daring fern
long sun
#

the wrong cards are being spawned

#

i expected chaff, ribbon_animal, bright in a normal pack, but got all animals

#

hold on actually lemme test this a bit further

#

ah no wait this works ^^; sorry to bother

red flower
long sun
#

what functions -3-?

red flower
#

SMODS.create_card

long sun
#

ah ;u; ya true

warm gyro
#

This is for an enhancement

#

whats wrong with my loc_vars?

red flower
#

loc_vars should be a function

warm gyro
#

oh yea

#

what now?

red flower
#

return { vars = {...} }

warm gyro
#

I want the card ability to trigger when it's played

daring fern
warm gyro
daring fern
warm gyro
slim ferry
#

go my list of calculation keys

#

(generally dont use the ones ending in _mod though)

warm gyro
slim ferry
#

nothing

warm gyro
#

oh

slim ferry
#

its just different names for the same effect for convenience

queen crescent
#

hmmm
how to hyperop blind requirement...

next timber
wind steppe
#

in the return

next timber
#

ok cool

#

now to figureo ut how i make the colour accurate

#

i cant tell if thats the purple colour or the dark_edition colour

#

probably dark_edition because. yeah

wind steppe
#

you dont have to though

next timber
#

i mean i want it to be consistent

gilded oak
#

Hi Doraccoon Team,
I’m a big fan of RACCOIN: Coin Pusher Roguelike. I was wondering if there are any plans to release a mobile version (iOS/Android) in the future. I would love to play it on my phone. Thank you for your time!

slim ferry
#

what

vernal seal
#

hello it's me again coming with a another question or problem:
how can i make it not playing the animation and not sounding like that?

vernal seal
pure salmon
#

how do i get a table containing the keys of every joker in my mod?

glass scaffold
#

Say I want to play a sound whenever a certain amount of Joker slots are taken up out of a specific amount available.

If I have my stuff in components, which one should I put that code in?

sturdy compass
#

you want "Card"

wind steppe
#

they should be using SMODS.destroy_cards no?

vernal seal
sturdy compass
#

That and it's happening during apply so it's not super necessary

daring fern
next timber
#

is there any way to make a msesage sound being returned in a calculate function be louder? im not sure if just adding vol to the return works

next timber
#

awesome thx

daring fern
vernal plank
wild pine
#

what sets the name at the bottom when opening a booster pack?

#

looking through vanillaremade rn for reference and i dont see anything related to it might just be blind

red flower
#

vanillaremade uses group_key and the localization file

rare torrent
#

why doesn't this work to make a booster pack that only has jokers from my mod? ```local mymodjokers = {}
for k, v in pairs(G.P_CENTERS) do
if v.set == "Joker" and v.mod and v.mod.id == "omegatro" then
table.insert(mymodjokers, v.key)
end
end

local omega_pack = SMODS.Booster{
key = "omega_pack",
loc_txt = {
name = "Omega Pack",
text = {
"stuffs"
},
group_name = "oh mah gowd"
},
atlas = "omega_pack",

pools = mymodjokers

}```

solid salmon
#

where do i make pool

#

i wanna make a pool of certain jokers

#

but like which file do i put it in?

slim ferry
#

<@&1133519078540185692>

karmic creek
#

aww shit here we go again

vocal helm
#

i missed what i can only assume to be the scammer but it seems really funny to assume that question is what the mods were called for

#
SMODS.ObjectType({
    key = "j8bit_waterproof_banned_jokers", -- The prefix is not added automatically so it's recommended to add it yourself
    default = "j_splash",
    cards = {
        j_splash = true,
        j_erosion = true,
        j_seltzer = true,
    },
})

anyway you can do it like this

obsidian spear
#

is there anyway to do custom context?

slim ferry
#

you can calculate a context with SMODS.calculate_context

#

that will calculate all cards with the given table as the context table

obsidian spear
#

whar?

solid salmon
#

Like the main one

obsidian spear
#

may you provide an example please

solid salmon
#

The jokers?

slim ferry
#

file never matters except for like localization

solid salmon
#

Jokers it is then

slim ferry
obsidian spear
#

ah alright

slim ferry
#

also usually its best practice to add your mod prefix to your own custom contexts to not potentially interfere with other mods adding a context of the same name

obsidian spear
#

ah algiht

wind steppe
#

why is my game crashing?
i know this code is causing it:

local _colors = G.C

-- create proxy
G.C = {}
local function is_color_table(table)
    if type(table) == "table" then
        for _, v in pairs(table) do
            if type(v) == "table" then return true end
        end
    end
    return false
end
local function replace_green_color(color)
    if type(color) == "table" and next(color) then
        local newcolor = copy_table(color)
        newcolor[1] = 0
        newcolor[2] = (color[1] + color[2] + color[3])/3
        newcolor[3] = 0
        return newcolor
    end
    return color
end
local function replace_green_table(table)
    local newtable = {}
    for k, v in pairs(table) do
        if not is_color_table(v) then
            newtable[k] = replace_green_color(v)
        else
            newtable[k] = replace_green_table(v)
        end
    end
    return newtable
end


-- create metatable
local mt = {
  __index = function (t,k)
    if not PSI.config.green then
        return _colors[k]
    end
    if type(_colors[k]) == "table" then
        if k == "UI" or k == "WHITE" then return _colors[k] end
        if is_color_table(_colors[k]) then return replace_green_table(table) end
        return replace_green_color(_colors[k])
    end
    return _colors[k]
  end,

  __newindex = function (t,k,v)
    _colors[k] = v   -- update original table
  end
}
setmetatable(G.C, mt)
vernal seal
#

hi again, question:
where can i find these lines of code?
is it in the smods folders?

wind steppe
thorn current
#

Hey all! For the steam modded framework what’s the snippet of code to make a joker that adds Xmult like the lucky cat? Can someone post a screenshot or walk me through how to basically have exactly the lucky cats Xmult effect trigger whenever ever say any 3 card is played? Thanks!

I figured out how to do both adding mult and adding chips but can’t figure out how to do scaling of any kind!

frail parcel
#

the example mod does it

frail parcel
#

basically, do something like this (dont copypaste this this is psuedocode)

card scored
{
  if card.rank = 3
  {
    xmultvar +0.75
  }
}
hand played
{
  apply_xmult(xmultvar)
}
hidden notch
#

Is there a good / simple way of looping trough all my added Content?
-# Jokers, Decks, Blinds, Tags, maybe even Sleeves

Ay, I figured it out ^w^

unkempt bronze
#
SMODS.Consumable {
    key = "lithium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 16, y = 0 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 5      
          local alki_card = SMODS.add_card { set = "Base" }
         G.GAME.blind:debuff_card(alki_card)
         G.hand:sort()
         SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
    end,
    loc_txt = {
        name = 'Lithium',
                text = {
                    'Adds +5 chips for the hand',
                    'after this is used, and adds one',
                    'new card to the deck',
                },
            },
}```
Where's the break in this code that causes the game to up and crash without a log?
#

(not upon use, but upon buying from the shop)

#
SMODS.Consumable {
    key = "cerium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 1, y = 7 },
    unlocked = true,
    discovered = true,   
    config = { extra = { yes_is_no = false } },
    keep_on_use = function(self, card)
       return true
    end,
    can_use = function(self, card)   
      if card.ability.extra.yes_is_no == false then
        return true
      end
    end,
    use = function(self, card, area)
       card.ability.extra.yes_is_no = true
    end,   
     loc_txt = {
        name = 'Cerium',
                text = {
                    'Adds +20 mult per odd card for',
                    'the hand after this is used',
                },
            },
    calculate = function(self, card, context)
    if card.ability.extra.yes_is_no == true then
        if context.individual and context.cardarea == G.play then
            if context.other_card:get_id() == 3 or context.other_card:get_id() == 5 or context.other_card:get_id() == 7 or context.other_card:get_id() == 9 or context.other_card:get_id() == 14 then
                   G.GAME.lanthanide_mult = (G.GAME.lanthanide_mult or 0) + 20
                 SMODS.destroy_cards(card, nil, nil, true)
             end
        end
    end
end
}```
And while I'm here, apparently this is an eternal buff.
wind steppe
#

anyone know what colors this menu uses?

unkempt bronze
#

The text?

wind steppe
#

the edges

#

this part

#

(ignoring the background)

unkempt bronze
#

fixed it, forgot to set lanthanide mult to 0 after

unkempt bronze
unkempt thicket
#

<@&1133519078540185692>

unkempt bronze
#

<@&1133519078540185692>

#

Good.

#

Anyway,

#
SMODS.Consumable {
    key = "cerium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 1, y = 7 },
    unlocked = true,
    discovered = true,   
    config = { extra = { yes_is_no = false } },
    keep_on_use = function(self, card)
       return true
    end,
    can_use = function(self, card)   
      if card.ability.extra.yes_is_no == false then
        return true
      end
    end,
    use = function(self, card, area)
       card.ability.extra.yes_is_no = true
    end,   
     loc_txt = {
        name = 'Cerium',
                text = {
                    'Adds +20 mult per odd card for',
                    'the hand after this is used',
                },
            },
    calculate = function(self, card, context)
    if card.ability.extra.yes_is_no == true then
        if context.individual and context.cardarea == G.play and context.other_card:get_id() == 3 or context.other_card:get_id() == 5 or context.other_card:get_id() == 7 or context.other_card:get_id() == 9 or context.other_card:get_id() == 14 then
                   G.GAME.lanthanide_mult = (G.GAME.lanthanide_mult or 0) + 20
                 SMODS.destroy_cards(card, nil, nil, true)
             end
        end
    if context.after then
        G.GAME.lanthanide_mult = 0
    end
end
}```
My fix to my cards seems to break it worse
copper perch
#

Is there a way I can destroy a playing card in a specific position (leftmost, for instance)? Its currently random but think a fixed position would be MUCH easier to code

local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
dense fulcrum
#

chat how do i make the challenge ui work

unkempt bronze
dense fulcrum
unkempt bronze
#

The banned items are easy: restrictions: 'keys of the stuff you don't want'.

#

As for the rules...

dense fulcrum
unkempt bronze
#

...?

dense fulcrum
stone dagger
#

Hello I have 2 jokers:

Uro Bound that has this: yes_pool_flag = "uro_bound_destroyed"
and another that has this:

in_pool = function (self, args)
        return not G.GAME.pool_flags.uro_bound_destroyed
    end

When Uro Bound is destroyed, the uro_bound_destroyed is set to false. However when I disable all other jokers using banner none of the jokers appear in the shop. Any idea why?

unkempt bronze
dense fulcrum
unkempt bronze
#

And any specific boss you wanna ban?

dense fulcrum
#

i have a hook on get_next_boss() that makes every boss blind the same

unkempt bronze
#

Ah.

dense fulcrum
#

is there a prefix for skip tags btw?

unkempt bronze
dense fulcrum
#

thx

unkempt bronze
#

also, c_ for consumables

#

p_ for packs

#

and j_ for jokers, for future reference

dense fulcrum
#

thx

unkempt bronze
#

yw!

dense fulcrum
#

how do i make the rules display in the menu

unkempt bronze
#

That I don't know.

dense fulcrum
#

thx for the help nonetheless

stone dagger
vale grove
#

hey just curios how do you change the base "balatro" image on the menu (like how yahimice made it "balala")

slim ferry
#

Create an atlas with the key balatro, iirc

vale grove
slim ferry
#

You can do it wherever

vale grove
slim ferry
#

Wdym applying the atlas

#

All you gotta do is make an atlas with that key

vale grove
#

well in a joker you use the atlas to apply it to that joker

vale grove
slim ferry
#

Thats an issue with your files then

#

Is the file path in the atlas correct

vale grove
#

considering youre asking that probably not

#

because i just took the atlast i have for jokers and changed it to balatro and balatro.png

slim ferry
#

Do you have a balatro.png in your assets folder

vale grove
#

yes its in 1x rn

copper perch
#
SMODS.Atlas {
    key = "Balatro",
    path = "this_is_my_logo.png",
    px = pixel_x,
    py = pixel_y
}
#

You'd need to get the pixel size for the x and y and fill those in as they are

vale grove
#

okay so i must admit im a little lost

#

with this

#

i dont see why it wouldnt work

copper perch
#

I think you need the 2x as well for it to work fully

#

Thats my guess anyways

vale grove
#

with 2x my game doesnt crash anymore but the background doesnt change either (both in 1x and 2x not one or the other)

copper perch
#

Okay, so are you trying to change the "Balatro" text? I think I may see what to do but this is just a random shot rn

vale grove
#

the colors are for latrer i have college tomorrow XD

copper perch
#

I think then we're looking for a 'splash,' just looking at a mod that uses a custom logo so again, guesswork 😅

slim ferry
#

Im pretty sure vanillremade wiki has it

#

Like the key that the atlas should be

vale grove
#

i didnt expect it to be on there so i didnt bother looking because why would it be

slim ferry
#

Im pretty sure its near the mod icon thing on the wiki so just search for mod icon on the wiki

vale grove
#

theres a wiki for this?

slim ferry
#

Vanillaremade wiki

#

In the top bar on github

#

Theres a wiki

vale grove
#

ohhhh

#

like that

#

sorry im a little tired

vale grove
slim ferry
#

Huho

copper perch
#

I think I have something then

slim ferry
#

Try searching near the mod icon bit

#

Maybe

vale grove
slim ferry
#

Oh

vale grove
#

okay well after a little expirementing

copper perch
#

Try this maybe? I see its called splash in a mod with a custom logo

SMODS.Atlas {
    key = "splash",
    path = "image_here.png",
    px = size,
    py = size,
}
vale grove
#

behold

#

lol

copper perch
vale grove
#

what i did for that result is shamelessy copy it from another mod

#

which uses this

#

which tbh i have no clue in the world why youd use logo

#

like this

copper perch
#

Very good question

vale grove
#

it also doesnt matter i think

#

because removing logo and just making it the balatro.png gives the same result

red flower
vale grove
#

youve helped me out tons

#

wait

#

theres progress

#

its here but in the wrong size lmao

frosty rampart
#

@next timber real quick could you elaborate on how you suggest setting context.blueprint for jokers that retrigger other jokers

next timber
#

astro said that they were retriggering the scaling which implies whatever method of retriggering you're using ignores context.blueprint, which it really should not do

frosty rampart
#

unless i'm stupid, it
doesn't

burnt tide
#

How can i make the thing that Misprint have where you can see the next card in deck ?

next timber
#

hm

frosty rampart
#

y'know what maybe it's just an issue on magolor's end

next timber
#

wtf

frosty rampart
#

yea i'm fuckin stupid i never check for blueprint with magolor

#

although it's still retriggering
hm

vale grove
frosty rampart
# next timber astro said that they were retriggering the scaling which implies whatever method...

ok i switched it to use scale_card and it works
for reference, retrigger doesn't interact with context.blueprint at all. if the joker returns something in the calculate function, it can and will be retriggered. using SMODS.calculate_effect on the card instead of returning a message will disable the joker from being able to be retriggered in that scenario (and scale_card calls calculate_effect)

copper perch
vale grove
#

its related to pos

#

but i dont really see the issue

#

because pos dictates size (apparently)

copper perch
#

Maybe size up the logo? Use 2x for the 1x and double it again for the 2x? Unsure

vale grove
#

you might be onto something

vale grove
#

the issue is that the center is different because iam adding a letter

copper perch
#

Damnnn

vale grove
# copper perch Damnnn

i also figured out it has to do with the friend i asked to make the art making it the wrong size lol

copper perch
#

Ohhh lol

sage crater
#

anyone have examples of collab art mods?

#

specifically, one mod that adds multiple suit changes

burnt tide
#

how can i change this so it verifies if the card is a custom rank ?

red flower
vale grove
#

just dropping this off here, currently i have this as the main menu and iam wondering how to make the image bigger while still having the little needle (orwhatever normally pierces the ace) on the center

#

i know this is probably difficult considering the defealt pos for the image is set but its worth asking maybe someone knows

#

(here is the image iam using btw which iam aware is a little clunky but im not that good at art )

burnt tide
sage crater
#

should look like this

#

now looks like this

jolly shadow
#

why are you overriding them

#

smods has support for adding collabs

sage crater
#

I'm not

#

it's just showing the defaults for some reason

#

not sure why :/

jolly shadow
#

oh, can u show the deckskin code

sage crater
#

sure

local atlas_key = 'ror'                   -- Format: PREFIX_KEY
-- See end of file for notes
local atlas_path = atlas_key .. '_lc.png' -- Filename for the image in the asset folder
-- local atlas_path_hc = 'ror_hc.png'                                          -- Filename for the high-contrast version of the texture, if existing

local suits = { 'hearts', 'clubs', 'diamonds', 'spades' } -- Which suits to replace
local ranks = { 'Jack', 'Queen', "King" }                 -- Which ranks to replace

local description = 'Risk of Rain'                        -- English-language description, also used as default

SMODS.Atlas {
    key = atlas_key .. '_lc',
    px = 71,
    py = 95,
    path = atlas_path,
    prefix_config = {
        key = false
    } -- See end of file for notes
}

if atlas_path_hc then
    SMODS.Atlas {
        key = atlas_key .. '_hc',
        px = 71,
        py = 95,
        path = atlas_path_hc,
        prefix_config = {
            key = false
        } -- See end of file for notes
    }
end

for _, suit in ipairs(suits) do
    SMODS.DeckSkin {
        key = suit .. "_skin",
        suit = suit:gsub("^%l", string.upper),
        ranks = ranks,
        lc_atlas = atlas_key .. '_lc',
        hc_atlas = (atlas_path_hc and atlas_key .. '_hc') or atlas_key .. '_lc',
        loc_txt = {
            ['en-us'] = description
        },
        posStyle = 'deck'
    }
end
#

and atlas

jolly shadow
#

change pos style to ranks maybe? also why the atlas so big just limit it to the 3 cards

#

its nothin but the collabs so 👍

sage crater
#

the mod I'm copying the code off of had an atlas that could hold the entire deck, so I just decided not to mess with it and do what it did

sage crater
jolly shadow
#

yea

sage crater
urban wasp
#

for some reason this logic doesn't require room yet i feel like it should

for i = 1, math.min(card.ability.extra.create, G.consumeables.config.card_limit - #G.consumeables.cards) do
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.4,
        func = function()
            play_sound("timpani")
            SMODS.add_card({ set = "Lenormand" })
            card:juice_up(0.3, 0.5)
            return true 
        end
    }))
end
#

card.ability.extra.create = 1 btw

sage crater
dapper sun
#

does anyone know why juice_up is crashing?

if #hearts >= card.ability.extra.count then
    for k, v in ipairs(context.scoring_hand) do
        v:change_suit("Hearts")
        v:juice_up(0.3,0.4)
    end
    return {
        message = "<3",
        card = self
    }
end```
jolly shadow
sage crater
#

oh, right

sage crater
#

@jolly shadow forgot to ping

dapper sun
jolly shadow
sage crater
#

what 😭

jolly shadow
#

deckskin doesnt add ur mod prefix to the atlas key automatically

#

so itd be modprefix .. atlas_key

sage crater
#

oh

#

ok, it works!
Now how do I tell it to look at the second row for the spades?

dapper sun
#

you make a second atlas for the spades

sage crater
#

aw man

#

I was hoping I could do it in one image file

dapper sun
#

nope

sage crater
#

womp womp I guess lol

azure valley
#

perhaps a basic question, but what is the proper way to "sequence" several events such that they occur one after the other without trying to play over or interfere with each other?

sage crater
jolly shadow
#

or if youre talking abt like, calculate returns, add "extra" table to ur return table

{
  xmult = 2,
  extra = {
    message = "delayed message!"
  }
}
azure valley
jolly shadow
#

show the code

azure valley
#

sure

#
curt_Consumable {
  key = "rev_chariot",
  atlas = "rev_tarot",
  pos = { x = 1, y = 1 },

  calculate = function(self, card, context)
    if context.buying_card and context.card.ability.set == "Voucher" then
      local voucher_key = get_next_voucher_key(true)
      local _card = Card(G.shop_vouchers.T.x + G.shop_vouchers.T.w/2,
        G.shop_vouchers.T.y, G.CARD_W, G.CARD_H, G.P_CARDS.empty,
        G.P_CENTERS[voucher_key],{bypass_discovery_center = true,
        bypass_discovery_ui = true})

      G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
        create_shop_card_ui(_card, 'Voucher', G.shop_vouchers)
        _card:start_materialize()
        G.shop_vouchers:emplace(_card)
        return true end }))
      
      curt_queue_juice_use_dissolve(card)

      G.E_MANAGER:add_event(Event({trigger = 'after', delay = 1.4, func = function()
        if _card.area then _card.area:remove_card(_card) end
        draw_card(G.hand, G.play, 1, 'up', true, _card, nil, true) 
        G.GAME.round_scores.cards_purchased.amt = G.GAME.round_scores.cards_purchased.amt + 1
        _card:redeem()
        return true end }))

        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 1.4, func = function()
          _card:start_dissolve()
        return true end }))
    end
  end
}

and elsewhere:

function curt_queue_juice_use_dissolve(card, from_rev_fool)
  G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.6, func = function()
    card:juice_up(0.6, 0.1)
    card:use_consumeable(G.consumeables)
    SMODS.calculate_context({using_consumeable = true, consumeable = card, area = card.from_area, from_rev_fool = from_rev_fool})
    card:start_dissolve()
    return true end }))
end
#

The intended effect - When purchasing a voucher, another is spawned and immediately purchased

#

This occurs, but the visuals are buggy because the events are not being sequenced properly and so events are starting before the previous one finishes.

#

@jolly shadow ^ the code and so forth as requested. Thanks in advance! I appreciate the assistance.

#

If need be, I can make a minimal example mod for you to test.

jolly shadow
#

not quite sure why its not working as intended
maybe its the buying card context? perhaps should find a different context after the fact to do the visuals and redeeming

sage crater
#

how do you use in_pool() correctly? Does it go in the calculate section of a Joker?

azure valley
#

@sage crater you can check VanillaRemade (specifically Cavendish and Gros Michel) for an example

sage crater
#

ah, true. Forgot that existed. thank you :]

daring fern
urban wasp
# urban wasp for some reason this logic doesn't require room yet i feel like it should ```lua...

bump, here's the full joker code if wanted as well:

SMODS.Joker{
    key = "bonsai",
    name = "Bonsai",
    config = {
        extra = {
            odds = 10,
            create = 1
        }
    },
    pos = { x = 3, y = 0 },
    cost = 8,
    rarity = 3,
    blueprint_compat = true,
    atlas = "joker",
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, "j_chm_bonsai")
        return {
            vars = { 
                numerator,
                denominator,
                card.ability.extra.create
            }
        }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.hand and context.other_card:is_suit("Hearts") and SMODS.pseudorandom_probability(card, "j_chm_bonsai", 1, card.ability.extra.odds) then
            for i = 1, math.min(card.ability.extra.create, G.consumeables.config.card_limit - #G.consumeables.cards) do
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.4,
                    func = function()
                        play_sound("timpani")
                        card:juice_up(0.3, 0.5)
                        SMODS.add_card({ set = "Lenormand" })
                        return true 
                    end
                }))
            end
            return {
                message = "+" .. tostring(card.ability.extra.create) .. " Lenormand",
                colour = G.C.SECONDARY_SET.Lenormand
            }
        end
    end
}
urban wasp
#

did my guy really just bump his message twice in a minute 💔

tight pumice
#

Is there a way to directly reference jokers in your joker roster that are perishable and modify them? Curious about this

unkempt bronze
tight pumice
#

The idea is to have a joker do something to one of your perishable jokers (picked at random) but I'm struggling to find a way to reference currently owned jokers that are perishable or debuffed or both

azure valley
tight pumice
#

Gotcha

azure valley
#

It might be G.jokers.cards, or some other slight variation

tight pumice
#

Any obvious way to check if a joker is perishable? I see SMODS.is_eternal exists but not an equivalent

unkempt bronze
#

I feel like there should something like if context.joker = perishable, but don't take me as gospel.

urban wasp
#

if anything it would probably be something utilizing likeSMODS.find_card()

unkempt bronze
#

And that's why I'm a frequent here

sage crater
#

how do you change vanilla content from being in one category in your collection to another?

I'm trying to make a new category of card modifier called material, and move glass, steel, stone, gold, and lucky into that category (instead of being an enhancement)

unkempt bronze
#

I think you take ownership of it.

sage crater
#

is that going to be using this function?

unkempt bronze
#

I don't know that part, I never took ownership of anything in a mod so far

sage crater
#

ok

#

do you know where I could find it on the wiki? It doesn't seem like it's in the side bar

#

but I have seen it before, I just don't remember in what page

#

ah, found it. It's in API Documentation

tight pumice
#

I see that card.perishable exists, is that something that could be referred to?

#

like G.jokers.cards[i].perishable or something

sage crater
#

yeah

#

as long as it has a value, it can be referred to

sage crater
unkempt bronze
#

You're telling me, some cards I've made just crash the game.

daring fern
daring fern
tight pumice
#

Interesting, but is there a way I can utilize that to iterate through your joker roster and place perishable jokers into a list?

#

card.ability.perishable would just refer to the joker itself in this instance right

daring fern
tight pumice
#

What's k's job in this

daring fern
tight pumice
#

It's necessary to have?

sage crater
# daring fern No, that's for boosters.

how do I go about making a new card modifier?

I assume I'll need

  • new logic for the card to recognize it needs to do stuff
  • a new button in the collection + all the logic that goes along with showcasing the new stuff

anything else/do I have it completely wrong?

sage crater
#

also iirc, k basically is just an integer representing the joker's index

daring fern
sage crater
#

yes. The end goal is to move all the enhancements that change the card into another material into a new modifier tier called "material" and make them usable with other enhancements

daring fern
sage crater
#

time to learn about hooking

urban wasp
azure valley
tight pumice
#

I see

azure valley
#

But ipairs and pairs return both a key and value

tight pumice
#

The joker worked without a hitch surprisingly, I'm almost suspicious

#

I've yet to have one work on the first run

#

It picks a random debuffed or perishable (or both) joker and brings it back to life

#

If it had/has the perishable tag, it removes that tag

#

Made it in honor of all the heartbreaking perishable blueprint/brainstorms I've seen in high stake runs

sage crater
#

is there a way to do something when a card is first created and never again?

frosty rampart
#

set_ability function

sage crater
frosty rampart
#

...
smods/the game handles that automatically
if all you're doing is setting those initial values, you don't need the set_ability function at all

sage crater
#

nah, I'm getting there

#

it's necessary, trust

tight pumice
#

Anyone know a way to return a message but have it return to a different joker than the one being currently called on?

faint yacht
#

message_card = target

vocal helm
#

SMODS.calculate_effect?

#

ah yeah that too

#

return
yeah do Ali's suggestion

frosty rampart
# sage crater it's necessary, trust

then yes the function itself is where it should be
it does also take two more arguments, initial and delay_sprites, but the game won't die if you don't include them

tight pumice
#

I'll have to play around with that

sage crater
#

the coding is scuffed, but the idea is there lol

tight pumice
faint yacht
#

Any card.

#

Joker, Consumable, playing card, etc.

tight pumice
#

and returning a message afterwards would return the message from that location?

#

Basically I'm trying to return a message from a joker, and then return a message from another joker that gets affected by this joker

faint yacht
#
return { message = "the balls", extra = { message = "harden", message_card = G.jokers.cards[1] } }

should make "the balls" appear on the triggering Joker and "harden" on the first Joker held, as example...

tight pumice
#

Worked like a charm, thanks

sage crater
#

getting an error on my for loop. Could someone enlighten me on why?

for _, v in pairs(G.jokers or {}) do
            if v.key == "florble" then
                toGain[1] = v.ability.extra.var1 or 0 -- chips
                toGain[2] = v.ability.extra.var2 or 1 -- xchips
                toGain[3] = v.ability.extra.var3 or 0 -- mult
                toGain[4] = v.ability.extra.var4 or 1 -- xmult
                total = total + 1
            end
        end
faint yacht
#

G.jokers and G.jokers.cards or {}

sage crater
#

ah, ok

sage crater
daring fern
sage crater
#

ah, thanks

#

replacing these parts?

#

bro why does alt+f5 not work sometimes

#

and pressing R after getting an error

#

it just decides to break and I have to go the slow way around and hit play in steam again

red flower
#

i just added the exe to my task bar

sage crater
#

I'm sure I could find a workaround, but I'm on a steam deck, so I need to run exe programs through steam's proton

red flower
#

sad

sage crater
daring fern
sage crater
#

ah, so it should be a string

#

it was complaining that I put in a string instead of an integer and I was confused by that

sage crater
daring fern
sage crater
#

oh

#

it should be less than 6 months 😭

#

I was working on this in april

hardy viper
#

only 6 months old am i right

sage crater
#

it appears I've made a fork bomb in my balatro

#
when time to score:
  make a new copy of yourself
  score as intended
``` seems to also run this on the copied version before it has existed for a round...
#

first question: how do I stop this?
second question: how do I limit the cards created per hand scored to 1?

#

I'm imagining I'll need to set a global var or something, but idk how I'd do that in lua

sage crater
daring fern
# sage crater

No, move everything into the if context.joker_main check, also put the copying of the joker in an event.

daring fern
sage crater
#

ok

#

ok, so...
it no longer crashes...

#

which I guess is good

#

if not for the fact that now my memory is being inhaled

daring fern
sage crater
#

ah

#

ok, it works

#

now I need to reduce the total jokers created per hand to 1

chrome widget
#

Finalized version of my reworked achievement menu

granite jay
#

Anyone know how to get the amount of chips each card’s rank grants?

#

I want to make a joker that adds the chips of each card held in hand.

urban wasp
#

what's the context for on score effects on enhancements?

daring fern
granite jay
#

Thx

daring fern
urban wasp
#

so if i did like (pseudocode) if context.main_scoring then return 3 xmult it would give 3 xmult every time it scores?

#

or do i need an additional context or something

daring fern
urban wasp
#

ah okay thank you

sage crater
#

getting the error attempt to compare number with table

sage crater
true jasper
sage crater
#

ah

sage crater
#

like do I just need to add it to the dependencies, or is there something I need to add to my lua file/s

true jasper
sage crater
#

oh boy

#

is that true for every number?

umbral zodiac
#

only if theyre going to be bignums

umbral zodiac
# sage crater

also this crash is in a base balatro file, are you doing any patches there, or setting any variables used outside of the joker?

sage crater
#

nope

#

this is my full file. It's all just SMODS.Joker stuff

umbral zodiac
#

you probably want to use add_to_deck rather than set_ability unless you have a reason im unaware of

sage crater
#

ah ok

umbral zodiac
#

no clue if that's causing the issue but

#

best to use the function youre meant to use even if set_ability works

sage crater
#

could it possibly be that my talisman version is out of date and I need to get the newst version?

sage crater
#

ah yep, that fixed it lol

sage crater
#

is pseudorandom always integers?

#

is there a way to make it floats?

granite jay
#

How do you get the level, chips and mult of a certain poker hand?

daring fern
sage crater
#

ah, cool

daring fern
granite jay
#

Thx

floral flicker
#

hello i try to destory card, but it dosen't work, may someone help me with it ? It should destroy the card at the if context.destroy_card but it dosen't destroy anything ?
Also, how can i localize the message on only one playing card ?

    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if SMODS.pseudorandom_probability(card, 'sl_trooper', 1, card.ability.extra.odds) then
                if context.destroy_card and context.cardarea == G.play and context.destroying_card == card then
                    return{
                        chips = card.ability.extra.chips
                        delay = 0.2
                        SMODS.calculate_effect({message = localize('sl_kia'), colour = G.C.MULT}, card)
                        remove = true
                    }
                end
            else
                return{
                    chips = card.ability.extra.chips
                    SMODS.calculate_effect({message = localize('sl_nkia'), colour = G.C.GREEN}, card)
                }
            end
        end
    end
daring fern
serene granite
#

can someone help meee im trying to make a joker that turns hearts into spades but its not working out, any advice?

#

ahhhhhh

daring fern
serene granite
#

omg thank u , ill try this now

obsidian spear
#

may anyone show an example of how i could use G.UIT.O in a sense to create a button during the main part of the game

#

with sprites and such

burnt tide
#

How can i do that a custom rarity shows only if i use a custom deck ?

daring fern
burnt tide
#

in the deck code or the rarity code ?

daring fern
burnt tide
#

and how can i make all jokers (excepts these ones) never spawn with this deck ?

#

in SMODS.Back ?

languid canopy
#

what's the effect called that made the soul do its little boucy thingy ?

burnt tide
#

and what does it do ?

daring fern
burnt tide
#

SMODS.Back ?

daring fern
obsidian spear
#

how do i make the blinds harder like how plasma deck does, do i need patching

obsidian spear
#

nah for the entire mod

#

i make the chips stay over from the previous blind, so i need to really ramp up the difficulty

daring fern
obsidian spear
#

should i place this in reset_game_globals

burnt tide
daring fern
burnt tide
#

so i can add more ?

daring fern
fossil ermine
#

hm, after testing the joker becoming extinct from copying gros michel/ cavendish is a problem and singing machine destroying another copy of singing machine is a problem

burnt tide
slim ferry
#

that has to be in an actual function

slim ferry
burnt tide
slim ferry
#

well idk what kinda object this is

#

or what youre trying to do

#

but you cant just drop random code in the table

fossil ermine
slim ferry
#

i see

#

well if its not blueprinting then the gros michel/cavendish would probably just get destroyed in whatever invisible cardarea theyre in

#

assuming thats how youre doing it

fossil ermine
#

the joker itself has the abilities

#

it extincts itself and is in a state of dead and alive

#

somehow

#

singing machine is the line joker

#

you cannot select it, but its abilities still works

#

and it counts for a joker slot

burnt tide
slim ferry
#

actually

#

wait no hold on

fossil ermine
# fossil ermine singing machine completely steals all abilities from jokers basically
    calculate = function(self, card, context)
        if context.setting_blind and G.GAME.blind.boss and not context.blueprint then
            local jokers = {}
            for _, j in pairs(G.jokers.cards) do
                if j ~= card then
                    if SMODS.pseudorandom_probability(card, 'group_0_e2e11086', 1, card.ability.extra.odds, 'j_fox_singing') then
                        table.insert(card.ability.extra.currentJoker, j.config.center.key)
                        SMODS.destroy_cards(j)
                    end
                end
            end
        end
        if card.ability.extra.currentJoker then
            local mergetable = {}
            for i, j in ipairs(card.ability.extra.currentJoker) do
                local key = j
                G.fox_savedjokercards = G.fox_savedjokercards or {}
                G.fox_savedjokercards[card.sort_id] = G.fox_savedjokercards[card.sort_id] or {}
                if not G.fox_savedjokercards[card.sort_id][key] then
                    local old_ability = copy_table(card.ability)
                    local old_center = card.config.center
                    local old_center_key = card.config.center_key
                    card:set_ability(key, nil, 'quantum')
                    card:update(0.016)
                    G.fox_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
                    G.fox_savedjokercards[card.sort_id][key].ability = copy_table(G.fox_savedjokercards[card.sort_id][key].ability)
                    for k, v in ipairs({"T", "VT", "CT"}) do
                        G.fox_savedjokercards[card.sort_id][key][v] = copy_table(G.fox_savedjokercards[card.sort_id][key][v])
                    end
                    G.fox_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G.fox_savedjokercards[card.sort_id][key].config)
                    card.ability = old_ability
                    card.config.center = old_center
                    card.config.center_key = old_center_key
                end
                local effect = G.fox_savedjokercards[card.sort_id][key]:calculate_joker(context)
                if effect then
                    table.insert(mergetable, effect)
                end
            end
            return SMODS.merge_effects(mergetable)
        end
    end
burnt tide
#

can i have 2 apply ?

slim ferry
#

no

#

why would you need 2 though

fossil ermine
daring fern
fossil ermine
burnt tide
slim ferry
#

just... add more code after that?

daring fern
# fossil ermine <:whuh:1407690766465106001>
for i, v in ipairs({'juice_up', 'start_dissolve', 'remove', 'flip'}) do
    G.modprefix_savedjokercards[card.sort_id][key][v] = function(_, ...)
        return card[v](card, ...)
    end
end
slim ferry
#

also why are you checking ranks like that

#

just do v:get_id()

burnt tide
slim ferry
#

also v.base.value is already the rank key so theres no point in looking into SMODS.Ranks

fossil ermine
slim ferry
#

what mod are you looking at

daring fern
fossil ermine
#

what does it do then

burnt tide
daring fern
slim ferry
slim ferry
slim ferry
#

which is

burnt tide
#

at least i didn't understand

slim ferry
#

what were you looking for

burnt tide
slim ferry
#

well then

#

look at anything that checks for rank

fossil ermine
slim ferry
#

you just wont find anything in vanilla decks because they have pre-made starting decks that are enabled with a modifier

burnt tide
#

but what i have works so for me it's good, that's not what i want now

slim ferry
#

well anyway

#

just add this to the apply ```lua
for _, rarity in pairs(SMODS.Rarities) do
if rarity ~= "<rarity key>" then
G.GAME[rarity:lower().."_mod"] = 0
end
end

#

i think

daring fern
slim ferry
#

wdym whats in that

#

you can just leave it if thats what youre asking

#

it comes from this

slim ferry
#

uhhhh

#
for _, rarity in pairs(SMODS.Rarities) do
    if rarity.key ~= "<rarity key>" then
        G.GAME[rarity.key:lower().."_mod"] = 0
    end
end
```try this
burnt tide
daring fern
burnt tide
#

ooh okay

burnt tide
#

what are the keys for the vanilla rarities ?

daring fern
fossil ermine
daring fern
burnt tide
#

how can i change weight of a rarity ? (like Common for example) is it like this : G.GAME.Common = 0 ?

fossil ermine
#

<@&1133519078540185692>

daring fern
fossil ermine
#

kay :3

#

wait why ~=

#

its if it does equal

#

cuz if it doesnt then it copies

daring fern
fossil ermine
#

but if it does then it doesnt copy

vast tusk
#

hello people! i have been preping myself to make a balatro mod but before i start strugling coding with my own ideas i just wanted to make a test to learn what the very basics are. for this i mostly copied a tutorial, yet the joker doesn't load in... any clue what i did wrong? (this is my first time ever truely coding so it may be something stupid)

fossil ermine
#

so like

              if j ~= card then
                    if j.config.center.key ~= self.key then
                        SMODS.destroy_cards(j)
                    else if SMODS.pseudorandom_probability(card, 'group_0_e2e11086', 1, card.ability.extra.odds, 'j_fox_singing') then
                        table.insert(card.ability.extra.currentJoker, j.config.center.key)
                        SMODS.destroy_cards(j)
daring fern
vast tusk
#

new issue... this apparently crashes the game?

daring fern
vast tusk
#

oh, missed that. thx for spotting it!

vast tusk
#

next question. is there a context state for rerolling the shop?

winter flower
#

if context.reroll_shop then

vast tusk
#

THX!

vale grove
#

how do i check the suit of a flush?

daring fern
vale grove
#

thank you

vale grove
#

okay so i have a joker that works simlar to bootstrap and chips but with Xmult

#

but when you dont have the required money amount it gives x0 mult instead of x1

#

any idea how to fix this?

#

<@&1133519078540185692>

#

👍

gilded goblet
#

when card.ability.extra.Xmult is 1 and the player has zero monies, 1 * 1 = 1

#

math.max(1, ...) constricts the following value to be at least 1

sage crater
#

So I’m trying to make a joker create a copy of itself, but the current version exponentially increases (1 -> 2 -> 4 -> etc) and I’m trying to limit it to create only one copy regardless of how many of the jokers you have.

I know in Java, you’d probably use a static variable or something, but how would one go about doing that in lua?

red flower
#

G.GAME.modprefix_jokername_copy_made_this_round = true?

sage crater
#

And then would I set it to false at the beginning of the next round or something?

vale grove
#

i have a joker that removes a card, however at the end of the round i get this

#

and when i draw that card i deleted it just leaves a hole in my hand

#

like that

wind steppe
#

you aren’t deleting them in an event

vale grove
tepid crow
daring fern
tepid crow
#

that context also works if the timing is right for you ^

vale grove
vale grove
daring fern
tepid crow
#

^ that hopefully works

vale grove
#

the last ban appeal standing

vale grove
wooden nexus
#

How’s mod chat

#

Been busy with other games but i’m still gonna mod balatro

primal robin
#

hotpot is talisman compatible

#

Well, mostly

wooden nexus
#

Oh

cunning valley
#

Hello! having a bit of trouble with a poker hand im doing. I'm trying to make a hand type out of an ace and two 5s (A55) but selecting the last card required for the hand crashes the game. I believe the crash comes from the evaluate function but I barely know how to do much stuff in this engine

daring fern
cunning valley
daring fern
cunning valley
#

Sweet! thank you, I'll try that out

#

is this a syntax error or is card.get_id() a genuine thing used for other things?

daring fern
#

The function needs to know what card you're trying to get the id of.

cunning valley
#

Oh that makes sense

#

Good news! The game doesn't crash!

Bad news... When selecting an Ace and two 5s it counts it as a Pair

sage crater
#

how do you check your current amount of jokers against the max amount of jokers?

#

this is what I currently have, but I'm sure this isn't going to work lol

#

ok yeah, it's not working

sage crater
#

thank ya kindly

#

ok, it kinda works?

when I have four of this joker at 4/5, each individual one does the effect when I was hoping only one would

#

but the good news is, when it's 8/5 none of them do, so the check is going through correctly

#

is there a way to limit how many events can happen or something?

#

actually, I may have a way to fix it

#

fixed it

#

woohoo

cunning valley
sage crater
#

indeed

#

I've run into an issue where only the first of my jokers will proc, and all copies have the exact same stats (when they should have slightly different stats)

split acorn
#

Hello everyone, total newbie here. For my mod, I'd like to add a deck that modifies the appearance of the cards (e.g. the "abandoned deck"). Any tips on how to do this?

slim ferry
#

like changing the starting deck? or do you mean like the collab face card skins

sage crater
split acorn
slim ferry
#

does it>

#

?

#

like the back of the cards yeah

#

but thats just the sprite of the deck

split acorn
#

oh is it only the back? oof my bad

slim ferry
elder rune
#

do yall think this is balanced

slim ferry
#

maybe

elder rune
sage crater
#

that's a direct upgrade, as long as you have no card modifiers

elder rune
#

but it shuts down a bunch of jokers functionalities

sage crater
#

also personally, I'd capitalize Debuff since it's the first word in the sentence, and also it's important

sage crater
split acorn
solid salmon
#

is there a context for when a probability triggers?

red flower
solid salmon
#

thanka you

bleak shore
#

hello everyone sorry to bother you but i need help with the "delay()" thing , i want to flip a card after delaying it but it flip before and do the delay afterward , any advice ?

viscid talon
#

im trying to make a blueprint-esque joker that copies the effect of a random joker. idk how to use lua so i got smth like this. would this work?

#

im guessing "local" refers to it effecting this specific lua file only and non local being a global variable that affects everyone

viscid talon
#

idk what that means im dumb

daring fern
viscid talon
#

oh hm

#

the goal i have rn is to have smth like:

when blind selected, copy a random joker

#

and have that number change constantly

dapper sun
viscid talon
#

i was thinking of having a variable that changes depending on the joker element

#

unsure how id code that in though LOL

daring fern
dapper sun
#

ah

gilded goblet
#

yea

#

card = card

dapper sun
#

i thought it was a problem with the juice_up since that's what was in the error 😭

gilded goblet
#

i think focus = card also works

#

dunno the difference

slim ferry
viscid talon
#

ok did some fooling around on jokerforge and i made something that semi works?

#

there's a variable called random which changes per round

#

it is able to target a random joker's index value

bleak shore
slim ferry
#

ideally for copying a random joker you would save a specific sort id

#

so you dont just. move the joker

viscid talon
#

rn it looks like smth like this

#

oh true

#

G.jokers.cards[random] isn't returning with anything

#

so as a result it copies nothing (im guessing it returns with nil)

slim ferry
viscid talon
#

okei

#

in the meantime im gonna look over the code

#

ok it looks like i migbht have to set target joker to mathrandom or something

#

smth like this?

#

i changed the variable name to amogus to make it easier for me to point out

#

im slowly understanding how the general code of jokers is laid out

slim ferry
#
calculate = function(self, card, context)
    if (context.selling_card and context.card.sort_id == card.ability.extra.target or context.setting_blind) and not context.blueprint then
        local compatible = {}
        for _, c in ipairs(G.jokers.cards) do
            if c.config.center.blueprint_compat then
                compatible[#compatible+1] = c
            end
        end
        local new_target = pseudorandom_element(compatible, "seed")
        if new_target then card.ability.extra.target = c.sort_id end
    end
    for _, c in ipairs(G.jokers.cards) do
        if c.sort_id == card.ability.extra.target then
            return SMODS.blueprint_effect(c, context)
        end
    end
end
```this should work i think
viscid talon
#

ooh, ill give that a shot

slim ferry
#

actually wait i can make that shorter hold on

viscid talon
#

im guessing i have to create a seed = 0

#

brb dinner time

plucky berry
#

guys i'm tryna dig from ortalab's code how they implemented a new shop slot reserved for their mythos cards to make my own custom shop slot but i didn't find anything, any of you know how to do that

elder rune
#

how would one change the color of these

#

(dont mind the operator between them)

plucky berry
#

i'm minding the operator wtf is ||

elder rune
#

concatenation

slim ferry
#

isnt concatention .. in lua...

frosty rampart
#

yea it should be .. :3

slim ferry
#

where is it ||

elder rune
plucky berry
#

kinda broken operator imo

#

sounds fun

elder rune
#

okay what about my question

elder rune
native bone
#

So are you just concatenating the chips and mult together or what?

elder rune
#

ye

native bone
#

Oh shit

#

That cannot end well

#

Imagine retriggering that Joker a billion times

granite jay
#

How do you check if two cards have the same suit?

elder rune
#

its literally the calculating function

native bone
#

1 Hanging Chad if it is a card enhancement

slim ferry
#

its a scoring calculation

elder rune
#

it replaces the X between chips and mult

granite jay
vernal seal
#

hello it's me again back with a another problem to solve:
why does it show "ERROR" in the booster pack message?

elder rune
granite jay
elder rune
#

and before the : you set the card youre debuffing

granite jay
#

ah thx

elder rune
#

e.g context.other_card:set_debuff(true)

granite jay
elder rune
#

do you know how to access the suits?

granite jay
#

Yes

#

Hold on lemme get the code i have rn

slim ferry
granite jay
#

Oh thx

granite jay
elder rune
elder rune
#

.base basically access a bunch of info about the playing cards like the suit or rank

burnt tide
vernal seal
burnt tide
#

no sorry

vernal seal
# burnt tide no sorry

goddam, i should make that joker forge creates a localization folder with the "default" localization file then

bleak shore
#

Hello, I'm having a problem my code

It's supposed to destroy the heart cards I discard, so that's fine, but as soon as it encounters a heart card, it destroys all the cards that follow, even if they're not hearts, and I don't understand where that comes from.

viscid talon
#

fniished dinner

#

ill test rn

slim ferry
elder rune
#

localize("k_upgrade_ex")

slim ferry
#

true

elder rune
viscid talon
slim ferry
#

yeah

#

closing brackety