#💻・modding-dev

1 messages · Page 574 of 1

dapper sun
#

oh

robust marsh
#

apparently bepis made a progress bar at some point, i could use that as reference

red flower
#

what I'm suggesting is that you pass the center and then on that other card you return the custom values when it detects it's on a tooltip

dapper sun
#

i'm still confused

#

😭

robust marsh
#

IT WORKS

loud summit
robust marsh
red flower
# dapper sun i'm still confused
-- In Sophie's loc_vars
info_queue[#info_queue+1] = G.P_CENTERS["j_elle_fallen"]

-- in Fallen Angel's loc_vars
if card.fake_card then
    return { vars = { <custom vars > } }
end
return { vars = { <default vars> } }
robust marsh
#

holy fuck bepis is amazing

red flower
#

true

dapper sun
#

what

#

what

#

the custom vars are set by sophie

plain gazelle
#

why does calling a function in context.check_enhancement with quantum enhancements on cause a stack overflow?

dapper sun
#

and also this is in a patch bc this is behaviour i want in all upgradeable cards

red flower
dapper sun
#

i think i misunderstood the question at that point mb

#

and

#

again

#

i've figured out those vars already

#

in the patch

#

i just need to get them to show on the thing

red flower
#

i dont understand what you mean by figured it out

robust marsh
#

is there a way to hide both of these fields?

red flower
#

if it's not showing then you didn't figure it out?

loud summit
red flower
dapper sun
loud summit
dapper sun
loud summit
#

you could set them to 0 and store the real value in another var?

#

or set the blind requirement to 9999999

#

so it doesnt accidentily win

red flower
dapper sun
#

9999999 isn't that much actually

#

this is balatro, remember

loud summit
#

well i assume theyre doing a guessing game gimmick

robust marsh
# loud summit wdym hide

like straight up just hide them so they don't appear, the values should stay the same but the UI itself shouldn't appear

loud summit
#

hm

#

you could always just draw a box on top

dapper sun
#

or not draw them

loud summit
dapper sun
#

loc_vars has a card argument

loud summit
#

then itd use the current cards loc vars right

#

oh

dapper sun
#

i've been trying to do that

#

also i don't want the current card's loc vars

#

i want the target card's loc_vars

#

with my own context table fed into it

loud summit
#

hmm

robust marsh
dapper sun
#

i genuinely can't tell what's so hard to understand about this 😭

red flower
#

it's weird you can't pass the vars directly

loud summit
#

hey i found something maybe

#

info_queue[#1116390750314307698_queue + 1] = {set = 'Other', key = 'generic_extra_slots', vars = { card.ability.extra_slots_used }}

#

from functions/common_events

red flower
#

yeah at least for the Other set you can pass vars directly

loud summit
red flower
#

no jokers are under Joker

loud summit
#

ok nvm wait

slim ferry
#

🤯

loud summit
#

for jokers you set config

#

instead of vars

#

i assume it works the same

red flower
#

yeah but that's not working for them it seems

slim ferry
#

you can set config for anything afaik

slim ferry
#

ooh

dapper sun
loud summit
#

so probably try like
info_queue[#1116390750314307698_queue + 1] = { set = 'Jokers', key = "j_elle_fallen", config = { increase = card.ability.extra.increase } }

#

maybe

dapper sun
#

ice said it's bc modded jokers don't have loc_vars hardcoded in like vanilla ones do

loud summit
#

makes sensw

slim ferry
#

why the fuck is Tag in P_CENTER_POOLS

#

tags arent even centers

loud summit
#

because lol

slim ferry
#

also what is P_CENTER_POOLS.Consumable? is that just every consumable or?

loud summit
#

probably?

slim ferry
#

apparently it is damn

daring fern
slim ferry
#

then whats this

#

if it doesnt exist

daring fern
slim ferry
#

okay

#

welll

wild berry
#

am i doing something wrong? im trying to check if the hand has cards that have a specific enhancement from a list

loud summit
#

you dont use brackets when specifying a key

#

so its just m_bonus = {

#

chips = 30

wild berry
#

oh

slim ferry
loud summit
#

oh

slim ferry
#

["key"] = ... is the exact same as key = ... in practice

#

sometimes you just need to do the first if something has special characters

loud summit
#

i still reccomend the latter it looks cleaner

slim ferry
#

fair fair

wild berry
#

joker

loud summit
#

i assume joke

#

yea

daring fern
wild berry
#

and replace with what

daring fern
wild berry
#

oh

loud summit
#

also what effect are you going for exactly

wild berry
#

giving the respective chips, mult, xmult or cash based on enhancement

loud summit
#

you probably want to have a local variable counting up how much chips and mult to give

#

and use return at the end to add those

#

also stone gives 50 chips, not 30

daring fern
# wild berry oh

Also context.card doesn't exist in context.final_scoring_step.

loud summit
#

ur current code is extremely confusing tbh

wild berry
#

cards in hand

loud summit
#

like it seems like if there is a card of one enhancement then it just never checks any other one

#

why are u early breaking

slim ferry
wild berry
#

got it

daring fern
slim ferry
#

and context.cardarea == G.hand

wild berry
loud summit
#

right so

loud summit
#

in the loop, just have it add the chips and mult to a local var

wild berry
#

kk

loud summit
#

at the end, return { chips = chips_accumulator, mult = mult_accumulator }

#

and itll add it to the hand score

wild berry
#

the break is to check if the hand has an enhanced card

#

but i think i got it wrong

#

oh and how do i check for the card being checked during the context.individual

loud summit
#

context.other_card

wild berry
#

kty

loud summit
#

ye

#

id reccomend looking thru the smods wiki

wild berry
#

smthing like this?

loud summit
#

you really dont need canttrigger tbh

#

i dont think anything happens if you return a table of zeroes

wild berry
#

brother

#

im changing the value

#

with the pairs loop inside cantrigger

loud summit
#

OH wait yea this is run for every card

#

nvm

wild berry
#

and now im having a separate issue

#

debugplus is not working

loud summit
#

actuallyyy

#

if its per card

#

you can just straight up return config.ability.extra.handfunction[k]

#

fun

slim ferry
#

can set_ability take a card object instead of a center?

#

actually it seems like it cant nvm

wild berry
slim ferry
wild berry
#

OH

#

im a dumbass

#

thank you

daring fern
slim ferry
#

actually

#

i think i might. be stupid

#

if i have a card in a local variable, it should get properly discarded with the local variable right?

#

or would i have to :remove() it

dapper sun
#

okay i've pasted over everything that was in the target's G.P_CENTERS, which you'd think would do the same as just putting in the G.P_CENTERS but it doesn't???

daring fern
slim ferry
#

i see

wild berry
loud summit
#

couldnt you just do

for key, boost in pairs(card.ability.extra.playfunction) do
if SMODS.has_enhancement(context.other_card, key) then return boost
end
end```
wild berry
#

wait

#

shit

#

youre right

loud summit
#

ye

wild berry
#

but

#

problem

#

its just

#

that the hand check

#

never triggers

#

not even the print worked

dapper sun
carmine chasm
#

would this be a working buff for ankh?
for k, v in pairs(deletable_jokers) do
if v ~= chosen_joker and v ~= chosen_joker.config.center.id then
v:start_dissolve(nil, _first_dissolve)
_first_dissolve = true
end
end

loud summit
#

instead of config

dapper sun
#

*as well as config

#

remember, not including config makes it crash

#

i've explained this a dozen times

loud summit
#

oh

dapper sun
#

unsurprisingly, still nil

wild berry
#

and the joker still doesnt work properly

slim ferry
#

context.individual and context.final_scoring_step are never called at the same time

#

just use a for loop over the held in hand cards

wild berry
#

k

hearty mesa
#

why is this happening

local scr = SMODS.current_mod

-- condition stuff...
    G.FUNCS.overlay_menu{
        definition = create_UIBox_generic_options{
            back_func = "scr_go_back",
            contents = {
                {n = G.UIT.C, config = {align = "cm", padding = 0.1}, nodes = {
                    create_text_input{
                        prompt_text = "...",
                        max_length = 12,
                        all_caps = true,
                        ref_table = scr.config,
                        ref_value = "left_keybind",
                        align = "cm",
                        callback = function()
                            SMODS.save_mod_config(scr)
                        end
                    },
                    {n = G.UIT.C, config = {align = "cm", padding = 0.05}, nodes = {
                        {n = G.UIT.T, config = {text = "Enter Left Keybind", scale = 0.5, align="cm"}}
                    }},
                    {n = G.UIT.R, config = {align = "cm", padding = 0.05}, nodes = {
                        {n = G.UIT.T, config = {text = keybind_text[1], scale = 0.2, align = "cm"}},
                    }},
                    {n = G.UIT.R, config = {align = "cm", padding = 0.05}, nodes = {
                        {n = G.UIT.T, config = {text = keybind_text[2], scale = 0.2, align = "cm"}},
                    }},
                    {n = G.UIT.R, config = {align = "cm", padding = 0.05}, nodes = {
                        {n = G.UIT.T, config = {text = keybind_text[3], scale = 0.2, align = "cm"}},
                    }},
                    {n = G.UIT.R, config = {align = "cm", padding = 0.05}, nodes = {
                        {n = G.UIT.T, config = {text = keybind_text[4], scale = 0.2, align = "cm"}},
                    }}}
                }
            }
        }
    }
dapper sun
#

actually losing it

hearty mesa
robust marsh
#

nvm I give up how do i just hide this entire hud

red flower
red flower
#

what parts do you want to hide

red flower
#

im on my pc now so i can look

robust marsh
#

i'm trying to hide this entire portion, i've been digging into ui def but i couldnt find this exactly

hearty mesa
# red flower put the text entry and the enter left keybind text in a row node together

uhhh

{n = G.UIT.R, config = {align = "cm", padding = 0.05}, nodes = {
                        {n = G.UIT.T, config = {text = "Enter "..key.." Keybind", scale = 0.5, align="cm"}},
                        {n = G.UIT.T, config = {text = keybind_text[1], scale = 0.2, align = "cm"}},
                        {n = G.UIT.T, config = {text = keybind_text[2], scale = 0.2, align = "cm"}},
                        {n = G.UIT.T, config = {text = keybind_text[3], scale = 0.2, align = "cm"}},
                        {n = G.UIT.T, config = {text = keybind_text[4], scale = 0.2, align = "cm"}},
                    }},
red flower
#

i dont think thats what i said

robust marsh
#

huh

hearty mesa
#

ohhhh the text entry

shy sequoia
robust marsh
#

ah

hearty mesa
red flower
shy sequoia
robust marsh
#

oh

#

holy hell

hearty mesa
red flower
#

also your balatro is old

slim ferry
#

1304a 💀

shy sequoia
#

It's the only one I have now, since I had ported it to mobile a while ago before my computer broke

red flower
#

lovely is also really old

slim ferry
#

did your smods see the dinosaurs go extinct

robust marsh
slim ferry
#

people never read modding rules 3 and 4, to find out more google modding rule 3 4

#

also same with 6 and 7, you should google balatro 67

shy sequoia
red flower
#

even if it wasnt for that i dont help with old balatro versions for piracy reasons

robust marsh
#

found, thank you N

red flower
#

i recommend searching for the localization keys when youre looking for some ui thing

wild berry
#

how can i make a probability affected by oops all 6s

red flower
#

damn

hearty mesa
#

guys

#

this is message 575,575 in this channel

dapper sun
#

not long until message 575757

quick kraken
#

Yeah

#

By the way, has LocalThunk said anything about whether 1.1 will break compatibility with old mods?

unkempt thicket
#

It'll probably break all mods

hearty mesa
slim ferry
#

i doubt that

#

unless he overhauls the entire codebase most mods will be fine

quick kraken
#

I don't care about probably or I think or anything like that, I care about whether LocalThunk himself said anything

slim ferry
#

its just that smods and some lovely patches might not work anymore and thats it

#

thunk hasnt interacted with modding at all from what i know so i doubt he said anything

unkempt thicket
#

Yea smods is what most mods depends on and im pretty sure it'll break smods.

quick kraken
#

He very much knows modding exists and doesn't want to interact with modding in order to not be accused of stealing an idea for an official update from a mod

#

But surely he can talk to the smods people and see what breaks and what doesn't?

slim ferry
#

he could but idk what he considers interacting with modding

wild berry
slim ferry
#

yeah?

#

why would you not be able to change them

dapper sun
#

any change he makes to the code will likely break some lovely patch somewhere for someone

unkempt thicket
#

Rip all my mods

slim ferry
#

rip debugplus

quick kraken
#

John Debugplus will have to put in some work then

#

And John Smods

#

And probably John Penumbra? (Ruby)

wild berry
#

does the context.result change everytime nominator and denominator are changed or does it need to be called manually

slim ferry
#

context.result is for an entirely different thing

#

thats for the outcome of probabilities

robust marsh
#

<@&1133519078540185692>

dapper sun
slim ferry
#

do the values in the copied table have the same names

dapper sun
#

they should

wild berry
#

i dont understand, you cant use multiple variables to

#

well

#

assign multiple keys to a table

#

because

#

where do i return this, its inside of a joker

dapper sun
#

the starting 3 values are bc my version of the table doesn't work without a set, and then i was told that to add custom info_queue values i need to use either vars or specific_vars

slim ferry
#

also if a function returns 2 things then yes you can do that

wild berry
#

no i mean like

#

you cant use local inside of a table

slim ferry
#

wdym

dapper sun
#

this isn't inside a table

wild berry
#

wait

slim ferry
#

you can return local variables inside a table

wild berry
#

is it called inside calculate??

slim ferry
#

no????

dapper sun
#

it's inside a patch

slim ferry
#

i literally JUST said its for loc_vars

dapper sun
#

no either??

slim ferry
#

yes

#

why would that be in a patch

#

genuinely what would that even do in a patch

dapper sun
#

????

#

wdym

wild berry
#

im genuiely confused

slim ferry
dapper sun
#

no

#

listen

slim ferry
#

get_probability_vars is, believe it or not, for getting the probability variables

wild berry
#

ill just add a normal nominator and denominator and call the chance thing every single calculate call

#

and change the loc var

#

everytime

dapper sun
#

_ _

slim ferry
#

literally just

#

read what it says

dapper sun
#

are we talking about different things 😭

#

no wonder i'm confused

#

because i've been asking for help with this single thing for almost a full 24 hours and made zero progress

wild berry
slim ferry
#

thats

#

not how loc_vars works

wild berry
#

i know

#

i just dont understand

#

how im supposed to do it

slim ferry
#

loc_vars is a function

#

not a table

wild berry
#

OH

#

can you tell im extremely rustty

#

with balatro modding

slim ferry
#

a little

dapper sun
#

it's a function that returns a table

wild berry
#

how do i fire the function to get that table

slim ferry
#

the game does that for you when you hover the joker

spice wadi
#

thats how the functions inside cards work

wild berry
#

no i mean like

#

how do i fire it inside like

spice wadi
#

you dont call them, the game does in certain situations

wild berry
#

the calculate function

#

oh

slim ferry
#

calculate doesnt use loc_vars

wild berry
#

but like, if i want to change the numerator

#

and denominator

#

at a certain point

slim ferry
#

then. change it in card.ability via calculate

wild berry
#

right

spice wadi
#

look at vanillaremade

slim ferry
#

loc_vars is just for the text

spice wadi
#

vanillaremade uses the probability functions

wild berry
#

the thing is

#

im trying to do

#

two probability checks

#

in one calculation

spice wadi
#

you can just

#

do two

#

i dont really see the issue

wild berry
#

smthing like this?

slim ferry
#

thats for

#

checking the result of a pseudorandom roll

wild berry
#

yeah

slim ferry
#

but if you want that then sure ig

wild berry
#

thats what im doing

#

this too?

#

because from this point of view

#

im assuming

slim ferry
#

what are you actually trying to do

wild berry
#

basically mimicking a lucky card effect

slim ferry
#

then

#

dont do that

spice wadi
#

have you looked at how lucky card works in vanillaremade

wild berry
#

no

#

never heard of vanillaremade

slim ferry
#

context.result is for checking the results of other probability rolls lol

spice wadi
slim ferry
#

oh

#

i was just gonna get it

gusty compass
#

how could i utilise a gradient from SMODS.Gradient as a custom colour here?

slim ferry
#

SMODS.Gradients.modprefix_key

dapper sun
gusty compass
#

like if my key for the gradient is GG_C_power, what do i have to use?

#

SMODS.Gradient.GG_C_power?

spice wadi
#

what is your mod prefix

gusty compass
#

GG

spice wadi
#

what is the exact key

dapper sun
#

the mod prefix goes in the middle

#

normally

#

like j_GG_example

gusty compass
#

i normally just add GG_ to my keys, so the key for that gradient is GG_C_power

dapper sun
#

that's handled automatically you don't have to

gusty compass
#

oh, so i just get rid of it and use SMODS.Gradient to use the gradient?

spice wadi
#

the main reason you set a mod prefix is so it can add it automatically

dapper sun
#

wait you weren't doing that already

gusty compass
#

yea the key was "GG_C_power" 😔

spice wadi
dapper sun
gusty compass
#

but im pretty sure im missing some important detail here

dapper sun
#

the same way you'd use any other colour

spice wadi
dapper sun
#

just replace HEX with the gradient

spice wadi
#

i thought it was automatically added or is that a different table

gusty compass
#

im very lost 🙏

dapper sun
gusty compass
#

im using it to change the colour of the power scoring calc

red flower
#

{C:modprefix_gradient_key}

dapper sun
#

yea

red flower
gusty compass
#

this part of SMODS.Scoring_Parameter colour = SMODS.Gradients.GG_C_power

red flower
#

that should work like that yes

gusty compass
#

i tried it earlier and it seem to be stuck on red

red flower
#

can you show the code

#

for the gradient too

spice wadi
#

didnt you say earlier you messed up the key

gusty compass
#

SMODS.Gradient { key = "GG_C_power", colours = { mix_colours(G.C.PURPLE, G.C.RED, 0.25), mix_colours(G.C.PURPLE, G.C.BLUE, 0.25), cycle = 20, interpolation = "trig" } }

#

discord cant format geez

red flower
#

have you tried removing the prefix

gusty compass
#

uh, not yet

spice wadi
#

then its probably not going to work of course

dapper sun
#

```like this```

red flower
#

the prefix is automatically removed for most things but idk for gradients

gusty compass
red flower
#

you shouldnt add the prefix manually anyway

robust marsh
#

the past hour has taught me that i don't know how to hide UI elements properly

gusty compass
#

yea its more of a personal preference since i dont really want it to clash with other mods in case it happens to have the same name

red flower
#

it wont because smods adds the prefix

dapper sun
#

and you can do this
```lua
--now it has lua syntax highlighting```

gusty compass
#

oh does it?

red flower
#

yes

gusty compass
#

alright

spice wadi
#

yes thats what we meant by SMODS automatically adds it

gusty compass
#

yea i was a bit lost

spice wadi
#

for things like jokers its j_modprefix_key

red flower
#

smods does remove it if you add it manually to not double it

#

but idk if thats true for gradients too

gusty compass
#

it doesnt seem to since i used the prefix as the key and for SMODS.Gradients

#

one to one

red flower
#

and it works in other places?

gusty compass
#

it seems to be fine with jokers

spice wadi
#

When referring to custom Rarity, Gradient, Consumable or Suit colours added by SMODS, the key must be prefixed with the mod prefix.

red flower
#

then why are we looking at the gradient code

dapper sun
#

that's when referring to them

#

not when making them

spice wadi
gusty compass
#

because i was originally planning to change the colour of the scoring parameter, just was asking how i could make that possible after creating a gradient

spice wadi
loud summit
dapper sun
#

no

red flower
#

do you define the gradient before the scoring_parameter?

gusty compass
loud summit
red flower
gusty compass
#

yea i think

loud summit
#

darn

robust marsh
#

i have a feeling that I might have to patch this

red flower
gusty compass
#

alr i will rearrange the code and get rid of dupe prefixes

loud summit
# red flower what do you need

any idea how to get a color that has a solid gradient where the color changes across the box instead of being over time

spice wadi
loud summit
#

can u apply a shader onto a text background??

red flower
#

you can apply shaders to anything, idk how easy it is

loud summit
#

dang

#

oh well ill just use purple

gusty compass
#

it seems to be crashing right now

spice wadi
#

code + crash pls

gusty compass
#

i somehow figured out the issue

#

but yea, thanks guys for le help

chrome widget
rare torrent
#

is it possible to make a joker dissable the leftmost joker?

wispy falcon
rare torrent
#

😱

#

but how tho😭

wispy falcon
rare torrent
#

i don't know how to dissable a joker

hearty mesa
#

but you'd have to check for when the leftmost joker changes

wispy falcon
#

^

rare torrent
#

hmm ok let me try

hearty mesa
loud summit
#

try looking if theres a context for jokers being reordered

#

or just update it in context.before so it gets updated before scoring

loud summit
#

then again... how would you un debuff the prev card

floral marsh
#

in this case how do I make the localize work with my own voucher
Ima check rq if it is in the vouchers set

loud summit
#

without it messing with boss blind effects

rare torrent
slim ferry
#

SMODS.recalc_debuff(card)

loud summit
#

so that just resets the debuff to what it would be if the boss was active?

frosty rampart
floral marsh
frosty rampart
#

yea

robust marsh
#

thisis pai n

rare torrent
#

just another quick question how to also get a joker's sell value?

floral marsh
#

ah well I did the changes with the prefix and even set the custom voucher's set to Voucher but it crashes - it is probably not able to find and create it
is there anything wrong with this code or do I have to do it the old way

#

thats the voucher btw

chilly crescent
#

Am I allowed to talk about developing mods to make the game playable on small Linux handhelds? In the handheld space it's referred to as porting (which goes against rule 4), but it's more just optimizing the game to run and look better on basically a tiny potato computer.

slim ferry
#

linux is technically a pc operating system so i think thats allowed? it sounds like a similar situation to steam deck modding

chilly crescent
#

yea that's essentially what it is

violet oasis
frosty rampart
# chilly crescent yea that's essentially what it is

yea it's not porting if it already ran on Linux in the first place. you're just modding the game in a similar manner to e.g. diet melee, with the express purpose of making it run better on low-spec hardware

chilly crescent
violet oasis
robust marsh
#

uhh how would i modify the score with context.main_scoring_step? For example if i straight up just wanted to halve it

floral marsh
#

ima attempt both (should fix the text hovering at least)

turbid tiger
#

Can someone help me out? This Joker is crashing the game and I'm not actually sure why since I mostly copied bloodstone's code for this particular section. (denominator section)

    key = 'rewindjoker',
    loc_txt = {
        name = 'Rewind Joker',
        text = {

        }
    },
    rarity = 3,
    cost = 10,
    atlas = 'Jokers',
    pos = { x = 0, y = 0 },
    blueprint_compat = true,
    perishable_compat = true,
    eternal_compat = true,
    config = { extra = { repetitions = 1, odds = 2 } },
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds)
        return { vars = { numerator, denominator, card.ability.extra.odds } }
    end,
calculate = function(self, card, context)
    if context.repetition and context.cardarea == G.play then
        if next(SMODS.get_enhancements(context.other_card)) and SMODS.pseudorandom_probability(card, 1, card.ability.extra.odds) then
            return {
                message = "Rewind!",
                repetitions = card.ability.extra.repetitions
            }
        end
    end
end
}```
floral marsh
#

aight one thing fixed

#

so the issue wasnt the table

robust marsh
#

nvm im stupid i figured it out

wispy falcon
#

Is there a way to make a card have two suits at the same time? Like hearts and spades or diamonds and clubs on one card

idle plaza
chilly crescent
#

I've been making a mod and using patches to make the game look and run better on small Linux handhelds. one issue I've noticed though is that text seems to not have any anti-aliasing, which makes small text very hard to read. i've tried applying setDefaultFilter and setFilter to linear as much as I could, and while it works for most images (blind icon and cards were noticably more blurry), the text was still aliasing. I found out that a lot of text is rendered through Balatro's DynaText, which might have to do with it?

I also noticed if I set TILESIZE in globals.lua to a very low number, the text gets bigger and lower-resolution, and has clear blurring from its anti-aliasing. I'm wondering if perhaps something within this behavior is making the text render higher than it needs to? Even then though, wouldn't it still be anti-aliased when drawn on a small screen?

If anyone has any ideas of where to look or things to try, it'd be very much appreciated. Thanks!

floral marsh
#

thats the line causing the issue

slim ferry
#

probably because its the first line that checks a cards center

wild berry
#

is it possible to get all the jokers created from a mod

#

and insert them into a pool after getting them

turbid tiger
slim ferry
slim ferry
#

will only work for cards already loaded though

floral marsh
#

idk why tho

slim ferry
floral marsh
turbid tiger
#

Wait, wait.

#

I just had to hover on it this time

robust marsh
#

alright i feel stupid now, how would I modify the final score in context.final_scoring_step

#

i thought i got it but nope

violet oasis
floral marsh
wild berry
#

wait

violet oasis
#

I haven't delved deep into that, but I don't think you can use "center" directly like that

slim ferry
wild berry
#

it is, im just too lazy to do it everytime 🤷‍♂️

idle plaza
floral marsh
violet oasis
#

Are you trying to make half joker be normal sized?

floral marsh
#

no just a random deck giving 3 vouchers

wispy falcon
violet oasis
#

Oh nvm, I misread it

violet oasis
#

Because it could be pointing at a different line

#

By which I mean card.lua:279 might be a completely different line after Smods messes with it

floral marsh
#

the main function is this one

#

actually

#

it has to be the voucher

#

I dont think it is anywhere else

#

as the error states 'center' specifically

violet oasis
#

It is, but by looking at which line is causing the crash in card.lua, it may shed light on what's wrong in the voucher

rough frigate
#

trying to make a deck skin. why does it want d_ranks? happens whenever i try to move over to the custom skin

violet oasis
#

But since Smods modifies card.lua, it adds and removes lines, so if you're checking card.lua directly from the balatro executable, it may give you something completely different

#

I think you can check the actual edited file inside the lovely folder?

floral marsh
#

well the voucher has this smods function could that be the issue

#

also yes I was checking the edited version

#

from the lovely folder

turbid tiger
idle plaza
rough frigate
#

ohhhhhhh ok i see

idle plaza
rough frigate
#

thank you. im a noob XD

wispy falcon
modern kindle
#

unless youre trying to do smeared i dont know

wispy falcon
#

No, I want a joker to "weld a spade" on played cards, meaning they're their original suit and spades

wild berry
slim ferry
#

okay uh

#

idk then

floral marsh
robust marsh
#

ok i was looking at the wrong thing, how would i modify the score AFTER it gets totalled

floral marsh
#

ima just divide the voucher table in the deck script

#

oh

mellow thunder
#

I'm currently trying to make a joker turn into another one if a banana joker is picked up. It works if I copy the banana from my collection, but it doesn't work if I buy it in the shop. Is there something silly I'm doing wrong here?
if context.card_added and not context.blueprint then if next(SMODS.find_card("j_gros_michel")) or next(SMODS.find_card("j_cavendish")) then card:set_ability("j_badlatro_monk") return { message = "wawa" } end end

violet oasis
floral marsh
#

its vouchers not voucher that I need

rotund sable
floral marsh
#

aight thx Kiro for your help

wispy falcon
violet oasis
stiff locust
#

where would I find a list of every registered joker

#

is G.P_CENTERS set up that way

mellow thunder
cursive gazelle
frosty rampart
mellow thunder
wispy falcon
stiff locust
#

yes and no

wild berry
#

what did i do wrong??

stiff locust
#

hooking is running your own code when a function runs

rotund sable
stiff locust
#

you take the original function and swap it out for your own function which is called instead

#

and then you run the original function you swapped out afterwards

wild berry
stiff locust
#

you can then run any code either before or after the original code runs

rotund sable
idle plaza
wild berry
cursive gazelle
#

Jimbo

cursive gazelle
mellow thunder
idle plaza
#

You're welcome.

slim ferry
#

what are the "synonyms" of these values, if any (as in multiple names with the same effect)

rotund sable
# wild berry same thing

im not sure then, modprefix and keys are case sensitive, only thing i did diffrently in a booster pack is return a table but iirc you can also return a card

wispy falcon
stiff locust
cursive gazelle
cursive gazelle
stiff locust
#

yes

#

and

#

inside of its wiki

#

how would I find this

slim ferry
wispy falcon
cursive gazelle
#

Thanks man

slim ferry
#

oh

red flower
slim ferry
#

why does vanillaremade use Xmult for glass then and not x_mult

#

ohhh

#

its Xmult or x_mult

#

also what the fuck is t_chips and t_mult

red flower
#

yeah lol thats funny

rotund sable
#

surely not tetra chips

primal robin
#

This code is crazy

red flower
#

t_mult is mult for like specific hand types or something like that

slim ferry
#

is that actually ever used

red flower
#

yes, by the hand type jokers

slim ferry
#

oh okay

#

what about h_size and d_size

#

are those just for jokers like juggler and drunkard

red flower
#

yeah

stiff locust
#

is there a way to change the uhhh

#

name of a variable to another variable

red flower
#

no

loud summit
#

why would you want to

red flower
#

you can do a = b

stiff locust
#

that doesn't really do what i need it to

slim ferry
#

a = b and then b = nil would have the same effect i think

stiff locust
#

see the thing is

red flower
stiff locust
#

i don't know what the name of the thing I need to change it to is gonna be

idle plaza
cursive gazelle
#

What in the luajit2

stiff locust
#

I wanna make lists that contain the keys of every joker from each mod that adds them

#

but I want those lists to be named with the mod prefix

#

so the lists don't overlap with each other and make dupes

#

it'll work if I can append the mod prefix to the name of said list

idle plaza
#

That's already accounted for because every Joker's key already has its mod prefix appended to it.

slim ferry
# red flower

wait whats repetitions, thats not used for anything right? unless theres something i cant think of rn

stiff locust
#

but they're not split into separate tables

#

based on which mod they're in (i don't think)

robust marsh
#

how would I modify the score after it has already been totalled, if that's possible

red flower
red flower
slim ferry
#

secret 11th automatically triggered enhancement effect ⁉️ /j

red flower
#

maybe mime used it at some point?

#

or the like

stiff locust
#

going through G.P_CENTERS.Joker and getting the keys of every joker (only if they have a mod field, so this won't include vanillas) and getting the mod prefix out of them

#

i haven't actually done this yet cause without named lists to sort each mod group of jokers into I can't save the values in a robust manner that accounts for every possible mod

slim ferry
red flower
#

yeah nvm it's added by smods

slim ferry
#

oh

#

why...................................

stiff locust
#

context.after but put your code in an event which has blockable and blocking enabled

red flower
red flower
rotund sable
#

genuinely what could go wrong

robust marsh
# cursive gazelle Context.after?

Not sure how to influence the score directly is the thing, I'm trying to implement a mechanic for my boss that's similar to boss armor in other games. The equation itself should be relatively easy but I'm not sure how I can modify the score directly after chips and mult are done multiplying

stiff locust
#

if I knew how to do that it would be easy

#

i wonder if it'll just let me concatenate
(it does not)

#

but I doubt it

slim ferry
#

also

#

seals arent centers

#

so that doesnt even work

latent perch
#

hey wait a minute I added that

red flower
latent perch
#

I think

slim ferry
stiff locust
#

yeah no that would work

#

I forgot you can do that with the square brackets

#

ok

robust marsh
red flower
#

vremade wiki has answers for that :3

latent perch
robust marsh
red flower
steady smelt
#

what in card_draw actually makes greyed/drawn cards render translucently in the deck view? i can't find it for some reason

latent perch
#

repetitions is just for parity with other permanent effects

slim ferry
latent perch
#

well it's retriggers

robust marsh
latent perch
#

retriggers on playing cards

red flower
#

you want the final hand score?

robust marsh
red flower
#

the game adds it immediately, there's no intermediate step

robust marsh
slim ferry
#

get patching bucko

red flower
#

you need to modify hand_chips and/or mult or patch the part where it adds it
or well, maybe the score_parameter stuff has something for that

robust marsh
#

this will be very fun

cursive gazelle
#

Get patching kiddo

robust marsh
#

this is quite random but I always feel like my mod will fall short in the end and when I spend 3 hours working on one feature I feel like I wasted them completely steamrotting

steady smelt
#

i figured it out, i was getting confused bc ranks aren't rendered translucently
they're rendered normally then with the greyed shader on top of them to give them the muted colours but not translucent

frosty rampart
#

bumping this question of mine

is there a UIBox or something that's exactly the entire screen? i want to be able to draw some text in the top left corner of the screen regardless of menu transitions/whatever

robust marsh
#

I might take a look at how some boss blinds cap your hand's score, there's a chance I can implement my equation into that one way or another

frosty rampart
steady smelt
#

or i mean something i did was doing that

red flower
frosty rampart
#

noted

rotund sable
#

i think you could also use love.graphics

modern kindle
frosty rampart
wild berry
#

istg i used the examples and they dont EVEN WORK FOR MY MOD........

#

god why do booster packs have to be hard for me

rotund sable
wild berry
#

nvm i got it kinda working

#

defaults work but pools are not being used

frosty rampart
#

you probably need to add the modprefix to the pool name in your create_card call

stiff locust
#

what function do I hook for starting a run

wild berry
#

but problem

#

its using inject

#

instead of manually using keys

frosty rampart
#

i don't follow

wild berry
#

guess i gotta switch back to that then

frosty rampart
#

that doesn't affect changing set = "CJModSet" to set = "modprefix_CJModSet" in the create_card call in your booster code

glossy comet
#

does anyone know what the value that holds the seed of a run is called?

rotund sable
frosty rampart
#

ah

stiff locust
#

it said its recommended to prefix them

frosty rampart
# stiff locust what function do I hook for starting a run

usually you hook Game.init_game_object i think? note that the return value of that function is what becomes G.GAME, so if you want to do anything in G.GAME you need to run the referenced function first and save the return value to then edit it

stiff locust
#

i don't need to do anything in G.GAME here

#

I just need my code to run when a run starts

frosty rampart
#

yea init_game_object should be right then
there's also Game.start_run, not sure what the distinction is

wild berry
modern kindle
#

ive never used init_game_object myself but i can confirm Game.start_run is what i use

stiff locust
#

game start run worked great

#

so that's 1/3rd of the idea

#

when I create a pool can I use a for loop inside it

#

wait nvm

#

there's an easier way than a for loop

vocal helm
#

Is there any way to set how long a perishable Joker lasts? I'm trying to create a joker that only lasts one round

#
new_card:set_perishable(true)
                        new_card.ability.perish_rounds = card.ability.extra.perish_rounds
#

(this just sets it to the default of 5)

frosty rampart
#

just have the joker destroy itself in context.end_of_round

vocal helm
#

it's not the joker itself that goes away, but the cards it creates

#

it's a riff-raff style thing

wild berry
#

ive tried putting a modded default for the booster and whaddayouknow, it defauts to joker

#

it feels like the game just doesnt recognize i loaded my jokers in

frosty rampart
# vocal helm it's a riff-raff style thing

oh i see
you might be better off making a new sticker than trying to hijack perishable, because then that just debuffs the jokers instead of removing them
check Paperback, it has a very similar joker called "Ultra Rare" that gives the jokers a new "Temporary" sticker. paperback is under the MIT license so you should be able to just borrow the code for temporary

vocal helm
#

i don't mind them getting debuffed

wild berry
frosty rampart
violet oasis
wild berry
#

i havent

#

lemme try

red cradle
#

Hi, is it possible to get table of all existing contexts?

slim ferry
#

not without making it yourself

wild berry
#

local tab = {}
for n, x in pairs(context) do
table.insert(tab, x)
end

red cradle
frosty rampart
slim ferry
red cradle
violet oasis
# wild berry it worked, ty!!

I dunno if there's a way to add them all at once outside of individually adding them to SMODS.Joker, but maybe try something like:

    key = "CJModSet",
    default = "j_four_fingers",
    cards = {
         ["j_CJMod_keyOfTheJoker"] = true,
     },
    inject = function(self)
        SMODS.ObjectType.inject(self)
        self:inject_card(G.P_CENTERS.j_CJMod_keyOfTheJoker)
    end,
})```
wild berry
#

is keyOfTheJoker an actual value or is it a placeholder

violet oasis
#

placeholder for your joker

stiff locust
#

does break end the current iteration of a loop or the entire loop

#

i looked it up i shouldve done that to begin with it ends the entire loop

rotund sable
#

Based on general programming I would assume the entire loop

stiff locust
#

how would I make it end the current iteration of a loop then

rotund sable
#

::continue:: should be at the bottom of the loop

stiff locust
#

ah

#

that's nice

rotund sable
#

A simple continue keyword would be nicer tho 😢

rocky plaza
#

wait lua doesnt have a continue keyword
wtf

#

i havent needed to use it yet
but why does lua also just casually have a goto

keen musk
robust marsh
#

HELL YES

vocal helm
#

Still figuring out a few things about my joker is there any way to filter stuff from add_card? I'm trying to specifically get an Uncommon Joker that's perishable, and working around it by using pseudorandom_element, but G.P_JOKER_RARITY_POOLS doesn't let you index by key and it's hard to check the rarity of the joker otherwise

wispy falcon
#

A hook is written in lua and not in TOML's like patches, right?

violet oasis
#

Yes

slim ferry
#

yes

robust marsh
slim ferry
#

hooks arent even in a seperate file.

wispy falcon
violet oasis
slim ferry
#

how does defining a function for scale_card work again? i forget because the lsp doesnt have anything for it

#

oh

#

nvm i found it

cursive gazelle
pseudo furnace
#

How do I update the text cards in full deck like driver's license? Doesn't seem like just the calculate script will make it

robust marsh
#

🧱

chrome widget
cursive gazelle
#

Hello winter

chrome widget
#

Hello!!!!

pseudo furnace
#

Why is everyone a M'

cursive gazelle
#

Seems to be a trend

chrome widget
#

I'm named this after the lovely N'

robust marsh
robust marsh
#

I made a custom HP bar for my boss so the UI for those two is pointless

cursive gazelle
#

You can go the stupid dumb way and draw a rectangle over it with love.graphics

#

But that’s lazy

cursive gazelle
pseudo furnace
cursive gazelle
robust marsh
cursive gazelle
#

I’m lazy i do stuff like that sometimes

robust marsh
cursive gazelle
#

Then i look at my code and say why am i lazy and fix it

stiff locust
#

do booster packs have set_ability

cursive gazelle
#

Find out

wispy falcon
robust marsh
cursive gazelle
#

Check

robust marsh
#

yeah

#

i could add that eventually

cursive gazelle
#

Bepis’s yggdrasil code

robust marsh
#

wait updating for what exactly? HP bar or the deduction

cursive gazelle
#

he has a progress bar for xp (animated )

robust marsh
#

ah

cursive gazelle
#

Make the bar larger so it looks like darksouls

robust marsh
#

I actually managed to make the HP bar with the help of bepis' progress bar code

robust marsh
robust marsh
#

bepis if youcan see this thank you for making the progress bar i love you you saved me about a week of sufferign

robust marsh
cursive gazelle
#

What do you think of my abysmal shaders

steady smelt
#
    calculate = function(self, card, context)
        if context.post_trigger and context.other_card.area == G.jokers and context.other_card ~= card then
            card.ability.extra.chips_count = card.ability.extra.chips_count + 1
            G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
                attention_text({
                    text = localize('manifold_plus_1'),
                    scale = 1, 
                    hold = 0.4,
                    major = card,
                    backdrop_colour = G.C.BLUE,
                    align = 'bm',
                    offset = {x = 0, y = -0.05*card.T.h},
                    silent = false
                })
                play_sound(sound, 0.8+percent*0.2, volume)
                if not extra or not extra.no_juice then
                    card:juice_up(0.6, 0.1)
                    G.ROOM.jiggle = G.ROOM.jiggle + 0.7
                end
                return true end
            }))
        end
        if context.joker_main then
            return {
                chips = card.ability.extra.e_chips * card.ability.extra.chips_count,
                card = card
            }
        end
    end

why does the event i'm calling here happen before the post_trigger joker effect? shouldn't it be after? i.e. POST trigger

robust marsh
cursive gazelle
#

yeah they’re quite weird

chrome widget
# robust marsh PLEASE

Do you want it to just be blank? Or would you want something like ???? or ---- where the score requirement usually is, since otherwise there would be open space

cursive gazelle
#

Winter is a shader wizard she can help with stuff that will blow your brain trying to figure out

#

Fun fact she helped me a lot to learn them

chrome widget
#

oh hehe thank uuuuu :cattoblush:

frosty dock
stiff locust
#

how would I get a booster to pull from a joker pool

cursive gazelle
robust marsh
stiff locust
#

I imagine manual card creation wouldn't be good for this because it could make duplicates appear inside the pack?
or does it already handle dupes

frosty dock
steady smelt
#

hm

chrome widget
# robust marsh blank

Okay gonna have to make some guesses since I'm in an airport and changing some stuff on the fly w/o testing but bear with me

frosty dock
#

there's the proper way to address that (using a func return and queuing the event in there, this will have it happen when this effect is getting evaluated) as well as a janky way (using a double event)

steady smelt
#

i tried double event and it gave all the popups at the very end

#

how would i do the first (proper) way?

robust marsh
frosty dock
steady smelt
#

ty for your help

frosty dock
#

np

wispy falcon
#

Anyway... The example code in the wiki for hooking, can I just copy paste that to see what it does or would I need to change some things?

#

This code

function Card:add_to_deck(from_debuff)
    local ret = card_add_to_deck_ref(self, from_debuff)

    if not from_debuff and -- If the card wasn't added by being undebuffed
        self.ability.set == "Joker" then -- and the card (`self` in this case) is a Joker

        -- Adds it to the run's global table.
        -- It is recommended (but optional) to preppend your mod's prefix to any global variable/field to prevent mod conflicts
        G.GAME.vremade_joker_added_counter = (G.GAME.vremade_joker_added_counter or 0) + 1
    end

    return ret
end```
slim ferry
#

this just works as is

cursive gazelle
#

I make my variables stupid to not have to add mod prefix

robust marsh
robust marsh
#

after i'm done with this boss I need to finish the t. nebula deck and move on to t. magic

spice olive
#

This is the joker I am trying to create:
All or Nothin (which can be purchased for $5) starts off with a sell value of $50 and the sell value decreases by $2 per round, when its sell value reaches $0 it self destructs. Every round there is a 1 in 50 chance of it giving $500.

I have no idea what I am doing wrong, the sell value stays at $2 no matter what I do, any advice? I can provide screenshot of code

cursive gazelle
wispy falcon
#

Damn, people's code is a really big treasure chest xD

cursive gazelle
cursive gazelle
stiff locust
#

one day someone will look in the tsunami code and find all the references

frosty dock
cursive gazelle
#

I like to spam S and D key when i’m coding and i get stuck

#

SDSDSDSDSDSDSDSD

wispy falcon
#

Cryptid has some comments that are so funny too

rotund sable
cursive gazelle
#

I love when my code backfires and shoots me in the leg

chrome widget
#

@robust marsh taking me a little longer than expected but im gettin there

stiff locust
robust marsh
chrome widget
#

Do you want me to just blank out this whole section or just the round score box

robust marsh
cursive gazelle
#

LeBron of modding blinds

robust marsh
wispy falcon
#

Would this work to hook is_suit?

function Card:is_suit(suit, bypass_debuff, flush_calc)

    -- Code before

    local ret = card_is_suit_ref(self, suit, bypass_debuff, flush_calc)

    -- Code after

    return ret
end```
cursive gazelle
#

Ultrakill ost makes you a good coder

robust marsh
stiff locust
#

crashed on opening collection for a booster pack i'm working on, anyone seen this one before?

robust marsh
#

i can't wait for hakita to drop the rest of the layer 8 ost

cursive gazelle
robust marsh
cursive gazelle
robust marsh
modern kindle
#

we got silksong before balatro update

#

dead game

robust marsh
#

yeah pack it up

cursive gazelle
robust marsh
#

I LOVE AZALI

cursive gazelle
robust marsh
#

he always felt like an enigma to me with the default pfp and random banger music

#

genuinely a goat

cursive gazelle
#

Use their music without consent in your mod

modern kindle
wispy falcon
#

Anyone know where is_suit is in the balatro code? I can't find it ._.

cursive gazelle
#

I don’t think it fits for balatro lol

robust marsh
#

i hate how good the tboi ost is for this mod

cursive gazelle
robust marsh
#

maybe one day i'll have custom music for it

cursive gazelle
robust marsh
#

but not anytime soon

stiff locust
wispy falcon
cursive gazelle
#

My brother in christ fl studio is 300$ and i know your ass know nothing about making music

robust marsh
cursive gazelle
#

I made this beat its so dope I’m gatekeeping it

stiff locust
# wispy falcon I just started with it

here's a hook for it

local card_is_suit_ref = Card.is_suit
function Card:is_suit(suit, bypass_debuff, flush_calc)
    local ret = card_is_suit_ref(self, suit, bypass_debuff, flush_calc)
    if not ret and condition then
        return true
    end
    return ret
end

self is the card being checked and suit is the suit it is checking for

#

so you just need to figure out if self has that spades thing and if suit is spades then return true

#

cause suit is whatever suit it's checking for iirc

wispy falcon
stiff locust
#

¯_(ツ)_/¯

#

idk how far you got

#

thought i'd put it out there

wispy falcon
#

This far:

function Card:is_suit(suit, bypass_debuff, flush_calc)

    -- Code before
    print("Before :O")

    local ret = card_is_suit_ref(self, suit, bypass_debuff, flush_calc)

    -- Code after
    print("After :3")

    return ret
end```
stiff locust
#

well then yeah it is

wispy falcon
stiff locust
#

i'm not sure what if not ret does

#

but mine has that and yours doesn't?

#

oh wait no I do know what that does

#

that makes it so if the suit check passes anyway, your code doesn't run

wispy falcon
stiff locust
#

cause your code wouldn't need to run if the suit check was already true

#

it's an optimisation thing I think

wispy falcon
#

The only thing I don't get is how I would make it so that the joker makes the scored cards be suit x and spades

stiff locust
#

well

#

is_suit is ran with a suit argument

#

unlike get_id which returns the rank of the card

#

is_suit returns true if the card's suit matches the suit argument you put in

stiff locust
#

the card will still have its original suit

#

and it should still pass the original suit checks

wispy falcon
#

So I would do if self:is_suit ~= "Spades" and 'joker check' then self:is_suit = "Spades"?

rotund sable
#

Isn't is_suit a function

stiff locust
#

running is_suit inside is_suit doesn't sound like a very good idea

#

I think you'd have to get the base suit of the card

#

by the actual value

wispy falcon
#

So I'd use self:base_suit or what's it called instead?

spring gyro
#

Hello

rotund sable
#

card.base.suit

wispy falcon
rotund sable
stiff locust
#

idk if self.base.suit is the right value but eastern said it

wispy falcon
#

And I would do that before or after the original code?

stiff locust
#

after

#

when do you apply the spades suit to all cards

rotund sable
stiff locust
#

is it an effect granted by a joker or is it on the card

#

like an enhancement or smthn

spring gyro
wispy falcon
stiff locust
# spring gyro I try make fusion from fusion mod. but crash. 145 load this joker, but whast wr...

Make sure you install the up to date version of the FusionJokers mod
I don't know if you did or didn't get the right version, but it will cause issues if you didn't get the right version

Also, the crash is caused by the file jokers/unholyhell.lua. Something inside that file is causing the crash, which may be caused by the incorrect FusionJokers version, or something else.

The up to date version of FusionJokers is here https://github.com/wingedcatgirl/Fusion-Jokers

GitHub

Fuse jokers into special powerful versions! Contribute to wingedcatgirl/Fusion-Jokers development by creating an account on GitHub.

spring gyro
#

Where my joker

stiff locust
wispy falcon