#💻・modding-dev

1 messages · Page 487 of 1

long sun
#

they have loads of mods installed so i'm assuming it's a mod interation

ivory coral
#

pretty sure thats a playing card yeah

long sun
#

i don't see how that'd help ;u;

limber blaze
#

itd probably be better to figure out the root cause but did you try just

#

checking if j is a table first

#

aka type(j) == "table"

long sun
#

right i'll give that a shot

limber blaze
#

i mean

#

this should probably be a temporary fix

#

but itll hopefully stop crashing until then

ivory coral
#

is it specified what exactly is the boolean being indexed

daring fern
ivory coral
#

because a playing card should not be a boolean tmk

long sun
#

alright will try

limber blaze
#

i mean crossmod is crossmod sometimes people do weird stuff

#

i dont think its unimaginable that j is a boolean

#

it shouldnt happen still

long sun
#

no but this happens with my decks too

#

which don't have custom cards

#

working on my end, will send it over

red flower
#

question: have you tried using ipairs instead

vague crest
#

coming back with hopefully one last finishing touch, im trying to have my joker that creates glass cards on card destruction add it to the deck like marble joker does, because i think its important to be able to see the rank and suit, but the problem is it gets stuck here and never goes into the deck, effectively softlocking the player. in theory i can just add the old code but i much prefer it show what actually gets added if anyone has any expeirnece with this

red flower
thorn basin
#

what is the command to check if a played card has a specific enhancement? (for example stone)

long sun
#

oh for the second part?

red flower
#

SMODS.has_enhancement(card, "m_stone")

thorn basin
#

aight

red flower
long sun
#

i mean, it works on my end

#

iirc G.playing_cards isn't indexed

red flower
#

it is

long sun
#

brain is melting it's nearly 3am sorry ;u;

red flower
#

the reason you might have this might be because there might be a non indexed value the games uses

long sun
#

person says it works now anyway :D

#

but ya i'll look at this tomorrow

#

so change to ipairs, then?

#

gotchagotcha ^^; will try and remember to do that

#

thanks!

red flower
vague crest
#

uhh i think so? its the one that formats stuff right

red flower
#

yes

#

can you format the code for me lol

vague crest
#

🤭

#

one moment i think i can

red flower
#

should be right click > format document

vague crest
#

THATS A THING?

#

oh my heavens

red flower
#

you can also make it format on save

vague crest
#

holy peak ok

humble pawn
#

Okay so how would I go about making it so that a card is scored while its in the hand?

vague crest
#

something like baron?

#

this is the context for something like that

#

context.individual and context.cardarea == G.hand and not context.end_of_round

humble pawn
#

Using it for a seal

vague crest
#

oh

#

i wanna say this exact kind of seal is in uhhh handsome devils? you could check that

#

might be black seal

red flower
# vague crest oh my heavens

I don't see anything wrong, so it might be the context that's the problem. How are you triggering this joker for testing?

vague crest
#

it's triggered on destroying a card with diamond suit

red flower
#

yes, but how

daring fern
red flower
vague crest
#

if context.remove_playing_cards then

#

oh wait like in game?

red flower
#

yes

vague crest
#

im using a hanged man

red flower
#

I think the problem is that the hanged man consumable places itself in G.play as well

vague crest
#

oh my god

red flower
#

marble joker does it in setting_blind so it doesn't have to worry about that

vague crest
#

yeahhhh ok 😭

red flower
#

same thing will happen with any card that destroys in scoring

sonic cedar
#

Does anyone know where i can find the scale/rotate mods for the legendary jokers' sprites?

lament agate
#

whats the real name of this

red flower
#

shop_jokers

lament agate
#

shop_jokers???

red flower
#

maybe not

#

no, it is

sonic cedar
#

like i have THESE mods, but it's for the soul itself. if i can get rid of the bounce it does, then we're fine

red flower
lament agate
#

oh yeah it is shop jokers

#

lmao

#

what about vouchers?

red flower
#

G.shop_vouchers

#

iirc

thorn basin
#

Not sure why but my custom joker doesn't create a tarot card when a stone card has played even if i increase the chances...
Am I missing something?

red flower
#

card is the joker, context.other_card is the card played

thorn basin
#

oh, I forgor that

#

my bad

lament agate
#

not playing the money animation for some reason

red flower
#

what's dollar_cost

lament agate
#

the fee for the joker

#

it takes the player's money

red flower
#

is that something you added or a cryptid thing or

lament agate
#
config = { extra = { fee = 15 } },
    loc_vars = function(self, info_queue, card)
        return {
            vars = { card.ability.extra.fee },
            colours = { G.C.MONEY }
        }
    end,
    calculate = function(self, card, context)
        if context.starting_shop then
            for _, c in ipairs(G.shop_jokers.cards) do
                c.ability.couponed = true
                c:set_cost()
            end
            for _, c in ipairs(G.shop_booster.cards) do
                c.ability.couponed = true
                c:set_cost()
            end
            for _, c in ipairs(G.shop_vouchers.cards) do
                c.ability.couponed = true
                c:set_cost()
            end
            return {
                message = localize('k_shop_free'),
                colour = G.C.MONEY
            }
        end
        if context.setting_blind and not context.blueprint then
            local fee = card.ability.extra.fee
            if G.GAME.dollars >= fee then
                G.GAME.dollars = G.GAME.dollars - fee
                return {
                    message = localize{type='variable',key='a_dollars_minus',vars={fee}},
                    colour = G.C.RED,
                    dollar_cost = fee
                }
red flower
#

sorry im on phone this is unreadable

lament agate
#

valid

#

i added it by myself

red flower
lament agate
#

its just no animation

red flower
#

like the animation over the dollar counter?

#

or the message?

lament agate
red flower
#

oh

#

that's because you're subtracting directly

lament agate
#

what do i need to do to make it animated

red flower
#

either return { dollars = value } or ease_dollars(value)

lament agate
#

and how do i detect the player's spending

red flower
#

hook ease_dollars

#

well that doesn't detect spending directly

lament agate
#

what do you mean not directly

red flower
#

it detects any form of manipulation on the money

#

so rentals would probably count as spending for example

lament agate
#

eh im sure no one plays with gold stake with my mod

#

thanks for that

red flower
#

i mean there are many other things that i wouldn't consider spending this would count, like your fee

lament agate
#

theres no other reliable way?

red flower
#

there probably is

#

just not very straightforward

lament agate
#

and that is

red flower
#

i cant find the shrug emoji

#

🤷

#

there it is

modern kindle
#

¯_(ツ)_/¯

lament agate
#

good enough

red flower
#

the smods.sound part looks ok but everything after is really old syntax
what are you trying to do?

manic rune
#

init...

sonic cedar
#

hi bepis

daring fern
#

play_sound("modprefix_wololo")

lament agate
#

why isnt it showing up

#

nevermind

modern kindle
daring fern
#

Is your mod prefix sample?

#

No, you should be using a JSON

daring fern
#

Yes.

#

Is wololo.ogg in assets/sounds?

manic rune
sonic cedar
manic rune
#

anyways

sonic cedar
#

oh shit nice

manic rune
#

:3

#

figured how to make a context to check whenever rank is changed

sonic cedar
#

i mean that still says 8 but

manic rune
#

it was my balatro freezing

sonic cedar
#

lmao?

manic rune
#

my snipping tool froze my balala to 2 fps :3

#

my pc is cooked

sonic cedar
#

i remember,,,

arctic notch
#

New to modding and I got changing text down in my mod. I'm now trying to add some visuals. Any advice on how I could make a png appear [here] in the shop phase?

rapid stag
#

question, during context.selling_self, would #G.jokers.cards include the joker being sold?

manic rune
rapid stag
#

how can i prevent any cards in the hand from being moved? cirThink i remember that there's a moveable property to set to false, but i forget where in the card hierarchy it lies

daring fern
sonic cedar
scarlet imp
#

can't focus

sonic cedar
#

you can make him lock tf in finally

lament agate
#

oh yeah @red flower i tried the gradient badges thing

#

doesnt work

modern kindle
#

You should make it work then

glass scaffold
#

How can I get this to delete ALL discarded cards

lament agate
#

@tight hull how did you get the mod badges working brw

daring fern
# glass scaffold How can I get this to delete ALL discarded cards
if context.pre_discard then
    if SMODS.pseudorandom_probability(card, "seed", 1, card.ability.extra.odds) then
        card.ability.extra.active = true
    end
end
if context.discard then
    if card.ability.extra.active then
        if context.other_card == context.full_hand[#context.full_hand] then
            card.ability.extra.active = false
        end
        return {remove = true}
    end
end
```?
daring fern
lament agate
daring fern
daring fern
scarlet imp
#

is there documentation on how I could add a setting to the game? or a config option associated with my mod that could be accessed in-game?

glass scaffold
glass scaffold
daring fern
glass scaffold
glass scaffold
#

I'm gonna hold off updating until I get more stuff done.

umbral zodiac
#

why would you hold off on updating

#

theres not that many breaking changes

#

and people are going to play your mod on the latest

glass scaffold
#

Because I'll hold off until Shenanigans and some more mods get updated

scarlet imp
#
[manifest]
version = "1.0.0"
priority = 0

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "boot_timer('splash prep', 'end',1)"
position = "after"
payload = "BI.create_pools_tooltips()"
match_indent = true
times = 1

this patch prevents the game from starting whyyyyyyy

#

patches hate me

daring fern
scarlet imp
#

I'm gonna try to not patch the game if I can avoid it I decided

#

alls I need is for this function to run after all the cards in the game have been declared

#

basically after I click on the game to launch it, at some point all of the cards get defined and I need this function to run after that

scarlet imp
#

because I need to do stuff with all of them? what matters why lol

modern kindle
#

Probably because knowing why you're trying to do something can help lead to the solution

#

Idk why it has to be secretive

glass scaffold
scarlet imp
#

basically I want to add tooltips to every item in the game and to do so I need to mess with their loc_vars. I made a function that is supposed to hook the loc_vars of every card in the game when it runs, adding the necessary code to each of them, but to do so I need the cards to exist already.
I didn't mean to come off difficult or rude, just didn't really know how to explain the situation

#

I tried hooking Card:init() instead but that has also left me out of luck, it isn't adding tooltips like I need it to

#

the only other way I've been able to pull this off successfully until now is by taking ownership of cards and adding the tooltips manually, but obviously that's really time consuming and I'd rather have a function that can do it for me

daring fern
#

Also other_value doesn't exist.

glass scaffold
daring fern
daring fern
lament agate
#
local fourthwall_gradient = SMODS.Gradient({
    key = "fourthwall",
    colours = {
        HEX("ff0000"),
        HEX("ff6600"),
        HEX("ffff00"),
        HEX("4bc292"),
        HEX("1e9eba"),
        HEX("00ffff"),
        HEX("0000ff"),
        HEX("708b91"),
        HEX("ef0098"),
        HEX("ff00ff"),
        HEX("ff0000"),
        HEX("ff6600"),
        HEX("ffff00"),
        HEX("4bc292"),
        HEX("1e9eba"),
        HEX("00ffff"),
        HEX("0000ff"),
        HEX("708b91"),
        HEX("ef0098"),
        HEX("ff00ff")
    },
    cycle = 1
})

nxkoo_dies.badge_colour = fourthwall_gradient
#

nxkoo_dies is global

sonic cedar
scarlet imp
sonic cedar
#

tomorrow i figure out why everything triggers twice with everything i do involving jokers

#

somecom surely youve noticed

#

do you know how many square root mult workarounds ive had to do

#

2
and that's 2 too many

scarlet imp
lament agate
#

i see

red flower
lament agate
red flower
#

i read that, what is it

red flower
scarlet imp
#

ahhh ok then idk why it runs twice lol

lament agate
sonic cedar
#

with chud

lament agate
daring fern
scarlet imp
#

its hard to tell 😦

red flower
glass scaffold
sonic cedar
daring fern
lament agate
# red flower show me
nxkoo_dies = {
    show_mustard = false,
    mustard_timer = 0,
    show_image = false,
    image_timer = 0,
    show_flashbang = false,
    flashbang_timer = 0,
    current_flashbang = nil,
    path = SMODS.current_mod,
    flashbangs = {
        shop = "shop_flashbang.png",
        blind = "blind_flashbang.png",
        hand_played = "hand_flashbang.png",
        discard = "discard_flashbang.png",
        round_start = "round_flashbang.png",
        joker_trigger = "joker_flashbang.png"
    }
}
red flower
scarlet imp
lament agate
#
SMODS.current.mod.badge_colour = fourthwall_gradient
#

?

red flower
#

yes

lament agate
#

thanks

daring fern
lament agate
red flower
sonic cedar
daring fern
lament agate
#

br

scarlet imp
# daring fern No, it gets given the `localization/center` you want the tooltip to be.

yes I understand but the localization is variable, depending on the card that the tooltip is attached to. As an example:

if BI.show_item_pools(card.config.center.set) then
    local text = BI.generate_pool_text(card)
    info_queue[#info_queue + 1] = {
        set = "Other", key = "item_pool", vars = {
            text.is_modded,
            text.pool,
            colours = {
                text.colour
            }
        }
    }
end

this is what I have on each of my modded cards right now, and the generate_pool_text function returns the necessary values for the localization

#

would I be able to patch all of that in?

daring fern
glass scaffold
daring fern
#

Actually no, you just put in the base numbers.

#

1, card.ability.extra.odds

glass scaffold
daring fern
lament agate
#

whats the cause for no assigned repetitions again

daring fern
glass scaffold
lament agate
#

here

#
calculate = function(self, card, context)
        if context.end_of_round and not context.blueprint then
            card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
            return {
                message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } },
                colour = G.C.MULT
            }
        end
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult
            }
        end
    end
}
daring fern
scarlet imp
#

how do I copy the error code when the game crashes

#

its a keybind right

glass scaffold
scarlet imp
# daring fern ```toml [[patches]] [patches.pattern] target = "functions/common_events.lua" pat...

this patch seems to cause a crash whenever I hover over any card with an additional tooltip, such as Stone Joker, which caused this crash. Here's the patch:

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "for _, v in ipairs(info_queue) do"
position = "before"
payload = '''
if BI.show_item_pools(card.config.center.set) then
    local text = BI.generate_pool_text(card)
    info_queue[#info_queue + 1] = {
        set = "Other", key = "item_pool", vars = {
            text.is_modded,
            text.pool,
            colours = {
                text.colour
            }
        }
    }
end
'''
match_indent = true
daring fern
scarlet imp
# daring fern Yes, you need to check `if card`

unfortunately it doesn't seem to work. Even though the generate_pool_text function works perfectly if I take ownership and manually add this code inside of loc_vars, it doesn't work from where it's being called as a result of this patch

bright abyss
#

i'm trying to install steamodded but i just can't find the appdata folder

daring fern
scarlet imp
#

it's normally hidden, the easiest way to access it is using the Run program. But long-term you'll want to enable the viewing of hidden files in your directory

bright abyss
#

computers suck

#

what're they hiding my files for

scarlet imp
#

(assuming you're the only one that uses your computer, otherwise keep it hidden)

bright abyss
#

well how do i unhide them

scarlet imp
#

View > Show > Hidden Items in File Explorer

bright abyss
#

and i just make a folder called Mods, right

scarlet imp
#

are you going to download the files manually or do you know how to use git clone

foggy ginkgo
#

Trying to make booster packs but this happened

scarlet imp
#

but that's only bc I'm tech savvy I suppose

scarlet imp
#

bc calling the generate_pool_text function doesn't crash anything when I call it from inside of a card's loc_vars

scarlet imp
# daring fern Yes, no you can't.

I think I'll just add it to each card manually then. It's causing alot of problems doing it the other way and the only thing I lose by adding it manually is time (and it might cause cross-compatibility issues but idrc)

#

thank you anyway

lunar silo
#
    name = "Blank Joker",
    key = "blankjoker",
    config = {
        extra = {
        }
    },
    loc_txt = {
        ['name'] = 'Blank Joker',
        ['text'] = {
            [1] = 'Copy effect of a random, unknown {C:attention}Joker{}.',
            [2] = 'Changes every trigger.'
        }
    },
    pos = {
        x = 6,
        y = 0
    },
    cost = 10,
    rarity = 3,
    blueprint_compat = true,
    eternal_compat = true,
    unlocked = true,
    discovered = true,
    atlas = 'CustomJokers',

    loc_vars = function(self, info_queue, card)
        return {vars = {}}
    end,

    calculate = function(self, card, context)
        local target_joker = nil
        
        target_joker = G.jokers.cards[1]
        if target_joker == card then
            target_joker = nil
        end
        
        return SMODS.blueprint_effect(card, target_joker, context)
    end
}```
vague crest
#

running into a kinda funny bug, i have a joker which makes a random joker rental at the end of the round, and ive realized that whether or not the rental takes 3 dollars immediately when it's applied is entirely dependent on whether the joker is to the right or left of landlord. is there a context besides end_of_round that would apply just a little bit before rental takes money?

#

this is what im currently doing and while it's functional it leads to an unexplained strategy where you want your landlord to be the rightmost joker and thats weird and strange

scarlet imp
vague crest
#

LOL that sucks but it might work

#

wouldnt that be weird with mr bones actually?

scarlet imp
#

true yeah

#

damn Mr. Bones and saving people from dying

#

you could hook the rental sticker and make it apply later perhaps

#

dunno how that would work

vague crest
#

oh wait i could lowkey just rental them when blind is selected

#

whats stopping me

scarlet imp
#

I think that would make it less abusable anyway

vague crest
#

also gives you a little warning in advance

scarlet imp
#

If I needed a Joker like that but didn't want rentals, you just sell it before playing the winning hand

daring fern
vague crest
#

which isnt really landlord coded but might be more fun to strategize with

#

probabaly just gonna go w that actually, ty

glass scaffold
#

I forgot if I've asked here, but how do I configure this to destroy ALL cards selected?

daring fern
#

And I provided a solution.

glass scaffold
scarlet imp
#

is taking ownership of consumables as simple as SMODS.Consumable:take_ownership() like it is for Jokers?

normal crest
#

yes, it's the same thing

lament agate
#

is this correct

#

trying to put talisman compat

normal crest
#

there shouldn't be an issue with doing hand_chips > mult even with talisman

#

since they're both turned into bignums

daring fern
#

Is it possible to check if a card would score anything when doing SMODS.score_card?

#

eval_card isn't sufficient because it doesn't account for jokers.

iron iron
#

im checking to see if the mult is less than a fifth of chips, is this the way

daring fern
foggy ginkgo
#

Does stop sound exist

#

Sounds dumb to ask

daring fern
#

It does also restart the music.

foggy ginkgo
#

Hm

#

Oh well

summer furnace
#

Sooo, I don't quite understand the DeckSkin doc, I also have the Example Mod open, but I don't understand the reason of icon_lc/hc, could someone explain please?

#

Oooooooh I figured it out, but as a question, would this be possible to do, or do I need to split that up?

tight hull
summer furnace
#

about my DeckSkin problem this message here seems to be the answer to my problem, I'll try it out now

tight hull
iron iron
tight hull
#

just curious, can you change the color of the name of a joker?

tight hull
daring fern
tight hull
daring fern
tight hull
daring fern
#

It's the same as a description I think.

daring fern
tight hull
#

I feel threaten by the ? emoji 😭

hidden sable
open tapir
#

i msde a joker on joker forge and apparently somethings wrong on line 69 and i dont know what it is

#

close to if it says

#

and return too

tight hull
rotund sable
daring fern
tight hull
#

so it kinda doesnt work (it just stays this color)

tight hull
#

name = '{C:Rcm_change}Return By Death{}',

daring fern
tight hull
#
local color_change = SMODS.Gradient({
    key="change",
    colours = {
        HEX("232329"),
        HEX("dd9237")
    },
    cycle = 5,
    interpolation = 'trig'
})
daring fern
tight hull
#

yeah

#

works now

#

kinda funny

hasty mist
#

how would i make this conditional? do i need to hook it somehow?

shell timber
#
local to_big_old = to_big
function to_big(x)
  if CONDITION then
    return to_number(x)
  else
    return to_big_old(x)
  end
end```
hidden sable
#

yeah that

hasty mist
#

oh awesome thanks

#

genuinely really helpful

lament agate
hidden sable
#

when people are so unfathomably smart that modding dev is dead

fossil nebula
#

Hi, I literally yesterday got into coding and I wanted to do a simple joker. It works that every time you use a planet card it additionally upgrades another random hand. I've got the part on detecting when the planet is used and how to level up hand but the problem is I have no idea how to make it upgrade a random hand

rotund sable
#

im not sure but would

for _, v in ipairs(G.P_CENTER_POOLS.Planet) do
  if v.config and v.config.hand_type then
    local hand = G.GAME.hands[v.config.hand_type]

    if hand and hand.visible then
      hands[#hands + 1] = {
        key = v.config.hand_type,
        hand = hand,
        planet_key = v.key
      }
    end
  end
end
local chosen = pseudorandom_element(hands, "seed").key

work?

rotund sable
#

it's a slightly modified version of the function i use for most played hand

rotund sable
daring fern
rotund sable
#

for this effect do i have to just copy paste set_ability everywhere or can i hook something?

tight hull
#

when i have {C:color} can I use hex?

rotund sable
fossil nebula
#

btw i have the code of the game extracted but where is code for the jokers?

#

can't find it

daring fern
rotund sable
#

shop, packs etc

daring fern
rotund sable
#

i'll try that

#

ty for the help

lament agate
#

how do you use

#

the assert line again

rotund sable
#

you mean like?

assert(SMODS.load_file("src/tags.lua"))()
lament agate
unborn bay
#

uh. yeah of course

rotund sable
#

how else would it know what to load

lament agate
#

OHHHHHHHHHHHH

#

thats why its not working

#

🥀

unborn bay
#

anyway assert (the function) is just a simple way of error checking something lmao

#

load_file returns nil and assert detects that

#

bringing an error

#

and halts program execution

#

SMODS.load_file is doing most of the work here

lament agate
unborn bay
#

you need to run it as a function since it returns a function

fossil nebula
unborn bay
#

without the assert line you basically just do SMODS.load_file(file)()

#

assert just adds an additional error check

lament agate
#

oh okay

#

thanks pookie

#

mwah

#

is there anything other than jokers that i should split
from main.lua

maiden phoenix
coral flume
#

Is my mod gonna break if I update steam modded

primal robin
#

50/50

wintry solar
#

Depends on what version you currently have

#

And what you class as breaking

lament agate
#

@manic rune help me

rancid flare
#

is there a way to make a consumable not disappear when used ?

manic rune
manic rune
#

its literally just

#

wankers = 0

lament agate
#

so i add that

#

?

manic rune
#

at the top of the file, yeah

lament agate
#

idk why its yellow under the rarities

manic rune
#

shouldnt it be a string

lament agate
#

should it?

manic rune
#

yes

lament agate
#

ah damn

manic rune
#

:3

#

i literally cant say ur folder name here

fossil nebula
#

I copied it from the wiki, can someone tell me why this is wrong

gray void
#

The indentation's off?

#

Also ifs in lua doesnt really use brackets?

#

Least, thats what i learned of

fossil nebula
daring fern
fossil nebula
fossil nebula
#

Im really new to this so i kinda don't know

royal ridge
#

but it's documentation

fossil nebula
#

If i remove the brackets it's still not working

daring fern
royal ridge
unborn bay
fossil nebula
#

Oh

#

that makes sense

#

thx

royal ridge
#

i mean it's a valid lua table but it doesn't run anything

rotund sable
#
get_weight = function (self, weight, object_type)
    if EF and EF.vars.shovel_voucher then
        return 0.65
    else
        return 0
    end
end

am i doing something wrong or why don't they appear in the shop

#

fixed it

#

forgot to add the pools field

rancid flare
#

is there a way to add a new button to a consumable ?

fossil nebula
#

If i want the consumeable to be a planet then what will it look like

#

like the whole context

red flower
#

context.using_consumeable and context.consumeable.ability.set == "Planet"

manic rune
#

how do you create a playing card with SMODS.create_card again
WRONG QUESTION, wheres the code that creates the Ace card in the balatro title screen

manic rune
#

i see, thanks

lament agate
#

@manic rune it crashed

manic rune
#

fire

modern kindle
#

👋

lament agate
manic rune
#

doesnt seem like its related to SMODS.load_file, but more of the content of your files

lament agate
modern kindle
#

Hello

#

Im deciding if I want to exist

manic rune
#

hi dilly

#

you should exist.

modern kindle
#

Hi bepis

gaunt thistle
#

agreed

red flower
modern kindle
#

Existing means getting up and figuring out a problem i came across yesterday

red flower
#

hi everyone

modern kindle
#

Hi N

lament agate
#

should it not use the joker for the title screen

lament agate
red flower
lament agate
#

hold

#
function Card:resize(mod, force_save)
    self:hard_set_T(self.T.x, self.T.y, self.T.w * mod, self.T.h * mod)
    remove_all(self.children)
    self.children = {}
    self.children.shadow = Moveable(0, 0, 0, 0)
    self:set_sprites(self.config.center, self.base.id and self.config.card)
end

local mainmenuref2 = Game.main_menu
Game.main_menu = function(change_context)
    local ret = mainmenuref2(change_context)

    local newcard = Card(G.title_top.T.x, G.title_top.T.y, G.CARD_W, G.CARD_H, G.P_CARDS.empty,
        G.P_CENTERS.j_tngt_wherethefuck, { bypass_discovery_center = true })
    G.title_top.T.w = G.title_top.T.w * 1.7675
    G.title_top.T.x = G.title_top.T.x - 0.8
    G.title_top:emplace(newcard)
    newcard:start_materialize()
    newcard:resize(1.1 * 1.2)
    newcard.no_ui = true
    return ret
end
modern kindle
#

While im debating getting up do you guys know a way I can check all possible contexts a card could be triggering without allowing it to 'double dip' so to speak

My edition right now works in joker main to deal the bonus effect it has but a large variety of jokers dont trigger in main
Ie lusty joker doesn't trigger in main so my bonus does not apply since it applies its effect while scoring

lament agate
#

it looks fine

#

ill delete it for a moment

oblique wyvern
#

Where's pseudorandom defined? Is it a love2d thing or did localthunk make his own random function

lament agate
#

@manic rune got the game working

#

but no custom jokers

modern kindle
red flower
modern kindle
#

yea that was the issue i ran into

wintry solar
#

I despise post triggers

modern kindle
#

eremel youre a smarty pants do you have any idea of a smooth way i could manage that

wintry solar
#

They epitomise the dev mindset of “do it quickly to make this specific effect work”

modern kindle
#

whatever the card returns it gives it a bonus

ie gros michel give +15 mult, bonus can add 7.5 mult to it resulting in 22.5 mult up to like 37.5

issue is right now with thigns like lusty joker which activate during scoring im not impacting that because its not joker main

#

i can also provide code if itd be easier

rancid flare
#

is there a way to add a add button to a consumable ?

wintry solar
#

I’d hook calc joker

modern kindle
#

if you mean for me i am doing that

wintry solar
#

Check for the edition and then change the values

red flower
rancid flare
red flower
#

it's UI so it's kinda advanced

rancid flare
#

dam

red flower
lament agate
#

crashes the game somehow

rancid flare
red flower
#

i think monsters.lua?

#

it shouldn't be relevant to you i dont think

#

you can click on a function on github and it'll tell you where it appears

red flower
lament agate
rancid flare
red flower
lament agate
#

it acts like Ancient Joker

red flower
#

did you define it in a file you're loading after this one?

autumn brook
#

Is there any documentation for custom jokers or templates? The only template i found was for changing existing jokers into a SMOD ones

lament agate
red flower
red flower
lament agate
#

i accidentally cropped the definition

modern kindle
#

thonk
am i insane and do things like delayed grat and egg not return dollars or am i simply not checking it correctly

        if ret.dollars then
            if not self.ability.base_dollars then
                self.ability.base_dollars = ret.dollars
            end
            ret.dollars = self.ability.base_dollars * multiplier
        end

trying to print what was changed for delayed grat gives me nothing

autumn brook
#

Hey so i created an custom rarity, and i want to add it to an card. so for example, if the rarity is called 'Test', should the rarity added to the card look like this?
rarity = Test,

hidden sable
#

don't rarities have indexes

lament agate
#

how do you apply an eternal to a joker for a deck

hidden sable
#

idk i've never made a rarity

hidden sable
lament agate
#

🥀

hidden sable
modern kindle
#

Ive decided there is no way

hidden sable
#

if you can do it with debugplus

lament agate
hidden sable
#

then you can't do it in code i'm sorry

#

that's just how it is

#

#debugplus

#

#iveconsumedlargeampuntsofcocaine

modern kindle
#

Whats an ampunt

hidden sable
#

let it be clear, you will be shot dead in the parking lot behind a target

modern kindle
#

5th time this week

autumn brook
#

the SMODS.Rarity wiki isn't helping me

hidden sable
autumn brook
#

It is erroring me that the } should be next to the badge_colour

#

why is making rarity so confusing 😭

hidden sable
#

you need commas

modern kindle
#

Shouldn't you have commas after the key, badge color, etc

hidden sable
#

yeah

autumn brook
#

ohhh

#

i kinda forgot about those

hidden sable
#

are you broke on commas

#

here take mine ,,,,,,,,

autumn brook
#

yes

#

thank you

#

at this point i don't know what am i doing

red flower
copper thorn
#

how could i make it so my joker changes the background music ? like Jimball in the cryptid mod

hidden sable
#

that's not vscode then, you aren't a true vscode unless you go in raw

normal crest
copper thorn
#

it doesn't help tho... i just made my SMODS.Sound thing

#

doesn't tell me how to do it

normal crest
#

Look at the select_music_track part

quick kraken
#

Does anyone have examples of SMODS tags I can use?

normal crest
quick kraken
#

Oh cool very nice

rotund sable
#

VanillaRemade my beloved

autumn brook
#

if i have to be honest at this point i don't know

#

it tells me NOTHING

quick kraken
#

Also, is there a way to grab the last blind's reward money in the shop or do I have to make a Lovely patch/a fork to keep a global variable updated with that?

#

Cause from what I've seen with what tags can do it doesn't appear as if I can store it in a local variable for the tag

normal crest
#

You wanna look for red text

#

Red underlined text

copper thorn
#

what is wrong with my synthax ?

normal crest
#

the = after returm

copper thorn
#

x) thanks

#

does adding the replace = "music1" will make it so that whenever the song is played it replaces the maain music ?

normal crest
#

it will make it so your sound plays instead of music1

#

whenever music1 would've normally played

#

you want something like this inside of your sound object

select_music_track = function(self)
  if next(SMODS.find_card('j_prefix_key')) then
    return 100
  end
end
glass crown
#

how would i check during context.selling_card what type of card the card being sold is?

normal crest
#

also your sound key has to start with music_

normal crest
glass crown
#

got it, thank you

autumn brook
#

Why is the game still revering to the normal joker image when PearTeto.png is in the folder?

normal crest
#

in your joker you have to set atlas = "PearTeto"

tight hull
glass crown
#

okay this is a much sillier question, but i havent done the balatro modding stuff in a hot minute and i dont think ive ever done this in particular, but how would i check that a card is a specific type of card (in this instance, checking that the sold card is The Sun (or The Star but the "or" part is easy))

copper thorn
normal crest
#

key = "music_world_revol"

#

also you forgot the j_ in find_card

copper thorn
#

haaaaaa

#

x)

#

im not that expereinced with modding balatro excuse my begginer mistakes

normal crest
#

hi bepis

copper thorn
#

so now it works but the song is distoreted... ima look into it don't bother for now other peple might need help

manic rune
#

im trying to figure out

#

why i cant use messages on cards in mod's menu

#

the print and juice_up do work

#

but the message doesnt work, i initially tried using SMODS.calculate_effect({message...}) but it doesnt work so i moved to card_eval_status_text

#

is it because of how i create my cards?

glass crown
normal crest
quick kraken
#

Ok I cannot for the life of me figure out what I'm doing wrong with this tag

#
apply = function(self, tag, context)
        if context.type == "entering_shop" then
            if #G.jokers.cards < G.jokers.config.card_limit then --and G.GAME.blind.money > 0 then
                SMODS.add_card({set = "personajoker", key_append = "spawn"})
                local func = function()
                    --ease_dollars(-1*G.GAME.blind.money)
                    
                    return true
                end
                tag:yep("+", G.C.MONEY, func)
                tag.triggered = true
            end
        end
    end
#

Ignore the commented out part because if I can't get the rest to work then it doesn't make sense to investigate that part

#

I've also tried context.entering_shop

red flower
#

tags have very specific contexts

#

i don't think that's one

copper thorn
normal crest
#

context.type == 'shop_start'

quick kraken
#

So tags don't have the same contexts as cards

normal crest
#

that's what you're looking for

manic rune
#

i tried using SMODS.add_card to add the joker to the cardarea instead, the message still doesnt work

#

im out of ideas

quick kraken
normal crest
manic rune
#

i did

#

it also doesnt do anything

red flower
#

maybe it doesn't work when an overlay is opened

manic rune
#

yeah thats what im thinking too

red flower
#

because it pauses the game (?

manic rune
#

😭

#

mmm

#

lemme try checking if it does pause the game or not

normal crest
#

they all should pause the game

manic rune
#

yeah thats true, its paused

#

crap

quick kraken
#

Ok the tag now kinda works

#

Except now there's a new issue

#

Trying to use G.GAME.last_blind.money gives nil

manic rune
#

hm

autumn brook
copper thorn
quick kraken
copper thorn
manic rune
#

is there ANY mod that tried making a message popup in the mod's menu

#

😭

#

i dont even know where to begin with

autumn brook
red flower
#

yes

normal crest
copper thorn
#

also x) N' always here to help tbh

normal crest
copper thorn
normal crest
#

and idk enough about music to help you

copper thorn
#

ima look into it then no worries

copper thorn
normal crest
#

oh

#

good to know

copper thorn
#

and the song is played forever until it doens't need to

pastel kernel
#

rarity issue

manic rune
#

im gonna crash out

#

😭

normal crest
pastel kernel
manic rune
#

no you are almost right there, it happens behind the UI

normal crest
#

🥴

manic rune
#

i did set G.SETTINGS.paused to false

#

so i was wondering why it didnt work

#

ghhh

#

how do i, even fix this

normal crest
#

just make the scale like 1000

keen atlas
#

oh reward?

#

nvm

wintry solar
#

I imagine you can control the layer in some way

manic rune
#

im aware, but i never tried manipulating layers before

normal crest
#

I'm looking at card_eval_status_text and I can't figure out how to control the layer

manic rune
#

is there an example of a mod doing this 🤔

wintry solar
#

Probably not

manic rune
#

im digging into attention_text too

#

ghh

#

damn im COOKED

lament agate
#

and modprefix_rarityname

normal crest
#

idk what all the UI stuff means, only the basics

wintry solar
#

Those would be width and height iirc

normal crest
#

pain

autumn brook
quick kraken
#

Does SMODS.add_card not account for rarity?

normal crest
normal crest
quick kraken
#

I tested a thing 3 times with a custom pool of jokers and 3 times it gave me rares

normal crest
#

or something

red flower
rocky plaza
#

real quick, how would i iterate over the cards in hand to count the number of face cards in hand before scoring happens?

manic rune
normal crest
#

I mean check with debugplus and try changing it

#

maybe it does something, dunno

manic rune
#

sure, one sec

pastel kernel
manic rune
#

is it just card.under_overlay

normal crest
#

i think so

quick kraken
#

What's vanilla joker rarity weights?

lament agate
manic rune
#

its being forced to false it seems

normal crest
#

oh well

candid sleet
red flower
manic rune
#

huh, didnt N' make it so you can use pseudorandom_element without randomseed now

red flower
#

yes

candid sleet
#

ohhh ok

#

i just changed smods version due to multiplayer update maybe i got an older one now

keen atlas
# manic rune

under_overlay is set to G.under_overlay and only affects how the element is interacted i think

manic rune
#

mm

manic rune
#

i just checked

#

i thought i was onto something but guess not lmfao

candid sleet
#

i've been trying to figure out why nothing i've tried today in regards to pseudorandom was working i guess that makes sense now

manic rune
#

yeah you initially needed to use pseudoseed alongside pseudorandom_element

#

it was something like pseudorandom_element(table, pseudoseed("hi"))

red flower
#

almost

manic rune
#

holy

#

HOW

#

you are truly a wizard

red flower
manic rune
#

mm

#

so it seems instance_type has something to do with layers?

red flower
manic rune
#

o

#

never noticed that

autumn brook
#

Hey so after trying to add an custom rarity to the card, hovering the card with the mouse jus crashes the game.

red flower
#

the other problem is that the box just doesnt clear so that might be the pause thing

manic rune
#

might be

#

you can try setting G.SETTINGS.paused to false and try

red flower
#

yep that did it

autumn brook
red flower
manic rune
#

N' im forever in your debt after this

#

😭

#

forever squared

#

because im already in your debt

#

ghh

red flower
#

dont worry you will repay by me stealing ur stuff

quick kraken
#

How does one apply an ObjectType rarity to a Joker?

manic rune
quick kraken
manic rune
#

oh

#

yeah dunno, never used that before sorry :<

quick kraken
#

Apparently if I generate a random joker through an objecttype I need to redefine rarities to make it respect rarities

red flower
#

idk if this is the issue but the rarity keys are uppercase iirc

#

or capitalized rather

quick kraken
#

No that's not the issue

#

I made the rarities and don't know where to put them

#

Cause this is not an SMODS.Rarity

wheat jewel
#

Trying to make a deck change the suit of every card after beating a boss blind but it doesn't do so, and it only does so at the beginning of the run on the deck, how do I make this work properly. I did try to use pseudorandom to choose a random rank but that didn't work

red flower
#

i dont understand the question

normal crest
# red flower

Should probably pass this through the arguments to not make everything the same layer

normal crest
#

Good to know that's how you change layers tho

red flower
candid sleet
#

so this is doing it's job of basically being a higher chance of hitting wheel of fortune but it can seemingly still hit even when all cards have an edition already, causing the game to crash

lament agate
wheat jewel
wheat jewel
#

i could try

real night
red flower
wheat jewel
#

i gotta remove the blueprint stuff too

#

i had the code lying around from a scrapped joker

lament agate
quick kraken
red flower
# candid sleet

wheel of fortune doesnt check if there's a valid target because it checks in the can_use function, you would need to

quick kraken
#

In the rarity field?

red flower
lament agate
#

@red flower the wiki isnt clear enough, what API should i use for spawning negative tag after beating a blind on a deck

normal crest
# wheat jewel

if you're using the latest smods you can just use context.beat_boss

red flower
candid sleet
#

would i just put it at the end of my joker like in WoF

quick kraken
#

I'm trying to make vanilla joker rarities work with SMODS.add_card specifically with a custom set of jokers

red flower
candid sleet
#

ah ok

real night
#

ouh

red flower
real night
#

anyways how would i get the rank of a scored card

#

for example like how would i add mult equal to the rank of scored cards

quick kraken
#

card:get_id()

#

11 is jacks, 12 is queens, 13 is kings, 14 is aces

red flower
real night
keen atlas
# red flower

i forgot instancetype is a thing even though i touched ui several times :(

red flower
lament agate
#

got it

red flower
candid sleet
quick kraken
#

usually context.other_card

red flower
quick kraken
tight hull
#

how can I use custom colors in {C:color}?

quick kraken
# real night yeah
calculate = function(self, card, context)
    if context.cardarea == G.play and context.individual then
        local rank = context.other_card:get_id()
        if rank == 11 or rank == 12 or rank == 13 then
            rank = 10
        end
        if rank == 14 then rank = 11 end
        card.ability.extra.mult = card.ability.extra.mult + rank
#

something like this

#

And then the return message is "upgraded" or whatever it is depending on how you intend your joker to look

red flower
#

i think card.base.nominal works as well

quick kraken
#

So in that case it would just be card.ability.extra.mult = card.ability.extra.mult + context.other_card.base.nominal?

red flower
#

yeah

#

thats what raised fist does

quick kraken
#

Well that does look much simpler

#

But if base.nominal didn't exist, that would probably be how I'd do it

red flower
mild grove
#

i'm trying to get a custom deck to spawn with a negative joker but it's not working

wispy sparrow
red flower
mild grove
#

ah

wispy sparrow
red flower
lament agate
#

trying to spawn a joker through a deck, this works fine with vanilla jokers but not modded one

red flower
lament agate
#

negative eternal

tight hull
lament agate
#

this is the vanilla one

mild grove
#

i could be wrong but i think to get modded jokers to spawn you need j__

lament agate
#

2 underscore?

mild grove
#

yeah

red flower
red flower
mild grove
lament agate
tight hull
red flower
#

nxkoo........

#

im going to cry

lament agate
#

y

#

yeah?

#

WHAT WHY

#

WHAT HAPPENED

red flower
#

read the key

lament agate
#

flashbangout?

red flower
#

read it again

lament agate
#

...

#

im old

keen atlas
#

typo

red flower
lament agate
#

yeah..

#

thanks for noticing that

#

i genuinely dont

red flower
#

:3

lament agate
#

imma keep it like that

#

thunk it out

tight hull
red flower
#

although in my mod i do it in a hook so that might crash

rotund sable
tight hull
rotund sable
#

-# yes N' it was your hook but with less colors

autumn brook
#

Hey so i have created an early description for the joker, how can i create that the joker gains X3 mult when the hand contains Heart Flush?
Or is there an template i can work of? The only template i can find are for adding, none for multiplying the mult

rotund sable
tight hull
#

thats why im asking now

rotund sable
#

So the G.C.EF = part is defining a table of colors I use elsewhere in the mod

#

EF is my mod prefix

#

Then in the later part

#

You just assign them

tight hull
lament agate
#

oh thats new what the hell

rotund sable
lament agate
#

what happened here

tight hull
#

I feel so stupid now

#

like ur explaining the basics and I still dont get them

rotund sable
#

I don't think it's basics

#

Tutorial I saw being sent here ^

#

Ok so here we assign the old function to a local variable and then we override it.

-- https://github.com/nh6574/JoyousSpring/blob/main/src/globals.lua#L71
local loc_colour_ref = loc_colour 
function loc_colour(_c, _default)
    if not G.ARGS.LOC_COLOURS then
        loc_colour_ref()
    end
    G.ARGS.LOC_COLOURS.ef_plant = G.C.EF.PLANT

    return loc_colour_ref(_c, _default)
end
#

The first if is checking if the colors aren't there we call the old function to assign them

manic rune
#

never noticed it but why does the first loc_colour_ref not have the arguments

rotund sable
#

After that if we assign our own colors. In this case ef_plant is my color I later use as {C:ef_plant}

formal parrot
#

Bepis

manic rune
#

🤔

rotund sable
#

Or something like that

tight hull
rotund sable
rotund sable
rotund sable
#

I use them for badges

tight hull
#

ohhh

tight hull
rotund sable
#

The lsp

#

Just so I don't get a warning

#

You can treat it as a comment

#

Lsp (language server protocol) is in simpler terms a program that checks for errors in the code

rotund sable
# rotund sable I use them for badges

For example

    set_badges = function(self, card, badges)
                 badges[#badges+1] = create_badge('Idea Credit: plantform', G.C.EF.IDEA_CREDIT, G.C.BLACK, 0.8 )
         end,
#

Ok I have to go now

#

Gl

tight hull
rotund sable
#

Np

#

Cya o/

normal crest
manic rune
#

oh my god this FINALLY WORKS

manic rune
brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton",
    path = "music_spamton.ogg",
    select_music_track = function()
        return (next(SMODS.find_card("j_silly_spambot")) and G.shop and not G.shop.REMOVED and 11) or false
    end,
})

how do i make a version of this that plays for regular (small, big) blinds + another version for boss blinds?

brittle yacht
faint yacht
#

Check G.GAME.blind.name.

brittle yacht
fossil nebula
#

Is there any easy way to make a joker that when card is scored and it's a queen it changes to king and vice verse

manic rune
#

god this is so nice 🥀

manic rune
autumn brook
manic rune
#

else it will always be nil as shown in your image

foggy ginkgo
#

What's the glass breaking sound called

midnight coyote
#

how do i nab the rarity of a joker

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton1",
    path = "music_spamton1.ogg",
    select_music_track = function()
        return (next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0 = true
    end,
})```
#

i probably failed here

#

lol

#

im new to balatro modding

faint yacht
autumn brook
faint yacht
#

-# Quite frankly, also new to Lua in general, huh.

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton1",
    path = "music_spamton1.ogg",
    select_music_track = function()
        return (next(SMODS.find_card("j_silly_spambot")) and string.len 'G.GAME.blind.name' > 0
    end,
})```
#

like that?

autumn brook
#

are we ignoring the NSFW link

faint yacht
#

<@&1133519078540185692>

brittle yacht
#

W mods

#

L spam

brittle yacht
fossil nebula
#

oh and one more thing

#

how do i detect and refer to a specific card?

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton1",
    path = "music_spamton1.ogg",
    select_music_track = function()
        return (next(SMODS.find_card("j_silly_spambot")) and string.len 'G.GAME.blind.name' > 0
    end,
})```
fossil nebula
#

and how could i prevent it from doing it 2 times to the same card

#

that it changes back from what it was

faint yacht
brittle yacht
faint yacht
#

return next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton1",
    path = "music_spamton1.ogg",
    select_music_track = function()
        return next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0
    end,
})```
#

this?