#💻・modding-dev

1 messages · Page 369 of 1

torpid plume
#

thats fair!

sturdy compass
#

yerr

analog spoke
#

how, uhm, how does one do talisman compat stuff? lol
I'm trying to make a bull-esuque joker and it's crashing from the whole "money is a table now" thing 💀

sturdy compass
#

First thing you've gotta do is add this function to your code

to_big = to_big or function(num)
    return num
end
analog spoke
#

ok, that part is now done!

sturdy compass
#

Really quick can I see the code?

analog spoke
#

code of the joker I assume?

analog spoke
sullen fern
#

kaboom

sturdy compass
# analog spoke

Ok now I'm confused because usually crashes like yours happen due to a comparison, but I assume it's happening with math.max???

sullen fern
analog spoke
sullen fern
#

and THEN, i need to make sure that every joker that’s a part of a specific tribe gets a badge saying what tribe it’s a part of

narrow iron
drifting topaz
#

Does anyone know how to make the auto completions work for VS code?

sullen fern
#

also…

sturdy compass
drifting topaz
#

I use the Lua extension by sumneko

sturdy compass
#

try wrapping your chip calculation in a to_number() wrapper

analog spoke
# sullen fern also…

I'm curious, where is wee joker here? I could see it being charming, heartful, or slippery (I know nothing about yokai watch, lol, going purely off vibes here)

low parrot
#

Hi, so I'm trying to make a joker that has the possibility of changing playing cards enhancements, ranks and editions, currently the editions part is fine, but I have no idea of how to do the others hahaha, this is my crash report and my current code

analog spoke
narrow iron
#

has someone made a list of every variable that has to be wrapped for talisman?

sturdy compass
narrow iron
#

dang

analog spoke
#

okey, I'll try it like this, then 👍

sturdy compass
#

to_number

analog spoke
#

okey!

sullen fern
#

decided to change snartle just a teeny weeny bit

narrow iron
#

so i changed the ability.Xmult value for glass cards, and it properly reflects that change in the description, but it still gives 2x mult even when not set to 2x

sullen fern
#

now for the mysterious tribe.

analog spoke
sturdy compass
#

Woohoo!

#

np!

hallow forge
#

Jimbonyan

narrow iron
sturdy compass
#

What's the timing of you changing the Xmult?

narrow iron
#

on creation

sullen fern
# sullen fern also…

so the various tribe themed buffoon packs will have, well, jokers from those specific tribes.

sturdy compass
sullen fern
#

kinda like cryptid’s meme packs

narrow iron
#

huhh.. Xmult is used for the description, and x_mult is used for scoring

sturdy compass
#

Yep lmfao

narrow iron
#

weird

sturdy compass
#

blame Thunk Shrug

sage crater
#

Is it possible to have the extra.mult value also affect a pseudorandom outcome?

lucid owl
#

how could i make this joker's status message pop up right when the card is added, rather than when the hand is scored?

sturdy compass
sage crater
#

Gnarly

lucid owl
sage crater
#

Wicked, even

sturdy compass
sturdy compass
#

I will say your code would very much benefit from some SMODS util functions

hazy mountain
#

hey all, im having trouble translating my joker ability to code. the ability is when the sum of cards played equal 14, lose 10 dollars, but gain 14 chips, and i would like to keep the chips on the joker, similar to wee joker. also here's an image of what i have so far.

lucid owl
sturdy compass
lucid owl
#

what would be passed to SMODS.add_card()?

#

i figured that was just for creating a card from scratch and also adding it to an area

sleek cliff
#

So I'm trying to make a planet that upgrades two hand types, it exists, but when I try to discover it the game crashes

lucid owl
#

so copying wouldn't work there

sturdy compass
#

Honestly you don't really have to do anything lmao

#

Your code works Shrug

lucid owl
lucid owl
narrow iron
#

i could hook the smods function that handles glass cards breaking, buuuut just setting the chance to 1 in 9x10^37 is a lot funnier

sturdy compass
lucid owl
#

so that must not be the issue

#

oh i misread

#

my bad

sturdy compass
#

I was boutta say 😭

lucid owl
#

lol

#

now i gotta think of where to put it

#

maybe put it into the hand then immediately discard it

sturdy compass
#

G.discard is also not a bad option if you're gonna discard it anyways

lucid owl
#

true, but it might be nice to show the player that specifically the leftmost was indeed copied

#

emplacing into G.discard just doesn't show the card at all (given that it's offscreen ofc)

sturdy compass
#

Could maybe add a delay in your code that emplaces it in G.play at first and then emplaces it into G.discard

lucid owl
#

yeah, that's what i'm thinking

timid parrot
#

@compact girder replying to your question in #⚙・modding-general , I highly recommend reading the documentation for Jokers on the steamodded wiki on their GitHub. It has a list of attributes (including rarity, which is a number for base game rarities)

high sinew
#

this should be only chaning the spades to gold enhancement and does everything in hand instead I have a feeling its the full hand i use in the for loop is there something better to use to have it turn cards that are only spades?

sturdy compass
#

Don't use a loop here. just apply the changes to context.other_card

timid parrot
#

The context loops through each card already. No need to write your own loop

sturdy compass
#

Or if you want every card to change at the same time, do it in context.before

high sinew
#

ah that makes sense thanks guys

high sinew
sturdy compass
#

Nice

compact girder
timid parrot
#

sidebar has the table of contents

#

SMODS.Joker for Jokers, but there's documentation for most other things you'd want to make

viral grotto
#

I'm trying to learn modding, and the first thing I'm trying is just renaming some of the stuff from the base game. I have this in the file localization/en-us.lua. Could somebody tell me why it isn't working?

return {
    descriptions = {
        Joker = {
            j_balatro_joker = {
                name = "Jimbo",
            }
        }
    }
}
sturdy compass
#

For vanilla objects you don’t need a mod prefix

viral grotto
#

so it would just be j_joker?

sturdy compass
#

Yep!

narrow iron
#

yep

viral grotto
#

thanks

viral grotto
narrow iron
#

lol :3

sullen fern
#

havent done this in a bit but here's all the heartful tribe jokers

#

so far assigning all of the jokers to a specific tribe is, well, easy.

#

the hard part will be, well, making a badge appear for each joker in the tribe.

#

might have to hijack the ui code for that

hazy mountain
timid parrot
#

you probably want to use the before context and sum all the cards' nominals (I think) using a for loop

#

do you have the base game's code?

hazy mountain
#

i believe i do

#

i do just double checked

timid parrot
#

also just a design suggestion, making the player pay $10 to upgrade their joker is kinda brutal, especially for only +14 chips. I'd recommend removing that and just making the requirement be cards sum to 14

hazy mountain
#

yeah this is more a private mod based on in jokes

#

with my friends

timid parrot
#

ah gotcha

hazy mountain
#

its silly basically context is, one of my friends talks a lot about ff14 and thats her game, which resulted in another friend saying every time you mention the game were gonna tax you 10 dollars (jokingly ofc)

timid parrot
#

nice

hazy mountain
#

also this is my first time trying to code anything so thoroughly confused

sullen fern
brisk rose
#

So, for the fuck of it, I asked ai (gpt o3) what it knew about balatro modding again. Most of it is hialousoly wrong, and tbh this isn't any exception, but it's weirdly spot-on with the formatting of a joker definition. Just things are named wrong

local M = {}

M.joker = {
  slug   = 'lucky_rabbit',
  rarity = 2,
  cost   = 7,
  blueprint_compat = true,
  loc = {
    name = 'Lucky Rabbit',
    text = {'+3× if hand contains', 'exactly one ♠ Ace'}
  },
  sprite = 'lucky_rabbit.png',
}

function M.joker.effect(self, ctx)
  if ctx.stage == 'before_score'
     and ctx.hand.count == 5
     and ctx.hand:contains_exact('A', 'S', 1) then
       return {mult = +3, message = '+3× Lucky Rabbit'}
  end
end

register_joker(M.joker)```
sullen fern
#

wicked will be cryptid-compat exclusive

brisk rose
#

weird coincidence

brisk rose
sullen fern
#

specifically with more vanilla-like mods such as ortalab and bunco

#

all of the luas for those will be stored in a “mod-compat” folder

brisk rose
hazy mountain
umbral zodiac
#

how would i check if a played hand has a specific amount of scoring 9's?

shell timber
#

loop through context.scoring_hand?

narrow iron
#

iterate through it and count em

umbral zodiac
#

i thought there would be a way that didnt involve looping tbh but i dont have a problem with it

sullen fern
timid parrot
hybrid shadow
#

alr so, this might be a bit complicated

the first gap,, the (_____), is essentially supposed to detect that a card with a certain sticker is in the hand. i assume this ends with "in area==G.hand" or something similar, idk what the acual code here ahould be

the second thing, the [variable], is supposed to have something that says how many of the sticker are in the hand so that gets used. i also dont know what would be put here

sullen fern
#

there’s too many hoops i would have to jump through to make it compatable with it

#

and even then i’m iffy on cryptid compatability

#

think of cryptid compatability as a “maybe”, and not a “definitely”

sturdy compass
sullen fern
#

well, specifically the tribe system.

#

is there a yo-kai that makes you work on balatro mods for extended periods of time

#

i mean, there’s wydeawake and allnyta that keep you up at night but that’s not specifically balatro related

shell quest
#

tryna figure out delay stuff but this seems to run the start and end prints at the same time?

timid star
narrow iron
#

WHAT

marble flint
sullen fern
marble flint
#
G.E_MANAGER:add_event(Event { func = function() print("start") return true end })
delay(5)
G.E_MANAGER:add_event(Event { func = function() print("end") return true end })
shell quest
#

is that meant to be add_event

marble flint
#

yes

hazy mountain
#

okay this is what i have now, im trying to figure which equation i need for the context.

sullen fern
hazy mountain
sullen fern
timid star
#

comely's theme is too quiet in the mod though i'll fix that

sullen fern
#

no like, the horse neigh sfx

timid star
#

oh

#

the niegh sfx is a random one i found on youtube that i though seemed similar

#

i used this https://www.youtube.com/watch?v=VCML7FBPkGA video to get each of the horses' themes

you may use this for your whatevers
all jingles except for legacy made by lexycat
stem extracted means ai was used to separate music from other noise
#hrt #hrtthrt #horseracetests
made this because someone from the discord server asked for a video like this
i however do not remember who was the person in question

00:00 Legacy
00:06 Resolute Min...

▶ Play video
sullen fern
timid star
#

neat

#

i'll use that then i'll have to list down that in some credits

sullen fern
#

no need to credit me because its not even my sound effect, lol

#

i just gave it to you so you wouldn’t have to extract it yourself

timid star
#

alri lol

#

i also gave the

#

green horse the legacy theme because why not

sullen fern
#

anyways i probably should get back to working on my mod

timid star
#

gl with that

sullen fern
timid star
#

yeah thats what i did

#

you only get the nightmare horses when the card is negative

sullen fern
#

mysterious figure, garbage bin, nighttime knifemare

timid star
#

alt form of the joker when turning it negative

#

even the background changes

sullen fern
#

wait, do multiple copies of the joker make their victory themes overlap

shell quest
sullen fern
#

ah

timid star
#

it does make you wait 5 seconds for each of them to play their own theme but thats on you for racking up so many hrt jokers

sullen fern
#

nostalgic invisible joker:

#

nostalgic googol play card:

timid star
#

i dont know if cryptid is compatible with my mod yet

sullen fern
#

chameleon joker:

narrow iron
hybrid shadow
narrow iron
#

yea!

shell quest
#

i <3 SMODS.restart_game()

timid star
hybrid shadow
# shell quest

for shits and giggles considering the context of the original sound effect, this should also destroy all glass cards in the deck when used

timid star
#

some themes are longer than 5 seconds but 5 seconds is enough

narrow iron
#

thats amazing

sullen fern
#

no mysterious figure or knifemare…

hybrid shadow
timid star
#

im also using their tournament sprite

timid star
#

it's ticking me off

#

it's the yahimod doing something

rugged pier
#

is there a way to "boost" editions and enhancements values by a certain value without taking ownership of them (i want this to be mod compatible)

timid star
#

idk what its doing

timid star
sullen fern
#

oh, there they are

timid star
sullen fern
#

scary ao oni horse

timid star
#

now i need 16 different separate effects for each horse

#

....that's a lot for an rng joker

shell timber
#

oh yeah to fix the ticking

timid star
#

did the yahimod recently update

shell timber
#

go to items/jokers.lua, search for Game:update, then comment out the first play_sound

#

it'll be in the next update

timid star
#

but i wouldn't expect it to be in the fucking jokers lua file

sullen fern
#

i bet on losing horses…

#

but in balatro, every horse is a winner

#

i like how the music comically lowers in pitch and stops to make room for the horse theme

timid star
#

idk how to actually do that but

#

lmao

timid star
#

the game music was getting in the way of the horse themes and i didn't just want to make the themes louder

thorn flame
#

what do they all do

timid star
#

but im about to come up with all 16 individual effects

#

each horse does something special so im gonna have to get around that

#

also have to take into account that horses change after every blind

#

each horse is a table so i can just give each table its own function that the joker will use

hazy mountain
#

okay i think im figuring out just messing with, when i tried to open the game i got this message and unsure what it means

thorn flame
#

love it

frigid blaze
#

Can you tell me how to increase the probability of a certain rarity appearing when I have j1 in my hand?

hazy mountain
frigid blaze
#

,

shut crater
hazy mountain
#

okie dokie

#

strange

#

coding is odd

#

i have no experience what so ever

shut crater
#

I would suggest installing the Lua extension so that vscode will automatically highlight syntax errors like that

timid star
#

wait there's an extension for that?

daring fern
frigid blaze
shut crater
#

I've not dealt with rarities, sorry

timid star
hazy mountain
daring fern
daring fern
shut crater
#

On the left sidebar there's an icon with 4 squares that says extensions when you hover over it. Click that and then search for lua

hazy mountain
#

okie dokie its downloading

#

assuming it will automatically flag for errors with extension

#

may have to reload the code first?

frigid blaze
#

Second day I can't customize the joker and no one knows, buzz😀

tawdry oriole
#

how do you do probabilities and randomness like for gros michel or glass cards

daring fern
hazy mountain
#

lua extension working now thanks everybody

timid star
daring fern
hazy mountain
#

anyone know what this means

timid star
#

thats how it be

tawdry oriole
narrow iron
hazy mountain
#

im not for sure what that is im sorry

timid star
#

ipairs is used in for loops

daring fern
frigid blaze
#

How can rarity be influenced through the joker?

hazy mountain
#

i just opened my game

timid star
#

you probably fed a function a string instead of a table

narrow iron
#

ipairs takes a table and returns the keys and values separately

hazy mountain
#

i figured i could get by without having to use a nominal, since i had trouble still finding it on steammodded wiki, so i thought i could do it this way

timid star
#

whats calculate doing there

daring fern
#

Atlas?

narrow iron
#

atlas is correct right

hazy mountain
#

i thought i needed calculate since the wiki said i needed it

daring fern
narrow iron
#

oh nvm

timid star
#

for atlas you do need your mod prefix before the atlas key

hazy mountain
#

is that the header

timid star
#

nvm

daring fern
hazy mountain
#

took out calculate and it still did it

hazy mountain
#

does the last atlas in green need to be upper case or lower case

hazy mountain
#

alrighty

frigid blaze
#

Aaaaaaaaaaaa

How can rarity be influenced through the joker?

hazy mountain
daring fern
hazy mountain
#

oh forgot that let me grab that

daring fern
hazy mountain
#

will do

#

now its saying ipairs again

#

huh

#

oh its the loc txt isnt it

daring fern
hazy mountain
#

my extension said syntax error

#

i think i needed maybe a comma instead

narrow iron
#

yep

#

i think ik where your ipairs error is

hazy mountain
#

ipairs again what

#

oh

#

really

daring fern
narrow iron
#

your text in loc_vars should be a list
example:

hazy mountain
#

like this

daring fern
daring fern
narrow iron
#

put { after text = and put } after the second string in your description

hazy mountain
#

like this?

daring fern
timid star
#

it should look like this

#

you put your text in between the braces

daring fern
narrow iron
#
text = {
'if scoring_hand = 14',
'gain {C:chips}+#14#(),
}
#

just too late lol

narrow iron
#

oop

#

typo

hazy mountain
daring fern
hazy mountain
#

one after the key line

#

or the one after 14

daring fern
hazy mountain
#

oh okay

#

am i going about the wrong way to learn it, i just started messing with using videos and such

#

and steammodded wiki

#

thanks everyone game finally launched

unkempt kestrel
#

guys how can i get the total amount of chips scored in context.final_scoring_step

unkempt kestrel
#

ok cool

frigid blaze
#

Is there any way to affect default_weight via joker?

sturdy compass
hazy mountain
#

alrighty sounds good

#

would cryptid be a good one to look at since there is a lot of jokers in that one

sturdy compass
#

In some cases yeah. The more complicated features I would not, as since you’re a lot less experienced with Lua you’d most likely just get lost in some of those massive blocks of code

#

There’s also some example mods provided by Steamodded that are heavily commented to convey what’s going on. Lemme see if I can find those rq

hazy mountain
#

ooh they sound nice

sturdy compass
wintry solar
#

Cryptid is one of the worst to reference imo

wintry solar
#

It uses its own conventions that over complicate things and it’s written by multiple different people who have varying levels of knowledge

sturdy compass
#

Of course

sturdy compass
wintry solar
#

It also has a lot of “if it works, it works” coding style

#

I’d recommend looking at N’s vanilla remade (I don’t have a link handy) which implement vanilla effects in the smods style, or something like ortalab

hazy mountain
#

oh yeah ortalab

#

oh would neatos be good then too

tawdry oriole
#

how do you test for multiple conditions (like if and elseif) in a calculate function?

daring fern
sturdy compass
tawdry oriole
#

as in "if this is true then do that" "or if this is true then do this"

unkempt kestrel
#

am i stupid this isnt scoring anything

daring fern
sturdy compass
sturdy compass
#

Resources aplenty BigMoney

tawdry oriole
violet sparrow
#

G.playing_cards doesnt consider the new suits and therefore cards i've added... how do i go about adding the new cards to G.playing_cards? nvm it does i just screwed up another part

sullen fern
#

there's only 5 slippery tribe vanilla jokers so...

bold sleet
#

They seem to uh... not like to work at all.

tawdry oriole
#

how would you gain money like the golden joker does but without using calc_dollar_bonus?

daring fern
#

You mean context.end_of_round and context.main_eval + ^^?

bold sleet
#

ye, i stupid

#

-# mb sry

rugged pier
#

can i access a joker's config values outside the joker from another function?

daring fern
rugged pier
bold sleet
#

I think card.ability.(...)

#

Where card stands for your joker.

bold sleet
#

guess I'll go ask the cryptid guy

daring fern
#

How does one prevent this but coming from a fake card?

rugged pier
#
if next(SMODS.find_card('j_mxfj_dungeon_jester')) then
        multiplier = SMODS.find_card('j_mxfj_dungeon_jester').ability.extra * 100
``` like so?
daring fern
#

SMODS.find_card returns a table.

sullen fern
#

shady and eerie

rugged pier
daring fern
sullen fern
#

so, now that i have every joker assigned to a tribe

#

time to impliment the badge

#

like this

tawdry oriole
#

any clue why this happens?

hard mica
bold sleet
hard mica
sullen fern
bold sleet
#

DebugPlusPlus, or balatro mod menu, or megahack v1

bold sleet
hazy mountain
#

okay tried using the runner 2 code from steam modded examples to set up storing and gaining extra chips but then told me it had an error on line 38, when before that line was fine

wintry solar
hard mica
#

Maybe go with that

bold sleet
#

The other two names are just for shit and jiggles

sullen fern
bold sleet
#

Now for real, help

#

Why does it break like that and now fix?

tawdry oriole
sullen fern
#

i’ve never really done something of this caliber before (a whole entire new gimmick)

#

all i’ve really done is create seperate object types for each of the tribes.

#

the whole “having a badge that shows off the tribe the joker is in” thing is a bit far-off for me but i want to make it happen god damn it

cloud crag
#

where do i download the EnhancedEnhancements resource pack

sullen fern
unkempt kestrel
#

i dont think this is how i use hand_chips how do i get that

#

also is there anywhere i can see all of the variables i can access from here

#

like theres hand_chips and such (i think?) but where can i see them

sullen fern
#

idk, i’m tired.

rugged pier
#

hi, is card:get_edition called everytime a hand is played?

#

im trying to modify effects of editions and hooked into that function as it is used in eval_card()

#

but it seems to not work upon a hand being played

daring fern
rugged pier
#
-- Modifies Edition Values
local base_get_edition = Card.get_edition
function Card.get_edition(self)
    local ret = base_get_edition(self)
    if not ret then return end
    if next(SMODS.find_card('j_mxfj_dungeon_jester')) then
        multiplier = 1.5
        print(multiplier)
    else
        multiplier = 1
    end
    -- Mult
    if ret.x_mult then ret.x_mult = ret.x_mult * multiplier end
    if ret.h_mult then ret.h_mult = ret.h_mult * multiplier end
    if ret.mult then ret.mult = ret.mult * multiplier end

    -- Message overrides
    if ret.x_mult_mod then
        ret.x_mult = ret.x_mult_mod * multiplier
        ret.Xmult_mod = 0
        ret.message = nil
    end
    if ret.mult_mod then 
        ret.mult = ret.mult_mod * multiplier
        ret.mult_mod = 0
        ret.message = nil
    end

    -- Chips
    if ret.chips then ret.chips = ret.chips * multiplier end

    -- Message overrides
    if ret.chip_mod then
        ret.chips = ret.chip_mod * multiplier
        ret.chip_mod = 0
        ret.message = nil
    end
    print(ret)
    return ret
end

rugged pier
daring fern
rugged pier
#

line 618

daring fern
daring fern
rugged pier
#

i see

daring fern
bold sleet
#

question: where does the game store in what ante you are in?

daring fern
tawdry oriole
#

i'm still getting the rancid ipairs problem even though i am returning a key-value pair

lofty sand
#

if I'm trying to make a copy effect joker, how could I check if the (vanilla/modded) joker it's trying to copy is blueprint compatible?

native zinc
#

brainstorm does G.jokers.cards[1].config.center.blueprint_compat

lofty sand
#

I'm searching through balatro's base code and can't find that, is it in the card.lua or somewhere else?

native zinc
#

yeah

prime beacon
#

Trying to figure out how to find the value for the played cards chip value, incl. hiker/bonus/foil, and then add it to it's own counter

tried

calculate = function(self, card, context)
        if context.destroy_card and not context.blueprint then
            if #context.full_hand == 1 and context.destroy_card == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
            card.ability.extra.chips = card.ability.extra.chips + card.base.nominal
                return{
                    remove = true,            
                    message = 'Sacrificed!',
                }
            end
        end
end

but unfortunately, the card is destroyed but no chips are added.

Tried

calculate = function(self, card, context)
        if context.destroy_card and not context.blueprint then
            if #context.full_hand == 1 and context.destroy_card == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
            card.abilitry.extra.chips = card.ability.extra.chips + context.other_card:get_id() 
                return{
                    remove = true,            
                    message = 'Sacrificed!',
                }
            end
        end
end

but when a card is played, I get the following error

#

the card id won't do what i want exactly, but at least adds the value to the card

daring fern
lofty sand
prime beacon
#

replaced if context.destroy_card and not context.blueprint then with if context.destroy_card:get_chip_bonus() and not context.blueprint then, game loads but if i start a round with the card equipped i get the error attempt to index field 'destroy_card' [a nil value]

#

Tried

calculate = function(self, card, context)
        if context.destroy_card and not context.blueprint then
            if #context.full_hand == 1 and context.destroy_card:get_chip_bonus() == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
                return{
                    chips = card.ability.extra.chips,
                    remove = true,            
                    message = 'Sacrificed!',
                }
            end
        end
end

and the game loads, but the effect no longer resolves

daring fern
prime beacon
#

oh... i see. Working now, tyvm

tawdry oriole
daring fern
daring fern
tawdry oriole
#

yeah that's what i figured out, the game launches fine without the loc_txt

daring fern
tawdry oriole
#

oh my god i'm so dumb

#

thank you

manic rune
#

did someone react to my message from like 2-3 weeks ago?? 😭

#

im actually flabbergasted

manic rune
#

i am so confused right now

#

what do you mean line 652 is on top of everything??

daring fern
subtle hawk
#

Is there a context for ante changing (Going up/down)

subtle hawk
#

Ty

tawdry oriole
#

how am i even indexing game here?

daring fern
tawdry oriole
#

yeah i figured out that mistake

#

thanks

pure salmon
#

this always gives the money and i cannot for the life of me figure out why

#

it's meant to only proc when you play at least three 7s

valid dove
#

isnt G.playing_cards your entire deck?

#

you should check context.scoring_hand

pure salmon
#

well that explans it, thank you

frigid blaze
#

Help, how to affect default_weight via joker?

manic rune
#

im confused

#

why does the input box not show any text, and the Inventory text doesnt appear when the ui is first opened?

#

like, its only when the ui is first opened too

#

am i doing something wrong??

red flower
#

creating a text input in balatro

manic rune
#

🥀

#

is this why thunk barely uses it

red flower
#

or maybe it's bad because he barely uses it

manic rune
#

true...

#

do i just not add any searching function and let players scroll through like 50 pages of items then

#

❤️

red flower
#

you need to figure it out so i can later steal it for my graveyard sorting

manic rune
#

wha

red flower
#

i want to add a search to the gy in my mod too

manic rune
#

fair

#

i will see what i can do

midnight coyote
#

what does this mean? here's the code for reference:

return {SMODS.blueprint_effect(card,right_joker,context), SMODS.blueprint_effect(card,left_joker,context)}

daring fern
red flower
#

you're trying to return no repetitions in a repetition context

midnight coyote
#

im stumped :[

red flower
#

did calculate_effect not work?

#

why if not

midnight coyote
#

no, blueprint_effect returns nil and calculate_effect expects a value

red flower
#

??

#

i told you to nil check

midnight coyote
#

it doesnt return anything

faint yacht
#

...did I not link you my multi-copying thing earlier?

red flower
#

local ret = SMODS.blueprint_effect(...)
if ret then SMODS.calculate_effect(...) end

daring fern
# midnight coyote it doesnt return anything

You would probably to do something like ```lua
local effects_table = {}
effects_table[1] = blueprinteffect
effects_table[2] = blueprinteffect
return functionthatdoesrecursiveextras(effects_table)

daring fern
midnight coyote
#

im gonna look at what ali did too, i forgot about it because as I mentioned, it was late, and i was more focued on going to sleep

daring fern
#

Instead of just what SMODS.calculate_effect supports.

red flower
#

is there something calculate_effect doesn't support

daring fern
red flower
#

makes sense

midnight coyote
#

okay, now ive got this

#

is this correct, or does the return line go in the if statement

manic rune
#

🤔 actually, does create_text_input even use callback??

red flower
manic rune
midnight coyote
#

HOLLY FUCKING SHIT IT WORKS

#

FINALLY

#

okay, now how do i change the color to green

#

🤔

daring fern
midnight coyote
manic rune
#

i

#

how did i even get this shi to work for the config tab in my pther mod???

#

😭

unborn bay
#

fuck you even doing

manic rune
#

adding create_text_input to my inventory menu

#

but the function is so jank its unreal

manic rune
unborn bay
#

text input in general is fucking wack

manic rune
#

like, why the hell does it even make DynaText not appear??? 😭

#

hwo does it even affect this

#

i might need to create my own text_input function at this point

#

bad fix but i have the text input box auto-selected when the ui is opened, so i guess thats problem solved?
-# tbf its a shit fix but at least i dont have to try and fix the whole function

#

actually, never mind

#

all it needed was a :recalculate when the ui loads

tawdry oriole
#

how do you set money to zero?

runic pecan
rugged pier
manic rune
#

this is

#

a crafting table

tawdry oriole
#

thank you

runic pecan
#

So, I have a voucher with the unlock condition labelled "Have your full deck consist of only one suit", but in reality it just counts how many card of your full deck is with each suit and unlocks the voucher if any suit counter equals the size of your full deck.
How do I rephrase it better?

manic rune
#

enhanced anvil reminds me of that golden anvil you would find in holocure

manic rune
#

or wait

#

hm

runic pecan
manic rune
#

if the suit number needs to be equal to the size of your full deck, then doesnt that mean the full deck only has one suit?

#

unless you somehow got 53/52 cards, idk

sturdy compass
#

Bouquet sounds familiar 👀

manic rune
#

is that benson's suit from regular show

runic pecan
manic rune
#

Have your full deck consist of only one suit. (Wild cards are excluded)? id probably try to specify that wild cards will still allow that to be unlocked, somehow

runic pecan
#

"Have all cards in your full deck be able to be considered one single suit." is a candidate.

manic rune
#

Have all cards in full deck count as only one suit.?

runic pecan
#

"Have all cards in your full deck be with one same suit." is shorter, but doesn't feel enough.

runic pecan
manic rune
#

Have all cards in full deck able to be counted as only one suit.??

#

oh actually i realized that does sound similar to the one you sent above

runic pecan
#

"Have at least one suit being with all cards in your full deck"
Except we usually say "card with suit" and almost never "suit with card".

red flower
#

that phrase doesn't make sense to me

#

"Have all cards in your full deck count as the same suit" is good enough I think

pure salmon
#

"Have only one suit of cards in your full deck" is good enough and easily understandable imo, even if it's ambiguous about wild

rugged pier
#
local base_calculate_enhancement = Card.calculate_enhancement
function Card.calculate_enhancement(self, context)
    local ret = base_calculate_enhancement(self, context)
    if not ret then return end
    print(ret)

why doesnt this print anything when i play a Bonus card?

runic pecan
manic rune
#

what did i do?? 😭

rugged pier
manic rune
#

what are you trying to do

rugged pier
#

im trying to multiply the effect of enhancements

#

but i need to see what the return object is of "calculate_enhancement"

#

but when i do print(ret) in that code, i get nothing in the console

manic rune
#

have you tried

local base_calculate_enhancement = Card.calculate_enhancement
function Card.calculate_enhancement(self, context)
    local ret = base_calculate_enhancement(self, context)
    print(ret)
    return ret

? i dont really think the nil check there is necessary

#

and thats assuming the enhancements do use that function for their calculate

#

:p

rugged pier
#

and its used in eval card

#

function

runic pecan
rugged pier
#

should do it

manic rune
rugged pier
manic rune
#

oh wait

rugged pier
#

literally my entire screen filled with "nil"

manic rune
#

i think i might see why

rugged pier
#

yeah?

manic rune
#

remove self

#

keep self in ret though

rugged pier
#

ah

#

okay let me try

#

crashed upon loading the blind

manic rune
#

i mean, the og function doesnt use self

rugged pier
manic rune
#

🤔

rugged pier
#

so i need to use self right?

manic rune
#

not sure if thats the issue, try replacing . with :

rugged pier
#

okay

native zinc
#

i didn't ev

#

what

runic pecan
placid star
#

what would be the most efficient context for checking how many of X cards are in the deck?

manic rune
#

what are you trying to do x2

placid star
#

lmao

#

scale Xmult with number of spade face cards in deck

manic rune
#

mm i see

#

use context.before, then

#

wait

runic pecan
manic rune
#

🤔 is it like

"Increase XMult by (x) for each spade face cards in deck (Currently X(y) Mult)"?

placid star
#

yeah excactly that

unborn bay
placid star
manic rune
#

well, performance-wise speaking, use context.playing_card_added and context.remove_playing_card, as well as setting the XMult to a number when its first added

#

that should make it so XMult is only recalculated when a playing card is added/removed, but if you want it to be more precise, add the count in calculate without any context wraps

placid star
manic rune
#

and it will be pretty accurate too

runic pecan
red flower
#

the update logic here doesn't make sense
just calculate it in joker_main and loc_vars

manic rune
#

but also, i think another approach is:
in loc_vars, run the count in there

and have a count function in context.joker_main

red flower
#

same braincell

manic rune
#

oh hey i guessed it right

#

:3

placid star
#

yeah that does make more sense lmao tysm guys!!

runic pecan
manic rune
#

🤔 how so

unborn bay
#

huh?

red flower
#

the only "bug" is that the tooltip won't update in real time but it's a non-issue

manic rune
#

if you mean that the loc_vars can crash if theres no G.playing_cards to check, just add a nil check there, or G.playing_cards or {} in the ipairs

native zinc
#

is there a function that plays after cards are scored in boss blinds

runic pecan
native zinc
#

i guess i coul d. make an event

unborn bay
runic pecan
native zinc
#

. those exist

#

well that's significantly easier

red flower
#

if you need to pick a rank you do it in calculate

runic pecan
native zinc
manic rune
#

boss blinds have calculate now

#

what they mean is that you should use it

native zinc
#

wh ...

manic rune
#

undocumented, i think :3

runic pecan
red flower
#

G.GAME.blind.boss is shorter

bold sleet
unborn bay
manic rune
unborn bay
#

so the alternate small and big blinds from ortalab for example would return true to that

native zinc
#

oh my god

bold sleet
native zinc
#

grrr no doc updates

#

it works

manic rune
#

this is how i fixed it

unborn bay
#

to quote a world famous video game designer

#

it just works

bold sleet
#

can send code so I can steal copy it?

manic rune
#

:3 sure, one sec

bold sleet
#

colon three!

manic rune
bold sleet
manic rune
#

use the new text_input function instead of create_text_input, btw

bold sleet
#

yummers

#

exactly, what function should I call to make the thing happen?

#

And more importantly, how does sh*t work?

manic rune
#

basically, the text input only loads properly after :recalculate, so all i did was adding func = ... to ensure that it loads the moment the ui is created

bold sleet
#

a

manic rune
#

so instead of using create_text_input, use the new function

#

it functions exactly the same as how you would use create_text_input, with the only difference being it loads :p

bold sleet
#

The difference: It doesn't fuck itself up

manic rune
#

so true

bold sleet
#

It actually works lmao

#

That's the difference

#

Me when the text input actually works:

manic rune
#

its a coincidence that i worked on text input today too lol

daring fern
#

Is this effect possible?: ```
All poker hands can be made with 2 cards

bold sleet
manic rune
#

wuh

#

that sounds complicated to implement

runic pecan
red flower
#

coding wise i dont think it would be hard at least for vanilla hands, but i dont know what two cards can count for each hand

manic rune
#

should i suggest create_text_input to be patched with that for smods, actually

runic pecan
runic pecan
# daring fern Yes.

But what about the oaks, Two Pair, and Full House?
If you can't answer that, maybe just word it like Four Fingers, "Flush and Straight can be made with 2 cards", because that's certainly not all poker hands.

rugged pier
#

like this?

daring fern
runic pecan
bold sleet
rugged pier
manic rune
#

🤔 how though, thats how i usually hook

bold sleet
#

Ye

rugged pier
bold sleet
#

I suspect it is because the function is like, only ran in one node and thus the other one makes everything go haywire.

rugged pier
bold sleet
#

Just need a way to detect it being unclicked or something.

manic rune
#

oh wait i think i see why

#

probably shouldnt use G.GAME

#

since thats used by all the text_input

bold sleet
#

how fix

manic rune
#

try saving to somewhere that only the ui can check

bold sleet
#

i stoopid

manic rune
#

🤔 an idea is to check from e instead

cyan urchin
#

yo im just looking to change the sound effects of balatro how would i do that?

#

sorry to but in lol

manic rune
#

does G.GAME[{}] work, actually

#

probably not though, i assume

bold sleet
#

Put the function inside G.GAME?

runic pecan
manic rune
#

oof

#

hm

bold sleet
#

It is hardcoded to be inside G.FUNCS

#

Haven't checked the code, but I am almost certain it will look something like G.FUNCS[func]

#

this it is indeed, hardcoded

#

I am going to have lunch.

#

Try to figure it out, will ya'?

#

ty

daring fern
manic rune
manic rune
rugged pier
#
if card.ability.set == 'Enhanced' then
        local enhancement = card:calculate_enhancement(context)
        if enhancement then
            ret.enhancement = enhancement
        end
    end
``` is this actually being used in enhancement calculation because its literally just printing nils
daring fern
runic pecan
rugged pier
rugged pier
manic rune
daring fern
manic rune
#

a

#

i was curious if you were still working on the "buff all jokers" section lol

daring fern
# manic rune a

I was working on a mod that added jokers, then I stopped developing it, because I made seals on everything, now I'm working on developing it again.

runic pecan
rugged pier
daring fern
manic rune
#

i dont think thats possible

rugged pier
manic rune
#

since most stuff check #G.jokers.cards

daring fern
manic rune
#

so unless you plan on patching every line that uses #G.jokers.cards, its impossible

rugged pier
manic rune
#

negative would become the worst edition you can get in that case, actually

rugged pier
#

why

manic rune
#

since theres no need for +joker slots anymore

rugged pier
#

the only reason you get + joker slots is to collect non negative jokers

#

negative jokers still have their own use case

manic rune
#

yeah but if all joker slots count as empty, then you technically have inf joker slots, no?

rugged pier
#

yeah thats the point i suppose?

manic rune
#

thats my point, it kind of defeats the whole point of negative

daring fern
rugged pier
manic rune
#

what they meant is that the text would still show the correct joker slot amount

rugged pier
#

but functionally you wouldnt, that would mess up how the logic works

#

its a more convulated, if not worse, negative

turbid maple
manic rune
#

wuh

#

thats possible????

sturdy compass
daring fern
manic rune
#

oh

turbid maple
#

i think so?

daring fern
rugged pier
#

where are enhancements calculated

vast fractal
#

what is the function to set the hands and discards amount?

hushed estuary
#

Is there any way to get a rank by id? Like, for example, jacks have an id of 11

manic rune
#

:get_id()

manic rune
hushed estuary
#

No I need the SMODS.Rank

#

And I have the id

manic rune
#

a

#

i havent tinkered with smods.rank yet, sorry

manic rune
#

im currently not at my pc, but my theory is that vanilla enhancements probably dont use calculate, idk

rugged pier
#

okay let me try modded stuff

#

yeah didnt work

#

still a bunch of nils

manic rune
#

hmmmmm

daring fern
manic rune
#

-# actually?

rugged pier
#

do they just use this then

#

i got this to work

#

^like modifying editions

#

i just didnt get enhancements to work

#

which looks like the same function but apparently doesnt work

midnight coyote
#

how do i choose the set from which a booster pack selects from?

#

is that what pools is for?

red flower
#

if you're making a booster pack you do it in create_card

midnight coyote
hushed estuary
midnight coyote
#

create_card = function(self,card,i)?

#

and then make sure said function returns a card?

bold sleet
#

I have returned.

#

@manic rune got anything?

manic rune
#

im still away from my pc rn, i will be back in a few minutes

bold sleet
#

ok

midnight coyote
#

yeah

rugged pier
#
if context.destroy_card and card.ability.extra.uses_left == 0  and context.cardarea ~= G.hand then
            G.E_MANAGER:add_event(Event({
                func = function()
                    card:start_dissolve({G.C.BLACK, G.C.RED, G.C.RED}, true, 5)
                    return true
                end,
                blocking = true
            }))
            return {
                message = 'Dragged!',
                remove = true
            }
        end

when i do this to destroy a card thats enhanced, it removes every card in deck as well

manic rune
#

since you only excluded it from checking G.hand, it will go through G.play, G.deck

rugged pier
manic rune
#

and context.cardarea == G.play

#

then check if context.destroy_card has any enhancement

rugged pier
#

gotcha ty

manic rune
bold sleet
#

watefuk

manic rune
#

you prob did something wrong on your end

bold sleet
#

can help me fix?

manic rune
#

sure, take a ss of the code rn

bold sleet
#

mayhaps in a VC, screenshare at least?

manic rune
#

a

bold sleet
#

I can send over stuff anyways

manic rune
#

my pc is ass, i dont think i can handle VC with vsc on rn

#

sorry

bold sleet
#

ok

manic rune
bold sleet
#

discord is stoopid

#

DPP stands for my mod stuff

#
 DPP_create_text_input{
    ref_table = DPP.test_b,
    ref_value = "test",
    max_length = 8,
    w = 1.8,
    h = 0.2
 }

calling the function like that

tired kestrel
#

Right now I made this jpeg shader for balatro I have no idea if I translated it correctly.

#

something new

rugged pier
#

dont know if this helps you in the future

#

thought id share

rugged pier
#

yeah

manic rune
#

oh

#

:3

#

i thought its a joker's effect lol

rugged pier
#

ah lol

#

something similar works in a joker too btw

bold sleet
#

-# got anything?

manic rune
#

nope

bold sleet
#

-# i am so stoopid

manic rune
#

card refers to the joker, so it shouldnt work

rugged pier
#
if context.destroy_card and context.destroy_card == context.scoring_hand[1] and card.ability.extra.destroy and not context.blueprint then
            card.ability.extra.destroy = false
            return {
                message = 'Destroyed!',
                remove = true
            }
        end
#

not card

#

but you can specify which card by indexing the scoring hand

manic rune
#

or that, yeah

but i assumed you wanted to destroy all scored enhanced cards

rugged pier
#

fair enough

manic rune
#

whats the crash log?

soft echo
#

i'm trying to check to see if the player has a specific joker with another joker. how exactly would i go about doing that?

manic rune
#

i dont see anything wrong here

tired kestrel
#

now how do I add an edition?

manic rune
#

and honestly, the code shouldnt cause any crash now that i read it again

bold sleet
tired kestrel
#

hm?

manic rune
#

my old implementation was that it uses G.GAME to check for something, but i forgot i already replaced that

bold sleet
#

Acts the same as when I was clicking it, but now it fucks itself up when releasing.

manic rune
#

nothing breaks for me

#

idk

manic rune
# bold sleet ???

ok idk, try adding a delay into the event in DPP_load_text_input probably?

soft echo
bold sleet
#

ok

manic rune
soft echo
#

ooohhh thank you

bold sleet
#

no worky

#

I'll take your code snippet and add it withot modifications

#

to see if i fucked up anything by accident

#

no worky wtf

manic rune
#

weird

tired kestrel
#

darn it.

manic rune
#

maybe try removing blockable?

tired kestrel
bold sleet
#

trying...

tired kestrel
#

this is the shader code I currently have I don't know why the % symbol is the issue.

bold sleet
#

nopeb

manic rune
#

ok idk, i guess its how your ui is constructed at this point

#

still weird that it breaks when there r more than 2 text input boxes though

#

it shouldnt do that

shell timber
bold sleet
#

I don't force you, but idk

manic rune
#

whats DPP.reload_lists() btw

bold sleet
#

It reloads some list I have for seals, enhancements, etc

#

a sec

#

lemme give you a bit more context

manic rune
#

🤔 what runs DPP.main_menu()?

tired kestrel
bold sleet
#

All these cycles things are controlled by lists, that contain well, ranks, suits, etc

manic rune
bold sleet
#

reload_lists just empties and fills them again

manic rune
#

ohh, i see

bold sleet
#

It shouldn't cause any problems, tho

tired kestrel
manic rune
tired kestrel
#

I tried to port the shader into game maker once but it did barely work.

#

so yeah.

bold sleet
tired kestrel
#

now balatro's shader code is the next level now.

manic rune
bold sleet
#
function G.FUNCS.DPP_reload_lists()
    DPP.reload_lists()
    G.FUNCS.DPP_main_menu()
end
faint yacht
bold sleet
manic rune
bold sleet
#

Do I just create a wrapper root node?

manic rune
#

mm probably, yeah

#

every ui should have a G.UIT.ROOT

tired kestrel
#

can you tell me who were the people that knows shaders?

manic rune
#

thats probably why the alignment all fucked up

tired kestrel
#

aside from Bear

manic rune
bold sleet
#

hmmmmmm

manic rune
#

though, please dont annoy them by dming them too much when they dont respond :p

tired kestrel
#

I don't know if he would take a look but my impatence was just well...

#

I try to control myself from being impatient

#

but yeah.

#

I don't know cause he haven't responded to me

#

even though I was new at the time.

#

I didn'T dm them a lot

#

just once

runic pecan
#

Am I able to put Eternal sticker on playing cards?

tired kestrel
#

except

manic rune
#

i understand, not having your code (or just basically anything) working can be quite annoying, but its not a good habit to put that impatience on others :p

tired kestrel
#

I only sent him a waving as a dm but yeah.

tired kestrel
#

and also the point

manic rune
tired kestrel
#

cause honestly I've been asking help a lot when I had an issue about trying to get the joker to like copy the played card.

#

So yeah.

#

honestly the fuiquent amount of users here haven't taken noticed on other helps or issues

#

or maybe guidence to new members

#

I mean a tutorial would help

#

but yeah.

red flower
#

the problem is also just people not knowing about your issue, I've noticed it but idk what the problem is

manic rune
#

shaders are like, some of the most complicated stuff you can work on for a balatro mod

#

so there arent many people that can read shader's code, let alone troubleshoot lol

red flower
#

yeah i hate shaders

manic rune
#

same

#

also N'

tired kestrel
#

but yeah.

#

mostly that.

manic rune
#

i figured out the fix to the text_input thing, in case u havent noticed it yet
-# and when im typing this, i realized you probably already read that, but leaving the conversation with "also N'" is weird, so

tired kestrel
#

But I'm thankful for a few people to notice mostly but yeah. I don't understand mostly why it's easily ignored.

#

I mean would've used pings

#

but that might not work

#

I don't think

red flower
manic rune
#

:3 damn

bold sleet
#

dismantling the whole UI to get it working again, help

manic rune
#

😭

#

i mean, your fault for not having G.UIT.ROOT before coding in everything

#

:3

bold sleet
#

why tf is the root node green ish?

#

Can I make it not visible?

#

The green aaa square

manic rune
#

G.C.CLEAR

bold sleet
#

inside my root node or huh?

red flower
#

color = G.C.CLEAR in the roots config

manic rune
#

^

bold sleet
#

oko

manic rune
#

i need to come up with more material/crafting recipes/relics ideas later

bold sleet
manic rune
#

idk try

#

i do not take responsibility for when your pc suddenly explodes

bold sleet
#

It still fucks itself 😭