#💻・modding-dev

1 messages · Page 579 of 1

vale grove
#

i dont think anything outside of this code is relevant?

slim ferry
#

like

#

it

#

definitely is

#

i think

#

since otherwise the money would just work

#

if this was it

vale grove
#

wdym?

slim ferry
#

well if the whole code was the return the dollars would just apply

vale grove
#

youre kinda confusing me

slim ferry
#

well

#

the code outside

#

is probably relevant

vale grove
#

you think?

slim ferry
#

probably

vale grove
#

i dont have anything outside of this SMODS.Joker that would apply to it

#

except for atlas

slim ferry
#

no like

#

you only showed a small part of the joker code

vale grove
#

oh i did?

#

misinput then

#

heres the full thing

slim ferry
#

i think this should work?

#

i got no idea whyt he dollars wouldnt apply

vale grove
#

it does work if i have space

slim ferry
#

ohh

#

okay

#

then just

stiff locust
#

did you do it

vale grove
stiff locust
#

yeah

vale grove
#

not yet

#

i wanted to fix this first

stiff locust
#

is that intentional

vale grove
#

first i wanna get this to work

stiff locust
#

it'll only activate if you have a free consumable slot

vale grove
#

and not the money

stiff locust
#

hold on

#

do you want the money or the tarot

slim ferry
# slim ferry then just

do this before the check for space

SMODS.calculate_effect({
  dollars = card.ability.extra.dollars,
  func = function()
    G.E_MANAGER:add_event(Event({
      func = function()
        G.GAME.dollar_buffer = 0
      end
    }))
  end
  }, card)
vale grove
#

i want the tarot if i have space and the money regardless

stiff locust
#

and what's the probability for

#

send your code in a code block so i can edit it

vale grove
vale grove
slim ferry
wild berry
#

why doesnt this work?

stiff locust
#

put three ` at the start of your message followed by lua

#

put three ` at the end of your message

slim ferry
wild berry
slim ferry
#

use copy_card

vale grove
slim ferry
#

yea

wild berry
vale grove
# stiff locust send your code in a code block so i can edit it
SMODS.Joker {
    key = "placeholder",
    blueprint_compat = true,
    cost = 6,
    loc_txt = {
        name = "placeholder",
        text = {
            'When highcard is played',
            '{C:green,E:1}1 in 2 {}chance to gain{C:money} $2 {}',
            'and generate a random{C:tarot} Tarot {}card',
            '{C:inactive}(Must have room){}',
            '{C:inactive}if only there was a way to get sillier...'


        }
    },
    atlas = 'Jokers',
    pos = { x = 3, y = 0 },
    config = { extra = { odds = 2, dollars = 2 } },
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'vremade_8ball')
        return { vars = { numerator, denominator, card.ability.extra.dollars } }
    end,
    calculate = function(self, card, context)
        if context.before and not context.blueprint and context.scoring_name == 'High Card' then
            if SMODS.pseudorandom_probability(card, 'vremade_8ball', 1, card.ability.extra.odds) then
                G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 0;
                G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra.dollars
                if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
                    G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                    return {                    
                        dollars = card.ability.extra.dollars,
                        extra = {
                             message = 'Whoosh',
                             colour = G.C.FILTER,
                            func = function()
                                G.E_MANAGER:add_event(Event({
                                    
                                    func = (function()
                                        SMODS.add_card {
                                            set = 'Tarot',
                                            key_append = 'vremade_8_ball'

                                        }
                                        G.GAME.dollar_buffer = 0
                                        G.GAME.consumeable_buffer = 0
                                        return true
                                    end)
                                }))
                            end
                        },
                    }
                end
            end
        end
    end

}
wild berry
#

it just seems like context.destroying_card doesnt get triggered at all

vale grove
umbral zodiac
#

there's no way to easily raise the weight of an individual joker (especially per-run), right?

slim ferry
#

The return true in the event

#

For resetting the buffer

wild berry
#

how can i check when a card IS being destroyed

#

through a seal

vale grove
#

now the money procs twice

slim ferry
#

Yeah remove the dollars from the return

#

So its only in the calculate_effect

vale grove
#

now how do i remove the like

#

visual effect on the proc

slim ferry
#

no_message = true

vale grove
#

what i find strange is that the money procs before the card

#

is there a way to make it proc after the hand?

umbral zodiac
#

probably trigger = "after", in the event

#

i dont actually know truly but i would try that and see if it works

slim ferry
#

Its just calculate_effect

#

So theres no after

wild berry
vale grove
slim ferry
#

That removes the money message yeah

#

Put it in the SMODS.calculate_effect

wild escarp
#

How could I make a consumable only useable in a pack?

vale grove
#

like this it dont work tho

slim ferry
#

And function

umbral zodiac
#

plus whatever restrictions you want

pseudo furnace
#

is there a detection method to not count extra triggers but only once per played card?

vale grove
#

wont that disable the whoosh effect aswell?

slim ferry
#

No because the woosh is in a seperate thing

vale grove
#

so where exactly do i put it?

slim ferry
#

Inside SMODS.calculate_effect

#

SMODS.calculate_effect works the same way as a return table

vale grove
#

okay so it sadly still does the message

#

with it like this

slim ferry
#

O

#

Well fuck idk then

vale grove
stiff locust
#

if you want no message

#

use ease_dollars() to add the money

wintry solar
#

no

stiff locust
#

cunningham's law

#

:)

wintry solar
#

add remove_default_message = true

vale grove
#

i feel like that one wolf with the arguing parents

stiff locust
#

you can summon eremel to correct you by saying something that is inefficient

#

and eremel is never wrong

wintry solar
#

I am sometimes wrong

vale grove
#

okay so holy eremel

#

where do i add that line of code?

wintry solar
#

insted of the no message one

vale grove
lunar finch
#

Do you need math to mod balatro

true jasper
lunar finch
#

NOOOOO

stiff locust
vale grove
#

now it gives all of them at the same time in one message

#

is there no way to make the "whoosh" msg i have also apply the money?

stiff locust
#

is there a max size that a uibox can be

#

some of my stuff isn't showing up on it and I don't get why

wintry solar
vale grove
#

actually ill just send an updated ss

wild berry
stiff locust
#

oh no fucking wonder actually

wintry solar
#

just send the updated code

stiff locust
#

it's saving the colours as tables

vale grove
wintry solar
#

just put the dollars stuff in the bottom return

vale grove
#

except for remove default message

wintry solar
#

put the dollars line and the remove default message line in the return table

#

then delete that calc effect bit entirely

vale grove
wintry solar
#

move where you detect your space to the function where you add the caard

vale grove
#

okay wait im getting really confused

#

thats not ur bad im just bad at taking in so many instructions at 2am

vale grove
wintry solar
#

yes, although that extra is entirely unnecessary

vale grove
#

is it?

unkempt thicket
#

How do you check if or what challenge you're on?

vale grove
#

and still gives a separate message for money

#

although after the hand ends tho so thats good

static valley
#

gonna implement a pot of greed consumable.

  • draws 2 cards
  • those 2 cards could be anything: jokers (not legendary), consumables, playing cards. The cards drawn could even have a random edition. It could even be another pot of greed
wintry solar
vale grove
wintry solar
#

no, move it into the event where you add the tarot card

vale grove
#

the add dollar line?

wintry solar
#

or rather, the function with that event

red flower
vale grove
#

oh wait i see

#

holdon

willow scroll
#

okay so i wanted to see what happened if i replaced smods.blueprint_effect with calculate_joker and uh

#

i got spammed with repetition check warning

#

and it does way more calculations

#

what does that mean exactly im not familiar with repetition checks

red flower
#

it means that you're returning things in context.repetition that doesn't contain repetitions

willow scroll
#

ah i see

vale grove
#

like to be more specific i want the woosh to trigger and then get the money and tarot card simulataniously

wintry solar
#

can you copy the return code and I will fix it for you?

primal robin
#

I hope that this kind of config, splitted in sections, will be easier to understand for players. If not - then I have no idea what to do

jolly shadow
#

Capitalize "actions", "zone" and remove "& Vanilla"

primal robin
stiff locust
#

why does your mod have info popups and what are the levels for i've never seen them

primal robin
#

I'll describe this too

#

In Appearance section

vale grove
#

i got it to work before and after the round

#

but not during like

#

when other jokers trigger

vapid flume
#

i wonder is there a way to like delete a basegame joker? ik taking ownership is a thing so i feel like it should be possible

red flower
#

and you can probably add no_collection if you don't want it to appear at all

vale grove
#
SMODS.Joker {
    key = "placeholder",
    blueprint_compat = true,
    cost = 6,
    loc_txt = { 
        name = "placeholder", 
        text = { 'When highcard is played', 
        '{C:green,E:1}1 in 2 {}chance to gain{C:money} $2 {}'
        , 'and generate a random{C:tarot} Tarot {}card',
        '{C:inactive}(Must have room){}',
        '{C:inactive}if only there was a way to get sillier...' 
    } 
}, atlas = 'Jokers', 
pos = { x = 3, y = 0 }, 
config = { extra = { odds = 2, dollars = 2 } },
 loc_vars = function(
    self, info_queue, card)
    local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'vremade_8ball')
    return { vars = { numerator, denominator, card.ability.extra.dollars } }
end, calculate = function(self, card, context)
    if context.before and not context.blueprint and context.scoring_name == 'High Card' then
        if SMODS.pseudorandom_probability(card, 'vremade_8ball', 1, card.ability.extra.odds) then
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 0; G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) +
                card.ability.extra.dollars
            SMODS.calculate_effect(
                {
                    func = function()
                        G.E_MANAGER:add_event(Event({
                            func = function()
                                G.GAME.dollar_buffer = 0
                                return true
                            end,
                        }))
                    end,
                }, card)
            return {
                dollars = card.ability.extra.dollars,
                extra = {
                    message = 'Whoosh',
                    colour = G.C.FILTER,
                    func = function()
                        if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
                            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                            G.E_MANAGER:add_event(Event({
                                func = (function()
                                    SMODS.add_card { set = 'Tarot', key_append = 'vremade_8_ball' }
                                    G.GAME.dollar_buffer = 0
                                    G.GAME.consumeable_buffer = 0
                                    return true
                                end)
                            }))
                        end
                    end
                },
            }
        end
    end
end 
}

hey yall, i currently have this code and i cant seem to figure out how to play the whoosh effect at the start of the round and the money/tarot generation when other normal jokers play, is there a way to set that up?

left breach
#

chattt how do I modify current anet

#

ante*

#

in lua

faint yacht
#

ease_ante(number)?

left breach
#

does it support like

#

+ante

#

*ante

#

and ^ante?

#

I'm very new to modding, only mods I've tried to make were in jokerforge 😭

frosty rampart
#

ease_ante(number) adds number to the current ante i believe

idle plaza
#

Yeah

left breach
#

I might try to code it right now but like

#

I feel like you guys will suffer trying to help me cause as I said idk lua 😭

#

is this right

#

I want it to be ease_ante(current_ante) or however that's done :p

#

eventually might do ^ante but just doing like

#

ease_ante(current_ante*current_ante)

#

or ease_ante(current_ante*current_ante*2) however that's done

#

is this a good idea chat? :D

#

chat? :(

paper lava
left breach
#

spectral card

#

like this

paper lava
#

ohhhh, you want to make a spectral card that changes your ante?

left breach
#

yeah

#

3 separate ones

#

+ante, *ante, and ^ante

#

cause I get runs that can get to really high antes and I just get bored cause like

skip skip play 1000 times is just... not fun

frosty rampart
#

you should probably either adjust the blind scaling to keep up with typical scoring in your mod, or consider rebalancing your mod (i prefer the latter, because it means that vanilla content doesn't get outclassed by modded content)

left breach
paper lava
#
  1. debug mods will allow you to set ante
  2. let me look at cryptid's analog
frosty rampart
left breach
red flower
#

you should consider not playing cryptid /srs

left breach
#

huh

#

this looks a lot more complex than I thought :p

#

or wait nvm

red flower
#

a lot of these are complex because they have animations and stuff

left breach
#

that top part is for custom consumable class

idle plaza
#

Yeah, you won't need that

red flower
#

but you can just have a use function with ease_ante

left breach
#

yeah I think I'll do that

red flower
#

why does the comment say tarot lol

left breach
#

this prob won't be public, so I just need to make something that works :p

red flower
#

let me fix that

left breach
#

oh ye it does xD

#

so I need to use smods.consumable I'm guessing?

red flower
#

yes

left breach
#

so is this good?

paper lava
#

might want to add a loc_txt param

frosty rampart
#

good start
pos is the position of the art on the spritesheet though, so it probably won't be at (4, 4) when you get the art in

left breach
#

should it be 0 0

#

the art will just be a placeholder thing tho

frosty rampart
#

if the art for that one is gonna be in the very top left corner, yea

left breach
#

with a +, *, and ^ on top of it

frosty rampart
#

anyway i'd say use a central localization file instead of a loc_txt thing in each consumable, but tbh this mod is gonna be so small that loc_txt would be fine

left breach
#

what's a loc_txt?

paper lava
#

basically where you put the name and description of your things

frosty rampart
left breach
#

ooo alr

#

what do I add next

#

to make this work

#

?

#

didn't change 4 4 so far btw

#

srry abt that, gonna do that rn

sturdy compass
#

are you using notepad...

left breach
#

there we go

left breach
idle plaza
sturdy compass
#

please use VSCode

left breach
#

I'm just like in the mood for modding rn and I don't wanna lose that

sturdy compass
#

It will make it 100x easier if you do it now

#

trust me

#

It will actually tell you if something is wrong

left breach
#

like this?

left breach
#

I will start the install rn

idle plaza
# left breach like this?

Yeah. Well, typical formatting has the end line matching the same indent as its function line, but it can work either way regardless.

left breach
#

I'm assuming this won't work tho

#

because no art

#

vscode installed

idle plaza
left breach
#

that's bad cause I won't know what card this is

#

how do I make an atlas and assign this to it

#

?

paper lava
#

this is how my atlas is set up
SMODS.Atlas({key = 'possession_blind', path = 'Blind.png', px = 34, py = 34, frames = 21, atlas_table = 'ANIMATION_ATLAS'})
so change out all my variables (key, path) for yours

idle plaza
left breach
#

so if I see a Fool in a spectral pack I'll know it's one of these?

paper lava
#

mhm

#

that or if you see a fool with no name/description when you hover over it (?)

left breach
#

wait will it be no name or will it be the key I put here

#

"pante"

paper lava
#

uhhhhhh, it might be the key, idk
but probably no name

idle plaza
#

Pretty sure it'll just have no name.

left breach
#

how do I make it have a name then? not too worried about graphics

paper lava
#

loc_txt would be easiest

idle plaza
left breach
#

what are the lines?

idle plaza
#

The lines of the description of the card. Balatro doesn't automatically wrap lines around if they're too long.

left breach
#

I might just leave them empty but like

#

how do I have more htan one name?

#

so different cards have different names

idle plaza
#

Each card gets its own loc_txt

idle plaza
left breach
paper lava
#

no? you put it in the same spot as key,set,pos

idle plaza
#

You can add a localization file but for smaller mods, you can also just have it as part of your main code.

left breach
#

so like this?

paper lava
#

yes, but please for the love of jimbo fix your indenting

left breach
#

alr :D

paper lava
#

also you might want to change your text to span 2 lines, but it should be fine

left breach
#

this better?

paper lava
#

much better

left breach
#

:D

#

so this will just work

#

?

idle plaza
#

Yes.

left breach
#

alright, imma need to ask another question for the other ones

#

how do I get the number that's current ante?

idle plaza
#

G.GAME.round_resets.ante

left breach
#

soo

ease_ante(G.GAME.round_resets.ante) should be x2 ante?

idle plaza
#

Yes

left breach
#

:D

#

this good?

idle plaza
#

Yeah.

paper lava
#

right, mom said its my turn to ask for help

anyone able to tell why my hand is not allowed when i have >=4 suits?

#

i want this to be compatible with mods that add suits (like bunco), so thats why im not doing this the flowerpot way

#

nvm i just saw a typo
SMODS.Suit => SMODS.Suits

#

nvm, still not working

idle plaza
#

What's the code now?

left breach
#

srry to interrupt but what did I do wrong 😭

paper lava
paper lava
left breach
#

no, the mod doesn't appear

#

it's on in bmm

#

so ye does anyone know why it doesn't appear?

paper lava
#

unsure

#

just to make sure, you did close+reopen balatro after saving changes, yeah?

left breach
#

yeah balatro was closed

idle plaza
left breach
#

while I was coding

left breach
paper lava
#

smth along the lines of "Antesq_"

idle plaza
#

You don't need the _

left breach
#

:p

paper lava
#

should work i think

left breach
#

IT'S THEREEE TYSM YALL

#

:D

idle plaza
#

Anyways, the purpose of the prefix is to help ensure two items from two mods can generally have the same name.

So for example, the key for your Plus Ante consumable will now be "c_ant_pante" due to the prefix you set.

left breach
left breach
#

that makes sense :D

#

why can't I use the cards?

sturdy compass
idle plaza
#

I guess the can_use function is required for each one. I would've expected it to just default to true if it didn't exist, but oh well.

can_use = function(self, card)
  return true
end,
left breach
#

thx guys :D

#

imma try

#

ITW ORKS!!!

paper lava
#

hype

paper lava
#

anyways, bringing this back cuz i still need help

#

suitcount is < 4 despite me clearly selecting >4 suits

#

even selecting 5 wild cards doesnt work

#

unless im grossly misunderstanding lua documentation, idfk what is going wrong here

idle plaza
# paper lava

Don't know for sure if this is the issue, but try using SMODS.has_enhancement(cards[i], "m_wild") to check for wild cards.

loud summit
#

so how exactly do you do crossmod content

frosty rampart
#
if next(SMODS.find_mod('the id of the mod')) then
  -- insert crossmod content here
end
ivory citrus
#

hello, i have a little problem, i'm doing a challenge and when i try make it negative dont works, i'm try to see vanilla remade but it's the same as my code

idle plaza
# ivory citrus hello, i have a little problem, i'm doing a challenge and when i try make it neg...

According to https://github.com/Steamodded/smods/wiki/SMODS.Challenge, your edition key should NOT have e_

In addition, the edition you give shouldn't have {} around it, in general.

You might be looking at an outdated branch of Vanilla Remade because I see:

-- Monolith
SMODS.Challenge {
    key = 'monolith_1',
    jokers = {
        { id = 'j_obelisk', eternal = true },
        { id = 'j_marble',  eternal = true, edition = 'negative' },
    },
}
ivory citrus
#

oh

#

i'm really stupid

#

thank you very much, its work

idle plaza
#

Cool

paper lava
# paper lava

right, ive narrowed the problem down to SMODS.Suits not working how i thought it would

#

i thought it would give me a table of all suits, but i think it gives me an empty table?

#

ie i thought it was
SMODS.Suits = {"Hearts", "Spades", "Clubs", "Diamonds"}
but instead, it's
SMODS.Suits = {}

frosty rampart
#

something is wrong possibly

#

because SMODS.Suits has suits in it on my end
it could be that it only populates SMODS.Suits if custom suits are added? idk

paper lava
#

weird, i have bunco on and it uses SMODS.Suits

frosty rampart
#

oh wait i just read your code

#

the entries in SMODS.Suits aren't strings, but the whole Suit objects

#

also the table isn't ordered, so you can't do #SMODS.Suits or index it with a number

#

you need to do this
for i, v in pairs(SMODS.Suits) do
and then i will be the string you want and v will be a bunch of extra information about the suits that you don't need

loud summit
frosty rampart
#

the what now

loud summit
#

the uhh

#

whats it called in lua hang on

frosty rampart
#

if you mean loading a file then yea, just call the function to load the file inside the if statement i gave you

loud summit
#

yea load file

idle plaza
loud summit
#

thx

loud summit
#

how do you get the id from card.seal

#

and does it have the mod prefix applied

#
      "items/jokers",
      "lib/atlas"
}

local crossmodfiles = {
      "cryptid",
}

for i, v in pairs(files) do
    assert(SMODS.load_file(v..".lua"))()
end

for i, v in pairs(crossmodfiles) do
    if next(SMODS.find_mod(v)) then
       assert(SMODS.load_file("crossmod/" .. v .. ".lua"))
    end
end``` is there anything that stands out here?
idle plaza
loud summit
#

oh

idle plaza
#

If you ever want to check a mod's ID, it'll always be listed in that mod's json file.

loud summit
#

oke thanks

clear ocean
#

wait looked it up, G.GAME.modifiers.booster_choice_mod

wind steppe
#

what is actually contained in G.I.CARD?

idle plaza
loud summit
#

ok so the joker i added in the crossmod file isnt being added to the jokers list

#

i know its being loaded by SMODS.load_file because it errors for syntax

clear ocean
#

not sure if i did it right

idle plaza
#

I was referring to the "choice_mod" part of "booster_choice_mod"

clear ocean
#

oh

#

well that wasn't working either not sure if i was doing it right

#

G.GAME.modifiers.booster_size_mod = G.GAME.modifiers.booster_size_mod + card.ability.extra.size
G.GAME.modifiers.booster_choice_mod = G.GAME.modifiers.booster_choice_mod + card.ability.extra.size

#

are they read only or is it done by a different method like booster_size_mod(x)

manic rune
#

is it possible to move an existing uibox's position?

loud summit
#
SMODS.Joker {
    key = "opensource",
    name = "Open Source",

    atlas = "jokers1",
    pos = { x = 1, y = 1 },

    rarity = 2,
    cost = 5,
    blueprint_compat = true,
    demicolon_compat = true,
    eternal_compat = true,

    calculate = function(self, card, context)
        local trigger = context.force_trigger

        if context.individual and context.cardarea == G.play then
            trigger = (card.seal == "Green")
        end

        if not trigger then return end

        print("we are triggering!")
        local outcomes = {"c_cry_commit", "c_cry_rework", "c_cry_delete"}
        local judgement = pseudorandom_element(outcomes, "nflame_opensource")
        SMODS.add_card{key = judgement}
    end,
}``` does ANYTHING stand out here that would make the joker not appear in the collection??
clear ocean
#

im going to go to sleep

loud summit
#

yes?

#

my other jokers are using it

wind steppe
#

no idea then

loud summit
#

:(

wind steppe
#

you are loading the file right

loud summit
#

ya its erroring on typos

true jasper
loud summit
#

what

frosty rampart
gusty iron
#

how would i save someone from death if a certain value is atleast 1?

(EX: G.GAME.JCJ_extralives)

frosty rampart
gusty iron
#

oh this isnt a joker

wind steppe
#

i assume they want to do it outside of a joker

gusty iron
#

i have a consumable that just gives you an extra life

frosty rampart
#

then do it in the global mod calculate

gusty iron
#

(It represents a "for" loop)

loud summit
#

you can give mods calculate functions that work the same as jokers

gusty iron
#

i might just hook the death function

wind steppe
#

i forgot mod calculate existed

gusty iron
#

...if i can do that

frosty rampart
#

do it in the global mod calculate. it's easier

gusty iron
idle plaza
loud summit
frosty rampart
true jasper
loud summit
#
      "items/jokers",
      "lib/atlas"
}

local crossmodfiles = {
      "Cryptid",
}

for i, v in pairs(files) do
    assert(SMODS.load_file(v..".lua"))()
end

for i, v in pairs(crossmodfiles) do
    if next(SMODS.find_mod(v)) then
       assert(SMODS.load_file("crossmod/" .. v .. ".lua"))
    end
end
``` heres my main
gusty iron
#

and is there anyway to add a counter in the main gui that shows your lives

#

(im planning on having it also show on the for card, but for easier access)

sturdy compass
loud summit
#

what

sturdy compass
#

No () at the end of the crossmod file loading

loud summit
#

oh

gusty iron
robust marsh
#

can I remove the info queues that aren't the consumables themselves? For context, this card is supposed to display the info queue of up to 3 different consumables

loud summit
#

uhh look at how entropy does it ig

gusty iron
round lion
#

if im lovely patching a mod and want to use a multiline, will i have to paste in the pattern exactly? or will i be fine with leaving the lines flat

idle plaza
loud summit
#

(yea the value is also called entropy :()

sturdy compass
#

Minus indents for parent lines

robust marsh
gusty iron
true jasper
gusty iron
#

thanks spaghetti monster

loud summit
#

oh no the lua code is escaping into the game

#

hey so is it safe to set consumeable_buffer to 0?

#

when spawning a card in event

robust marsh
loud summit
#

oke it just feels wrong ig lol

lavish elm
#

how to get the description of a joker as a string

loud summit
#

localize(set = "Joker", key = "j_pfx_yourjokerkey") i believe?

lavish elm
#

ok another quick question when using the id_card function what is the ID of aces I tried 1 and it didn't work

lavish elm
#

if 14 is ace then what is 1?

true jasper
lavish elm
#

ok makes sense

lavish elm
loud summit
#

then idk

true jasper
loud summit
#

its something to do with localization

lavish elm
robust marsh
#

how would i make it so you can take a joker from a booster even if the slots are full? I already did something similar with the shop by hooking check_for_buy_space

loud summit
#

you could try setting the joker buffer to a negative number

true jasper
robust marsh
#

not the best practice since i'm already using hooks for other similar functions

robust marsh
#

otherwise i'd be doing that

robust marsh
wintry solar
#

I don’t quite remember the name of the other function but it’s something like can select card

robust marsh
#

I couldn't find it

#

done NepGem

last sentinel
#

how could i make it so the context.blueprint_card juices up in this instead of the joker being copied. Swapping out "card" for "(context.blueprint_card or card)" doesnt seem to work

lament agate
#

how does versioning works again

normal crest
true jasper
lament agate
#

thanks

true jasper
#

yw

plucky berry
#

guys I'm tryna make a new poker hand of four 7s of different suits, but it doesn't work, this is my code (i've never programmed before) can someone help?
-- Primera: 4 unique suits
SMODS.PokerHandPart {
key = 'primera',
func = function(hand)
if #hand < 4 then return {} end
local unique_suits = (get_unique_suits(hand, nil, true) or 0)
if unique_suits >= 4 then
return {
cards = hand,
name = "Primera"
}
end
return nil
end
}

-- Primera 7: exactly four 7s
SMODS.PokerHandPart {
key = "primera_7",
func = function(hand)
if #hand == 4 then
for _, card in ipairs(hand) do
local val = (card and card.nominal) or 0
if val ~= 7 then return nil end
end
return {
cards = hand,
name = "Four Sevens"
}
end
return nil
end
}

SMODS.PokerHand {
key = 'Primera',
visible = true,
chips = 100,
mult = 14,
l_chips = 30,
l_mult = 7,
loc_txt = "Primera",
example = {
{ 'S_7', true },
{ 'H_7', true },
{ 'C_7', true },
{ 'D_7', true },
{ 'H_Q', false },
},
tooltip = {
name = "Primera",
text = {
"A special Napoli hand.",
"Requires four {C:attention}7{} of different suits.",
},
},
evaluate = function(parts)
if not next(parts.napoli_primera) and not next(parts.napoli_primera_7) then
return {}
end
return {SMODS.merge_lists(parts.napoli_primera, parts.napoli_primera_7)}
end
}

pseudo furnace
#

Is there a way to detect which card is currently scoring? Like the [3]rd card returns 3?

pseudo furnace
#

Hanging Chad, of course! Thanks

true jasper
#

wrong emoji first time around lol

glass scaffold
#

Alright, I just throw this into a lovely.toml file, change the variable from the code, and call it a day or is there more to do?

rotund sable
#

I think that's it

#

You could also make a lovely folder with individual patch files

#

To make things more organized

glass scaffold
#

-# Give me a funny variable name.

#

-# Bonus for mentioning the G.GAME.SSS var

rotund sable
#

Super_secret_variable_responsible_for_reroll_text_that_replaced_the_SSS_var

rotund sable
#

Oh god you combined snake case and pascal case

#

😨

glass scaffold
#

And you delivered

#

This should work, yeah?

glass scaffold
true jasper
glass scaffold
#

Yep, still at $10.
-# Why won't you change?

wintry solar
#

Have you changed the ui element?

rotund sable
#

Assuming the patch worked

#

Because looking at the change text that might not be the case

glass scaffold
rotund sable
#

lovely/dump/functions/UI_definitions

glass scaffold
rotund sable
#

Ctrl+f to find the function mentioned in the patch

#

The create_UIBox_blind_select

lament agate
#

how do you detect if a card is unscored

glass scaffold
glass scaffold
rotund sable
#

Did you load the patch correctly

#

Either in lovely.toml or lovely/name.toml

glass scaffold
rotund sable
#

It needs to be in the root directory 😭

#

Of the mod

glass scaffold
#

Alright, lemme test it. I moved it.

#

-# Yes, I AM this stupid sometimes.

glass scaffold
glass scaffold
rotund sable
#

Also you can check the lovely/dump again

glass scaffold
wintry solar
#

You need to set that value when you redeem your voucher

#

Currently it’s when you press the button

glass scaffold
#

WE HAVE WORKING CODE!

robust marsh
#

how would I get every sticker that is currently on a joker?

wintry solar
#

You’d have to loop through SMODS.Stickers and check if they are present

#

I might make a util function for that

robust marsh
#

alrighty

floral marsh
#

why am I getting an error here saying G.GAME.hands["whicheverhandhere"].level is a table

#

when I print it its telling me a number

glass scaffold
daring fern
floral marsh
#

wtf

daring fern
# floral marsh yes

Talisman turns poker hand levels into tables, so you would need to use to_big

floral marsh
#

why is that a thing

#

whatever

rotund sable
slim ferry
#

talisman makes you to_big like fucking everything

jolly shadow
#

used to_big on my ex wife, she was not amused

floral marsh
#

so do I just put to_big(thehand.level) instead

#

everywhere

slim ferry
#

no

#

the hand level is already big

#

you would do to_big(6) instead of just 6

#

same with whatever that other number is

robust marsh
#

i was testing my recipe system and realized gluttonous joker is spelled as gluttenous joker thunk

floral marsh
#

oh I see

#

I dont affect the level but the number Im checking

slim ferry
#

also the thing at the end is pretty important if your mod doesnt require talisman anyway

floral marsh
#

yeah I shall add that

#

I dont intend to make my mod require talisman cuz am trying to keep it as balanced as I could make it

#

unlike cryptid blueprint

slim ferry
#

except cryptid will also be losing the talisman dependency at some point in the future..

#

still not the most balanced but its something

floral marsh
#

we love exotic jokers

slim ferry
#

i mean tbf most of them arent all too insane

#

theres just a few more problematic ones like crustulum and tenebris and ace aequilibrium

#

which are just fucking stupid

floral marsh
#

isnt tenebris the one giving 25 whole joker slots AND 25$

slim ferry
#

yeah

floral marsh
#

its terribly overpowered

true jasper
#

I hate speculo

slim ferry
#

joker slots are way too versatile to just. give 25 casually

floral marsh
#

I remember getting it on that one deck giving a free exotic and -2 joker slots

slim ferry
#

oh yeah

#

speculo

#

speculo is also fucking stupid

#

and scalae how could i forget

floral marsh
slim ferry
#

huh

floral marsh
#

I prob forgot a line there

slim ferry
#

i cant believe they added None to vanilla

true jasper
#

I was hungry

floral marsh
#

at least it leveled down my pair

#

just need to fix the ui

robust marsh
slim ferry
#

is this not a context where you can just return level_up = -1

#

because theres quite a few where you can

floral marsh
#

ima check out space joker

#

cuz

slim ferry
#

alternatively just use SMODS.smart_level_up_hand

floral marsh
#

so smart

#

sure

slim ferry
#

oh wait

#

level_up return is true/false not a number apparently

#

i think

floral marsh
#

I think it is a number

slim ferry
#

nevermind

#

the arm does this

floral marsh
#

the arm remade has a number

slim ferry
#

wtf

floral marsh
#

yea

slim ferry
#

but space and burnt use true

floral marsh
slim ferry
#

speaking of burnt what the fuck is a context.hook

wintry solar
true jasper
slim ferry
#

ohhhhhhhhhhhh

#

i see

floral marsh
#

but like

#

what does space upgrade

true jasper
#

I have in my Joker that resets when discard

floral marsh
#

the played hand right?

slim ferry
#

the currently displayed hand

true jasper
slim ferry
#

which is the played hand

floral marsh
#

yeah so I cant really use it, the curse I made directly targets the most played hand and substracts 5 levels from it

slim ferry
#

oh okay

wintry solar
#

You can do that

slim ferry
#

then use SMODS.smart_level_up_hand(card, hand, instant, amount)

#

i imagine

wintry solar
#

Add level_up_hand = “hand name” alongside the level up return

slim ferry
#

oh

wintry solar
#

If the question is “can I do this via the return table”, most of the time the answer is yes

floral marsh
#

well okay

#

smods.smart_level_up_hand did the animation but increased by one the level instead 🗿

#

am gonna attempt the space joker strat

slim ferry
#

yeah youre supposed to put in -5 for the amount

#

to level it down by 5

floral marsh
#

as I did

#

but it leveled up by 1

slim ferry
#

uhhhhhhhhhhhhhhhhhhhhhhhhhh

#

fuck idk

floral marsh
#

well I cant return tables with a consumable so I will have to get the Black Hole's code, and modify it

#

which is roughly

#

25 lines

#

:D..

slim ferry
#

i mean

#

you can remove most of it

floral marsh
#

yeah

slim ferry
#

since a lot of it is just the all hand level up animation

floral marsh
#

I need like 2 update_hand_text()

slim ferry
#

why

#

arent you only affecting 1 hand

floral marsh
#

its doing the leveling but

#

the hand name doesnt show up

#

and the text stays at the end

slim ferry
#

smart_level_up_hand takes care of that for you

#

at least its supposed to

#

actually

floral marsh
slim ferry
#

what value is levels_removed

floral marsh
slim ferry
floral marsh
#

and x -1

manic rune
#

can u try using a number value instead of a big num 🤔

#

the issue could be in there

slim ferry
#

you dont need to do to_big on arithmetics

#

only comparisons

floral marsh
#

that shouldnt be an issue should it?

slim ferry
#

it shouldnt

#

i dont think

#

can you just show the entire use function

floral marsh
#

I dont use localization yet dont blame me

#

I should do smth rq

#

adding the config

#

instead of just

#

5

slim ferry
#

you could instead of the check just do

#

local levels_removed = math.min(card.ability.extra.levels_lost, G.GAME.hands[hand_current].level - 1)

ashen drift
#

what do i hook/patch to add ui stuff here

manic rune
ashen drift
manic rune
#

scroll down, in the return thats where you want to add

ashen drift
#

ohhh

#

i was wondering why it was so small i thought the end was just the end of the function

rotund sable
#

You could technically do it in a hook

ashen drift
#

i guess

#

this is an eyesore i feel like my head is gonna explode

floral marsh
#

okay I found the issue

#

levels_removed returns a to_big() table

#

talisman ah-

wild berry
#

how can i make the variable apply for just the card

#

while still being able to display it

#

the venomcount

#

because

#

the way im doing it rn

#

it just changes it for every single card that has the seal

floral marsh
#

am never making a ui in balatro 👍

daring fern
wild berry
#

ohhh ok

#

ty

#

but

#

in the loc_vars

#

card is not returned

#

i mean

#

its not given

ashen drift
#

okay i think create_UIBox_blind_choice is for this part?

#

i didnt see the or text or the tag

wild berry
ashen drift
#

actually this could work

wild berry
daring fern
robust marsh
daring fern
wild berry
#

oh

#

thanks

#

how can i make a card duplicate itself with a seal

#

when its being destroyed

manic rune
wild berry
#

because

#

the way i did it right now

#

the calculate never triggers

#

when its being destroyed

floral marsh
#

how do I return the number equivalent of a to_big() table

wild berry
#

isnt it #(table)

daring fern
slim ferry
#

Ohh

floral marsh
wild berry
wild berry
floral marsh
#

which is why smart_level_up increases by 1 instead

#

cuz

daring fern
floral marsh
#

type(amount) == 'number'

slim ferry
floral marsh
#

thats where it comes from

slim ferry
#

Ohh

#

Right

lament agate
floral marsh
daring fern
slim ferry
#

to_number is the talisman function

wild berry
ashen drift
#

its clear enough

#

ty

floral marsh
#

oh ma gad

#

finally

#

that one curse is done

#

thanks yall fr

lament agate
daring fern
lament agate
daring fern
lament agate
#

alright

vale grove
#

does anyone rq know the command for making a different sound play when scoring?

cursive gazelle
#

do you want to replace the sound or play a sound ?

#

Either way you should check the SMODS.Sound and the examples in smods

vale grove
cursive gazelle
#

You can replace the sound pretty easily just look at the examples

vale grove
cursive gazelle
#

The smods repo

#

Under examples

#

In github

slim ferry
#

Or you can replace sounds entirely with it too

vale grove
#

but it just doesnt recognize my file for some reason

slim ferry
#

is it in assets/sounds?

vale grove
#

yes

#

actually no

#

its in recources sounds

#

should i make it in assests?

slim ferry
#

Yeah

vale grove
#

i did that and now it gives this

slim ferry
#

Wtf

#

I have

#

No idea how that could happen

vale grove
#

i dont even know whythat would happen

#

all i did was remove sounds from recources and put them inside assets 😭

vale grove
#

oh

#

i fixed it

#

lol

#

now it gives the error that "recources/sounds/my.ogg" doesnt exist

#

which is true it doesnt

#

but how do i redirect it to assets?

daring fern
slim ferry
daring fern
slim ferry
#

Also wtf is register_global

daring fern
vale grove
#

this is not my code

#

this is from smods github

#

is it just modname_sound

daring fern
daring fern
vale grove
vale grove
vale grove
lost spruce
#

how can i make this text disapear after i used my consumable
(ignore the absurd levels)

daring fern
# vale grove .

Yes, you're not doing it right, it is exactly SMODS.Sound:register_global()

vale grove
#

oh () instead of {}

vale grove
#

i know im just stupid

#

but

#

i feel like im overcomplicating things in my mind

daring fern
vale grove
#

because currently i have this (YA being my prefix)

#

Propellor being the name of my ogg file

#

but when i run that it still checks for my recources/sounds instead of assets/sounds

vale grove
daring fern
vale grove
daring fern
ashen drift
#

why isnt G.GAME.sajevents initialized

vale grove
daring fern
ashen drift
#

ohh alr

#

thanks

vale grove
#

wait do my ogg files need my prefix attached to them?

daring fern
ashen drift
#

do i hook it in the return or can i just hook it to set sajevents

daring fern
vale grove
vale grove
#

bcs im reading on the github about this

#

and i find it so confusing to understand properly

daring fern
vale grove
#

like is my key just supposed to be basically a name that i call back later?

#

because in atlas for the sprites thats pretty much what i do

daring fern
vale grove
#

iam using just SMODS.Sound

#

nothing after it besides ({

wild berry
#

how can i force a hand draw

vale grove
#

like is my path supposed to be assets/sounds/mysound.ogg

#

because it keeps looking in recources/sounds

wild berry
#

because

#

G.hand:draw() didnt work for me

vale grove
#

in atlas

#

i just call Joker.png

#

and it works

#

why does that not work in sound?

slim ferry
#

Is your sound file called Propellor.ogg exactly?

daring fern
vale grove
#

yes the .ogg is the extension not the name

wintry solar
#

You need to prefix sound keys because it is perfectly plausible that you would want to play vanilla sounds

vale grove
wintry solar
#

No

#

When you call play sound

vale grove
#

so in here?

slim ferry
#

Yes

#

There

vale grove
#

so myprefix_propellor?

slim ferry
#

Yea

vale grove
#

i have a feeling itll still look in the wrong file path

#

but everything is worth a shot

#

and ive had many times in this project where i thought there is no way it'd work and it just works for some reason

#

now it says cant read Ogg bit stream?

slim ferry
#

Thats probably wierd file shenanigans if it can find but not read it

#

Try like redownloading the file or smth assuming you downloaded it from somewhere

#

I think

vale grove
#

but i can do that again yeah

slim ferry
#

Converted in what way

true jasper
vale grove
#

you cant convert it just by name can you?

slim ferry
#

Yeah you cant

#

Because the data type in the file metadata will still be the same

true jasper
vale grove
#

because there has to be a distinct difference for there to be a seperate file extension for it

#

that you probably cant get by just changing 3 letters at the end

slim ferry
#

The extension is mostly for determening what the file should be opened in

vale grove
#

oh i think it might have been the file

#

redownloading it worked

#

now im curios, how do i make multiple sound files register

slim ferry
vale grove
#

because im planning on using more

slim ferry
vale grove
#

man learning balala is so much more fun than java

#

bcs this is so much easier

#

what im learning here in 20 minutes takes like 2 days in java

true jasper
#

lua

vale grove
#

wait i was playtesting two of my jokers to see if they werent too busted and i found another one in the shop

#

how do i make them unique?

#

asin only multiple can be found with showman

slim ferry
#

They should be unique by default

#

Duplicates sometimes just happens if you spawn them with debugplus iirc

#

Try typing eval G.GAME.used_jokers into the console

#

That should have every single currently owned joker normally

vale grove
vale grove
#

if context.joker_main and not context.blueprint and context.scoring_name == 'High Card' then
just a quick question how do i update this to check if hand contains a stone card

daring fern
lament agate
#

how do you grab card's rank again

ashen drift
#

card:get_id() iirc

wild berry
#

could this work for setting a random edition?

robust marsh
#

I'd look at how Aura or Wheel of Fortune do it

wild berry
#

oh

daring fern
wild berry
#

also

#

how can i add a seal to poll_seals

#

or

daring fern
wild berry
#

does it do it automatically

#

no like

#

not add to a card

#

add a seal to the pool

#

for poll_seal

daring fern
slim ferry
#

where do you think poll_seal gets the pool of seals

wild berry
#

ohh

#

ok

#

i thought itwas just

#

a fixed table

hollow mango
#

im trying to make it so beating stakes unlocks more than just the next one (e.g. beating white stake unlocks red, green, and black. beating black unlocks blue, purple, and orange. beating purple unlocks orange, a modded stake, and some other modded stake. etc.)

does anyone know where i should start looking to make modifications to unlocking stakes? i've poked around but finding the right code to look at (and inject a patch into) has been a struggle

lament agate
#
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and not context.blueprint then
            if SMODS.has_enhancement(context.other_card, 'm_steel') then
                if SMODS.pseudorandom_probability(card, 'blacksmith', 1, card.ability.extra.odds) then
                    local original_rank = context.other_card.base.value
                    local original_id = context.other_card.base.id
                    local new_id = context.other_card.base.id + card.ability.extra.rankup
                    if new_id > 14 then new_id = 2 end
                    context.other_card.base.id = new_id
                    context.other_card.base.value = card.get_id(new_id)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            context.other_card:juice_up(0.5, 0.5)
                            return true
                        end
                    }))
                    return {
                        message = localize { type = 'variable', key = 'k_rank_up', vars = { original_rank, context.other_card.base.value } },
                        colour = G.C.SECONDARY_SET.Enhanced
                    }
                end
            end
        end
    end
#

any idea why this isnt working?

slim ferry
#

why dont you just use the same function that strength uses

pastel kernel
#

What’s the context for “end of ante” specifically? Unless it’s end of boss blind.

slim ferry
#

no, its assert(SMODS.modify_rank(context.other_card, card.ability.extra.rankup))

lament agate
slim ferry
#

that because source: vanillaremade strenght

daring fern
slim ferry
#

first argument has to actually be a card

lament agate
#

i see

#

so eris one?

ashen drift
#

nxkoo biggest fumble of the century

#

also yeah

slim ferry
#

assert is just so vscode doesnt kill you for not assigning the return

lament agate
ashen drift
#

might be a little far but its litterally a joker that +1 rank why isnt your first instinct strength

lament agate
#

because its not a joker

#

anyways

ashen drift
#

it still does the same thing

slim ferry
#

uhm

#

idfk man

#

how the fuck did you make card a number

lament agate
#

wdym

slim ferry
#

attempt to index local 'card' (a number value)

#

how

#

how is that a number

#

what did you do

lament agate
slim ferry
#

where he put it