#💻・modding-dev

1 messages · Page 80 of 1

limpid wing
hallow forge
#

fair

limpid wing
#

how i can put the blind score scaling of gold stake?

loud citrus
#

i think challenger deep can help with that

hallow forge
#

set teh stake to gold stake as part of the challenge

limpid wing
wintry solar
#

I imagine you can set G.GAME.modifiers.scaling to 3 in your apply function

limpid wing
#

i will do it rn

limpid wing
hardy viper
#

luals with the love and nativefs extensions for luals

#

thats what i use

#

oh wait

#

theres no nativefs addon

#

what am i on about

tepid crow
#

config stuff in steamodded (since I cannot find any documentation on it):

Create a config.lua file in the top level directory of your mod. It can look as simple as:

return {
  setting = true,
  multivalue = 5
}

This file will be the "default" settings for anyone first installing your mod.

Steamodded will then automatically copy your default config to %AppData%/Balatro/config/[your mod id].jkr when any setting is changed from the defaults.
You don't need to worry about/deal with saving to or loading from this file, just thought I'd document it.

Now you need to give the user the ability to manipulate their config. The easiest way and most conventional way is to do so by using SMODS.current_mod.config_tab:

local your_mod = SMODS.current_mod

SMODS.current_mod.config_tab = function()
  -- lots of UI stuff - you might want to check other mods for more elaborate examples
  return {n=G.UIT.ROOT, config = {align = "cm", padding = 0.05, r = 0.1, colour = G.C.BLACK}, nodes = {
    create_toggle{ 
      -- making use of the base game function create_toggle by Thunk - look at its sourcecode to see the customization options
      label = "label", 
      w = 0,  -- hacky hack to force toggle to center when label length is less than 3
      ref_table = your_mod.config, 
      ref_value = "setting" 
    },
    create_option_cycle{
      -- or use create_option_cycle for cycles - again, see sourcecode for extensive customization, and other mods for examples
      label = "label2", 
      ref_table = your_mod.config, 
      ref_value = "multivalue",
      opt_callback = function()
        -- you will need to define this function otherwise the value will not be saved, see e.g.  https://github.com/Eremel/Galdur/blob/master/galdur.lua#L808
      end
    }
  }}
end

Finally, if you want to read from the config, it's as simple as:

if your_mod.config["setting"] or your_mod.config["multivalue"] > 3 then
  ...
end
#

All that should result in something like this:

gilded narwhal
#

What do you guys like better?

24 hands and 24 discards, hands and discards don't get reset at end of round
OR
6 hands and 6 discards, hands and discards get reset at end of ante

tepid crow
#

what is this for? a joker? a deck? a challenge?

gilded narwhal
#

Deck

#

Shoulda said that 😭

brisk rose
#

So the second one

gilded narwhal
#

Gotcha

opal spade
#

what about combining them

#

24 hands 24 discards
reset after beating a showdown blind

gilded narwhal
#

I still think the second one better

#

Feels more balanced

tepid crow
#

I also like the second more I think

tranquil gull
#

is rthethere a way to just. draw text on screen. at all times

#

or like can i hoodk into love.draw in any way

brisk rose
#

I mean you can just... use love functions. Idk if it'll work right at all times I guess

tranquil gull
#

okayyy so i need to traverse the ui tree to find a specific button

#

so i can call a function to simulate clicking that button

#

how would i access said ui tree

#

(i need specifically the Select Blind button)

#

(and the Skip Blind button but that's for later)

#
G.blind_select.UIRoot.children[1].children[1].config.object:get_UIE_by_ID('select_blind_button')

ah here we go (?)

topaz sun
#

Is there a way to have a joker loaded but not show up in the collection page?

brisk rose
#

Probably, but I'm kinda curious of the purpose

loud citrus
#

does anyone know how to do this? or is there a mod i can take example from

topaz sun
brisk rose
#

How do you apply a specific shader to a joker by default?

#

(To whoever knows)

brisk rose
#

You could just have them locked/undiscovered by default and handle the pool seperately

#

I think the benefit to it still being in the collection is once people do manage to get it, they can look back at what it does later

#

And idk if people don't wanna play along and unlock them manually that's their prerogative. Still won't mean it actually spawns

silent pawn
topaz sun
#

It's just a "better" version of a joker in the mod with similar sprite that you can only get from using a particular deck and sleeve combo

brisk rose
#

Yeah I figured it was something like that

topaz sun
#

That's why I wanted to hide it, to not have two similar sprites in the collection. But makes sense that people would want to look back at them to see the desc text

brisk rose
#

Maybe figure out the clicking thing that tarots dx does?

#

Though I don't think it's really nessacary

topaz sun
#

Thanks!

brisk rose
#

Np :3

#

Oh I also noticed the legendary in the pack seems to say 'not yet made' in the description, effect though it spawns

#

If I'm thinkinh of the right pack

#

In yours I mean

topaz sun
brisk rose
#

Oh I see

#

Nvm

#

Is it the inactive color? If so I just brainfarted

brisk rose
topaz sun
#

Yeah lol. Nah, I actually think it's maybe a little ambiguous

brisk rose
#

Inactive and in parenthesis right below the line is referring to is standard formatting

#

So if it's that it's on me

topaz sun
#

But yes, it's the inactive text. It's supposed to say "already created" when it does create the joker, to let you know it won't create any more jokers

brisk rose
#

Yeah I understand the purpose now

#

I thought it was like dev text for some reason, lol

#

But that's perfectly in line with how joker descriptions work

topaz sun
#

lol I mean, it's a little unorthodox. But it works

brisk rose
#

It works exactly like dozens of other joker descriptions. I should really know this playing when over 1200 jokers, lmfao

#

But my brain did a thing I guess

topaz sun
#

Happens to the best of us

brisk rose
#

Unless the exporter just strips it. Maybe a line break between the two effects would help for clarity

#

And maybe 'not yet created' should be in an extra pair of parathesis

#

To group it as kinda a subclause

timid parrot
#

once it's created

brisk rose
#

Oh good idea

silent pawn
#

do stone cards have a context.other_card:get_id()

timid parrot
#

given "must have room" is kinda redundant when the ability's no longer gonna work

silent pawn
#

whats the id for them

hallow forge
#

-1000000 to -10

#

it's random

silent pawn
#

why is it like that 😭

timid parrot
#

I take it that's so that the stone cards get sorted in a random order?

hallow forge
#

it's so they don't count as thier own rank

timid parrot
#

and always before the other cards

#

ah that too

silent pawn
#

but why is it random in such a large range

timid parrot
#

sorting I'd assume

silent pawn
#

yea

#

i mean it makes sense why stone cards always draw to the very right now

#

xd

brisk rose
hallow forge
timid parrot
#

stone cards do have a preferred order when you have a lot of them. Even if you rearrange them, sorting them will snap them back to their original positions

topaz sun
brisk rose
topaz sun
#

Next update it'll be fixed

timid parrot
silent pawn
hallow forge
#

yes

#

probably

silent pawn
#

didnt know that thats kind of funny

#

are stone cards the only cards with a negative id

hybrid iris
#

is it possible to change the description of playing cards when you hover over them?

#

im, making a card that would make the chips given by cards random and i want to do a misprint description on the cards whenever i have that joker

brisk rose
#

Pretty sure you can take ownership of any thing to change its loc text. Or do something more elegant I'd be unlikely to gravitate towards if I were to finally code a mod

hybrid iris
#

ill,, just look into that later sjdhsdjh

orchid thunder
#

But yeah is there any way to delete the blind circle

hallow forge
#

yes

silent pawn
#

am i right in saying xchips isnt implemented into steamodded by default

#

i cant get it to work in the slightest

hallow forge
#

yes

silent pawn
#

thats so annoying

hallow forge
#

y do u need XChips anyway?

brisk rose
#

It must be easy to implement, like 5 people have done it

#

All probably copying talisman for compat. Because I've had no issues mixing different implementations

hallow forge
#

more than 5 people have become quantum physicists

#

must be even easier

silent pawn
#

😭

#

someone remind me to become a quantum physicist once i get xchips working

topaz sun
orchid thunder
hallow forge
#

don't know off the top of my head

rough furnace
#

I belive talisman implements it if you want to depend on it

orchid thunder
#

Hmm ok

hallow forge
orchid thunder
#

Yeah I understood that

topaz sun
# silent pawn 😭

You can inject the xchips code in these two blocks of code in the state_events.lua file from the base game. Just follow the same syntax and add a prefix before the xchips thing

orchid thunder
#

Wait is Xchips not in base game at all?

hallow forge
#

it's not

topaz sun
#

like if effect.pfx_Xchips_mod then mult = mod_mult(hand_chips*effect.pfx_Xchips_mod);extras.hand_chips = true end

basically just copy the Xmult and change Xmult to Xchips and mult to hand_chips

topaz sun
silent pawn
#

yea

#

i just wanna use xchips for aesthetic reasons

topaz sun
#

i get it

silent pawn
#

such a hassle

topaz sun
#

I used it for the same reasons

silent pawn
#

is there no way i can individually just multiply the chips amount for one specfic joker or do i have to fully implement it

#

cus its so much work to use it for one joker 😭

topaz sun
silent pawn
#

is it possible to declare multiple atlases in the same script

#

my game shits bricks when i try

brisk rose
#

Can we see your code?

silent pawn
#

sure thing

#

all i want to do is add an icon damn it

#

the crash specifically complains about line 28 which is so random

#

my brain is gonna explode its 6am

brisk rose
#

I think you need register {} or similar after each atlas definition

#

Look at how pokermon does it

silent pawn
#

does that include SMODS.Joker

brisk rose
silent pawn
#

like this yea?

brisk rose
#

But yes do exist

brisk rose
brisk rose
silent pawn
#

still throwing out this error

#

INFO - [G] 2024-10-23 06:00:03 :: ERROR :: StackTrace :: Oops! The game crashed
[SMODS _ "core/game_object.lua"]:28: Missing required parameter for Atlas declaration: py
Stack Traceback

#

):<

#

WAIT

#

i hate my life

#

i put py instead of px

#

or rather

#

px instead of py

#

😭

silent pawn
brisk rose
#

Lol very easy to do

silent pawn
brisk rose
#

Catter :3

tepid sky
#

Ngl, i might mess with the texture changing

#

Sometime

silent pawn
#

😮‍💨

tepid sky
#

Wow

#

Looks marble or sand(y)

silent pawn
#

yeah its marble

tepid sky
#

Nice

silent pawn
#

how do i refer to the cards in the played hand

#

i thought it was context.played but doesnt seem to work

opal spade
#

G.play.cards

vagrant moth
#

Modding help: How do I check if a card in my played hand has a specific Enhancement?

silent pawn
vagrant moth
#

It's for this card:
Library Card (uncommon joker)
Gains X0.1 Mult if played hand contains a Flush and a Wild Card

frosty dock
# silent pawn ty

or context_full_hand (which is the same) and context.scoring_hand (which is scored cards only)

loud citrus
shell timber
silent pawn
#

is context.scoring_hand:get_id() == the correct way to search for a specific card id out of scoring cards

vagrant moth
#

But good idea

brisk rose
#

that;s what I come up with trying to read the code

vagrant moth
#

👍

brisk rose
loud citrus
#

strange question, if i remove card from card.ability does it become global across all values that use it?
i'm trying to make an enchantment ability that stacks, for each of this enchantment that's discarded next played hand get's plus 20 chips. i'm using the extra value so if you exit the game doesn't forget.

brisk rose
vagrant moth
#
if context.joker_main and next(context.poker_hands['High Card']) and not context.blueprint then
        mult_mod = card.ability.extra.mult,
        message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
end```
#

Does this wording work?

#

Sword Swallower (common)
+4 Mult if played hand is exactly a High Card. If it's the first High Card this round, +1 Hand.

#

I would also like to ask about how I can add a "once per round" counter to a Joker that resets after each Blind.

#

Thanks!

silent pawn
#

you can probably use a boolean that sets to true when you trigger the joker, and reset it back to false once the blind ends

vagrant moth
#

That's the plan, though I have no idea how to do that

loud citrus
#

very cool :)

vagrant moth
#
SMODS.Joker {
  key = 'swordSwallower',
  loc_txt = {
    name = 'Sword Swallower',
    text = {
      "+4 {C:mult}+#1#{} Mult if played hand is,",
      "{C:attention}exactly{} a {C:attention}High Card{}",
      "If it's the first {C:attention}High Card{}",
      "this round, {C:chips}+1{} Hand"
    }
  },
  config = { extra = { mult = 4, swallowed = false } },
  rarity = 1,
  atlas = 'MASS',
  pos = { x = 1, y = 0 },
  cost = 4,
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.mult, card.ability.extra.mult_gain } }
  end,
  calculate = function(self, card, context)
    if context.joker_main and next(context.poker_hands['High Card']) and not context.blueprint then
        mult_mod = card.ability.extra.mult,
        message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
        if swallowed == false then
            ease_hands_played(1),
            swallowed = true
        end
    end
    if context.setting_blind and not (context.blueprint_card or card).getting_sliced then
        swallowed = false
    end
  end
}```
Here's the tentative code for Sword Swallower
loud citrus
vagrant moth
#

👍

#

Seems to be it, thanks!

loud citrus
#

🎉

loud citrus
#

YES I DID IT AND I FEEL LIKE A GENIUS

vagrant moth
#

Any idea how to fix this?

frosty dock
#

not without your code, you just have a syntax error somewhere

frosty dock
vagrant moth
#

thanks!

loud citrus
#

so right now i don't know how to add the chips the throwing card yields, i don't even know if i can just simply put context.before becuase i think it's expecting my enchantment to be involved

silent pawn
#

whats the context for checking ids of scoring cards

#

my brain is going to explode

vagrant moth
#
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }```
Which "=" has the problem?
silent pawn
#

show the whole area of code

#

like the surrounding maybe 3-4 lines either side

vagrant moth
vagrant moth
# silent pawn like the surrounding maybe 3-4 lines either side
  calculate = function(self, card, context)
    if context.joker_main and next(context.poker_hands['High Card']) and not context.blueprint then
        mult_mod = card.ability.extra.mult,
        message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
        if G.GAME.current_round.hands_played == 0 then
            ease_hands_played(1)
        end
    end
  end```
silent pawn
#

what exactly does other_card refer to

silent pawn
#

but i think discord is maybe formatting it funny

vagrant moth
brisk rose
#

so it's irrelevent besides for readability

wintry solar
silent pawn
#

idk why it indented like that

vagrant moth
#

if context.individual and context.cardarea == G.play then
is fine too, straight off of the example code for Walkie Talkie 2

brisk rose
#

all the same to luajit

silent pawn
#

but if i try and use only context.other_card:get_id() then it crashes when i play/discard

wintry solar
#

Joker_main doesn’t use other_card

silent pawn
#

oh shit incredibly useful

#

thanks

#

got it to work

#

:D

vagrant moth
#

The "if combo == 3" isn't working, even though I am playing three or more cards that meet the condition.

calculate = function(self, card, context)
local combo = 0
    if context.individual and context.cardarea == G.play then
      if context.other_card:get_id() == 3 or context.other_card:get_id() == 6 or context.other_card:get_id() == 9 or context.other_card:get_id() == 12 then

        combo = combo + 1
        if combo == 3 then
            card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
            return {
                message = 'Upgraded!',
                colour = G.C.RED,
                card = card
            }
        end
        return {
          chips = card.ability.extra.chips,
          mult = card.ability.extra.mult,
          card = context.other_card
        }
      end
      end
end
tepid crow
#

Combo gets reset on every call to the function

vagrant moth
#

Nooooooooooo...

silent pawn
#

why does it not display the message?

vagrant moth
#

Made the combo thing work, but how do I make the first return table not "eat" the second one?

brisk rose
#

returning ends a function I think, not just a loop or if statement

#

so i'm not sure the second one is even seen

#

might be mistaken though

vagrant moth
#

Thought so. How do I put two "messages" in one return table?

#

Like, I want to put a copy of the second one in the first.

brisk rose
#

not sure, gonna have to wait for someone who isn't just talking out of their ass like me and actually codes, lol

frosty dock
vagrant moth
#

Tinkered with eval_this and it works! Thanks!

tepid crow
#

btw @wintry solar, I was just thinking, would it be nice if the cycle_update func was always defined?
aka integrated into steamodded, there's even existing code in steamodded that I think would be able to use it

G.FUNCS.cycle_update = function(args)
    args = args or {}
    if args.cycle_config and args.cycle_config.ref_table and args.cycle_config.ref_value then
        args.cycle_config.ref_table[args.cycle_config.ref_value] = args.to_key
    end
end
#

I already have it copied in my mod in case galdur isnt loaded

teal estuary
#

so:

card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.plustone then
return{
  --message stuff
}
end```
brisk rose
frosty dock
teal estuary
frosty dock
#

you're effectively checking for stone cards

teal estuary
#

thats what they are doing raisedcateyebrow

wintry solar
silent pawn
#

when i play a stone card the message isnt displayed

#

upgrades the card tho

#

tested it without the ids condition as well so its not the fact that its a stone card

hybrid iris
#

,,,hm

hybrid iris
# silent pawn

from a first glance, the message can't just directly be the string, if i remember correctly

#

it has to be equal to a localize() function

#

try message = localize('k_upgrade_ex')

#

also, you dont need to check if it's id is negative to see if it's a stone card, context.other_card.ability.name == "Stone Card" in the if statement would do the same thing

frosty dock
hybrid iris
#

,,,wait, really?

#

ahh,,

#

wait nvm, i see

#

hmm

frosty dock
silent pawn
#

yeah i thought so but for the rest of the functionality of the card individual is needed

frosty dock
silent pawn
#

otherwise the upgrade itself is never applied

frosty dock
#

yeah no it's possible, it just works differently

silent pawn
#

yea

#

im guessing using individual it just never really gets told when to display so it just doesnt

frosty dock
#
return {
  extra = { focus = card, message = 'Upgrade!' },
  card = card,
  colour = G.C.CHIPS,
}
hybrid iris
#

,,,i remember having this problem before, but i dont know exactly what i did to fix it

frosty dock
hybrid iris
#

yeah maybe try that-

frosty dock
#

it's a thunkism

hybrid iris
silent pawn
#

ill try it later thanks ^^

frosty dock
#

it's often useful to think about if there's a vanilla joker that does something similar

silent pawn
#

yeah i was trying to the closest one i could think of was steel

frosty dock
#

in this case, the first one I thought of was wee joker

hybrid iris
#

the first i thought of was hiker

silent pawn
hybrid iris
#

but yeah all similar

silent pawn
#

you guys got closer than me then aha

frosty dock
#

yeah hiker also has the same trigger condition, works just as well

silent pawn
#

idk why i didnt think of hiker tbh,,

brisk rose
#

tbh probably more useful to think of similar mod jokers

#

already being in smod format and all

silent pawn
#

i looked at steel and walkie talkie 😭

silent pawn
#

my main reference for vanilla jokers is just the logic behind them

wintry solar
#

how the context returns are handled is so strange to say it's a one man production

#

why are they all so different

frosty dock
#

There's also lucky cat and 8 ball that work the same way, but that's actually it

#

4/150 isn't great odds ngl

silent pawn
#

xd

hybrid iris
#

yeahhh

brisk rose
#

and who wants to recode already working shit?

frosty dock
#

Card:calculate_joker is a mess in and of itself too, it would have really used some refactoring

silent pawn
#

when i was thinking of similar modded jokers the first one that came to mind is the menu card from SDMs stuff(?)

brisk rose
#

good resource for modded objects

#

and vanillia ones too technically

#

there;s my site too made with the same exporter, but I think elbe downloaded my whole modpack, so he has everything I do and lots more

#

but yeah you can just find something there and then look up its code

silent pawn
#

iconic icon - and its just not the card i was looking at xd

hybrid iris
#

oh cool

#

saved

silent pawn
#

saving that aha

#

cant find the card i was thinking of maybe its in cryptid or something

#

m

brisk rose
#

all the cryptid jokers are there too

#

what sort of thing are you looking for exactly, I have a fairly decent memory for mod jokers,
I could probably dig something up

primal robin
brisk rose
#

hmm?

primal robin
brisk rose
#

yeah must just be their ddos protection

#

because I'm not getting that

primal robin
#

Also images for blinds does not work

brisk rose
#

yeah that's athe exporter just not working right yet

#

elbe has been busy porting basically the entire backlog of old balatro mods to work on 1.0, lol

primal robin
#

Also add for all images loading="lazy"

#

Or any other lazy-loading technique

brisk rose
#

I helped concept the exporter in the beggining, but it's all elbe's thing

limpid wing
brisk rose
brisk rose
#

export location is %appdata%/balatro/output

#

and you can just put everything it spits there right on a github.io or any other free hosting site

#

as I said, I helped with concepting in the begging and started trying to code, but elbe had the same idea earlier and beat me to it, so we just went with his version

#

can't take much credit, except for figuring out how to get the soul_pos sprites to overlay on the main sprites

silent pawn
#

it could be jens almanac or something??

#

i normally play with like sdms stuff and jens whole collection

brisk rose
#

not the same, but seem to have some of the same utility

silent pawn
#

seems to be a similar idea

brisk rose
#

this too

silent pawn
#

brb

wintry solar
#

what's the idea of the joker?

teal estuary
silent pawn
#

could use it for reference

teal estuary
#

still wonder why enhancements cant have retriggers 😭

#

true

#

i might change copper card enhancement to give mult or smth, its a little less unique but it works joeshrug

silent pawn
#

you could probably implement it yourself but it would be a hassle

teal estuary
brisk rose
#

what was it gonna be?

teal estuary
silent pawn
#

retriggers based on a specific enhancement

#

yea that

teal estuary
#

if you plat copper cards next to eachother, they’d all retrigger

silent pawn
#

cool idea but definitely needs lovely xd

brisk rose
#

well to code around retriggers apperently needing lovely, just add the effects of the adjecent cards

#

would accomplish the same thing

#

pretty sure checking for adjecency is part of smodded

silent pawn
#

might be a bit clunky i think he just wants to use xmult lol

brisk rose
#

well multiply then, lol, still should be simple lua math

#

from the little I understand

wintry solar
#

I don't think that needs lovely

silent pawn
#

yea i guess you could probably artificially multiply the mult

wintry solar
#

it's a fiarly straightforward check actually

silent pawn
#

i think xmult might be possible with steamodded but according to him he cant use retriggers based on enhancements

wintry solar
#

you can

#

it's just not very intuitive

silent pawn
#

yea didnt think it would be aha

wintry solar
#

it doesn't need lovely though

silent pawn
#

i think he was saying he would need lovely if he wanted to manually implement an easier way to do it

wintry solar
#

it's not difficult though

silent pawn
#

im guessing its more long winded than difficult

wintry solar
#

I'm pretty sure you just have to set effect.seals.repetitions = X

#

and it should work

vagrant moth
#
  key = 'flowerTrick',
  loc_txt = {
    name = 'Flower Trick',
    text = {
      "Gains Mult whenever you",
      "gain {C:money}${} from {C:attention}Interest",
      "{C:inactive}(Currently {C:mult}+#1#{C:inactive} Mult)"
    }
  },
  config = { extra = { mult = 0} },
  rarity = 2,
  atlas = 'MASS',
  pos = { x = 3, y = 0 },
  cost = 6,
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.mult} }
  end,
  calculate = function(self, card, context)
    -- end of round: gain mult based off of interest
    if context.end_of_round and not context.blueprint then
        card.ability.extra.mult = card.ability.extra.mult + G.GAME.interest_amount
        return {
            message = 'Upgraded!',
            colour = G.C.RED,
            card = card
        }
    end
    if context.joker_main then
      return {
        mult_mod = card.ability.extra.mult,
        message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
      }
    end
  end
}```
#

What is happening and how do I make this card work as intended?

wintry solar
#

what's at that line of state events?

vagrant moth
#
                            --Check for hand doubling
                            --From Red seal
                            local eval = eval_card(G.hand.cards[i], {end_of_round = true,cardarea = G.hand, repetition = true, repetition_only = true})
                            if next(eval) and (next(effects[1]) or #effects > 1)  then 
                                for h = 1, eval.seals.repetitions do
                                    reps[#reps+1] = eval
                                end
                            end

                            --from Jokers
                            for j=1, #G.jokers.cards do
                                --calculate the joker effects
                                local eval = eval_card(G.jokers.cards[j], {cardarea = G.hand, other_card = G.hand.cards[i], repetition = true, end_of_round = true, card_effects = effects})
                                if next(eval) then 
                                    for h  = 1, eval.jokers.repetitions do
                                        reps[#reps+1] = eval
                                    end
                                end
                            end
                        end```
#

it's this part

frosty dock
#

end_of_round has multiple contexts that use it

#

need check not context.repetition and not context.individual i think

vagrant moth
#

I swapped out a SMODS.eval_this for the return table because the Joker procced too much-

#

That must be it, thank you!

frosty dock
#

that should also fix it procing too much from the individual calls

wintry solar
# teal estuary still wonder why enhancements cant have retriggers 😭
if context.repetition_only and context.cardarea == G.play then
            effect.seals = {
                repetitions = 6,
                card = card,
                message = localize('k_again_ex')
            }
        end

something like this would work, it has no compatability with retriggering from seals right now, but I'll get that patched into smods at somepoint

vagrant moth
cursive ocean
#

Anyone know how I can make this not give Canio double the bonus when applied to a face card and Sock&Buskin is present 😐

SMODS.Seal({
    name = "black_seal",
    key = "black_seal",
    badge_colour = HEX("000000"),
    config = { },
    loc_txt = {
        label = 'Black Seal',
        name = 'Black Seal',
        text = {
            "Destroy this card",
            "after it is scored"
        }
    },
    loc_vars = function(self, info_queue)
        return { vars = { } }
    end,
    atlas = "seals",
    pos = {x=0, y=0},
    calculate = function(self, card, context)
        if not context.repetition and not context.repetition_only and context.cardarea == G.play then
            local destroyed_cards = {}
            table.insert(destroyed_cards, card)
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.2,
                func = function()
                        card:start_dissolve(nil, true)
                        return true
                    end
                }))
            delay(0.3)
            for i = 1, #G.jokers.cards do 
                G.jokers.cards[i]:calculate_joker({remove_playing_cards = true, removed = destroyed_cards})
            end

        end
    end,
})
brisk rose
vagrant moth
brisk rose
#

I think that's the interest per 5 dollars

#

not the earned interest

#

pikachu funnily enough is the one joker I see that uses earned interest at all

#

though you could calculate it yourself, if you can get the money before cashout

vagrant moth
hardy viper
brisk rose
#

yes i think

#

not a bad joker still

teal estuary
wintry solar
#

yeah, for now

vagrant moth
wintry solar
#

pffft, why use the built in option cycle when you can build your own

frosty dock
#

this one looks better ngl

#

should replace all vanilla option cycles with it

languid mirage
#

looks better in this context

#

I like how vanilla cycle options fit in vanilla UIs

opal spade
#

having this cycle in smods would be cool..

silent pawn
#

looks nice

primal robin
#

Imagine make a mod which has a collection of well-designed components

silent pawn
silent pawn
#

whats the syntax for using talismans xchips on a joker in my mod

topaz sun
#

What is a center? What's "self"? What's the difference between center, self and card? These questions keep me up at night

silent pawn
#

is there a way to disable certain jokers if you dont have a specific dependant mod installed

topaz sun
#

modkey is the mod ID

tepid crow
#

there's also a dependencies argument

wintry solar
tepid crow
#

though that's only useful if the only thing you're doing is creating a SMODS object

wintry solar
#

I find it easier to understand if there’s some context provided, what is it you’re doing that’s getting you confused?

topaz sun
#

I'm still trying to hide a joker in the collection. I found G.P_CENTER_POOLS in the game files and discovered I could just say G.P_CENTER_POOLS[index] = nil to make the (index)th joker not appear in the collection. But then I thought this could have other unwanted consequences and wanted to better understand what's this center that i'm dealing with here

#

Also this only works with vanilla jokers, so from index = 1 to 150

wintry solar
#

You can overwrite the inject function on the SMODS.Joker object to not insert it in the center pools, though I imagine this will also have unintended consequences during a game

topaz sun
#

Where can I find the inject funtion?

wintry solar
#

It’s in core/game_object.lua, from wherever it extends from

#

Probably SMODS.Center

topaz sun
#

Alright! I'll take a looksie

#

Thanks!

wintry solar
#

I don’t recommend this though, I’m pretty sure your joker would never show up in game either if you do this

#

Unless you force spawn it

topaz sun
#

That's actually precisely what I'm doing. I had disabled the spawn with in_pool = false. It's an upgraded version of a Joker in my pack, or a "DX Joker", if you will, that doesn't spawn, but is given if you choose a certain deck or deck/sleeve combo

#

If the joker still works after being given, it's all good

wintry solar
#

I believe it should do

#

I think you can actually do something like this for the inject then,

inject = function(self)
  SMODS.Joker.super.inject(self)
  G.P_CENTER_POOLS.Joker[#G.P_CENTER_POOLS.Joker] = nil
end
topaz sun
#

Will try it rn. Thanks a lot

small breach
#

im getting started with modding and trying to change the text in the "en-us.lua" file to try something simple, but the text changes never seem to appear in game and im a bit confused as how to fix that? i tried looking up a solution but i couldnt really find anything on editing the text in balatro,

topaz sun
small breach
#

i am, opened it with 7zip

topaz sun
#

What are you trying to change?

small breach
#

only the skip_blind thing, just replacing it with "NAH"

#

something like this!

topaz sun
#

Works here. Just saving the file in the text editor won't do. You gotta save the file and replace the original en-us.lua file inside the zip with the modified one.

tepid crow
#

^ that or use a proper steamodded mod

small breach
#

OOH shoot i see, thanks for the help! :0

topaz sun
#

Modifying the .exe file could break things

hardy viper
cursive ocean
hardy viper
#

check for the retrigger context

#

or, the better way is to make it happen after the hand is scored

tepid crow
wintry solar
#

Give it a value when it’s been destroyed once and check if it’s present or not

tepid crow
#

cryptid probably has a couple of examples

hardy viper
silent pawn
hardy viper
#

so you don't need to iterate through G.jokers and calculate them

silent pawn
#

not that i like looking through cryptids code,, joker config is a bit all over the place

tepid crow
#

yeah it's a lot of code 😅

tepid crow
wintry solar
silent pawn
#

also they seperated the jokers config like cost and stuff with the context and calculate sections

wintry solar
#

It just gets called twice because of sick and buskin retriggering

hardy viper
cursive ocean
hardy viper
cursive ocean
#

Wait no. He doesn't level up without the calculate_jokers call, he was just already at 2x -__-

wintry solar
#

There’s nothing in start dissolve

#

That’s a patch I’ve seen people do to try and get a destroyed context

#

the repetition check isn't checking for retriggers, that context is for returning repetitions to be carried out

#

you just need to add something like card.calculated = true at the end and then and and not card.calculated in your if statement

#

card destruction is a bit wonky rn

cursive ocean
hardy viper
#

using calculated there will 100% cause an incompat with something

cursive ocean
#

yea i went with

if not context.repetition and not context.repetition_only and context.cardarea == G.play and not card.dogmod_blackseal_calculated then
            local destroyed_cards = {}
            table.insert(destroyed_cards, card)
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.2,
                func = function()
                        card:start_dissolve(nil, true)
                        return true
                    end
                }))        
            for i = 1, #G.jokers.cards do 
              G.jokers.cards[i]:calculate_joker({remove_playing_cards = true, removed = destroyed_cards})
            end
            card.dogmod_blackseal_calculated = true
        end
hardy viper
#

🔥

cursive ocean
#

Now to figure out the wonky animations 😄

#

Or the timing of them

#

Is there any information about the different triggers you can send to add_event? I'm not sure what 'after' actually means. It doesn't seem to behave different from sending 'before' in this context

silent pawn
#

line 4855?? 😭

#

idk which script i even broke?

cursive ocean
wintry solar
#

what isn't working as intended?

silent pawn
#

i fixed it its cus i was loading a save after modifying stuff so it went nuh uh

lusty epoch
silent pawn
#

oh sick so it uses the same syntax as xmult

#

gotcha

lusty epoch
#

you have to make it use the chip colour though if you want that

#

it doesn't do that automatically

tranquil gull
#

is it just current_mod.config

tepid crow
#

edited the message to include it

tranquil gull
#

that should be pinned imo

tepid crow
#

I might write it up as a markdown doc so it can be added to the steamodded wiki

wintry solar
tepid crow
#

Ah, perfect! Let me know if you need any help/feedback for it

wintry solar
#

it's very bare bones at the moment, I started it alongside this one for general UI docs

#

but then I stopped 🤣

wintry solar
tepid sky
#

Thats nice

topaz sun
#

Looks great

plain wyvern
#

oooo

tranquil gull
#

okay how do i update the label of a button
i'm changing the children[1].config.text but it's not updating visually

wintry solar
#

can you send the code?

tranquil gull
#

function G.FUNCS.bind_key(e)
    print("Current label:", e.children[1].config.text)
    e.children[1].config.text = "..."
#

i found a reference to G.HUD:recalculate() earlier, do i need to call that?

#

wait

wintry solar
#

do e.children[1]:recalculate()

tranquil gull
#

ah

#

thank you !!!

#

aaaa it's a nil

wintry solar
#

oh maybe e.UIBox:recalculate()

#

I've literally deleted my text update today to use dynatext instead

tranquil gull
#

got it

#

e.children[1].UIBox:recalculate()

#

i should use dynatext but too lazy to figure out how it works

tranquil gull
#

how does the game make a ui element only show when hovering?

#

trying to put an on-hover tooltip on a button

rough furnace
#

theres a function to generate them when hovered

tranquil gull
#

?

rough furnace
#

iirc function Card:generate_UIBox_ability_table()

tranquil gull
#

no not a card

#

a button

rough furnace
#

oh

#

Card has a hover prop that might be inherited by it's earlier parts

#

probably can just do the same thing as a card when hovered

wintry solar
#

there are tooltip values on most things

#
  • tooltip - adds a simple tooltip to your element that is shown on hover
    - `tooltip = {title = "", text = {"", ""}, filler}
  • detailed_tooltip - adds a detailed tooltip, like the ones from info_queue to your element that is shown on hover
silent pawn
#

can someone put me on the right lines as to what the context would be for creating blueprint-like jokers

#

basically just the contexts for copying abilities of other jokers

#

^^

rough furnace
#

You just don't check the context

#

I'm on mobile rn so I can't pull up the code but basically you get the other joker and you can check ig its blueprintabke and then call its calculate function

tranquil gull
#

how do i add my own localization entries (for nothing in particular, juts some UI eleements)?

rough furnace
#

Hold on I had math guy recite some code for this for me earlier

silent pawn
rough furnace
#

Or you can use localization files (idk how they work)

silent pawn
#

arent modicons 34x34?

rough furnace
#

There whatever you specify them as

silent pawn
#

yea i guess

#

just think the default is 34x34

rough furnace
#

Actually my sprite is 34x34

#

I'll fix it later

limpid wing
#

There is a code example for a half joker like?

humble gale
#

is there any commands for testing modded jokers or do i have to just find them randomly in a run?

tranquil gull
#

vi_keybind_restart is not empty

wintry solar
#

where did you define it?

tranquil gull
#

localizations/default.lua .misc.dictionary

#

here's thefull thing:

mod.config_tab = function()
    return {
        n=G.UIT.ROOT,
        config = {align = "cm", padding = 0.05, r = 0.1, minw=8, minh=6, colour = G.C.BLACK}, 
        nodes = {
            {
                n = G.UIT.R,
                config = {
                    align = "cm", colour = G.C.UI.CLEAR,
                },
                nodes = {{
                    n = G.UIT.C,
                    config = {
                        align = "cm", colour = G.C.RED,
                    },
                    nodes = {{
                        n = G.UIT.T,
                        config = {
                            text = localize("vi_keybind_restart"),
                            colour = G.C.UI.TEXT_LIGHT,
                            shadow = true
                        }
                    }}
                }}
            },
-- there's a ton after this, not pasting it all
wintry solar
#

oh

#

the text needs a scale

tranquil gull
#

really

#

it doesn't default to 1

#

:/

wintry solar
#

I don't think so, no

#

huh, it looks like it does default to 1 but I've always experienced it being required

humble gale
#
if context.before and next(context.poker_hands['Straight_Flush']) and not context.blueprint then
      card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain 
      card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain 

      return {
          message = "Charge!",
          card = card            
      }
end

Is a straight flush referred to as Straight_Flush? It crashed on the next function

lusty epoch
humble gale
stiff locust
#

hey chat

tranquil gull
#

so will doing like

local func = Card.function_name
function Card:function_name()
  -- my code
  func(self)
end

break lovely patches

stiff locust
#

if I wanna iterate through cards in a pack how do I do that
I tried for k,v in ipairs(G.pack_cards) do and for k,v in ipairs(pack_cards) do and both gave the error table expected, got nil so i'm a little perplexed and would like a second opinion

tranquil gull
#

check if G.pack_cards exists first

#

it isn't guaranteed to

stiff locust
#

how could it not exist yet if i'm checking it during the create card function in the code for a booster pack

#

when does it exist if not during that part specifically

#

that's where it puts a card into G.pack_cards

tranquil gull
#

idk then

stiff locust
#

i'll do it the long way i guess

brisk rose
#

What are you trying to do exactly?

#

Maybe you can find something similar on else's site to reference

stiff locust
#

nah i'm doing it the long way

#

and none of you can stop me

gaunt thistle
#

have you considered stopping

stiff locust
#

wasn't worth it

#

what did I do that caused this

#

it's probably because of find_joker ig

#

gotta use smods find card

#

changing to that did not fix the issue uhhh

orchid thunder
#

how to delete blind

#

i dont want aht circl there with the art

silent pawn
#

😭

vagrant moth
#

How do I give a Deck a passive "counter" that does something and resets when it reaches a specific number?

#

Do the same variable things that work on Jokers work on Decks too?

vagrant moth
#

Might be wiser (and easier) to put the effect on a Joker...

brisk rose
vagrant moth
#

The funniest thing has occured. Due to me forgetting to set the atlas for Alchemical Deck's sprite, its sprite was set... to the template for Gold cards.

#

Noooooooooooo... I tried to run Alchemical Deck and this happened.

#

Here's the code. I'm trying to spawn a specific card named Rebirth at the start of the game.

SMODS.Back{
    name = "Alchemical Deck",
    key = "alchemical",
    pos = {x = 6, y = 0},
    config = {},
    atlas = 'MASS',
    loc_txt = {
        name = "Alchemical Deck",
        text ={
            "Start with an {C:tarot}Eternal {C:attention}Rebirth",
            "{C:inactive}(Every time you sell {C:attention}2{C:inactive} Jokers,",
            "{C:inactive}gain a {C:black}Negative Tag{C:inactive})"
        },
    },
    apply = function()
        G.E_MANAGER:add_event(Event({
            func = function()
                if G.jokers then
                    local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "rebirth")
                    card:set_eternal(true)
                    card:add_to_deck()
                    card:start_materialize()
                    G.jokers:emplace(card)
                    return true
                end
            end
        }))
    end
}```
#

What's wrong here?

#

Also getting this error when trying to test just Rebirth.

#

Code here.

SMODS.Joker {
  key = 'rebirth',
  loc_txt = {
    name = 'Rebirth',
    text = {
      "Every time you sell {C:attention}2{} Jokers,",
      "gain a {C:black}Negative Tag",
      "{C:inactive}(Currently {C:attention}+#1#{C:inactive}/2 Jokers sold)"
    }
  },
  config = { extra = { counter = 0} },
  rarity = 3,
  atlas = 'MASS',
  pos = { x = 5, y = 0 },
  cost = 8,
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.counter} }
  end,
  calculate = function(self, card, context)
    -- two jokers sold -> one negative tag
    if context.selling_card and context.card.ability.set == "Joker" then
        card.ability.extra.counter = card.ability.extra.counter + 1

        SMODS.eval_this(card, {message = card.ability.extra.counter .. '/2',
                colour = G.C.MONEY})
        -- create Negative tag!
        if card.ability.extra.counter == 2 then
            SMODS.eval_this(card, {message = 'Negative!',
                colour = G.C.BLACK})
            add_tag("Negative Tag")
            card.ability.extra.counter = 0
        end
    end
  end
}```
vagrant moth
limpid wing
#

there is documentation about shaders of card editions?

wintry solar
#

Some brief docs on the edition page, yes

vagrant moth
vagrant moth
#

It's alive!

silent pawn
#

love the cardart

nocturne garnet
#

YK that game called skyjo

brisk rose
#

looks like one of those games Mattel makes to try to recapture the magic of Uno

maiden phoenix
#

Oh I love this game

brisk rose
orchid thunder
#

We need rank decks

#

Like the 6 deck I saw somewhere

#

But for all ranks

brisk rose
#

cryptid might have those?

orchid thunder
brisk rose
#

I thought they also had edition decks and stuff, so it seemed possible

#

suit decks are also in something else now (forgot what) which is nice

orchid thunder
#

But not rank decks

brisk rose
#

fair

#

so yeah it is a good idea

#

though might be better to be a single configurable deck, which I think @wintry solar is cooking something for iirc

orchid thunder
#

You just lose

silent pawn
orchid thunder
silent pawn
#

which is a pretty unique idea surprisingly thats the only place ive seen a rank deck

#

compared to suit decks i think cryptid implements

#

tbh im surprised cryptid doesnt have rank decks yet aha

orchid thunder
#

Yeah

hardy viper
#

new deck where you get every single possible combination of suit/rank/enhancement/edition/etc at the start of the game

#

only like 6000 ish cards from my approximations

brisk rose
#

if not minutes

hardy viper
#

it's not so bad when it's in deck

#

idk if it's modded optimizations but ive seen jen do some runs with that many cards in deck and it runs at a decent framerate

brisk rose
#

very fair

hardy viper
brisk rose
#

but it probably won't keep running that good. in my experience, if there'a much oif anything going on in terms of card creation and deletion the game comes to a crawl at practically any deck size

brisk rose
hardy viper
#

very fair deck

brisk rose
#

lmao

cursive ocean
#

Does anyone have experience extending the ability of a vanilla jimbo? Most mods have the ability be a table for their jokers, but e.g. Baron only uses a single scalar value for its xmult as far as I can tell. Would you have to patch the game in order to take_ownership and expand upon a vanilla jimmy like Baron?

wintry solar
#

You can just take_ownership and then treat it as any modded joker

wintry solar
brisk rose
#

yeah I wasn't trying to say it was more than a concept currently

#

thought for a sec that "internal brain cooking" meant you had a high-ass fever, lmfaooo

wintry solar
#

Hahaha nooooo

brisk rose
#

pffft

wintry solar
#

I’m going to finish cooking textures first though, it’s getting closer

tranquil gull
nocturne garnet
tepid sky
#

Is there any way to make my custom flame shader actually work?

tepid sky
#

how? ;-;

hardy viper
#

how would i know you provided 0 details

tepid sky
#

if i changed some values from the original shader, how could i load it

brisk rose
#

you have to load it as a seperate shader, I know that much

#

idk how to apply it in context though

#

probably takes a lovely patch

crisp coral
#

you can probably load it akin to replacing base game atlases

tepid sky
#

i think i can see how the vortex is done right?

#

compare with the normal flame shader

#

cuz those 2 are the only ones (as far as i know) that are shaders that AREN"T on cards

upbeat ferry
#

someone who can help me with modding balatro? i cant play mods cause this

#

if can in spanish... betther

#

better*

tepid crow
upbeat ferry
#

and how can i do it? i use de 0.9.8?

#

i download in github

tepid crow
#

DONT use the 0.9.8

upbeat ferry
#

okei, i try it

brisk rose
#

Does anyone know why the playing card sprite sheet is called "8bitcards"? Makes it sound like an external asset

#

or that non-pixel art playing cards were considered

topaz sun
#

I think the early version of the playing cards in Balatro was lower-res

#

Or looked 8 bits like this ba dum tss

brisk rose
#

Ah so they just didn't change the file name, lol

#

They being thunk

tidal edge
#

how do you debuff cards

#

like make a joker

#

debuff certain cards

#

when gotten

#

apparently this is a thing in the balatro code

#

works for me

rough furnace
#

I updated balatro and now it crashes

#

👍

tepid crow
#

oop

primal robin
#

Works fine for me I guess

rough furnace
#

I reinstalled lovely and not it works

#

¯_(ツ)_/¯

tranquil gull
#

engine/ui.lua:693: attempt to index field 'colour' (a nil value)
so tired of seeing this Fucking error message

edgy reef
#

Isn't this usually tied to incorrect UIElement table depth?

tranquil gull
#

thank you that was it 😭

#

that needs a better error message!!

rough furnace
tranquil gull
#

JPFPSDJFLSKDFHS

cursive ocean
#

Can anyone tell why this is crashing with

"functions/state_events.lua:998: attempt to perform arithmetic on field 'x_mult' (a table value)"

is it because it's trying to use the vanilla calculate function, where "config.extra" is just a number, whereas it's a table here..?
"Hello Baron" is never printed..

SMODS.Joker:take_ownership('baron', {
    config = {
        extra = {
            tier = 1,
            maxTier = 2,
            canRankUp = true,
            multmult = 1.5
        }
    },
    loc_vars = function (self, info_queue, card)
        return {key = "j_dogmod_baron_t" .. card.ability.extra.tier, vars = {card.ability.extra.multmult}}
    end,
    calculate = function (self, card, context)
        print("Hello Baron")
        if context.individual and context.cardarea == G.play and context.other_card:get_id() == 13 then
            if context.other_card.debuff then
                return {
                    message = localize('k_debuffed'),
                    colour = G.C.RED,
                    card = self,
                }
            else
                return {
                    x_mult = 100, -- just as an example
                    card = self
                }
            end
        end
    end
})
hardy viper
#

chat is this real

tepid crow
#

that shortcircuits right

brisk rose
#

also balatro wouldbt be being ran with root permissions

tepid crow
#

also true

#

I meant that most programming languages don't evaluate the second operand if not needed

#

true or ... doesn't need to have the second part evaluated, because it will always be true
false and ... doesn't need to have the second part evaluated, because it will always be false

brisk rose
#

Oh yeah that'd just return true I think

tepid crow
#

Both and and or use short-cut evaluation, that is, they evaluate their second operand only when necessary.
Yup, Lua does as well

tepid eagle
#

short circuiting is awesome

cursive ocean
#

my brain does it all the time

glossy stone
#

i won the 50/50, i'm coming back soon :P more art for OS incoming!

tepid eagle
#

yay!!

frosty dock
#

you're not specifying what to remove

#

only how to remove

brisk rose
#

Also true

tepid eagle
#

rm rf with no argument deletes everything i believe

frosty dock
wintry solar
#

ugh, why do seals treat their atlas so differently to everything else

tepid crow
wintry solar
#

no the way they're referenced

#

they're hard coded in a different table and the seal objects themselves have no reference to the atlas or the position

tepid crow
#

oh I see

wintry solar
#

so whilst all your seal data is in G.P_SEALS or G.P_CENTER_POOLS.Seal, the images are saved in G.shared_seals

tepid crow
#

fun

wintry solar
#

but I think I've got it all working now :d

wintry solar
mellow sable
#

:O

oblique pond
#

judgement but seal

limpid flint
brisk rose
limpid flint
#

Wdym

brisk rose
# limpid flint Wdym

The joker that makes a random modded joker at the start of a blind. Sure, it'll fill your joker slots with garbage sooner for some free econ, but that's not too busted

#

Maybe just only make it be made from a spectral and not nat spawn in standard packs, if it needs any adjustment at all

#

I presume the "must have room" is implied

tepid crow
#

should still add it, even if implied

tepid crow
#

(the texture pack priority system)

hardy viper
tepid crow
#

I'll take that as a no then

hardy viper
#

i have no clue tbh

oblique pond
tepid eagle
#

(Must not have room)

tepid sky
rough furnace
#

anyone know why the shader thing needs it's name as a varible/

tepid sky
#

🤷‍♂️

#

i am figuring shaders out too my guy

rough furnace
#

ok I found a hack

tepid sky
#

thats hella handy!

#

but now try something outside of the card shaders 😏

wintry solar
wintry solar
rough furnace
#

Yeah

#

Luckily I found smods has a paych that lets it use a different name than the shader name

#

So I kinda just guess what the name of the variabke is and put it there

wintry solar
#

Yeah, ejwu sorted that one out

rough furnace
wintry solar
#

Still leads to the pointless if name.g > 0 || name.g < 0 part in the shader code

rough furnace
#

Why does it even need that?

#

Like could we just go and be like if smods shader don't pass that variable

#

Or does it cause some problems then?

wintry solar
#

It’s useful for effects that adapt over time

rough furnace
#

You think there would be a consistanntly named variable for time

wintry solar
#

Oh wait there is

#

Maybe it wasn’t time

#

I don’t remember what it passes 😂

#

Maybe it was card rotation?

rough furnace
#

Idk but why does it have to be named after the shader?

wintry solar
rough furnace
wintry solar
#
self.ARGS.send_to_shader[1] = math.min(self.VT.r*3, 1) + G.TIMERS.REAL/(28) + (self.juice and self.juice.r*20 or 0) + self.tilt_var.amt
        self.ARGS.send_to_shader[2] = G.TIMERS.REAL

I found them!

#

Confusingly, the time value isn’t actually a time value G.SHADERS[_shader or 'dissolve']:send("time",123.33412*(_draw_major.ID/1.14212 or 12.5123152)%3000)

tepid sky
#

@languid mirage iirc you made something where the (combo) flame were on the played cards. (i think u send a gif/video of it) could i please know how u did that?

languid mirage
#

shader is drawn on a dummy UI object that is attached to the card so first you need to create that, then you need to draw shader over it which you can hook within card:draw

#

both those things you can find if you look at where shader is drawn

tepid sky
languid mirage
#

yes

tepid sky
#

wow thanks!

#

i tought something about this cuz i saw the code for the boxes in the hand menu (the chip x mult boxes)

#

and saw it was like a function

languid mirage
#

yeah iirc it adds draw callback which draws the shader on UI element

tepid sky
#

thanks!

#

i'll look into how i make the boxes :)

languid mirage
#

Actually the mult/chip boxes are draws separately, as they are on top of the flames

tepid sky
#

hmm

upbeat ferry
#

someone can help me?

#

i try to install the modder and i cant work it, i play balatro app and appears in streammod 0.9.8 insead of the 1.0.0

tepid sky
#

u sure u got 1.0.0 instead of 0.9.8?

upbeat ferry
#

i do all but in the game appear this

limpid wing
#

when you download steamodded you press the green button and click on download zip

upbeat ferry
#

i got it

#

and then?

limpid wing
upbeat ferry
#

the old folder where is?

limpid wing
#

Just do windows key + r and write %appdata%/balatro

upbeat ferry
#

okei, im there, in there, it's only the mods carpet

#

i delete de carpet "mods", i create a new one and i put in the carpet of steamodded

fluid monolith
#

Hello, I wanted to start working on trying to update a mod for personal use that seems to have been abandoned, but I’m struggling to find anything on the GUI documentation for SMODS. Does anyone have any tips on how to resolve issues with the function SMODS.RegisterUIElement on the current alpha? Or any other information on GUI stuff with this build? Thanks in advance

wintry solar
fluid monolith
# wintry solar What exactly are you trying to do??

Trying to resolve issues with the Deck Creator mod which appears to be built on SMODS 0.9.8 API which has a lot of deprecated features. I was trying to find out if it is possible to replace most of the existing functions with more modern iterations, or if it will need a full rewrite.

wintry solar
#

From a brief look at the code, it’ll probably need a complete rewrite to make sure it’s compatible with other mods

fluid monolith
#

Hmm, unfortunate. Do you have any advice on where to start with a rewrite like that? Even if the original mod never gets updated I would like to try helping keep it available for modern Balatro

wintry solar
#

I’d try and get the base mod functional in terms of custom decks before worrying about the ui

silent pawn
#

what does the function juice_up() do

hardy viper
#

juices up

#

make card

#

juice

#

jump

#

vibrate

#

boingong

#

shake

silent pawn
#

oh right

#

thanks for the very detailed description

#

oh yes i see

silent pawn
#

is there a context for when you win a blind

#

nevermind i made it work anyways

teal estuary
#

also, is there a way to make a joker unsellable naturally? not like, an eternal tag or smth

silent pawn
teal estuary
#

coolios

#

you can also do card = card, and most of the time that works

silent pawn
#

nah i did G.hand_text_area.blind_chips:juice_up() G.hand_text_area.game_chips:juice_up()

#

wasnt to a card

teal estuary
#

😭 its done on jokers

silent pawn
#

it works on other things too

teal estuary
silent pawn
#

it makes stuff jiggle

wintry solar
#

you can make almost anything juice up

vague island
#

so im trying to make some code for a joker that removes editions from another specific joker

#

and it copies the joker

#

but i cant figure out how to strip every edition from a joker

#

calculate = function(self, card, context)
if context.before and not (context.blueprint_card or self).getting_sliced then
for i = 1, #G.jokers.cards do
if
G.jokers.cards[i].ability.name == "Gerald" and G.jokers.cards[i].editon and G.jokers.cards[i].edition.negative == false
then
local chjoker = G.jokers.cards[i]
local card = copy_card(chjoker, nil, nil, nil, chjoker.edition and [here is where i need any edition])
end
end
end
end
}

frosty dock
#

you might be overthinking this? jokers can only have one edition

vague island
#

i think were saying diff thing

#

i meant remove any edition

#

might have not been clear

silent pawn
#

find modded jokers that manipulate editions, it could help you out

#

heres a big index of a bunch of modded jokers

#

is there a function to update the tooltip of a joker?

#

oh wait is it literally just card = card

#

it wont update ):

wintry solar
#

you can just do card:set_edition() and it'll strip it

silent pawn
#

can someone help it doesnt update the tooltip when the variable is modified

#
    if context.blind_skipped and not context.blueprint then
      card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.increase
      return {
        message = localize("k_upgrade_ex"),
      }
    end
  end```
narrow pollen
#

can someone more well-versed in lovely help me out with how to get it to parse this line that i want to change in state_events that has both types of quote marks in it?
play_area_status_text("Not Allowed!")--localize('k_not_allowed_ex'), true)

wintry solar
#

I believe using ''' will work

wintry solar
#

can you send your code?

vague island
#

well i edited it a bit but here
calculate = function(self, card, context)
if context.ending_shop then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.name == "Gerald" and G.jokers.cards[i].editon and G.jokers.cards[i].edition.negative == false then
G.E_MANAGER:add_event(Event({
func = function()
local card = G.jokers.cards[i]
card:set_edition()
local card2 = copy_card(card)
card2:add_to_deck()
G.jokers:emplace(card2)
return true
end
}))
end
end
end
end
}

wintry solar
#

and what happens?

vague island
#

nothing

#

it just exists

#

even with 3 holo gerald

wintry solar
#

try using SMODS.find_card instead of the ability name check

humble gale
#

Im trying to make it so this calls when a gold card is scored. How would i check if it is gold?

if context.other_card:get_id()==10 then --Check if it is gold instead
   card.ability.extra.money = card.ability.extra.money + card.ability.extra.money_gain 
            
   return {
       message = "Harvest!",
       card = card            
   }
end
silent pawn
#

is G.GAME.skips valid syntax

#

not syntax like

#

yk what i mean

humble gale
#

?

silent pawn
#

dont worry got it to work

#

just wondered if G.GAME.skips was valid for like getting the amount of blind skips

#

it was

vague island
wintry solar
#

no

#

look up how SMODS.find_card works

vague island
#

ok

#

look up as in on google?

#

cause there arent any matches

brisk rose
vague island
#

ohhh

#

ok

inland helm
#

is there a way to allow stone cards to show suits?

#

target = "card.lua"
pattern = '''self.ability.effect ~= 'Stone Card''''
position = "at"
payload = '''self.ability.effect ~= 'UNUSED Card''''

#

I cant seem to get this lovely script to even find self.ability.effect ~= 'Stone Card'

#

switching to patches.regex worked

#

the whole thing works now yippie

spare elk
#

this'll make a joker that does nothing except be bought and sold, right? i just wanna be sure im doing this right before i commit the change

hardy viper
#

idk if thats required for jokers

#

lemme check

#

i suggest testing it out by spawning it in via debug

spare elk
#

ok well first off i forgot to make an atlas for it's sprite, im dumb

vague island
#

does anyone here know how SMODS.find_card works? i cant find anything

maiden phoenix
lament fjord
#

Is there some way to enable/disable voucher availability in pool?

maiden phoenix
#

use in_pool

spare elk
silent pawn
brisk rose
#

:p

silent pawn
#

yea but you can also use other functions to give them effects :3

#

a lot of mine use add_to_deck/remove_from_deck

#

by a lot i mean like 3

#

😭

brisk rose
#

Lol very fair

silent pawn
#
engine/sprite.lua:11: attempt to index field 'atlas' (a nil value)``` bro what is causing this error
#

clearly something with my atlases but idk what

#

this is for loading my joker configs and the first joker art atlas

#

SMODS.Atlas ({
    key = '1up',
    path = "1up.png",
    px = 71,
    py = 95
}):register()```
#

load_file is on line 12 so I think that's the issue but I don't know what's wrong with it

brisk rose
#

Doesn't jokers.lua use that atlas?

#

AFAIK you need to declare the atlases before they're used, and load_file basically just pastes or at that position

#

Might be mistaken

stiff locust
#

what's the joker key for jimbo

#

is it just joker

brisk rose
#

j_joker yeah

#

Iirc

tepid crow
#

(also, I don't think you need :register() anymore in 1.0.0+?)

vagrant moth
#
SMODS.Back{
    name = "Unstable Deck",
    key = "MASS_unstable",
    pos = {x = 6, y = 1},
    config = {discards = -1},
    atlas = 'MASS',
    loc_txt = {
        name = "Unstable Deck",
        text ={
            "All hands start at {C:attention}LVL 2",
            "{C:mult}-#1#{} Discard"
        },
    },
    apply = function()
        G.GAME.joker_buffer = G.GAME.joker_buffer + 1
        G.E_MANAGER:add_event(Event(
            {trigger = 'after', delay = 0.8, func = function()
                -- switch G.jokers for appropriate start of game effect?
                for k, v in pairs(G.GAME.hands) do
                        level_up_hand(self, k, true, 2)
                end
            end
        }))
    end
    loc_vars = function(self)
        return { vars = { self.config.discards }}
    end
}```
Trying to give a deck two functions and it's not working at all.
#

I added a comma (end,) and it booted!

brisk rose
#

ayyy nice

vagrant moth
#

Less discards (2 at base, 1 on higher stakes) but it's easier to pivot and just play whatever hands come.

narrow pollen
#

siiiiiiiiiiiiiiigh

#

really getting sick of how difficult it is to figure out how to override methods now

#

or if it's even possible to override certain methods, given how steamodded changes them

silent pawn
silent pawn
#

it was 6am i blame that

#

nevermind that just didnt fix it

#

i moved the load_file to after the atlases and it still breaks

#

same error

languid mirage
narrow pollen
#

yeah, what i want to do is override the straight detection method

languid mirage
#

is it something not worthy of a PR?

narrow pollen
#

PR?

languid mirage
#

pull request

narrow pollen
#

trying to figure out how to add the capability to loop in straights

languid mirage
#

filename would be core/overrides.lua iirc

narrow pollen
#

ohhhhhhhhhhhh okay

#

cool, will look more into that tomorrow

silent pawn
#
    key = '1up',
    path = "1up.png",
    px = 71,
    py = 95
}):register()
SMODS.Atlas ({
    key = 'adollar',
    path = "adollar.png",
    px = 71,
    py = 95
}):register()
SMODS.Atlas ({
    key = 'bloodofthemartyr',
    path = "bloodofthemartyr.png",
    px = 71,
    py = 95
}):register()
SMODS.Atlas ({
    key = 'bobsrottenhead',
    path = "bobsrottenhead.png",
    px = 71,
    py = 95
}):register()```
is there anything wrong with the way i register my atlases? in game for some reason all the jokers have no image and the first one to be written as SMODS.Joker{} has the wrong image 😭
opal spade
#

why are you doing :register

brisk rose
#

I think maybe I can be blamed for that

opal spade
#

just doing SMODS.Atlas {} should make it work

brisk rose
#

I suggested it when they were having a different problem that ended up having an unrelated actual solution

#

if they're the same user I'm thinking about

brisk rose
opal spade
#

then putting the atlas in the joker definition to be the same as the key of the atlas definition should make it use your atlas