#💻・modding-dev

1 messages · Page 240 of 1

remote shell
#

mine will have references to all sorts of stuff

deft niche
#

does it work for playing cards too?

rain slate
#

I think so

hard flume
#

I changed a suit. Just let me get my code rq

rain slate
#

pseudorandom_element selects a random element from a table so you would probably do something like ```lua
local editions = {
{ foil = true },
-- more elements
}

context.other_card:set_edition(pseudorandom_element(editions, pseudoseed("insert seed here")), true)

high eagle
#

what would running a print function in balatro do?

rain slate
#

it should just print it to the console

#

at least it does if you have the DebugPlus mod installed, idk if it does without it but probably does

high eagle
#

ok so void, if im getting this right we should have created a new "context" function which the joker can call when calculating?

rain slate
#

now it should be correct

rain slate
deft niche
#

what does inputting the joker name do?

rain slate
#

it's just a seed for the random number generator

deft niche
#

mhm ok

#

is there a way to set the "weight" of each element in the pool?

rain slate
#

you'd need to make a custom RNG for that I think

#

I guess you could just put the same element multiple times into the table but that's kinda jank catxdd

turbid maple
tall wharf
#

Fredoka One

turbid maple
remote shell
#

anyways

tall wharf
#

😭

next timber
#

i still am so confused about this whole thing, the values in card.ability.seal ARE being changed by the code, I've checked it I'm 100% sure it's happening, so WHY does card.ability.seal in loc_vars only ever return their initial values??

turbid maple
#

also note it's good practice to prefix custom things you add with a mod prefix just in case

#

SMODS.calculate_context({ yourmodprefix_change_suit = true, other_card = self } or smth

#

aaaaand also note the other discussion that Card:change_suit might not even be called becaue SMODS overrides things

hushed field
#

How does the return table work, when calling SMODS.calculate_context? I'm trying to parse the code for it, but it's unclear to me what information is passed through all the way back, as it goes through quite a lot of functions

quartz ravine
#

New tarot card checking in.

next timber
#

kitti

deft niche
#

@rain slate I keep getting an arror at this line when booting up the game

#

says there's an unexpected symbol near 'local'

dim lynx
#

you didnt screenshot the line numbers

deft niche
#

it's the one I have highlighted

dim lynx
#

oh nvm you edited

#

sorry.

deft niche
#

no it's fair

dim lynx
#

i think you need some , after your tables

quartz ravine
#

that is a joker? Can you paste the whole code. I don't understand what it is supposed to be doing here

dim lynx
#

youre also defining things in a table which i dont think you can do (?)

turbid maple
#

you do not need local

tall wharf
#

why is it in return

dim lynx
#

that too

high eagle
deft niche
turbid maple
#

actually yeah i just saw what you're doing you do need local you just wrapped what you're doing in a table for some reason

quartz ravine
#

I think they are right. return after doing your enhancements, you cant' return a multiline statement (well, not normally)

tall wharf
#

please move it out

turbid maple
deft niche
#

`SMODS.Joker
{
key = 'j_harlequin',
loc_txt =
{
name = 'Harlequin',
text =
{
'All played {C:attention}numbered{} cards gain a',
'random {C:attention}Enhancement{}, {C:attention}Edition{} and {C:attention}Seal{}',
'when scored'
}
},
atlas = 'a_harlequin',
pos = {x = 0, y = 0},
rarity = 4,
cost = 20,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card:is_face() == false then
return
{
local editions =
{
{ foil = true },
{ holographic = true },
{ polychrome = true }
}
context.other_card:set_edition(pseudorandom_element(editions, pseudoseed("harlequin")), true),

            local enhancements =
                {
                    { mult = true },
                    { bonus = true },
                    { glass = true },
                    { steel = true },
                    { gold = true },
                    { stone = true },
                    { wild = true },
                    { lucky = true }
                }
            context.other_card:set_edition(pseudorandom_element(enhancements, pseudoseed("harlequin")), true),

            local seals =
                {
                    { red = true },
                    { blue = true },
                    { gold = true },
                    { purple = true }
                }
            context.other_card:set_edition(pseudorandom_element(enhancements, pseudoseed("harlequin")), true),
        }
        end
end

}`

turbid maple
#

jokers need to explicitly handle in its calculate function which parts of its effects are copiable by blueprint-likes and which are not

hushed field
#

also just an fyi, that code will set edition twice, never seal. There's also poll_[whatever] functions for seals, editions and enhancements, so you don't have to set up a table yourself each time

turbid maple
#

SMODS.calculate_context will automatically handle blueprint and all that you do not need to bother

quartz ravine
#

Side note: anyone hear the extended jazz fusion version of the balatro theme? this has been kicking around my brain for days since I first heard it

https://www.youtube.com/watch?v=WJi6m7R8ADY&list=PLhFVkxwhjLxpU2_eSvOwSQ131u8-BhUHb&index=2

Stoked to share this new SOLO cover I worked on recently! I've always been a fan of Rogue-Like Games for a long time, especially deck builders (and being a trading card game junkie). First few that come to mind are games like: Slay The Spire, Monster Train, Peglin, One Step from Eden, and many more.

When Balatro first got announced, I got the d...

▶ Play video
deft niche
turbid maple
#

you do need it

#

you just wrapped all your code in a table for some reason

#

I only took a brief look and assumed you're building a table

deft niche
#

so like, no need for curly brackets?

high eagle
#

what context would i put in the joker itself, then? (sorry im new to this)

hushed field
#

btw, void, do you have some insight in how the return table works for SMODS.calculate_context()? I'm trying to return some string information in a return value for a mod-specific mechanic, but I seem to be bumping my head against where and how I can make that actually show up in the return table

quartz ravine
#

try this @deft niche

            
    local editions =
        {
            { foil = true },
            { holographic = true },
            { polychrome = true }
        }
    context.other_card:set_edition(pseudorandom_element(editions, pseudoseed("harlequin")), true)

    local enhancements =
        {
            { mult = true },
            { bonus = true },
            { glass = true },
            { steel = true },
            { gold = true },
            { stone = true },
            { wild = true },
            { lucky = true }
        }
    context.other_card:set_enhancement(pseudorandom_element(enhancements, pseudoseed("harlequin")), true)

    local seals =
        {
            { red = true },
            { blue = true },
            { gold = true },
            { purple = true }
        }
    context.other_card:set_seal(pseudorandom_element(enhancements, pseudoseed("harlequin")), true)
end```
#

i added an extra check for context.other_card because sometimes I have encountered that being nil. and lua is not chill with nil

turbid maple
hushed field
#

ah shame. I guess I'll keep digging around and trying to print answers to the log, haha

hard flume
#

What if I made this a world in my mod...

deft niche
#

still getting some errors, I'll see what I can do

quartz ravine
#

What the heck yall

I export my sprite from esprite, it has ~18 colors

It gets backed up into google photos. I download it. Now it has 4600 colors somehow?

deft niche
high eagle
#

what is the purpose of the starting underscore in "_card_change_suit"

quartz ravine
#

remove the comma after editions @deft niche

#

you don't need a trailing comma after your local variable declaration

deft niche
#

ok
but then I get another error, 1 sec

rain slate
#

remove the commas after the function calls

high eagle
#

heres what i have so far:

rain slate
#

and uhh you need to use different functions to set seals and enahncements

high eagle
quartz ravine
#

‼ I found the issue. Google photos is doing some weird shit. It actually makes my 2kb sprite bigger

It makes it 5kb and also looks like poo emoji

rain slate
#

you're even using enhancements in the seals part...

deft niche
quartz ravine
#

Storage Saver, so efficient it increaes the size of your files!

rain slate
quartz ravine
#

jesus christ show us your line numbers

rain slate
#

it will still not do what you want but it will be syntactically correct

deft niche
quartz ravine
#

you dont need commas at the end of each line

deft niche
#

tho the line of interest is always the one I have highlighted

rain slate
#

remove these

quartz ravine
#

My man. What I sent to you did not have commas. also I fixed like eight of those errors my man

deft niche
rain slate
#

ok and now there should be no more syntax errors, but it won't do what you want because there's still some things that need to be fixed

deft niche
#

also because if I let another person do the code for me then where's the fun!

rain slate
#

for one, set_edition should only be used once here, because we're trying to set editions, enhancements, and seals, and enhancements and seals are not editions so we can't use set_edition to set them all

deft niche
#

oh and thank you, now it doesn't crash

high eagle
rain slate
#

the second one is that we should use the seals table in the final one

#

instead of enhancements

deft niche
#

fixed

quartz ravine
#

people here want to help you because we are all mired in agony trying to implement our own stuff and basically falling apart

next timber
#

i was RIGHT, the card argument in loc_vars IS fake

#

so FUCK.

#

what do i do about that.

wintry solar
#

it's only sometimes fake

rain slate
#

oh also I think seals shouldn't be a table of booleans it can just be ```lua
local seals = {
"Red",
"Blue",
"Gold",
"Purple"
}

#

and it seems setting a seal is easy and can just be done with ```lua
context.other_card:set_seal(pseudorandom_element(seals, pseudoseed("Harlequin")))

deft niche
#

you mean without the table?

gentle rain
#

is there anything wrong here

rain slate
high eagle
# high eagle

anyone here with knowledge of contexts that can help?

rain slate
deft niche
#

you mean with or without the table you described above?

thorn ridge
#

How would I go about testing my jokers.
Is there a mod or something I can use to just spawn them in

gentle rain
hushed field
#

eremel, would you happen to know what kind of info gets passed to SMODS.calculate_context()'s return table? I've been trying to figure out how to use it, but I have mostly just been running into a wall, haha

quartz ravine
rain slate
rain slate
rain slate
quartz ravine
#

You can put the game in debug mode and do it without debug plus. But debugplus does add a lot of cool extra stuff

tepid crow
gentle rain
#

literally never programmed in my life i will probs ask dumb things in here :P

#

but ty for the help hehehe

rain slate
#

np

gentle rain
#

yaaaaaay :D

deft niche
#

neat art

high eagle
hard flume
#

Hihi :3

high eagle
#

eh ill come back to this l8r

next timber
#

its probably a very bad idea but i wonder if i could just check the hovered card's stats and use that

earnest perch
#

Has anyone gotten Reverie to work or is it too outdated?

hushed field
neat plover
#

i need this to : Every card played has a 1 in 10 chance to trigger this joker. When triggered, every card played next hand gives +20 Chips and +2 Mult.
can anyone help me???

earnest perch
hushed field
hushed field
#

no wait, I'm reading it wrong, the hands are of course set on the card, not the actual hands in the game

#

why are you setting hands? It now triggers multiple times? Also, judging by the localization keys, I assume this is mostly just a kitbash of paperback jokers, right?

neat plover
#

yep

hushed field
#

you're setting and checking some variables that you're just not using as well, huh

#

It'l trigger twice after being activated as well, currently

neat plover
#

changed it for testing purposes

hushed field
#

your contexts also don't fit the contexts you'd want this to trigger in. if you want every card to give chips and mult, you need to be in context.individual, not context.main_scoring, which is used for modifiers on cards

deft niche
#

going insane trying to make this work
i'm not even sure the code enters the function at this point

hushed field
#

as this is a joker, you want the first main_scoring to also be joker_main

neat plover
#

it does trigger now

hushed field
#

I've not seen set_enhancement before, is that an actual function of the game I've forgotten about? or added to SMODS very recently?

dim lynx
#

anyone know what was changed in new smods versions which stop this code working? it works properly in alpha build but does nothing in beta one. ive tried looking for reasons why and am stumped.

hushed field
#

You'll wanna do set_ability, and again, make sure to pass proper syntax, instead of mult = true, which I don't think would set anything

tall wharf
#

is this faier

deft niche
wooden nexus
hushed field
dim lynx
hushed field
tardy wind
#

context.scoring_hand is still good

#

get_id also could be deprecated

hushed field
# deft niche thanks a ton!

the section starting at line 52. Ignore everything else, because a lot of it uses custom mechanics for my mod, so that'll just be confusing, haha

quartz ravine
#

hi @wintry solar does post_injection hook not fire when the object is first rendered? I thought that would be a convenient place to do some setup for a special booster pack but I can't get that handle to get called, in the logs

tall wharf
#

omg hello balatro goes kino person

hushed field
#

hey hey aiko

neat plover
#

yall, how do i retrigger a card? (real stupid question, ik)

deft niche
#

is context.other_card: fine?

hushed field
#

yes

deft niche
#

ok

warped marsh
hushed field
#

you'll also not need to check for it in an if statement, because I think it's always there if you're checking context.individual. But no harm in doing so either, I guess

next timber
#

im actually starting to get a little worried that im gonna have to scrap the black hole seal after already programming the hard part because of something as stupid as not being able to show the right values in the tooltip lol

neat plover
#

ok, but how do i retrigger the first and last card played?

deft niche
#

did this and it still does nothing

next timber
# quartz ravine what's giving you grief?

i have a seal thats supposed to grow stronger as you play it, but because of the way loc_vars works for seal tooltips, it seems like i have no way of actually showing the increased values, as the card argument is a fake card made using the default config, not the updated real values

hushed field
hushed field
quartz ravine
# wintry solar Hmmm?

Hi Eremel! I have a booster pack that correctly always spawns cards of a certain special edition. Well, I thought it woudl be cool for the pack itself to have this edition effect, when it shows up in the store.

I tried to use post_injection to make the booster pack apply an edition to itself, so it would render correctly in the store, but I could not figure out if this was the right usage

neat plover
hushed field
#

I'd have to see exactly where the generate_ui code gets called to see why it'd be making a fake card in your case

#

If you print other information of the card in the loc_vars, that are unrelated to the seal, does it match in any way?

next timber
#

if i just print card it's literally just { seal = {...} } with no other variables im pretty sure

tall wharf
thorn ridge
#

I know this is messy and very wrong, but im trying to learn, (its a bunch of jokers smashed together rn)
This joker is SUPPOSED to gain 15 chips every hand but have a 1/6 chance of restting to zero every hand.

next timber
hushed field
#

there's specifically a syntax to get the last item in a table, but I'm blanking on the correct one, but you'd quickly be able to google that, haha

red flower
hushed field
hushed field
hushed field
next timber
#

i guess hypothetically i could make it an enhancement, but idk, the revive is a seal and they're kinda meant to be a pair, and also the texture works nicely as a seal

#

but if it saves the grief i can prolly make it an enhancement

gentle rain
#

where are the joker abilities located in the files of balatro?

hushed field
#

the text or the code that handles them?

#

mostly in card.lua but in truth literally all over

gentle rain
#

code that handles them

#

im trying to figure out probabilities rn

turbid maple
#

card.lua contains most joker ability effects by name

thorn ridge
turbid maple
#

weird ones like Splash get handled elsewhere

gentle rain
hushed field
gentle rain
gentle rain
#

cheers

strong jacinth
#

Does anyone know why this doesnt work?

local t = {}
t.insert("Gold")
local card
for i, v in t do
  if v[i] == "Gold" then
    card = SMODS.create_card(set = "mycustomset", area = area3, key = v)
    area3:emplace(card)
    i = i + 1
  elseif v[i] == "Steel" then
    card = SMODS.create_card(set = "mycustomset", area = area3, key = v)
    area3:emplace(card)
  end
end
gentle rain
#

aaaaa ty!!

turbid maple
#

This is a reimplementation of the banana

wintry solar
quartz ravine
hushed field
# thorn ridge

you have multiple calculate functions, that won't work!

thorn ridge
glad osprey
#

how would i implement this

hushed field
hushed field
#

You're checking probability without doing anything with it currently, for example, which happens at the end of the round. I think that's because you've based it on gros michel, which makes sense, but the reason that it checks probability in context.end_of_round is because that's when it can disappear. You want probability to be checked every time your joker grows

red flower
#

<@&1133519078540185692>

hushed field
#

Yes. In this case, you'd increment the current chips in the if statement. You want an else statement to set it to 0, if it fails, and after the if statement, (But not inside of it!), you want to return the chips

quartz ravine
#

wow that was weird

glad osprey
#

ooooh free money @dapper monolith check this out

hushed field
#

yup. Now all you need is a return!

quartz ravine
#

wow Lua is the least null safe language I have ever used

thorn ridge
#

I am a certified lua hater so this is gonna take a bit to get used to

hushed field
next timber
#

ok converting black hole to an enhancement is giving me more grief than i thought, where do cards store their enhancement data?

hushed field
#

if card and card.ability and card.ability.extra and ad infinitum ❤️

wintry solar
minor furnace
hushed field
quartz ravine
#

I can run inspect() and see that the return always has a property. And yet when I try to log it out like so, it's nil

            sendInfoMessage("created joker card of " .. jokerInfo.label, self.key)```
turbid maple
#

mods censored the free money opportunity this world is truly unfair

minor furnace
next timber
#

mainly just that everything so far has been written with seals and now i gotta adapt all that to work with enhancements

hushed field
# strong jacinth -# bump

your code needs some context because I have no clue what you're trying to do, but also you're just setting local card, without defining what card is

tall wharf
hushed field
red flower
#

at some point i decided to stop nil checking until it crashes

minor furnace
thorn ridge
hushed field
next timber
hushed field
next timber
#

oh well for chips specifically would it actually be bonus

#

lol

hushed field
#

(The Sci-Fi card enhancement might give you some hints as to formatting :P)

hushed field
strong jacinth
hushed field
# thorn ridge

should've spotted it earlier, but that's definitely the mesaage= we are checking line

next timber
#

ok now if this works i can finally get back to the hell of summing up every possible way a card can have chips/mult/xmult/money lol

neat plover
#

so how do i make a card give more mult and chips when scored?

thorn ridge
hushed field
neat plover
hushed field
hushed field
red flower
neat plover
next timber
hushed field
# next timber hm?

the perma_bonuses page has basically every bonus a playing card can have, unless a mod adds a new one

hushed field
#

do you just mean when it's scored? Like suit mult jokers??

quartz ravine
#

@wintry solar , that worked great, thank you

next timber
high eagle
#

@turbid maple could I DM you about balatro help if that’s alright? You were a big help earlier

strong jacinth
#

If i create a consumable type, does it automatically show in the collections

warped marsh
#

heya im trying to make it that when the boss blind is defeated, the mult resets to 1 :)

hushed field
turbid maple
high eagle
#

I see

#

Makes sense

#

based tbh

turbid maple
#

boss makes a dollar when i make a dime thats thats why i complain about lua on company time

hushed field
next timber
thorn ridge
#

@hushed field Something dont seem right

turbid maple
#

also im a sad soul that works on sundays so feel free to ask

hushed field
thorn ridge
warped marsh
hushed field
# thorn ridge What should it be

you want the number between the #s to correspond to the relevant item returned in the loc_vars, but index. So #3# will be the third item in that list. In your case, you want the fourth

neat plover
#

better question: how do i make a joker give mult like suit jokers

hushed field
hushed field
warped marsh
#

ah

neat plover
hushed field
#

you add mult in the return

next timber
neat plover
#

like that

hushed field
warped marsh
neat plover
hushed field
#

yes

#

Did you try it before asking? haha

next timber
#

how do i check what name string SMODS.has_enhancement is getting from the card you feed into it? i think it's returning false and i dont know why

#

my assumption is i typed the name of the enhancement wrong so i wanna know what its checking for

wintry solar
neat plover
#

it works

thorn ridge
#

@hushed field Is there something wrong with the probabilities here, The joker is currently always not activating its buff

neat plover
next timber
wintry solar
#

You can use post triggers to easily grab that

#

Especially if you just want the main scoring of the card

next timber
#

sorry, how would i do that? i have no clue what a post trigger is :p

red flower
hushed field
#

is it not triggering or are you just unlucky? haha

thorn ridge
thorn ridge
hushed field
#

I've spent time bugfixing a 1/3 odds that didn't trigger for like 14 cards in a row

red flower
#

that's low

thorn ridge
#

wait a minute

#

I might be dumb

#

it needs to be 1/6 chance for it to reset, not for it to gain

#

im stupid

#

there

#

lemme try this now

#

it works now

#

lets go

#

Awesome. I think Im understanding how all this works alot more

#

Thanks guys

next timber
#

originally i was just making this mod for myself but after all this work im putting into actually making it functional theres no way in hell im not sharing this lmao

thorn ridge
#

Im trying to make sure I understand what im writing

hushed field
#

you can thank me by getting 50 friends to play Balatro Goes Kino and have them all give me playtest feedback 😛

gentle rain
#

is this how pseudorandom is implemented? i tried with 3 oops all 6s and it didnt trigger
if im understanding it correctly the pseudorandom value is arbitrary

hushed field
#

Realizing that me not knowing shaders is a boon, because otherwise I'd be spending too much fucking time getting each spell to have its own visual effect

hushed field
gentle rain
#

rightright

deft niche
#

what's juice_up()?

thorn ridge
next timber
#

not 100% sure but i think thats it

turbid maple
#

it makes the card go bwop

deft niche
#

i tried because I thought the same thing but gave me nullreference

gentle rain
hushed field
#

Makes it shake when it's called. You need to call it on an object

gentle rain
deft niche
frosty dock
#

it's trying to juice up what you pass there, which fails because self isn't actually a card

next timber
#

man i wish there was a faster way of reloading mods than having to close balatro and reopen it

deft niche
#

oh okok

#

what's the right syntax to make the joker juice up?

frosty dock
#

it happens automatically

tall wharf
#

uhhh

neat plover
#

hear me out, is this even possible????

On first turn with no discards, retrigger first and last card played 2 additional times.

frosty dock
#

yeah why wouldn't it

tall wharf
#

i think it's kinda weak tho

neat plover
dim lynx
tall wharf
neat plover
tall wharf
#

sock also does it every hand

neat plover
deft niche
tall wharf
#

yeah but only on one hand

#

i don't think you're planning to win with one hand with burglar anyway

neat plover
deft niche
#

right now the effect works, applying all 3 addons to each scored number card, however the replacement effect happens immediately when the hand is played, instead of after each card is scored, how do I fix it?

#

I tried using other contexts but then the effect simply doesn't trigger

neat plover
next timber
#

man i cant wait to be done with black hole cards so i can add asbestos cards already

gentle rain
tall wharf
dim lynx
tall wharf
#

i still think it's a bit weak

#

idk

deft niche
neat plover
dim lynx
#

im not sure i understand, but if you want a function to run after scoring you would want to use context.after not context.individual

tall wharf
hushed field
tall wharf
#

i guess i was wrong

red flower
red flower
tall wharf
#

(you would get cooked easily by the height)

deft niche
#

in the rounded brackets you mean?

tall wharf
#

also don't forget to return true

red flower
#

no, like

return {
    func = function()
       -- your code
    end
}
next timber
#

lets gooooo black hole is destroying cards again

next timber
tall wharf
#

hello n

red flower
#

helloaiko

tall wharf
#

do you know how fire is rendered

red flower
#

carefully

tall wharf
#

i haven't gotten to work yet on the challenge background

red flower
#

no idea but let me check

tall wharf
#

also does love 2d not support coloured fonts

#

I was gonna have these stars be emojis

deft niche
#

or does it have to be a separate return function?

gentle rain
#

how would i make two context.joker_main events trigger after each other? the first triggers fine but the second does nothing and i dont think theres anything wrong with how the event happens

red flower
red flower
#

in the first return

tall wharf
#

i don't think you need the message anymore?

deft niche
red flower
gentle rain
#

i dont mean to be rude im just confused

deft niche
gentle rain
#

full script

deft niche
tall wharf
#

if the first one runs successfully

#

it would just not run anything else after return

gentle rain
#

it doesnt need to check?

#

aaaa right that makes sense

#

should i do a second calculate function then?

red flower
# gentle rain second return table? what do i need two for

ok, looked at your code and there's a better way to do it

if context.joker_main then
   return {
       mult = card.ability.extra.mult,
       xmult = (pseudorandom("brimstone1") < G.GAME.probabilities.normal / card.ability.extra.odds) and card.ability.extra.Xmult or nil
   }
end
tall wharf
#

i think i should just make a tutorial for custom jokers for new calc as a video

red flower
gentle rain
red flower
#

yeah

tall wharf
#

yes

gentle rain
#

yeah i thought it was weird how different that video was from the example mod someone else posted

tall wharf
gentle rain
#

it you do that itd be much appreciated!!!

tall wharf
#

yeah i think i should do a new calc joker tutorial

#

what do you think n

next timber
#

stupid question but how do you set the enhancement of a card

gentle rain
#

this is the one i was following

red flower
tall wharf
deft niche
#

the first string randomly gets one of the available enhancements, but you can set it to whichever you want

#

1 sec

gentle rain
deft niche
frosty dock
#

I assume you're trying to score cards held in hand as if they were played?

dim lynx
#

yea

deft niche
frosty dock
# dim lynx yea

I can't think of a clean way to do that without patching the smods calculation pipeline to specifically include such scoring.

next timber
red flower
deft niche
deft niche
frosty dock
#

Once the PR on blind calculation I've been working on is merged, you could move the cards to G.play on context.press_play and later return them to hand, though I guess that's a slightly different effect given it doesn't also score as if held in hand

mellow marsh
#

does anyone know how it could be possible for my mod's lovely hooks to be loading but my main mod file doesn't? someone is running into an error and that's the only way i can interpret the error happening

red flower
gentle rain
next timber
red flower
mellow marsh
#

nope

mellow marsh
#

i do define some dependencies though

gentle rain
red flower
#

i think smods doesn't disable the lovely patches when there are missing dependencies

mellow marsh
#

i see, that's likely it then

gentle rain
frosty dock
red flower
#

makes sense

gentle rain
#

youve been veryvery helpful i appreciate it a lot :3

frosty dock
#

it'd have to bootloop, and even that can fail due to syntax errors

gentle rain
#

my fully implemented child,,,, its so very simple but im still quite proud hehehe

next timber
#

BLACK HOLE IS WORKING!!!

#

pretty damn powerful too

gentle rain
neat plover
#

retrigger

deft niche
#

i changed context.individual to context.before but now the effect simply won't trigger

hushed field
red flower
hushed field
#

I'm currently going through every joker in my game to mark every joker that vibes as wet ❤️

next timber
#

i just need to get black hole to absorb xmult and money and it should work

tall wharf
#

yeah it does that now

tall wharf
#

if you add the message it will show up twice

gentle rain
unkempt thicket
#

This took forever to code 🫠

gentle rain
next timber
#

i have a 10 of spades that gives 239 chips and 28 mult, and it grows more powerful every time you play it with other cards

#

this is peak

#

i think i'm gonna leave the "Yum!" placeholder popup it's funny

#

now to texture the card

gentle rain
tall wharf
#

mayhem the mime

gentle rain
#

.w.

tall wharf
#

initial shop items cost 0 dollar

gentle rain
#

spicy i like it

tall wharf
#

more reliable discount tag

next timber
#

now i gotta go get my hands on a card texture to modify

hushed field
#

if we assume that Splash is the wettest vanilla joker, and jimbo's entirely a dry joker, would you classify seltzer as wet? Would you qualify diet cola as wet?

next timber
#

i would classify them both as wet

hushed field
#

I swear this is relevant to modding balatro, but would the movie Cocktail, who's poster is Tom Cruise, vibe as wet? 🤔

hushed field
turbid maple
#

ask jimbo if this joker is creepy or wet

deft niche
next timber
#

what kind of mechanic needs to know if a joker is wet lmao

tall wharf
hushed field
#

As a little easter egg, the Gremlins joker copies itself when played with thematically wet jokers

tall wharf
#

also hi void

hushed field
next timber
#

sounds pretty powerful if it's negative too

deft niche
turbid maple
#

hi mr. aikoyori

tall wharf
#

how do i concentrate on learning Japanese

#

do i gotta add japanese wordle to balatro

next timber
#

yes

hushed field
#

Are you trying to fix the animation timing for the change effect?

turbid maple
hushed field
#

Because that's entirely unrelated to context. A good rule of thumb is that calculations are done entirely separately from animations, so anything you want to happen visually can't be timed by changing the context. I'm sure that's not always true, but it's what I try to keep in mind

turbid maple
#

Anki Deck.

deft niche
tall wharf
#

might actually go hard with my letter mechanics

#

tho I'm not gonna draw all kanji

deft niche
tall wharf
#

I'll just use a font

hushed field
# deft niche the other function being: changing the cards' modifiers

I think that if you put the code in an event with the immediate timing, that should work? I'm not entirely sure, I always have to mess around a bit with events to get the proper timing. I'd suggest how to do it with the method N suggested but I'm entirely unfamiliar with the details of returning funcs

deft niche
#

I already implemented that function but sadly everything's the same

#

I guess I have no choice but learn events
pray for me

turbid maple
#

blind that gives you kanji words and makes you spell their reading in hiragana

hushed field
#

events have a lot of complicated details but the chances of you needing to mess with those are incredibly small.

deft niche
hushed field
#

I've only had to really understand events once, and that was when I added the alien abduction mechanic to Kino. But for most things, it's mostly a chunk of lines that look intimidating. My main reasoning tends to be 'if it's a visual element, I'll put it in the events system'

#

Yeah, sorry! I just meant that it looks a lot scarier than it is, haha. The messing around with timings is just changing a single string around and seeing what feels better!

deft niche
#

I really feel like shit rn 'cause I've read the first lines of the events article on git 3 times and I still don't understand anything
like, ok you can declare events, but where do you do that??

tall wharf
#

this shit does take a while to wrap my head around so

hushed field
#

In the code! Let me see if I can find a joker with a very simple effect that uses them

#

Because that's why it feels complicated. All you really need to know for the most part is 'I copy the G.events thingy and the return statement at the end'. You only need to understand them more in depth once you start getting into very complicated ideas

deft niche
#

'I copy the G.events thingy and the return statement at the end'
yeah no my brain is def too small for this

#

is it a Lua thing of a SMODS thing?

#

if it's lua i can look up a guide on yt maybe

hushed field
#

haha, it's not, it's just feeling complicated

#

I suspect it'll be a LOVE2d or balatro thing, not a lua thing

deft niche
#

sucks

zealous glen
#

what are you trying to do

hushed field
#

In the joker I'm currently working on, I'm checking if one of the other jokers is splash, and if it is, it will animate, flip over, change into a copy of this joker, and then flip back.

#

the uncommented code here is what the event manager code is

#

Everything commented inside of it is what gets added to the event queue. The details of that are complicated and I can't explain it because I don't understand it. all you really need to know is that for the most part, visual stuff works if you wrap the G.E_MANAGER stuff around it, as it means it won't happen immediately in the calculation, but instead is done a little bit later

#

oh, the if context.joker_main there should also be commented

zealous glen
#

I think the concept behind an Event queue isn't too hard. I just don't know thunk's implementation (and it has some questionable choices IMO)

#

but that's thunk code

#

well maybe not all questionable choices

#

some I can understand, others are tied to their hard-coded-ish implementation of Jokers, etc.

deft niche
# zealous glen what are you trying to do

basically what this currently does, is:

  1. You play a hand;
  2. Immediately upon playing the hand, any numbered scoring cards are applied a random enhancement/edition/seal;
  3. The cards score (WITHOUT applying their new modifiers);
  4. Each time a card scores, the "chaos" text pops up and the joker juices up;

what I want it to do is:

  1. You play a hand;
  2. The cards score normally;
  3. If the card that's scoring is a numbered card, a random enhancement/edition/seal is applied, the "chaos" text pops up and the joker juices up;
thorn ridge
zealous glen
#

Those do grant benefits prior to scoring

deft niche
deft niche
zealous glen
zealous glen
hushed field
zealous glen
deft niche
zealous glen
#

Midas Mask and Spinagogue Champion have some Events only to change the visual aspect of cards

#

If you apply the Enhancements in a later context, they won't apply during scoring

#

because they'll be late

#

but like Midas Mask and Spinagogue Champion, you'll need to hide them temporarily

deft niche
zealous glen
#

Due to how vanilla code is structured

deft niche
#

ok maybe I bit off a bit more than I could chew

zealous glen
#

I just realized you're Homosuck Caliborn

deft niche
#

I wasn't expecting it to be this difficult haha

zealous glen
# deft niche ooohh

It's not necessarily hard, except only Enhancements can do this in vanilla because thunk only needed it for Midas Mask

hushed field
# deft niche where is that condition declared in your case

The timing I don't actually declare. I can see why it's confusing, because you're trying to actually understand how it works, haha, but with events you basically are going to have to understand it very fundamentally to actually get why and when they trigger, instead of just learning through experience. In this case, there are already events in the queue, and my code just says 'the moment you have the time'. The way balatro works is just that that will always be after calculation if your event is set during calculation

deft niche
#

no pressure tho

zealous glen
#

lol

next timber
#

what would a black hole card even look like?
i'd mayyybe try a shader to do some cool warping stuff but that's an edition thing and i am NOT changing what type of modifier it is a second time

zealous glen
#

So you'd need to copy that and implement it for Seals

#

Unless SMODS provides some functinality for it now

hushed field
#

i am only now realizing your pfp isn't knuckles from sonic the hedgehog 3 and knuckles, Victin, damn

zealous glen
#

There were some Draw Step changes, so maybe

deft niche
#

I'll try something similar

next timber
#

how many damn homestuck pfps are there here i've seen like 3 today

minor furnace
#

oh no

#

not homestuck

zealous glen
zealous glen
next timber
hushed field
# deft niche ok I kinda get it

just trying is honestly the best thing to do. As I said, I tried to really understand events and I just got a headache, so I mostly just shorthand 'if it's something I wanna do visually, I put it in an event'. If you don't define the timing, it'll just default to immediate, so I just copy it over whenever I need it, haha

minor furnace
zealous glen
hushed field
#

this server needs more cinephiles and less homestuck dorks imho, it'd be good for my download numbers

hard flume
#

We need more Yumedorks

zealous glen
next timber
zealous glen
#

All scoring happens instantly, then Events are handled in order

zealous glen
minor furnace
next timber
hard flume
#

I like gandan paron

red flower
#

i have never watched a movie

hushed field
warped marsh
#

How would one add a custom sound effect to their mod :3

zealous glen
minor furnace
hushed field
minor furnace
#

very good movie

zealous glen
gentle rain
#

do i need to do anything specific to make my jokers appear in the shop or are they already able to appear in the shop without anything fancy

red flower
gentle rain
hushed field
neat plover
red flower
zealous glen
hushed field
#

you don't wanna do it in the return in this case, but otherwise, I think that works! haha

neat plover
deft niche
hushed field
zealous glen
# hard flume My mod.

Player playng your mod with the Jokers yume nikki guertena baseball batter mercy idk what omori does

next timber
deft niche
next timber
#

but i dont wanan steal a shader from another balatro mod for my balatro mod

red flower
hushed field
neat plover
red flower
deft niche
#

It was 3pm when I told myself, "yeah I can implement that in half an hour"
6 hours later

next timber
#

right now for black hole cards i have a black background with a blurry orange border but it looks kinda lame tbh lmao

zealous glen
deft niche
red flower
#

you need to put the event inside the func not the func inside the event

hushed field
zealous glen
deft niche
zealous glen
#

but I think it's kind of a classic shader

#

because it's a classical kind of transform

red flower
zealous glen
#

the hard part would be "screenshotting" the screen

turbid maple
#

@tall wharf did you have a blind that gives you infinite hands and discards can I steal that code

deft niche
#

and keep the rest as is?

red flower
#

just put the event ouside the return and see what happens

zealous glen
tall wharf
#

just go look on my GitHub

#

it's somewhere

#

my mod has a shitton of code

zealous glen
quartz ravine
quartz ravine
hushed field
zealous glen
quartz ravine
#

ohhh how do you configure that?

zealous glen
#

Lvl. ? Death

next timber
#

is it actually possible to give shaders to card enhancements?

quartz ravine
#

I'm going to write the name of my mom logo in FF font, Fickle Fox

#

mod not mom

next timber
#

lol

zealous glen
quartz ravine
zealous glen
#

naturally you don't need all of these

warped marsh
quartz ravine
#

Quntum jokers!?

zealous glen
#

no

#

Quantum Enhancements

thorn ridge
#

where is the link to the balatro source

zealous glen
#

nowhere

#

copy-paste the executable and unzip the copy

hushed field
#

check your lovely dump

#

ain't gonna be the source code, but it's what smods turns it into, so if you're making an smods mod, easier to check that

quartz ravine
#

my lovely lovely dump

next timber
#

i suck at art im gonna deal with visual headaches later, for now i just wanna get as many mechanics out the way as possible

hushed field
#

that's why you pick a theme for your mod that let's you get away with simple art

#

that's how N and I both have mods with so many fucking jokers

next timber
#

the theme for my mod is "random bullshit and inside jokes"

zealous glen
#

There was once the emoji mod

quartz ravine
#

someone needs to make the pantone colors, it' sjust sitting there

quartz ravine
next timber
zealous glen
#

But I don't have that many good and implementable Joker ideas yet, since I don't mind having placeholder art

thorn ridge
#

Wehre is the code for all the jokers in the source

agile thistle
#

under what conditions is the debuff cross shown on the shader? these don't properly show it until clicked

hushed field
#

mostly in card.lua

quartz ravine
#

the source jokers are kind of oddly done in two or three areas.

#

I would say its easy to learn by looking at ExtraCredit or cryptid, who use SteamModded and make it very easy to understand

neat plover
#

this is n't retriggering

zealous glen
#

idk if Cryptid is that helpful

#

It's occasionally helpful

red flower
#

I'm trying to figure out how to make a joker grant permanent abilities to another joker without having to manually add a check for that to every calculate, any ideas?

zealous glen
#

Can't you just use the check directly?

strong jacinth
#

What did i do

neat plover
zealous glen
#

like Tokyo Grandfathers idk I never watched it

deft niche
# deft niche

@red flower like this or did you mean something else?

red flower
#

no I mean like an extension to calculate

stiff locust
#

what if you make a second invisible joker

#

and store it off screen

zealous glen
stiff locust
#

and use it as a medium

zealous glen
#

give the Joker a child

red flower
#

I'm worried about performance honestly

#

that's going to happen a lot in the mod

stiff locust
#

as long as it doesnt use an update function that runs every frame you'll be fine

zealous glen
#

ok how about giving each Joker a deity

#

and the deity handles all of its worshippers

red flower
#

they already have one it's Ra

stiff locust
zealous glen
#

so it's not doubling the number of Jokers

#

it's just +1

stiff locust
#

jokers have "allegiances" to like a deity

#

and if you collect enough per deity it unlocks passive effects

red flower
zealous glen
#

I have some Poker Hand effects that depend on invisible Jokers in the sky

neat plover
zealous glen
hushed field
#

you could patch in an extra scoring check that iterates through all jokers and checks them for upgrades. Same way enhancements and card upgrades work

zealous glen
#

on top of the screen

strong jacinth
#

Lul

deft niche
stiff locust
zealous glen
#

a retrain of calculate

stiff locust
#

new funky mode

tall wharf
#

new

deft niche
red flower
#

calculate 2 the calculating

neat plover
hushed field
deft niche
#

like, calculate = G.E_MANAGER:add_event after the main body?

zealous glen
hushed field
zealous glen
#

there's a built-in function for that

red flower
#

smods was better when it was mult_mod now all the new calculates ruin the fun

zealous glen
#

well

#

a built-in function to patch into

#

which handles essentially everything

zealous glen
hard flume
#

Hmm... I had an idea, but I'm not sure how easy it would be

hushed field
# neat plover ...ok...?

please check some other code to see how it's done. You'll see where the errors are coming from. Your error log also will show a list of functions. If the crash log points you towards a vanilla function, it's not that function that's crashing, it's one of your additions that passes information to it that then crashes the game, for example.

#

ahh wait did i reply to the wrong person?

neat plover
hushed field
#

no wait, nvm, i fused two things, i'm confusing myself, haha

tall wharf
#

omg

#

people are making mods

hard flume
hushed field
next timber
warped marsh
#

I thought you put your custom sounds in assets > sounds > (your_file.ogg)

hushed field
hushed field
hard flume
#

Oki oki!!

neat plover
hard flume
#

Once I do that, I can work on revamping all the Yume Nikki Jokers I've made. I feel like they're all a bit... bland

hushed field
warped marsh
next timber
hushed field
next timber
deft niche
#

so do I really need to create a second calculate function or was that a joke?

neat plover
hushed field
hard flume
zealous glen
next timber
hushed field
thorn ridge
#

how would i code a joker to trigger every certain amount of hands,
is there an example I can look out, the games source is weird to look at

zealous glen
hushed field
next timber
#

thought he implementation isnt quite the same

deft niche
zealous glen
hard flume
#

What if I added a Kirby Joker that ate the Joker to it's left and to it's right, combining the effects...
That would be too much work me thinks.

hushed field
neat plover
#

I GOT IT!!!!

zealous glen
#

It functionally works but it's missing the generalized Joker stats functionality

thorn ridge
#

whats the difference between chip_mod and just chip

deft niche
#

1 sec

deft niche
#

line 86 is this one

next timber
zealous glen
#

loyalty card

next timber
#

oh no you did

#

hm

deft niche
next timber
#

strange

zealous glen
#

define it outside

#

also

hushed field
zealous glen
#

you'll need to use can_calculate

deft niche
deft niche
zealous glen
#

Basically it helps you detect if you can calculate with the card

#

you might need tests to see if the card exists

#

right now it detects if a card is debuffed or if it's waiting to be destroyed

deft niche
#

like this??

zealous glen
#

no

#

you redefine it inside

#

don't

#

I'd also add to the beginning and context.other_card:can_calculate(true)

#

it's a bit optional at the moment

#

could be useful in the future

#

but anyways

#

inside the function

#

it's good to test if the card exists

#

something like ìf ocard and not ocard.removed

deft niche
#

are you referring to can_calculate or ocard?

zealous glen
thorn ridge
#

@hushed field What would I write for a joker to trigger every X amount of hands

deft niche
#

oh my bad

zealous glen
hushed field
zealous glen
#

And clicking recalculates what’s supposed to render

next timber
#

i have drastically fucked up the black hole card WHY does it gain x1 mult for every +1 mult it gains

#

im. so stupid

zealous glen
#

You could solve it or you could fake a click

agile thistle
#

the thing is this is just the normal debuff param

#

and it still properly does the color

hushed field
#

It doesn't look great, but I just left it in like that, haha

agile thistle
#

so i'm thinking it has to do with position updating???

hushed field
#

it's got to do with it being in the deck, instead of a hand or play cardarea

next timber
#

what's the difference between card.ability.x_mult and card.ability.Xmult??

neat plover
#

why is the syntax wrong

agile thistle
#

Gonna mess with the shader itself to see if that produces anything meaningful

red flower
neat plover
#

nvm fixed it

deft niche
hushed field
#

congrats on getting that working, gowly 😄

next timber
#

when absorbing xmult from a card, should black hole cards multiply or add their own xmult by it?

#

right now it's add but that acts kinda weirdly

neat plover
deft niche
#

thanks a lot, it's still not perfect and I wouldn't have done it without your help

#

I appreciate y'all's patience haha

hushed field
red flower
neat plover
#

its what ice told me to use i think

hushed field
#

i can assure you i didn't

next timber
neat plover
#

i want to die. i didnt see the space

red flower
#

lol

next timber
#

lol

frosty dock
#

lol

hushed field
next timber
#

would it not. half the enhancement and make it worse

#

i may be misunderstanding

hard flume
#

Hmm... How would I go about making a red light, green light Joker?
I have no idea how that would function at all

hushed field
#

Well upgrade with x0.5 would mean it'd get added onto a baseline x1.0

next timber
#

ill leave it as add for now

turbid maple
hard flume
#

Lmao no. Surprisingly not squid games.

#

It's actually a Yume Nikki reference

neat plover
#

ARRGGGHH IT STILL DOESNT TRIGGER

next timber
deft niche
#

tangent question, how do I declare a legendary joker's 2 sprites?

hushed field
neat plover
deft niche
frosty dock
#

pos is the position of the background sprite

deft niche
#

ah okok

frosty dock
#

soul_pos is formatted the same way and acts as the position of the floating sprite

#

both just need to be on the same atlas

neat plover
deft niche
#

I just don't understand where to put it,
do I just add another variable to the atlas called soul_pos?

next timber
#

is this what the cool kids call a "synergy"

#

i don't think it was ever localthunk's intention for there to be playing cards that give x19 mult before any jokers have been applied

#

and yet. black hole revive synergy

neat plover
hushed field
hushed field
#

i guess i give up

neat plover
#

i dk how to debug this argghh

agile thistle
thorn ridge
#

Im stuck on how to translate this to SMODs

woven merlin
#

how do i use SMODS.add_card with custom jokers? smods function works fine with base game jokers but my custom joker crashes the game

neat plover
frosty dock
agile thistle
frosty dock
#

j_modprefix_jokerkey

neat plover
neat plover
woven merlin
thorn ridge
hushed field
strong jacinth
hushed field
thorn ridge
deft niche
#

I'm having trouble making it so the modifiers of the cards change when the "chaos" text pops up, instead of their initial trigger

hushed field
neat plover
deft niche
hushed field
red flower
thorn ridge
#

I hate lua

#

So MUCH

hushed field
#

this might be the better way to do it, I just use an outdated method still, apparently, haha

agile thistle
#

I only don't like lua because some fun things arent available like += -= etc

deft niche
#

sorry, wrong reply

hushed field
hushed field
#

You don't need the toggle for what you're trying to do. Just check that in the if statement

agile thistle
#

the then and end is my biggest gripe because it's harder to read than rainbow brackets

deft niche
hushed field
# neat plover oh, well thats stupid

i really recommend playing around a bit with your code so you can understand what you write. Add some print or debug statements, so you can what triggers or not, and such

minor furnace
#

really dumb question, can you put a soul effect onto a consumeable card?

hushed field
minor furnace
#

ooh ok awesome!

hushed field
# deft niche can I find info on it on git?

I'm not sure actually 😬 I haven't checked it on git, I've just messed around with it by copying it and changing things to see what it does. Sorry I can't be of more help there

hushed field