#💻・modding-dev

1 messages · Page 665 of 1

astral pine
#

I tried this but I get the same error, I also tried doing an if with my G.sprite to not render it if null and then the problem becomes the {x=x, y=y}, sorry, code that is in my main.lua right now

local oldmainmenu = Game.main_menu
function Game:main_menu(change_context)
    local gm = oldmainmenu(self, change_context)
    G.collector_sprite = SMODS.create_sprite(0, 0, G.CARD_W, G.CARD_H, 'lilithsb_CollectorCard', {x = x, y = y})
    return gm
end

SMODS.DrawStep{
    key = 'collector_extra',
    order = -9,
    func = function(self)
        G.collector_sprite.role.draw_major = self
        G.collector_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center)
    end,
    conditions = {vortex = false, facing = 'front'},
}
random thorn
#

How do I fix it?

#

nods

astral pine
# random thorn How do I fix it?

You can just move the highlighted line (card.ability.extra.var1 = math.max(0, (crad.ability.extra.var1) - 1)) above the return { e_mult = 1 }

sturdy compass
random thorn
#

Okay, that fixxed it, presumably. we have another one though.

#

I assume it'll be a similar error

random thorn
astral pine
#

Oh yup exacty same error

#

It's at the end of the file

random thorn
#

yeah exact same

#

This is the next error

astral pine
sturdy compass
#

Once again stuff happening after the return

#

Actually why is there even a return in the first place

#

what the hell is JF doing here with the code generation

#

This is why we do not like it here lmfao

random thorn
#

I dont see the situation

astral pine
#

Also checking for nil values fixed it, thank you for the help

sturdy compass
#

👌

random thorn
sturdy compass
#

Have fun with your funny goofy sprites

red flower
#

jokerforge seems to be absolutely broken i see

sturdy compass
#

yep

random thorn
#

Yeah, it feels really weird

sturdy compass
#

It likes putting stuff under returns for some reason

tidal hemlock
sturdy compass
red flower
#

also it's not using SMODS.is_poker_hand_visible

sturdy compass
#

😭

red flower
#

and there's a random __PRE something something at the bottom

sturdy compass
#

Yeah I saw that and was SO confused by it

rapid stag
#

is there a way to make a joker only show up in the shop if you have any specific jokers? kinda like stone, steel and glass joker, but for jokers instead of cards

sturdy compass
random thorn
#

I'll be honest, coding is not my area of expertise, but its kinda amusing to see people who do know it mocking bad code. Its like listening to a language expert roast someones bad attempt at using that language, but you know NOTHING about that language.

sturdy compass
#

for example

sturdy compass
random thorn
red flower
#

this one is hard because there are a bunch of wrong things
i would report it to the joker forge server to fix it

sturdy compass
#

Agreed

#

Looking at this feels like wading through a thicket

random thorn
#

nobody is saying anything in the help channel even tho i asked for help, and I wanna test the mod

#

Its supposed to be similar to black hole, but jokerforge didnt have an "all hands option, lemmie see if i can just like ... copy black holes code?

wanton jolt
#

We are joker forge we carry the bugs

#

we'll fight for the bad code

#

we'll honor the crashes

rapid stag
sturdy compass
random thorn
#

I mean, if your willing to teach im willing to try learning, to a degree.

#

Are you willing to vc? Its okay if not, I just like being able to hear people speak

#

auditory learner

sturdy compass
#

I'm the same way though I am not currently able to, so apologies for that. You may pester me in DMs about it though, the more people who are willing to take the dive the healthier the community is

rapid stag
#

sanity check, G.jokers is an indexed array, right?

#

i forget the term, but ipairs() not pairs()

daring fern
rapid stag
#

that's was i was forgetting

gaunt folio
#

im trying to make something retrigger an amount of times if its under a certain pool but this doesnt work. any help?

#

i do have the optional parameters enabled btw

daring fern
reef bobcat
#

trying to tackle a pretty complex effect, doing a card that doubles up on seal effects

#

how would i go about this?

gaunt folio
red flower
gaunt folio
#

ah

grizzled tide
#

how do i go about setting the sell value of a joker

red flower
#

hook Card:set_cost and set self.sell_value

grizzled tide
#

o, gotcha

noble ore
#

how can i increase the amount of booster packs the shop can have?

daring fern
daring fern
noble ore
#

yk how come i dont know all of the smods functions .......

#

thanks btw lol

reef bobcat
red flower
noble ore
#

mfw i didnt read the documentation 😭

gaunt folio
#

ok it works but it does retrigger itself, which ill have to figure out

#

im trying to make it not repeat if its the main joker, it should retrigger other jokers but not itself

#

if its even possible

noble ore
#

whats a way to remove a joker from the game entirely? lets say i want to remove jimbo, how can i do that?

crimson marlin
thorn ingot
#

Thanks for answering. balatroheart

I actually managed to do what I wanted a couple of hours ago by making this .lua file load based on the config. Kind of scuffed, but it does what I needed.

What you mention of it being unreliable is important though, will get back to this soon.

near coral
#

So for context a consumable in bizarrtro transforms a vanilla joker into their bizarro version and vice versa, and the bizarro version of wee joker is jumbo rekoj
The original issue was that jumbo rekoj was the wrong size when the consumable was used on it, it has been fixed but now jumbo rekoj is the wrong size normally and the correct size when a transformed wee joker

bright ivy
#
-- RERUN
SMODS.Joker {
    key = "rerun",

    in_pool = function(self, args)
        return true 
    end,

    blueprint_compat = true,
    rarity = 3,
    cost = 10,
    
    loc_txt = {
        name = "Rerun Joker",
        text = {
            "On {C:green}Reroll{}",
            "creates a random {C:attention}Joker{} card",
            "{C:inactive}[Must have room]{}"
        }
    },


    atlas = "rerun_atlas",
    pos = { x = 0, y = 0 },
    discovered = true,

    config = { extra = { creates = 1 } }, -- we only generate 1
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.creates } }
    end,
    calculate = function(self, card, context)
        if context.reroll_shop and #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
            local jokers_to_create = 1 -- only generate one

            G.GAME.joker_buffer = G.GAME.joker_buffer + jokers_to_create
            G.E_MANAGER:add_event(Event({
                func = function()
                    for _ = 1, jokers_to_create do
                        local joker_rarity = SMODS.poll_rarity("Joker")
                        
                        SMODS.add_card {
                            set = 'Joker',
                            rarity = joker_rarity,
                            key_append = 'rerun'
                        }

                        G.GAME.joker_buffer = 0
                    end
                    return true
                end
            }))

            return {
                message = localize('k_plus_joker'),
                colour = G.C.BLUE,
            }
        end
    end,
}

The local joker_rarity = SMODS.poll_rarity("Joker") only gives me rare jokers when I want it to be just a random joker using the games regular probabilities. How do I do this correctly?

gilded blaze
#

yikes, take_ownership_by_kindis easier to use, but in order to hook during take_ownership it has to be done for each individual booster pack 😭

daring fern
daring fern
noble ore
#

thank you thooo

near coral
#

I don't know how the coding process works

noble ore
#

do i use the same method?

gilded blaze
#

just hook SMODS.add_to_pool

#

no need to take ownership of an object's in_pool

daring fern
daring fern
gilded blaze
#

welp, time to whip out my utimate weapon

#

this allows completely removing an object at runtime

#

albeit not recommended

thorn ingot
bright ivy
noble ore
#

you can give it a seed as well

bright ivy
bright ivy
daring fern
thorn ingot
#

yeah, that's what I was going to type

bright ivy
#

How would I do it then?

thorn ingot
daring fern
bright ivy
#

thanl you

thorn ingot
#

here is a card I made that has some of the effects you want. It works even if I take off the rarity in the first one

tacit peak
#

can someone help me with my first mod im trying to make a basic jimbo joker

#

whenever i try to load it this message appears

sturdy compass
#

Two issues I see:

  1. The “text” field in loc_text needs to be a table (just wrap the string in {} and it should work
  2. You have an extra unnecessary end bracket after loc_text that closes off the joker object too early
tacit peak
#

by wrapping do you mean put the text string in {} ??

frosty dock
#

perhaps take_ownership_by_kind should have an alternate calling mode taking a function that takes the current object and returns the table to pass on to take_ownership

normal crest
tacit peak
#

like this?

bright ivy
tacit peak
#

oh

#

new error

faint yacht
#

SMODS.Joker accepts a table - wrap all those in {}.

normal crest
#

You put joker when it's meant to be Joker too

#

Also put a comma at the end of line 3

#

Also you should go learn lua before trying this

dreamy thunder
#

also im pretty sure j needs to be capital

#

but im like 2 hours late

shy atlas
#

Hey, how would I check if the played hand has a 5 and a 6 in a joker

#

Would context.other_card:get_id() == 5 and context.other_card:get_id() == 6 work or would that rely on the order of the cards

gilded blaze
#

that would be false

#

a card can't have 2 ids at once

shy atlas
#

Oh

#

How would one do that then

gilded blaze
#
local has_5, has_6
for _. v in ipairs(context.full_hand --[[or context.scoring_hand]]) do
    if v:get_id() == 5 then has_5 = true end
    if v:get_id() == 6 then has_6 = true end
end
if has_5 and has_6 then
    -- do stuff
end
gilded blaze
#

you know what, Imma safe-check that too

fading rivet
#

is there a way to switch to a different lovely patch if a specific mod is present

red flower
#

not for the whole patch, you would need to check for that in the code you patch in

fading rivet
sleek valley
#

is there a context to check if the player has lost to a blind?
trying to make a blind where the win condition is scoring less than the required chips, and obviously context.blind_defeated isnt gonna work for that lol

fading rivet
#

that'll work then thx

red flower
#

it will just send a warning in the console

fading rivet
#

this also detects winning the game though

red flower
#

i dont think game over detects winning

#

but a lot of blind winning stuff is hard coded so you might need to patch some places

fading rivet
sleek valley
fading rivet
#

this used to have and not context.game_over in the condition

red flower
#

i always do context.game_over ~= nil

#

so maybe that's why

fading rivet
#

would anything bad happened if I stored a card in a copy of itsself found in the deck preview

hushed field
#

probably, yes

fading rivet
#

hmmm

hushed field
#

If there's anything I've learned, you really, really want to avoid storing any object onto something of the same type.

#

What's the end goal?

fading rivet
#

since the ones in the deck preview are copies (dunno if shallow or deep thought)

hushed field
#

What's the full ability you? Let me scroll up to see, haha

fading rivet
hushed field
#

They're made using the copy card function, and lack anything not explicitly set up to be copied or saved

#

So, if it acts immediately, any game object will have a unique identifier. you can also add just a temporary reference to the deck view, so you don't have to copy the game object itself. Unless what you meant was already just storing a reference, ofc

fading rivet
#

yeah thats what I meant lol

hushed field
#

Oooh, yeah, if you just grab the reference to use as a way to search when you iterate through the deck, there's no harm in that

#

You just don't want to actually store the object onto itself, or another card

fading rivet
#

thats why I had this question lol

#

wasn't sure if it applied here also

hushed field
#

I would suspect it wouldn't be an issue in just vanilla. I know for Kino, it wasn't really an issue if I just played it by itself, but anything even resembling a slight recursion risk would become a Crash To Desktop if other mods loaded

sleek valley
# fading rivet `context.game_over` iirc

so after a bit of testing, context.game_over works for giving the associated achievement but i cant rly use it for winning the round after not meeting the chip req

fading rivet
sleek valley
#

oh yeah, i forgot abt mr bones!

fading rivet
#

ight this should work

gilded blaze
hushed field
#

you'd be able to fix that by always counting all of them in G.playing_cards, and then lowering it by 1 instance, no?

sleek valley
fading rivet
#

okay well it's not crashing but now I cant view the deck

fading rivet
#

forgot to call the original function ;-;

long sun
#

oh ya uhm

#

how would i check if a played and scored card is part of a 3oak?

#

i know there's a 3oak function but i'm not sure how to use it for this

fading rivet
long sun
#

wait is this not a movie reference 😭

fading rivet
#

no its an ultrakill reference 🥀

long sun
#

🥀

fading rivet
#

okay whiplash works now yay

long sun
#

not quite my tempo

#

okay wait i have a solution for the thing i wanted to do

#

it's scuffed but it's probably gonna work

primal robin
#

Salty ghost is 3d now what a heck

shell timber
#

is one not allowed to be 3d

plucky lantern
#

make it 4d mwahaha

long sun
noble ore
#

teehee :3c

formal vessel
#

hmm seems balanced enough

long sun
#

how do i retrigger the effects of a held consumable that has a calculate function?

red flower
#

retrigger joker check should work

long sun
#

ah kay ^^ thanks

fading rivet
spark owl
#

so.. uh....

#

still confused on what to do here 😭

dreamy thunder
spark owl
dreamy thunder
#

yes i have no idea

spark owl
#

default one

#

hang on

#

you can take a gander at this one too if it helps

dreamy thunder
#

oh wait

#

gimme a sec

#

i wish i knew how malverk worked

dreamy thunder
#

and smods + lovely

dreamy thunder
#

lovely latest is 0.9
smods latest is 1224a
and malverk is 1.1.4 i think

bright ivy
#

-- 2 BY 2
SMODS.Joker {
    key = "2by2",
    in_pool = function(self, args)
        return true 
    end,
    loc_txt = {
        name = "The 2 By 2",
        text = {
            "{X:mult,C:white}X#1#{} Mult",
            "if played hand contains",
            "a {C:attention}#2#{}",
        },
    },

    
    blueprint_compat = true,
    rarity = 3,
    cost = 8,

    atlas = "2by2_atlas",
    pos = { x = 0, y = 0 },

    config = { extra = { Xmult = 2.5, type = 'Two Pair' } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.Xmult, localize(card.ability.extra.type, 'poker_hands') } }
    end,
    calculate = function(self, card, context)
        if context.joker_main and next(context.poker_hands[card.ability.extra.type]) then
            return {
                xmult = card.ability.extra.Xmult
            }
        end
    end,
}

Why does this say x4 and give x4... Im so confused

dreamy thunder
bright ivy
#

I dont think I respawned it, let me do that rq

dreamy thunder
#

pre-existing jokers' values are seperated from their centers

bright ivy
#

Ahh ic

#

thats weird

#

yeah that worked

bright ivy
#

is weird cus I normally dont respawn the jokers I am testing

#

but yeah that worked

dreamy thunder
# spark owl hrm

so it looks like its checking for keys in the center, but the README says its an optional feature, maybe you could get away with adding a keys = {}

spark owl
#

but add it to where?

dreamy thunder
#

in AltTexture({

spark owl
#

kk

spark owl
dreamy thunder
#

for example in -- RH Enhancements

spark owl
#

Oh

#

whoops

#

kk

dreamy thunder
#

probably best to check this part in readme and play arround

spark owl
#

wait

#

we have a key already

#

hrm

dreamy thunder
#

it checks for the keys

#

value, not the key

dreamy thunder
spark owl
#

i see

#

okay

#

lets SEE

#

if this works now

#

OH GREAT

#

its looking for something else now

spark owl
dreamy thunder
#

yeah idk

spark owl
#

i could have just like

#

asked the main dev for malverk

dreamy thunder
#

its probably releated to the image

spark owl
#

but brother is not responding

#

😭

dreamy thunder
#

busy man

spark owl
#

did i resize my images wrong...

#

OH WAIT

#

its probably this

#

what sizes are these usually in

dreamy thunder
#

should be 71x95 default

#

including the empty borders

spark owl
#

well

#

SHIT

#

its still the same

#

Oh

#

I swapped

#

the files

#

for 1x and 2x

#

yea i

#

fucked up on that 😭😭

#

still no

dreamy thunder
#

idk

umbral spire
#

what's the prefix for enhancements? like prefix_polychrome?

#

is it e_? or m_ or...?

faint yacht
#

m_prefix_key

umbral spire
#

ah ok

bright ivy
#

-- HANDY JOKER
SMODS.Joker {
    key = "handy_joker",

    in_pool = function(self, args)
        return true 
    end,

    loc_txt = {
        name = "Handy Joker",
        text = {
            "{C:blue}+1{} hand each round",
        },
    },

    atlas = "handy_joker_atlas",
    pos = { x = 0, y = 0 },
    

    blueprint_compat = false,
    rarity = 1,
    cost = 4,
    
    config = { extra = { h_size = 1 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size } }
    end,
    
    calculate = function(self, card, context)
        if context.setting_blind then
            G.GAME.round_resets.hands = 
                G.GAME.round_resets.hands + card.ability.extra.h_size
        end
    end,
}

When I start a challenge with this it doesn't give me the +1 hand until after the first blind is over, why is that and how can I fix this?

umbral spire
#

how do you check if a playing card is a lucky/wild/glass/etc ?

red flower
umbral spire
#

does SMODS.has_edition(...) exist?

red flower
#

no

dusk crypt
#

so im using joker forge when i use the denominator and numerator in text will it be formated it game? it doesnt change on the website

red flower
#

i would ask on the joker forge discord, not many people are familiar with it here

dusk crypt
#

oh i didnt know there was one

#

thanks

wintry solar
slim ferry
#

does adding an info_queue entry with a key that doesnt actually exist in localization cause any issues? or does it just get skipped? ive had this situation before due to an issue on my end but i forgot what happened exactly

junior tapir
#

why when I do card.ability.eternal = false/true the joker reacts to it, but when I do card.ability.personalSticker = false/true it does nothing

daring fern
rapid stag
#

what's going on here? the joker on the right-most side should copy baron (in the middle) twice, yet it's not even doing it once?

did i do something wrong or

#

oh right, i hook blueprint effect, i should show that too

rapid stag
red flower
#

needs a table

rapid stag
#

ohhhhhhhhh

#

thank you

red flower
#

you can also do { ret1 or {}, ret2 or {} } to remove the nil checks

viscid talon
#

currently redoing the code for divine jokers and ive begun using card:set_ability

#

problem is, it doesnt seem to work in game

#

here is my code so far

#
SMODS.Consumable {
    key = 'soulofdummy',
    set = 'divine',
    pos = { x = 0, y = 0 },
    loc_txt = {
        name = 'Soul of Dummy',
        text = {
            [1] = '{C:purple}Evolve!{}'
        }
    },
    cost = 3,
    unlocked = true,
    discovered = true,
    hidden = false,
    can_repeat_soul = false,
    atlas = 'CustomConsumables',

    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                local evolution = G.jokers.highlighted[1]
                evolution:set_ability("j_cavendish")
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
    end,
}```
#

ill demonstrate what happens shortly

#

so i have the both of them selected, and "use" is grayed out

#

how do i fix this?

wooden belfry
red flower
viscid talon
#

oo oke

#

hmm, lets figure that out

#

i just wrote can_use = function(self, card) return G.hand and #G.jokers.highlighted <= card.config.max_highlighted and #G.jokers.highlighted > 0 end

#

idk if it will work

red flower
#

you dont have a card.config.max_highlighted

#

just do
return G.hand and #G.jokers.highlighted == 1

viscid talon
#

oke

#

oke i made it work, now to add specific animations and conditions

primal robin
tranquil cypress
#

this is so peak

rapid stag
#

sanity check, adding seal info to info_queue is the same way as anything else? just add the centre?

daring fern
rapid stag
red flower
#

same but without prefix

#

lowercase

wintry solar
#

I think seal keys are capitalised arent they?

red flower
#

not the localization ones iirc?

slim ferry
#

localization keys are never capitalized right

#

because the keys are always lowered

wintry solar
#

you are correct N

#

I am thinking of doing card:set_seal('Red') for example

red flower
#

but centers can have capitalization

slim ferry
#

o

rapid stag
#

doesn't work

slim ferry
#

key = "gold_seal"

#

im pretty sure

red flower
bright ivy
#
-- DIVER
SMODS.Joker {
    key = "diver",

    unlocked = false,

    check_for_unlock = function(self, args)
        if args and args.context then
            local context = args.context

            if context.individual
            and context.cardarea == G.play
            and not context.retrigger
            and context.chips
            and context.chips >= 70 then
                return true
            end
        end
        return false
    end,

    locked_loc_txt = {
        name = "Diver",
        text = {
            "Unlock by scoring",
            "{C:attention}70{} chips with a card"
        }
    },



    in_pool = function(self, args)
        return true 
    end,

    loc_txt = {
        name = "Diver",
        text = {
            "Cards that score",
            "{C:attention}10+{} chips gain",
            "{C:mult}+1{} Mult permanently"
        }
    },

    rarity = 2,
    cost = 5,
    blueprint_compat = true,
    atlas = "diver_atlas",
    pos = { x = 0, y = 0 },
    

    config = { extra = { mult_gain = 1, value = 10} },

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

    calculate = function(self, card, context)
        -- Only triggers on cards that actually score
        if context.individual and context.cardarea == G.play 
        and context.other_card:get_chip_bonus() >= card.ability.extra.value 
        then
            context.other_card.ability.perma_mult =
                (context.other_card.ability.perma_mult or 0)
                + card.ability.extra.mult_gain

            return {
                message = "+Mult",
                colour = G.C.MULT
            }
        end
    end,
}

I cant figure out why this wont show up as locked

rapid stag
bright ivy
#

Thought that was the case

bright ivy
rapid stag
# bright ivy How can I make the locked text show up as rn it isnt?

this is wrong:

        name = "Diver",
        text = {
            "Unlock by scoring",
            "{C:attention}70{} chips with a card"
        }
    },```
your unlock text needs to be in ``loc_txt`` as a table in an  ``unlock`` var:
```loc_txt = {
  name = [name],
  text = {
    [description]
  },
  unlock = {
    [unlock requirements]
  }
}```
bright ivy
#

ahhh, I see

#

thank you for being so helpful

reef bobcat
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and context.other_card:has_enhancements(scored_card)  then
            return {
                mult = card.ability.extra.mult,
            }
        end
    end
}``` 

this card should give mult if the card has an enhancement but it crashes instead ;-;
fading rivet
red flower
#

SMODS.has_enhancement(card, key)

red flower
fading rivet
#

your config has it as s_mult

red flower
#

next(SMODS.get_enhancements(card))

reef bobcat
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and context.other_card:next(SMODS.get_enhancements(card))  then
            return {
                mult = card.ability.extra.mult,
            }
        end
    end
}```

so this?
red flower
#

no
replace this context.other_card:next(SMODS.get_enhancements(card))
with next(SMODS.get_enhancements(context.other_card))

fading rivet
reef bobcat
#

balatro modding is my first ever experience in coding :0

#

aside from like

#

basic high school classes

fading rivet
#

okay basicly
next is a built in function that helps you iterate through lists, so you call it like any other function, function_name(arguments)
some_object:some_method(some_arugment) is a shorthand for some_method(some_object, some_argument)

reef bobcat
red flower
#

can i see the new code

reef bobcat
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and next(SMODS.get_enhancements(context.other_card))  then
            return {
                mult = card.ability.extra.mult,
            }
        end
    end
}```
red flower
#

hmm no idea that should work

rapid stag
#

you know... is there a way i can make a joker effect that makes stone cards also count as wild cards? like in such a way that if i play 4 cards of the same suit and a stone card, it becomes a flush

fading rivet
#

they are very laggy though

#

I have a card that makes face down cards act as wilds and I get a nice 15 fps

rapid stag
#

nice

fading rivet
#

like by itsself

fading rivet
#

try completely closing the game

thorn ingot
#

Guys, guys super quick question. But how do I reference the card buy cost?

Like card.sell_cost but for the price in the store.

thorn ingot
#

brooo, thanks.

fading rivet
#

@rapid stag this is the entire code btw

rapid stag
#

that's wild

fading rivet
daring fern
fading rivet
reef bobcat
#

ok it's working now

fading rivet
bright ivy
#

Is there anyway for me to code up a way to access challenges without needing the 5 wins, testing unlockable cards in a new acc as my main acc already has them unlocked

reef bobcat
#

idk what changed cuz i closed the program and reopened it before

#

but i just did that again

#

and now it works

#

anyway thanks

daring fern
reef bobcat
#

ok since im here im gonna ask a question i asked before that didnt get answered

#

how do you make a joker that retriggers seal effects?

#

so purple seals give 2 tarots, red seals trigger twice etc.

daring fern
fading rivet
daring fern
# fading rivet

No, you would just copy the code and change that function.

reef bobcat
# daring fern Hook `Card:calculate_seal`

would I put this somewhere in the mime's effect?

    calculate = function(self, card, context)
        if context.repetition and context.cardarea == G.hand and (next(context.card_effects[1]) or #context.card_effects > 1) then
            return {
                repetitions = card.ability.extra.repetitions
            }
        end
    end
}```
reef bobcat
#

what's a hook? :-;

daring fern
red flower
#

what's a hook

fading rivet
# reef bobcat what's a hook? :-;

say smods defines the method G.hand:print_hi
now you want that function to only work if there's a certain joker in play
you can do this

local printhiref = G.hand.print_hi
function G.hand:print_hi(arg1, arg2)
  if next(SMODS.find_card('j_urmod_print_hi_man')) then
    return printhiref(self, arg1, arg2)
  end
end
reef bobcat
#

ohhhhh

reef bobcat
#

tbh with u i still dont know where to put Card:calculate_seal in the code :-;

fading rivet
versed swan
#

How do you detect that a card's order in an area is changed? i.e. which function, where in the code, etc

grizzled tide
#

do you guys happen to know which function determines when a card is debuffed? id like to hook it to prevent a card from being debuffed

#

i know you can modify can_calculate, but it does keep the debuffed ui and text

daring fern
grizzled tide
#

Wait really? I’m surprised you don’t hook it

red flower
#

that probably wont work for shuffling

versed swan
#

I'll look into that, thank you

#

oh, actually, while i'm here, may as well ask here as well

#

Does anyone else know about [card].rank that gives the order of a card in a cardarea

#

because I just found out about it after several months of using for-loops to get a card's index/order

spark owl
wicked sonnet
#

Alr uhh, im bad with text, so I just drew it, Im asking if its possible to make the number scroll down to the current blind requirement after its recalculation

gaunt folio
#

again, im trying to make it not repeat itself if its the main joker, it should retrigger other jokers but not itself. Because instead of retriggering one joker it somehow retriggers 3 times

gaunt folio
#

did that and replaced 'joker' with 'card' in the pool check as it would error out and does nothing

#

nevermind got it

wicked sonnet
red flower
#

yes it's the latter

thorn ingot
#

Hey guys. Do you know where I could look to change the discount of the edition tags?

It sets it to $0 in the base game, but I would like for it to be a 50% discount or something like that.

wicked sonnet
oblique lotus
#

How can you get all rarites in the game?

#

Specifically Joker rarites

daring fern
fervent rampart
#

I get the crash on loading Balatro SMODS FusionForce.lua"]:2422: '}' expected [to close '{' at line 2420] near 'card
so long as this bit of code is left in. ```lua
if card.ability.extra.hand_size_buffer ~= card.ability.extra.hand_size * math.max(0,math.floor(midas_tally/3)) then
return {
G.hand:change_size(card.ability.extra.hand_size * math.max(0,math.floor(midas_tally/3))),
card.ability.extra.hand_size_buffer = (card.ability.extra.hand_size * math.max(0,math.floor(midas_tally/3)))
}
end

Line 2420 is "return {" and 2422 is "card.ability.extra.hand_size_buffer = (card.ability.extra.hand_size * math.max(0,math.floor(midas_tally/3)))"
I know that despite what the crash is saying, this has nothing to do with a '}'. The second bit of code, the hand_size_buffer one, *that* is crashing Balatro. And I don't know why. If I dummy just that bit out then it works. So this is purely a case of me writing it in wrong. But I'm comparing it to other examples and I can't see what I did wrong.
mystic river
#

you can't execute code inside a return table

fervent rampart
#

I can't?!

mystic river
#

no, you can only put values in there

daring fern
bright ivy
#

Is there anyway for me to code up a way to access challenges without needing the 5 wins, testing unlockable cards in a new acc as my main acc already has them unlocked

fervent rampart
# mystic river no, you can only put values in there

Okay I tried moving it outside the return table before to no avail. Did it again and nope. Move it above instead of below and now it works. I can't believe there's even this rule that return tables have to be on the bottom. Thank you for the rescue.

mystic river
#

i mean. even if it was allowed to go below the return table, returning ends the function, so it wouldn't be executed anyway

rapid stag
#

how would i write a context check that catches anything (other than end-of-round) that gives $ cirThink

#

actually wait, maybe i just don't do that and cheat, nvm

clear ocean
#

blind ideas what do you think

#

not sure how i would do the first two showdown boss blinds, im sure there's a way to get last antes scoring, and for boss blind, i can set the mult or base as one per joker so 5X base if five jokers

#

maybe for a 6-7 or showdown boss blind, scored cards lose their enchancement?

rapid stag
#

why isn't it creating my table in G.GAME when i start a new round? i've tried both before and after calling the old func, and i also initially tried outside of an event, with the same result

#

putting a print in the event suggests the event doesn't even run? cirLost

#

was new_round changed?!

red flower
#

you can try SMODS.current_mod_reset_game_globals

rapid stag
#

where do i find documentation on thatfunc cirDerp

#

if it exists

#

oh i'm an idiot, i should have done this in start_run, not new_round. new round is per blind

red flower
#

it runs every round but it has an argument for start of run

primal robin
#

Of course you can, pretty sure it's only one check in some UI

rapid stag
#

cursory testing shows this doesn't seem to capture gold card triggers, what am i doing wrong cirDerp

figured it out, i needed to check for cardarea == G.hand and context.money_altered

grizzled tide
#

hi, this is kind of a stupid question, but can smods handle hand levels which are large and a long decimal

wicked sonnet
formal vessel
#

maybe remove the animation? ik its kind of a bandaid, but it should work for now

wicked sonnet
formal vessel
#

oh ok

gilded blaze
#

it's used in easing round score after every hand played

wicked sonnet
gilded blaze
#

the func field

#

{trigger = "ease", func = function(t) return math.floor(t) end}

wicked sonnet
#

ooo, okok, lemme tryit

rapid stag
#

so wait, if context in calc_dollar_bonus = function(self, card, context) is typically nil when called, how do i determine if the blind was a boss blind in that function?

oblique lotus
#

How can I go from the number of a vanilla rarity to its key?
Example: 1 to Common

gilded blaze
#
({"k_common", "k_uncommon", "k_rare", "k_legendary"})[rarity_num]
gilded blaze
#

don't just blatantly copy my example, it doesn't work in your context

#

an Event object takes a table to init
define a func field in that table

daring fern
thorn ingot
#

I managed to find how to change the price of the edition and base joker tags!!! I made it go to 25% off or * .75.

But a small problem that popped up is that when I combine an uncommon tag and a foil tag together for an example it makes the price go to 0, haha. It's a cool feature I guess, but I would like to know why it happens and fix it if I can.

#

here is an example of one of them. They are all like this basically.

#

Is it because it's doing * .75 twice?

red flower
red flower
#

you can set a flag in beat_boss and then add in calc dollar bonus when that flag is set if that doesn't work

rapid stag
red flower
#

yes

rapid stag
#

wow

gilded blaze
red flower
#

but it's literally just SMODS.current_mod.calculate = function(self, context) and works like any calculate

gilded blaze
#

examples aren't meant to be correct, they're meant to demonstrate

rapid stag
#

actually why did i write it like that, i can just put it in the init

wicked sonnet
wicked sonnet
#

Forget about it, after ante 3 (Big blind, or jusr 1,200 Chips) its just a crashes 💔

red flower
#

you can probably just cast it to number beforehand

wicked sonnet
#

or like, what exactly?

red flower
#

you can just do G.GAME.blind.chip_text = G.GAME.blind.chips

#

the problem is probably that it wont format properly

#

but you would need to do some custom easing for that

wicked sonnet
red flower
#

i know how to code but i gave up on making things look nice because it's too much effort

#

i would rather code 200 jokers

wicked sonnet
#

Also, uhh, the only real thing it did was just to push the crash into the 4,000 chips area

#

Meh, for the time being, im just gonna make it have a juice up and thats all

bright ivy
#

How do I make this effected by the Oops! All 6s Joker?

SMODS.Joker {
    key = "hacker",

    in_pool = function(self, args)
        return true 
    end,

    loc_txt = {
        name = "Hacker",
        text = {
            "Played cards have",
            "a {C:green}#1# in #2#{} chance", -- 1 in 3
            "to {C:attention}retrigger{}",
        },
    },

    atlas = "hacker_atlas",
    pos = { x = 0, y = 0 },
    

    blueprint_compat = true,
    rarity = 2,
    cost = 6,
    
    config = { extra = { chance = 3, repetitions = 1 } },

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

    calculate = function(self, card, context)
        if context.repetition 
        and context.cardarea == G.play 
        then
            if pseudorandom('hacker_roll') < (1 / card.ability.extra.chance) then
                return {
                    repetitions = card.ability.extra.repetitions
                }
            end
        end
    end,
}

As rn when I have both jokers in hand it still says 1 in 3?

faint yacht
#

SMODS.get_probability_vars(card or self, 1, card.ability.extra.chance) for loc_vars & SMODS.pseudorandom_probability(card, 'seedhere', 1, card.ability.extra.chance) for calculate check roll.

umbral zodiac
#

is there a way to make a ui button not move or move less when clicked

keen atlas
#

button_dist = 0

umbral zodiac
#

oh fire

#

thanks

hushed field
fading rivet
#

where would I need to put my file for this to pick it up, or am I understanding it wrong

faint yacht
frosty dock
#

omit the second parameter if the file is in your mod, not the other mod

faint yacht
#

Sure.

fading rivet
#

❤️

frosty dock
#

and use assert(SMODS.load_file(...))() to properly handle errors

faint yacht
#

The full nickname, if you wish.

fading rivet
#

TheOneGoofAli?

faint yacht
#

ye.

fading rivet
fading rivet
#

Is there a way to iterate through every card the player has or do I have to check each card area individually

faint yacht
#

Iterate through the areas given by SMODS.get_card_areas function.

fading rivet
#

thx

wild patrol
#

for ANIMATION_ATLAS is there away to speed or slow down the frames?

#

or are you stuck a default speed

fading rivet
#

Is there a context for changing/setting editions?

faint yacht
wild patrol
#

nearly finished the first page of jokers

fading rivet
#

what would the target be for patching into aikoyoris?

#

I have this but it's not working

frosty dock
#

what makes you think it's not working

fading rivet
#

I fixed the payload and the patch still didn't appear

frosty dock
#

oh that one's quite dumb

fading rivet
#

thetes also no message in the terminal of the patch being successful

#

or even attempting a patch

frosty dock
#

do "./modules

fading rivet
#

ah

frosty dock
fading rivet
#

yay it appeared

frosty dock
#

you can also check buffer names by running with dump-all flag

#

there's an info file for each dumped lua file that tells you what the buffer name is

fading rivet
#

<@&1133519078540185692>

frosty dock
#

oh moderators

fading rivet
#

thx

robust tundra
#

if i had 1 cent for each crypto spammer I've banned

frosty dock
#

ty, quick work as always

robust tundra
#

I'd be pretty poor actually

fading rivet
#

buh my code doesn't work

#

yippee

frosty dock
#

i can't see half your code so I'm not sure i can help there haha

fading rivet
#
if scored_card.edition and scored_card.edition.aiko_sliced == true and next(SMODS.find_card("j_foobar_splitdance")) then extratrigs = extratrigs + 1 end
frosty dock
#

what is this == true shit

#

besides that it seems reasonable

fading rivet
#

it was how cryptid did it iirc

frosty dock
#

if (scored_card.edition or {}).aiko_sliced and ...

fading rivet
#

got rid of that and it still doesn't work

frosty dock
#

yeah that doesn't matter, it's just bad practice

gilded blaze
#

I mean, not all people are familiar with lua's simplicity

#

if a then where a is not a boolean does sound like alien stuff

#

wait

#

== true is a different thing

#

😭

frosty dock
frosty dock
fading rivet
#

the patch was successful

frosty dock
#

what does the patched source read like

lyric wadi
#

how do you draw a card from deck

fading rivet
lyric wadi
#

like not increase the number of card just draw one

#

oh

fading rivet
#

specificly its

#

draw_card(G.deck, G.hand, some number, 'up' or 'down', nil, the card, delay)

frosty dock
#

also can I see the edition in question

lyric wadi
#

what is up or down

#

im assuming face up or face down

frosty dock
#

can you not do screenshots...

fading rivet
fading rivet
lyric wadi
#

number is number of cards drawn

fading rivet
lyric wadi
#

what is nil and the card

fading rivet
#

the card is the card you want to draw

#

nil is if you want to resort the hand

gilded blaze
lyric wadi
#

is this documented

pastel kernel
#

How to style mod description in the json file

fading rivet
#

omg I found the problem

frosty dock
fading rivet
#

I got the mod key wrong

frosty dock
#

💀

gilded blaze
pastel kernel
#

At this point I should just switch from loc_txt to en_us.lua

fading rivet
#

yes

gilded blaze
#

should've done that in the first place

pastel kernel
#

But I’m too lazy to do it all

pastel kernel
frosty dock
#

oh wait json file

#

in that case you don't

#

i was thinking of a different json file..

gilded blaze
pastel kernel
fading rivet
#

omg it still doesn't work wtf

pastel kernel
gilded blaze
#

knowing that sooner helps a lot more

frosty dock
gilded blaze
#

loc files are simply better in many aspects

frosty dock
#

smods has been supporting JSON loc files

pastel kernel
frosty dock
#

but you can't lovely patch them

gilded blaze
#
  1. manage all loc entries in a single file for each language
  2. supports key field in a loc_vars return since you can store non-default descriptions here
#

like, I'd never be able to separate story mode from normal mode without it

pastel kernel
#

This is gonna be a hassle.

frosty dock
#

how so

gilded blaze
#

how do you store non-default descriptions with loc_txt

pastel kernel
#

I’m gonna have to keep track of what I put in?

frosty dock
#

if you're worried about converting from loc_txt to localization files, there's a feature for that

pastel kernel
#

I made jokers, decks, 2 new consumable types, spectral cards, a booster pack, a voucher, and an edition.

#

I’m scared I might use the wrong prefix key for each card, which one is c, which one is e, which one is j, etc.

gilded blaze
frosty dock
#

you don't have to do that manually

#

at least for conversion

pastel kernel
#

Pardon?

frosty dock
#

dump_loc my beloved

pastel kernel
#

What’s dump_loc?

frosty dock
#

add "dump_loc": true to your mod's json file, run the game with no other mods active, and boom

#

there's a ready-made localization file waiting for you in your mod's localization folder

pastel kernel
#

No other mods? What if it has dependencies?

fading rivet
#

im so confused wtf
the card is being retriggered twice in the code
yet its only giving its effect once

frosty dock
#

well you have to keep dependencies i suppose

#

you can just remove the parts that belong to dependencies afterwards

#

it's not perfect, but it's better than converting manually

pastel kernel
#

In the curly brackets or outside of it

frosty dock
#

inside, of course

#

that restriction is because the localization table has no way of knowing what keys get added by what mod, all it can do is compare what was there before to what's there after

fading rivet
#

oh I mistyped the mod key

#

yay it works

gilded blaze
#

ok, that's cool

#

dump_loc also does vanilla stuff, but it shouldn't be too hard to extract the entries from your mod

frosty dock
#

does it? it should only dump the entries that were touched during mod loading

pastel kernel
#

should they all have square brackets when you dump them?

#

as in dump_loc

frosty dock
#

yes it's supposed to do that

#

that's because keys can be strings that aren't valid identifiers in lua

#

for example if they contain a space or start with a number

fading rivet
#

omg finally fixed the compatibility issue between whiplash and cartomancer

faint yacht
#

Like trying to access "High Card" under G.GAME.hands.

frosty dock
#

exactly

pastel kernel
#

I wonder if people ever saw the unused Ultra Broken Sisyphus Prime v2 code in hyperjokers.lua

rapid stag
pastel kernel
#

Wait, do I have to assert the lua file?

faint yacht
#

ye.

pastel kernel
#

Tch

frosty dock
rapid stag
#

yes cirBlech i'm desperately throwing everything at the wall to try and see what will catch the things i need it to catch and it's not doing it

pastel kernel
#

ok what the fuck is wrong with this now

frosty dock
#

money_altered is supposed to work but doesn't give full context of where the money is coming from

rapid stag
# pastel kernel Why are you looking for the name and not the key?

that's true, i do need to change that, but i don't know exactly what to alter to get it. i also need to change another similar implementation to look for the key too cirDerp

i mean, if you can help me find the key from trigger_obj , i'll make the change, but i don't think it'll solve this problem

frosty dock
#

temperance and hermit just aren't fixed to be detectable on smods' end

frosty dock
rapid stag
#

the thing is, it was actually working and picking them up when i was hooking smods calculate_context

#

but after migrating to current_mod.calculate, it stopped

pastel kernel
frosty dock
#

presumably the entry is missing or in the wrong place

pastel kernel
#

It’s in joker

frosty dock
#

what does that mean

pastel kernel
#

Joker section of the loc file

frosty dock
#

i can't tell you what's wrong with a piece of code you've never shown me

pastel kernel
frosty dock
#

oh

#

the file name is wrong

#

the correct locale is en-us

pastel kernel
#

My brain is crine

#

Is it automatic

#

Or do I still need to assert it

frosty dock
#

no code needed for it to load

#

it just needs to live in your localization folder

pastel kernel
#

Thanks

#

Now how do I change the json mod description to use the loc file

rapid stag
frosty dock
#

where what's SixSuits for me is your mod ID

pastel kernel
#

on god finally

#

Oh yeah how do you use custom colors for the mod desc

gilded blaze
#

SMODS.current_mod.description_loc_vars

#

works the same as loc_vars on other objects

pastel kernel
#

I’ve been using ascensio as a guide

#

They use G.ARGS.LOC_COLOURS.modpf_name

frosty rampart
#

that adds custom colors you can use anywhere with {C:modpf_name}
SMODS.current_mod.description_loc_vars lets you return colors to use via {V:number} only in the mod description

#

up to you, both methods are valid

#

ascensio's method is better if you intend to use the colors elsewherre too

pastel kernel
#

I sure do

frosty dock
#

(you can also use a constant SMODS.Gradient)

frosty rampart
#

SMODS.Colour when 🤔

pastel kernel
#

Ok now how do you actually add music?

#

I finally got the track from vylet pony

#

Now I wanna use it

frosty dock
frosty rampart
frosty dock
#
SMODS.Gradient { 
  key = 'key',
  colours = { colour },
}
frosty rampart
frosty dock
#

speaking of gradients

#

should they have different interpolation options?

pastel kernel
#

what's the 100.002 for?```lua
#Cryptid.advanced_find_joker(nil, "busterb_Grandiose", nil, nil, true) ~= 0
) and 100.002

frosty dock
#

that's a priority value

red flower
frosty dock
#

multiple music tracks may report they want to be played, the one with the highest priority value gets chosen

pastel kernel
#

NI4NI sounds fucking dope when slowed actually

pastel kernel
#

What’s G.booster_pack_sparkles

#

I really wanna add sparkles for any event.

gilded blaze
pastel kernel
vital wren
#

I want to do the following:

    --if all four cards score then
        --self.ability.extra.chips = self.ability.extra.chips + self.ability.extra.chip_mod_square
    --else
        self.ability.extra.chips = self.ability.extra.chips + self.ability.extra.chip_mod
    --end
    return {
        message = localize('k_upgrade_ex'),
        colour = G.C.CHIPS,
        card = self
    }
end```
Does anyone know how to check how many of the played cards are scoring?
rapid stag
#

how would i go about adding a badge to a card? cirThink

rapid stag
#

just any playing card

vital wren
#

thanks!

wintry solar
frosty dock
#

ah yes that exists

wintry solar
#

We should close this tbh

frosty dock
#

yeah there's no need for it

median veldt
frosty dock
rapid stag
# frosty dock please elaborate

let's say i hover over a card in the hand. i want to add a badge to it's info box after it's description. where would i start looking if i wanted to do that? so after the edition badge, enhancement badge, seal badge, whatever badge i want. where should i look to access that pipeline?

median veldt
#

oh THAT kind of badge

frosty dock
frosty dock
#

it's designed to have a layer of visual information on the card, but you can just use a blank sprite to only have the badge and description

median veldt
#

i mean like how does smods itself do it. like the mod badge that shows at the bottom

frosty dock
#

there's a certain place in the code where these get added to the UI, smods patches all its additions including mod badges and sticker badges there

#

but it's much easier to make a sticker than it is to patch that code yourself

median veldt
#

wait yk what'd help

median veldt
frosty dock
#

meh, stickers are the way to go here no matter the concrete use case

median veldt
#

yeah fair

median veldt
frosty dock
rapid stag
median veldt
#

you can have multiple stickers

frosty dock
#

no, stickers aren't mutually exclusive

median veldt
#

i just don't think it ever happens naturally in game

frosty dock
#

it totally does

median veldt
#

mm

frosty dock
#

ever seen a perishable rental card?

median veldt
#

ive never played on a stake high enough to know lol

frosty dock
#

yeah I figured

median veldt
#

that sounds terrible

#

i think i would die if i got an eternal rental

vital wren
#

eternal rentals are more annoying imo

median veldt
#

lol

frosty dock
#

yeah perishable rentals aren't particularly annoying

#

I was just giving an example

vital wren
#

i buy them by accident sometimes intending to use them for one round and sell like other rentals

frosty dock
#

yet these are the only examples that are actually possible in vanilla

vital wren
#

would be nice to see Blue stake -1 discard replaced with a new sticker in 1.1 though

frosty dock
#

I think blue stake's effect is sure to be replaced

median veldt
rapid stag
red flower
# median veldt bunp 🥺

you can copy the cards to a hidden cardarea and then add them to deck on selling the card
otherwise other modifiers and stickers are kinda hard to get

median veldt
#

that is a fair point? however i'm really not sure how to go about that

red flower
#

it's kinda hard to explain without just coding it out, i would look into mods that do similar things by storing cards, the hardest part with individual cards is just naming the areas with unique identifiers in case you have multiple

#

to copy the card you would use copy_card

median veldt
#

i think i just need like. i could make a cardarea for the sandcastle card (and i mean technically in theory couldn't it just be the same cardarea for all sandcastles?)

i just don't know how to make cardareas

reef bobcat
#
        calculate = function(self, card, context)
        if context.discard and not context.blueprint and #context.full_hand >= 5 then
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                G.E_MANAGER:add_event(Event({
                    func = (function()
                        SMODS.add_card {
                            set = 'Tarot',
                        }
                        G.GAME.consumeable_buffer = 0
                        return true
                    end)
                }))
                return {
                    message = localize('k_plus_tarot'),
                }
            end
        end
    end,
}```

this joker should create a random tarot if 5 or more cards are discarded but it's not creating anything :[
median veldt
#

...why are you calculating in the loc_vars function

frosty dock
median veldt
reef bobcat
rapid stag
median veldt
#

give me a moment ill look at it if nobody else responds

reef bobcat
#

oki np

frosty dock
rapid stag
daring fern
rapid stag
#

yeah, i wasn't mentally parsing it right cirDerp

it's giving you five because it's doing that one on every single discarded card
somethingcom's solution is better and will probably actually work

reef bobcat
#

only 1 more issue, and that it's going past the consumable slot limit

rapid stag
#

you also need to check if G.GAME.consumeable_buffer < G.consumeables.config.card_limit otherwise it's going to give you more than the consumable limit

#

yeah

reef bobcat
#

ahh

#

yeah ok

oblique lotus
#

I'm adding an item to the shop in the G.shop_jokers section using emplace. When the store has only one slot, though, the emplaced item completely covers up the original item. How can I ensure there is enough space for the new item?

median veldt
short mauve
#

How do I make a deck set the scoring calculation to another one?

daring fern
mystic river
median veldt
#

cool ok now i just gotta learn how to make cardareas

red flower
#

i would look at the code for the game
it's just something like G.modprefix_area_name = CardArea(...) but the exact arguments escape me at the time

#

it should also be saved in G for it to save properly

dreamy thunder
#

had a similar issue

#

i might just be dumb

hidden aspen
#

i have finished core mechanics of my mod, so im getting closer to an alpha release

i have couple of questions regarding releasing the mod i wanted to ask here because people are much more experienced than me

#
  1. what's a good mod name? my WIP title was vissamap because, well, its a mod that adds a map and i made it myself.
    however i do understand that it's kinda "me centric", and a map is a generic concept to the point where i would love to see other people add their own events. should i go for some more generic mod name?

  2. how do people document their own code? i saw that some mods have lua language server definitions for IDEs, but im not sure how useful that is and how to even make them.

  3. my mod has a dependency on TheEncounter mod, so im not too sure how to release it? Should it be bundled in somehow, or should they stay separate? TheEncounter doesnt seem to be published on Balatro Mod Manager, should i reach out for it to become published?

  4. anything else i should know about?

red flower
#

you don't need to document all types and stuff, as long as you leave a comment on what each function does it's fine

#

for the dependency i would ask @primal robin what they think

primal robin
#

?????

mystic river
hidden aspen
# primal robin ?????

oh hi, im making a mod utilising TheEncounter, how should i publish it concidering the dependency? TheEncounter is not on the Balatro Mod Manager, and im not sure how good of a practise it is to bundle multiple mods together

primal robin
#

Maybe makes sense to publish it in bmm yea

#

I dont mind if you do that

hidden aspen
still hedge
#

goog

primal robin
hidden aspen
#

oh sure

short mauve
#

Was the reason why I asked here

dreamy thunder
#

that fixes the issue

short mauve
#

huh

dreamy thunder
#
G.E_MANAGER:add_event(Event({
    trigger = "immediate"
    func = function()
        -- do stuff here
        return true
    end
}))
#

i think immediate should work

short mauve
granite jay
#

You know how debuffed cards have a visual indicator?

How do I do that for custom effects like when a Blind targets a specific joker for a different effect?

#

Also how do you make it so certain cards cannot score chips during a Blind?
(Not debuffed so other jokers can trigger them)

granite jay
vital wren
#

i'm trying to change judgement to grant a top-up and change the top-up tag to add a free joker to the store. but when i use judgement to add the tag during a shop, is don't trigger right away. but it does trigger as im leaving the store which makes it do nothing. code below

    { -- table of properties to change from the existing object
        apply = function(self, tag, context)
            if context.type == 'store_joker_create' then
                local card = nil
                card = create_card('Joker', context.area, nil, math.random(), nil, nil, nil, 'top')
                create_shop_card_ui(card, 'Joker', context.area)
                card.states.visible = false
                self:yep('+', G.C.PURPLE, function() 
                        card:start_materialize()
                        card.ability.couponed = true
                        card:set_cost()
                        return true
                    end)
                self.triggered = true
                return card
            elseif context.type == 'immediate' then    -- do nothing
            end
        end,
        set_ability = function(self, tag)
            tag.type = 'store_joker_create'
        end,
    },
    true    -- silent | suppress mod badge
)```
red flower
bright ivy
#

-- RNA
SMODS.Joker {
    key = "RNA",
    discovered = true,
    in_pool = function(self, args)
        return true
    end,

    loc_txt = {
        name = "RNA",
        text = {
            "{C:mult}+#1#{} Mult on {C:attention}retriggered{} cards",
        },
    },

    atlas = "RNA_atlas",
    pos = { x = 0, y = 0 },

    blueprint_compat = true,
    rarity = 2,
    cost = 5,

    config = { extra = { mult = 5 } },

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

    calculate = function(self, card, context)
        if context.individual
        and context.cardarea == G.play
        and context.retriggered
        then
            return {
                mult = card.ability.extra.mult
            }
        end
    end,
}

How do I make it so that the +5 mult happenes only when a card is retriggered?

Rn it doesn't activate at all.

red flower
#

i don't believe there's a way to check retriggers in calculate

bright ivy
#

is there a way to check retriggers at all?

sturdy compass
bright ivy
#

Got it working now

sturdy compass
#

o7

mystic river
real night
#

how do you create custom ranks

tidal hemlock
real night
tidal hemlock
#

well you'd have to create art for all the suits, and every crossmod suit in order to prevent crashes

#

and spend way too long ironing out the kinks of what is and isnt a straight

real night
#

okay NeverFuckingMind then

tidal hemlock
#

not to be discouraging

#

it'd be cool if you added a new rank

#

but it takes some effort

real night
#

they will not be ready for the day i add i rank

frosty rampart
rapid stag
daring fern
rapid stag
#

i can't get the sticker to add

#

like i've tried all sorts, this, calling it with the additional true bool, the sticker sets and should_apply, directly w/ debugplus doing eval dp.hovered:add_sticker() - it just does not want to put the sticker on the card

#

...can i take_ownership of the base card

#

is that a thing

red flower
#

no

rapid stag
#

fuck

red flower
#

add_sticker takes a string, no?

rapid stag
#

of the sticker key? tried that too, no dice

#

unless it's string in a table?

red flower
#

like :add_sticker("modprefix_key", true)?

rapid stag
#

yep

red flower
#

and you're sure the sticker is getting registered?

rapid stag
#

nope, wait, it worked that time for whatever reason

#

maybe i wrote the key wrong before cirDerp

so how do i make its description not go into the info_queue

red flower
#

i dont think you can? i might be wrong

rapid stag
#

okay, new idea. how do i tell programmatical, if a card has this sticker or not

red flower
#

card.ability.modprefix_key

rapid stag
#

because i know if i do that from a joker, it'll look in the G.localization.descriptions.Joker table

rapid stag
#

nice

pastel kernel
#

I’m gonna be busy for a while, but I need to ask, how do you make it so that whenever you have a joker of a specific rarity, the default background changes and particles always appear?

rapid stag
#

i guess i should do and not (card.ability and card.ability.cir_face_infoKey)?

daring fern
rapid stag
#

yeah, because when i did that, apparently add_sticker is now nil x.x so i need to look at the card object coming in from generate_card_ui

#

alright, so new question
why does my badge text say error?

granite jay
#

How do you use a drawstep to modify the size of a card?

#

Need this for an enhanced card

rapid stag
#

can you do create_badge with an SMODS.Gradient colour or does it have to be a dynatext badge to parse that?

umbral zodiac
#

anything that can take in a colour can take a gradient

#

since colours are tables (and so are gradients) and are passed by reference itll always update properly

rapid stag
#

sanity check - i have an intuition that i iterate through every card in G.deck by just iterating through G.deck.cards but i feel like i'm horribly wrong

umbral zodiac
#

you would be correct

#

just be sure that you intend to only loop through cards in the deck - not all playing cards

#

if you do intend to affect all playing cards it'd be G.playing_cards

rapid stag
#

is that initialised at the start of the run?

umbral zodiac
#

should be

rapid stag
#

what even is obj in SMODS.create_mod_badges

#

oh it's card.config.center

shrewd gazelle
#

can someone send vanilla remade github? i cant find it anywhere and i wanted to start coding

rapid stag
umbral zodiac
#

ok professor semantics

#

like youre not wrong but this is rarely the case

#

most things don't copy the colour they just use it

sturdy compass
#

G.playing_cards.cards doesn't exist

umbral zodiac
#

G.playing_cards is just a table of cards sorry

#

shouldve been clearer

#

its not a cardarea like G.deck or G.hand

elder isle
#

i've been struggling for the past 2 days to make this consumable end the round and skip payout but all it does is defeat the blind, go to the payout screen, and then draw another hand like what is wrong with this

G.E_MANAGER:add_event(Event({
        trigger = 'before',
        func = function()
            G.STATE = G.STATES.HAND_PLAYED
            G.STATE_COMPLETE = true
            G.GAME.blind.payout = 0
            G.GAME.chips = G.GAME.blind.chips
            G.GAME.blind:defeat()
            end_round()
            return true
        end
    }))
junior tapir
#

is there a way, outside of a certain card scope, to access its .ability.params? I'm trying to get a voucher parameter by next(SMODS.find_card("the card I need")).param, hoping for that result, apparently idk what I'm doing

#

for jokers I can just for i = 1, #G.jokers.cards do, I guess I should look into some voucher card area

#

yeaah, G.vouchers

subtle hawk
#

I think G.vouchers is claimed?

#

Shop is G.shop_vouchers

vital wren
#

is there a way to grab the array of cards in hand (not being played or discarded, just all the cards in hand). something like G.hand.cards or something?

subtle hawk
#

Yes, G.hand.cards

vital wren
#

nailed it. thanks

slim ferry
#

why does specifically the bottom library path here just not work

#

i definitely have the correct folder name

queen crescent
#

how would i get this to work

tidal hemlock
queen crescent
short mauve
#

i have this deck that is supposed to balance mult and amp (my scoring param) but the mult gets balanced for like half a second then goes back to its original value
why is that?

#

wait nvm

#

i had to put mult = mod_mult( math stuff )

short mauve
#

wait how do i replicate the blind_wiggle sound thing?

quick scarab
#

Question, How do I create new parameters for jokers? I want to create something similar to Pokermon, where jokers of a "type", like Water or Grass. Do I have to use SMODS.modify_key(obj, prefix, condition, key) or SMODS.add_prefixes(cls, obj, from_take_ownership)

dapper sun
#

just put it in the joker, like when youset cost and rarity

#

then add the handling for the parameters elsewhere

red flower
#

(you should add the prefix to not conflict with other mods)

umbral spire
#

what's in_pool do?

#

In a joker per se

red flower
#

defines custom logic for when a card is allowed to spawn

umbral spire
#

Ah

mystic river
#

when the game is considering creating a random card, it runs the center's in_pool method with whatever arguments it deems relevant, and only adds that card to its list of options if the function returns true

#

if there is no method defined, it essentially always returns true

red flower
mystic river
#

i say center, but this also applies to several non-center objects such as suits and ranks

red flower
#

i think every object that spawns has in_pool

mystic river
#

i feel like there's one really dumb and hyperspecific exception to that
but as i can't bring it to mind it's possible I'm imagining it

#

there's very often one really dumb and hyperspecific exception to rules in balatro, because thunk

tidal hemlock
#

locale thonk moment

red flower
#

i think stickers dont because they have should apply

mystic river
#

there we go

#

though i don't even know if that's a thunk moment
iirc should apply is a purely smods construct

red flower
#

in_pool is also

mystic river
#

true!

quick scarab
mystic river
#

truly, smods has learned from the master

blazing helm
#

if i want to add extra UI to a joker would i do it in draw(self, card, layer)? (if so how do you add ui with it?)

red flower
#

what kind of ui do you want to add

blazing helm
#

a few text elements

red flower
#

i would recommend waiting a day for the next smods update

#

it adds a way to have better looking text on cards

blazing helm
red flower
#

today or tomorrow most likely

#

the release will probably have documentation on it

blazing helm
#

oki cool

umbral spire
#

is the current deck (amount) #G.playing_cards?

#

the steel joker's code says (VanillaRemade)

    in_pool = function(self, args) --equivalent to `enhancement_gate = 'm_steel'` <--

Where is enhancement_gate mentioned on the wiki?

red flower
#

i don't think it is

umbral spire
umbral spire
# red flower yes

in jokers.lua for VanillaRemade, is it sorted by the order in the catalog, or no?

slim ferry
#

It is

umbral spire
#

What does next(...) do again?

#

also what exactly is context.card_effects?