#💻・modding-dev

1 messages · Page 384 of 1

sleek siren
#

Thank you!! ^^

slow brook
#

Can I add my own localization language that you can turn on in the config and then my jokers have different descriptions from that language?
like
Funny Language: ✅
Joker1Description: funny description :D
Funny Language: ❌
Joker1Description: en-us normal description

wind steppe
#

take ownership and use get_weight(self, weight, object_type)

tall jewel
#
info_queue[#info_queue + 1] = {set = "Other", key = "tl_key", vars = {}}
-- localization file
return {
    descriptions = {
        Other={
            tl_key={
                name="",
                text={
                },
            },
        },
    }
}
gusty iron
hard mica
#

how can i randomize my seal type? so like at the end of the round , it randomizes the seal type etc etc but not sure how rng works with balatro

placid silo
wind steppe
placid silo
hard mica
placid silo
#

oop

#

uhh

hard mica
#

neither set seal

gusty iron
placid silo
#
function randomSelect(table)
    for i = 1, 5 do
        math.random()
    end
    if #table == 0 then
        return nil -- Table is empty
    end
    local randomIndex = math.random(1, #table)
    return table[randomIndex]
end```
hard mica
placid silo
#

my bad

slow brook
#

how do i take the joker name and text from a localization file?

placid silo
#

not a standalone function ;-;

wind steppe
#

then modify get_weight(self, weight, object_type)

gusty iron
#

ah

#

wait how do i access the rarities

wind steppe
#

uhhhh

#

does anybody know the keys to rare and uncommon?

#

i THINK it's just 2 and 3 but dont quote me on that

gusty iron
#

okay so like wait

#

im seeing this code as example:

SMODS.Joker:take_ownership('joker', -- object key (class prefix not required)
    { -- table of properties to change from the existing object
    cost = 5,
    calculate = function(self, card, context)
        -- more on this later
    end
    },
    true -- silent | suppresses mod badge
)
#

what do i replace smods.joker with??

#

smods.rarity?

placid silo
#
SMODS.Joker:take_ownership('joker',
    { -- table of properties to change from the existing object
    rarity = 2 -- uncommon
    calculate = function(self, card, context)
        -- more on this later
    end
    },
    true -- silent | suppresses mod badge
)```
#

maybe this?>

#

if you're trying to change that joker's rarity?

gusty iron
#

im trying to modify rarities themself

placid silo
#

oh uhhhh

gusty iron
#

im adding a stake that makes uncommon and rare jokers 4x more uncommon

wind steppe
#

yeah it'd be SMODS.Rarity

gusty iron
#

then what would i change get_weight to

sleek siren
#

Is there a way I can change the order of my custom rank to be accurate to how big the number actually is?

wind steppe
sleek siren
#

Yes! ^^

placid silo
#

3.1415?

sleek siren
hard mica
#

how can i show the cureent seal effect in my description?

wind steppe
sleek siren
#

Just 3.14, originally it was DOOM's slightly inaccurate approximation, but then I shrunk it

hybrid shadow
wind steppe
placid silo
slow brook
#

umm what would be the type of localization a custom consumable would have? descriptions = { Other } ?

hard mica
magic lava
#

The game crashes when selecting a blind I've disabled all mods and still. I have my mods from balatro mod manager

wind steppe
#

you dont have loc_vars

hard mica
gusty iron
wind steppe
magic lava
magic lava
placid silo
wind steppe
wind steppe
slow brook
placid silo
#

that too

magic lava
tall jewel
hybrid shadow
tall jewel
#

lmao

wind steppe
tall jewel
#

(hes my bf we're modding our own mods respectively)

placid silo
#

i'm not making any mods atm

wind steppe
# magic lava

get rid of everything except lovely and steamodded

hybrid shadow
# hard mica

try self.config.extra.[key] in loc_vars instead

wind steppe
#

frankly id recommend modding manually instead of through a manager

#

you can put half of them back and binary search to find which one's crashing later

lofty sand
#

hey, does anyone know how I would use pseudorandom to instead of making a charm tag, make a random booster pack tag? (standard, charm, meteor, buffoon, or spectral?)

           ``` return {
                remove = to_remove,
                    func = function()
                    for _, _ in ipairs(to_remove) do
                        add_tag(Tag('tag_charm'))
                    end```
magic lava
wind steppe
magic lava
#

ok

wind steppe
wind steppe
gusty iron
placid silo
magic lava
hard mica
#

but question is how can i spawn a card with that seal

slow brook
#

what prefix would a consumable have? like a joker is j_modprefix_jokerkey so what would a consumable have instead of j_

placid silo
#

until it hits the one you want

hard mica
#

but how do i swap it

placid silo
#

Ctrl+ something

#

Hold Tab

#

while in a run

#

should have instructions

wind steppe
daring fern
placid silo
hard mica
#

yeah

daring fern
gusty iron
#

does anyone know the weights for rare and uncommon

hard mica
daring fern
lofty sand
daring fern
wind steppe
#

check wheel of fortune in vanilla remade i think they use it there

hard mica
wind steppe
#

or aura

gilded narwhal
#

gang how would i make a card in the shop always appear with an edition

#

Like I can make it gain an edition when you buy it but thats weird

daring fern
hybrid shadow
#

why is there just a random spam of ❓ reactions

gusty iron
#

would i do ownership like this??

SMODS.Rarity:take_ownership('2', -- object key (class prefix not required)
    { -- table of properties to change from the existing object
    cost = 5,
get_weight = function(self, weight, object_type)
return .75 * .25
end
    },
    true -- silent | suppresses mod badge
)
SMODS.Rarity:take_ownership('3', -- object key (class prefix not required)
    { -- table of properties to change from the existing object
    cost = 5,
get_weight = function(self, weight, object_type)
return .2 * .25
end
    },
    true -- silent | suppresses mod badge
)
daring fern
wind steppe
gusty iron
wind steppe
#

yeah like that

gusty iron
#

i just realized lmao

wind steppe
#

you need indents though

#

i think

#

looks nicer at least

daring fern
wind steppe
#

also remove cost = 5

magic lava
#

installed both of them

#

steammodded and lovely

wind steppe
# magic lava

check file integrity on steam then reinstall steamodded and lovely

gilded narwhal
#

Also what's the code name for the collection

#

like uh

daring fern
gilded narwhal
#

So I can do and not card.area

gusty iron
#

0.9375% of jokers on maroon stake will be common

wind steppe
gilded narwhal
daring fern
# gilded narwhal Yes

Every individual collection page is in G.your_collection, it is not the card area itself though.

gilded narwhal
magic lava
gusty iron
gilded narwhal
#

Which is funny but i don't want it

gusty iron
#

cause i got 3 rare jokers in a row

daring fern
wind steppe
gusty iron
hard mica
#

when im trying to use the card with the seal it just crashes, idk what im douing wrong

wind steppe
gusty iron
#

im making the weights for uncommon 0.05, and rare 0.0125

#

so it cant be that

daring fern
hard mica
daring fern
tall jewel
#

I'm not sure why, but the title/name of the deck isn't getting localized properly

hard mica
daring fern
red flower
#

they're modprefixing the lesbians now?

tall jewel
daring fern
tall jewel
#

sent it already

daring fern
tall jewel
#

SMODS.Back{
    key = "lesbians",
    pos = {x = 1, y = 3},
    loc_vars = function(self, info_queue, card)
    return {
        key = "lesbians",
        set = "Back",
    }
    end,
    apply = function(self)
        G.E_MANAGER:add_event(Event({
            func = function()
                for _, card in ipairs(G.playing_cards) do
                    card:set_ability(G.P_CENTERS["m_hime_himejoshi_lesbian"])
                    assert(SMODS.change_base(card, "Hearts", "Queen"))
                end
                return true
            end
        }))
    end
}
daring fern
hard mica
gusty iron
#
[[patches]]
[patches.pattern]
target = 'blind.lua'
pattern = " elseif self.name == 'The Tooth' then
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2, func = function()
        for i = 1, #G.play.cards do
            G.E_MANAGER:add_event(Event({func = function() G.play.cards[i]:juice_up(); return true end })) 
            ease_dollars(-1)
            delay(0.23)
        end"
position = 'after'
payload = " elseif self.name == 'The Tooth' then
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2, func = function()
        for i = 1, #G.play.cards do
            G.E_MANAGER:add_event(Event({func = function() G.play.cards[i]:juice_up(); return true end })) 
            ease_dollars(1)
            delay(0.23)
        end"
match_indent = true

whats wrong with this patch?

sleek siren
#

How do I make a voucher redeemed on run start?

daring fern
tall jewel
#

Now it shows as nothing whatsoever

#

even without the b_

#

with modid,

daring fern
#

Also the prefix not the mod id.

tall jewel
#

Removing the modprefix when defining the key results in this

tall jewel
#

not sure if thats the proper tl key but

daring fern
magic lava
#

Still have this error when selecting a deck

tall jewel
#

ah I needed to swap b_ and hime

#

b_hime_lesbians

#

i may be stupid

hard mica
slow brook
#

is this writing fire or nah

ivory coral
#

how does one check for a custom consumable type? im using card.config.center.set but it doesnt seem to work when i try to check for the consumable type's key or prefix_key

daring fern
# hard mica yep it ddnt work

Try this instead:

local temp_card = {seal = self.config.extra.SealType, ability = {}}
local usedfunction = Card.calculate_seal
return usedfunction(temp_card, context)
```?
ivory coral
#

actually wait lemme try smth

slow brook
#

how does the game determine what joker comes first in collections tab?

daring fern
slow brook
ivory coral
#

im trying to make a patch to keep track of the last used consumable of a type im adding

#

but i cant get it to correctly check for the type

hard mica
daring fern
ivory coral
ivory coral
# daring fern Yes.

well its not working
honestly even i dont know why
when i eval the card's ability.set it does indeed return the key

daring fern
ivory coral
#

i guess

#

ill try rewriting it

wind steppe
#

does anyone know how i would make a sticker that gives +1 joker slot?

ivory coral
#

im gonna sanity check this thing rq

daring fern
ivory coral
#

guess ill go figure out why

#

ok im stupid i jucked up the path for the file to patch, forgot misc_functions.lua is in its own folder

#

thanks anyway lad @daring fern

gusty iron
#
local pool = {
    "The Hook",
    "The Ox",
    "The House",
    "The Wall",
    "The Wheel",
    "The Arm",
    "The Club",
    "The Fish",
    "The Psychic",
    "The Goad",
    "The Water",
    "The Window",
    "The Manacle",
    "The Eye",
    "The Mouth",
    "The Plant",
    "The Serpent",
    "The Needle",
    "The Head",
    "The Tooth",
    "The Flint",
    "The Mark"
}
local selected = {}
for i = 1, 3 do
table.insert(selected, pseudorandom_element(pool, pseudoseed("fiasco")))
print(selected)
end
#

so its saying that theres

#

a bad argument to table.insert

#

what am i doing wrong??

#

its saying number expected, got string

daring fern
gusty iron
wind steppe
daring fern
# gusty iron yeah

Try table.insert(pool, #pool+1, pseudorandom_element(pool, pseudoseed("fiasco")))

#

I think it's because it doesn't know if what you gave it is a string or a number.

gusty iron
#

i fixed it anyways

#

bu just doing

#

selected[i] = blahblahblah

#

how do i recalculate what cards are debuffed by a boss-blind?

sleek siren
#

How do I redeem a voucher on game start?

#

Or how do I redeem a voucher at all? I was looking through utility and it was just for cards

astral sonnet
#

ive been sitting here for the last 2 and a half hours waiting for a hand to be played/calculated MA_Abyssal is this normal for late game cryptid?

wind steppe
#

i would assume it's a retrigger heavy build

astral sonnet
#

yeah i have like 5-6 blueprints on a chad that is on a mime

tall jewel
#

welcome to cryptid

#

also join the cat tags smh

astral sonnet
#

HOW

#

i didnt know u could

#

and ill try to when it finally gets done calculating

slow brook
#

can i spawn a gif on the middle of the screen when a consumable is used? a consumable moves to the middle of the screen so i want it to spawn right there

sleek cliff
#

is there a way to have 2 different odds?

daring fern
sleek cliff
#

wait ofc there is there's lucky cards lmao

daring fern
sleek siren
slow brook
#

where do i write a localization thing for messages? descriptions = { Other } ?

daring fern
sleek siren
#

Oh!!! Ok! I'll give it a try

wind steppe
#

has anybody here actually worked with stickers before? the documentation is not helping

sleek siren
#

is there anything else I should add to the key?

wind steppe
turbid maple
#

you want negative editions as a sticker?

wind steppe
#

yes

placid silo
#

my game crashed :(

daring fern
# sleek siren Like this?

No, you do lua cardd = SMODS.add_card({set = 'Voucher', key = 'modprefix_key'}) cardd:apply_to_run()?

wind steppe
tall jewel
sleek siren
#

ohhhhh, ok!

tall jewel
placid silo
turbid maple
#

the apply method of the sticker should handle it

tall jewel
#

No3sAlexPout

wind steppe
#
    apply = function(self, card, val)
        G.jokers.config.card_limit = G.jokers.config.card_limit + self.config.extra.card_limit
    end
turbid maple
#

probably have to check when the card itself is removed as well because im sure that the game doesnt bother to unapply the sticker before destroying it

wind steppe
unborn bay
#

don't use self

wind steppe
unborn bay
#

actually wait nvm

#

im stupid

#

hmm

sleek siren
wind steppe
turbid maple
#

did you check how negative editions work

daring fern
turbid maple
#

it should be in cards.lua somewhere

daring fern
#

It’s meant for any card?

sleek siren
#

ahhhh

turbid maple
#

also apply is called for both applying (val is true) and removing the sticker (val is false) so you should check that

wind steppe
daring fern
unborn bay
#

add_card can be used anywhere and not just for jokers specifically

#

that wouldn't really make sense

daring fern
unborn bay
#

just specify the area

wind steppe
#

surely the scammers can do better than that

wheat jewel
#

How can i make a config to allow for players to turn a specific music track off from a joker, i heard making a config file would do it but idk where to start making it

slow brook
#

commynity

wind steppe
#

steamcommynity? really?

sleek siren
wind steppe
#

neither of which really works for stickers

turbid maple
#

hmm

#

it just doesnt do anything?

#

no changes to number of slots?

wind steppe
#

rn i have

    apply = function(self, card, val)
        if val then
            G.jokers.config.card_limit = G.jokers.config.card_limit + self.config.extra.card_limit
        else
            G.jokers.config.card_limit = G.jokers.config.card_limit - self.config.extra.card_limit
        end
    end
hybrid shadow
wind steppe
#

but this
1: makes the sticker disappear for some reason
2: increases slots whenever a joker with this sticker would be spawned (in a booster pack of 3 jokers with this sticker, +3 joker slots permanently)

slow brook
#

where do i write messages in en-us.lua? in Other? and how do i use them in a Joker?

hybrid shadow
slow brook
turbid maple
daring fern
slow brook
turbid maple
#
  1. oh yeah wait youre right huh
#

i should look back at my implementation but im not home

#

you might have to hook add_to_deck and remove_from_deck or whatever they were called instead

#

and apply only explicitly checks if card is in already in your joker area and a sticker gets added to it somehow

hybrid shadow
#

btw to anyone whose done this before would this work as intended (using the number of unscored cards to decide how strong the ability of the joker is) or do i need to move the math that decides what the variable is to the outside of the return

wheat jewel
wind steppe
sleek cliff
#

i don't think this is right...

wind steppe
#

one of these is not like the other

wheat jewel
sleek cliff
#

no i mean-

wind steppe
#

literally anything besides cryptid

#

it is not coded well

sleek cliff
#

this is the code, it also triggers multiple times when I want it once

wind steppe
sleek cliff
#

so put set.cardarea?

slow brook
daring fern
sleek cliff
#

maybe because im selling the joker it's spawning in the joker area???

daring fern
wind steppe
placid star
#

crashes when trying to load the deck

sleek cliff
daring fern
sleek cliff
#

o?

daring fern
placid star
#

ahh

sleek cliff
daring fern
sleek cliff
#

like this?

lucid owl
#

absolute noob to shaders here, are shaders very hard to code?

lucid owl
daring fern
sleek cliff
#

oki

pulsar furnace
#

how do i make a deck with less cards

daring fern
pulsar furnace
#

ik apply

#

but how i remove them

daring fern
pulsar furnace
#

and also how do i use randomness, do i just use math.random? or something else

hidden notch
#

What is the function to hide and show these elements?
[Hide "Play Hand" or "Discard"]
I've looked at the code for a while and I can't really figure out what I need to call to make it happen

Edit: Figured it out!
You need to set the "G.STATE" to either "G.STATES.HAND_PLAYED" or "G.STATES.DRAW_TO_HAND"
You need to set it back to "SELECTING_HAND" at a later time, It's also important to set the "G.STATE_COMPLETE" to true and later to "false" again!
It's best to check out the "state_events.lua" => G.FUNCS.play_cards_from_highlighted

wind steppe
#

does anyone know why buying a joker with this sticker decreases instead of increases the joker slots?

#

ive hooked remove_from_deck and add_to_deck

#
local para_card_removal_old = Card.remove_from_deck
local para_card_addition_old = Card.add_to_deck
Card.remove_from_deck = function(self, card, from_debuff)
     if self.ability.para_negativesticker then
         G.jokers.config.card_limit = G.jokers.config.card_limit - 1
    end
    return para_card_removal_old(self, card, from_debuff)
end
Card.add_to_deck = function(self, card, from_debuff)
     if self.ability.para_negativesticker then
         G.jokers.config.card_limit = G.jokers.config.card_limit + 1
    end
    return para_card_addition_old(self, card, from_debuff)
end
analog spoke
#

does anyone have a link to the thread in #1209506514763522108 for public art resources made by devs I lost it 💀 sorry lmao

#

I made something I wanted to put in there lol

wild escarp
#

I know next to nothing about hooking, but how would this be for tracking played hands in a round?

local SMODS_calculate_context_ref = SMODS.calculate_context
function SMODS.calculate_context(context, return_table)
    if context.before and context.main_eval then
        G.GAME.willatro_played_hands[#G.GAME.willatro_played_hands + 1] = G.GAME.hands[context.scoring_name].played
    end
    return SMODS_calculate_context_ref(context, return_table)
end
wintry solar
#

doesn't the game already track played hands?

wild escarp
#

I want it to track just within an ante, resetting afterwards. not sure if there's another way to do that.

pulsar furnace
#

how do i use pseudorandom()?

pure salmon
#

is there a way for me to do the joker effect "earns $2 when a card is retriggered"?

#

my first thought is to do a hook but i'm not all too familiar with those

wheat jewel
#

Anyone know of a way to configure music playing for a specific joker that isn't jimball

#

i can't seem to find any other examples that do so

#

like where you cang go to the mod config and do so

#

because i can't understand how cryptid does it even by looking into the code

sleek cliff
#

im going to explode, bro

red flower
# pulsar furnace how do i use pseudorandom()?

pseudorandom("seed") gives you a number between 0 and 1
pseudorandom("seed", min, max) gives you an integer between min and max
pseudorandom_element(table, pseudoseed("seed")) gives you the pair value, index of a random element in an array

maiden phoenix
sleek cliff
pulsar furnace
#

why this doesnt work, just deletes all cards (im new to modding)

sleek cliff
#

using center also crashes sometimes

red flower
# sleek cliff

please use loc_vars = function(self, info_queue, card)

harsh sonnet
#

what do i even do at this point

img 2 shows my poorly written code that i believe contains the point of issue

pulsar furnace
#

how do i make a if .... with 50% chance

#

i tried but idk

red flower
#

if pseudorandom("seed") < G.GAME.probabilities.normal/2 then

gusty iron
#

...i think i broke soemthing...

clear yoke
umbral zodiac
gusty iron
#

how do i fix this 😭

#
 apply = function(self)
                G.E_MANAGER:add_event(Event({
            func = function()
                for k, v in pairs(G.playing_cards) do
                    local _card = copy_card(v, nil, nil, G.playing_card)
                    _card:add_to_deck()
                end
            return true
            end
        }))
umbral zodiac
#

i think you didnt emplace it in the hand

gusty iron
#

how do i do that

umbral zodiac
#

i think G.hand:emplace(_card)

#

i dont remember if its G.hand or something else for the card area

gusty iron
umbral zodiac
#

well, it went in your hand
nobody said it had to be in the round to work!

gusty iron
#

im trying to put it in the deck

#

not the hand

umbral zodiac
#

ah

#

i actually dont know about that since i've never used the deck for things like this
i rarely touch playing cards anyway

gusty iron
#

so uh

any help

red flower
#

try G.deck?

gusty iron
#

it does go into it, but it doesnt show up in the deck ui

umbral zodiac
#

mmm
anyone know if rarities you create spawn naturally in the shop by default or not?

gusty iron
red flower
umbral zodiac
#

when in doubt go check like cryptid code or something

red flower
#

(the card)

harsh sonnet
#

i was in doubt
checked cryptid mod code
cried myself to sleep

umbral zodiac
# red flower (the card)

oops
regardless cryptid still is a very good source and also the spectral card does only create copies into hand, no?

red flower
#

yes but it does a couple more things when it copies that are probably what makes it show up in deck

#

also I disagree on the cryptid (the mod) part

umbral zodiac
#

idk ive found it relatively simple so far to just go off my own intuition plus checking cryptid & examplemod code when i am stuck

sleek cliff
red flower
#

well it's not in your code

#

that error is usually when you try to create a card with the wrong key

sleek cliff
#

i see

sleek siren
#

How can I make replace_base_card still draw the base card sprite?

sleek cliff
#

Ok, we got SOMETHING

#

could I do an or with the keys?

red flower
#

wdym

sleek cliff
#

like key = 'c_whatever' or 'c_whatever

red flower
#

no

#

use psudorandom_element

gusty iron
#

OH HELLO

lofty sand
#

yo this joker should only be creating one tag per card destroyed, but for some reason every card destroyed creates a tag equal to the amount of cards destroyed, anyone know what could be happening here? here's my calculate:

        if context.first_hand_drawn then
            local eval = function() return G.GAME.current_round.discards_used == 0 and not G.RESET_JIGGLES end
            juice_card_until(card, eval, true)
        end
        if context.discard and not context.blueprint and G.GAME.current_round.discards_used <= 0 and context.full_hand then
            local to_remove = {}
            for _, c in ipairs(context.full_hand) do
                if c.seal then
                    table.insert(to_remove, c)
                end
            end
                if #to_remove > 0 then
                    local possible_tags = {'tag_standard', 'tag_charm', 'tag_meteor', 'tag_buffoon', 'tag_ethereal'}
                    return {
                        func = function()
                            for i = 1, #to_remove do
                                local tag_key = possible_tags[math.random(#possible_tags)]
                                add_tag(Tag(tag_key))
                            end
                            play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
                            play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
                            return true
                        end
                    }
                end
        end
    end,```
red flower
#

context.discard is called once per card

wheat jewel
#

does anyone have an example code of how to configure a song to play in a mod config menu

#

i tried to reference cryptid but i cannot understand how it's coded

gusty iron
#

how do i allow spaces, commas, and other things in textboxes?

zealous glen
#

You type them

gusty iron
red flower
#

type them harder

#

(bepis had to deal with those recently maybe ask him)

wheat jewel
#

if i want to reference my config file, what should i use because i keep getting crashes here

gusty iron
#
        if deck == "red" then
            G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1
            ease_discard(1)
        end
``` this doesnt save between runs
wheat jewel
#

lemme add more info

red flower
#

at the beginning of your code do sizi.config = SMODS.current_mod.config

lofty sand
red flower
wheat jewel
lofty sand
red flower
#

yes it will be inconsistent with the seed

lofty sand
#

got it, okay

wheat jewel
red flower
sleek cliff
#

idk why this isn't working but another one with the same exact line does work

red flower
gusty iron
sleek cliff
wheat jewel
red flower
red flower
sleek cliff
red flower
sleek cliff
#

oh

rapid stag
#

so question - the game differentiates between whether the hovered thing is a joker, consumable and with steamodded, a playing card for the negative tooltip.

how can i implement this for say, red seal?

gusty iron
#

uh

#

can i get some help?

sleek cliff
#

It just that its triggering them all, but I doubt there would be a run where you have several Chaplets

red flower
red flower
gusty iron
#

both

red flower
#

between reloads it is G.GAME
but between runs you need to save to the profile

#

i dont remember the syntax for that

gusty iron
#

OH

#

SO APPARENTLY

#

IT SAVES AFTER YOU BEAT 1 ROUND??

red flower
#

the game saves after specific actions

#

if that's what you mean

gusty iron
#

yeah cause what im doing is

#

im checking for red

#

and adding one discard via G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1
ease_discard(1)

red flower
#

yeah it's not going to be saved until the game saves

gusty iron
#

okay time to see if

#

my fusion deck works

#

i added blue and yellow

#

OH HELLO

#

okay now uh

#

green will be a bit hard to impliment

#

wheres the code for green deck??

rapid stag
worthy stirrup
#

hello! How would i call for the color from JimboGrad?
self is needed here btw :3

SMODS.Gradient {
  key = "JimboGrad",
  colours = {},
  cycle = 10,
  interpolation = 'trig'
}

  update = function(self, dt)
    self.boss_colour = ???
  end
red flower
#

it does for jokers

wind steppe
#

why does this only decrease my joker slots instead of increasing? (the sticker only appears on jokers in a booster pack of 3 items where you pick 1)

local para_card_removal_old = Card.remove_from_deck
local para_card_addition_old = Card.add_to_deck
Card.remove_from_deck = function(self, card, from_debuff)
     if self.ability.para_negativesticker then
         G.jokers.config.card_limit = G.jokers.config.card_limit - 1
    end
    return para_card_removal_old(self, card, from_debuff)
end
Card.add_to_deck = function(self, card, from_debuff)
     if self.ability.para_negativesticker then
         G.jokers.config.card_limit = G.jokers.config.card_limit + 1
    end
    return para_card_addition_old(self, card, from_debuff)
end
#

i think it's because when the boosterpack is closed the 2 cards i didnt pick are "removed" but i dont know if im missing something

red flower
wind steppe
#

and i also dunno how to fix that

worthy stirrup
manic rune
#

how do i use main_end in loc vars :p

#

is it documented anywhere

red flower
rapid stag
red flower
manic rune
#

thanks, lemme check if i still have vanillaremade github link

red flower
wind steppe
#

skipping the pack reduces slots by 3

#

how do i check where a joker is when it's removed?

manic rune
#

a

#

no i dont

worthy stirrup
#

Wait, is update(self, dt) called every frame?

manic rune
red flower
gusty iron
#

how do i give the player a voucher from the get-go?

worthy stirrup
#

hm, it doesnt seem to be updating my thing

wind steppe
red flower
#

G.pack_cards

red flower
gusty iron
unborn bay
#

i mean dt is just straight 0

red flower
wind steppe
#

why does my function hook not remove a joker slot when the joker is sold?

local para_card_removal_old = Card.remove_from_deck
local para_card_addition_old = Card.add_to_deck
Card.remove_from_deck = function(self, card, from_debuff)
     if self.ability.para_negativesticker and not self.area == G.pack_cards then
         G.jokers.config.card_limit = G.jokers.config.card_limit - 1
    end
    return para_card_removal_old(self, card, from_debuff)
end
Card.add_to_deck = function(self, card, from_debuff)
     if self.ability.para_negativesticker then
         G.jokers.config.card_limit = G.jokers.config.card_limit + 1
    end
    return para_card_addition_old(self, card, from_debuff)
end
unborn bay
#

hi n

gusty iron
gusty iron
#

its in the apply function rn

#

because you have to CHOOSE 3 decks

red flower
gusty iron
#

(ex: typing in red1blue1yellow would combine red, blue, and yellow deck respectively)

red flower
gusty iron
#

found it

#

whats the key for crystal ball

red flower
#

v_crystal_ball

gusty iron
#

my code is messy, suffer >:)

red flower
#

im not the one that needs to read it all the time

gusty iron
#

yeah but some people get really disgusted at seeing i code in notepad

red flower
#

yeah that includes me

wind steppe
gusty iron
#

OH GOD

#

WHAT THE FUCK

wind steppe
gusty iron
#

EVERYTHINGS BLUE

worthy stirrup
#

where do i begin with making a little area to show stuff, like the card area?

wind steppe
gusty iron
red flower
worthy stirrup
#

just, like the basics of where to start

red flower
gusty iron
#

magic, checkered, and black work :)

red flower
#

because G.pack_cards is nil when not in the booster

#

no, that's not it

#

not a == b is almost always false == b

wind steppe
#

oh

#

parentheses issues

red flower
#

use a ~= b

rapid stag
#

how on earth do i take ownership of a red seal? neither SMODS.Seal:take_ownership('red'... nor SMODS.Seal:take_ownership('red_seal'... work

red flower
#

the key is Red

wheat pulsar
#

hey one question, im learning now how to make blinds and i want to recreate psychic but with 4 cards, but idk whats wrong

wind steppe
#

condition is self.ability.para_negativesticker and self.area ~= G.pack_cards

red flower
#

try the other thing

#

check if G.pack_cards exists

wind steppe
#

wouldn't that have the same issue if i sold it in another booster pack (like an arcana pack)?

rapid stag
red flower
red flower
#

it does that for tooltips

gusty iron
#

what are the keys for planet and tarot merchant?

red flower
#

search them in the localization files

wind steppe
red flower
#

try self.ability.para_negativesticker and (not self.area or not G.pack_cards or (self.area ~= G.pack_cards))

#

that should work i think but if that has the problem where leaving a booster decreases again then that means self.area is removed before remove_from_deck

wind steppe
#

no that works

#

ty

rapid stag
#

...wait, wtf? cirLost i'm looking at common_events.lua and i'm wondering if the decision to add tooltips for editions and seals is based on the badges the card has?

red flower
#

what function is it?

rapid stag
#

generate_card_ui

red flower
#

It seems like it

hasty mist
#

how do i make it so a joker only appears in the pool when a certain hand has been played?

wintry basin
#

talisman was the mod that made yggdrasil hard crash

red flower
hasty mist
#

tysmm

elfin stratus
#

hello

digital sun
#

im makin a tarot card and i want to make it so when you use the tarot card you get a $1 increase in reward money from blinds
whats the best way of doing this

elfin stratus
#

heres where i ask how to mod the game?

red flower
#

yes

elfin stratus
#

like make mods

red flower
#

yes

elfin stratus
#

how do i get started

#

i want to make custom jokers

#

i only know the game is written in lua

sleek cliff
#

So, I've been testing the Dodo Chaplet card, every time I spawn it, it creates 50 base events and I cannot figure out why

red flower
elfin stratus
#

alright

#

thanks

hasty mist
#

ive got a timer that increments every second from the beginning of the game, is there a way i could reset the timer to 0 under a certain condition and still have it increment afterwards?

red flower
#

have a variable that holds the current time, that's your time 0, and when you want to check the current timer you do getTime() - variable

sleek cliff
hasty mist
#

but i think ive done it incorrectly

red flower
#

but that looks correct

hasty mist
#

wait

#

i forgot the calculate function hold on

red flower
#

the logic makes sense to me, you just need to have ast.idle as the last time they clicked

#

and check if anticheat > 60

hasty mist
#

so like this?

hasty mist
red flower
hasty mist
#

huh why

#

thats the function setting the anticheat to true

#

unless im missing something

#

ohh wait

#

i see

#

nvm nvm

red flower
#

you need to set ast.idle = getTime() there

hasty mist
red flower
#

no but context doesn't exist in update

hasty mist
#

ah

#

fuck

#

alright then

red flower
#

also update doesn't run in main menu

#

so it doesn't matter

hasty mist
#

the joker increments in the main menu

red flower
#

oh yeah because you get the time

#

well idle takes care of that

hasty mist
#

so this is how i should do it?

red flower
hasty mist
#

ah 😭

sleek siren
#

I'm facing a strange problem, apply_to_run doesn't seem to work with vouchers without cryptid, but works when I have cryptid?

does someone know a fix to this?

hasty mist
#

ok i did this very wrong

maiden phoenix
#

If you mean vouchers don't show up in your deck, you can init them in the config table like Zodiac Deck does it here config = {vouchers = {'v_tarot_merchant','v_planet_merchant', 'v_overstock_norm'}}

sleek siren
maiden phoenix
#

Yes

sleek siren
#

Oh! Ok! ^^

#

Thank you!

maiden phoenix
#

G.FUNCS.use_card works too but it might have weird behavior

hasty mist
#

this is broken, what did i do wrong? when the timer hits 60 seconds it instantly becomes -120, regardless of whether or not i clicked

maiden phoenix
#

Especially if gotten during booster packs

digital sun
red flower
hasty mist
red flower
#

does it happen tho

hasty mist
#

i dont think so

red flower
#

try printing something

faint urchin
#

This might be a bit confusing so lmk if I need to clarify but I have a card that triggers when a two pair of face cards is triggered, but the way I have it written right now a hand like (KH KH QH QH 3H) wouldn't trigger even though it is supposed to. So is there a way to specifically get the cards that are in the two pair or is there a better way to do this?

hasty mist
#

which is weird because its always worked before

#

WAIT

#

i know why

#

it's cry_press

sleek siren
hasty mist
#

not cry_click

#

either way it still goes into the negatives instantly whenever the anticheat is true

#

which isnt supposed to happen

maiden phoenix
#

or card.cost = 0

#

with card:set_cost() afterward

red flower
hasty mist
faint urchin
red flower
wheat jewel
#

I'm trying to make the config menu show options to turn music for a joker on or off but it isn't working

#

anyone have any idea what's going on?

red flower
faint urchin
#

ok got it, thank you

manic rune
#

how can this be nil???

#

sob

sleek cliff
red flower
manic rune
#

its a lua thing

#

actually, is it

#

i never defined it

#

im gonna cry if its from a mod 😭

#

a lot of mods use table.contains

#

so im pretty sure its a lua thing

red flower
# sleek cliff eeeeugh

i assume you replace all center with card but card.children.center is what you want there

manic rune
#

is it because

#

a mod fucked up table.contains or something

#

🤔

sleek cliff
#

there we go, much better

red flower
manic rune
#

wha

#

but even malverk uses it...

red flower
#

does it define it

manic rune
#

oh wait nevermind

#

seals on everything defines it

#

:3

#

and malverk too

#

bleh

#

thought it was a lua thing

#

im honestly very surprised that its only reported now

#

sob

red flower
#

everyone uses malverk lol

manic rune
#

true

wind steppe
#

how do i add a tooltip to a joker?

red flower
#

info_queue

rapid stag
#

how can i make a joker debuff itself in a way that will be removed after the blind is over, but still retain that state if the run were quit out of and loaded?

#

i've used SMODS.debuff_card() before, but i don't know that it serves my purpose? cirLost

red flower
#

the way i would do it is use SMODS.debuff_card and then hook SMODS.calculate_context to rebuff all of those jokers at end of round

sleek cliff
#

what would be the context of beating a boss blind?

rapid stag
#

yeah a quick test of SMODS.debuff_card() proves my suspicion that any cards you debuff that way don't auto undebuff when the blind's over

red flower
#

yeah they don't

red flower
glossy hill
#

is there a way to completely disable animations? I'm running game speed 1000, but it is still too slow

wind steppe
#

if it's scoring animations talisman does that

sleek siren
#

How can I check if a playing card has no enhancements?

red flower
#

not next(SMODS.get_enhancements(card))

sleek siren
#

Thanks! ^^

glossy hill
wind steppe
#

turn on "disable scoring animations"

#

profit

hasty mist
#

why am i getting a compare table with number crash on this

#

no matter if i to_big the numbers or not

#

it still crashes

red flower
#

what's arrows

hasty mist
#

arbitrary operators

red flower
#

can i see the config

hasty mist
manic rune
hasty mist
#

-1 basically means addition

manic rune
#

to_big(300) is a table

#

card.ability.extra.arrows is still a number

hasty mist
manic rune
#

you want to use to_big(card.ability.extra.arrows) too

hasty mist
#

ohhhh

#

that would make sense

mystic river
#

does anyone know how to get the on-screen location of a joker
ideally the center of the sprite

shut crater
#

I think that's card.T.x and card.T.y but this is from memory

sleek cliff
#

here we go again

red flower
#

Spectral uppercase

sleek cliff
#

ah

shadow perch
#

anybody have a clue what the problem here is?

wild escarp
#

Can someone help me out with this? I'm trying to track any hands not played at the end of an ante so I can level them up, and I don't have a hot clue what I'm doing.

local SMODS_calculate_context_ref = SMODS.calculate_context
function SMODS.calculate_context(context, return_table)
    local played_hands = {}
    if context.before and context.main_eval then
        played_hands[#played_hands + 1] = G.GAME.hands[context.scoring_name].played
    end
    return SMODS_calculate_context_ref(context, return_table)
end
red flower
#

you want to make it a variable in G.GAME instead of a local

wild escarp
#

And would I want this in with my other SMODS.calculate_context, or is it better to have two?

red flower
#

both work the same, it depends on how you want to organize it

glass scaffold
shadow perch
glass scaffold
#

If it's the Deck Creator mod I think you're using, they did something weird with how the files are arranged.

shadow perch
#

The strange thing is that I was unaware that I had a mod like that.

glass scaffold
shadow perch
shadow perch
glass scaffold
#

I might deduce it from that alone.

shadow perch
glass scaffold
#

Why do you have .Lua files with your mods?

#

Try removing those files first

shadow perch
#

adjusted modlist^

wild escarp
#

Now with this code I get a crash, line 339 is the first line here.

calculate = function(self, card, context)
    if context.end_of_round and context.main_eval and G.GAME.blind.boss then
        if #G.GAME.willatro_played_hands then
            return {
                level_up = true,
                message = 'Level Up!'
            }
        end
    end
end

local SMODS_calculate_context_ref = SMODS.calculate_context
function SMODS.calculate_context(context, return_table)
    if context.before and context.main_eval then
        G.GAME.willatro_played_hands[#G.GAME.willatro_played_hands + 1] = G.GAME.hands[context.scoring_name].played
    end
    return SMODS_calculate_context_ref(context, return_table)
end
glass scaffold
shadow perch
#

I found Util.lua

#

Got rid of the mod that contained it and got this instead.

#

I can just delete the mods that cause errors until it works, but I have a feeling that all of them might end up needing to be deleted

wild escarp
#

Yeah, probably just completely reinstall your mods.

shadow perch
#

Reinstalled the initial mod that was causing an error and it still gave the same error

hasty mist
#

this has been driving me insane for days

#

what is wrong here?

#

crashes upon hover

manic rune
#

have u tried starting a new run

hasty mist
#

yes

shadow perch
modern kindle
#

that was alot fo text

wheat jewel
#

i'm trying to make a joker give money but it keeps crashing at line 802

shadow perch
#

Won't let me copy and paste it like normal

glass scaffold
glass scaffold
# shadow perch I do not

Set it as one. That DLL gets commonly flagged as an injector for a virus, thus Windows stops it from working.

#

(Thanks, Windows. Very cool)

shadow perch
#

and it still won't copy the crash log as a .txt file

glass scaffold
shadow perch
glass scaffold
shadow perch
glass scaffold
mystic river
#

a quick search of the source is suggesting G.CURSOR.T
i'm going to try that

#

hmm. this somewhat works, but card.T and G.CURSOR.T aren't using the same coordinate system

grand sage
#

how do i properly format the suits so that they are seperate as i am currently getting an error

wheat jewel
#

i'm trying to make an econ joker but it keeps crashing when I try to make it give money at line 804

#

can anyone help me understand why it crashes?

sleek cliff
#

Idk why it is printing nil

daring fern
wheat jewel
#

i keep getting an error at line where it says the value of dollars is nil

wheat jewel
#

lemme uhh

#

put the line numbers

daring fern
wheat jewel
sleek cliff
daring fern
hasty mist
#

does smods have a server?

#

or some forum of discussion

slow brook
#

It’s somewhere here

#

scroll a bit down and it’s in the second message

hasty mist
#

ty

sleek cliff
#

yes it would cool

slow brook
# sleek cliff

couldn’t you just do it inside the event right before returning true?

sleek cliff
#

maybe idk lol

slow brook
#

if it works it works right

daring fern
sleek cliff
slow brook
slow brook
umbral zodiac
#

is there a way to just change a joker into another joker
trying to make a consumable that replaces all instances of one joker type with its corresponding other type

umbral zodiac
#

that being.?

slow brook
#

if you want to change it to a vanilla joker you dont put anything into modprefix

umbral zodiac
#

oh thats what set ability does

#

interesting ty

daring fern
misty shoal
#

probably a better question for here, does this feel balanced?

slow brook
manic rune
#

abilty :3

daring fern
manic rune
slow brook
mystic river
wise walrus
#

I'll look over alternate ways to code this in the morning (its 1am lol), but is there a specific reason why this is running 4x times rather than once? I'm trying to have it so when the 'Wicked' card is drawn to hand it does -1 discard and discards your entire hand

hasty mist
#

i feel like im going insane here

#

what's wrong?

slow brook
#

and it takes 4 discards at once because it probably calculates it all before actually doing all animations

daring fern
wise walrus
#

Even before implementing the discard I used a print line and it did it 4 times rather than once

hasty mist
slow brook
hasty mist
#

this joker is such a pain in the neck

#

oh my god

#

the typo

wise walrus
misty shoal
#

is the github wiki the best place for info on smods because I swear I can never find some basic info on things here

slow brook
slow brook
misty shoal
mystic river
#

there's unfortunately a fair amount of stuff that isn't documented yet, or documented well
people are working on that but it's slow going

slow brook
misty shoal
#

1 year into a bachelors of compsci I can program A CLOWN CARD BY MYSELF

slow brook
shut crater
misty shoal
shut crater
misty shoal
shut crater
#

I hear the Cryptid mod has kinda done everything

#

But I have not played it nor have I really looked at it so I cannot confirm

misty shoal
#

yeah I bet it'd be a good resource but I haven't played it

shut crater
#

This is certainly the best modding experience I've had though, easier to jump in with balatro

misty shoal
#

oh definitely

slow brook
slow brook
lofty sand
#

anyone know if/how I could make a joker remove the selection limit in booster packs?

daring fern
shut crater
#

anything is possible but that sounds wild

lofty sand
lofty sand
shut crater
#

the red card synergy goes crazy

lofty sand
#

that was the idea lol

shut crater
frosty rampart
#

there's a joker in polterworx that does exactly that iirc

shut crater
#

sounds like it will almost definitely require a patch

daring fern
lofty sand
# shut crater bit of both

I have another joker that destroys cards with seals and makes booster tags from those, I thought it would be REALLY funny to get that, this one, and red card

lofty sand
frosty rampart
runic pecan
#

How do I run a context through a playing card (the calculate functions of Stickers, Seal, Edition, and Enhancement on that card)?

lofty sand
#

also is polterworx new alminac or smth?

daring fern
lofty sand
#

neat, wacky mod

daring fern
frosty rampart
#

yea it's that one

lofty sand
#

that sounds like the one

#

I couldn't find it at first, I thought I was getting it confused with almanac

#

and then I realized

misty shoal
#

Making my prized slug worth a joker could be cool..

shut crater
shut crater
#

Wait it says played cards earn

#

But then when scored

#

So probably it should be worded scoring cards

misty shoal
#

I see what you mean

runic pecan
#

Which page in smods wiki has the guide of SMODS.calculate_context?

misty shoal
#

I think

runic pecan
misty shoal
#

ah

daring fern
runic pecan
daring fern
runic pecan
#

Does find_joker include debuffed joker?

daring fern
timid star
#

does someone know why it don't show my high contrast atlas

#

yeah im doing a generic nothing suit

daring fern
timid star
daring heron
#

I dont think that’s the atlas

timid star
#

i used a function to auto generate atlases for me

daring fern
# timid star

No, I meant how did you define it compared to the low contrast one.

timid star
#

while nosuit_lc works

daring fern
timid star
#

if the path was wrong it would give me an error

daring fern
timid star
#

huh

timid star
#

hc still shows the hearts suit for some reason

#

did something change with the parameters

#

no idea whats going wrong

#

oh

#

oh.

timid star
#

this is why you quadruple check people

faint yacht
#

...could I somehow sort specific cards in the deck to be always last for drawing?

daring fern
#

You mean at the bottom of the deck?

frigid raft
#

Hi guys

faint yacht
frigid raft
#

DualSenseDude is streaming on youtube

daring fern
faint yacht
#

...what exactly do with said hook? table.sort?

#

For this example, always have Bonus Cards be last...

faint yacht
#
table.sort(self.cards, function (a, b) return a and a.config and a.config.center_key ~= 'm_bonus' and b and b.config and b.config.center_key ~= 'm_bonus' and a.rank < b.rank end )
```?
daring fern
faint yacht
#

...this really shuffled a headache into existence.

misty shoal
#

how can I give a consumable that already has an edition

#

maybe remade perkeo will be of help actually..

daring fern
misty shoal
#

also how can you do polychrome text

#

like it shows what polychrome does on the side, smods examples all seem to incorrectly use {C:dark_edition}Polychrome{}, which shows negative

manic rune
#

thats info_queue

#

in loc vars

misty shoal
#

oh is that a different thing

slow brook
#

yeah all those pop ups on the sides are info queues

manic rune
#

it adds the extra info boxes next to the description

misty shoal
#

ahh I see

#

I thought it had to do with the text format mb

runic pecan
manic rune
#

ohh

#

dont modded seals have calculate built in though?

#

same goes fro stickers, editions and enhancements

runic pecan
manic rune
#

SMODS.calculate_context makes it so a new context is added, the timing is whenever its run

it should work for all calculate functions afaik

#

so yeah

daring fern
misty shoal
#

got it now

daring fern
misty shoal
#

Is there an easy way to have a joker debuff/undebuff itself

#

couldn't find many examples of that

red flower
misty shoal
#

Yeah seems the main issue would be undebuffing itself

hard mica
daring fern
hard mica
daring fern
# hard mica nope

Try keeping that and putting this in your code somewhere:

local oldcalcseal = Card.calculate_seal
function Card:calculate_seal(context)
    print(self)
    return oldcalcseal(self, context)
end
long sun
#

is there an SMODS method that counts Jokers with a particular key?