#💻・modding-dev

1 messages · Page 324 of 1

maiden river
#

reading the docs 🗣️

zealous glen
#

Wikipedia just says an index is a key in an associative array. I don't think CS keys have their own page, although in mathematics there are pages for indexed sets and stuff

worldly fractal
#

how are yall so fast at that

hardy viper
#

which makes me wonder, if you have a table with indexes 1-8 being normal, and you nil 5, does that relocate 6/7/8 to the hashmap or what

#

i don't know how that works

zealous glen
maiden river
red flower
zealous glen
zealous glen
limber blaze
#

ipairs iirc starts at 1 and stops if theres a gap

zealous glen
#

they just need to identify another member of the pair

hardy viper
burnt cairn
zealous glen
#

Wikipedia doesn't say anything about order, and I know it's true for mathematics

maiden river
hardy viper
#

so like, ipairs might loosely not follow the convention there

burnt cairn
#

labyrinth ass wiki catstare its all there but god knows im not getting there myself

maiden river
#

every day I become more like sam

next timber
#

sam reich jumpscare

zealous glen
#

Wikipedia also says this in the Associative Array page

burnt cairn
#

its called calculate functions not list of context functions 😭

red flower
maiden river
#

well calculate is pretty much the only time you're using context anyway

zealous glen
#

yeah I was about to say that

maiden river
#

but I agree, the wording is a little confusing at first glance

zealous glen
#

Dictionary indices don't require order

maiden river
#

the great lua table debate of 2025

burnt cairn
#

as someone who doesnt know what calculate is. its a lottle confusing at most of the other glances as well

#

its not very beginner friendly wholesome

next timber
#

tbf it did take me some time to come to grips with how balatros code works

maiden river
#

I do wish the example mods covered a few more jokers

zealous glen
next timber
#

but looking through the examples cleared up a bunch

hardy viper
maiden river
#

or smth like golden joker

#

oh wait golden's in there nvm

burnt cairn
#

im pretty sure it- yeah

hardy viper
#

i would imagine that relocating at worst case an entire array into a hashmap is slow so he doesn't do that but meh

maiden river
#

another nice one would be steel joker, to show better ways to display numbers that can change at any time

hardy viper
#

i don't think a gap in the array is a big deal

#

now that i think about it those exist anyways

lyric wadi
#

i have a problem with numbers on my card lagging behind sometimes

maiden river
#

(psa: just do it in the loc_vars function)

lyric wadi
#

cuz it's not updating frequently enough

thorn flame
#

how do i make it so every card is drawn face down

#

or like anything simialr

zealous glen
burnt cairn
#

teleporting 6 months into the future to when i know all this and fixing the documentation myself peaceline

zealous glen
maiden river
thorn flame
#

i want to do it for a joker

zealous glen
maiden river
burnt cairn
#

true

maiden river
#

like I'd like a lot more information on localization stuff

burnt cairn
#

im just moody cause im confused 33

maiden river
#

which apparently john smods said was coming

#

but it's been
a while

zealous glen
thorn flame
zealous glen
thorn flame
#

ah

zealous glen
#

wait it's dave strider

red flower
#

I'm fine with making more guides and stuff but please don't tutorialize the docs I'd like things to be easy to find lol

maiden river
#

that's also important

#

I think there should be a different wiki for examples

thorn flame
#

hi

#

its me dave strider

shut crater
maiden river
#

huh 😭

burnt cairn
#

clicking on your site and seeing "boyfriend named john" was extremely funny

maiden river
#

whose site?

burnt cairn
#

arizonas

zealous glen
#

davejohn?

#

that's an og ship

placid star
#

can anyone diagnose the issue here? my tarot doesnt do anything upon use

limber blaze
maiden river
#

does anyone know how to retrigger cards in areas that aren't the played hand

#

I need to retrigger a card in a custom area

zealous glen
#

I mean, if context.repetitions is called there

red flower
#

did you register that custom area with a patch?

#

if so then it should be sent to repetitions

maiden river
#

nothing's happening tho

#

lemme send the actual code

red flower
#

is this for playing cards or joker-like stuff

zealous glen
#

That's Joker evaluation not playing cards

maiden river
#

yeah it's not a playing card

maiden river
#

the one on the right

zealous glen
#

Jokers can't retrigger in vanilla, but maybe if you enable Joker retriggers it should work?

burnt cairn
#

is that a friends vs friends mod nom

burnt cairn
#

banger?

maiden river
#

indeed

#

it would be more banger if I could figure this out 😭

#

now I need to figure out how to turn on the joker retrigger thing

#

curse you, docs

burnt cairn
maiden river
#

scoring_hand isn't available all the time, so it's under all the contexts where it is

red flower
burnt cairn
languid mirage
#

all you really need is scoring_hand =

red flower
#

it's not a "main context" is more like a field inside the context table

burnt cairn
#

this is confusing

languid mirage
#

context variable is just a table

#

table stores data

red flower
#

i do think the way that's structured is confusing, but I think it's being rewritten

burnt cairn
#

cause im looking at #💻・modding-dev message trying to derive what im meant to be doing for myself and. it uses a context.scoring_hand

#

and alledgedly does what its meant to just fine

red flower
#

the way that you read this is

if context.joker_main then -- if this condition is true
---then the context table contains this information
context = {
    cardarea = G.jokers,
    full_hand = G.play.cards,
    scoring_hand = scoring_hand,
    scoring_name = text,
    poker_hands = poker_hands,
    joker_main = true,
}
burnt cairn
#

ookay

#

then for for index, _card in ipairs(context.scoring_hand) do, context.scoring_hand refers to a table of card keys and the ipairs is iterating through it

#

is there a reason to use context.scoring_hand and not just scoring_hand

red flower
#

not card keys but card objects

red flower
languid mirage
#

nope it does not

#

if you go to the source code, you can perform Ctrl + Shift + F and search scoring_hand =

#

that will give you an idea how that is being calculated & used

burnt cairn
#

which file is this

#

getting a lot of

languid mirage
#

uhh

#

any reason you aren't using vscode?

burnt cairn
#

mostly the install is intimidating nom

languid mirage
#

I usually disable as much as I can

#

then install whatever is necessary whenever it is necessary

#

but uh state_events.lua

burnt cairn
#

🫡

faint yacht
#

They wouldn't be alone in using N++ for developing stuff. 😛

languid mirage
#

I prefer IDE's mostly because of the LSP

#

so much easier to spot mistakes

next timber
#

all my python gets written in n++

#

whenever i read n++ i think of the hit platforming game for the nintendo ds

red flower
#

same

last sentinel
#

if im making a joker that does something like: "if played hand is a straight, all face cards held in hand give +10 mult", would the best context to trigger the face cards be context.individual? Idk why but my head is having a hard time wrapping around this one

red flower
next timber
#

lmao

#

n++ was fun i should play more n++

languid mirage
#

oh

#

I guess it is

#

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

last sentinel
#

Thats what i figured, does that only trigger before scoring?

brisk rose
maiden river
#

What distro do you use?

brisk rose
lavish pine
#

can someone help me import some textures we've drawn into my balatro modpack, I have no idea how to do it even though its simple mb

maiden river
brisk rose
torpid garden
#

the game crashes when i use joker and it says attempt to call table value. the error is on line 56 idk whats wrong

brisk rose
burnt cairn
#

im yet to find a reason to switch from windows 🙂‍↕️

red flower
torpid garden
#

didnt work

red flower
torpid garden
#

yeah

red flower
#

well thats the problem

torpid garden
#

still crashes

#

with the same issue

brisk rose
# brisk rose It's literally built on Ubuntu

The vast availability of .deb packages and things like ppas make Ubuntu and to a lesser extent Debian based distros the obvious choice to me, even compared to other 'it just works' distros

red flower
burnt cairn
#

when youre asking for help its generally a good idea to give as much information as possible

maiden river
brisk rose
sturdy compass
#

Just found out Seals don't have an in_pool function. Day ruined
(Or at the very least it isn't documented if it exists)

brisk rose
placid star
#

what would be the code to make a specific joker spawn as often as a common whilst being another rarity?

maiden river
sturdy compass
maiden river
maiden river
#

The pairs thing reminded me of when I was writing a nested loop and my teacher wanted me to use i twice instead of i and j

red flower
#

what

#

lmao

zealous glen
#

???

hardy viper
#

i can understand i and j

#

i can understand _ and i

#

but i and i is out of touch

red flower
hardy viper
#

lmao

rapid stag
#

bump

torpid garden
red flower
ancient plinth
#

Rq, can I have y'alls thoughts on a joker idea I had for my mod?

ancient plinth
placid star
hardy viper
#

bump

placid star
ancient plinth
#

I have another version of the idea, wanna hear it?

#

I thought of it just now

placid star
#

yeah sure

ancient plinth
#

When you play any hand, the lowest ranked scored card ranks up

sturdy compass
#

Free $20!!!

ancient plinth
placid star
ancient plinth
#

K, thx

#

Wanna hear an idea I had for another joker?

placid star
#

sure

ancient plinth
#

All played hands get the Jelly enhancement, the Jelly enhancement causes played cards to retrigger once for every joker, there is only a limited number of cards this joker can affect before it destroys itself though

#

How is the joker idea? As well as the enhancement idea

thorn flame
#

@sturdy compass COSPLAY JOKER WORKS I PATCHED IT THANK YOU SO MUCH

sturdy compass
#

Yahoo!

thorn flame
#

and YES it stacks with smeared

sturdy compass
#

Enjoy your free flushes and total destruction during suit bosses lol

thorn flame
zealous glen
#

the trollker

formal parrot
#

Yo mr white someone’s at the door

rapid stag
# red flower i hope you get an answer to this someday

eremel told me they would look into it, so i am still waiting on them, but i don't understand why i'm the only one experiencing this - this literally just happens when i'm adding to the info_queue of certain enhancements. i can't be the only person that wants to do or has run into this cirLost

red flower
#

i have seen stuff like that asked before but i dont know if they got an answer

glad osprey
#

why the FUCK doesnt this work

red flower
glad osprey
#

it just like doesnt change the fucking function

carmine burrow
glad osprey
#

im going to

#

do something bad

#

still doesnt hook tho

#

that print isnt printing

red flower
#

is it printing the over here part?

glad osprey
#

yes

red flower
#

then your file is cursed im sorry

glad osprey
#

yea that makes sense

#

even when i run the create_card manually it still doesnt work 😭

sturdy compass
#

try create_card = function(yadda yadda) instead

ancient plinth
red flower
ancient plinth
#

Same as the other person?

red flower
#

yeah 5x red seal for multiple cards is more cryptid level

glad osprey
sturdy compass
#

damn, worth a shot

#

Is the base create card function still working?

red flower
glad osprey
#

i am going to commit war crimes

glad osprey
red flower
#

i love cryptid

sturdy compass
#

stank

ancient plinth
#

Any other ideas for what to make the enhancement do?

#

I still wanna keep the theme of having more jokers makes it stronger

glad osprey
#

i forgot cryptid just says fuck you and rewrites the entirety of create_card

unborn bay
ancient plinth
#

What about Xchips equivilant to how many jokers you have?

unborn bay
ancient plinth
#

Does Xchips work in base balatro?

glad osprey
#

no

glad osprey
#

but with smods it does

glad osprey
sturdy compass
#

It does with SMODS now

hard needle
glad osprey
#

yea

#

worm

ancient plinth
red flower
#

nope

hard needle
#

hhhhhhhhhhhhh bro the art looks so shit but i dont know how to draw slugfish

unborn bay
hard needle
#

what do You think of This>>>>

glad osprey
#

gimmick is cool

zealous glen
#

do you mean ranks 3 and 5

glad osprey
#

art is eh

modern kindle
ancient plinth
#

Then how do I do Xchips?

red flower
#

xchips = value

hard needle
glad osprey
#

also maybe do if hand has an odd amount of cards

rapid stag
glad osprey
#

and somehow work in greater than 1 card

ancient plinth
rapid stag
#

actually no

ancient plinth
hard needle
rapid stag
#

for this and when i tried in loc_vars, it did the tooltip correctly, but it broke the normal description

hard needle
#

the mechanic Even symbolizes what slugfish does in grace

rapid stag
#

because gold card's description expects a var for its dollar value that it gets from generate_card_ui(), and you can't feed it in via a take_ownership() so it breaks

glad osprey
#

maybe use the peer pressure badge for reference in terms of art

hard needle
scenic pewter
#

Where do I learn to code lovely lua? Preferably free…

hard needle
#

but the note is so weird

#

so i looked for fanart

#

and tried to use that as a reference

rapid stag
#

so i don't know what's going wrong

unborn bay
#

have you tried putting the info_queue insert before you call SMODS.Center.generate_ui

rapid stag
next timber
#

it just works

unborn bay
#

SMODS.Enhancement has its own override for generate_ui

#

maybe call that instead of SMODS.Centers.generate_ui

cyan lagoon
#

question is there something like SMODS.poll_seal for editions?

rapid stag
red flower
#

poll_edition (no SMODS)

cyan lagoon
#

thanks

ancient plinth
#

How do I make it so the game detects the cards with the lowest rank?

cyan lagoon
cyan lagoon
cyan lagoon
#

open Balatro.exe with 7Zip

next timber
#

why does this code (modified so it always trigges and always produces chicot, shown in screenshot) lead to the first egg not flipping back properly?

ancient plinth
cyan lagoon
#

no

#

just open it

#

right click > 7-Zip > open archive

ancient plinth
#

There are two open archive options

cyan lagoon
#

first one

ancient plinth
#

K, thx

cyan lagoon
#

card.lua

#

that's where the jokers are

ancient plinth
#

Thx

cyan lagoon
#

ur welcome

zealous glen
#

I mean it's recommended to copy it to have a backup

#

But you can probably just redownload it from Steam

ancient plinth
#

I found and copied the code for Raised Fist's ability

next timber
cyan lagoon
#

maybe do the second flip in another G.E_MANAGER?

next timber
#

you mean, seperate to the set_ability?

cyan lagoon
#

yeah

#

that's how i have it

agile dew
#

how do i make a joker trigger after scoring? to, for example, delete a playing card

next timber
cyan lagoon
next timber
#

looking closer it looks like it's actually flipping 3 times??

zealous glen
#

maybe try to print something to track how often it's flipping

cyan lagoon
rapid stag
#

bump

desert ore
#

how do I make a joker that effects base chips like same timing as the flint?

cyan lagoon
#

i'd say context.before but i think that triggers before the hand gets calculated

glad osprey
#

how do I make it so a card activates when ANYTHING is bought, not just a card

cyan lagoon
glad osprey
#

i want it to be when anything is bought

#

like vouchers or booster packs

cyan lagoon
desert ore
#

already have, blind contexts work differently than joker contexts from what I can tell

#

unless I can use those some how

glad osprey
#

what context does the flint use?

restive pine
#

hi, uh... how do i make a texture pack? (for jokers specifically if that means anything)

desert ore
#

it's just not the same format as how jokers work

glad osprey
#

ah

#

wait why wouldn't before work?

glad osprey
#

isnt that what they wanted tho?

next timber
glad osprey
#

or am I misunderstanding

desert ore
#

whenever I modify chips during context.before, whenever any new chips are added it goes to what it would be otherwise

glad osprey
#

aaaah

desert ore
#

mult works fine from what I can tell

glad osprey
#

try adding

return {
   chips = 0,
   mult = 0
}

to a before context

#

see if that works

desert ore
#

I think I've tried but I'll try again to show what happens

glad osprey
#

sometimes it just doesn't like recognizing that chips have changed without that

#

so worth a shot

desert ore
#

wait what

#

so setting chips to zero before I do things?

glad osprey
#

no return chips = 0

glad osprey
#

inside of the before context

#
if context.before then
    -- other stuff here
    return {
          chips = 0
     }
end
#

for example

#

but don't just copy that

desert ore
#

yeah ok

tall wharf
#

I'm so done with solitaire

#

I'll just disable double click stacking

steady smelt
#

is there a way to make emplace() happen instantly instead of having tweening?

#

like G.play:emplace(_card)

ancient plinth
#

Ngl I am so confused with what I am doing with this joker

desert ore
glad osprey
ancient plinth
#

I have no idea what I am doing with this one

brisk rose
glad osprey
#

HOW??????

#

and no context.buying_card doesnt work because that only applies to cards not boosters or vouchers

sturdy compass
#

It does apply to vouchers

glad osprey
#

oh

#

well it still doesnt apply to boosters

sturdy compass
#

for boosters it's context.open_booster

brisk rose
#

I presume they'd wanna

sturdy compass
iron haven
#

who is a modding pro?

sturdy compass
red flower
iron haven
#

oh U works now.

#

okay so how am I going to make V?

glad osprey
#

why are you telling us 😭

sturdy compass
#

They just do this man Emoti_Shrug

iron haven
#

creates a voucher tag if last hand contains a 5. How am I going to make this into code?

brisk rose
steady smelt
#

when you use a comsumable from an arcana pack, what position does it get moved to? like, usually it gets moved to play, but from an arcana pack it gets moved down lower since cards are in the way

sturdy compass
steady smelt
#

or even just using a consumable while in an arcana pack

#

actually easier question

is there a way to make the hand displayed while in a pack opening screen disappear temporarily?

zinc forum
#

Sharing the thing I was trying to do yesterday and failed miserably (but this time, it's done and I'm proud of it)
It's an enhancement that copies rank, suit and enhancement of the card on its left

glad osprey
zinc forum
#

xDDD

glad osprey
#

cool tho

iron haven
#

How do I make make tags?

zinc forum
#

Hope it's OP enough to change your mind :>

glad osprey
#

please 🙏

#

learn from already existing content rather than immediately going to us for help

iron haven
zinc forum
glad osprey
#

@iron haven think of any already exsisting vanilla joker that does what you are looking for (creating tags in this case)

glad osprey
#

yes!

#

now look at it's code in card.lau

#

lua

#

(source code is dumped into mods/lovely/dump fyi)

iron haven
glad osprey
iron haven
#

oh

glad osprey
iron haven
#

oh yes. NOTHING.

sturdy compass
#

I really hate being harsh like this but we've told you we cannot handhold you for the entire development cycle of a mod. You've gotta learn how to do things yourself man

iron haven
#

oh that's the text file.

#

play_sound('generic1', 0.9 + math.random()*0.1, 0.8) play_sound('holo1', 1.2 + math.random()*0.1, 0.4) what's this?

sturdy compass
#

no way bro Facepalm

glad osprey
#

what do you think play_sound could possibly do

iron haven
#

oh yeah. to make voucher tags? would the code be tag_voucher?

#

brb

glad osprey
ancient plinth
glad osprey
#

what does that even mean

ancient plinth
glad osprey
#

yea no

#

i am asking what the joker means

#

bcus that just sounded like a word salad

ancient plinth
#

So basically combine Strength and Raised Fist

#

When you play a hand

glad osprey
#

ah I see

ancient plinth
#

The lowest ranked card in the hand you played ranks up

glad osprey
#

how do you want to handle multiple of the same rank?

gilded narwhal
#

hey gang is there a mod that does the thing where there's like a button to discover all

#

in the config i mean

ancient plinth
glad osprey
glad osprey
# ancient plinth They all rank up

ok in that case I'd say look at how raised fist checks for the lowest rank and then apply strengths code to all of the cards of that rank

rapid stag
#

bump

ancient plinth
sturdy compass
gilded narwhal
#

I had no idea

rapid stag
zealous glen
#

I've added tooltips to my modded Enhancement without issues, so idk

sturdy compass
#

NTF's have some complicated mumbo jumbo to 'em that I barely understand

rapid stag
# zealous glen I've added tooltips to my modded Enhancement without issues, so idk

yes, but i'm just trying to add a tooltip to a vanilla enhancement. and so far it's been straightforward for literally only stone

stone you can just append to the info_queue in generate_card_ui() and it works as you'd expect

everything else has so far been an uphill battle and i'm left hanging with gold because either i do it that way and it merges the text into the description, or i try taking ownership and it breaks the var

zinc forum
# rapid stag bump

Uhhhhhh
Might have already been suggested but I know Pokermon has like a thousand infoboxes, surely there's something there right...?

zinc forum
#

I'm gonna be honest I'm not quite sure x)

#

I should double check

iron haven
#

back

ancient plinth
#

I feel so confused

zinc forum
#

Trying to think about a mod that would add to vanilla infoboxes

iron haven
#

ok now I have a logic error for V.

#

It doesn't spawn the tag when last hand contains a 5.

glad osprey
#

ok

#

fix it then

scarlet spire
#

we can't know what the issue is if you don't show the code

iron haven
glad osprey
#

also we arent gonna hold your hand throughout the entire development of your mod

#

that is the entirety of your code we did not need that

#

only the one jokers snippet

zinc forum
iron haven
# glad osprey only the one jokers snippet
SMODS.Joker{
    key = 'victor',
    loc_txt = {
        name = 'V',
        text = {
            "Creates a {C:attention}Voucher Tag{} if last hand contains a {C:attention}5{}."
        }
    },
    atlas = "Jokers",
    pos = {x = 5, y = 2},
    config = { extra = {
        }
    }, 
    unlocked = true,
    discovered = true,
    rarity = 2,
    cost = 7,
    loc_vars = function(self, info_queue, card)
    calculate = function(self, card, context)
        if context.final_scoring_step and G.GAME.current_round.hands_left == 0 and ( context.cardarea == G.play and context.other_card:get_id() == 5 ) then
                add_tag(Tag('tag_voucher'))
                play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
                play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
                   return true
        end
    end
end
}
glad osprey
#

why is that one part of the if in parenthesis

#

also final scoring step doesnt have a other_card i think

glad osprey
#

yea

#

read the docs

iron haven
#

I guess it doesn't. So how do I fix that?

glad osprey
#

figure it out

#

youve gone through more than half the alphabet surely you can figure stuff out on your own 😭

iron haven
#

I don't know...

#
if context.final_scoring_step and G.GAME.current_round.hands_left == 0 and context.cardarea == G.play and context.other_card:get_id() == 5 then
``` Has to be about this line?
scarlet spire
#

you're going to want to loop through G.play.cards and check if any of them equal 5

#

final scoring step doesn't have an other_card because that refers to contexts where cards are evaluated individually (like context.individual, context.repetitions, etc)

formal parrot
#

YEAH I NEVER WANNA DANCE AGAIN

iron haven
#

is it just for?

glad osprey
#

GOOGLE !!!!!

#

(just google questions that apply to lua in general)

#

but yea

iron haven
#

why are there %'s?

rapid stag
# zinc forum Well the code for SMODS does generate\_card\_ui for each item in the info\_queue...

alright well, it's a complex pipeline i've worked out that just basically lets me specify tooltip keys (defined in my localization file) in a table based on item key - it looks overly complex, but basically the lovely patch basically just puts in a call to my mod's function, which looks for the key of the thing in my table (works a little differently for playing cards) and returns the correct tooltip key if there is one.

boiled down, literally all that's happening is that it's doing info_queue[#info_queue+1] = { key = [key of item in my localization file], set = 'Other' } there isn't really much point going into the nuance of this system, especially since i can show that it works for every other case i have where i use this. the point of the system is to just enable convenience of being able to specify "hey, for this item, append this tooltip to it, here's the key, go"

right before that loop from generate_card_ui() that you showed

iron haven
#
{% for i in range(11) %}
  {{ i }}
{% endfor %}

what?

glad osprey
#

where the fuck are you looking

#

that is def not lua

scarlet spire
#

that's definitely not lua yeah

formal parrot
scarlet spire
formal parrot
#

This is if python and c had a child

scarlet spire
#

this seems to be a good introduction to for loops in lua

iron haven
#

wtf is Jinja?

formal parrot
glad osprey
#

definitely NOT lua

iron haven
#

it's just ```lua
for

glad osprey
ancient plinth
glad osprey
ancient plinth
glad osprey
#

read the error

scarlet spire
#

error is at line 571, you showed completely unrelated code

glad osprey
#

no

#

thats the smods error

#

their error is at 104

scarlet spire
#

ah wait

#

yeah

brisk rose
rapid stag
# ancient plinth What do I do?

this error is actually not intuitive - it doesn't like what you're trying to set the variable to and thinks you should be ending the table there instead

brisk rose
#

It thinks it's just another variable which confuses it

glad osprey
#

also there isnt a self in the context so

brisk rose
glad osprey
#

rather when your calling it

#

should be var_name = "value"

rapid stag
#

wait, why are you trying to set anything inside self.ability inside the config.extra definition

glad osprey
#

yea thats the issue

#

should be name = "whatever it was"

ancient plinth
glad osprey
#

AHA

#

boosters have a "from_tag" attribute!

#

now then how do i force a reroll

#

your kidding me.

#

its that easy?????

ancient plinth
glad osprey
#

why are you returning code

ancient plinth
#

Idk, I am using the strength and raised fist code

glad osprey
#

you shouldnt return code

ancient plinth
#

and I only started using LUA yesterday, so I am still quite unsure of how to do stuff

glad osprey
#

you should only return values

ancient plinth
#

So what should I do?

glad osprey
#

not return the code

#

infact you shouldnt have to return anything

ancient plinth
#

Do I just delete the return text?

glad osprey
#

yea

ancient plinth
#

The error code thing is still the same

#

with the unexpected symbol near the {

#

What's wrong?

glad osprey
#

you still have the curly brackets

ancient plinth
#

Which ones do I need to delete?

#

There are multiple curly brackets

#

You there?

glad osprey
#

the ones that were part of the return

gilded narwhal
#

hey guys why can this activate in the blind select

faint yacht
#

and #G.hand.cards > 0?

ancient plinth
glad osprey
#

you forgot the curly brackets for the event

gilded narwhal
ancient plinth
glad osprey
#

yea

ancient plinth
#

What do I put the brackets around?

glad osprey
#

the entire event

ancient plinth
#

the entirety of line 120?

glad osprey
#

like this

ancient plinth
paper zealot
# ancient plinth Now what?

I recommend installing the Lua extension and then running the auto-formatter with Shift+Alt+F first, it might help you recognise problems for yourself

edgy reef
#

The issue is on line 132 you're not returning true

#

You just have true.

#

But yeah Lua extension tells you about syntax errors like these.

ancient plinth
paper zealot
gentle rain
#

how would i implement a check that occurs over an entire run, like tarot merchant tracking the number of tarots used in a whole game?

brisk rose
limber blaze
#

that should work

brisk rose
#

I did possibly think of a possible alternate solution that doesn't require taking ownership, if you're interested at all. Maybe you could have the variable with the offset and do a check on every gold card to see if the pay got set back up the default and if it did, add it?

gentle rain
limber blaze
#

G.GAME.var = value yea

ancient plinth
#

What do I do?

paper zealot
# ancient plinth Even with the extension I am still confused

First hit Shift+Alt+F to auto-format the code and indentation.
The first issue is the trailing comma on line 132, which is marked as an error by the red squiggly line, and by the red highlights on the right side.
Second issue is that there are mismatched statements or braces somewhere, which that final red squiggle is indicating. If you hover over the red squiggle, it'll explain the issue.

#

Lua doesn't allow trailing commas. The reason they're included in the SMODS.Joker initialisation is that each named parameter is being passed as a member of a table in a function call to SMODS.Joker init:

SMODS.Joker( --calling function
  { --start of table being passed to function
    key = 'balloon', -- table member named "key"
    rarity = 2,      -- table member named "rarity"
      --etc...
  } --end of table
)
```Anything outside of that table is code to be run, not a member of a table, and shouldn't have trailing commas
#

This is slightly hidden by the usage of the syntax SMODS.Joker{ ... } which is just a "convenient" shorthand for SMODS.Joker( { ... } ), but in my opinion makes it less obvious what's actually going on

rapid stag
#

bump

paper zealot
# rapid stag bump

You say only the first additional info_queue entry gets merged to the tooltip - have you tried adding just an empty placeholder entry first, then adding your other desired tooltips afterwards?

gentle rain
#

whats the context for when any joker is destroyed? i'm not sure if remove_from_deck would work here

rapid stag
gentle rain
gusty iron
#

hihi!! quick question

how do i mark a boss blind as a finisher?

#

or

#

showdown

#

or whatever theyre called

paper zealot
shrewd cobalt
#

trying to make a joker that makes a card when a glass heart card is destroyed, but its not sensing the context I think (testing using print functions) I'm using the code from glass joker

gentle rain
paper zealot
#

So replace_base_card might work as a substitute

proud moon
#

..As I was told previously lol. I just didn’t realize how it was the right method.

#

My only confusion is how to setup the hook

paper zealot
gusty iron
#

yeah i figured it out

#

now time to do the very painful coding

#

yayyyy

proud moon
gentle rain
#

would i have to like. create a new context for that?

shut crater
#

Unless I'm forgetting something

gentle rain
shut crater
#

Ah

gentle rain
#

which is what im specifically looking for

#

food jokers

paper zealot
proud moon
shut crater
gentle rain
shut crater
#

Hmm, my thought is that you could hook into remove_from_deck and check if the card being removed is a joker and if the cardarea is G.jokers

gentle rain
#

yeah you might be onto somethin there!!

shut crater
#

If that's the function that is consistently used for those jokers

proud moon
#

does it have to be in your hand for the joker to increment, or does it work like fortune teller

sturdy monolith
proud moon
#

hm, im hoping youve got a way to store that value somewhere so its not wiped when the game reloads, like continuing a run

gentle rain
#

are G.game values like that not normally stored? it should only be reset upon starting a new run

proud moon
#

they should, that gives me an idea

#

i was gonna take a break from coding today, but i gotta get this to work lmao

gentle rain
#

is there documentation for hooks on steamodded wiki

#

all i have is this and im having trouble understanding it and applying it to my situation

proud moon
#

thats all i could find as well, and im stumped on the same step

gentle rain
#

bluh

thorn flame
#

hi im back again

gentle rain
#

i wanna try figuring this out myself b4 i ask for people to write my code for me if thats what youre doing devdelta

gentle rain
thorn flame
#

i want this joker to destroy a random face card in your hand on your first hand but for some reason if your score exceeds the blind it just. skips that

paper zealot
# gentle rain is there documentation for hooks on steamodded wiki

Hooks are a feature of Lua, not of Steamodded, so it's more about understanding the general principle.

  • you store a copy of the original function
  • you replace the original function with your own version
  • you call the original function that you copied within your own new version
  • you return the value that the original function returned
proud moon
proud moon
gentle rain
#

god my brain is getting scrambled

hasty mist
#

ive been looking for the syntax error for like 20 minutes, any ideas?

gentle rain
#

the help is very appreciated

#

just

#

im not very good at understanding coding

rapid stag
hasty mist
rapid stag
#

oh right

#

duh, i know why. it keeps constantly adding the tooltip to the new thing it's looking at

paper zealot
rapid stag
#

lemme fix that first

rapid stag
hasty mist
#

how do i write this correctly?

#

the card.ability.extra.score part

#

i'm trying to make it not occur if score in the config is equal to 0

steady smelt
#

i have a custom consumable that creates cards by adding them to play then drawing them to your deck, but if used in a pack opening they show up here and overlap hand cards, how can I move play down or adjust their position specifically in this case?

hybrid galleon
#

Hi, I'm new to modding and I have something to ask
I want to create an event to delete all cards with certain suits in the deck(because I added custom suits and that made vanilla decks have hundreds of cards I just want to avoid that) but I got no idea to do that

brisk rose
proud moon
# gentle rain all i have is this and im having trouble understanding it and applying it to my ...

i understand it now

to initialize the variable a hook is used, hooking init_game_object (igo) where a bunch of the game's global values are stored like skips and shop spectral rates and whatnot
local ret = igo(self) makes sure the base game's function runs normally, and then the ret.current_round.castle2_card creates the var

Then, the next section is just to change it each round like it says, by looking through the entire deck to see what cards you have, selecting a valid one to use the suit of, and then setting the suit of the new G.GAME.current_round.castle2_card.suit to the card's suit.
(i never knew castle was deck based lol, i never use it)

gentle rain
proud moon
#

should G.game be G.GAME? or no

gentle rain
#

i think it should yeah

gentle rain
hasty mist
#

i'm trying to set the joker's values to 0 after a hand has been played, but when i use context.after, it sets it to 0 while the joker scores, meaning it only scores 0, and context.after is the ONLY context that works for the joker's main scoring, and i'm pretty sure context.after is the latest context when you score a hand, so i'm not sure what to do here

ancient plinth
#

The game no longer crashes when I load it, but now the game crashes when I attempt to score a hand, what do I do?

thorn flame
hybrid galleon
gentle rain
brisk rose
gentle rain
# hasty mist wdym

like, have it set the score to 0 AFTER adding the score rather than before

hasty mist
#

the code that sets it to 0 is after the code that scores

#

but it still executes simultaneously

gentle rain
#

i had this issue before, having two of the same contexts is going to cause it to ignore the second one i believe

#

id try putting them under the same context

#

rather than under two contexts like you currently have

hasty mist
#

ill try that

#

though my issue isnt that it's ignoring one of them

#

both are happening

brisk rose
hasty mist
#

it's just not executing in the right order

brisk rose
hasty mist
open aspen
#

i was looking through paperback code to see how they made certain jokers more likely and found this toml file. I was wondering if its possible to do the same with a deck sleeve (from the deck sleeves mod)

#

like idk if people have worked with deck sleeves, im basically wondering how to check what sleeve is selected

gentle rain
proud moon
#

yea im working through that rn, seeing what resets what

#

fun fact, function SMODS.current_mod.reset_game_globals(run_start) runs every round blind select (at least from testing it does)

gentle rain
#

guh

#

yeah idek where to define it in the first place

#

this crashes on line 12

#

this is probably just a not understanding game variables moment

open aspen
#

how do i do a lovely patch

proud moon
#

it doesnt save, but it doesnt crash

#

This was all that was necessary for the hook i think, at least to make the variable in the first place.

#

ig i should find out how the game normally stores the value for castle

naive flame
#

Ok so hi, I wanna mod Balatro, but when I watched a tutorial it said that I had to extract the .exe file which

#

i couldn't figure out how to do

hybrid galleon
naive flame
#

if its a feature that was removed in the new windows version

open aspen
#

guys how does priority work with mods

#

and with lovely patches

#

i think im fucking something up because the priority of a lovely patch i have is incorrect

proud moon
shut crater
#

or 7zip

#

idk if winrar works

urban wasp
#

i get a stack overflow when this tag tries to create a joker, any ideas?

SMODS.Tag {
    key = "mythic_tag",
    atlas = "crp_tags",
    pos = { x = 7, y = 0 },
    min_ante = 5,
    config = { type = "store_joker_create" },
    apply = function(self, tag, context)
        if context.type == "store_joker_create" then
            local rares_in_posession = { 0 }
            for k, v in ipairs(G.jokers.cards) do
                if v.config.center.rarity == "crp_mythic" and not rares_in_posession[v.config.center.key] then
                    rares_in_posession[1] = rares_in_posession[1] + 1
                    rares_in_posession[v.config.center.key] = true
                end
            end
            local card
            if #G.P_JOKER_RARITY_POOLS.crp_mythic > rares_in_posession[1] then
                card = create_card("Joker", context.area, nil, "crp_mythic", nil, nil, nil, "cry_eta")
                create_shop_card_ui(card, "Joker", context.area)
                card.states.visible = false
                tag:yep("+", G.C.RARITY.crp_mythic, function()
                    card:start_materialize()
                    card.misprint_cost_fac = 2
                    card:set_cost()
                    return true
                end)
            else
                tag:nope()
            end
            tag.triggered = true
            return card
        end
    end,
}
proud moon
naive flame
shut crater
#

can someone explain how this hook could possibly be causing this error

#

commenting out my hook prevents the crash

shut crater
#

but idk anything about tags

brisk rose
#

@hybrid galleon

#

Sorry for the random @ aure, forgot to turn off pings

shut crater
naive flame
#

What would be a good place to start for making a balatro mod?

shut crater
#

(be warned, the documentation is a little rough)

urban wasp
shut crater
#

if you can read code then other mods' source code is probably better

naive flame
#

Is Steamodded the same as the Balatro Mod Manager, or is it a separate thing?

proud moon
#

separate

gentle rain
#

i am gonna explode i think

shut crater
#

mood

shut crater
ancient plinth
shut crater
#

on line 112 you write self.ability.name, but you should use card.ability.name

gentle rain
shut crater
#

yeah it be like that

unborn bay
#

"eaten" can really be many things which is a problem

#

could be it self destructs could be its sold

#

etc

shut crater
#

hard to write code that expects a standardized way of doing things when there is no standard

gentle rain
#

idk how to do that

#

and atp i think id have to hard code in the contexts in which jokers are destroyed

#

so

#

yeah this ideas dead

shut crater
#

surely there is a context for selling a joker?

gentle rain
#

like

#

maybe

#

but i dont wanna search for that

unborn bay
#

context.selling_card i think

lethal stratus
#

how do i make this, sufferin

shut crater
#

idk, test it and post if you get a new error

ancient plinth
#

It didn't give an error, but the card didn't rank up

shut crater
#

can you screenshot your whole calculate function

lethal stratus
daring fern
lethal stratus
#

i dont have cryptid installed :/

ancient plinth
#

I ripped the code from Raised Fist and Strength

shut crater
lethal stratus
#

nobody goes to stack overflow and gets told to google it

#

this isnt why im here

shut crater
# ancient plinth

I wasn't here for the whole conversation, what's the goal of this joker

open aspen
#

is there a way for me to make my joker epic rarity if cryptid is installed, else rare?

ancient plinth
daring fern
shut crater
lethal stratus
shut crater
#

we all learn as much as we need to make the mod we're making

open aspen
#

why not just look at cryptid code

#

when it works 🙏

#

u dont need to download it github search works fine

lethal stratus
#

im trying to not look at any other mods so that i dont copy their ideas

daring fern
open aspen
#

ig thats fair enough

paper zealot
#

Alrighty, I have a possible solution for you that involves patching the problematic line in the vanilla generate_card_ui code to allow all enhanced cards to have added tooltips.

It will break any mods that rely on the arguably bugged vanilla behaviour of overwriting the original tooltip of non-stone enhanced cards instead of adding new ones, but I've tested it with all the big dogs and haven't found any immediately obvious issues. There are much cleaner ways to change existing tooltips than info_queue, so it's probably not ever desired behaviour.

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''
elseif specific_vars and (card_type == 'Default' or card_type == 'Enhanced') then
    if _c.name == 'Stone Card' or _c.replace_base_card then full_UI_table.name = true
'''
position = "at"
payload = '''
elseif specific_vars and (card_type == 'Enhanced') then
    full_UI_table.name = true
elseif specific_vars and (card_type == 'Default') then
    if _c.replace_base_card then full_UI_table.name = true
'''
times = 1
match_indent = true
``` Valid for SMODS 0323b - 0423c at least.

This is probably the simplest solution, and could probably be included in SMODS by being added onto the existing SMODS patch (that adds the `or _c.replace_base_card` check) if there are no other obvious conflicts
red flower
open aspen
#

yea i dont agree with that

#

but i understand the reasoning

lethal stratus
#

wish lua was more straightforward

#

99% of my issues coding this are not knowing keywords

open aspen
#

fwiw i can just tell u what cryptid did

#

they hooked calculate_reroll_cost to get it to work

shut crater
#

Rank up the lowest ranked scored card

lethal stratus
#

that doesn't seem too bad

true dune
#

Hey quick question. Can anyone tell me the mod that ya can gain xp and level up as you play?

open aspen
#

you sohuld be able to check if ur voucher was redeemed

lethal stratus
#

not a voucher, its a joker

daring fern
lethal stratus
#

while held it sets the value of rerolls to a flat 7$

open aspen
open aspen
#

its literdally just redefining the function. hooking just means u also have the original function called

lethal stratus
#

from what i know from other languages i think its relatively similar

open aspen
#

eg run ur code before a fucntion

paper zealot
# lethal stratus 99% of my issues coding this are not knowing keywords

Lua 5.1 has only 21 keywords, and the syntax is usually pretty straightforward (imo)

     and       break     do        else      elseif
     end       false     for       function  if
     in        local     nil       not       or
     repeat    return    then      true      until     while
```The trickier part of Lua is that it includes a lot of syntactic sugar that overly simplifies what's actually going on, which can make it kinda odd on a first read
open aspen
#

and its not strongly typed

#

which can make problems sometimes not apparent

#

if ur not familiar

lethal stratus
#

there's lua, and then there's Steamodded 🤮

open aspen
#

eg i remember an issue where what was done was setting G.GAME.banned_keys (a vanilla array fyi) indexes = true to remove certain cards

#

and there was an option to make the cards u banned inverted (eg a blacklist and not a whitelist)

open aspen
#

but it didnt work right because they checked like array_allowed_cards[i], and not array_allowed_cards[i] == false

#

and it got all fucked up cause nil evaluates to false

red flower
#

i mean nil evaluating to false is not that weird

open aspen
#

it isnt but sometimes u dont consider it

#

esp if ur not super familiar

red flower
#

most stuff being truthy maybe is

open aspen
#

i caught it after like 5-10 mins of trying to figure it out

desert ore
#

ok well, I technically found a way to for a joker to modify base mult before cards are scored, but there has to be a better way to do this calculate = function(self,card,context) if context.before then G.GAME.hands[context.scoring_name].mult = G.GAME.hands[context.scoring_name].mult*card.ability.extra.x_mult G.GAME.hands[context.scoring_name].chips = G.GAME.hands[context.scoring_name].chips*card.ability.extra.x_chips return { mult = 0, chips = 0 } elseif context.after then G.GAME.hands[G.GAME.last_hand_played].mult = G.GAME.hands[G.GAME.last_hand_played].mult/card.ability.extra.x_mult G.GAME.hands[G.GAME.last_hand_played].chips = G.GAME.hands[G.GAME.last_hand_played].chips/card.ability.extra.x_chips end end

red flower
#

I'm pretty sure context.modify_hand is made for that but it's not documented yet and I've never used it

desert ore
#

as a context? what

shut crater
desert ore
#

yeah I've checked that out but I don't think blind contexts can be used for jokers?

red flower
#

they can

desert ore
#

😶

shut crater
#

that's good to know actually

lethal stratus
#

yeah uh... no

shut crater
#

SMODS.calculate_context calculates for all cards, that's wild

red flower
#

yes

lethal stratus
#

classic case of complete fumble

desert ore
red flower
naive flame
#

Ok I'm struggling a bit with installing the Lovely Injector

red flower
#

that one is kinda confusing but i think that's it

naive flame
red flower
#

that means that you put the mod's folder into %appdata%/Balatro/Mods (or the equivalent for your OS)

#

(create it if you don't have it)

shut crater
#

windows key + R

red flower
shut crater
#

or that

naive flame
#

Isn't the mods folder outdated or something?

#

Because like, Balatro Mod Manager tells you to delete the Mods Folder before installing (i think)

red flower
#

no

#

i think thats because BMM reinstalls everything so it tells you to delete it to not cause conflicts

naive flame
#

Ah, I see

#

Is the folder name caps-sensative?

red flower
#

i dont think so

naive flame
#

Do I need to put mods into the mod folder before running balatro?

red flower
#

yes

#

unless what you mean is if you can run it without mods which yes you can
but if you add a mod you need to restart the game

naive flame
#

Do I need to run it with mods in the folder to install the injector thing?

red flower
#

no

#

if the console pops up when you open the game then it's installed correctly

naive flame
#

Alright

#

Ok the console popped up

#

Now, to install Steamodded

thorn flame
#

ITS IN

#

feels so good having it in

paper zealot
thorn flame
#

yeah

daring fern
#

How would one do blueprint for non-jokers?

shut crater
#

like

#

a blueprint playing card?

daring fern
shut crater
#

so playing cards and consumables?

daring fern
shut crater
#

what is there that you're trying to copy that isn't a joker, playing card, or consumable?

#

I'm confused about your goal so I'm not sure how you would implement it

#

what is included in "all things"?

#

blinds? decks? the play button?

daring fern
shut crater
#

what is triggering the effect

daring fern
#

For example, a blueprint voucher.

shut crater
#

I imagine you would have to write a custom version of each thing you are trying to copy

manic rune
#

how would i remove an UI

shut crater
#

and the implementation would probably vary for each one

daring fern
#

Is there a way to make score card score from a specific card?

naive flame
#

Is this right for the mods folder?

paper zealot
manic rune
#

hm

iron haven
shut crater
#

don't underestimate the blank button blueprint

#

it lets you open the joker collection twice

manic rune
#

ok i THINK i understand it now, thanks breeze :3

thorn flame
#

14 jokers!!

shut crater
#

anyone know the best place to check if a joker is being hovered?

#

I can think of 2 and there are probably more

thorn flame
#

my newest ADDITION

#

holy shit

shut crater
#

I hate that but it's probably great with Bunco

#

(lovingly hate)

#

(very neat concept)

#

(but it would infuriate me)

thorn flame
#

loved spriting it

thorn flame
#

it;s the great milenko

brisk rose
shut crater
#

hologram is an outlier and should not be counted in the statistic

#

but yeah maybe a 1 in 2 chance?

thorn flame
#

hologram is uncommon for some fucking random ass reason

#

i mean base balatro has some weak rares

brisk rose
brisk rose
thorn flame
#

burnt joker has no business being a rare

#

same with like hit the road that shit sucks

steady smelt
#

does CardArea:move just not work? it seems like exactly what i need but trying it with G.play doesn't seem to do anything

shut crater
#

what is the broader goal?

steady smelt
#

been looking for something for awhile but haven't found anything that works, even changing the cards' T.y

shut crater
steady smelt
#

here's a copy:

i have a custom consumable that creates cards by adding them to play then drawing them to your deck, but if used in a pack opening they show up here and overlap hand cards, how can I move play down or adjust their position specifically in this case?

shut crater
#

have you tried creating your own cardarea?

steady smelt
#

i have no idea how to do that and it feels super niche for something like this, this seems like it should be easy and i just don't know how to do it

shut crater
#

my guess is that G.play is having its transform manually set

#

thus why it won't let you move it

brisk rose
steady smelt
#

changing G.play's T directly does seem to work though

#

dunno how i didn't try that at first lol

#

just gotta remember to change it back after

shut crater
#

oh cool lol

steady smelt
#

i tested by accidentally shifting it up like 10x the amount i wanted to at first and it shifted the background too fsr? but doesn't seem to be doing that now

shut crater
steady smelt
#

i assume it was just trying to make the background stay behind the 'in focus' area

thorn flame
#

ill consult w my mod partner

steady smelt
#

x5 and 1 in 2 cards drawn face down (and affected by oops) i think would be more balanced

#

but would be a playtesting thing

manic rune
#

i am now a bit confused

steady smelt
#

hi bepis

manic rune
#

G.UIT.C should make it so all the children nodes align vertically, right?

#

hi kuro

steady smelt
#

this is out of my area of expertise i wish you luck

manic rune
#

same

#

thanks tho :3

steady smelt
#

:3

shut crater
#

what is create_progress_bar

#

for some reason I don't see that when I search the source

manic rune
#

does exactly what you think it does

shut crater
#

I've barely touched UI but it seems like you're using G.UIT.C on the overall box but not the text

steady smelt
#

can you not just use create_progress_box? which is used for collection menu bars

daring fern
manic rune
steady smelt
#

thats fair

naive flame
#

Ok so I got the modding tool stuff all loaded in...

#

so what do I do now?

manic rune
paper zealot
shut crater
naive flame
daring fern
steady smelt
#

gahhh i hate event ordering

shut crater
manic rune
#

:3

#

I HATE UIS

#

WHY ARE THEY SO CONFUSING

#

😭

unborn bay
#

blame the existence of css

naive flame
#

What would be a good thing to start with when making a mod? New jokers?

unborn bay
#

new jokers

#

jokers are p easy to make

manic rune
#

like, it should align vertically but WHY is it horizontallyadsdma

shut crater
#

litereally shooting in the dark but what is the G.UIT.T doing on the line below

steady smelt
#

why in the world does this last event always trigger before the first event(s) no matter how i change the delays

manic rune
#

i mean