#💻・modding-dev

1 messages · Page 658 of 1

stoic void
#

What was the issue?

dusk sonnet
#

i didn't save changes 😭

slim ferry
#

bruh

little fractal
#

😭 real tho

dusk sonnet
#

but i CANNOT find the joker

#

😭

slim ferry
#

in what sense

dusk sonnet
#

if i check the collection i can't

#

it is in additions tho

slim ferry
dusk sonnet
#

nah

little fractal
#

try adding

unlocked = true,
discovered = true,

to the joker, might help idk

slim ferry
#

unlocked is true by default

little fractal
#

ah well

wanton jolt
#

do you like my sword sword sword my diamond sword sword

dusk sonnet
#

time to figure out how to add the decal!

primal trail
#

Uhm, so i recently got into Balatro and im enjoying it alot. I wanted to ask what some QoL mods are and any mods thaat improve overall enjoyment (No special decks just adds onto the standard game)

primal trail
little fractal
#

this is for people who are developing their own mods

dusk sonnet
#

i have no idea how to add the decal

#

help

#

im stupid and don't get it

#

even though it should be very obvious

red flower
#

missing a comma

dusk sonnet
#

oh ok ty

#

where abouts (is this stupid question)

little fractal
#

the }

dusk sonnet
#

OH

little fractal
#

so it should be },

dusk sonnet
#

the curly bracket?

little fractal
#

yes

#

I THINK

frosty rampart
#

yes that's correct

dusk sonnet
#

i don't think i got it right

little fractal
#

},
atlas = 'Joker',

dusk sonnet
#

oh 😭

little fractal
#

its okay

#

we've aall been there

dusk sonnet
#

phew

#

please work now 😭

#

gng is it over

little fractal
#

just get rid of pos it has a default

dusk sonnet
#

ok

#

?

slim ferry
dusk sonnet
#

oh

slim ferry
#

and not pos{ x = 0, y = 0 }

dusk sonnet
#

ok

#

YESSSSSSSSSSSS

little fractal
#

yay!!

dusk sonnet
#

that took like 2 nearly 3 hours 😭

little fractal
#

welcome to balatro moddding

dusk sonnet
#

figured

little fractal
#

hey at least you have it down now

dusk sonnet
#

yeah

#

(i understood nothing)

little fractal
#

welcome to balatro moddding

little fractal
# dusk sonnet yeah

also i would recommend using joker blocks with the live lua preview on as a way to kind of learn stuff like this, dont rely on it fully, not yet, atleast.

dusk sonnet
#

got it

#

thanks

#

ima carry on tmr, i must get in bed (my mum is making me)

little fractal
#

🫡

dusk sonnet
#

i have no idea what to make them do 😭

#

also im cooked for the sprites dude

#

i can't draw for the life of me

#

like

#

at ALL

#

what am i supposed to do

little fractal
#

🤷‍♂️

#

that parts on you dawg

#

is it not possible to put any other if statements after if context.joker_main then? everytime i try it just says all ifs are unexpected

slim ferry
#

what

#

why would it not be possible

little fractal
#

hold on im probably fucking this up somehow

slim ferry
#

are you like

#

putting the actual ends and stuff correctly

little fractal
slim ferry
#

you cant

#

put code in a table

little fractal
#

huh

slim ferry
#

you cannot put a block of code inside of a table

#

which is what you are doing right now

#

not all of the code should go in the return

little fractal
#

im

#

ill figure it out

slim ferry
#

have you looked at like

#

any sort of other mod as a reference

little fractal
#

those usually have too much shit going on for me to even process im not very good at that stuff

slim ferry
dusk sonnet
#

i am now beginning to realise that this may have been a bad idea

little fractal
#

same here i may be going insane

mystic river
little fractal
#

think i got it

dusk sonnet
#

i have accidentally forced myself into making 48 jokers and two mods with zero experience and zero art skills

little fractal
#

well good thing is you dont have a deadline

dusk sonnet
#

true

#

still im probably cooked

#

(i have no idea how im gonna make the sprites)

#

i don't even have ideas for what they're gonna do 😭

little fractal
#

how do i get random jokers (i have a random value already for how many) and destroy them? (i assume SMODS.destroy_cards(G.jokers.cards) plays a part but i couldnt find a comprehensible example on the vanillaremade wiki)

white hull
little fractal
#

i guess ill look again, maybe i missed something

white hull
#

Get a random element from G.jokers.cards, add it to a table

#

Then call SMODS.destroy_cards on the table

little fractal
#

yeah i have like no idea how to do that 😭 ill study up a bit and try in a sec

white hull
#

good luck!

wintry solar
#

you don't need to add it to a table

#

SMODS.destroy_cards accepts individual card objects too

white hull
#

yeah true, it just sounds like they want several

little fractal
#

yep yep

white hull
#

maybe not the best way to be doing this lmao

little fractal
#

hey as long as it works

#

i think someone would explode if they looked at these if statements lmao

white hull
slim ferry
white hull
slim ferry
#

did you check

#

like everything should have a mod or original_mod field afaik

white hull
#

I tried eval G.GAME.challenge.original_mod in the console

#

it's a nil

#

while in a challenge

slim ferry
#

G.GAME.challenge is a string no?

white hull
#

hmm

#

well vremade wiki doesn't say so i dunno lol

slim ferry
#

Does it give you an error or

white hull
#

G.GAME.challenge is a string yes

#

but then where would i look for original_mod

slim ferry
#

yeah so try G.P_CHALLENGES[G.GAME.challenge].original_mod

white hull
#

G.CHALLENGES is a table

#

G.CHALLENGES[challenge_id] isn't doing the thing tho

#

How do I access......

slim ferry
#

What is actually inside G.CHALLENGES

#

did you check

white hull
#

a table of tables like this

slim ferry
#

Okay so it appears to be number indexed

#

But that should work for looping over to find challenges from your mod

white hull
#

yeah prob

little fractal
#
        if context.joker_main then
            return {
                 random = pseudorandom("mod_somerandomseed", 1, 10),
                 message = tostring(random)}```
just has the joker say "nil", is this another table problem?
white hull
#

the return table takes only specific values

#

random is not a value it can do something with

little fractal
#

damn

white hull
#

you'll want to specify local random = pseudorandom("mod_somerandomseed", 1, 10) before the return table

#

so it's an estabilished variable

little fractal
#

ahh ok

white hull
#

then the table's message value - which it can work with - can take your local variable

slim ferry
#

Oh wait yeah

#

Nvm

little fractal
#

the message thing is just a debug

slim ferry
#

Random outside the table ya

little fractal
#

oh god damn it i have so many of these

#

okayyy so my randoms pick random jokers, but i cant use G.GAME outside of a return table, so I cant predefine the random functions.

#

do i need to make them local? if so, it just says its an undefined global

white hull
#

can you show the code?

slim ferry
#

Also wdym you cant use G.GAME

little fractal
#

thats what i thought

little fractal
slim ferry
#

?

#

that does not make sense

#

what are you even doing

wintry crater
#

i have this as softlock = true but when i use high priestess, it still shows up. i assume that the Planet set has something that my set does not but i dont know what it is, does anyone have any idea what i could do so it works as intended

slim ferry
little fractal
# slim ferry what are you even doing

trying to get a random joker

random_joker1 = pseudorandom_element(G.jokers.cards, "MOD_randomJoker1")

and i cant use random inside of a return table, but i cant use anything under G outside of a return table (when they were inside, the game actually opened, but didnt give any random values)

slim ferry
#

show the codep

#

because it appears that you are just putting the code outside of the joker as a whole

#

Which does not work

little fractal
#

im putting them with the atlas and pool and stuff

slim ferry
#

jus show the code

tulip pecan
tulip pecan
slim ferry
#

Huh

#

Okay i forget if its hardcoded to check if the softlock card is a planet

#

Check get_current_pool in vannilla

tulip pecan
slim ferry
#

i meant like look at the function in the code

tulip pecan
#

ohhhhhhhh

slim ferry
#

get_current_pool gets a table of all available card keys for a set

dusk sonnet
#

CHAT I THINK MY FRIENDS GONNA MAKE THE SPRITES FOR ME!!!

primal robin
#

Congratz

dusk sonnet
#

:D

mystic river
grizzled tide
#

for getting "every unique rank" in a hand, should i use get_id() or base.value

#

i dont really understand respects enchants so

red flower
#

you can get the same with base.rank + SMODS.has_no_rank

grizzled tide
rapid stag
#

hey so uh, wtf is happening? why isn't it doing it

#

???????????????

#

what wacky thunkism is this where it's reading a completely different value than what it's being told

#

is the unlock text just somewhere else?

#

...wait what? does process_loc_text just not work for the unlock table?

#

actually no, that's not even running because i'm changing it via malverk

#

...did eremel close the malverk thread?

rapid stag
#

wtf, didn't show up when i looked for it

#

discord being very cool

red flower
#

i had to do malverk texture

modest sedge
#

Is it possible to make a Joker that detects copies of other Jokers
like e.g. it does something if you have two of the same Joker

frosty rampart
#

#SMODS.find_card("j_modprefix_jokerkey") will be the total number of that joker you own

red flower
modest sedge
#

oh i didn't know it was that easy
I looked everywhere for a solution and found nothing so I just stated my problem here
Should've checked VanillaRemade omfg

red flower
#

i need to organize it better but idk how

grizzled tide
#

is there a way to grab the list of all ranks cards could have

red flower
#

SMODS.Ranks

grizzled tide
modest sedge
grizzled tide
#

why does get_id() throw a random negative number with stone 😭

red flower
#

if it's more than 1 then you have a copy

#

although it's probably better to do it manually to not increase the complexity lol

spiral mural
#

ignore the first command

tulip pecan
#

Quick question, how would I choose a random card from a consumable set with a key of uma_Planet, preferrably using the get_current_pool() function? otherwise it just ignores the fact that some cards are softlocked and still makes them while using SMODS.add_card({ set = 'uma_Planet' })

tulip pecan
final jewel
#

if context.individual and context.other_card:is_number() and context.cardarea == G.play then why that isn't working cause if I use not context.other_card:is_face() it does the thing on stone card

near coral
#

How do you write a compat check

#

Rejok is too complicated rn so I want it to have a compat check

#

And in a way that doesn't require you to edit every vanilla jokers' code just to add that check in

#

Do you just make it false for all by default unless specified otherwise?

red flower
red flower
spiral mural
red flower
#

one is for v and the other for

near coral
spiral mural
final jewel
red flower
#

there isn't really a way to check

#

vanilla does not is_face and not an ace iirc

near coral
#

I'm gonna bint my bogos

lament agate
#

is it possible to make certain part of localization to appear if certain requirements are met

#

i.e "+4 Mult" shows up if you have this Joker

#

on their description

red flower
#

if you have a lot of combinations you can use main_end

#

if you have few then it's easier to change localization keys

lament agate
#

what about the first one?

near coral
#

How do you maek compat checkds

red flower
tulip pecan
red flower
#

softlock should be in config

#

idk why it didn't work then tho

tulip pecan
#

lemme retry rq then, maybe i messed smth up

red flower
#

ah it only checks softlock if it's the set planet

final jewel
#

do stone card keeps the id or it change

#

not (context.other_card:get_id() > 10 and context.other_card:get_id() < 14) I tried that but it doesnt work

red flower
red flower
#

stone cards have negative id

final jewel
#

wait im dumb

#

(context.other_card:get_id() >= 2 and context.other_card:get_id() <= 10) it should work

tulip pecan
tulip pecan
#

oh i see now

#

makes sense, thank you!

lament agate
#

how do i use animated atlas for jokers

red flower
#

just make the atlas animated like for blinds

#

and it works

rapid stag
#

oops lmao, i accidentally made 8 ball able to make tarots when the consumable area is filled, how fix girldmDizzy

i think there's an issue with my compare, but i'm not sure what to set it to

red flower
#

you dont need to check if the other card can calculate smods already does

#

i dont see how it's adding extras tho

rapid stag
#

yeah - like, i based this off of vanillaremade's 8ball

#

the only thing i can think of is that i'm not adding to the consumable buffer

#

OH

#

when you take ownership of a joker and add a calculate function, the original calculate still runs

#

it might have done the one i wrote, plus its original calculate

red flower
#

ah yeah

rapid stag
#

how do i make it not do that

red flower
#

I think it doesn't if you always return

#

try returning nil, true

tulip pecan
steady tusk
#

I'm trying to have a seal be applied to all cards played, but right now it only applies to one card.

calculate = function(self, card, context)
    if context.joker_main then
        if context.cardarea == G.play then
            for i, card in ipairs(context.full_hand) do
                    card:set_seal("ModPrefix_Seal", true, true)
                    return {
                        message = "Sealed",
                        sound = "ModPrefix_SealSFX",
                        }
                    end
                    end
end
}```
What am I doing wrong?
tulip pecan
tulip pecan
#

Where are these consumable textures used in-game? I don't know if I need to make versions for my new consumable sets or not

umbral zodiac
#

also you probably don't need the context.cardarea check

steady tusk
umbral zodiac
#

if it was doing random stuff and you still checked for joker main then that's a Very Different problem

steady tusk
umbral zodiac
#

ok tbh i might recommend you put this effect in either context.before or context.after

#

depending on if you want it before/after scoring, but if you put it in joker_main i think it might be a bit weirder

steady tusk
umbral zodiac
#

for sure

tulip pecan
#

how would I make a joker check if a certain consumable was just used?

#

I have a custom joker with values that should go up when my custom consumable is sold. I know how to do everything other than relaying the information to the joker that the consumable was used

red flower
tulip pecan
#

makes sense

steady tusk
#

how do I get the tooltips on the description of cards? (like if a card description references a seal, it will define that seal in another textbox to the left of it)

daring fern
steady tusk
#

thanks!

steady tusk
granite raptor
#

before i make a variable for this myself, is there a G.GAME variable that tracks the most recently sold joker?

steady tusk
steady tusk
stuck ore
#

I'm having trouble getting pools to work where I want to make a custom tarot that only spawns in the joker from a pool but I can't tell why it is spawning any joker still. I've got this but I think something is wrong, do I need to enable pools elsewhere? SMODS.add_card({ set = 'Joker', pools = "Hamburger" })

tulip pecan
#

Inside the loc_vars = function() of a consumable card, would it be possible to reference the default config options for a joker? I basically have config = { extra = {stat1, stat2, stat3} } inside a joker and I want to be able to access those default values within a consumable card to use

mystic river
tulip pecan
#

I won't worry about it then

granite raptor
#

does this effect sound too strong? the seal initially only created the spectral card when destroyed but i realized that sounds kinda weak given that it's essentially "IOU a spectral card that actually does something". i'm wondering if the spread is too much though, even if card destruction isn't incredibly widespread

tulip pecan
#

How come even after I disable certain consumables using in_pool = function(), the default card still continues to show up?

stuck ore
#

I too would like to know this

stuck ore
#

Imma be honest even a 4/5 odds to spread would do wonders (in my opinion)

slim ferry
#

So you should do something to make the set not spawn at all if the pool would be empty

tulip pecan
#

so i need to modify the shop rate to fully turn them off?

slim ferry
#

If you want to avoid the default card

#

Yeah

tulip pecan
# slim ferry Yeah

is there an optimal place I can put my function to check whether a joker is present or not? that would be my trigger and I don't think I can just put the code in the joker, since once you sell the joker it probably wouldn't turn off since there's no code to run

steady tusk
#

im trying to make a seal that has the card its applied to only score half of its chips, whats the calculate function? i dont know how to get the card chip value

granite raptor
slim ferry
stuck ore
sleek valley
#

can someone help explain how G.UIT.O works? i know im doing something wrong here but i have no clue how to fix it

lament agate
#

@faint yacht yeyooo, just asking if love.timer.getFPS would work for Balatro?

primal robin
#

Just check how vanilla checks fps

lament agate
primal robin
#

Global search exist

lament agate
#

it doesnt work for me

shell timber
#

check what debugplus does then

lament agate
#

oh huh

#

thats odd

#

im just testing if everything works atp

inner terrace
#

Hmm
Is it possible to get the location of a joker in its atlas?

shell timber
#

when are you calling it

lament agate
#

in calculate?

#

i mean, the day, month, hour stuff worked

daring fern
inner terrace
#

Oh! For some reason, I thought that referred to, like, position on the screen

lament agate
inner terrace
#

Hm... getting an error trying to index pos, which means I think I have my syntax wrong
Also, is there a resource that shows all of the card.ability and card.config syntax?

inner terrace
#

card.children.center:set_sprite_pos({x = card.config.center.pos +1, y = 0}) is the single line - I can send the whole function, it's basically trying to make it so that the popcorn card changes sprites when it activates. If I have it as an integer, it works fine

inner terrace
# daring fern Code?

I managed a workaround, by making a config = {extra = {cardpos}} field, and accessing it with card.ability.extra.cardpos to increase continually

daring fern
inner terrace
#

Ohh, okay

inner terrace
# daring fern It should be `card.children.center.sprite_pos.x+1`

Is there a resource for learning all of the card.children, card.config, and card.ability contents?
I looked through modding-resources, and I think I've read effectively every page in the smods wiki, but I haven't found anything that discusses those past some basic card.ability stuff

primal robin
#

there's multiple issues

#

First, it's not how you create a card in a first place (check SMODS.create_card)

#

Second, c_fool used as a variable, not a string

#

And third, you cant put Card in G.UIT.O, you need make CardArea, put your card in this area, and put area in G.UIT.O

sleek valley
primal robin
#

Well no

#
local area = CardArea(0, 0, G.CARD_W, G.CARD_H, { type = "title", card_limit = 1, highlighted_limit = 0 })
local card = SMODS.create_card({ key = "c_fool", area = area })
area:emplace(card)

return { n = G.UIT.O, config = { object = area, id = "consumeable" } }
#

In Balatro we call it consumeable like LocalThunk intented

lament agate
#

is there any context that triggers during scoring?

primal robin
#

i mean isnt like billions of them

#

like context.before

lament agate
#

right

#

but isnt that trigger before scoring?

primal robin
#

scoring is multi-staged thing yk

#

technically after pressing "play hand" everything it's scoring

lament agate
#

riiiight

crisp coral
#

yeah after context.press_play is all scoring

dapper sun
#

i've done it before

primal robin
#

idk when I was trying it was crashing

dapper sun
#

well i was doing it with new Card(

#

maybe it's smtn in the smods function that makes it dislike putting them in ui

#

i do it here

primal robin
#

Kinda makes sense since card is Moveable but, whatever

lament agate
primal robin
#

nxkoo are you interacting with calculating for first time or smth

lament agate
#

😭

#

hey this is my time to learn, i never used that before

#

only before and after

primal robin
#

I thought you're improved in modding since stuff you're doing for bad director is looks cool

#

or all this done bu Ruby and not you

lament agate
#

ruby just did the planet and thats it

#

just because i dont know 1 context doesnt mean i dont know anything,,,,,,,,

sleek valley
#

we're here to learn cause we dont know, it's not our fault that sometimes the questions sound a lil stupid

shell timber
#

press_play is a newish context anyways

lament agate
#

ah fair

#

thanks

dapper sun
#

how do i stop a card from being draggable

daring fern
dapper sun
#

ty

sleek valley
#

i cant figure out what's wrong for the soul to not animate

#

the toggle doesnt even stay on, if i press it on that screen, switch to smth else and come back, it's just off again

daring fern
lyric wadi
#

how do i delay played cards from going away

#

im trying to have the played card do the usual flip and flip back animation revealing the change, then goes to discard

#

but currently they just fly off after the first flip

wild patrol
#

is there an smod function to control the tutorial jimbo?

#

or just to have this popup

sleek valley
#

i think mod.quip_filter(SMODS.JimboQuip, string) is what you're looking for?

wild patrol
#

even with a string

oblique lotus
#

Got a unique problem. I have a card that moves to different storage sections (i.e. joker slots, consumable slots, etc.) I want an effect to happen the moment it switches to a new slot type. How could I do that, and are there any examples of something similar?

frosty rampart
#

put the code for the effect right next to the code for it moving?

oblique lotus
#

Okay, thanks for the tip

wild patrol
#

well it's something just ripped the code from the vanilla game lol

#

just can't get the text box to appear

#
    if not whitelist[user:lower()] then return end
    if is_on_cooldown() then return end
    if not text_to_show or text_to_show == "" then text_to_show = "Hello!" end
            local Jimbo = nil
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 2.5,
                blocking = false,
                func = (function()
                    if not text_to_show or text_to_show == "" then text_to_show = "Hello!" end
                        Jimbo = Card_Character({x = 0, y = 5})
                        Jimbo.ui_object_updated = true
                        Jimbo:add_speech_bubble(text_to_show, nil, {quip = true})
                        Jimbo:say_stuff(1)
                        return true
                end)
            }))
        end```
#

closes I can get

#

text doesn't seem to want to appear

#

even with default speech bubble from the vanilla game

sleek valley
wild patrol
#

it's fine i';ll tinker around

#

with the vanilla code

#

see what happens

sleek valley
#

good luck bro

wild patrol
#

I can get everything to work but the text

#

can't seem to pass the text from chat to the bubble like attention text does

dusk sonnet
#

maybe dumb question but how do i add a second joker

#

i can't figure it out

slim ferry
#

do SMODS.Joker

wind steppe
#

like to a mod?

slim ferry
#

Again

wind steppe
#

you put another SMODS.Joker

dusk sonnet
#

like this? (99% chance this is wrong)

#

i haven't tested it yet

wind steppe
#

yeah

dusk sonnet
#

oh

#

wait lemme test

slim ferry
wind steppe
#

eris why are you hearts

dusk sonnet
slim ferry
#

There are suit roles

dusk sonnet
#

nah it didn't add

slim ferry
#

Huh

#

Is this in another file

wind steppe
#

what's your other jokers key

slim ferry
#

Oh yeah

#

You need to have different keys

dusk sonnet
#

i see

#

should i change the key to "Joker2" or the name of the joker?

slim ferry
#

well usually people just do something similar to the name

#

Because thats convenient

dusk sonnet
#

so like

wind steppe
#

name of the joker all lowercase

dusk sonnet
#

"swordy" for sword or "skate" for skateboard?

slim ferry
#

Just do whatever you want the actual key doesnt matter in the end

dusk sonnet
#

ok

#

the SECOND i opened the additions it crashed 😭

slim ferry
#

Did you put the correct atlas key

wind steppe
#

your description string is closed right

slim ferry
dusk sonnet
#

i assume this is incorrect

slim ferry
#

well

dusk sonnet
#

help me im scared

slim ferry
#

whats your atlas key

dusk sonnet
wind steppe
slim ferry
#

Okay but

#

Whats the atlas key

#

SMODS.Atlas

#

The key in it

slim ferry
dusk sonnet
#

sword.png (like the file name)

wind steppe
#

fair

slim ferry
#

The key

dusk sonnet
#

oh

slim ferry
#

Not path

dusk sonnet
#

OH WAIT

#

😭

idle plaza
dusk sonnet
#

i may have fixed it

#

ok

#

it's in the game

#

but the decal is gone

#

not like the default one

#

it's just

#

gone

wind steppe
#

show us your SMODS.Atlas

dusk sonnet
#

for skateboard?

wind steppe
#

is the atlas on the joker also skate

dusk sonnet
#

yeah

wind steppe
#

your image is probably just white there then

dusk sonnet
wind steppe
#

you need to put art there for it to show up

dusk sonnet
#

no i have art in my folder for it

wind steppe
#

show image

dusk sonnet
#

same for 2x as well

wind steppe
#

pos should be 0, 0 not 1, 0

dusk sonnet
#

ohhh

#

and sword's should be 1, 0 not 0, 0?

wind steppe
#

also why not reuse the same atlas for both

wind steppe
dusk sonnet
#

oh

wind steppe
#

theyre both 0, 0 because its the top left

dusk sonnet
#

what

wind steppe
#

if you combined the atlases one would be 0, 0 and one would be 1, 0

dusk sonnet
#

OH

#

so keep them all as 0, 0?

wind steppe
#

yeah

dusk sonnet
#

ok

#

thanks!

#

ima do this for all the guys now

#

thanks

wild patrol
#

so smods.destroycard not work on Jimbo?

#
    if not whitelist[user:lower()] then return end
    if is_on_cooldown() then return end
            local Jimbo = nil
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                func = (function(_,text_to_show)
                    if not text_to_show or text_to_show == "" then text_to_show = "Hello!" end
                        Jimbo = Card_Character({x = 0, y = 5})
                        Jimbo:add_speech_bubble(text_to_show, 'bm')
                        Jimbo:say_stuff(5)
                        SMODS.destroy_cards(Jimbo, nil, nil)
                        delay(0.30)
                        return true
                end)
            }))
end```
#

still trying figure out why text won't pass through to speech bubble

wind steppe
#

i assume SMODS.destroy_cards was meant for Cards and not Card_Characters

wild patrol
#

i'll figure something out later on destroying it after the text is read later

#

right now just trying figure out why the box is empty

#

the box is empty even with vanilla dialouge

red flower
wild patrol
#

I can just use Character instead of Card_character?

#

or is that custom

red flower
#

that's custom i think it's earlier in the file

#

it uses cars character iirc

#

card

wild patrol
#

I think it has something to do with the math.random

#

and how it randomly selects quips

#

game might be looking for a list of quips under ""

#

instead of just displaying the text written

dusk sonnet
#

don't ask

wild patrol
dusk sonnet
#

wait no it'd be more like this then

#

guys is this right?

wild patrol
#

is there a better explanation of the SMODS.JimboQuips

#

the smods wiki just seems so unifinshed

#

Game keeps crashing with string error

mystic river
#

silly that we have to look there for that, though

sturdy compass
#

We should put together a documentation strike team

mystic river
#

this is true

torpid flicker
wild patrol
#
    key = 'example_quip',
    extra = { center = G.P_CENTERS.j_hanging_chad, particle_colours = { G.C.RED, G.C.WHITE, G.C.BLACK } },
    filter = function()
        if next(SMODS.find_card('j_hanging_chad')) then
            return true, { rarity = 100 }
        end
        return false
    end,
    loc_txt = {
        ['en-us'] = {
            "Hanging Chad is for Chads!",
        }
    }
}

chat_commands.text = function(_, user, text_to_show)
    if not whitelist[user:lower()] then return end
    if is_on_cooldown() then return end
    if not text_to_show or text_to_show == "" then text_to_show = "Hello!" end
    SMODS.JimboQuips('ttv_example_quip')
end```
#

haven't tried passing the chat text to it yet

sturdy compass
wild patrol
#

trying make sure this is the right setup

mystic river
sturdy compass
#

Ironically

mystic river
#

... oh there is a link. it's at the bottom of the table of contents

#

how long has that been there. did my adhd brain turn it into background noise again

wild patrol
#

every time I try using SMODS.JimboQuips()

#

just tells me it's a table value

torpid flicker
#

if i knew smods better and wasnt swamped id help with documentation

#

its really needed

slim ferry
#

JimboQuips just stores the created objects

wintry solar
#

Proper quip docs are here

#

They just haven’t been organised into a nicer place because I don’t care for doing it 🙃

dusk sonnet
#

gng how would i code this: "When this Joker is Triggered OR Retriggered, Activate one of 3 effects in rotation: +30 Chips, x3 Mult, Retrigger the Joker to the Left of this Joker. When this Joker is Triggered AND Retriggered 15 times, Activate all 3 effects at once."

#

friend said to make this the effect for Coil but i have no idea how to do that

#

help

#

im cooked aren't i

wintry solar
#

No you just need to count the times it triggers

dusk sonnet
#

im still trying to figure out how to code it

#

would this be right for the description?

#

'When this Joker is triggered OR retriggered, activate one of three effects in rotation: {C:Blue} +30 Chips, {C:Red} x3 Mult, {C:Green} Retrigger Joker to the left. When this Joker is Triggered AND Retriggered 15 times, activate all 3 effects at once.'

#

exactly like that

#

in the code

wintry solar
#

Triggered and retriggered are synonymous

dusk sonnet
#

what

#

what does synonymous mean

slim ferry
#

Means the same

#

A retrigger is just triggering it again

dusk sonnet
#

oh

#

so i change that to triggered?

slim ferry
#

Yeah

dusk sonnet
#

ok

#

anything else i should change?

#

or is it right

wild patrol
#

JIMBOQUIPS DOESN'T SEEM TO WORK FOR WHAT I'M GOING FOR

#

caps sorry

wintry solar
#

What are you trying to do

wild patrol
#

doesn't matter what I do the box is always blank

#

trying ot pass a twitch chat message into the box

#

works with attention_text

wintry solar
#

That’s not what jimboquips are for

#

Jimbo quips are messages at the end of a run

wild patrol
#

well tweaking with it a littlebit seems to be getting results

lyric wadi
dusk sonnet
#

lol

#

the funny thing is that's an inside joke between me and some friends

lyric wadi
#

make sense

#

very relatable

dusk sonnet
#

chat should i send my placeholder art so far

lyric wadi
#

im chat and i say sure

dusk sonnet
#

ok

#

i still have Subspace, Vinestaff and Coil to make

#

(and the 7 Swords and Dom and Valk but WE DON'T TALK ABOUT THEM YET OK?)

lyric wadi
#

better than i could've done tbh

dusk sonnet
#

:D

#

im using mspaint 😭

lyric wadi
#

i just have the advantage of transparency and some filters

dusk sonnet
#

yeah

lyric wadi
#

otherwise im on even ground art skill wise

#

like im good at taking an existing thing and editing it

#

but drawing things from scratch i cant do that

dusk sonnet
#

i have the power of mspaint and a mouse

lyric wadi
#

also still better sprite than yahislop

dusk sonnet
#

😭

#

i hope my code doesn't implode 😭

#

last one

wild patrol
#

needs a lot of work but the vision is there

#
    if not whitelist[user:lower()] then return end
    if is_on_cooldown() then return end
    local Jimbo = Card_Character({center = 'j_cavendish'})
--    local holdtime = text_to_show:len() / 10
    if not text_to_show or text_to_show == "" then text_to_show = "Hello!" end
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        func = (function()
            Jimbo:set_alignment{major = G.play, type = 'cm'}
            attention_text({ colour = G.C.WHITE, text = text_to_show, scale = 1, hold = 8, major = Jimbo, 'bm', backdrop_colour = G.C.PURPLE })
            play_sound('voice'..math.random(1, 11), G.SPEEDFACTOR*(math.random()*0.2+1), 0.5)
            return true
        end)}))
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        delay = 8,
        func = function()
            Jimbo:remove()
        return true
        end
    }))
end```
#

sloppy but get it better later

wild patrol
#

progress

#

basically duck taping together my own

#

with create card and attention text

granite jay
#

Can you modify consumable slots in challenge decks?

mystic river
#

yeah
idk if there's a built in config for it, but you can always put it in the apply function

gaunt folio
#

@daring fern small question apologies for the ping again, is there any way to make a card immutable with your modification script you provided? If so would it be in here or extras, the code mentions "card.config.centers.immutable" or whatever

thick drift
#

So, don't know if this might be related to something else that might have been messed up from my issue last night with accidentally refactoring G.jokers across way too many files (I've already redownloaded lovely and smods), but now I'm having an issue where the game crashes once I try to spawn a Photograph at the end of the round using another joker. This does not happen with another mod joker that I have that spawns mod jokers at the start of a round, and it's not happening with Judgement either. I have yet to do rigorous testing for this issue on other jokers that spawn jokers, but the traceback places the source of the error at engine/object.lua , so I'm not sure if this is an issue on my end or if something is corrupted in my game files. Has anyone else experienced a similar issue?

daring fern
gaunt folio
#

so like where id put blueprint_compatible?

daring fern
next timber
#

is there a way to tell if a card is juicing up?

#

oh i can get if card.juice is a table or not

#

neat

granite jay
#

Anyone know how to make it so jokers only do stuff when you buy things from the jokers/consumable row?

#

And not vouchers/bosster packs too?

mystic river
#

check the set of the purchased card

#

is what I'd try first

dusk sonnet
mystic river
#

syntax errors

#

you opened a pair of curly brackets without closing it

dusk sonnet
#

it says its around here but i can't find it

next timber
#

is the range of x and y position for a joker (NOT its atlas) roughly consistent between screen sizes?

slim ferry
#

no lmfao

mystic river
slim ferry
#

the horrors of balatro units

granite jay
#

How do you get the best hand from the stats menu?

#

for a joker?

next timber
#

is. there a way to know how wide and tall the users screen is in Balatro Units

granite jay
#

How do you get the high score for your current run?

next timber
#

in a hand or in a round

#

highest score in one hand is G.GAME.round_scores.hand.amt

granite jay
#

The best scoring hand for the current run

#

like the high score from your you win screen

loud crescent
#

sorry for interrupting, but does anyone know how functions like pseudoseed, pseudoshuffle and pseudorandom_element in misc_functions.lua work (or any resources that document how they work)? their source code is above my understanding and i couldn't find anything about them (or the random number generation techniques balatro uses) on google

red flower
granite jay
#

Anyone know how to add extra stuff to the vanilla challenges?

thick drift
#

I would assume you'd have to hook or take ownership of those objects

#

what are you trying to add?

loud crescent
# red flower it basically just uses math.random from lua but saves the seeds so they stay con...

im trying to re-implement some of the pseudorandom code in a different programming language (rust) and was able to at least attempt to translate some of it, but specifically the calls that look like pseudorandom_element(..., pseudoseed(...)) give me trouble, as pseudoseed returns a float between zero and one, but the second parameter to the pseudorandom element chooser is passed to math.randomseed which usually only accepts integers and according to this reddit thread is a function that works different in LuaJIT. I've just been replacing the calls to math.randomseed with rand::StdRng in rust, but that only works with u64 (integers and not floats).

Reddit

Explore this post and more from the lua community

loud crescent
# loud crescent im trying to re-implement some of the pseudorandom code in a different programmi...

just truncating the float doesnt work as explained in the thread as that will always result in zero, leading to the same element always being picked
(Example output, trying to generate the erratic deck on some random seed 7LB2WFFF)

Seeding on `erratic` yields 0.48454444595106194
Seeding rng with 0
Picking card # 41
Card { rank: Rank4, suit: Diamond, enhancement: None, edition: Base, seal: None }

Seeding on `erratic` yields 0.6072349004158222
Seeding rng with 0
Picking card # 41
Card { rank: Rank4, suit: Diamond, enhancement: None, edition: Base, seal: None }
red flower
umbral zodiac
#

let me find the github

#

this function gets the exact pixel pos of the center of a card

gaunt folio
#

how do I give a card a modded sticker? this doesnt work

daring fern
steady tusk
#

how do I make a seal only score half of a cards chips? (like a 4 card scores 2 chips, 10 scores for 5 etc.)

steady tusk
#

what is hooking 😭

white hull
#

it's a little complex at first but you'll get the hang of it

steady tusk
#

yeah im looking at it and i dont get ANYTHING i guess i can hold off until im more experienced

azure valley
#

@loud crescent I can def help, but I'm afk. Can you ping me sometime later tonight? About 8 hours

loud crescent
daring fern
azure valley
#

@loud crescent sitting down for a second and reading up, it seems like you're running into the same problem I did. Essentially, luajit provides a random seeding function that doesn't conform to the same API as the C random seeding function that PUC Lua uses. Instead of taking an integer it takes a double. This explains the difference between PUC Lua (and the behavior you are expecting).

See https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lib_math.c#L114

GitHub

Mirror of the LuaJIT git repository. Contribute to LuaJIT/LuaJIT development by creating an account on GitHub.

real night
#

hey guyseth how do you make a random shop item freeth

daring fern
daring fern
real night
# daring fern Code?
        if context.starting_shop then
            local shopcard = pseudorandom_element(G.shop_jokers.cards, 'seed')
            shopcard.ability.couponed = true
            return {
                message = "Pirated!"
            }
        end
red flower
#

try adding shopcard:set_cost()

real night
#

wait what were the things for that i have not modded in like 7 years

#

like the things inside the brackets

mystic river
#

the parameters? set_cost doesn't have any iirc

real night
mystic river
#

yarr

real night
red flower
#

add it after the couponed line

mystic river
#

you're not setting the cost to anything, you're just updating what it should be based on being coupon'd

real night
#

ohhhh

real night
spiral mural
#

is there such a thing as double hooking a function..

daring fern
faint yacht
#
local scref = SMODS.score_card
function SMODS.score_card(card, context)
    scref(card, context)
    scref(card, context)
end

would do the function twice. Or the hook of it that may have come before yours.

next timber
#

why is using card.children.center:set_sprite_pos({x=1,y=0}) on a joker putting a grey rectangle behind the joker?

frosty rampart
#

no colon after set_sprite_pos, only before it

next timber
#

oh that was a typo in typing it out here not in the code

#

<@&1133519078540185692> kill

frosty rampart
#

oh, hm. idk then

next timber
#

maybe i messed up on my joker atlas or smth

faint yacht
#

-# You mean shadow?

next timber
#

obviously i dont mean the shadow

#

lol

#

on second glance

#

i seem to have left my reference image partially visible

frosty rampart
#

that would probably do it

wild patrol
#

the streamer can finally fight back

wild patrol
#

trying to get the booster to fill with vanilla jokers after all are picked up

#

always seems to result in jimbo

#

trying the i

#

i == 1 only makes the first one a twitch joker anything else just results in this

#

tried <>~ and changing the number around

#

or just decrease the extra var when joker pool reaches a certain limit

stuck ore
#

Question: do I have to enable pools or set them up or can I just put pools = { hamburger } in the joker and then do a SMODS.add_card({ set = 'Joker', pools = "Hamburger" }) Or is there something I'm missing, because it's spawning anything as opposed to just from the pool

tidal hemlock
faint yacht
#

set sets the pool.

red flower
stuck ore
#

oh so instead I need to have set = Hamburger?

stuck ore
# red flower do you have an smods.objecttype
    set = "Tarot",
    key = "hamburger",
    loc_txt = {
        name = "Hamburger",
        text = {
            "Create a random {C:attention}Hamburger Joker{}",
            "{C:inactive}(Must have room){}",
        },
    },
    pos = { x = 0, y = 0 },
    atlas = 'hamburger_1',
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('timpani')
                SMODS.add_card({ set = 'Joker', pools = "Hamburger" })
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
        delay(0.6)
    end,
    can_use = function(self, card)
        return G.jokers and #G.jokers.cards < G.jokers.config.card_limit
    end,
}```
This is what I have so far, I haven't worked with consumables before so this is a first
red flower
#

so you want to make that tarot?

stuck ore
#

yos

tidal hemlock
red flower
#

SMODS.add_card{ key = 'c_[your mod's prefix]_hamburger' }

stuck ore
#

oh

red flower
stuck ore
#

when I browsed through there I couldn't find that but now I know it's there I'll look through it again thanks

kindred niche
#
local cubedjoker = {
    object_type = "Joker",
    name = "cubedjoker",
    key = "cubedjoker",
    atlas = "atlas_common",
    pos = { x = 1, y = 0 },
    config = {
        extra = {
            mult = 3
        }
    },
    rarity = 2,
    unlocked = true,
    discovered = false,

    in_pool = function(self, args)
        return false
    end,
    
    blueprint_compat = true,
    perishable_compat = true,
    eternal_compat = true,

    loc_vars = function(self, info_queue, card)
        return { vars = { number_format(card.ability.extra.mult) } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if context.other_card.get_id() == 3 then
                context.other_card.ability.perma_mult = to_big(context.other_card.ability.perma_mult) or to_big(0)
                context.other_card.ability.perma_mult = context.other_card.ability.perma_mult + to_big(card.ability.extra.mult)
                
                return {
                    extra = { message = localize("k_upgrade_ex"), colour = G.C.mult },
                    card = card
                }
            end 
            
        end
    end,
    add_to_deck = function(self, card, from_debuff)
        card.sell_cost = 3
    end,
}

Any time I play a hand the game crashes and says that I tried to "index into local 'card' (a nil value)"

#

Its probably something really simple that I am just missing

clear ocean
#

am open to changing the denominator or dollar amount but what do you think of the concept itself?

wild patrol
#

I just noticed

#

gold stake stickers for jokers like perifishable and stuff

#

don't seem to work on custom joker pools?

reef bobcat
#

probably a super simple question but how would you give your joker description text

#

that tells you what it does

#

when you hover over it

red flower
steady tusk
steady tusk
#

does anyone know how to stop a function from looping? (for reference im using the code above, and it gets called like 10 times in a row, which is why it returns the "unrelated" number)

reef bobcat
wild patrol
#

At the end of the function

#

Usually works for me when something does a disaster loop of infinity

clear ocean
#

any tips on how to come up with ideas for jokers and stuff

wild patrol
#

Themeing usually

#

Pick a theme

#

Base your jokers around that

clear ocean
#

i think the main issue for me is that any idea i think of i feel like its either too derivative or been done before

wild patrol
#

There's nothing wrong with being a little derivative

#

As long as you're not carbon copying

#

Eventually every idea is gonna be done

#

There's like several different mods that have the same ideas

opaque forge
#

anyone know how to change the splash screen ace card to like a custom joker?

frosty rampart
#

wait for the next smods update and there will be a system in place to help you do that

opaque forge
#

bet

wild patrol
#

I'm using it rn

steady tusk
clear ocean
cerulean aspen
#

what is the code or way to add things to hypermult= { 1 , 4 } like how would i add 1 to the 1 when i play a card

frosty rampart
#

instead of it being a 1, it'd be card.ability.extra.something (where "something" is whatever you want), and you want to define something = 1 in the joker's config table.

winter flower
#

WRONG LINK

#

SORRY

frosty rampart
#

lol

winter flower
frosty rampart
#

anyway then yea reference the calculate functions documentation to see how to do something whenever a card is scored

frosty rampart
#

the answers are in the documentation that has been so kindly provided to you :)

red flower
#

i recommend also looking into the vanilla jokers as examples if it's easier for you to copy their stuff

frosty rampart
#

(specifically, look at VanillaRemade)

cerulean aspen
#

alr

cerulean aspen
frosty rampart
#

uh no
remember, you have to return hypermult = { something, something else }

cerulean aspen
#

return {
mult = card.ability.extra.hypermult,
hypermult = { 1, 4},
level_up_hand
}
so this?

frosty rampart
#

no mult = at all, and hypermult = { card.ability.extra.hypermult, 4 },
now you can change the number at other timing during calculation

cerulean aspen
#

ooooo

#

how would i check for extra mult? or chips

#

like lets say that if i play a flush

frosty rampart
#

no need
returning hypermult = { 1, 4 } will always apply ^4 to the current mult value at the time that the joker triggers

clear ocean
# clear ocean

working on it and so far everything else is working fine but noticed that it resets and applies a new seal when you play a card that already has a seal so added a check, but i guess i did it wrong. any solutions?

#

if context.full_hand[1].card.seal == nil then is the check

red flower
#

context.full_hand[1].card.seal
remove the .card

frosty rampart
#

^ it should just be context.full_hand[1].seal

cerulean aspen
clear ocean
#

that did the trick @red flower @frosty rampart thanks

frosty rampart
clear ocean
#

last thing before working on jokerdisplay which shouldn't be hard is "Active!" in a blue colour good for this kind of joker

#

thats what dna does but something like sixth sense does k_spectral

cerulean aspen
frosty rampart
#

not yet, you have to code that yourself

#

again, check the calculate functions documentation to see how to get code to run whenever a card is scored

frosty rampart
cerulean aspen
frosty rampart
clear ocean
#

i agree and go ahead and which to attention as i think that would be more accurate

winter flower
#

then in localization (whether using localization files or loc_txt)
do #n#
(n being dependent in what order you put the vars, so card.ability.extra.whatever would be #1#)

cerulean aspen
#

alr ty

clear ocean
#

yeah like that also... also new synergy

#

just have scout before dna so it can apply the seal first before copying

#

i was inspired to have it as scout similar to how scouts get their badges

cerulean aspen
#

i dont know how you do this this is hella confusing

clear ocean
#

not sure if "scout," "scout joker," or "scoutmaster" is the best theme but i think this does the trick. i really like how this came out

cerulean aspen
#

SMODS.Atlas {
key = "niko",
path = "heisgod.png",
px = 71,
py = 95
}

SMODS.Joker {
key = 'joker2',
loc_txt = {
name = 'Niko who is a god',
text = {
"gives {1}4 mult, +1 hyperoperator when flush is played"
end"
}
},
config = { extra = { mult = yes } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
rarity = 2,
atlas = 'niko',
pos = { x = 0, y = 0 },
cost = 2,
calculate = function(self, card, context)
-- Check if we have played a Flush before we do any scoring and increment the mult
if context.before and next(context.poker_hands['Flush']) then
card.ability.extra.hypermult = card.ability.extra.hypermult + card.ability.extra.change
return {
message = 'Upgraded!',
colour = G.C.RED
}
end
-- Add the mult in main scoring context
if context.joker_main then
return {
hypermult = {card.ability.extra.hypermult, 4}
}
end
end
}

this is the joker

winter flower
#

why is there an end there

frosty rampart
#

^ remove the end" line in your localization

winter flower
#

also the {1} will just vanish because formatting uses "{}"

cerulean aspen
#

hmm okay

winter flower
#

and also the {1} has to be {#1#}

#

and the mult being "yes" will just lead to nil as the variable "yes" has no value

#

(or nil)

#

AND you don't have a config for hypermult and change

frosty rampart
#

yea why did you get rid of hypermult in the config 😭

cerulean aspen
#

heh?

#

i used this from the tutorial thingy calculate = function(self, card, context)
-- Check if we have played a Flush before we do any scoring and increment the mult
if context.before and next(context.poker_hands['Flush']) then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.change
return {
message = 'Upgraded!',
colour = G.C.RED
}
end
-- Add the mult in main scoring context
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end

frosty rampart
#

no like here
you used to have hypermult = 1 in here, right?

cerulean aspen
#

that use to be like 98135769839832475912759871253981725

frosty rampart
cerulean aspen
#

thats here and here

frosty rampart
#

and you want to define something = 1 in the joker's config table

frosty rampart
#

you should have this:

config = { extra = {
  hypermult = 1,
  change = 1
} }

to properly define what those variables start at. the computer doesn't magically know that you want them to equal 1

winter flower
#

ok im just gonna

cerulean aspen
#

ohhhh

winter flower
#

if you're still struggling badly i'm just gonna do it myself 😭

frosty rampart
#

i try not to just write code for ppl because i think it's important that ppl learn how to do it themselves

cerulean aspen
#

i dont code well even though im in a coding class in my school 😭

frosty rampart
#

otherwise they'll need you to write your code for them all the time

cerulean aspen
#

yeah makes sense tho

#

im kinda stupid

#

yeah

cerulean aspen
#

i put the config in and the game crases on loading

#

i replaced it for the config i had before

frosty rampart
#

ok well now you also need to update the loc_vars function, because card.ability.extra.mult doesn't exist anymore
and also put a comma after the last closing brace of the config

cerulean aspen
frosty rampart
#

think about what variables you want localization to have access to and put those variables in the table

frosty rampart
#

table = array = everything inside a set of {}

#

(technically table does not = array, more like arrays are a subset of tables)

frosty rampart
cerulean aspen
#

so its wokring right now

#

thank you

cerulean aspen
frosty rampart
#

no
in the return table, have level_up_hand = "High Card"

cerulean aspen
cerulean aspen
#

cause rn i have this but it kinda dosent work

frosty rampart
#

read the localization docs again
you put stuff in the vars table in the loc_vars function, and then access that with #n# in the text itself (where #1# is the first thing in the vars table, #2# is the second thing, etc)

cerulean aspen
frosty rampart
#

specifically in the loc_vars function, yes

cerulean aspen
#

how do i call that function?

cerulean aspen
frosty rampart
#

no that is not at all what i was saying

frosty rampart
#

the game will call it whenever it generates the text in-game

frosty rampart
cerulean aspen
#

oh just that?

frosty rampart
#

yes

#

access that with #n# in the text itself

cerulean aspen
#

would i put n instead of 1?

frosty rampart
#

no

#

n is a placeholder for a number

frosty rampart
cerulean aspen
#

so 1 is self, and 2 is info_queue?

mystic river
#

#n# becomes vars[n]

frosty rampart
#

it can be any number of values

mystic river
#

vars being the vars table in the table you returned from loc_vars

frosty rampart
#

^^^

cerulean aspen
#

wait so would i put vars[#1#]4 or what?

mystic river
#
...
return {
 vars = {
  "this is vars[1]",
  "this is vars[2]",
  "lua is implicitly indexing these with numbers"
 }
}
frosty rampart
#

instead of just gives 14 mult

cerulean aspen
#

ohhh okay

#

so #n# calls a var?

#

or like repeats it

frosty rampart
#

i don't understand what you mean by "repeats it" but i'm going to say yes it calls a var

mystic river
#

tbc that's not any lua function, this is something thunk coded into balatro specifically

#

which is why it doesn't follow normal lua syntax at all

reef bobcat
#

hey guys i coded this in but the game crashed D: what did I do wrong?

cerulean aspen
#

how would i add something that makes it so that one card can apear in shop, only when another joker is in the joker slot

reef bobcat
winter flower
mystic river
winter flower
#

why is there just a
"effect = nil" there

mystic river
#

anyway you're missing an end in your calculate

reef bobcat
frosty rampart
# cerulean aspen how would i add something that makes it so that one card can apear in shop, only...

the "one card" in question should have a custom in_pool function that checks if the player owns the "another joker"
documentation source https://github.com/Steamodded/smods/wiki/SMODS.Joker
you don't need to worry about any of the arguments, just have it return next(SMODS.find_card("j_modprefix_jokerkey")) where modprefix is your mod's prefix and jokerkey is the key of the "another joker". in_pool should return true when it's allowed to spawn and false when it's not, and SMODS.find_card will find all instances of the given card that is owned by the player

cerulean aspen
#

alr ty

mystic river
reef bobcat
frosty rampart
#

if anything = nil like that you can just remove it entirely

torpid flicker
#

how do you make a varible that persits between restarts of the game?

mystic river
reef bobcat
#

ah ok, here then

torpid flicker
#

because then you can reset it if needed

winter flower
#

you're missing an end

winter flower
#

hoky fuck

mystic river
cerulean aspen
#

i may be a tad stupid

reef bobcat
#

omg you guys were right

#

i put the end and it worked

reef bobcat
#

thanks so much

cerulean aspen
#

just without the bool

red flower
#

no...?

cerulean aspen
#

im confused 😭

red flower
#

look at where it is and how it is written in the link

cerulean aspen
#

this any better?

frosty rampart
#

it's a step in the right direction

red flower
#

you fixed where it is but not how it's written

cerulean aspen
#

oh great 😭😭

winter flower
#

oh my god

cerulean aspen
#

wait i just realized

#

niko who is a god dosent spawn in the first place

#

he dosent spawn in the first place

reef bobcat
#

oof, ok so the joker is in but it isn't giving the +200 chips

mystic river
frosty rampart
mystic river
#

the docs just use that to tell you what your function should return

winter flower
#

i don't want to make someone feel bad but this is going horribly 😭

cerulean aspen
#

ussually i do everything possible wrong before i get it right

kindred niche
#

This joker crashes the game when any hand it scored.
The error message is "attempt to index local 'card' (a nil value)"
Probably missing something really simple

mystic river
frosty rampart
kindred niche
#

Oh my god

cerulean aspen
kindred niche
#

Thank you

mystic river
#

it might help to look at the code of some existing mods that you know to work

cerulean aspen
winter flower
#

should already

#

it's an uncommon

cerulean aspen
mystic river
#

rng can be terrible

daring fern
#

reef bobcat
#

ok i tried by myself but i couldn't figure it out. How do you make a card like Wily Joker that checks for a specific kind of card (like a king) instead of a specific kind of hand?

cerulean aspen
# winter flower bad luck lmao

so back to the thing how would i make it so that it only apears when niko who can summon a god is in your joker slots?

#

he only showed up once

winter flower
cerulean aspen
#

oh

#

so like this?

cerulean aspen
winter flower
#

aGHFHHHGNGHGHHGDBH

cerulean aspen
#

im guessing im missing something

winter flower
cerulean aspen
#

again

winter flower
#

and you're also missing a comma

cerulean aspen
#

where should i put it in the niko who is a god joker?

kindred niche
reef bobcat
#

This ended up working 😄 first joker I've ever coded myself (even if 90% of this is copied from existing lol)

winter flower
kindred niche
#

Alright

cerulean aspen
winter flower
#

NO

cerulean aspen
reef bobcat
#

oh wait noooo

#

it isnt working like i thought

#

it's giving each 2 +200 instead of just giving +200 if hand contains a 2

cerulean aspen
#

huh

#

i havent pasted it yet