#💻・modding-dev

1 messages · Page 498 of 1

sonic cedar
wintry solar
#

try vars = G.P_CENTERS[v].loc_vars and G.P_CENTERS[v].loc_vars({ability = G.GAME.hpfx_ijiraq_savedvalues[card.sort_id][v]}, {}).vars

sonic cedar
#

got it boss

primal robin
#

Hey @wintry solar did you seen new UI nonsense I kinda started developing today for no reason?

wintry solar
#

I did

primal robin
#

Does it have chance to live what you think?

wintry solar
#

it seems interesting for people who are scared of UI code but I am not so it's not useful to me 🤣

#

if you do all the set up in your api I don't see why it wouldn't be used

sonic cedar
#

i have the same vein of question but about the booster weight thing i pitched ✋

primal robin
#

It needs deeper development like, creating some sort of contexts which will allows to make deep cross-references

#

Basically, invent React in Balatro

wintry solar
#

probably easier to just write a good guide for UI

#

like, it's actually pretty simple to do, it just looks overwhelming because it tends to be formatted badly imo

primal robin
#

That's also true, but I want to try make some sort of bootstrap over UI to make it easier to pickup

#

Possibly, easier attaching callbacks, easier elements selecting, etc. Not sure can I make smth more complicated than that

slim ferry
#

will the or 1 actually stop the game from crashing outside of runs, or do i just not need to do that at all

sonic cedar
novel yarrow
#

I never coded in lua and it's eating my brain a lil' bit lol

#

like why is there a comma after end sometimes.... Is it only to end functions??

slim ferry
#

comma is because theres another element after it in a table

novel yarrow
#

Ah... That makes more sense, I'm not used to the syntax yet

formal parrot
slim ferry
#

why does this show as 1 in-game when outside a run? i can see G.hand existing outside of runs but why is #G.hand.cards specifically 1?

sonic cedar
slim ferry
#

which is?

sonic cedar
#

maybe the title screen one?

slim ferry
#

i suppose so then

sonic cedar
#

i said it as a joke but now im thinking

#

why IS it 1

slim ferry
#

i should maybe try

#

downloading another mod that adds a card to the title screen

#

and see if that makes it 2

sonic cedar
#

oh yeah theory time

slim ferry
#

okay yeah so it doesnt

#

its just 1 for no particular reason ig

sonic cedar
#

oh ok then

slim ferry
#

or maybe it has to be another playing card

sonic cedar
#

default value maybe

slim ferry
#

strange!

#

since vanillaremade does like a ton of shenanigans with the number of cards in deck for blue joker and stuff to make sure the value actually exists first

#

oh wait no its probably just 0 and not 1

sonic cedar
slim ferry
#

wait no its because im stupid and used math.min instead of math.max 💀

#

whoops

sonic cedar
#

oml

knotty orchid
#
function Card:get_chip_mult()

    if self.ability.set == 'Joker' then return 0 end
    local ret = (not self.ability.extra_enhancement and self.ability.perma_mult) or 0
    if self.ability.effect == "Lucky Card" then
        if SMODS.pseudorandom_probability(self, 'lucky_mult', 1, 5) then
            self.lucky_trigger = true
            ret = ret + self.ability.mult
        end
    else
        ret = ret + self.ability.mult
    end
    -- TARGET: get_chip_mult
    return ret
end

If I want to patch the SMODS.pseudorandom_probability line, how should I proceed? Can this be done through lovely?

red flower
#

Yes, but why do you want to do it?

knotty orchid
#

I wanna set the numbers as variables -> 1 in 5, being 5 a variable

#

which i could access and modify with other jokers, don't know if this can be done without patching this

red flower
#

You could hook the function instead and it would be less invasive

knotty orchid
#

oh

#

i'll try that

#

thanks

red flower
#

I'd hook SMODS.get_probability_vars and check for identifier == 'lucky_mult'

brittle yacht
#

how do i debuff every playing card in the deck and hand with a boss blind

red flower
#
if context.debuff_card then
  return { debuff = true }
end
#

oh wait i think that gets jokers too i forgot about that

brittle yacht
#

😐

#

lol

sonic cedar
#

you got it eventually

red flower
brittle yacht
#

ok actually let me explain it

#

it's a red light green light minigame

#

when the local state is 'green' you are free to play cards and earn score. when the local state is 'red' all playing cards get debuffed.

sonic cedar
#

dont say it

brittle yacht
#

what?

red flower
sonic cedar
#

cool blind idea btw

brittle yacht
sonic cedar
#

DAMNIT

#

i had hope

modern kindle
#

erm if its red and you play it should be an instant lose

brittle yacht
#

but i'm too stupid to figure this out

#

for context i've only ever made 1 boss blind

sonic cedar
#

if its red change the blind to the plant

brittle yacht
graceful vapor
#

How do I add bonus mult to a card

brittle yacht
graceful vapor
#

without an enhancement or edition*

brittle yacht
#

oh i have no idea

graceful vapor
#

._.

brittle yacht
#

gl my guy

brittle yacht
graceful vapor
#

-# So you're telling me that you can't send a gif but you CAN send a link to a fandom page to squid games!??!??!?

sonic cedar
brittle yacht
#

how do i just add a random number to a delay

sonic cedar
#

pseudorandom probably

brittle yacht
modern kindle
brave blade
#

I'm kind of confused on how to set up custom rules for challenges, how would I make a rule that gives an investment tag after every boss blind? (Similar to how anaglyph gives you a double tag after every boss blind)

brittle yacht
modern kindle
#

wym?
should just be if you have the state on red then it does that

unless you mean you dont even have the whole red and green light set up

brittle yacht
modern kindle
#

uhh, im not sure
maybe could just find a way to set timers and randomize the timers

idk how easy that is to set up myself though
i want to do stuff with timers soon i just havent gotten around to it

ie total time spent in ante, in shop, in blind, etc effects

brittle yacht
sonic cedar
slim ferry
#

how do i actually properly set the icon for my mod, i dont see anything referencing icon images in any other mods

brittle yacht
final jewel
#

how do I make the name of my rarity translate. like I am trying to translate in french my things but the name of the rarity doesn't translate

#

the first screenshot is in main.lua and the secont is in fr.lua

limber blaze
#

is there a good way to add custom functionality to debugplus keysbinds without weird patches, because of how its setup its not really possible to patch the original function definitions and debugplus loads them locally so you have to insert hooks in weird places using patches which id like to avoid if possible

primal robin
#

You can make custom commands afaik

limber blaze
#

does this let you change how ctrl+r works for hovering over something custom

#

i specifically need to stop the current functionality from happening and do something else

#

ctrl+c too

primal robin
#

Unfortunately, fully hardcoded

#

Use cross-mod lovely patches ig

#

Still dk why mod structurized like this

#

It looks like gamemaker thing

limber blaze
#

i mean i can do the weird patches ik how

#

but its like

#

annoying and janky

primal robin
#

No choice for you

#

Unfortunate!

limber blaze
#

its mostly just for my own testing so i could just like

#

edit my own copy of debugplus

primal robin
#

Also an option

limber blaze
#

but thats lame

primal robin
#

You cannot even check is console opened

#

This variable is local

#

For no reason ofc

limber blaze
#

if i ever get motivated enough i will pr debugplus

#

but dont count on it

sonic cedar
#

are either of you guys good enough with info_queues? still trying to figure out this value reference thing

primal robin
#

never used it

limber blaze
#

ive used them

sonic cedar
brittle yacht
slim ferry
#

i dont actually think you need to do that from what i have just also been replied with

#

its just an atlas

brittle yacht
slim ferry
#

also folder names should basically never matter outside of the fact that the assets folder always should be named assets i think

rotund sable
sonic cedar
wintry solar
#

oh damn I completely forgot I was helping with this 🤣

sonic cedar
#

EREMEL 💔

#

lmfaoo

#

welcome back regardless

limber blaze
#

whats cfg

#

here

sonic cedar
#

this is within the generate_ui function so let me go find it

wintry solar
#

oh I know

#

I think

limber blaze
#

its likely that cfg is nil somehow

sonic cedar
novel yarrow
#

Is there a way to get the chip value of a discarded card?

wintry solar
limber blaze
#

:loc_vars instead of .loc_vars

#

in your first screenshot

sonic cedar
#

doing both of these

sonic cedar
wintry solar
#

the problem is that you don't have a card

limber blaze
#

no just when you call the function

wintry solar
#

oh wait

vestal magnet
#

can i play a sound in return

wintry solar
#

just do :loc_vars({}, {ability = bla})

limber blaze
#

also info_queue is second isnt it so it would be :loc_vars(nil, {...})

#

well not nil

#

yeah what eremel said

sonic cedar
#

setting up

#

is this right or no

wintry solar
#

probably

vestal magnet
wintry solar
#

I don't know why I didn't just look at my own jokers that do this originally 🙃

sonic cedar
#

omg

#

testing time 🙏

#

idk maybe im missign something
im not the best at reading crashes

brave blade
#

Is there a helper mod that adds a calculate function to challenge decks? It seems really annoying that challenge decks have to modify funtions in order to implement custom rules when normal decks just use calculate function

red flower
#

i dont think so

#

it would be cool to have that in smods

#
  • an apply function
sonic cedar
floral narwhal
#

how can i play a music when a special boosterpack kind open?

brave blade
#

Ok, well I'm just going to implement my challenge deck idea as a regular deck then until that gets changed

sonic cedar
wintry solar
#

this is how I do my tooltip that's similar I think

sonic cedar
#

oh my god i dont even have a uibox generation function in this is that it

#

no wait that wouldnt make sense nvm

#

ill set up the patch first before trying the left image

sonic cedar
wintry solar
#

yes

brittle yacht
#
    SQUID = HEX("ED1B76"),
    GHOSTSALT = HEX("4D1575"),
}

G.ARGS.LOC_COLOURS.silly_squid = G.C.SILLY.SQUID
G.ARGS.LOC_COLOURS.silly_ghostsalt = G.C.SILLY.GHOSTSALT```
brave blade
#

Is there a context for the very start of a run? I want to make a deck that starts with a tag, and while it seems easy to make decks start with consumables, I can't figure out how to do it for tags

rotund sable
#

wait a sec

brittle yacht
rotund sable
#
G.C.SILLY = {
    SQUID = HEX("ED1B76"),
    GHOSTSALT = HEX("4D1575"),
}

local loc_colour_ref = loc_colour 
function loc_colour(_c, _default)
    if not G.ARGS.LOC_COLOURS then
        loc_colour_ref()
    end
    G.ARGS.LOC_COLOURS.silly_squid = G.C.SILLY.SQUID
    G.ARGS.LOC_COLOURS.silly_ghostsalt = G.C.SILLY.GHOSTSALT

    return loc_colour_ref(_c, _default)
end
rotund sable
#

from this message downwards there is a explanation of what this does (stops at my Cya)

#

line by line

wintry solar
#

you can also just do loc_colour() at the top of your code

brittle yacht
#

i believe i can't do this though, as it doesn't work in game?
{C:#1#}#2#{}

#

info_queue[#info_queue + 1] = { key = 'silly_art', set = 'Other', vars = { "silly_ghostsalt", "GhostSalt!" } }

rotund sable
#

what

brittle yacht
#

i'm trying to make it so you set the color to change the info queue

wintry solar
#

you'd use {V:1}#1# and then {vars = {"GhostSalf", colours = {'silly_ghostsalt'}}}

brittle yacht
#

"Art by {V:1}#1#"

wintry solar
#

oh sorry

#

should be G.ARGS.LOC_COLOURS.silly_ghostsalt

brittle yacht
wintry solar
#

in the colours = {}

brittle yacht
#

thanks you

sonic cedar
brave blade
#

How do I modify blind payouts? (For example, if I wanted to make boss blinds pay out $25 instead of $5)

slim ferry
#

why does it become red

#

never questioned it before

sonic cedar
#

what is this

slim ferry
#

commit message in vscode

sonic cedar
#

oh i do it through ghub desktop so idk

sonic cedar
sonic cedar
slim ferry
#

nothing

wintry solar
#

just try it

sonic cedar
#

tried it

#

i didnt make it

#

to the game

wintry solar
#

your patch is wrong

sonic cedar
#

where did i go wrong

#

equal sign

#

i miised the equal sign

#

take 2

wintry solar
#

you need ijiraq = true in the info queue bit

sonic cedar
#

oh okay

wintry solar
#

so it triggers this bit of the code

sonic cedar
#

like just under the vars = vars

wintry solar
#

yeah that's fine

sonic cedar
#

ok cool

#

nvm (freeze on hover, then crash)

wintry solar
#

🤔

sonic cedar
#

maybe I messed up the infoqueu?

chrome widget
#

Here's my final ish version of this atlas

#

Took way too long lmao, the taser really is funny

sonic cedar
#

hook into Blind:defeat maybe?

slim ferry
brave blade
chrome widget
#

If you mean an existing blind, you can either take ownership of the center itself to set its dollars property, or when it's loaded into G.GAME.blind, you can directly modify G.GAME.blind.dollars

#

Otherwise if you want to update the UI while also changing it at runtime while also not making a permanent change to the object center, you're gonna need to hook some UI functions I think

#

Depends on what you're using it for

brave blade
#

What I want to do is change the payout of boss blinds from $5 to $25

chrome widget
#

That's not specific enough

#

Do you mean just universally? In general? A Joker effect? When is this applied?

brave blade
#

It's a deck effect, so it would be applied universally in the context of the run

chrome widget
#

Is it specifically 5 -> 25 or does it also apply to final boss blinds as general x5 payout?

#

I.E. 8 -> 40

brave blade
#

A 5x multiplier would probably be better

chrome widget
#

What you're going to want to do is, in the deck's apply function, iterate through G.P_BLINDS and just do blind.dollars = blind.dollars * 5

#

I'm not 100% sure if this resets correctly when the run is exited however, let me check

wintry solar
#

it wont

chrome widget
#

What's the most effective way to reset it? Because regardless of changing the prototypes/centers being always a lil sus, it's probably the easiest method that doesn't involve UI hooking

brave blade
#

I think I probably need to UI hook anyway because that's going to be far too many $ signs

chrome widget
#

Hmm thinking

#

Actually wait

slim ferry
brave blade
slim ferry
#

ah okay i see

brave blade
#

If this is difficult, I'd be fine with just having an "extra payout" on the cash out screen like econ jokers

sonic cedar
chrome widget
#

So for the actual internal blind hud:

function Blind:set_blind(blind, reset, silent)
    local ret = ref_set_blind(self, blind, reset, silent)
    if G.GAME.selected_back_key == 'your_key' then
        self.dollars = self.dollars * 5

        -- you can modify this however you want to shorten it, like how the game will do $75 and above
        G.GAME.current_round.dollars_to_be_earned = self.dollars > 0 and (string.rep(localize('$'), self.dollars)..'') or ('')
        G.HUD_blind:recalculate(false)
    end
    return ret
end```
#

For the blind selection screen:

function create_UIBox_blind_choice(type, run_info)
    local ret = ref_blind_choice(type, run_info)
    if G.GAME.selected_back_key == 'your_key' then
        local reward_node = ret.nodes[1].nodes[3].nodes[1].nodes[2].nodes[3]
        if reward_node then
            reward_node.nodes[2].config.text = string.rep(localize("$"), blind_choice.config.dollars * 5)..'+'
        end
    end
    return ret
end```
#

and then by changing G.GAME.blind.dollars in the first one, it should also cover the cash out

#

I think. this is kind of a quick thing that I didn't test but give it a whirl @brave blade

brave blade
#

Thanks for the help! I thought about it a little bit, and it might be more elegant and simple if I just add a row on the blind payout screen

sonic cedar
#

winter,,, how good is your info_queue knowledge,,,

chrome widget
sonic cedar
#

can you save me from this hell

#

trying to fix the scaling of the infoqueues to follow the ijiraq's effects instead of just not scaling

chrome widget
#

In what circumstance does the hover crash occur

sonic cedar
#

i give ijiraq at least 1 joker absorbed

#

in this case it has the effects of shoot the moon

#

i hover over it to view the shoot the moon effect (which does NOT scale ofc)

#

crash

chrome widget
#

Does it show shoot the moon in the infoqueue?

sonic cedar
#

i dont know

#

it crashes

chrome widget
#

I mean, is it intended to

sonic cedar
#

well yes it's intended to do that with each joker it absorbed

#

and before this infoqueue thing, the one i had before showed it fine
BUT it did not render the scaling or dynamic values properly

#

(think wee, stencil)

chrome widget
#

Okay I know why it occurs but I need to know what you're doing to cause it. Are you trying to call generate_uibox_ability_table from somewhere in your own code?

#

Additionally, if you can show the full crash log and where that function is called from, I can help you better

chrome widget
#

Show me your code

sonic cedar
sonic cedar
chrome widget
#

oh right this cool code thing I need to figure out how to do this

sonic cedar
sonic cedar
#

also noting that this is solely a ui thing, effects wise everything works perfectly

#

hi dilly

modern kindle
#

hi friends quick query how can i change a blinds background splash color easily?

ie in a specific blind during specific events the background changes

sonic cedar
modern kindle
#

from winters reaction i wonder if she has done it

sonic cedar
#

i think crisis?

chrome widget
#

specifically the function is ease_background_colour_blind()

sonic cedar
#

i get your reaction now

chrome widget
#

And then within, it's ease_background_colour()

#

So you can just use the latter one in your blind code or wherever probs

#

ease_background_colour{new_colour = lighten(mix_colours(boss_col, G.C.BLACK, 0.3), 0.1), special_colour = boss_col, contrast = 2}

#

This is the vanilla code for blind backgrounds

modern kindle
#

hmm, would i be able to just pass hex values to it you think

chrome widget
#

ye

modern kindle
#

awsum

chrome widget
#

I had to do a whole load of bullshit to get boss backgrounds to support gradients

#

Don't recommend

modern kindle
#

thats unfortunate because i want to also do that later

chrome widget
#

I'll just give you my code

#

Don't tear your hair out over it

sonic cedar
sonic cedar
wintry solar
#

they do have 3 colour values that you can change

chrome widget
#

Also yeah looking at it toma, it just looks like whatever you've got saved in G.GAME.hpfx_ijiraq_saved_values isn't correct

#

Since what you're doing is very similar to what vanilla does to create fake info_queue cards..... but whatever you're trying to set in ability is nil

sonic cedar
#

ah

#

and this ISNT a change card to self thing even though the function uses self is it

chrome widget
#

no I don't think so

sonic cedar
#

ok it crashed regardless before but i just wanted to make sure

#

i mean in terms of ability directly, maybe it's something here?

chrome widget
#

I mean that's setting the ability on the card itself

#

Im suggesting whatever you have stored in the G.GAME.hpfx_ijiraq_savedvalues table is itself bad data

#

Whatever this is, it's returning nil

sonic cedar
#

maybe it's the way the patch works?? though this is for the effects themselves

#

maybe if i remove the ability line?

iron burrow
#

balatro source code uses both "consumeables" and "consumables"

sonic cedar
#

thanks stephen

iron burrow
#

pretty insane if you ask me

daring fern
sonic cedar
#

what about changing that one specifically to k

daring fern
sonic cedar
#

last time i checked shoot the moon doesnt even have values that need storing

brave blade
#

I'm trying to do a lovely injection but it doesn't seem to be injecting, do I need to list it somewhere?

sonic cedar
chrome widget
#

Additionally, it can also fail if you're just patching the wrong file

brave blade
#

I have it in ModName/lovely/file_name.toml

daring fern
brave blade
#

Does this look right? This is my first time doing a lovely injection so it might just be completely wrong

sonic cedar
daring fern
brave blade
sonic cedar
brave blade
daring fern
#

Most lovely patches have a priority above -1 so you're doing it before any of the other ones are doing it.

brave blade
#

Hmm... the one I'm trying to patch is in G.FUNCS.evaluate_round()

daring fern
brave blade
#

Ohhhh wait a minute, does negative priority mean it patches first

#

I think I know where I went wrong

daring fern
rotund sable
#

Are you looking in lovely/dump ?

brave blade
#

No, where is that?

daring fern
chrome widget
#

In your mods folder, you have a lovely folder assuming it's installed correctly

#

"dump" is the dump of the actual patched files

#

Which are only valid at runtime

daring fern
# brave blade Yes

You shouldn't be looking at that unless you're looking at files that don't get patched.

brave blade
#

Oh, got it

sonic cedar
daring fern
sonic cedar
#

isn’t that here?

#

or do I have to put it again but with card, and in the joker instead?

daring fern
sonic cedar
daring fern
brave blade
sonic cedar
daring fern
brave blade
#

Oh, ok

median tinsel
#

im tryna get into modding and i have no lua experience, anyone got any resources other than the ones listed on modpage of smods

rotund sable
#

How would i update a UI lets say every 2 seconds?

#

so instead of updating it on a button press it updates every those 2 second

smoky maple
#

hello im trying to make my own balatro deck mod, can i get some help please?
i dont know anything about modding balatro
or code

smoky maple
rotund sable
#

can you click the link?

smoky maple
red flower
rotund sable
#

the UIBox config?

red flower
#

in the nodes

#

i actually dont know if a uibox can have a func

rotund sable
#

wait how would i do that? im looking through the docs on the smods wiki and testing but it seems that i dont understand you correctly

#

i mean there's func field in the config but that apparently is only called when drawn

red flower
#

{ n = G.UIT.C, config = { func = "my_func" } } and then use G.FUNCS.my_func(e)

#

i think being drawn refers to the draw function which is every frame

rotund sable
#

oh

long sun
#

how do you get a card's suit, again?

smoky maple
#

hey i got a error on balatro

long sun
#

looking for a way to count the number of distinct suits held in hand

rotund sable
#

what would i do without you N'

rotund sable
smoky maple
#

i mean appears this

slim ferry
#

deck creator like never gets updated i think so that could explain it

#

just some wierd bug if i had to guess

#

that never got fixed

smoky maple
#

ill try to delete it

vast bough
#

what is deck creator

slim ferry
#

it lets you create decks in-game

#

its really basic though

vast bough
#

that's fire I fuck with it

long sun
daring fern
long sun
#

cheers ^u^

smoky maple
slim ferry
#

you have no other mods though...

smoky maple
long sun
#

show the log now?

#

buh

slim ferry
#

just reinstall the game atp

long sun
#

try updating smods

slim ferry
#

or that ig

red flower
#

update balatro

#

you have an old version

smoky maple
red flower
#

yes

#

im going to give you the benefit of the doubt and just say to update it through steam

long sun
#

is there a context for after you've discarded, and have drawn your new cards?

long sun
#

aw

#

is there a combination of contexts for that?

daring fern
long sun
#

aw

daring fern
#

There is context.hand_drawn but that happens every time a hand is drawn.

long sun
#

mm, right

#

i could work with that?

#

with a flag that triggers when a card is discarded?

#

HEHE YOU LIE >:3 i will make this happen! >:3

#

/in reference to the "No."

#

/what about that doesn't make sense ;u; sob, anyway

long sun
#

exactly ^u^ thanks!!!

final jewel
#

what is the condition that I need to put in a can_use for it to return true only during a round

red flower
#

G.GAME.blind.in_blind?

brave blade
#

Is there normally a sound effect for cards being debuffed?

final jewel
long sun
#

got it to work!! thanks ^U^

brave blade
hallow slate
#

What's a good way to check which vouchers I have redeemed?

rotund sable
#

The keys of used vouchers will be there

#

What I mean by that is
if G.GAME.used_vouchers.v_overstock then would check if overstock is redeemed

final jewel
#

why when I capitalize the F for my consumable type it doesn't work in game but when its a small f it work

#

In the key I mean

rotund sable
#

Wdym by "doesn't work"

final jewel
#

like it doesnt show in the collection

final jewel
final jewel
red flower
final jewel
#

yeah why

red flower
#

it adds a food pool too

#

it might be the reason

final jewel
#

oh shit

red flower
#

objecttypes dont add the prefix like other stuff

final jewel
#

yeah

#

so I sould rename every key by 'food' its just uglier 😢

daring fern
final jewel
#

🤣

compact valve
long sun
#

quick question! how do i get the amount of money the player has?

#

oh i

#

rescind, Vagabond does it

#

^^; sorry

ivory citrus
#

how do I get my variable to add

rotund sable
#

Wtf is this function chain

ivory citrus
#

wait a minute i show the error menssage

rotund sable
rotund sable
ivory citrus
#

say something of the arimethic value

rotund sable
#

add a nil check

ivory citrus
#

where

rotund sable
#

or 0 inside those brackets

ivory citrus
rotund sable
#

Same error?

ivory citrus
#

where i put the nil check?

ivory citrus
rotund sable
#

multvar = (multvar or 0) + multvar

#

Or put the value in the config

ivory citrus
rotund sable
#

No

hardy ibex
#

What do you think of this?

rotund sable
ivory citrus
hardy ibex
#

Still thinking bout the effect tho

hardy ibex
ivory citrus
rotund sable
#

Like not scoring mult?

ivory citrus
#

i sorry, exactly

rotund sable
#

Did you use a consumable before scoring?

#

Because it technically starts at 0

ivory citrus
ivory citrus
rotund sable
#

I still don't know why you have that abomination of functions

rotund sable
ivory citrus
#

and it came out that

rotund sable
#

Good god I'm going to the dev

ivory citrus
rotund sable
#

Not your fault

rotund sable
ivory citrus
#

I don't know what I do

rotund sable
#

Ok so in the place where I told you to place a nil check you replace that line with

card.ability.extra.mult = card.ability.extra.mult + 4

And in the return you replace mult = ... with

mult = card.ability.extra.mult
ivory citrus
final jewel
#

you can try in 2 var like mult = 0 (thats) what it should be return for giving mult and mult_add = 4 thats waht is going to be add each time you change the suit of a card

and like when you change a suit
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_add

and when you give the mult
mult = card.ability.extra.mult

rotund sable
final jewel
#

Then in the loc_vars
loc_vars = function (self,info_queue,center)
return{vars = {center.ability.extra.mult_add, center.ability.extra.mult}}
end,

#

That the simple way that I use all time

ivory citrus
final jewel
#

did you add mult_add in the config extra

ivory citrus
#

My internet failed a few minutes

#

i'm back

final jewel
ivory citrus
final jewel
#

if context.joker_main and card.ability.extra.mult > 0 then
return {

            mult = card.ability.extra.mult,

        }
    end

use that for when you want to give mult

#

and make the next part to : Gives {C:mult}+#1#{} Mult for each

#

and change the 1 here to a 2

#

this part delete and just write : card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_add

#

not the last end

#

only the return

lament agate
#
    config = {
        extra = {
            slots_to_add = 5,
            ante_requirement = 1,
            ante_count = 0,
            activated = false
        }
    },
    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.extra.slots_to_add,
                card.ability.extra.ante_requirement,
                card.ability.extra.ante_count
            }
        }
    end,
    calculate = function(self, card, context)
        if G.GAME.blind.boss and context.end_of_round and context.game_over == false and context.main_eval then
            card.ability.extra.ante_count = card.ability.extra.ante_count + 1

            if card.ability.extra.ante_count >= card.ability.extra.ante_requirement then
                card.ability.extra.activated = true
                G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.slots_to_add

                card:juice_up(0.8, 0.8)
                play_sound('chips1', 1.4)
                return {
                    message = localize { type = 'variable', key = 'a_joker_slots', vars = { card.ability.extra.slots_to_add } },
                    colour = G.C.BLUE
                }
            else
                card:juice_up(0.2, 0.2)
            end
        end
    end,
    add_to_deck = function(self, card, from_debuff)
        if card.ability.extra.activated then
            G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.slots_to_add
        end
    end,
    remove_from_deck = function(self, card, from_debuff)
        if card.ability.extra.activated then
            G.jokers.config.card_limit = G.jokers.config.card_limit - card.ability.extra.slots_to_add
        end
    end
}
#

why isnt this working

#

goal: +5 Joker slots once you passed 1 Ante

daring fern
lament agate
#

shit

#

what do then

ivory citrus
#

still does not work

final jewel
daring fern
ivory citrus
#

Sorry for the mayus

final jewel
lament agate
final jewel
#

this line

ivory citrus
#

no

final jewel
#

change it

#

and change the part where you give the mult to that instead
if context.joker_main and card.ability.extra.mult > 0 then
return {
card = card,
mult_mod = card.ability.extra.mult,
message = '+' .. card.ability.extra.mult,
colour = G.C.MULT
}
end

lament agate
#

try using ```lua when typing a code

#

easier readability

#
if context.bruh then
  return {
      your_ass = true
  }
end
arctic mason
#

Hi everyone! ill be jumping in for some help if anyone could be so kind.

lament agate
#

we're always here

#

not me tho

#

im a beginner

ivory citrus
arctic mason
#

same. first time

ivory citrus
#

i wanna send this image

#

is the same error

final jewel
#

and your config should be like that

#

my bad it was the big issue I think

ivory citrus
#

Sorry

final jewel
#

revome that

final jewel
arctic mason
#

You are good at that.

maiden phoenix
#

Me when I recreate Cryptid's forcetrigger

final jewel
maiden phoenix
final jewel
#

yeah

ivory citrus
arctic mason
#

yeah, the artwork is awesome!

#

did you do that?

ivory citrus
maiden phoenix
#

I didn't make the game if that's the question

final jewel
ivory citrus
#

Now the error is here, but i dont understand why is an error

arctic mason
#

does anybody mind if i jump in for a hot minute? also?

final jewel
#

less complicated

ivory citrus
#

ok

final jewel
#

yeah

ivory citrus
final jewel
#

should work

arctic mason
# maiden phoenix https://dontasktoask.com/

i like the invitation. thanks. so i have the following:

            "{C:green}#1# in number of scoring 7's{} chance to",
            "{C:attention}Retrigger{} each scoring {C:attention}7's{}",
            "Quantum 7 Dice"
        },
#

also,

    calculate = function(self, card, context)
        if context.repetition and context.cardarea == G.play then
            if context.other_card:get_id() == 7 or then
                return {
                    repetitions = card.ability.extra.repetitions
                }
            end
        end
    end
}
maiden phoenix
#

Are you showcasing it or you have an issue with it?

arctic mason
#

i have an issue. im not sure how to count the scoring 7's for the chance to retrigger

lament agate
#

whats the fix for loc vars showing +nil or Xnil again

#

this should work

#

right?

maiden phoenix
#

Maybe this will work? Above your if context.repetition line

if context.cardarea == G.jokers and context.before and context.scoring_hand and not context.blueprint then
    card.ability.extra.sevens = 0
  for k, v in ipairs(context.scoring_hand) do
      if v:get_id() == 7 then
          card.ability.extra.sevens = card.ability.extra.sevens + 1
      end
  end
end
daring fern
#

How does one change the text of a UIBox_button every frame?

arctic mason
#

Edit:

SMODS.Joker{
    key = '7 Sided Dice', 
    loc_txt = { 
        name = '7 Sided Dice',
        text = {
            "{C:green}#1# in number of scoring 7's{} chance to",
            "{C:attention}Retrigger{} each scoring {C:attention}7's{}",
        },
    },
    atlas = 'Jokers', 
    rarity = 3,                         
    cost = 10,                                      
    unlocked = true,                               
    discovered = true,                              
    blueprint_compat = true,                        
    eternal_compat = false,                         
    perishable_compat = false,                      
    pos = {x = 0, y = 0},                          
    config = { extra = {
         repetitions = ,odds = 4 
        } },

    calculate = function(self, card, context)
        if context.repetition and context.cardarea == G.play then
            if context.other_card:get_id() == 7 then
                return {
                    repetitions = card.ability.extra.repetitions
                }
            end
        end
    end
}
maiden phoenix
lament agate
# maiden phoenix Are you returning your vars? Show more of the code
    config = { extra = {
        base_mult = 1,       
        base_xmult = 1,      
        heart_mult = 2,      
        face_xmult = 0.2     
    }},
    loc_vars = function(self, info_queue, card)
        return { vars = {
            card.ability.extra.heart_mult,
            card.ability.extra.face_xmult,
            card.ability.extra.mult_per_heart or 1,
            card.ability.extra.xmult_face_bonus or 1,
            localize('Hearts', 'suits_singular')
        },
    }
    end,
#

ignore the or for now

#

wait

#

im so dumb

#

thank you

maiden phoenix
#

I don't even need to do anything I'm just that good 😎

lament agate
#

alright bro

arctic mason
#

also, how did the code snippet become color embedded? howd you do that?

maiden phoenix
modern kindle
#

add lua after the

#

yea

arctic mason
#

Ah! legend

ivory citrus
arctic mason
#

how do i count how many 7's are played and scoring?

maiden phoenix
#

Oops forgot an end

#

Anyway I'm off for today 👋

arctic mason
#

does anybody know if all of the following hands are correct?:

type = 'High Card'
type = 'Pair'
type = 'Three of a Kind'
type = 'Four of a Kind'
type = 'Five of a Kind'
type = 'Five Flush'
#

is high card even a type?

red river
#

it's flush five instead of five flush

#

or is it different internally somehow

#

high card seems correct

arctic mason
#

im not sure. but im trying to either check if the hand played are the above or just count how many scoring 7's there are

#

well, played hand and scoring 7

red river
#

does scoring non-7s count?

#

as in, does it not interrupt the intended function when non-7s get scored alongside 7s

arctic mason
#

Played*

red river
#

i'd suggest to find a different way of counting 7s then. there may be cases when 7s get played in a flush with non-7s, for example

arctic mason
#

you, my guy, are right. didnt even think of that

lament agate
#

how do you set a joker sell value

daring fern
lament agate
near heart
#

somethingcom515 {seals on every} are you in this chat every minute of every day

lament agate
#

yes

arctic mason
#
 cost = 10, 
#

?

lament agate
#
local cost_dt = 0
local oldgameupdate = Game.update
function Game:update(dt)
    local g = oldgameupdate(self, dt)
    if G.shop and G.jokers and next(SMODS.find_card("j_tngt_dealmaker")) then
        cost_dt = cost_dt + dt
        if cost_dt > 0.2 then 
            cost_dt = cost_dt - 0.2
            for i, v in ipairs({G.shop_jokers, G.shop_vouchers, G.shop_booster}) do
                for ii, vv in ipairs(v.cards) do
                    vv:set_cost()
                end
            end
        end
    end
    return g
end
daring fern
lament agate
#

something, which value is the speed value one

#

like

#

the time of the update

#

LIKE

#

hold on

#

its connected to a hook for dealmaker, which changes the shop pricing right

#

and it updates realtime using the game:update hook

#

but its really quick

#

i want to make one thats a bit long

daring fern
lament agate
daring fern
lament agate
#

alright thanks alot

#

how do i affect the natural edition rate for a certain joker

sleek nova
#

(posting this again)
Is there a way so i can disable the negative filter on a joker? i have one that can only spawn negative

#

with filter i mean like the shader effect

daring fern
near heart
#

probably to make it more or less likely for a joker to be able to naturally appear with an edition

lament agate
daring fern
sleek nova
#

how

daring fern
lament agate
#

i see

daring fern
final jewel
near heart
#

how can i get a joker to cause a hand to not score? i tried this based on some of the code in the boss blinds and it technically works, just acts a little strange. i tried adding some extra contexts so that it didnt act strangely but that caused it not work at all.

red flower
#

hi dilly

modern kindle
#

hii

lament agate
#
local old_set_cost = Card.set_cost
function Card:set_cost()
    old_set_cost(self)
    if self.config.center and self.config.center.key == "j_tngt_stonks" then
        SMODS.Joker("stonks").set_cost(nil, self)
    end
end
#

is this right

red flower
#

no

lament agate
#

shit

red flower
#

what are you trying to do

lament agate
#

what did i do wrong

lament agate
#

like selling the joker

near heart
# red flower how did it act strange

its doing the message popup (the 'Try Again!') every time i select or deselect a card instead of when its intended to (when you submit the hand)

red flower
red flower
near heart
#

k will try

lament agate
red flower
#

yes but you might need a min and max values too

lament agate
#

so

#

'seed', 1, 10

#

?

red flower
#

yeah

lament agate
#

aight

#

i swear to god i added smods to my workspace, why does it still gives out yellow underline

red flower
#

this will randomize it every time you call set_cost tho so it might be weird

lament agate
red flower
lament agate
#

wiki shill

#

finally

documentations

#

this is the update hook btw, is it wrong

#
local volatile_update_dt = 0
local old_game_update = Game.update
function Game:update(dt)
    local result = old_game_update(self, dt)
    
    if G.jokers and next(SMODS.find_card("j_tngt_stonks")) then
        volatile_update_dt = volatile_update_dt + dt
        if volatile_update_dt > 0.3 then
            volatile_update_dt = 0
            for _, joker in ipairs(G.jokers.cards) do
                if joker.config.center.key == "j_tngt_stonks" then
                    local config = joker.ability.extra
                    local direction = math.random() > 0.5 and 1 or -1
                    local change = direction * config.change_rate
                    config.current_value = math.min(
                        math.max(
                            config.current_value + change,
                            config.min_value
                        ),
                        config.max_value
                    )
                    joker:set_cost()
                    if math.abs(change) > 0 then
                        joker:juice_up(0.2, 0.2)
                    end
                end
            end
        end
    end
    
    return result
end
red flower
#

wait

#

what's the goal

lament agate
#

it randomizes its sell value

red flower
#

to update all prices?

lament agate
#

just the joker itself

red flower
#

ah ok then why are you hooking update

#

jokers have an update function

lament agate
#

oh really?

red flower
#

yes

lament agate
#

i thought it doesnt update the price in real time

#

so i put the update hook

lament agate
red flower
#

it doesn't, you need to do that but not with a hook

lament agate
#

oh

#

damn

red flower
#

just put the hook stuff into the joker's update function

lament agate
#

the cost hook?

red flower
#

no, the update hook

but are you sure this is only for that joker? the code looks like its updating all of them

lament agate
#

oh shit really

#

wait

red flower
#

oh wait no, i didnt see the key line

lament agate
#

br

red flower
#

SMODS.find_card already gives you a list of the cards owned tho

rapid stag
#

i know i can do {C:diamonds} for the suit colour, but this is always the LC colour. how do i do the HC colour? cirThink

lament agate
#

vair

#

fair*

lament agate
#

i learned it the hard way

rapid stag
#

what if i specifically want the HC colour though cirBox

lament agate
#

i could NOT get contrast specific joker working at all

red flower
#

you would need to make your own loc_colour that references the HC colour

misty radish
#

Help
Please

rapid stag
#

yeah, i have a loc_colour hook, but i was wondering if there was just a colour string i could specify that i wasn't thinking of - i guess i'll adjust my hook, then wait, i don't need to adjust my hook at all, i have a system for just adding whatever colours i want cirDerp that's what the hook does in the first place

red flower
#

there is but it has a weird name

#

something something S_0

sleek nova
#

how can i stop something from happening completly

red flower
rapid stag
#

my tried and true method of stopping anything from happening at all is alt + f4 cirYay

red flower
#

you cant use that to stop global warming tho

ivory citrus
sleek nova
red flower
#

you can hook the function somethingcom said and then if it's not you joker you return the original function and if it is you do nothing

rapid stag
lament agate
#

@daring fern @red flower it worked, thanks

sleek nova
rapid stag
#

remind me what the function was to make a string lowercase again cirDerp

final jewel
#

How do I make the game restard when I reset something in the config

pure salmon
#

trying to make a joker that makes arcanas give an extra choice, but i can't find where the game calls the config.extra value of a booster and creates that many cards

candid prism
#

i wish i could code i have so many ideas but everytime i try to learn lua im stuck staring at my screen like "what the factorial"

red flower
daring fern
subtle merlin
#

2 questions:

1: How can i make a joker retrigger itself?

2: Is there a way to check if a variable is greater than 0 in a return?

modern kindle
#

hey fellas im drawin a blank how can i use debugplus to set myself at a specific ante

short girder
#

how do i make a card (a consumable, a joker) to only be available if the user has a certain mod?

short girder
modern kindle
#

holy shit is that john debug

rough furnace
short girder
#

well too slow i guess

rough furnace
#

ante set # in the console should work

#

where # is the nmbver

modern kindle
#

thankies bestie

#

it did work

subtle merlin
rough furnace
#

if it's your return you just check the number

#

before you return it

daring fern
rough furnace
#

use variables

#
local xmult = card.ability.extra.xmult
if xmult == 0 then xmult = nil end
-- etc.
return {
  xmult = xmult,
  -- etc.
}
#

or well i guess that one doesn't hit 0

#

but you get the idea

subtle merlin
rapid stag
subtle merlin
short girder
rough furnace
#

you can check if a mod exists with lua if next(SMODS.find_mod("modID")) then -- Add content here end

oblique lotus
#

I want to make an API mod that adds "equipables" to Balatro. These would be items that you can add to Jokers that either serve their own function or do something relating to the Joker they are on top of. Ideally, you would also be able to customize them so that the same item can do something different depending on the data given on its creation. I included a mock-up of what one such item could look like. Would anyone be up to help me with this?

rough furnace
#

SMODS.DrawStep would likely be nessicary

#

or at least useful

oblique lotus
#

Gotcha, will look into it

brave blade
short girder
brave blade
#

Managing giant cards is a really big pain when you have a lot of jokers (like Huge from cryptid)

daring fern
short girder
#

okay!

lament agate
#

hello im home

oblique lotus
sonic cedar
#

hi nxkoo

lament agate
#

haaii

rough furnace
#

I mean hats would just be like offset stickers

subtle merlin
rough furnace
#

if I did some vc streaming would any of yall want to watch?

#

probably no mic

sonic cedar
rough furnace
#

smods discord has one

sonic cedar
#

im not doin much rn except modding so sure why not

daring fern
oblique lotus
# rough furnace I mean hats would just be like offset stickers

I agree, but the reason I decided I wanted to pursue this is because of what stickers can't do. Stickers are suppose to be general abilities that will work regardless of the Joker they are placed on. I want to these to be able to store individual variables and function differently depending on how they were created and what they are placed on. For example, for the mod I am working on I wanted to store a specific Joker in a sticker that it would transform into. This isn't possible with stickers as far as I am aware.

sonic cedar
rough furnace
oblique lotus
#

Gotcha

sonic cedar
sonic cedar
rough furnace
#

the card is nil

#

oh wait

#

no the ability is

sonic cedar
#

yes

#

that's been the

rough furnace
#

sned stack trace

sonic cedar
#

this was supposed to be the fix to exactly that lmao

sonic cedar
sonic cedar
rough furnace
#

and what does Lua method 'loc_vars' at file 'Ijiraq/Jokers/Ijiraq.lua:23' loo klike?

rough furnace
#

can I see your lovely dump of card.lua?

sonic cedar
#

just the crash

rough furnace
#

just card.lua

sonic cedar
#

like the whole file?

rough furnace
#

yeah

sonic cedar
rough furnace
#

ok so the saved valu isn;t anything

#

why store it on a global table and not just the card itself

rough furnace
#

yeah like why the G.GAME.hpfx_ijiraq_savedvalues wit the cards sort id instead of just putting it in the cards ability table

sonic cedar
rough furnace
#

what is your goal?

sonic cedar
#

you know how stuff like stencil and wee dont track properly?

rough furnace
#

no

sonic cedar
#

in infoqueues

rough furnace
#

no

sonic cedar
#

fym no

rough furnace
#

I dont't know what you mean

sonic cedar
#

stuff like this

#

or how the Currently +0 in wee will stay +0

rough furnace
#

how are you specvifying ythe info qwueu?

sonic cedar
#

are you good 😭

#

currently it's this

#

which doesnt work

daring fern
sonic cedar
rough furnace
#

sorry I don't understand this code well enough to be much help

sonic cedar
daring fern
sonic cedar
#

i should be sending the full log atp

daring fern
rough furnace
#

Assuming the dump is unchanged from earlier

daring fern
# sonic cedar

Replace old_center_key with last and put last = k at the end of the for loop.

daring fern
sonic cedar
#

NEW CRASH 🎊

daring fern
# sonic cedar

You need to do config = {center = G.P_CENTERS[v]}} in the fake card.

sonic cedar
#

current config in the joker

daring fern
sonic cedar
#

DRINKS ARE ON ME

#

...i need to test a dynamic one still...

sturdy compass
#

will hyperfixation actually release

sonic cedar
unborn bay
#

will hyperfixation actually release

sonic cedar
#

ok little guy
i need you to get in that guy's mouth
and scale his chips
can you do that

sonic cedar
modern kindle
#

I take a bite

sturdy compass
sonic cedar
#

thank you

sturdy compass
sonic cedar
#

NOW I NEED A 2

#

I AM OUT OF DISCARDS WAIT

#

i now have a 2

sturdy compass
#

Do
Do you not use debugplus

sonic cedar
#

no i do i had to add 1 lmao

#

it took me all of my other ones to get a single 2 before

sturdy compass
#

lol

sonic cedar
#

YEAAAAAAAAAAAAAAAAAAAA-

modern kindle
#

Hell yea

sonic cedar
#

does that say 16

modern kindle
#

Yes

sonic cedar
#

that's right.... the double trigger.....

#

i am plagued forevermore

sturdy compass
#

death

sonic cedar
#

there's no squareroot fixing this one

modern kindle
#

Sure there is

sonic cedar
modern kindle
#

Sure there is

sturdy compass
#

You're gonna make her snap 😭

modern kindle
#

I regularly deal psychic damage to toma

sonic cedar
#

he's worse than nxkoo fun fact

modern kindle
#

Im just a silly guy

sonic cedar
#

i will skin you

modern kindle
#

Bit rude innit

sonic cedar
#

what could possibl

#

cause

#

a double trigger

#

this consistent

sturdy compass
#

Does Shoot the Moon double trigger

sonic cedar
#

im talking about ijiraq himself

sturdy compass
#

I know, I meant the effect the Ijiraq ate

modern kindle
#

Shoot the moon does not

sonic cedar
modern kindle
#

Just triggers on queens in hand

sonic cedar
#

im OUT of QUEENs

modern kindle
#

Ye but I was answering

sturdy compass
#

wdym you're right here

sonic cedar
#

oh my goodnesskflnmmkhm

sturdy compass
#

lol

sonic cedar
#

size bug is still here btw

sturdy compass
#

WEEEEEEEEE

modern kindle
#

Size good

#

I like this one better

sonic cedar
#

i dont

#

it means the half joker one still exists

modern kindle
#

Yea because you haven't fweaking showered so ur ideas SMELL

#

Small joker peam..

sonic cedar
#

hop OFF

modern kindle
#

Tell it to the judge he said you didnt pass the test

sonic cedar
sturdy compass
#

wack

sonic cedar
#

is it literally just his scaling

#

oh my god wait

#

that's the link

#

all of my scaling

#

it's all

#

scaling

#

it's not that effects trigger twice

#

it's solely

#

scaling

#

that triggers twice

sturdy compass
#

weird

sonic cedar
#

the crashout

#

imminent

#

ok fine it's cute

modern kindle
#

Is that the one jiren guy from that one show

brave blade
#

Why is this not changing queens in my deck to Jacks?

daring fern
sonic cedar
daring fern
sonic cedar
#

WHY DID HW TRIGGER TWICE

#

JUDAS

brave blade
daring fern
# sonic cedar JUDAS

Remove the table.insert(extra_jokers_list, 1, card.config.center.key) and add: lua if jokers then table.insert(jokers_table, 1, jokers) end Outside and after the for loop.

sonic cedar