#💻・modding-dev

1 messages · Page 385 of 1

daring fern
#

SMODS.find_card?

long sun
#

does that return how many there are?

daring fern
long sun
#

ah schweet :D thanks!

harsh sonnet
#

ok so im still just a few days into lua coding on balala and there seems to be an issue with this part of my code
maybe probably the way im trying to check if .ppay exists under G.jokers.highlighted[1].ability and if not to create it but i got no idea how to fix that (if that even is the problem)

G.E_MANAGER:add_event(Event({func = function()

    if G.jokers.highlighted[1].ability.ppay == nil then
        G.jokers.highlighted[1].ability.ppay = G.jokers.highlighted[1].base_cost
    else
        G.jokers.highlighted[1].ability.ppay = G.jokers.highlighted[1].ability.ppay * card.ability.extra.rate
    end

    local mai = SMODS.shallow_copy(G.jokers.highlighted[1].ability)
        if G.jokers.highlighted[1].ability.ppay == nil then
            G.jokers.highlighted[1].ability.ppay = G.jokers.highlighted[1].base_cost
        else
            G.jokers.highlighted[1].ability.ppay = G.jokers.highlighted[1].ability.ppay * card.ability.extra.rate
        end
        mai["mult"] = mai["mult"] * card.ability.extra.nlrg
        G.jokers.highlighted[1].ability = mai


return true end}))
hard mica
daring fern
# hard mica
local oldcalcseal = Card.calculate_seal
function Card:calculate_seal(context)
    if not self.ability.set then
        print(self)
    end
    return oldcalcseal(self, context)
end
```?
wise walrus
#

Bumping this before I’m able to work on it today. Still not sure why one hand check for ‘Wicked’ cards repeats code 4 times

red flower
red flower
timid star
#

how do i prevent the custom suit from being included in the default deck

harsh sonnet
# red flower what's the card supposed to do?

its a partner™ that when clicked doubles(.nlrg) a jokers values (currently only Jokers "Mult")
for the cost of it's base_cost
then it should add ppay to the jokers .ability which is the same as base_cost
if ppay already exists there it should be multiplied by .rate

red flower
#

and what's the issue with the code exactly?

#

does it not work or is it something else

#

thank you something

harsh sonnet
#

well if i actually click on the partner i

red flower
#

I'm guessing this is from shallow_copy? maybe the ability table is nil

#

but idk much about partners havent made one yet

harsh sonnet
wise walrus
red flower
#

for what you want calculate with context.hand_drawn probably works

red flower
misty shoal
#

why does it crash when refering to context.blind?

harsh sonnet
#

wait i figured something out
now i have a different problem
but hey
im not crashing anymore

unborn bay
#

reference G.GAME.blind

misty shoal
#

chicot lied to me?..

unborn bay
#

most likely only exists during context.setting_blind

misty shoal
#

ah

misty shoal
chrome widget
#

Yep, there's only certain things in the context table at certain times

#

Though if you want to refer to the current blind you can also refer to G.GAME.blind

long sun
#

hmm, this code isn't working

daring fern
long sun
#

it's supposed to call add/remove_prog for all zodiacs that have them, when it's added or removed

#

relevant for the two that add discards / hands

daring fern
long sun
#

ah oops

#

i'm guessing it should be card.center.add_prog then?

daring fern
long sun
#

ah ^^!

#

thanks!!

bleak crane
#

how do i add the tool tip next to my joker description, like how this has the description for stone cards?

red flower
#

info_queue

bleak crane
#

woohoo

frigid blaze
#

Can you tell me in which program is the best to make drawings for Jokers?

chrome widget
#

Aesprite!!

frigid blaze
#

Are there any rules for drawing them? 😀

#

Also wanted to know what words are usually highlighted in the description of the joker, everyone has a different one, there is not some common meaning?

chrome widget
#

Here's a big style guide reference

slow brook
#

how can i activate a card twice? (just so i can display messages twice)

chrome widget
#

Also, for joker descriptions, you'll just want to look at what Vanilla does consistently

#

It's not universally consistent, but just find a vanilla joker that has a close enough effect and use that as a reference

manic rune
daring fern
manic rune
#

true

daring fern
#

Unlike SMODS.calculate_effect

spice wadi
#

Gotta love the question mark react 💀
I just meant I remembered I can have custom contexts using that which might make my joker with multiple repeating effects and messages much more efficient

harsh sonnet
manic rune
#

G.jokers.highlighted[1] might not even exist

#

you want nil checks

harsh sonnet
#

oh

manic rune
spice wadi
manic rune
#

sob

red flower
#

calculate_effect would do nothing different in that case

#

it literally does the same thing as returning

spice wadi
#

I'm fully aware

#

But I'm gonna use that (or I remembered there's an actual method for retriggering jokers) to just retrigger the joker instead

manic rune
#

theres indeed an actual method to retrigger jokers

spice wadi
#

Yeah I forgot about that

#

I'm not sure if a custom context would be better or not
Just cos idk how retriggering interacts with final_scoring_step

subtle urchin
#

Hi! just arrived cuz im having problems intalling the bunko mod, i followed a tutorial about installing lovely and steammodded, opened the game via steam and it worked, but after adding the latest bunko version the game crashes with: Oops! The game crashed:
Syntax error: card.lua:5368: 'end' expected (to close 'function' at line 828) near '<eof>' and i can´t find anything about it in past messages, anyone knows how to fix? thanks!

#

or do you need the rest of the message

#

just tested opening without the mod and that does work

daring fern
subtle urchin
#

yeah it now works! thanks!!

#

the other version i got was the one in the description of its trailer btw if it needs report or sth

harsh sonnet
#

so this ive learned is illegal (cuz im crashing)
now my question is: how else am i supposed to do it

red flower
subtle urchin
#

ohhh okay, thanks!

red flower
#

and modify card.ability

harsh sonnet
#

god dammit

#

i have no idea how to tho 😭

red flower
#

i mean if you copy that if condition to calculate and modify card.ability.extra.nlrg_cost it should work

harsh sonnet
#

no i uh
i have no idea how to create new functions in lua

red flower
#
function name(args)
end
#

but I'm saying that you use the card's calculate function

placid star
misty gorge
#

Tried making my joker work, now it just does nothing if my last hand is like 60

harsh sonnet
#

ima try
ill be back for the next crash

slow brook
#

how do i localize the text of an undiscovered custom consumable

daring fern
misty gorge
#

Doesn't G.GAME.chips return the round score? I want the hand score

daring fern
misty gorge
#

Awh

#

Well in that case I'll figure out some other use for this card

maiden phoenix
#

You can save it in a calculate function perhaps

#

Like during context.end_of_round

misty gorge
#

Oh maybe yea

red flower
#

you would save it at final_scoring_step and then use that

slow brook
#

how do i localize the name, collection, and undiscovered description of a consumable type

maiden phoenix
slow brook
placid star
#

whats the thingy to find the mod prefix of a card?

daring fern
misty gorge
#

Still does nothing, do I need to place final_scoring_step in the dollar function?

daring fern
maiden phoenix
#

If you put it in a local it will remain in calculate, put it in a card.ability.extra variable

#

card.ability.extra.final_hand_score = ...

#

So you can reference it in calc_dollar_bonus if it exists

misty gorge
#

Ah, okie

hard needle
#

how can i use SMODS.change_base to only change the rank of a card?

red flower
hard needle
slow brook
red flower
#

i would recommend looking at a mod that adds new consumabletypes like cryptid

maiden phoenix
#

Remove the local

misty gorge
# maiden phoenix Remove the local

Still seems to do nothing for some reason, maybe it's my calculation idk but I do know it should trigger when my final hand scores a 60 (since 300/2 is 150)

maiden phoenix
#

I wonder if G.GAME.blind.chips exists in calc_dollar

misty gorge
#

Ig I can try and maybe put the blind chips in a extra variable

#

Wait

harsh sonnet
misty gorge
#

I'm fucking stupid

#

I forgot it has to be my last hand

#

Sorry for wasting ur time, I'll go test it quickly

red flower
maiden phoenix
harsh sonnet
misty gorge
harsh sonnet
red flower
harsh sonnet
#

i hate this bs

#

thank u once again

maiden phoenix
#

If you install it normally it should highlight where the error is

red flower
#

get the sumneko one

spice wadi
#

I'd also look into setting up your workspace folders to include Steammodded and the balatro source code

misty gorge
#

true

#

there's a LOT of useful stuff there

harsh sonnet
#

i aint that smart guys

#

i only code as a side hobby
aka bc im too addicted to balatro

spice wadi
#

I also am not smart but it's surprisingly easy to set up

#

And I'd recommend it even more if you're doing this as a side thing

daring fern
slow brook
harsh sonnet
#

time to look for a tut on how to set up (now that im (hopefully) almost done)
also just to clarify
were still talking vs code right?
or have i been living IN a rock

slow brook
maiden phoenix
#

You must glibolask with the trufunc and add the susball

#

Shrimple as that

misty gorge
#

i should set up that stuff too, I hate not having like tooltips and stuff show up for me in vscode

slow brook
# harsh sonnet so real

if you figure out how to include the lovely dump in the workspace tell me how cuz i dont even know whats a dump (in this case of course)

harsh sonnet
#

i cant find no sumneko on vs code 💔

red flower
maiden phoenix
red flower
#

i just have my entire mod folder open

harsh sonnet
#

ts is all my dumbass can see

red flower
slow brook
maiden phoenix
#

usually it might be due to outdated vscode methink

#

Try the website link still

harsh sonnet
#

well "trying" i am

slow brook
harsh sonnet
#

do i even have the right vs code atp

red flower
#

do you have vscode or visual studio

slow brook
harsh sonnet
#

purpul

slow brook
#

no wonder then

red flower
slow brook
#

that's not vscode

daring fern
spice wadi
hard mica
daring fern
#

Also Blue and Gold wouldn't work with this method.

daring fern
harsh sonnet
#

holy shit i did it i think

#

everything is so colorful

slow brook
slow brook
hard mica
hard mica
slow brook
#

does any joker in vanilla even do something like that?

harsh sonnet
#

its beautiful
now how tf do i zoom

long sun
#

hi! how would i add a modded consumable type to the shop pool, if a particular deck is selected?

#

(similar to Ghost Deck)

wheat jewel
#

How do i check if a specific type of spectral card is used

daring fern
wheat jewel
#

since black hole isn't a planet card

daring fern
daring fern
#

Just set it to "Red" for now.

hard mica
daring fern
hard mica
daring fern
# hard mica

If you did Red = 'Red' in the table then yes it would exist.

#

But currently it doesn't.

wheat jewel
#

how do i specifically check for the black hole spectral card in the consumable section

daring fern
wheat jewel
#

let me try that

#

I got an error

#

Oh wait nvm

#

Figured out i removed a lot of the if statement

daring fern
hard mica
#

when i was doing that long code

long sun
#

OH i see

#

ya

#

cheers ^^

#

shop_rate

wheat jewel
hard mica
#

now the seal appears

daring fern
broken rivet
#

somehow the check at the bottom here is always hitting the leftmost instance of the joker, not the specific instance being calculated

daring fern
hard mica
#

when it socres

long sun
#

one more question :>

#

how does shop_rate work? what would a shop_rate of 1 mean?

#

what are the vanilla shop_rates?

daring fern
# hard mica

Add this after you define temp_card: ```lua
temp_card.juice_up = function(self, scale, rot_amount)
return card:juice_up(scale, rot_amount)
end

broken rivet
daring fern
broken rivet
daring fern
broken rivet
#

also context.forcetrigger is a context added by the cryptid mod

#

that line does nothing

broken rivet
broken rivet
#

ah

#

yeah i just wanted it to do nothing in that context

daring fern
broken rivet
#

without having to wrap everything in a big if statement

broken rivet
daring fern
daring fern
#

Also with this method you could also get it to copy modded seals, but there would be possible crashes.

hard mica
harsh sonnet
#

ok hey ive done it almost
everything pretty much works
my only issue:
how do i update this passage every time i highlight a joker instead of when i press on the partner

daring fern
daring fern
hard mica
daring fern
hard mica
#

is it good?

undone stirrup
#

I need some help, I have steammoded and lovely installed, and I have the balatro multiplayer installed, but when I try to add bunco I get an error. (if im in the wrong chat lmk)

daring fern
undone stirrup
#

i tried adding it to the mods folder, but I get this error screen

daring fern
# hard mica is it good?

No, it would be something like ```lua
local temp_card = create_fake_joker(card, "c_base", "add_to_deck")
temp_card.seal = self.config.extra.SealType
local usedfunction = Card.calculate_seal
return usedfunction(temp_card, context)

daring fern
undone stirrup
#

previous what?

hard mica
undone stirrup
daring fern
daring fern
maiden phoenix
#

JoyousSpring makes use of this if you need a ref

daring fern
hard mica
daring fern
#

Also you need to do temp_card.seal = self.config.extra.SealType

hard mica
#

and it does nothing

hard mica
daring fern
slow brook
#

how do i check if a joker is from my mod

daring fern
hard mica
daring fern
hard mica
#

it does nothing

manic rune
#

remove the local

daring fern
marsh turtle
#

is there a way to grab specific types of jokers to be reactivated? Example being retriggering any joker that gives chips on the final hand of the round

daring fern
red flower
slow brook
#

why does this crash when i click on a vanilla joker? shouldn't it just return false?

maiden phoenix
#

Context doesn't exist anywhere else

slow brook
maiden phoenix
#

This context is not defined

manic rune
#

calculate has context in it:

calculate = function(self,card, context <---)

#

can_use doesnt provide it

slow brook
# maiden phoenix

yeah but that's inside the first if, and it shouldn't even consider that one if card.config.center.original_mod == false

#

and if its from a mod i made sure that every joker provides the context in can_use_plantfood

red flower
#

whats the crash log

slow brook
#

what's card in this context, the consumable or the joker i select?

red flower
#

the consumable

slow brook
red flower
#

G.jokers.highlighted[1]

slow brook
#

oh so i should change card.config.center.original_mod to G.jokers.highlighted[1].config.center.original_mod? Cuz i want to check if the joker i select is from a mod

red flower
#

yeah

#

you should also check if it exists first

slow brook
#

#G.jokers.highlighted > 0 ?

red flower
#

that works yeah

harsh sonnet
red flower
harsh sonnet
#

could u explain that to me like im 5? qwq

red flower
#

no

hard mica
harsh sonnet
#

ok 🥀

red flower
harsh sonnet
#

thank u <3

daring fern
placid star
#

where are the poker hands stored?

daring fern
harsh sonnet
placid star
#

should this work to upgrade spare trousers with 4oak aswell? i tested and its not working

placid star
daring fern
placid star
#

but could i change 4oak to inherantly include two pair in checks for that kinda stuff?

slow brook
#

can i check the order of ranks of cards played from left to right?

daring fern
high sinew
#

tryna figure out the easiest way to check if a playing card has an edition when played what if can I use to do it? is set_edition gonna work just wanted to ask before doing anything

#

it upgrades cards to next edition foil --> holo --> neg --> poly

#

idk if that will work

daring fern
high sinew
#

ok bet yea i forgot about that tag

placid star
high sinew
daring fern
red flower
high sinew
slow brook
placid star
daring fern
primal terrace
#

Sorry to interrupt

Trying to implement a deck that changes all 52 cards to be a random chosen card, but the pseudorandom always chooses the same card regardless of seed

How would I change it so that it is different every run?

placid star
daring fern
slow brook
daring fern
placid star
#

what would be the best way to change this, its in SMODS/game_objects

broken rivet
#

really wish there was a way to detect the most recent card in a blueprint chain

digital niche
#

how do i check if a joker is from some set? like how cryptid makes "Sweet jokers"? i already have something defined for the jokers i want

misty gorge
#

How do I make it so that only playing Hearts and Clubs triggers the joker, tried doing it like this but it keeps triggering when for example spades and hearts are played (ig because it detects that hearts is there)

digital niche
#

also can i check if something is from X mod or vanilla?

daring fern
digital niche
daring fern
digital niche
#

tyty!

minor magnet
#

does context.blueprint_card not work with juice_up?

#
   calculate = function(self, card, context)
      if context.starting_shop or context.reroll_shop then
        for k, v in pairs(G.shop_jokers.cards) do
          G.E_MANAGER:add_event(Event({trigger = "after", delay = 0.5, func = function()
          if v.cost - card.ability.extra.discount >= 0 then
            v.cost = v.cost - card.ability.extra.discount
            if context.blueprint_card then context.blueprint_card:juice_up() else card:juice_up() end            
            v:juice_up()
            play_sound("coin1", 1.2)
          elseif v.cost > 0 then
            v.cost = 0
            if context.blueprint_card then context.blueprint_card:juice_up() else card:juice_up() end
            v:juice_up()
            play_sound("coin1", 1.2)
          end
          return true end}))
        end
      end
    end

this is my code

primal terrace
digital niche
daring fern
digital niche
#

yeah

#

wait no actually

minor magnet
digital niche
#

it checks if the highlighted things have an enhancement then if its from this mod

minor magnet
#

to check the mod

digital niche
#

it should check if the highlighted card have an enhancement from tat mod

minor magnet
#

wait im stupid

digital niche
#

not if the consumable is from the mod

daring fern
minor magnet
#

</3

hot granite
#

there's a lot of functions

minor magnet
#

but ye should be fine then

hot granite
#

that's what everyone else is here for, to assist

minor magnet
#

you learn something new everyday

digital niche
#

if it have 2 enhancements from that mod it still can be used

daring fern
# misty gorge -# bump

Why are you checking if the card is not spades or diamonds if you only want it to trigger on hearts and clubs?

misty gorge
#

It didn't work when I checked for if card is hearts or clubs so I thought the opposite might work

slow brook
#

why doesn't it work (i want to do one effect if cards in played hand are ascending and another if they are descending)

daring fern
hard mica
hard mica
daring fern
#

See what's going wrong.

slow brook
#

why does that print out attempt to compare two table values? I took only the [i] of it so it should be one singular value

unborn bay
#

full_hand is a table of tables

#

specifically cards

slow brook
#

aah so i have to take the rank of the card inside full_hand

placid star
#

is there a pool for suits?

unborn bay
#

SMODS.Suits

slow brook
daring fern
daring fern
misty gorge
#

Thanks

broken rivet
#

fuck it i'm posting this whole thing here because there's so many weird bugs
this is meant to be a left and right blueprint but it has so many weird things going on
like somehow a bunch of scaling effects are entirely disabled if a joker is anywhere to the right of this one
in a chain of 3 the third one triggers the last joker twice rather than both first and last once

#

i'm genuinely just lost

daring fern
broken rivet
#

oh that's a thing?

daring fern
broken rivet
#

huh

daring fern
# broken rivet huh

Also you should use a function that does the extra sorting so you don't have to check if it exists.

worthy stirrup
#

Just to be sure, this is how I could get every card in the deck, right?

  calculate = function(self, card, context)
    if context.setting_blind then
      for c = 1, #G.playing_cards do
        local card = G.playing_cards[c]
        print(card)
      end
    end
  end
daring fern
daring fern
broken rivet
#

also is this able to handle a joker returning nothing

daring fern
broken rivet
daring fern
hard mica
#

im really unsure why this error appears? the problem is with the purple and blue seals , i had the gold and red seal and they worked fine with eachother but once i added the blue and purple seal it keeps crashing when it wants to score any card

worthy stirrup
#

How could i destroy a card thats in the deck?

daring fern
worthy stirrup
#

and thats it?

daring fern
worthy stirrup
#

thanks

broken rivet
red flower
#

i think it should be an smods utility actually i think a lot of people want to use nested returns

daring fern
broken rivet
#

ah

worthy stirrup
#

How could i have my boss score requirement change mid blind?

daring fern
daring fern
daring heron
#

How would i change specifically the description and nothing else of the jokers?

worthy stirrup
hard mica
daring fern
flat sorrel
daring heron
worthy stirrup
#

hm, it seems to destroy the cards but not increase score requirement

    calculate = function(self, card, context)
    if context.setting_blind then
      for c = 1, #G.playing_cards do
        local card = G.playing_cards[c]
        if card:is_face() then
          card:start_dissolve()
          G.GAME.blind.chips = G.GAME.blind.chips * 1.1
        end
      end
    end
  end
daring heron
#

Using SMODS:Take.Ownership right?

#

Or something like that

daring fern
daring fern
daring heron
#

Wait mb

slow brook
#

how can a consumable delete a selected joker?

daring heron
#

But i dont want to edit the base localization files

hard mica
flat sorrel
daring heron
#

Oh ok

flat sorrel
#

if you're confused by something I said use your words like an adult

hard mica
slow brook
#

and how can i do that..?

daring fern
slow brook
daring fern
daring heron
#

can i add the mod info into the en-us file or do i need to still have a metadata file

daring heron
#

alright

#

what would i put as the main_file?

daring fern
daring heron
#

and where do i find the base descriptions of the jokers

daring fern
hard mica
#

@daring fern im using pseudorandom_element but it doesnt reroll the seal effect at the end of the round like it does it once and then never again

slow brook
daring heron
#

so thatd be en-us.lua

daring fern
#

I don't know if you can just not have a main file.

#

You do need a main file.

slow brook
#

just make a main file and have it empty then

daring heron
#

at least not in there

worthy stirrup
#

How do i debuff every suit?

daring heron
#

when i search for it

slow brook
daring fern
slow brook
#

then that is in en-us.lua

daring heron
#

oh mb

slow brook
#

mb i told you the wrong file

hard mica
turbid maple
worthy stirrup
#

yea

turbid maple
#

see recalc_debuff

daring fern
worthy stirrup
hybrid shadow
#

has anyone here made an enhancement deck that doesn't piggyback off of cryptid

lofty sand
#

anyone think this is underpowered? I thought it'd be pretty balanced but I'm noticing a lot of my friends playtesting my mod don't take it too often due to better in slot options

iron plover
#

how do you create a balatro deck without that one mod? is there a template?

#

also can you mod steam deck balatro

daring fern
sleek cliff
#

representation

iron plover
daring fern
# iron plover is there a guide for that somewhere

Balatro is a game with a lot of possibilities, but even more possibilities when modded. Featuring new jokers, new card enhancements, new mechanics, and new card types!

Check out Off The Console!
https://www.youtube.com/@OffTheConsolePodcast

▰▰▰▰▰▰▰▰▰▰▰▰▰【LINKS TO GAMES】▰▰▰▰...

▶ Play video
hot granite
lofty sand
#

lol

hot granite
#

lowering the blind requirement is underpowered because jokers exist that give you big numbers usually

lofty sand
#

it was meant to be a mr. bones esque pickup, or a throwaway pickup you snag like popcorn/ice cream or smth

hot granite
#

yeah that makes sense, those food items are early game scalers

#

so the newports technically can fulfill a similar role

#

if they showed up early and im struggling in the shop, yeah that pack of smokes will carry me

hybrid shadow
lofty sand
hot granite
#

you wanna make it more alluring, make it half or 0.66

#

you can also do like the scalers do

#

start at half and go up by 0.1 or whatever

lofty sand
#

oh that's not a bad idea actually

#

eventually it starts making the blind scaling worse lmao

#

never expires, just keeps getting worse lmao

hot granite
#

yep, it's meant to offset poor shops or low money making easier reqs

#

while the food items generally offset early game scoring but replace getting those nice setup jokers

misty gorge
#

Sooo I tried to base my joker off of blackboard and now it's doing nothing

#

Progress

daring fern
misty gorge
#

Wait why did I write diamonds wtf

hot granite
#

brain fell out moment

misty gorge
#

Lemme change that

#

Still does nothing when I play a heart club pair

daring fern
misty gorge
daring fern
misty gorge
#

I thought that was what if not scored_card:is_suit('Hearts') or not scored_card:is_suit('Clubs') then meant

#

Oh maybe I need to add brackets

daring fern
frosty rampart
#

not (x or y) = (not x) and (not y)
shoutouts to minecraft redstone tutorials for ingraining de morgan's laws into the deepest recesses of my brain

misty gorge
#

Still does nothing :P

daring fern
misty gorge
#

FUCK

#

God why do I keep making these mistakes

daring heron
#

no idea if i can fix this but the edited jokers dont appear in a collection tab in my mod

misty gorge
#

Wait what it still doesn't work

#

Well then idk anymore

daring fern
daring heron
#

can i take ownership and then just change nothing?

misty gorge
#

Guess I'll just try again tomorrow

broken rivet
slow brook
#

how do i make a joker give score when counting a card? like it stops and the joker shakes like even steven or odd todd

placid star
#

small issue, i have a custom card area and i only have a use button, found out the issue is that the allignment of the sell button is behind the card and inaccessible, how can i make that not the case so that the button are alligned to the right of the consumeable like tarots

misty shoal
#

hilo, how can I make a boss blind disable negative jokers Smile

daring fern
misty shoal
#

well I imagine there's a something in cryptid that does anything, so that makes sense

#

do you know which one

daring fern
misty shoal
#

ok well cryptid has it's own mod-specific way of doing it

placid star
# misty shoal ok well cryptid has it's own mod-specific way of doing it
        if (card.area == G.jokers) and not G.GAME.blind.disabled and card.config.center.rarity == 'jjok_special' then
            return true
        end
        return false
    end,```
this is my code for disabling jokers of a specific rarity, so just replace `and card.config...` with `and card.edition ~= nil and card.edition.key == 'e_negative'`
misty shoal
#

am I missing a comma or parathesis somewhere it says expecting ] on line 32

primal robin
#

Incorrect brackets for pos

misty shoal
#

that's gotta be it thanks

wintry basin
turbid maple
#

ship it

placid star
turbid maple
#

whats with you and question marking everything

turbid maple
lost plover
#

Someone know how to mod balatro on mobile please

wind steppe
placid star
wind steppe
#

steamodded is, as the name suggests, for steam

lost plover
wind steppe
#

its not called iosmodded or androidmodded

daring fern
turbid maple
open forum
#

Looking at SMODS.Sound in the wiki, why the discouragement of using .MP3?

hard mica
lost plover
#

Can you emulate windows/linux

placid star
wind steppe
daring fern
wintry basin
placid star
wind steppe
#

weird coincidence ig

wintry basin
hard mica
placid star
hard mica
#

i guess this thing causes the problems

hard mica
#

huh

placid star
#

this is my card.lua

#

seems more plausible for your situatuon

daring fern
placid star
#

oh yeah cause of patches?

hard mica
#

how can i fix it ? i really wanna fix this annoying error

daring fern
hard mica
placid star
#

how can i make this work?

frosty rampart
#

i'm trying to take ownership of Stone Joker, but it still seems to be running the vanilla code for its loc_vars

#

oops sent early

#

tldr if i take ownership of Stone Joker, and change card.ability.extra to be a table, it crashes on hover because the vanilla loc_vars definition does arithmetic on card.ability.extra. i can work with it just using card.ability.extra as a number but i'd rather not for convention/consistency purposes

#

ownership call and localization respectively

zealous glen
#

@chrome widget was this the issue you had ran into

chrome widget
#

No, but it's just unfortunately a result of how SMODS handles vanilla items. Vanilla behavior is maintained as much as possible, so you're going to need to overwrite loc_vars too if you want to avoid it

frosty rampart
#

i am. i think, at least. see the first screenshot

sleek cliff
placid star
frosty rampart
#

yes, although i think it needs to be a capital P in 'Planet'

sleek cliff
#

yeah, I just realized the capital too lmao

hard mica
#

im very confused

wind steppe
#

how do i put in a custom tooltip on a joker? it's the description of a modded tag if that helps

lucid owl
#

how could you use context.individual in an enhancement to only make something activate on the card that's calculating? i have an enhancement with a chance to give a random consumable, but the current implementation just gives the cards immediately upon pressing "play hand"

#

using context.other_card == card doesn't seem to work

chrome widget
#

There are some other instances of taking ownership of default cards that require patches to not break them. For example, I had to patch out code for Swashbuckler and Joker Stencil in Card:update() in addition to taking ownership of the joker to implement them more cleanly

wind steppe
wind steppe
#

at least the way im doing it

#

i can get the info queue to spawn descriptions of things in base balatro (like perkeo) but nothing modded

chrome widget
#

This, for example, shows the description for a Negative Tag
info_queue[#info_queue+1] = {key = 'tag_negative', set = 'Tag'}

wind steppe
#

thats what i have rn but its blank and the title is error

chrome widget
#

Assuming you have the tag set up correctly in a localization file

wind steppe
#

wait do i need a localization file for that

#

is loc_txt not enough

chrome widget
#

No

#

You'd either have to use a loc file or directly add it to G.localization.descriptions.Tag in your file

#

I think

wind steppe
#

time to learn how to do that then

daring fern
chrome widget
#

I was under the impression that it was kept on the joker definition and it uses the loc file if it doesn't find loc_txt first

zealous glen
#

I thought loc_text was equivalent to having a localization file

lucid owl
#

currently i don't use context.individual, just context.main_scoring

#

oh, nvm i get what you mean

#

that makes sense

daring fern
lucid owl
spiral crown
#

Does anyone know how to iterate through played cards? Tried looping through G.play but its giving me trouble

daring fern
spiral crown
wind steppe
#

for localization files: are stickers other?

daring fern
wind steppe
#

are booster packs also other?

spiral crown
red flower
spiral crown
spiral crown
wind steppe
#

does anyone know why none of my descriptions are loading? (also if i look at the deck my game crashes. prob a galdur issue)

wheat jewel
#

How can I check for multiple suits within one joker without it causing any issues?

maiden phoenix
#

What that joker do?

daring fern
maiden phoenix
#

Also this should be "Spades"

wheat jewel
#

my brain is fried

maiden phoenix
#

I feel like this code could be simplified depending of what this joker does

wheat jewel
#

The joker is meant to activate specific abilities of other flush suit themed jokers depending on the type of flush played

#

i'm thinking of putting if statements for each suit in one if statement

#

to simplify the ability

spice wadi
#

i get an error saying its trying to compare a number to a table (its definitely a number) for the mult, but if i manually put a number its fine, whats causing that?
its not giving me an error from my script but from the common_events file

i dont get the same error with the dollars entry and i did print the xmult value beforehand

last sentinel
#

I have an end_of_round effect for a Deck, but it's triggering 6 times instead of just once. Is there an additional context i should use to only have it go through once for defeating a blind?

flat sorrel
#

idk why I have the explicit nil check

last sentinel
#

thats peculiar, ill give it a shot

spice wadi
last sentinel
#

scanned the chat looks like context.main_eval might also be needed

flat sorrel
#

might be a more sensical filter, wasn't necessary in my case.
the explicit nil is probably unnecessary though I think I was just tired when I wrote that haha

last sentinel
#

Worked!

primal robin
wheat jewel
#

I did some changes to make code for efficiency reasons but the spades check isn't working

#

it doesn't return chips

red flower
#

change it to a separate if

wheat jewel
#

Gotcha tysm!

maiden phoenix
#

Btw only next(context.poker_hands["Flush"]) is needed, you don't need to check each flush hand

dapper sun
#

how do i use multiple lua files for my mod?

wind steppe
dapper sun
#

ty

wind steppe
#

^ localization file

glad osprey
wind steppe
glad osprey
#

no

#

I refuse

#

did you check for capitalization aswell

wind steppe
#

prefix is para all lowercase

glad osprey
#

are the names loading

wind steppe
#

no

glad osprey
#

are you using the correct keys

wind steppe
#

yes

wild escarp
#

Would this code work for storing all played poker hands?

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

yknow what heres the (unfinished) mod

#

maybe i missed something or misspelled something

#

(also it will crash if you dont have cryptid)

wild escarp
turbid maple
#

its dependent on cryptid? whats in this mod

#

why do i ask when i could just look actually

#

lemme see

wind steppe
#

food jokers

#

i haven't made my own food joker thing yet

#

its probably fine unless you actually open the pack so it should load

turbid maple
#

huh yeah i have no idea why it wouldnt load

#

you just get empty text?

wind steppe
#

wait does it load for you?

wind steppe
turbid maple
#

no im just looking at the lua code dont have the game witj me rn

wind steppe
# wind steppe

if anyone else wants to help with my localization files i have the whole mod up here

red flower
#

i looked at it and it looks fine

#

let me run it

#

hmm yeah doesnt work

turbid maple
#

somethings cursed because the files and keys look fine

wind steppe
#

does anyone know a digital exorcist

red flower
#

it's en_US

#

?

#

no yeah it's en-us i think

wind steppe
#

yknow what may as well try it

turbid maple
#

oh the filenames wrong

wind steppe
#

wait

red flower
#

yup that works

wind steppe
#

it was named en_us instead of en-us

red flower
#

yeah

wind steppe
#

pros of programming: it does exactly what you tell it to

#

cons of programming: it does exactly what you tell it to

red flower
#

btw i just noticed jokerdisplay has the same problem

wind steppe
red flower
#

but ive never noticed because the default is english

turbid maple
#

😔

wind steppe
#

wait actually hold on

#

why is the hyphen only for english

red flower
wind steppe
#

every other language that needs something like that uses an underscore

turbid maple
#

existence of en-us implies the existence of British balatro

wind steppe
#

bo'oh o' seltzer

red flower
#

australian balatro

dapper sun
wind steppe
dapper sun
#

also spare trousers

wind steppe
#

true

turbid maple
#

fuck youre right

wind steppe
#

maybe the united states was britain all along

dapper sun
#

there was no independence, we were still colonizing this whole time /j

#

aaanyways, uhhh,,

#

how do i add an extra side button to a joker

red flower
#

i hook card:highlight and make the buttons myself

turbid maple
#

find someone that did it and copy it off of them

dapper sun
#

fair

turbid maple
#

i copied mine off the lobotomy corp mod

#

thank you mysti

wind steppe
#

nothing is original

dapper sun
#

ty

#

i don't understand this :p

red flower
#

well

dapper sun
#

ik the vinesauce mod does it

sturdy compass
#

Yeah that's kinda the best way to go about it and learn from it lol

turbid maple
#

just try to understand how it works i suppose

#

you cant just have a button anyway you do need to hook it to things you want it to do

#

putting stuff in rows and columns still confuses me

primal robin
#

After seeing this code my life became harder

red flower
#

it's not that complicated lol

#

it's literally the same code 4 times for each kind of joker i have

#

copied from vanilla

primal robin
#

The problem is it's not a G.UIDEF.use_and_sell_buttons hook

#

Problem for me specifically

red flower
#

i wanted more control

primal robin
#

uhhhhhh

red flower
#

you will catch me dead before i use get_UIE_by_ID

primal robin
#

This thing triggers before highlighting card, I have no access for card.childre.use_button

red flower
#

they pop up for a second

#

its funny

primal robin
#

Tbh I don't want to highlight card, do checks, and unhighlight it if needed, like idk

#

Maybe I should... but... uhhhhh

wind steppe
#

wait my tag description doesnt work

#

how do i get a textbox about a booster pack?

#

tooltip

red flower
#

isnt it the same as a joker

#

never tried it

primal robin
#

Hm, maybe highlighting a card is not the worst thing I can do I guess

wild escarp
#

Is there any easier way to check hands played/not played in an ante? because I can not figure out this hooking stuff.

wind steppe
# wild escarp Is there any easier way to check hands played/not played in an ante? because I c...
Klei Entertainment Forums

In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...

#

tldr: copy paste the bottom function and change the function ur hooking

wild escarp
#

I can copy and paste fine, just struggling with the Smods garbage.

misty shoal
#

next(SMODS.get_enhancements(card)) gets if there's enhancements on a card, is there a get_seals / get_editions?

#

looking to check if the card is completely untouched

dapper sun
misty shoal
#

saw that

dapper sun
#

sticker ban 💔

frosty rampart
misty shoal
#

interesting

zealous glen
misty shoal
#

formatting king right here

frosty rampart
misty shoal
#

fantastic

dapper sun
#

why isn't this working?

turbid maple
#

I believe that doesn't work because SMODS lets you do this freaky thing where a card can have multiple enhancements

wind steppe
#

how do i make a sticker tooltip

turbid maple
#

with stuff like this existing

frosty rampart
dapper sun
#

ah ok

red flower
wind steppe
#

that seems significantly worse

red flower
#

i know because you asked earlier

wind steppe
#

yeah ig they are

#

trying that

#

that fixed the issue

red flower
#

what

#

oh

misty shoal
#

why does this trigger on every face card

shut crater
#

you are checking the edition, seal, and enhancements of the triggering card, not the scored card

#

you probably want to use context.other_card for all those checks

misty shoal
#

oughhh

#

right

#

yeah the joker has no seal so that makes sense

sleek siren
#

Is there a way I can make every new spawned playing card (from either a booster pack or a spectral card, etc) into a certain rank?

wind steppe
#

hook card creation maybe?

wild escarp
#

What would I use to copy a played card?

sleek siren
wind steppe
wild escarp
#

So, I've got this, but it crashes, anyone know why?

if context.before and context.main_eval then
    for k, v in ipairs(context.scoring_hand) do
        if v.enhancement or v.seal or v.edition then
            G.playing_card = (G.playing_card and G.playing_card + 1) or 1
            local _card = copy_card(context.scoring_hand[v], nil, nil, G.playing_card)
            _card:add_to_deck()
            G.deck.config.card_limit = G.deck.config.card_limit + 1
            table.insert(G.playing_cards, _card)
            G.hand:emplace(_card)
            _card.states.visible = nil

            G.E_MANAGER:add_event(Event({
                func = function()
                    _card:start_materialize()
                    return true
                end
            })) 
            return {
                message = localize('k_copied_ex'),
                colour = G.C.CHIPS,
                playing_cards_created = {true}
            }
        end
    end
end
wind steppe
#

my tag description and name only displays in the info queue for some reason

wild escarp
#

local _card = copy_card(context.scoring_hand[v], nil, nil, G.playing_card)

primal robin
#

Oh it looks so bad omg

wind steppe
wild escarp
#

Still crashes.

dapper sun
wind steppe
dapper sun
#

that shouldn't make a difference

#

it's a variable name

wind steppe
#

it shouldnt but idk what else the problem would be

wild escarp
#

Yeah, same problem.

dapper sun
#

anyone know mods that add an extra button to a joker?

#

i remember seeing a mod that added a "flip" card thingy that added an extra button to a joker in a yt vid but idk the mod

flint fern
#

anyone know a sound replacer mod? (aka. a soundpack mod)

wind steppe
#

double sided edition

dapper sun
#

i'm looking in cryptid but don't see it

#

i may have an older cryptid version

flint fern
#

i dont think anyone knows a soundpack mod
so...

#

fine, i'll do it myself

flint fern
#

-# firstly how do you replace a sound in steamodded

shrewd cobalt
#

Can someone help me figure out whats going on with trying to replicate blueprint? The game keeps crashing with a attempt to call method 'juice_up' (a nil value)

manic rune
dapper sun
flint fern
manic rune
# wind steppe

whats your tag's key, and how does the localization look like?

#

hi dilly

modern kindle
#

hi bepis

wind steppe
#

localization:

#
        Tag = {
            para_foodtag = {
                name = 'Safe Room Tag',
                text = {
                    'Open a free {C:enhanced}Snack Pack{}'
                }
            }
        },
manic rune
#

shouldnt there be a class prefix like t_ similar to j_ for jokers?

wind steppe
#

oh

#

right

dapper sun
lament agate
dapper sun
#

i'm looking in cryptid's files already

#

latest version

wind steppe
#

items > misc.lua > line 1449 onward

dapper sun
#

ty

wind steppe
#

in my version of cryptid thats where it is

#

try ctrl f

dapper sun
#

ok

#

i'll look in ur version

#

found it ty

wild escarp
#

Anyone know why this doesn't do anything? I took the high priestess code from vanillaremade and put it in a joker.

calculate = function(self, card, context)
    if context.setting_blind then
        for i = 1, math.min(card.ability.extra.planets, G.consumeables.config.card_limit - #G.consumeables.cards) do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    if G.consumeables.config.card_limit > #G.consumeables.cards then
                        play_sound('timpani')
                        SMODS.add_card({ set = 'Planet' })
                        card:juice_up(0.3, 0.5)
                    end
                    return true
                end
            }))
        end
    end
end
dapper sun
sturdy compass
#

Cryptid lowkey sucks to reference ngl skul

dapper sun
#

i can tell,,

#

does anyone know any other mods that add a button to a joker

sturdy compass
#

If I had a nickel for people who were asking about button stuff today I would have two nickels lmao

dapper sun
#

lol

sturdy compass
#

If this were a new card type I would be able to help but not here unfortunately 😭

dapper sun
#

instead it's a specific joker,,

turbid maple
#

did you look at lobo corpo

dapper sun
#

lobo corpo?

sturdy compass
#

Lobotomy Corporation

turbid maple
#

lobotpmy corp

#

its pretty simple implementation

dapper sun
#

ok

primal robin
#

Jut in one place, to make sure it not crash or smth

#

I just idk how to test it quickly because mod has so much content

dapper sun
#

i'm not familiar with the mod or the source material

turbid maple
#

uhh p sure the implementarion is in the giant main file

dapper sun
#

what joker(?) is it?

turbid maple
#

its not jker specific as you asked

#

ctrl f for --=============== ACTIVES ===============--

high sinew
#

Just curious tryna to see if there is a good place for learning or understanding the API for SMODS more. I am looking thru other mods and SMODS too and just a little stuck. Can anyone help?

turbid maple
ornate prism
#

Hello, I'm developing for the Balatro Multiplayer mod. I was trying to implement a new feature when I encountered a drawing crash cause by a nil access. When debugging the issue, I found this bug in the main Balatro source code. this self.T.H is most certainly supposed to be self.T.h, lowercase h. Is this known?

turbid maple
#

if you want more specific advanced stuf im afraid theres no better docs beyond other peoples code

misty shoal
#

what does this unlock code mean, it's present for all remade legendaries

high sinew
dapper sun
#

ok think is progress i think

unborn bay
#

why is the use button pink

frosty rampart
high sinew
dapper sun
dapper sun
#

i'll prob disable it tho to make future screenshots look more like vanilla

#

or just switch to the vanilla palette

frosty rampart
# high sinew No I mean kinda like what Partner & other API based mods

as void said (which you might have missed), your best bet is just referencing other mods at that point. there's not much documentation at least partially because it's a super broad concept, and it's hard to identify what would be generally useful vs what would just be a tutorial for your specific idea

high sinew
#

ok fair I get it yea it def get what u mean its just tough man 😖 lol but thank you ill study some mods any good suggestions?

frosty rampart
#

not really, i haven't played around with bigger mods like that yet (in-game or from a modding perspective). but if partner is the first one you named it's probably not a bad choice

wild escarp
shut crater
wild escarp
#

2

hoary stream
#

why my joker doesnt retrigger another joker ability

#
SMODS.Joker{
    key = 'gamer',
    loc_txt = {
        name = 'Gamer',
        text = {
        },
    },
    atlas = 'Jokers',
    rarity = 2,
    cost = 8,
    unlocked = true,
    discovered = false,
    blueprint_compat = true,
    pos = {x = 7, y = 0},
    config = { 
        extra = { odds = 20, odds_mod = 1 }
    },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.odds, card.ability.extra.odds_mod } }
    end,
    calculate = function(self, card, context)
        if (context.retrigger_joker_check and not context.retrigger_joker) and context.other_card ~= "Gamer" then
            return {
                message = localize("k_again_ex"),
                repetitions = 1,
                card = card,
            }
        else
            return nil, true
        end
    end
}
red flower
hasty mist
#

how do i apply an effect to every joker to the right? (for example, retriggering)

odd shadow
#

the mod i created will not show up in the game, so i cannot tell if my code will work

#

help

rapid stag
#

question, :is_face() naturally takes pareidolia into account, right?

red flower
red flower
odd shadow
#

does anyone know why my file isnt showing up in game 💔

copper shell
#

the simplex tableau

rapid stag
daring fern
rapid stag
#

can context.end_of_round and context.individual happen at the same time? OkuuThink

red flower
#

yes

#

you need not context.end_of_round

rapid stag
#

also, how is hand size during a blind controlled?

lament sparrow
#

What's the best way to test a consumable immediantly?

rapid stag
#

debugplus

red flower
rapid stag
red flower
#

i imagine it's in cardarea.lua

wheat jewel
#

I'm trying to make a joker produce xmult whend detecting a flush of clubs but it doesn't give Xmult at all

lament sparrow
#

Hmm... my mod doesn't load

hoary stream
#
            return {
                message = localize("k_again_ex"),
                repetitions = 1,
                card = card,
            } ```
why doesn’t this do anything
rapid stag
red flower
marsh turtle
#

where in the documentation can I find more info on how other_joker is used in Steammoded context?

wheat jewel
lament sparrow
#

How do I fix this?
Found invalid metadata JSON file at C:\Users\vieta\AppData\Roaming\Balatro\Mods/Gaff Mod/GaffMod.json, ignoring: [SMODS _ "src/utils.lua"]:566: bad argument #1 to 'match' (string expected, got nil)

hoary stream
red flower
wheat jewel
#

trying to test my joker with smeared joker to see if it's working as intended

#

but the Xmult for clubs doesn't trigger

wheat jewel
#

with a flush of clubs and spades

red flower
odd shadow
#

The folder for my mod will not show up in game doesn anyone know why

wheat jewel
#

how can i make it to where my joker can work with wild cards and smeared joker

marsh turtle
#

OHH now I get what Blueprint is saying in the code!!

It essentially checks if the next card after it is a joker and compatible with Blueprint, right?

red flower
manic rune
#

hi n