#💻・modding-dev

1 messages · Page 604 of 1

clear ocean
#

feel free to show me resources if you want

#

also good idea with the rocket

native bone
#

Perhaps an alternate name for the challenge could be Elton John lol

native bone
clear ocean
#

i think ground control fits isnce theres the obelisk and still a music reference

native bone
clear ocean
#

if someone is able to show me how to make sure blue seals don't appear i can revert the ban on card packs and certificate

native bone
#

Thank you, it actually worked, with some finagling of course

clear ocean
wind steppe
clear ocean
#

oh yeah good idea

#

thanks

copper perch
#

So, I have an old Joker that is now causing me issues, its scoring its mult twice even though only prompted once, any pointers on why that could be?

loc_vars = function(self, info_queue, card)
        local probabilities_normal, odds = SMODS.get_probability_vars(card, 1, card.ability.odds, "RocketLauncher")
        return { vars = { probabilities_normal, odds, card.ability.mult } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            if SMODS.pseudorandom_probability(card, "RocketLuncher_mult", 1, card.ability.odds, "RocketLauncher_mult") then
                return {
                      mult = card.ability.mult,
                      extra = {
                        func = function()
                              SMODS.calculate_effect({ mult = card.ability.mult }, card)
                              SMODS.destroy_cards(card, nil, nil)
                              G.GAME.pool_flags.RocketLauncher_extinct = true
                        end,
                        extra = {
                              message = 'BOOM!',
                              colour = G.C.RED,
                              sound = 'DRY_EXPLODE'
                        }
                      }
                }
            else
                if not context.blueprint then
                    return {
                    message = 'No Ammo!',
                }
                end
            end
        end
    end
clear ocean
#

what do you think of this challange idea? if the deck needs to work with straights i can add sixes or aces

frosty rampart
copper perch
#

Thank you :)

exotic estuary
#

Hi ive made a joker and all has gone well but im not sure how to show (Currently X__ Mult) like other scaling jokers such as hologram, would love some help thanks 🙂

clear ocean
#

otter gang

exotic estuary
#

🔥

clear ocean
#

{C:inactive}(Currently {X:mult,C:white}X#1#{C:inactive} Mult)

faint yacht
#

Forgot the X with #1#.

clear ocean
#

woops

#

here's vanillaremade for hologram

exotic estuary
#

ohh okay, ive been using vanillaremade, just never found that specific section of it thanks!!

clear ocean
clear ocean
tranquil gull
#

was stumped on what to draw and decided "fuck it lets be silly" :3

peak coral
#

where are Loyalty Card's loyalty_active and loyalty_inactive functions defined? i can't seem to figure out where they're pulled from in the localisation

#

asking because i want to make a card that does something every n hands played but i'm not sure what allows other cards like that to do such a thing

clear ocean
#

should i make it where you start with more capital

#

maybe $10 or $12?

clear ocean
peak coral
#

good stuff

peak coral
#

oh!. huh. what file is this?

daring fern
peak coral
#

really ? i wasn't able to find it there

#

probably just a vremade thing

daring fern
peak coral
#

cool, thanks !

lean whale
#

anywhere to learn more about context.whatever and what possibilities there are?

red flower
gilded goblet
#

This could also be a good starting point

#

There's a Smods file with all possible contexts but I do not recall where that is located

#

Or what it is called

red flower
#

it's in the lsp_defs but it's hard to read and i would discourage pointing beginners to it since it lists things that are not main contexts at the same level as them

gilded goblet
#

Yeahh

#

Just letting them know

fathom star
#

how do i iadd music to a booster?

lean whale
#

is there a way to use
SMODS.destroy_cards(SMODS.find_card('j_jam_gaming'))
(have a blind destroy a certain joker) but accounting for eternals (which should not be deleted)

red flower
lean whale
#

cool thx

crystal perch
#

i'm having a problem where SMODS.add_card seems to not be reading my card ability correctly and always makes rare jokers (rarity 3) instead of the specified rarity

#
calculate = function(self,card,context)
        if context.setting_blind and card.area == G.jokers then
            local right_joker = nil
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] == card then 
                    if G.jokers.cards[i + 1] ~= nil then -- Ensure right Joker exists
                        right_joker = G.jokers.cards[i + 1] 
                    end
                end
            end
            if right_joker ~= nil and not right_joker.ability.eternal then -- Get right joker rarity and slice it
                right_joker.getting_sliced = true
                card.ability.extra.doodle_rarity = right_joker.config.center.rarity
                print(card.ability.extra.doodle_rarity)
                G.GAME.joker_buffer = G.GAME.joker_buffer - 1
                G.E_MANAGER:add_event(Event({
                    func = function()
                        G.GAME.joker_buffer = 0
                        -- See note about SMODS Scaling Manipulation on the wiki
                        card:juice_up(0.8, 0.8)
                        right_joker:start_dissolve({ HEX("57ecab") }, nil, 1.6)
                        return true
                    end
                }))
                G.E_MANAGER:add_event(Event({ -- Create new Joker
                    func = function()
                        SMODS.add_card {
                            set = 'Joker',
                            rarity = card.ability.extra.doodle_rarity,
                            key_append = 'chak_doodle_joker',
                            allow_duplicates = false
                        }
                        return true
                    end
                }))
                return {
                    message = "Doodled!",
                    colour = G.C.CHAK_TOKEN
                }
            end
        end
    end
#

basically it's a joker that destroys the joker to the right, and replaces it with a random joker of its rarity

#

and card.ability.extra.doodle_rarity does get set properly as is confirmed by the print, it's just that SMODS.add_card seems to be reading it incorrectly

red flower
#

(this is in the wiki)

#

you want something like { "Common", "Uncommon", "Rare", "Legendary" }[other_rarity]

crystal perch
#

so i have to translate it into a string if it's a number

red flower
#

yes

crystal perch
#

gotcha

#

i was confused because i've used it to specifiy rarity in the past, but i did use strings that time so makes sense

lean whale
#

Can blinds display infoqueues aside from the normal description

#

same as jokers and tarots do

red flower
#

no afaik

#

blindexpander can do that iirc

vale zinc
#

Within context.individual, how do I know what the current card is for, say, card_eval_status_text()?

frosty rampart
#

it's context.other_card

lucid owl
#

wondering how much hell it would be to program the player replaying a specific blind, like the same blind in that ante, if a requirement isn't met

vale zinc
red flower
#

if you want to seamlessly retry the current blind idk but if you just want it to immediately play a blind again you can look at how i do extra blinds for hotpot

#

for the former you can maybe look at multi-phase blinds in blindexpander

vale zinc
lucid owl
red flower
#

yeah that's kinda what i do for the hotpot events but in a different order

#

it's actually not that much code

copper perch
#
loc_vars = function(self, info_queue, card)
        local glass_numerator, glass_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.glass_odds, 'DRY_oddity_break')
        local luck_mult_numerator, luck_mult_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.luck_mult_odds, 'DRY_oddity_luck_mult')
        local luck_dollars_numerator, luck_dollars_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.luck_dollars_odds, 'DRY_oddity_luck_money')
        return {
            vars = { card.ability.glass_Xmult, glass_numerator, glass_denominator },
            vars = { card.ability.bonus, card.ability.mult },
            vars = { card.ability.steel_x_mult },
            vars = { card.ability.gold_dollars },
            vars = { luck_mult_numerator, luck_dollars_numerator, card.ability.extra.mult, luck_mult_denominator, card.ability.extra.dollars, luck_dollars_denominator }

        }
    end,
    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            local ret = {}
            if SMODS.pseudorandom_probability(card, 'DRY_oddity_luck_mult', 1, card.ability.extra.luck_mult_odds) then
                card.lucky_trigger = true
                ret.mult = card.ability.extra.luck_mult
            end
            if SMODS.pseudorandom_probability(card, 'DRY_oddity_luck_money', 1, card.ability.extra.luck_dollars_odds) then
                card.lucky_trigger = true
                ret.dollars = card.ability.extra.luck_dollars
            end
            return ret
        end
        if context.destroy_card and context.cardarea == G.play and context.destroy_card == card and
            SMODS.pseudorandom_probability(card, 'DRY_oddity_break', 1, card.ability.extra.glass_odds) then
            card.glass_trigger = true
            return { remove = true }
        end
    end,
#

Trying to combine all vanilla card enchantments into 1. Feel I'm missing a lot though...

#

Know I need to combine all my vars in loc_vars, but feels like I need more

hidden mirage
#

Is there such thing as a quantum seal and if so how do you check if a card has a seal (quantum or not)

daring fern
crystal perch
#

this is kinda out there but how would i make a joker cause you to draw your cards from your deck unshuffled, like in the order they appear in your full deck

hidden mirage
hidden mirage
daring fern
hidden mirage
crystal perch
# daring fern Hook `CardArea:shuffle`

tried hooking, but i keep getting this crash :/
here's the code

local shuffle_ref = CardArea.shuffle
function CardArea:shuffle(_seed)
  local ret = shuffle_ref(_seed)
  if G.GAME.modifiers.omicron = true then
    table.sort(self.cards, function (a, b) return a:get_nominal('suit') > b:get_nominal('suit') end )
    self:set_ranks()
  end
  return ret
end
#

the logic behind the hook was that i have to re-sort the table if it's already pre-shuffled when a new pseudoshuffle is called

daring fern
#

Also you should only do it if self == G.deck

crystal perch
#

yeah i was going to considering how i saw immolate also uses it but i just wanted to make sure the hook worked first

daring fern
crystal perch
#

same code just with self, seed

local shuffle_ref = CardArea.shuffle
function CardArea:shuffle(_seed)
  local ret = shuffle_ref(self, _seed)
  if G.GAME.modifiers.omicron = true then
    table.sort(self.cards, function (a, b) return a:get_nominal('suit') > b:get_nominal('suit') end )
    self:set_ranks()
  end
  return ret
end
daring fern
crystal perch
#

this is the code

#

the reason it's calling for main.lua nil val at line 9 is cuz i have a separate hooks file, and line 9 is where it gets loaded

#

oh fuck.

#

yo i'm stupid and tired i forgot to add a second = to the if statement 😭

#

works now thank you

daring fern
crystal perch
#

i have but it doesn't recognise all the custom funcs etc so it just puts errors everywhere

mystic river
# lucid owl wondering how much hell it would be to program the player replaying a specific b...

i have a tag that makes you refight a boss, i patched in a tag calculate check right before the code that ends the round and then the tag sets score to 0 and goes again

GitHub

A mod for Balatro that adds a bunch of things I found amusing. - wingedcatgirl/MintysSillyMod

GitHub

A mod for Balatro that adds a bunch of things I found amusing. - wingedcatgirl/MintysSillyMod

#

so if you wanted a complete refight, you would presumably also reset hands and reshuffle the deck

astral sleet
#

this joker feels too complicated for a common but not strong enough to be anything above that

#

not sure

copper perch
#

would there be somewhere I can find all the code for the vanilla enchantments? Not every calculate function is in the vanilla remake, only what the card would basically do

daring fern
copper perch
#

so some things would only need the config then and no calculate?

copper perch
#

ah

#

so like bonus and mult for example, they have no calculate but they still need their numbers calculated. Would a return only be needed?

#

I guess so cause I have that and it works...weird

hidden mirage
#

cards from G.playing_cards have a nil self?

#

I cant call get seal

daring fern
daring fern
hidden mirage
#
if G.playing_cards then
    for _, playing_card in ipairs(G.playing_cards) do
        if playing_card.get_seal() == "mymod_Orange" then 
            tally = tally + 1 
        end
    end
end```
daring fern
hidden mirage
copper perch
#

also, would there be a way to make a playing card enchantment that cannot be debuffed?

umbral zodiac
#

when you return an effect table in a mods global calculate function, what card is considered to be the one scoring

reef belfry
#

how do you check for a jokers rarity that was added to the deck

umbral zodiac
#

oh

#

strange but thank you

daring fern
daring fern
serene granite
#

is there a way tro detect cards that are played but arent scored? i am trying to find it but cant

wicked leaf
#

can you somehow make hands not reset at the end of round?

#

through a hook or smth

granite jay
#

How do you make a joker detect if you’ve bought something and how much the bought item costed?

reef belfry
daring fern
daring fern
hidden mirage
#

one time a card in G.playing_cards wasnt detected, any ideas why, like it being in final scoring hand or something

wicked leaf
serene granite
wicked leaf
#

is there a wiki I can look at for UI stuff like that?

#

I might haev found one in the smods wiki hgold on

#

I believe I would have to anchor the new UI to the hands/discards

#

and then remove the original UI?

wicked leaf
hidden mirage
#

whats the table for cards still in deck?

daring fern
hidden mirage
wicked leaf
#

what's the variable for the current hands remaining in the round?

daring fern
wicked leaf
#

thanku

copper perch
#

So I have all this code (bottom is the only real important one, supposed to make it so the special cards are not debuffed, yet they are)

calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            local ret = {}
            if SMODS.pseudorandom_probability(card, 'DRY_oddity_luck_mult', 1, card.ability.extra.luck_mult_odds) then
                card.lucky_trigger = true
                ret.mult = card.ability.extra.luck_mult
            end
            if SMODS.pseudorandom_probability(card, 'DRY_oddity_luck_money', 1, card.ability.extra.luck_dollars_odds) then
                card.lucky_trigger = true
                ret.dollars = card.ability.extra.luck_dollars
            end
            return ret
        end
        if context.destroy_card and context.cardarea == G.play and context.destroy_card == card and
            SMODS.pseudorandom_probability(card, 'DRY_oddity', 1, card.ability.extra.glass_odds) then
            card.glass_trigger = true
            return { remove = true }
        end
        if context.debuff_card and context.debuff_card == card then
            return {prevent_debuff = true}
        end
    end,
#

If the cards are made in the boss blind, they're fine. If outside of them, they get debuffed

granite jay
#

How do you make it so the game refers to anything in the misc part when making popups?

#

Like G.P_MISC.g_handfire

wicked leaf
#

how do you stop a blind from appearing in the run?

long sun
wicked leaf
#

is it ease_discard or ease_discards?

#

its ease_discard alright

#

this isnt working for some reason

daring fern
daring fern
wicked leaf
#

wait i misspasted something

#

THIS doesnt work

#

trying to make it give back a discard on discard

daring fern
wicked leaf
#

ohhh got it

#

yeah that works

#

thank you

#

does apply NEED to have an add_event inside?

#

just curious

#

actually doesnt seem like it+

maiden phoenix
#

Not necessary

#

I think I used one for deck manip once iirc

wicked leaf
#

how do you destroy the entire deck?

#

(its for a deck)

daring fern
wicked leaf
#

thank you

#

holo edition is e_holo and red seal is s_red, right?

daring fern
wicked leaf
#

huh

slim ferry
#

seals dont have a prefix

wicked leaf
#

yeah from what I heard seals are just

#

the jankiest thing in the game

slim ferry
#

not really

#

theyre fine code wise

#

(and also i didnt know card.ability.seal existed but shh)

wicked leaf
daring fern
wicked leaf
#

wait shit I might know why?

#

or not

#

let me check smth first

wicked leaf
daring fern
wicked leaf
#

i got no clue what I did wrong

#

ohhh

#

I forgot to return true

#

its not adding the card to the deck

#

and its keeping it on the screen

#

and im tryna figure out why

daring fern
wicked leaf
#

so I suspected

#

thank you yet again

#

ive already added you to my mod's credits because you have helped so much lmao

hidden mirage
#

Do custom global variables (like G.deck.my_mod_var) get saved when you quit to main menu and stuff?

hidden mirage
wicked leaf
#

i suppose youd have to savwe them manually

burnt tide
#

are operations such as square root, cosine, etc. possible?

slim ferry
#

math.sqrt, math.cos

#

theres a lot of mathematical functions that you can use

burnt tide
#

where can i find them ?

slim ferry
burnt tide
#

thanks

real crown
#

How can I add Legendary Jokers to the normal Joker pool?

wicked leaf
#

is there a way to specify a key with context.using_consumeable?

daring fern
wicked leaf
#

thank you

#

this stuff should really be listed on the wiki

daring fern
# wicked leaf

No, it's context.consumeable also you need to check for context.using_consumeable

wicked leaf
#

ohh

#

got it

daring fern
wicked leaf
#

ah

#

ill swap them then

queen meadow
#

yo chat is this possible

#

probably a big ask

umbral spire
#

I don't know why that happens ? I've never worked with blinds yet, maybe some1 else will know.

cunning valley
#

Hello! I'm trying to make a Poker hand that contains an Ace and two 5s, but the game doesn't seem to recognize it when I select the cards. It does appear in the "run info" ui but nothing else, would anyone be able to give a hand here?

umbral spire
#

-# also idk mb

cunning valley
#

Yes the Ass joke is entirely the purpose of the hand type

umbral spire
#

also why dont you use VsCode?

cunning valley
#

I believe I improved the code a little since i completely forgot a section, now it checks for the Ace, and a pair of 5s. However, selecting said cards crashes the game

cunning valley
umbral spire
cunning valley
#

oh thats neat imma get that

umbral spire
#

or is that Visual Studio light mode?

cunning valley
#

nah thats notepad++

umbral spire
frosty rampart
cunning valley
#

oop, well, guess i gotta uninstall visualstudio

#

also hi meta !!

frosty rampart
#

helo

umbral spire
frosty rampart
#

branding

frosty rampart
#

it should yea

umbral spire
#

wdym "it should"

#

have you even used it ;-;

frosty rampart
#

i don't actually use vscodium because i'm not a big enjoyer of IDEs
but vscodium is literally vscode source code with a different json used for the build process

umbral spire
#

i dont see an extensions tab ;-;

frosty rampart
frosty rampart
umbral spire
cunning valley
#

Well, things look much more pleasing now!

But it's still crashing when trying to select the 3 cards (ace + pair of 5s)

#

to be more specific, the game crash mentions that Line 28 attempts to index a nil value

if set[1]:get_id() == 14 and _has14 == false then

(line 28 for reference)

elder rune
#

How do you update a jokers description while still hovering over it

umbral spire
#

uh i dont think thats possible

elder rune
#

misprint does that

cunning valley
#

Oh true

ashen drift
#

misprint returns a node

#

you could do some ui jank if you want

frosty rampart
elder rune
#

okay it seems simple-ish to do now that I checked how Cryptid did it

umbral spire
daring fern
cunning valley
#

Nonetheless, it doesn't crash anymore! But it doesn't register either, it still counts as a Pair

#

This is basically the same problem i've had for the longest time, still puzzles me

ashen drift
#

try setting above_hand?

cunning valley
#

above_hand? is that like a subtable or smth? I'm not too well versed in this type of stuff so im not too sure what that means

#

OH above_hand is the priority of the hand, right

ashen drift
cunning valley
#

Doesn't seem to change anything. Hand order is dependant on the product of chips and mult anyways, and the chips and mult I gave it are higher than the ones of a pair so it would already have priority over them

#

I dont think the issue is the priority, rather that it cant detect the cards for the hand type

cunning valley
cunning valley
#

BAHADVGHJFGHJSG

frosty rampart
ashen drift
#

oh i think this is fucking it up

frosty rampart
#

yea

ashen drift
#

youre checking for a pair and if it has a pair it doesnt register

#

so its killed

frosty rampart
#

you don't need the other_hands check at all because a flush can still contain a pair, and it'll score above an ass so it'll give you a flush not an ass

cunning valley
#

oh bother 🤦‍♂️

frosty rampart
#

and a straight can't contain an ass in the first place

#

unless you give an above_hands, hand order is auto-determined by the hand's base score at level 1

cunning valley
#

Well that sounds like a simple fix! Problem is... still the same issue

#

Cards aren't being detected

#

I'm super grateful for you people's help though, i don't doubt that this is an improvement and I thank yall so much!

#

If anything I'll put this here in the meanwhile if anyone wants to give it a go, i gotta do other stuff related to the mod

ashen drift
#

whats pkr_ass the variable

cunning valley
#

Oh it's the key

#

i think?

ashen drift
#

did you want to return the string

cunning valley
#

I copied it straight from yahimod's jerma poker hand so i'm not entirely sure what it does, all i saw was that it modified the display text and i thought it was necessary for it to... well, display the text

#

If thats what it needs to display text then yeah i want it to return, otherwise i dont know what this would be for

umbral spire
#

how do yall test boosters?

ashen drift
#

cant you just spawn it with debugplus

umbral spire
#

idk

#

can you?

cunning valley
#

You can go to the collection and spawn them in by pressing 3 while hovering over it

umbral spire
#

ohh

#

right

ashen drift
#

i think you can

umbral spire
slim sundial
#

Can someone tell me why this crashes?

cunning valley
#

Pretty sure the ". . ." needs a coma at the end

ashen drift
#

no its fine

#

theres no other value in the table

cunning valley
#

oh true

ashen drift
#

is Tarots.png in assets?

#

also, crash log

slim sundial
slim sundial
ashen drift
#

oh

#

its SMODS.Consumable

#

the function

slim sundial
#

oh

#

thanks

umbral spire
#

why does this crash?

SMODS.Atlas{
    key = 'boosters',
    path = 'boosters.png', 
    px = 71,
    py = 96,
}

SMODS.Booster{
    key = 'booster_jarz',
    group_key = 'jj_jarz_booster_group',
    atlas = 'boosters',
    pos = { x = 0, y = 0 },
    discovered = true,

    loc_txt = {
        name = "Jarz Pack",
        text = {
            "Pick {C:attention}#1#{} card out of",
            "{C:attention}#2#{} {C:attention}Jarz{} jokers!"
        },
        group_name = {''}, -- idk what this is for
    },

    draw_hand = false,

    config = {
        extra = 3,   -- number of cards offered
        choose = 1,  -- number player picks
    },

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

    weight = 1,
    cost = 5,
    kind = "JarzPack",
    select_card = 'jokers',

    create_card = function(self, card, i)
        ease_background_colour(HEX("b48aff")) 
        return SMODS.create_card({
            set = "Jokers",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = true,

            filter = function(center)
                return center.mod and center.mod.id == "JarzMod"
            end
        })
    end,

    in_pool = function(self)
        return true
    end
}
ashen drift
#

send the crash log urggghhg

umbral spire
#

oh mb

ashen drift
#

the set is "Joker"

#

without the s

umbral spire
#

o

#

I always do that 😭

ashen drift
#

2nd

#

i dont think you return an actual card

#

create_card = function(self, card, i)
ease_background_colour(HEX("b48aff"))
return { set = "Joker", area = G.pack_cards, skip_materialize = true, soulable = true}
end,

umbral spire
#

whats the bool 'soulable' for?

queen crescent
#

in a localization file, where do i put this key 😭

elder rune
ashen drift
#

so cards with soul_set can appear

lean whale
queen crescent
slim sundial
#

Can u tell me what the issue is? My code is: SMODS.Consumable({
set = "Celestial",
key = "the_moon",
pos = {
x = 0,
y = 0
},
loc_txt = {
name = "The Moon",
text = {
"..."
}
},
atlas = "Tarots",
cost = 3,
discovered = true
})

lean whale
elder rune
ashen drift
queen crescent
ashen drift
#

hm

elder rune
#

ye

slim sundial
#

How can i do that?

ashen drift
#

wait im stupid i think its another typo

lean whale
#

ah cool I didn't know that

ashen drift
#

set = "Planet"

slim sundial
#

oh ty

lean whale
#

also u need to add the mod prefix

elder rune
ashen drift
#

so it works

umbral spire
#

technically

queen crescent
#

um (its in misc)

umbral spire
queen crescent
#

never forget the prefix

elder rune
ashen drift
#

99% of these issues can be resolved by checking vremade

elder rune
#

true

umbral spire
ashen drift
#

probably

queen crescent
#

i swear if the prefix fixes it

elder rune
#

it is what displays in the collection

umbral spire
queen crescent
elder rune
#

idk what else to say that is what works for me

queen crescent
daring fern
umbral spire
elder rune
#

b_trinket_cards

umbral spire
ashen drift
queen crescent
elder rune
ashen drift
#

ease_background_colour = function(self)
ease_background_colour{new_colour = your color, special_colour = your color 2}
end,

umbral spire
#

oh

tepid crow
ashen drift
#

okay i was wrong you can return a card

umbral spire
umbral spire
elder rune
tepid crow
umbral spire
#

well then, how do i make it filter?

tepid crow
#

good stuff

#

documentation and examples are a chore to read

umbral spire
umbral spire
tepid eagle
#

why isn't my code working

elder rune
elder rune
ashen drift
#

function get_your_mod_card(seed)
    local cards = {}
    for i, v in pairs(G.P_CENTERS) do
        if v.set == "Joker" and G.P_CENTERS[v.key].original_mod.id == "your mod id" then
            cards[#cards+1] = v
        end
    end
    return pseudorandom_element(cards, pseudoseed(seed))
end
-- and then a shit bunch of code
-- in the booster pack func
    create_card = function(self, card, i)
        local c = get_your_mod_card("your seed")
        if c then
            local newCard = SMODS.create_card{
                key = c.key,
                skip_materialize = true
            }
            return newCard
        end
        return {key = "j_joker"}
    end,
tepid eagle
umbral spire
#

will how yahimod does it work?

SMODS.Booster{
    key = 'booster_yahiworld',
    group_key = "k_yahimod_booster_group",
    atlas = 'boosteratlas', 
    pos = { x = 0, y = 0 },
    discovered = true,
    loc_txt= {
        name = 'YAHIMOD BOOSTER PACK',
        text = { "Pick {C:attention}#1#{} card out",
                "{C:attention}#2#{} YAHIMOD jokers!", },
        group_name = {"Pick somethin', will ya?"},
    },
    
    draw_hand = false,
    config = {
        extra = 3,
        choose = 1, 
    },

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

    weight = 1,
    cost = 5,
    kind = "YahiworldPack",
    
    create_card = function(self, card, i)
        ease_background_colour(HEX("ffac00"))
        return SMODS.create_card({
            set = "Yahimodaddition",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = true,
        })
    end,
    select_card = 'jokers',

    in_pool = function() return true end
}
elder rune
ashen drift
elder rune
umbral spire
#

o

tepid eagle
ashen drift
#

its mega jank thoughj

umbral spire
rare torrent
#

came here to ask how to make a custom booster pack with jokers from my mod, and someone is already asking that🙏

ashen drift
lean whale
#

my boss blind icon works in every other context except when I'm in the battle itself, any ideas to why it could be?

elder rune
ashen drift
lean whale
daring fern
lean whale
#

ah

broken rivet
#

is it possible to add a floating sprite layer to a tag

elder rune
#

what

lean whale
#

thx

elder rune
#

legendary tag

umbral spire
ashen drift
#

just put the function def anywhere before the booster call

umbral spire
#

so like:

SMODS.Atlas{
    key = 'boosters',
    path = 'boosters.png', 
    px = 71,
    py = 96,
}


function getCard(seed)
    local cards = {}
    for i, v in pairs(G.P_CENTERS) do
        if v.set == "Joker" and allowed_sets[v.set] and G.P_CENTERS[v.key].original_mod.id == "JarzMod" then
            cards[#cards+1] = v
        end
    end
    return pseudorandom_element(cards, pseudoseed(seed))
end

SMODS.Booster{
    key = 'booster_jarz',
    group_key = 'jj_jarz_booster_group',
    atlas = 'boosters',
    pos = { x = 0, y = 0 },
    discovered = true,

    loc_txt = {
        name = "Jarz Pack",
        text = {
            "Pick {C:attention}#1#{} card out of",
            "{C:attention}#2#{} {C:attention}Jarz{} jokers!"
        },
        group_name = {''}, -- idk what this is for
    },

    draw_hand = false,

    config = {
        extra = 3,   -- number of cards offered
        choose = 1,  -- number player picks
    },

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

    weight = 1,
    cost = 5,
    kind = "JarzPack",
    select_card = 'jokers',

    create_card = function(self, card, i)
        local c = getCard("jarz_mod")
        if c then
            local newCard = SMODS.create_card{
                key = c.key,
                skip_materialize = true
            }
            return newCard
        end
        return {key = "j_joker"}
    end,

    in_pool = function(self)
        return true
    end
}
lean whale
#

as in 34x34 and 68x68?

daring fern
lean whale
#

does the icon fill the whole canvas space or is there a 1px gap

tepid eagle
ashen drift
#

i love this

rare torrent
elder rune
#

should probably give like -1 chips

ashen drift
#

oh yeah i fucked up

#

remove allowed sets

#
function get_your_mod_card(seed)
    local cards = {}
    for i, v in pairs(G.P_CENTERS) do
        if v.set == "Joker" and and G.P_CENTERS[v.key].original_mod and G.P_CENTERS[v.key].original_mod.id == "your mod id" then
            cards[#cards+1] = v
        end
    end
    return pseudorandom_element(cards, pseudoseed(seed))
end
queen crescent
rare torrent
umbral spire
ashen drift
ashen drift
rare torrent
daring fern
tepid eagle
queen crescent
#

i presume consumable loc goes in other = {}, or is it also misc

umbral spire
ashen drift
daring fern
queen crescent
daring fern
ashen drift
#

my point is v is a table right

elder rune
ashen drift
#

oh wait

elder rune
#

nope wait

ashen drift
#

im stupid

rare torrent
ashen drift
#

anyways both should work so im lazy

queen crescent
#

whuh

ashen drift
#

i copied the code elsewhere

elder rune
queen crescent
elder rune
rare torrent
queen crescent
#

this gonna work?

slim ferry
#

for what??

umbral spire
#

still says "Error"
'

slim ferry
rare torrent
umbral spire
#

oh thats what that is for

ashen drift
#

its in the docs guys

slim ferry
ashen drift
#

check the docs

elder rune
umbral spire
ashen drift
#

???

tepid eagle
#

just use dowhatiwant()

umbral spire
rare torrent
# umbral spire ew

cmon as a greek letter myself as well i find it good to check the docs

frosty rampart
# umbral spire ew

with all due respect, checking the docs is an integral skill for modding or software development, and refusing to do it just means you aren't going to get the answers you're looking for

broken rivet
#

ok is it possible to have two object nodes stack on top of each other

umbral spire
ashen drift
umbral spire
#

-# you dont have the pfp

frosty rampart
rare torrent
queen crescent
#

-# or is it the k this time

frosty rampart
elder rune
queen crescent
#

ok

ashen drift
rare torrent
umbral spire
rare torrent
#

oh

#

forgor the .id my bad

broken rivet
umbral spire
ashen drift
#

should work

#

wait

#

no

umbral spire
#

it worked before

ashen drift
#

v.original_mod.id

rare torrent
# umbral spire like?

mine is like this if v.set == "Joker" and v.mod and v.original_mod.id == "omegatro" then

ashen drift
#

be consistent

umbral spire
#

o

umbral spire
rare torrent
#

true

broken rivet
# broken rivet i want the soul crystal to render over the tag here also want to make the soul c...

code

local tgui = Tag.generate_UI
        function Tag:generate_UI(_size, ...)
            if self.key ~= "tag_lem_legendary" then
                return tgui(self, _size, ...)
            else
                _size = _size or 0.8

                local tag_sprite_tab = nil

                local tag_sprite = Sprite(0,0,_size*1,_size*1,G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"], (self.hide_ability) and G.tag_undiscovered.pos or self.pos)
                tag_sprite.T.scale = 1

                local soul_sprite

                if not self.hide_ability then
                    soul_sprite = Sprite(0,0,_size*1,_size*1,G.ASSET_ATLAS[G.P_TAGS[self.key].atlas], {x=1, y=0})
                    soul_sprite.T.scale = 1
                    print("B")
                end

                tag_sprite_tab = {n= G.UIT.C, config={align = "cm", ref_table = self, group = self.tally}, nodes={
                    {n=G.UIT.O, config={w=_size*1,h=_size*1, colour = G.C.BLUE, object = tag_sprite, focus_with_object = true, no_fill = true}},
                    soul_sprite and {n=G.UIT.O, config={w=_size*1,h=_size*1, colour = G.C.BLUE, object = soul_sprite, focus_with_object = true, hover = true, shadow = true}} or nil,
                }}

                for _, sprite in ipairs{tag_sprite, soul_sprite} do
                    sprite:define_draw_steps({
                        {shader = 'dissolve', shadow_height = 0.05},
                        {shader = 'dissolve'},
                    })
                    sprite.float = true
                    sprite.states.hover.can = true
                    sprite.states.drag.can = false
                    sprite.states.collide.can = true
                    sprite.config = {tag = self, force_focus = true}

                    sprite.hover = function(_self)
                        if not G.CONTROLLER.dragging.target or G.CONTROLLER.using_touch then
                            if not _self.hovering and _self.states.visible then
                                _self.hovering = true
                                if _self == tag_sprite then
                                    _self.hover_tilt = 3
                                    _self:juice_up(0.05, 0.02)
                                    play_sound('paper1', math.random()*0.1 + 0.55, 0.42)
                                    play_sound('tarot2', math.random()*0.1 + 0.55, 0.09)
                                end

                                self:get_uibox_table(tag_sprite)
                                _self.config.h_popup =  G.UIDEF.card_h_popup(_self)
                                _self.config.h_popup_config = (_self.T.x > G.ROOM.T.w*0.4) and
                                    {align =  'cl', offset = {x=-0.1,y=0},parent = _self} or
                                    {align =  'cr', offset = {x=0.1,y=0},parent = _self}
                                Node.hover(_self)
                                if _self.children.alert then 
                                    _self.children.alert:remove()
                                    _self.children.alert = nil
                                    if self.key and G.P_TAGS[self.key] then G.P_TAGS[self.key].alerted = true end
                                    G:save_progress()
                                end
                            end
                        end
                    end
                    sprite.stop_hover = function(_self) _self.hovering = false; Node.stop_hover(_self); _self.hover_tilt = 0 end

                    sprite:juice_up()
                end
                self.tag_sprite = tag_sprite
                self.soul_sprite = soul_sprite

                return tag_sprite_tab, tag_sprite
            end
        end
rare torrent
queen crescent
ashen drift
elder rune
ashen drift
#

under api methods

elder rune
#

in the localization

queen crescent
rare torrent
elder rune
ashen drift
#

yeah you run the ease background color function inside the arguement function

queen crescent
#

k_candy is chilling in misc dictionary

rare torrent
ashen drift
#

ease_background_colour is a built in balatro function

elder rune
# queen crescent

okay I checked mine, the consumables are supposed to be under the name of the key of the set

ashen drift
#

its just what balatro takes in

rare torrent
#

ohhhhhhh

ashen drift
#

your color can be HEX("hex code") or something in G.C

elder rune
rare torrent
queen crescent
#

i dont get it 😭

elder rune
ashen drift
#

new_colour = HEX("something")

#

inside the ease bg color func

rare torrent
queen crescent
#

ok so in short; move Candy = {} to below dictionary?

ashen drift
#

no then youd have to set G.C.maybeBLUE

queen crescent
elder rune
rare torrent
elder rune
#

brb gotta C O N S U M E

queen crescent
#

why wouldnt it be

umbral spire
#

boosters are 71x95 right?

ashen drift
#

99.99% of cards are 71 95

daring fern
umbral spire
daring fern
ashen drift
#

i was off by 0.01%

umbral spire
#

how do i make this where it desn't choose legendaries, or does it already not choose legendaries?

function getCard(seed)
    local cards = {}
    for i, v in pairs(G.P_CENTERS) do
        if v.set == "Joker" and v.original_mod and v.original_mod.id == "JarzMod" then
            cards[#cards+1] = v
        end
    end
    return pseudorandom_element(cards, pseudoseed(seed))
end
ashen drift
#

and v.rarity ~= 4

umbral spire
#

like ^?

ashen drift
#

yes

lean whale
#

to create the animation for the boss tags, do I need a specific setup apart from specifying frames?

elder rune
queen crescent
#

well that's done

umbral spire
rare torrent
daring fern
rare torrent
#

just v.rarity ~= "omega_simp" worked, but what about making the jokers not repeat?

#

i openned a pack with 3 of the same joker🙏

umbral spire
#

also will the boosters atuomatically spawn in-shop?

rare torrent
umbral spire
#

oh i forgot 2x, im so stupid

umbral spire
rare torrent
#

🙏

umbral spire
rare torrent
umbral spire
#

o

#

mb typo

rare torrent
umbral spire
#

i see

#

i meant 95 lol

thorn basin
#

small question: how can you add a custom joker into a vanilla-made pool?
I mean that I made a food joker but I'm not sure how to insert it in the pool of food jokers.

frosty rampart
#

there is no food pool in vanilla

thorn basin
#

oh, I thought there was

frosty rampart
#

nope, it's a conceptual set but there's nothing for it code-wise

thorn basin
#

oh aight then lol

rare torrent
tepid eagle
#

holy shit aro ace arrow ace

umbral spire
#

is there a way to download the entire wiki

rare torrent
umbral spire
#

-# also idk

rare torrent
#

but omega is the superior greek letter

umbral spire
#

look at my lazy ah art

umbral spire
rare torrent
umbral spire
#

im not use to (approx.) 64x 😭

#

i usually draw with 16x or 8x, rarely 32x

umbral spire
rare torrent
#

here's some of my other joker (don't ask questions)

umbral spire
#

its so peak

#

what is that 4th one tho 😭

#

are those wheel of fortunes? 😭

rare torrent
umbral spire
#

peak

umbral spire
rare torrent
#

also this is one of my favorites

rare torrent
umbral spire
#

why is your mouse at 4k quality

#

16k*

umbral spire
#

oh lets go

rare torrent
red river
#

which part of game code is responsible for context.from_area and context.to_area? for patching purposes

umbral spire
rare torrent
umbral spire
red river
daring fern
hallow slate
#

Sigma ???

red river
#

oh

red river
lean whale
#

I need help animating the boss blind chip, I added the glimmering and that's working properly, but it also scrolls from one frame to the other like a powerpoint transition (all frames are contained within the same file)

#

bottom one is the file with the frames

hallow slate
#

How would I make a negative sticker

#

Like a sticker that gives an extra slot

sage crater
#

Is there a way to copy a card without it visually appearing?

daring fern
daring fern
sage crater
sage crater
#

kirby

sage crater
daring fern
vale zinc
vale zinc
#

Also, how'd you determine the colors for the gleam effect?

daring fern
vale grove
#

how do i make a joker lose money at the end of the round

hallow slate
daring fern
sage crater
sage crater
#

cool beans

lean whale
#

and that works

#

but it also scrolls

vale zinc
#

Move the little circle-things around such that each 34*34 space contains just one of those circles, without being cut off. Use the Fill tool to specify the space if that helps.

lean whale
#

so no spaces between them?

#

i'll try thx

sage crater
vale zinc
lean whale
#

btw it doesn't show coz I uploaded a screenshot but it's scrolling through them smoothly, if that changes anything

vale grove
#

how do you change the background colors of balatro

lean whale
#

i'll try to fix

vale grove
#

for example instead of blue and red i want greend and orange

#

how would one go about this?

vale zinc
sage crater
#

oh lmao

#

duh

sage crater
lean whale
sage crater
#

also I generally like writing my own code for the sake of learning

#

since I barely understand lua

queen crescent
#

why do i wanna replace the balatro menu theme so much 😭

sage crater
daring fern
sage crater
#

ah, ok

#

in that case,

sage crater
daring fern
sage crater
#

ahh

#

so I'm going to need a table of tables or something

queen crescent
#

-# how tho

sage crater
#

wait, I just noticed this is using a global variable

#

will that work for multiple types of this card in the same hand?

red river
#

so apparently jokers can't see debuffed cards when context.to_area and context.from_area happen, but deck backs can do that(???)

#

i'm trying to implement this jimbo but it doesn't properly trigger on debuffed cards

#

patching in custom context for drawing debuffed cards doesn't work either for some reason

red river
#

i tried that but it doesn't achieve best results

#

i.e. it doesn't trigger when cards are drawn after hand size increase

#

besides, doing it with a context.to_area hook looks more... eye-pleasing, when it works

#

when hand size increases mid-turn, it adds cards to your hand

#

it (usually) triggers context.to_area and context.from_area but not context.hand_drawn

sage crater
#

wait

sage crater
#

it's not doing what I was expecting

#

and I think it's doing something cooler

#

but it's not what I'm looking for

daring fern
daring fern
sage crater
#

ok, so it is doing what I thought it was doing

#

very, very cool

sage crater
# daring fern What are you looking for?
  • it should consume the joker to the right (like ceremonial dagger)
  • then preserve the joker it ate in whatever capacity
  • then pick a joker it ate at random and proc it during context.joker_main
    and then the 1 in 2 chance is just a while loop, so I know how to do that part
daring fern
sage crater
#

yeah

#

if it's possible, I would want Kirby to act as the eaten joker (including if it can scale or give end-of-round benefits) but for now, I just want to get the proof of concept working

daring fern
sage crater
#

ok

#

oh, neat

#

side note: how do you multiplicatively change hand size? Trying to use G.hand here crashed my game

sage crater
#

fire

#

btw, did we lose reaction perms, or am I crazy

sage crater
sage crater
daring fern
sage crater
#

ah ok

sage crater
#

hell yeah

sage crater
daring fern
sage crater
#

ahh

daring fern
#

Cards have the Card metatable, because they are Cards.

sage crater
#

makes sense 😎 👍

#

can you return a table with a bunch of these?

daring fern
sage crater
#

oh, interesting

prisma loom
#

Can someone explain why I cant run Balatro shaders (editions) via GLSL Canvas?

#

I keep getting errors

sage crater
daring fern
sage crater
#

FIRE

#

ok that make so much sense now haha

sage crater
vocal helm
#

Trying to make it so that I have a deck that replaces all Planet/Tarot cards in the shop with the Fool; am I doing this right?

local ccfs = create_card_for_shop
function create_card_for_shop(area)
    local card = ccfs(area)
    if G.GAME.selected_back == "b_j8mod_graph" then
        if card.ability.set == "Tarot" or card.ability.set == "Planet" then
            card:set_ability("c_fool")
        end
    end
    return card
end

(for context, other planets/tarots can show up, I think after rerolling as well. Would I have to hook anything else?)

sage crater
#

good luck

vocal helm
#

i made a similar deck that does a similar thing so I think I'll hook create-card instead

daring fern
#

Also you still can't put cards in other cards.

sage crater
#

wait what

#

so is the limiting factor not metadata?

sage crater
sage crater
daring fern
sage crater
#

:(

lean whale
#

Can i make a joker display a message when it's deleted

daring fern
lean whale
#

thanks

solid salmon
#

how do i make this turn the discarded cards into wrapped cards?

#

(wrapped cards are a custom enhancement)

daring fern
nova sleet
#

new card I made for a Lazy Joker

#

I don't know how I could make it look more like he is asleep

solid salmon
nova sleet
#

hold on this channel for modded card art as well? or solely lua shenanigans

solid salmon
#

its for devs

hardy viper
#

both i suppose

solid salmon
#

so its just modding in general

nova sleet
#

well I do intend on making this for a mod

lean whale
lean whale
nova sleet
#

intending to make it give you +3 or 4 Mult for every empty played card slot when playing a hand

#

so basically early game High Card encouragement

lean whale
#

i'm unsure on how to use it properly

daring fern
nova sleet
#

me when Pareidolia and Ride the Bus

solid salmon
#
SMODS.Joker {
    key = 'festive_joker',
    loc_txt = {
      name = 'Festive Joker',
      text = {'{{C:green}#1# in #2#{} chance to turn discarded cards into wrapped cards}'
            }
   },
   rarity = 3,
   pos = {
      x = 0,
      y = 0
   },
   config = {extra = {odds = 3,}},
   loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'festive_joker')
        return {vars = {numerator,denominator}}
    end,
   cost = 5,
   discovered = true,
   calculate = function (self,card,context)
   if context.discard and context.other_card == card then
        if SMODS.pseudorandom_probability(card, 'festive_joker', 1, card.ability.extra.odds) then
            card:set_ability('m_othe_wrapped')
        end
   end
end,
   atlas = "festive_joker"
   }
SMODS.Atlas {
    key = "festive_joker",
    path = "JokerQ.png",
    px = 71,
    py = 95
}

this is not turning cards into wrapped cards

native bone
#

So how do you use the SMODS.psuedorandom_probability?

#

Im trying to roll a number between 1 and 8

slim ferry
#

SMODS.pseudorandom_probability is only for binary probability rolls

#

use pseudorandom("seed", 1, 8)

native bone
#

Oh, okay.

#

Also, how do you debuff a card until something happens, like the end of an ante?

slim ferry
#

you would have to set a flag on it and then use mod calculate to debuff it and remove the flag after

#

you can also use SMODS.current_mod.set_debuffs or whatever its called for the debuff

lean whale
#

is there a guide on how to use remove_from_deck for different purposes?

slim ferry
#

its just code that runs when removing the card

#

idk how there would be tutorials for that

lean whale
#

hmm idk i'm having issues

#

I want the joker to display a message

#

but I guess that can't happen if the joker is gone

slim ferry
#

return values arent evaluated for remove_from_deck if thats what youre doing

#

you have to use attention_text i think, see how vanillaremade wheel of fortune uses it

red flower
#

SMODS.calculate_effect({message = "text"}, card)

native bone
#

Meh, fuck it, I would just rather Thanos snap the card then debuff it lol, because my ass is lazy

lean whale
red flower
lean whale
#

yay works

#

thanks

#

do u know how to change the time it's displayed for? was it hold?

native bone
#

Is there something that lists all the colors that you can output through G.C?, like G.C.UPGRADE?

lean whale
#

This should be it

slim ferry
#

text styling uses different names and doesnt have access to every colour

native bone
#

Looking through the Balatro source code seems to have answered my questions somewhat

slim ferry
#

also theres G.C.SET and G.C.SECONDARY_SET

#

which both contain the primary and secondary colours for every set respectively

#

except that editions dont have a primary colour for some reason

copper perch
#

I'm not wanting this enchantment to be debuffed ever, but for some reason if the enchantment isnt made in the boss blind then it gets debuffed anyways. If it is, then its fine though

calculate = function(self, card, context)
        if context.debuff_card and context.debuff_card == card then
            return {prevent_debuff = true}
        end
native bone
#

Doesnt Entropy have a thing that makes sure a card can never get debuffed?

copper perch
#

Maybe?? I have no clue what that mod is 😅

#

This enchantment does more than that, but its the only problem I have rn

native bone
#

So how do you check what cards are bought or sold?

frosty dock
#

prevent_debuff from calculation isn't strong enough for what you need

copper perch
#

ahhhh

#

What would I need then??

native bone
frosty dock
#

i think doing that in add_to_deck should work fine, though you'll also want to make sure it doesn't apply after the enhancement is changed

#

SMODS.debuff_card(card, nil, 'source') in remove_from_deck should do for that

copper perch
#

Anything could be filled in for that the 'source' I'm assuming?

frosty dock
#

doesn't even need to be a string

copper perch
#

got it, so could just be a random word and it would work?

frosty dock
frosty dock
copper perch
frosty dock
#

yeah, that removes specifically the debuff effect set from that exact source

#

if you wanted to remove all such effects, there's also SMODS.debuff_card(card, 'reset')

#

tbf this stuff is poorly document and probably needs to be changed at some point

#

it's not even like one of the two systems is vanilla-imposed, they're both just added by smods

copper perch
#

So like this?

if context.add_to_deck then
            SMODS.debuff_card(card, 'prevent_debuff', 'DRY_oddity_debuffing')
        end
        if context.remove_from_deck then
            SMODS.debuff_card(card, nil, 'DRY_oddity_debuffing')
        end
#

They are sadly still debuffed

slim ferry
#

add_to_deck isnt a context

#

its a different function

copper perch
#

oh

#

So I'd wanna do this outside of calculate then?

slim ferry
#

yes

#

the docs are also pretty cool

copper perch
#

So I know I need a new function now, what would be the best thing to put at the front (like calculate has calculate = function(stuff_here)

slim ferry
#

add_to_deck = function(self, card, from_debuff)

#

same for remove_from_deck

copper perch
#

ahhhh, okay

#

still return debuffed

add_to_deck = function(self, card, from_debuff)
            SMODS.debuff_card(card, 'prevent_debuff', 'DRY_oddity_debuffing')
    end,
    remove_from_deck = function(self, card, from_debuff)
            SMODS.debuff_card(card, nil, 'DRY_oddity_debuffing')
    end,
granite jay
#

How do you make a joker check for sold jokers?

willow scroll
#

is it possible to display variables inside a localization file without it being inserted via loc_vars or similar methods

#

i have a slight jank custom object type and i cant be bothered to figure out why loc_vars refuse to work rn

lofty stratus
tepid crow
stone dagger
#

Hello any idea why this is crashing when calling the function? Am I overriding wrong?

local start_run = Game.start_run

function Game:start_run(args)
    start_run(args)

    G.GAME.mtgg_best_hand = nil

end
lofty stratus
#

sorry for bugging ty

slim ferry
#

also setting a variable to nil doesnt really do anything fyi

#

also this could also be done with SMODS.current_mod.reset_game_globals

stone dagger
slim ferry
#

its stored in G.GAME

#

its already tied to the run save

#

so it wont exist outside the run where you set it

stone dagger
copper perch
vale grove
#

@daring fern a while back i asked how realistic it would be for a card to give mult based on the amount of hours someone has on a steam game

#

i remember you asking me if their steam profile was public and stuff and it is

copper perch
#

thats actually such a cool idea, damn

vale grove
#

so how do you convert the time they have on a game to local value

vale grove
#

im making this as a surprise for my friends

#

and one friend LOVES silksong

#

so i wanna represent his love for silksong inthe form of a joker

copper perch
#

awww :)

vale grove
#

i kinda put it off until now because i thought this would be horrendously difficult

elder rune
vale grove
#

its just hard to pull off considering i didnt know a single thing about balatro modding/lua until last month XD

elder rune
vale grove
#

get his hours from steamdb

#

onto a local variable

elder rune
#

hiiiiiii Eris

slim ferry
#

idk if you need steamdb, i know some steam info is directly accessible in the game

#

also hi

elder rune
#

I dont think playtime would be saved in the game though

slim ferry
#

well yeah its not saved in the game

#

as in with your save file

#

but its definitely accessible

stone dagger
#

Hello is there any way to draw a specific card from the deck?

#

I created basically a copy of the smods.draw() with a different argument but that seems not amazing

#
function draw_specific_card(card)
    if not (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and
        G.hand.config.card_limit <= 0 and #G.hand.cards == 0 then 
        G.STATE = G.STATES.GAME_OVER; G.STATE_COMPLETE = false 
        return true
    end

    local hand_space = 1

    local flags = SMODS.calculate_context({drawing_cards = true, amount = hand_space})
    hand_space = math.min(#G.deck.cards, flags.cards_to_draw or hand_space)
    delay(0.3)
    SMODS.drawn_cards = {}
    for i=1, hand_space do --draw cards from deckL
        if G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK then 
            draw_card(G.deck,G.hand, i*100/hand_space,'up', true,card)
        else
            draw_card(G.deck,G.hand, i*100/hand_space,'up', true,card)
        end
    end
    G.E_MANAGER:add_event(Event({
        trigger = 'before',
        delay = 0.4,
        func = function()
            if #SMODS.drawn_cards > 0 then
                SMODS.calculate_context({first_hand_drawn = not G.GAME.current_round.any_hand_drawn and G.GAME.facing_blind,
                                        hand_drawn = G.GAME.facing_blind and SMODS.drawn_cards,
                                        other_drawn = not G.GAME.facing_blind and SMODS.drawn_cards})
                SMODS.drawn_cards = {}
                if G.GAME.facing_blind then G.GAME.current_round.any_hand_drawn = true end
            end
            return true
        end
    }))
end
elder rune
vale grove
elder rune
#

I mean from the code

vale grove
#

wdym?

granite jay
#

Jumpscare

elder rune
#

accessing the steam profile from some code instead

elder rune
vale grove
elder rune
#

well idk

slim ferry
#

okay i thought G.STEAM had info

#

but thats like

#

wierd other shit

#

so idk

#

not sure

elder rune
#

probably some api needs to be used

granite jay
#

Had the same issue lol

vale grove
#

to ask for help

elder rune
#

I guess you could check how vanilla does it

vale grove
slim ferry
#

dont think so

elder rune
slim ferry
#

i mean if anything you can always use SMODS.https

elder rune
#

true

slim ferry
#

because im pretty sure theres at LEAST a way to find what steam profile it is

vale grove
slim ferry
split acorn
#

hey guys im trying to to draw a specific card from the deck. i created this method but it doesnt really seem ideal.

split acorn
#
function draw_specific_card(card)
    if not (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and
        G.hand.config.card_limit <= 0 and #G.hand.cards == 0 then 
        G.STATE = G.STATES.GAME_OVER; G.STATE_COMPLETE = false 
        return true
    end

    local hand_space = 1

    local flags = SMODS.calculate_context({drawing_cards = true, amount = hand_space})
    hand_space = math.min(#G.deck.cards, flags.cards_to_draw or hand_space)
    delay(0.3)
    SMODS.drawn_cards = {}
    for i=1, hand_space do --draw cards from deckL
        if G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK then 
            draw_card(G.deck,G.hand, i*100/hand_space,'up', true,card)
        else
            draw_card(G.deck,G.hand, i*100/hand_space,'up', true,card)
        end
    end
    G.E_MANAGER:add_event(Event({
        trigger = 'before',
        delay = 0.4,
        func = function()
            if #SMODS.drawn_cards > 0 then
                SMODS.calculate_context({first_hand_drawn = not G.GAME.current_round.any_hand_drawn and G.GAME.facing_blind,
                                        hand_drawn = G.GAME.facing_blind and SMODS.drawn_cards,
                                        other_drawn = not G.GAME.facing_blind and SMODS.drawn_cards})
                SMODS.drawn_cards = {}
                if G.GAME.facing_blind then G.GAME.current_round.any_hand_drawn = true end
            end
            return true
        end
    }))
end````
#

thanks btw :3

slim ferry
#

also do NOT store things in the SMODS table

split acorn
#

why not

slim ferry
#

because that has important stuff

split acorn
#

oki doki

#

thanks

slim ferry
#

also the number of drawn cards doesnt need to be global

#

but for drawing a specific card from deck do draw_card(G.deck, G.hand, nil, "up", true, card)

#

you dont need to do all of that

viscid talon
#

hello modding dev i need help

elder rune
#

hi

viscid talon
#
    key = 'orange_deck',
    pos = { x = 0, y = 0 },
    config = {
      hand_size = -3,
        discards = 3,
},
    loc_txt = {
        name = 'Orange Deck',
        text = {
            [1] = '{C:attention}-3{} hand size',
            [2] = '{C:attention}+1{} hand size per Ante',
            [3] = '{C:red}+3{} discards'
        },
    },
    unlocked = true,
    discovered = true,
    no_collection = false,
    atlas = 'CustomDecks',
    calculate = function(self, card, context)
        if context.end_of_round and context.main_eval and context.beat_boss then
            return G.hand:change_size(G.GAME.selected_back.effect.hand_size_value)
        end
  end,
}```

this *mostly* works but its not adding +1 hand size per ante
elder rune
viscid talon
#

good point

#

will edit that rn

#

most of this was done in jokerforge and its weird when it comes to its code

elder rune
#

thats why it obviously doesnt work duhh

viscid talon
#

lemme try it

slim ferry
#

since you arent using a config value for it

viscid talon
#

oke

slim ferry
#

also remove the return

viscid talon
#

what does return do?

#

i always assumed return was like the "then" part to if statements

elder rune
#

return a value to whatever called the function

slim ferry
#

it passes information out of the function

#

and ends the function too

viscid talon
#

oh so its similar to then except it ends it after it finishes transferring the info? interesting :o

slim ferry
#

return is more of its own thing

#

since in lua there is never a point where you arent in a function

unkempt bronze
#

Say, would {display_size.h = h*0.7} work as I think it would? (supposed to be for a random card/joker)

viscid talon
#

ok so on the second ante it increases it by 2 instead of one

#

hmmm

slim ferry
#

thats

#

wierd

#

do you have any jokers that do joker retriggers by any chance

viscid talon
#

yeah, old photograph over there has a 1 in 2 retrigger chance

slim ferry
#

yeah for some reason context.retrigger_joker_check gets run for decks