#💻・modding-dev

1 messages · Page 699 of 1

primal robin
#

Now time for pain: pokermon, which loads billion years because of huge atlases

#

Oh my gosh, pokermon moment

#

We're hooking instances and not classes once again

red flower
#

pokermon is a cryptid-like

dawn knoll
#

does SMODS.gradient work for primary color in consumable type?

crimson dune
#

How should I shuffle played cards on play? I am currently trying to add a detrimental card effect for my mod that does an amber acorn effect on played cards
When I tried to do something like this: for context.before or context.press_play doesnt work becasue G.play.cards apparently isnt a proper cardarea before then
I tried adding my own context to shuffle the held area before playing cards, but apparently highlighted cards simply like resort themselves in the original arranged order before being played

Here's part of my code

if card.area == G.hand and context.on_select_play and card.facing ~= 'back' then
                G.E_MANAGER:add_event(Event({
                    func = function()
                        if #G.jokers.cards > 0 then
                            print("suffle")
                            G.jokers:shuffle('NUTTY'); play_sound('cardSlide1', 0.85); return true
                        end
                        if #G.hand.cards > 0 then
                            print("suffle2")
                            G.hand:shuffle('NUTTY2'); play_sound('cardSlide1', 0.85); return true
                        end
                        G.hand:hard_set_T()
                    end
                }))
                 delay(0.1)
dawn knoll
daring fern
dawn knoll
#

ohhhhhhhhhhhh

#

it says the 'Uber' is a nil value

#

uber is my mod prefix

#

oh

#

i used a period instead of an underscore

dawn knoll
#

nvm

#

i was missing an s

red flower
#

without events

crimson dune
#

I just realised that it was due to the premature return statements I made in the code from copying it from paperback's ouya board without moving the return statements
this works better now

if card.area == G.hand and context.press_play and card.facing ~= 'back' then
G.E_MANAGER:add_event(Event({
                    func = function()
                        if #G.jokers.cards > 0 then
                            print("suffle")
                            G.jokers:shuffle('NUTTY'); play_sound('cardSlide1', 0.85)
                        end
                        if #G.hand.cards > 0 then
                            print("suffle2")
                            G.hand:shuffle('NUTTY2'); play_sound('cardSlide1', 0.85)
                        end
                        if #G.play.cards > 0 then
                            print("suffle2")
                            G.play:shuffle('NUTTY3'); play_sound('cardSlide1', 0.85)
                        end
                        return true
                    end
                }))
glossy dagger
#

someone knows if there is a way to make a joker search in your deck and select a random enhancement from it?

#

something like idol, but for enhancements

red flower
#

you would need to manually iterate through the cards to find the enhancements and then pick one

glossy dagger
#

there is a G. or variable for enhancements?

red flower
primal robin
#

I think I'm cooking

red flower
timid zinc
#

is there a way to visually delay debuff showing on jokers? i have it in context.after and it shows as soon as you play a hand

red flower
#

someone else asked for that the other day i can see if i can add it as a feature tomorrow

#

wait if it's in context.after you can just use an event

brazen rock
#

how do i make a joker pool?
cant figure it out after trying for a little bit

#

my game keeps crashing because my jokers are trying to be put into an empty pool..?

#

nvm figured it out

hard kayak
#

For the love of god do not use quantum enhancements

hard kayak
#

I would like some tips on making a UI, for something like run info

#

Does Vanilla remade remaking creating the UIs?

#

That might be very useful actually

fading rivet
#

smods adds additional features but uses the same methods of making g ui

hard kayak
#

I see

queen crescent
#

wait how do you set a custom sell price

daring fern
hard kayak
#

You set the buy price to twice the value you want, or that

queen crescent
hard kayak
#

Twice the negative value?

queen crescent
hard kayak
#

I didn't know you can just directly hook the sell price

queen crescent
#

this will default to 1 (sell price)

hard kayak
#

Well I think the hook thing said above might work instead

#

I think cryptid uses that hook

queen crescent
#

well i just added the hook

#

im so silly

#

-# forgot to add a - at the start but its there now

amber turret
#

Can someone please help? I'm trying to add two new ranks, 1's and 0's... its displaying as ERROR however.

#

just fixed the problem where one didnt use a sprite by just subtracting 1 from the xpos but

#

why is it displaying as error?

#

tried playing a straight using a 0, Ace, 2, 3, and 4 and this happened.

#

i give up on this

#

adding new ranks is too hard

fading rivet
#

How can I overlay UI akin to the skipped text in the blind UI

red flower
hard kayak
#

I have not a clue where the smods stuff is for the UI

red flower
#

what are you looking for

hard kayak
#

Making another tab for run info

red flower
#

that's in G.UIDEF.run_info in the vanilla code

tidal hemlock
#

i want to do the flip animation that the enhance/convert tarots do, during context.other_card, but all the things i found were for highlighted cards

fading rivet
#

you can do the same with context.other_card

tidal hemlock
#

do you just replace highlighted[i] with other

hard kayak
fading rivet
#

context.other_card:flip()

fading rivet
#

whats the thing to get rid of the card limit display in card areas again

hard kayak
#

I have not done a lovely patch before so it would be nice to see how to make one

tidal hemlock
#

currently hating lua rn, i keep forgetting the commas

hard kayak
#

More of a mild inconvenience

#

Since it typically tells you where you need to add something

red flower
hard kayak
#

I see

silk latch
#

How would I get specifically the first 3 cards drawn?

#

And how would I keep them from being played or discarded?

amber turret
#

So, I'm trying to add new blinds, and currently I got "The 1", "The 10", "The 20", and "The 100", (The numerals of the Phoenician alphabet for the symbols on it) but I don't really know what to do for its functionality.

#

i got The 1 being debuffing all even cards and The 10 debuffing all odd cards tho

#

actually... what if i tried to make it more easier by just making them face down instead of a debuff

silent sail
#

what causes this in booster packs?

queen meadow
frosty dock
silent sail
#

its identical to my other packs but with different names

polar flint
#

what is this asking for?

primal robin
#

chud install mod called Spectrallib

queen meadow
#

sevendea_boosters being the group key

primal robin
#

Maybe this message should be rephrased so non-programmers can understand

frosty dock
silent sail
slim ferry
#

group key is only for localization

#

what would you even be using that for

silent sail
#

for an astronmer style card, i setting it so anything with the key wasw $0

frosty dock
#

at least it shouldn't be

#

you should use kind for that

silent sail
#

ah i can just change it its fine

#

everything is fixde this is so awesome

amber turret
distant junco
#

weird thing ive noticed, when i set a variable using pseudorandom_element(G.handlist, 'SEED') its fine, but if its printed it has a number after like Flush 11 and i think its causing issues when i use it like SMODS.upgrade_poker_hands({hands = {pseudorandom_element(G.handlist, 'SEED')}, level_up = 1, from = card})

#

because ive been doing that and its been crashing

#

and im pretty sure it wasnt doing that before

rigid solar
#

Pseudorandom element returns the result and the result's key in that array

#

So you have to store it in a variable and then you can use it in your function, if you want to avoid issues

frosty dock
distant junco
#

Awesome, thanks!

frosty dock
#

putting the result of a function call directly into a table unpacks it to use all results

frosty dock
#

though iirc you can also just do hands = ... without the table

dusk stream
#

im currently trying to make a blind that destroys cards in deck after 5 seconds, but im not sure how to get it to do that
i assume it's something with SMODS.destroy_cards(card) but i dont know if that affects all cards including cards in hand

    key = "blackhole",
    loc_txt = {
        name = "Black Hole",
        text = {"Slowly destroys all cards in deck"}
    },
    dollars = 5,
    mult = 5,
    atlas = 'bwaaablind',
    pos = {x = 0, y = 4}, -- change later
    boss = {min = 2, max = 6}, -- change later
    boss_colour = HEX("f600ff") -- change later
    set_blind = function(self)
        SMODS.destroy_cards(card)
}
#

i also don't know how to get psuedorandomized things (ex: a 1/5 chance to do bwaaa or bwuhhh)

wanton jolt
#

and then pick a random card from that table

#

and destroy it

#
local list = { }
local areas = { } -- list your areas in there
--loop areas
  --loop every card in areas.cards
  list[#list+1] = the_card_you_want_to_add
  --end loop every card
--end loop aread
local random_card = pseudorandom_element(list, "modprefix_seed".. G.GAME.round_resets.ante)
SMODS.destroy_cards(random_card,nil,nil,nil) -- change the first nil to true if you want it to remove eternals
dusk stream
#

you can make playing cards eternal?

#

or is that for jokers

wanton jolt
#

any

#

its a sticker

dusk stream
#

ah

#

where would i be able to find a list of all areas?

#

nvm

wanton jolt
#

you can use G.playing_cards but remember this not an area and therefore does not have a .cards table in it, you have to list through it directly

#

so you can like loop through G.jokers.cards, G.consumeables.cards and G.playing_cards

dusk stream
#

what does the_card_you_want_to_add do

glass crown
#

sorry for late reply, but is there any rough idea of when this will be being released?

wanton jolt
#

for example

  for _, playing_card in G.playing_cards do -- For each card in the scoring hand
    list[#list+1] = playing_card
  end
dusk stream
#

ah

wanton jolt
#
local list = {}
local areas = {G.playing_cards, G.jokers.cards, G.consumeables.cards } -- list your areas in there
if #list >= 1 then
  for _, area in areas do
    for _a, _card in area do -- For each card in the scoring hand
      list[#list+1] = _card
    end
  end
end
local random_card = pseudorandom_element(list, "modprefix_seed".. G.GAME.round_resets.ante)
SMODS.destroy_cards(random_card,nil,nil,nil)
#

i think this should be the code

viscid talon
#

how do i have it so that all cards in the first hand change their ability to m_hatch_salt

#

im guessing the assert is wrong

wanton jolt
#

in first hand played or first hand drawn

viscid talon
#
    calculate = function(self, card, context)
        if context.joker_main and G.GAME.current_round.hands_played == 0  then
            for i = 1, #context.full_hand do
                local percent = 1.15 - (i - 0.999) / (#G.hand.cards - 0.998) * 0.3
                local target = context.full_hand[i]
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.15,
                    func = function()
                        target:flip()
                        play_sound("card1", percent)
                        target:juice_up(0.3, 0.3)
                        return true
                    end,
                }))
            end
            for i = 1, #context.full_hand do
                local target = context.full_hand[i]
                G.E_MANAGER:add_event(Event({
                    func = function()
                        assert(card:set_ability("m_hatch_salt"))
                        return true
                    end,
                }))
            end
            for i = 1, #context.full_hand do
                local percent = 1.15 - (i - 0.999) / (#G.hand.cards - 0.998) * 0.3
                local target = context.full_hand[i]
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.15,
                    func = function()
                        target:flip()
                        play_sound("card1", percent)
                        target:juice_up(0.3, 0.3)
                        return true
                    end,
                }))
            end
        end
viscid talon
#

how do i make every single card played the salt enhancement

wanton jolt
#

i think you dont have to assert for this

#

also it should be target:set_ability("m_hatch_salt")

dawn knoll
#

can someone help me make a planet card?

viscid talon
#

gotcha

amber turret
#

how would i make a blind that debuffs all cards that have a rank lower than the lowest ranked card in the last played hand?

#

nevermind, that would probally be too complicated for me to code.

long sun
#

how do i check if a round is being played?

tranquil cypress
#

G.GAME.blind.in_blind is true when you're in a blind

long sun
#

thanks ^^

wanton jolt
viscid talon
#

i havent tested it yet sorry

distant junco
#

Im sure you could figure it out

glass crown
#

whats the best way to get the ante number? making a joker that only appears ante 2 and before

dusk stream
# wanton jolt ```lua local list = {} local areas = {G.playing_cards, G.jokers.cards, G.consume...

not sure if i have to continue building up on it but

    key = "blackhole",
    loc_txt = {
        name = "Black Hole",
        text = {"Slowly destroys all cards in deck"}
    },
    dollars = 5,
    mult = 5,
    atlas = 'bwaaablind',
    pos = {x = 0, y = 4}, -- change later
    boss = {min = 2, max = 6}, -- change later
    boss_colour = HEX("f600ff"), -- change later
    set_blind = function(self)
        local list = {}
        local area = {
            G.deck,
            G.hand
        }
        if #list >= 1 then
        for _, area in areas do
            for _a, _card in area do -- For each card in the scoring hand
            list[#list+1] = _card
            end
        end
        end
        local random_card = pseudorandom_element(list, "bwaaa_seed".. G.GAME.round_resets.ante)
        SMODS.destroy_cards(random_card, nil, nil, nil)
    end
}
amber turret
distant junco
#

fair enough

wanton jolt
viscid talon
wanton jolt
#

you need to go through G.deck.cards or G.hand.cards

#

but you can simply go through G.playing_cards, its a list of the full deck@dusk stream

#

code would be

SMODS.Blind {
    key = "blackhole",
    loc_txt = {
        name = "Black Hole",
        text = {"Slowly destroys all cards in deck"}
    },
    dollars = 5,
    mult = 5,
    atlas = 'bwaaablind',
    pos = {x = 0, y = 4}, -- change later
    boss = {min = 2, max = 6}, -- change later
    boss_colour = HEX("f600ff"), -- change later
    set_blind = function(self)

        local random_card = pseudorandom_element(G.playing_cards, "bwaaa_seed".. G.GAME.round_resets.ante)
        SMODS.destroy_cards(random_card, nil, nil, nil)
    end
}
#

and you wouldnt need to list every card in every area

#

since you only delete playing cards

#

i gave you the double loop incase you wanted to delete jokers too

#

but the code how it is right now would destroy one single card when you set the blind

weak grove
#

wait what lua interpeter should i use?

slim ferry
#

you do not use an interpeter, testing is done ingame

slim ferry
#

what is there to explain?

#

you dont need something to run code when the game already does so

weak grove
slim ferry
#

?

#

whats what

weak grove
#

is that in notepad?

slim ferry
#

thats just discord code block

iron oxide
#

the formatting is done thru grave accents

slim ferry
#

i assume you mean an editor and not an interpeter

iron oxide
#

it’s just showing how the Code Is

slim ferry
#

which is up to preference

iron oxide
#

many ppl use vscode for Editing tho

weak grove
#

i meant editor lol

#

?

slim ferry
#

but probably dont use base notepad at least

iron oxide
#

-# myself included

slim ferry
#

vscode is what most people use

red flower
#

if only there was a resource that answered these kinds of questions..

fading rivet
#

if only...

slim ferry
#

yeah that would be crazy

weak grove
#

?????

iron oxide
#

like some king of modding-resources…

weak grove
#

im asking a question

#

please dont make fun of me

red flower
weak grove
#

im kinda new to modding

iron oxide
#

i wasn’t trying to mb but there is a lot of info about it there

#

both in the above link and the respective forum

fading rivet
iron oxide
#

at least in regards to the simpler starting questions anyway I’d think

#

idk

#

🤔

#

but ya VSCode is definitely the recommended starting editor for that

fading rivet
#

where could I find the code that makes all the scoring animations happen faster

#

I need to make it not accelerate while a specific event is occueing

wanton jolt
#

but i use both n++ and vscode

versed swan
#

Is there a context for when a rental sticker deducts money?

wanton jolt
#

do which ever fits you best

wanton jolt
# versed swan Is there a context for when a rental sticker deducts money?
context.money_altered -- flag to identify this context, always TRUE
context.amount -- the amount that money has changed by
context.from_shop -- true if the money changed while in the shop
context.from_tarot -- true if the money changed from using a consumeable
context.from_scoring -- true if the money changed while scoring
#

i dont think so

fading rivet
wanton jolt
#

you could track the amount though

fading rivet
#

hmm there's no way from that to figurenit out

wanton jolt
#

i think if you do if context.money_altered and context.amount == -1

fading rivet
#

you'll need to modify the rental stick to give a custom context

versed swan
#

yeah I considered money_altered but I don't think it can exclusively regard rental

wanton jolt
#

right

fading rivet
#

and that would also consider purchasing jimbo

wanton jolt
#

then do and context.from_shop == false

fading rivet
#

that should work for pure vanilla, but any extra mods may break it

wanton jolt
#

i dont see how

#

unless they change the rental mod

versed swan
#

I'll play it safe and just patch rental

fading rivet
#

if a mod adds an enhancement that takes $3

#

oh wait, ox and wraith would break

#

if you have 3 dollars

wanton jolt
#

wait

#

rental doesnt remove the dollars during scoring

#

right

#

so i think if you set everything else to false you'd be good

fading rivet
#

its better to make your own custom context

wanton jolt
#

yeah

fading rivet
#

oh wait I figured it out

#

wait maybe not

glass crown
#

whats the best way to make packs bigger / have more choices? of a specific type too?

red flower
slim ferry
#

for specific types you could probably look at cardsleeves

fading rivet
#

nvm its G.GAME.modifiers.booster_size_mod

#

therss another one for choices

red flower
#

that's what i linked 💔

glass crown
#

what would be the best way to go about doubling the levels you recieve from level ups?

red flower
#

hooking level_up_hand probably

viscid talon
#

quick question does other_card.ability.perma_bonus also apply to xchips

frosty dock
viscid talon
#

thank you

#

i fucking love divine hiker

brazen rock
#

how would i make a seal grant a spectral card when it is played and scores?

#

i've got the function and stuff for it
i just dont know how to make it choose a random spectral card

red flower
brazen rock
#

thanks

cinder elk
#

another joker has hit the photochad meta.

wanton jolt
#

@faint yacht @fading rivet

amber turret
#

does anyone know how to make a blind only appear on ante 0?

wintry solar
#

you can mess around with in_pool currently, soon the max value of your blind definition will be functional though so it's probably easier to wait for that

amber turret
#

oh

#

my idea was a way to get to ante -1 without voucher shenanigans, a blind that when defeated would instead take you back an ante, and maybe it has a chance of appearing on ante 1, and guaranteed on ante 0.

fading rivet
viscid talon
#

lore accurate you are an idiot

wanton jolt
wanton jolt
#

in what context

#

on the first ever hand drawn?

fading rivet
#

wait

#

context.stay_flipped with to_area being G.hand

#

first 3 calls

amber turret
#

does anyone know why this isnt working? It's only debuffing the Diamond suit...

weak grove
#

hey whats the varible for the base blind size?

wanton jolt
#

1

slim ferry
weak grove
slim ferry
#

to debuff multiple suits you should use i think the debuff_card function

#

and check if its not clubs

wanton jolt
slim ferry
#

and the multiplier is G.GAME.starting_params.ante_scaling which is used by plasma

weak grove
amber turret
fading rivet
wanton jolt
fading rivet
#

update who

wanton jolt
#

blind galore coming soon?

weak grove
slim ferry
wanton jolt
fading rivet
#

sob

weak grove
fading rivet
#

what

#

\😭

slim ferry
#

what

weak grove
#

WRONG REPLY

wanton jolt
#

\😭

slim ferry
#

1 what 2 what 4 what

#

multiplier?

slim ferry
weak grove
slim ferry
#

ONE WHAT

fading rivet
wanton jolt
#

i think its the ante scaling

fading rivet
#

not ante

slim ferry
#

1 blind size? multiplier?

#

i dont understand the goal

fading rivet
slim ferry
#

i

#

i

fading rivet
#

you'd have to take ownership of them

wanton jolt
#

i think he wants to do return {xblindsize = (9+10)} and it should do x21

slim ferry
#

i gave the damn answer to the ante multiplier

weak grove
#

ante 1: 1X base blind size, ante 2: 2X blind size, ante 3: 4X blind size.

slim ferry
#

so

#

thats what i said

slim ferry
weak grove
#

oh wait so i can change starting_parems mid run?

slim ferry
#

yeah

#

its called starting_params but a lot is used outside of run start

weak grove
#

🤦

slim ferry
#

blame thunk

fading rivet
#

all that matters is that its reflected correctly

wanton jolt
#

it makes sens for it to be in starting params since you kinda want to reset it every new run

slim ferry
#

well

#

eh

fading rivet
wanton jolt
#

it shouldve been called something else though

slim ferry
#

well editing most starting params doesnt actually do anything because theyre used to set another value

fading rivet
# weak grove wym?

if I change the object a scrollbar is connected too I also have to change like 5 other variables to get it work again

slim ferry
#

tf you talking about bruh 😭

wanton jolt
#

ui slop

slim ferry
#

ui is just propaganda for big html

fading rivet
slim ferry
#

and nested tables

wanton jolt
fading rivet
wanton jolt
#

paingas

fading rivet
#

i am not dynamically adding buttons

weak grove
#

so basicly
game.starting_parems.ante_scaling = 2^game.round_resets.ante

#

?

#

but how do i update that every ante change?

fading rivet
weak grove
slim ferry
#

context. uhhh i forget

#

its like

#

ante something

#

context.ante_change

weak grove
#

ante_change

#

How to put it in a deck?

slim ferry
#

use calculate

#

works the same as any other object

weak grove
#

How to use calculate correctly?

weak grove
#

wtf is a loc_target

wanton jolt
fading rivet
carmine valley
#

Hello, everyone! I am new to Balatro and hoping to learn how to make a mod version of Balatro for my partner’s birthday:) Could folks point me to what you think is worthwhile tutorials for beginners? I’m hoping illustrate myself too- Is that something I can do too? 😊

brazen rock
#

how do i make spritesheets for things like seals?
aseprite is kinda annoying to do it with, its just overlapping the frames and causes this

silk latch
silk latch
weak grove
#

??????/

young wigeon
#

ello, I am trying to make a bot that can play balatro(earlier when I mentioned it here, there was some discussion about rule 9, but it seemed like the general understanding was that it was specificaly for generative ai, but if it is a problem, if you are a mod, please ping me, and I will take down all my posts about it). Has anyone made a mod that would allow a script to play the game that I could latch into, if not that would be my next steps, I know that typist is a thing which has keyboard inputs for all actions which I would probably be a base, but if some other framework would work better, that would be great to know.

daring fern
fading rivet
young wigeon
silk latch
amber turret
#

is there something im doing wrong in here? Maybe its the max but i added kraM ehT and now I tried rerolling and the game crashed

amber turret
fading rivet
# amber turret

replace talisman with amulet, but thast not the source of uour crash

amber turret
#

k

#

not sure if the error log changed or not

amber turret
#

oh

#

i think the problem was just me loading in from something on a low ante

#

just incase, i replaced the max one with a minimum of -69420 because, nice.

glass scaffold
#

It's just straight up not debuffing anything. I've tried using the return debuff and the SMODS:debuff_card along with some combinations of context checks

cinder elk
#

always remember mod makers

just because your mod’s joker “copies” the effect of a joker of a different mod, it’s ok!

with how many mods there are it’s difficult to be “original”, so go crazy

radiant bronze
#

is there a way to change a played poker hand into a different one

#

like Straight to Straight Flush

#

like before scoring

frosty rampart
#

during context.evaluate_poker_hand, if context.scoring_name is "Straight", then return replace_scoring_name = "Straight Flush"

radiant bronze
#

alr thanks

silk latch
# frosty rampart

And how would I add something to the list of contained Poker Hands?

frosty rampart
#

it's that "advanced use" mentioned in the screenshot

silk latch
#

So would I not be able to just table.insert(context.poker_hands, "Hand Name")?

daring fern
fading rivet
#

@jagged gulch why did you add a comma 😭

#
loc_vars = function(self, info_queue, card)
  return {vars = {card.ability.extra.chips}}
end,

use this

jagged gulch
fading rivet
jagged gulch
fading rivet
#

ah okay

jagged gulch
#

I know commas are how you sperarte code but I think that was sperate code since it looked line a line

silk latch
#

so, to make every hand contain, say, a flush, it would be

local handlist = {}
handlist = context.poker_hands
table.insert(context.poker_hands, "Flush")
return{replace_poker_hands = handlist}
```?
fading rivet
#

quick refresher
tables are like

{
-- list like tables
item1, item2,
item3, item4, item5,
item6,
item7,
-- keyed tables
loc_vars = function()-- the function is NOT done don't use a comma
  line_of_code_1 -- still not done
  if true then -- still no
    return true -- nope
  end -- almost there
end, -- now its done
other_key = 2
}
fading rivet
silk latch
#

no like to add it

fading rivet
#

yes

#

its a keyed table

#

use table["Flush"]

#

or if flush is constant table.Flush

daring fern
silk latch
#

so a pair is considered a flush with a pair (while still scoring as a pair normally) and not just a flush with nothing else

fading rivet
#

oh yeah that too

#

i don't know about scoring but yes it will be considered to contain a flush

jagged gulch
#

Why isn't it working

gilded blaze
#

is xmpl your mod prefix

#

then Idk what's wrong here
the indent is a bit annoying, but nothing else is bad

jagged gulch
#

Forgot that was the tutorials mod prefix

gilded blaze
#

lmao

sturdy compass
#

lol

jagged gulch
#

xmpl sounds like a actual file extension to be fair

sturdy compass
#

"xmpl" was meant to sound like "example"

jagged gulch
#

I know

sturdy compass
#

.example files miyalolto

jagged gulch
#

It's just that it also sounds like .xml a actual file extension

twin fiber
sly finch
#

Out of coincidence, does someone have the spritesheet of a Boss Blind?

iron oxide
#

like the vanilla spritesheet/etc

sly finch
#

Oh! ye yeye, thx!

iron oxide
#

-# np! :3

tulip pecan
#

how do I get the key of the current poker hand being played? everything I've found either gives me the Localized name of the hand or every hand that it contains, and I only want the key.

tulip pecan
# daring fern `context.scoring_name`

okay next question, how can I tell if the hand played is a hidden hand type? trying G.GAME.hands[context.scoring_name].visible always returns true because once you play the hidden hand type it shows up

#

would I have to scan all the poker hands at the beginning of the game and save that visible status to reference later?

sturdy compass
twin fiber
#

(there's a helper function there to manage my mod id for me)

sturdy compass
#

Have you considered using SMODS.find_card instead of doing a loop check?

#

It wouldn't solve your pool problem but it is more optimal

twin fiber
#

thanks for the heads up! i was not aware of that, ty :3

sturdy compass
#

no prob

#

What else have you done in your mod? I'm assuming it's more than just these joker inits

twin fiber
#

i feel like i must have done something wrong with config somehow somewhere cuz it manifested so early

sturdy compass
#

None of these files were present?

twin fiber
#

util was, rest not

-- debugging function
function print_keys(tab)
    local keyset = {}
    local idx = 0
    for k, v in pairs(tab) do
        idx = idx + 1
        keyset[idx] = k
    end
    table.sort(keyset)
    print("[print_keys]", table.concat(keyset, " | "))
end

function whimsy_prefix(prefix, id)
    return prefix .. "_whim_" .. id
end
function whimsy_joker(id)
    return whimsy_prefix("j", id)
end
function whimsy_modifier(id)
    return whimsy_prefix("m", id)
end
function whimsy_sound(id)
    return "whim_" .. id
end
sturdy compass
#

hm, very odd

twin fiber
#

.....i did disable _RELASE_MODE in the game file manually before starting the mod, now that i think of it, to get the debug menu. is it possible that has something to do with it?

sturdy compass
#

What Steamodded version are you running?

twin fiber
#

should be latest, i git clone'd the repo

sturdy compass
#

Might be an issue on dev maybe. Usually it's recommended to develop on latest release, not latest commit

twin fiber
#

yeah, i think you must be right - i just tested it without my mod, and i'm still getting the error. thanks for the help debugging, i never considered dev would have this issue!!

#

er, not an error. *unexpected behavior.

sturdy compass
#

I'll grab latest myself and see if I can repro

#

Actually I should've asked you this too: Did you spawn those cards in?

twin fiber
#

oh.

#

yes >~>

#

does that affect things

sturdy compass
#

That's it lol

#

Spawning cards in does not remove them from the pool

twin fiber
#

😭 oh my gosh, you learn something new every day

#

thanks 😭

sturdy compass
#

no problem, and dw that's a pretty weird one to learn lol

#

-# I'm honestly just glad it's not a smods bug

versed swan
#

Although I guess debugging will always bring its own set of oddities

sturdy compass
#

Huh, I'm surprised you didn't know that one 😭

versed swan
#

I always thought it was like "if this card is in an area it's not in the pool unless showman"

#

see, i don't touch the pool, much like i dont touch the scoring loop

sturdy compass
#

I believe "adding a card to the deck" is what removes it from the pool, and I think for whatever reason, spawning a card through debug doesn't do that lol

versed swan
#

Maybe it has something to do with the buy button and stuff

sturdy compass
#

I literally just don't think card:add_to_deck() gets called on debug spawn lmao

daring fern
mystic river
#

that's an oddly specific restriction
i wonder what thunk had in mind with it

sturdy compass
#

My guess would be so viewing collection mid-run doesn't mess with it

near coral
#

Where can I find the values to change the positions in the collection menu

#

I wanna make the first page normal and have the second mirror that of the first

shell timber
#

reload it ?

near coral
#

The disorganization was something I figured could be fixed after all the blinds were added

teal grotto
#
    message = "something",
    func = function()
        print("something")
    end
}```
how would you make the function actually trigger when the message does
shell timber
#

add it in an event

tacit peak
tacit peak
#

specifically anyone thats good at making custom api would be great

primal robin
#

Peak card creation

#

(don't do that it's not proper way)

hard kayak
hardy vessel
#

Is there a proper way to prevent multiple context.destroying_card effects from going off from the same card?

Like how Sixth Sense only works once on one played 6, even if you have multiple Sixth Sense

latent perch
#

I think you can either check existing flags like card.getting_sliced or smthin, or set your own flag e.g. card.sixth_sensed, and then check that it isn't set already.

#

just also make an Event to reset the flag if the card remains in the deck

gusty compass
#

what would i use to set a gradient for the title splash, cus this didnt seem to work

gusty compass
#

SMODS.Gradient {
    key = "BgOne",
    colours = {
        HEX("c48454"),
        HEX("895d3b"),
        interpolation = "trig",
        cycle = 15
    },
}

SMODS.Gradient {
    key = "BgTwo",
    colours = {
        HEX("ab744a"),
        HEX("e69e66"),
        interpolation = "trig",
        cycle = 15
    },
}

G.C.mid_flash = 0
G.C.vort_time = 7
G.C.vort_speed = 0.4

-- Thank you yahimod for easy accessa 🇫🇷🇫🇷🇫🇷🇫🇷
local game_main_menu_ref = Game.main_menu

Game.main_menu = function(change_context)
    local ret = game_main_menu_ref(change_context)
    G.SPLASH_BACK:define_draw_steps({
            {
                shader = "splash",
                send = {
                    { name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
                       {name = 'vort_speed', val = G.C.vort_speed},
                    {name = 'colour_1', ref_table = G.C, ref_value = 'BgOne'},
                    {name = 'colour_2', ref_table = G.C, ref_value = 'BgTwo'},
                    {name = 'mid_flash', ref_table = G.C, ref_value = 'mid_flash'},
                },
            },
        })
    return ret
end


#

idk how it works precisely

red flower
#

ref_table = SMODS.Gradients, ref_value = 'modprefix_BgOne'

#

granted, i think it will only pick the starting color but im not sure

gusty compass
#

im basing off of intuition since it appeared to work with polter

red flower
#

ah also

#

Game.main_menu = function(self, change_context)
local ret = game_main_menu_ref(self, change_context)

gusty compass
#

thanks

#

yea hold on, it appears to be getting nil?

#

nvm im just a bot and forgot i had a toml file with the same bit

red flower
#

i switched vanillaremade to recommend a patch instead of a hook because it's easier to preserve the title flash

gusty compass
#

yea, and hooking the splash, atleast when i tried it, deleted the cards that honed into the centre

#

so probably for the best

keen totem
#

why does the balatro logo on the main menu drift to the right when you have multiple mods enabled that add cards to the title cardarea

slim ferry
#

because cryptid was like the first mod to add a card to the main menu i think(?) and it multiplied the cardarea size for the title card

#

which kinda became the standard

#

but that breaks when theres a lot of mods doing that

mystic river
#

and they did the math wrong

#

one of the numbers was slightly off

slim ferry
#

at least SMODS.current_mod.menu_cards exists now

mystic river
#

yes, use that instead and you won't have this issue

#

(or, y'know, tell the mod devs)

slim ferry
#

speaking of

#

i should still port cryptid to that prob

median rose
#

I'm trying to make an event for when the wheel is used via toml. I should see "consumable print" in the console, but i don't when the tarot is used. Did I miss something?

--game_state.lua
GameState = {
    playing_cards = {}, -- the playing cards in hand during a blind
    jokers = {} -- the jokers at the top area
}
function GameState.consumable_print()
    print("consumable print")
end
return GameState
--main.lua
GameState = assert(SMODS.load_file('game_state.lua'))()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "eligible_card:set_edition(edition, true)"
position = 'before'
match_indent = true
payload = '''
GameState.consumable_print()
'''
brazen rock
#

how would i make my mod description look something like this

frosty dock
brazen rock
#

thanks

red flower
red flower
primal robin
tidal hemlock
#
        if context.selling_card and context.card.type == 'Planet' and not context.blueprint then
            card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
            return {
                message = localize('k_upgrade_ex')
            }
        end
end```

trying to make the joker gain mult when a planet card is sold, but `context.card.type` is wrong and the wiki doesnt say what's right
slim ferry
#

context.card.ability.set

#

the structure of a Card instance isnt on the steamodded wiki because it is a vanilla thing

tidal hemlock
#

nvm something happened to make that not crash

#

ill take what i have ig

glossy sky
#

how would I return/shuffle cards from the hand into the deck?

fervent rampart
#

I used SMODS.create_card to make booster packs appear in the shop and all is well, except that they're tiny. I've seen code in other mods to correct this, but those are done totally differently and are always coded for specific packs instead of random ones. I've not gotten it to work when trying to get a random pack key. So is there a way to stick with SMODS.create_card and resize them?

red flower
red flower
#

SMODS.change_booster_limit(1)

fervent rampart
silk latch
#

Why is it crashing like this? It should be able to either pull the value from the mod calc or just take the 0 over it.

frosty dock
#

config is initialized when the game is loaded, G.GAME doesn't exist yet at that point

frosty dock
viscid talon
#

is there a way to have scored enhanced cards do something

#

like for example theres SMODS.has_enhancement(context.other_card, "m_gold")

#

is there like an "m_all" or something like that

#

would next(SMODS.get_enhancements(context.other_card)) work

#

ok it does

#

lol

brittle yacht
#
SMODS.Atlas {
    key = 'miniwage',
    path = 'miniwage.png',
    px = 71,
    py = 95
}

SMODS.Joker {
    key = 'miniwage',
    loc_txt = {
        name = 'Minimum Wage Working Joker',
        text = {
            'After {C:attention}60 minutes,{} gain {C:money}$7{}',
        }
    },
    atlas = 'miniwage',
    pos = { x = 0, y = 0 },
    rarity = 1,
    cost = 2,
    blueprint_compat = false,
    eternal_compat = true,
    perishable_compat = true,
    unlocked = true,
    discovered = true,
    config = { start = 0, inblind = 0, time = 5, timecolor = copy_table(G.C.GREEN), extra = { dollars = 7 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars } }
    end,
    update = function(self, card)
        local time = 5 - (G.TIMERS.REAL - card.ability.start) * card.ability.inblind
        if time <= 0 then
            card.ability.timecolor[1] = G.C.RED[1]
            card.ability.timecolor[2] = G.C.RED[2]
            card.ability.timecolor[3] = G.C.RED[3]
            card.ability.timecolor[4] = G.C.RED[4]
            card.ability.time = "00:00"
        else
            card.ability.timecolor[1] = G.C.GREEN[1]
            card.ability.timecolor[2] = G.C.GREEN[2]
            card.ability.timecolor[3] = G.C.GREEN[3]
            card.ability.timecolor[4] = G.C.RED[4]
            card.ability.time = string.gsub(string.format("%.2f", time), "%.", ":")
        end
        if time == 0 then
            return card.ability.extra.dollars
        end   
    calculate = function(self, card, context)
        if context.blueprint then return end

        if context.add_to_deck then
            card.children.timer = UIBox { definition = { n = G.UIT.ROOT,
                config = { align = "cm", colour = { 0, 0, 0, 0 } },
                nodes = {
                    {
                        n = G.UIT.O,
                        config = {
                            object = DynaText {
                                string = { {
                                    ref_table = card.ability,
                                    ref_value = "time" } },
                                scale = 1.2,
                                shadow = true,
                                colours = { card.ability.timecolor }
                            },
                            align = 'cm'
                        }
                    }
                } }, config = { align = 'cm', major = card, parent = card } }
            card.ability.start = G.TIMERS.REAL
            card.ability.inblind = 1
            return {
                func = function()
                    G.E_MANAGER:add_event(Event({
                        trigger = 'immediate',
                        func = function()
                            return true
                        end
                    }))
                end,
            }
        end
    end
end,

set_badges = function(self, card, badges) end,

inv_badge_info = {
        { key = "credits_code", vars = { "sinkhole" } },
        { key = "credits_art", vars = { "sinkhole" }},
        { key = "credits_idea", vars = { "sinkhole" }},
    },
}```
this guy doesn't add a timer to the card's description, and doesnt give me moeny after 5 seconds (5 seconds for testing)
#

sorry for wall of text

amber turret
#

does anyone know how to make negative antes have score requirements of the non-negative counterpart?

#

Like, make ante -1 and 1 have the same requirement, and -2 and 2 having the same score requirement, etc, instead of negatives having the same requirements of ante 0?

slim ferry
#

hook get_blind_amount(ante) to take the absolute value of ante instead

astral pine
#

I'm not sure if this is exactly a modding question, but does anyone know how to expand the collab skin area like picture 1? I wanna take a preview screenshot but it shows as picture 2 and i'm not sure if it's just a mod I don't know about

amber turret
torn thunder
amber turret
#

wait...

#

was the reason it crashed was BECAUSE OF A DAMN EXTRA COMMA???

astral pine
red flower
white zinc
#

does seltzer not count as a "food joker" in the code?

daring fern
white zinc
#
            if context.card:has_attribute('food') then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
                return {
                    message = localize('k_upgrade_ex'),
                    colour = G.C.MULT,
                }
            end
        end```

using up seltzer doesn't trigger this code
#

oh wait now it did

#

hmm

#

perhaps a bug

glossy dagger
#

First time making a mod, please send help

red flower
#

text = { "description" }
?

glossy dagger
#

... I am so fucking dumb

#

Thanks!

long sun
#

how do i check if the player is in a booster pack, and how do i increase the currently open booster pack's number of choices?

#

oh, you again

#

<@&1133519078540185692>

#

cheers

glossy dagger
#

?

long sun
#

[hmm i suspect they might be deleting their own messages]

#

[they weren't banned last time]

glossy dagger
#

what

long sun
#

anyway

glossy dagger
#

A scammer, where?

long sun
long sun
long sun
glossy dagger
#

i literally add {} at the end and start of the file?

long sun
#

nono

#

add just a }

#

the error says there's a mismatched { somewhere

#

so you need to close it

glossy dagger
#

oh wait, i think what happened

#

No, i didnt know

long sun
#

what did you try?

#

have you tried adding a } at the end of the file?

glossy dagger
#

This is the whole joker btw

long sun
#

add a comma to the end of line 5

#

that's your problem

#

more likely, you misplaced it

glossy dagger
#

WHY THERE IS A COMMA INSIDE THE {}

#

I AM BLIIIND

long sun
#

same -3- i missed that too

#

it happens

glossy dagger
#

My god, thats was it

long sun
#

yay :D

glossy dagger
#

just 2 errors before launching

#

new record

#

Okay, the atlas doesnt work

long sun
#

maybe those four Jokers have the wrong atlas, in the code?

mystic river
glossy dagger
red flower
glossy dagger
#

The atlas seems right

red flower
#

idk about the choices while you're in the pack

long sun
long sun
glossy dagger
#

yeah, just found that

#

I love coding!

long sun
#

wahoo! you found the bug ^u^ well done /gen

viscid talon
#

trying to make a divine blueprint, but i have no idea how to make the joker itself retrigger

glossy dagger
#

IT WORKS, IS ALIVE

viscid talon
#

also i have no idea if my code works either

long sun
#

well. that was easy

#

[also, hello mmmmmjokers joker]

#

i did G.GAME.pack_choices = G.GAME.pack_choices + card.ability.extra.added_choices, for reference

#

it seems that variable is what the booster uses for its selections

red flower
long sun
#

hello??? cool okay

viscid talon
#

how do i make it return ret without the localisation going all funky, bc i tried doing end statements and it kinda didnt want to

long sun
#

omg hawker hai ^u^

median rose
red flower
viscid talon
#

😭 its just one joker

#

the other divine jokers worked out fine, this is the last one i need to program

#

i managed to get divine smeared, divine swashbuckler, divine walkie talkie and a few others working without any bit of help

red flower
median rose
viscid talon
#

whatever ill just scrap it

red flower
sturdy compass
viscid talon
#

astra

#

please

#

not now

sturdy compass
#

I'm trying to be positive 😭

median rose
red flower
median rose
viscid talon
#

i was typing an explanation out but it sounds incomprehensible so ill just get rid of it

#

my main point is

#

i dont want to

red flower
viscid talon
#

at the very least im not relying on ai to help me figure out how to make this work (neither are any of you, but thats besides the point)

median rose
red flower
#

ah

#

it needs to be named lovely.toml or be in a lovely folder

median rose
#

god damn it

#

thank you

viscid talon
#

oh yeah theres a tutorial for that hold on

red flower
viscid talon
#

ah nvm

median rose
red flower
#

organization

#

tags.toml last updated in commit: tags
im very good with names

fading rivet
fading rivet
#

@torn thunder i dont anymore I have learned

primal robin
#

I use it for lua patterns and regexes because they're stupid

glossy dagger
#

I have an idea but i need help

#

look, uhhh

#

is basically a joker called "Go fish" and functions like this:
when (Random card) is drawn from the deck, +10$

#

the random card should work like Idol

#

the problem is "drawn from deck", the fact that appears in your hand, not in the scored cards

#

there is a way?

primal robin
#

look for death note from hotpot

glossy dagger
primal robin
#

yes

glossy dagger
#

Why there is 2?

primal robin
#

idk

torn thunder
#

Because Bmm Sucks

primal robin
#

or this

glossy dagger
#

Nevermind, is just this

#

now the problem is putting this in basically stolen Idol code

tulip pecan
#

Is it possible to make the infobox related to config = { card_limit = 5 } say "Joker slots" as opposed to "area slots" if it's on a joker?

glossy dagger
#

How works "context.end.of.round"?

primal robin
#

this answered in VanillaRemade wiki, I believe

glossy dagger
#

where if i can ask?

tulip pecan
glossy dagger
red flower
primal robin
#

is it custom context?

red flower
#

i think the hotpot context is a new one for better animations

#

yes

glossy dagger
red flower
#

context.hand_drawn is the context for when cards are drawn in a round

glossy dagger
#

but now my problem is generating the same card

#

I could use the same as Idol but that could be kinda cheap

red flower
#

wdym kinda cheap

glossy dagger
#

like, too lazy?, idk

red flower
#

i was about to tell you to look at what idol does lol

red flower
#

i wrote all the ones in vanillaremade so people copy best practices instead of inventing their own stuff lmao

glossy dagger
red flower
#

ah did you mean literally using the one for idol

glossy dagger
#

yeah

red flower
#

just copy the way it chooses

frozen bay
primal robin
#

Good start

glossy dagger
#

i can create a G. variable or i am just bullshitting?

red flower
glossy dagger
red flower
#

yeah

glossy dagger
#

Whole code btw

#

just changed everything mail related with fishing

#

(Because is the Go fish joker)

urban wasp
#

i want it so that if a specific deck is selected, every instance of the vanilla sound "card1" is replaced by a sound in my mod. how could i accomplish this?

red flower
#

hook play_sound probably

glossy dagger
#

help pls

red flower
#

how does the config look like

glossy dagger
#

fixed it

#

i think

#

i need help

#

again...

#

I need a way that the text shows the card selected by the variable fishing_card

#

i can send the whole code

red flower
#

in the loc_vars return you are using vremade_mail instead of your card

#

and then in the description you're not using the card which would be #2#

glass scaffold
glossy dagger
glass scaffold
glossy dagger
#

My code is:
loc_vars = function(self, info_queue, card)
local fishing_card = G.GAME.actualround_fishingcard or { rank = 'Ace', suit = 'Spades' }
return { vars = { card.ability.extra.dollars, localize((G.GAME.current_round.going_fishing or {}).rank or 'Ace', 'ranks') } }
end,
calculate = function(self, info_queue, card)
if context.hand_drawn and not context.other_card.debuff and
context.other_card:get_id() == G.GAME.actualround_fishingcard.id then
G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra.dollars
return {
dollars = card.ability.extra.dollars,
func = function() -- This is for timing purposes, it runs after the dollar manipulation
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.dollar_buffer = 0
return true
end
}))
end
}
end
end

#

and for the generator or how is called:
local function reset_current_fishing_card()
G.GAME.actualround_fishingcard = { rank = 'Ace' }
local valid_fishing_cards = {}
for _, playing_card in ipairs(G.playing_cards) do
if not SMODS.has_no_rank(playing_card) then
valid_fishing_cards[#valid_fishing_cards + 1] = playing_card
end
end
local fishing__card = pseudorandom_element(valid_fishing_cards, 'going_fishing' .. G.GAME.round_resets.ante)
if fishing_card then
G.GAME.current_round.going_fishing.rank = fishing_card.base.value
G.GAME.current_round.going_fishing.id = fishing_card.base.id
end
end

red flower
#

those are not the arguments for calculate

#

you can name them whatever you want but you know what i mean

glossy dagger
#

uuuuhhhh

#

Then why in vanilla remade mail in rebate is like this?

gilded blaze
#

it's loc_vars, not calculate

#

uh, mail is also the vanilla key

glossy dagger
#

i mean

#

uhhh, forgot to clearifie that

#

it works, i think

urban wasp
#

how would i make it so that a card front (as in, the default card texture that you see on the front/technically middle of playing cards) is set to a custom texture when a specific deck is used?

#

kinda like how it's changed with enhancements

dawn knoll
#

can someone help me make a planet card

red flower
#

depends on what you need help with

naive coral
#

how could i , if possible get the total amount of time needed to finish all jokers scoring? like say you have a baron mime build and it takes 30s to score because it has like 10 red seal steel kings

shell timber
#

you could use love.timer.getTime() before and after scoring

median rose
#

I am trying to check which specific playing card is being affected by the magician when in a blind. However, when I run what I have, the cards do not have the enhancement. Ik this bc print_playing_cards prints out "5 of Hearts, 9 of Diamonds..." when it should be "5 of Hearts (Lucky Card), 9 of Diamonds (Lucky Card) ...". I would show the print statement, but it's too long. I need to figure out either: 1. if there's a what to select a card via a individualized value like an id (not the way that variable is currently used) or 2. a way to get new G.hand.cards after the ehancements are applied. I would preferably like to do the latter bc it sounds easier. Does anyone know how to do either?

--gamestate.lua
GameState = {
    playing_cards = {}, -- the playing cards in hand during a blind
}

function GameState.set_playing_cards(cards)
    local copy = {}
    for _, card in ipairs(cards) do
        table.insert(copy, card)
    end
    GameState.playing_cards = copy
end

return GameState
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
for i=1, #G.hand.highlighted do
    G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function() G.hand.highlighted[i]:set_ability(G.P_CENTERS[self.ability.consumeable.mod_conv]);return true end }))
end
'''
position = 'after'
match_indent = true
payload = '''
if G.GAME.blind.config.blind.key ~= nil then
    local key = self.config.center_key
    if consumable_index[key] == "Magician" then
      GameState.set_playing_cards(G.hand.cards)
      GameState.print_playing_cards()
    end
end
'''
#

I apologize for the edits. I try to cut out code that is irrelevant to the problem, but I realized there were some lines that didn't make sense, so I added them in

red flower
#

put it in another event

median rose
dawn knoll
#

what code do i use to upgrade a specific hand type by multiple levels

urban wasp
#

how would i detect how many retriggers occurred in a played hand

red flower
urban wasp
red flower
#

if it runs immediately here then it's before the cards are enhanced

dawn knoll
red flower
#

instead of card.config it should be card.ability

#

also your smods seems very outdated

#

that's causing the crash

dawn knoll
#

yippee it worked

#

thank you

urban wasp
#

oops didn't mean to put that

#

ignore picture

glossy dagger
#

wrong file, this is the real one

urban wasp
#

how would i make it so that a text ui element is essentially given {E:1}

iron oxide
#

localizing iirc

urban wasp
#

would track

glossy dagger
#

i fixed the code... kinda

#

the joker doesnt do anything

red flower
#

context.hand_drawn is the list of cards drawn

glossy dagger
#

i already fixed that

red flower
#

it doesn't look like you did it properly from the code you sent in general

#

stay_flipped will run for other things other than from deck to hand so you also need to check the areas

glossy dagger
urban wasp
#

why doesn't my sound play in my joker? (yes the mod prefix is correct)

return {
    xmult = card.ability.extra.xmult,
    sound = "bof_alarm_ring"
}
SMODS.Sound({
    key = "alarm_ring",
    path = "alarm_ring.ogg",
    loop = false,
    volume = 0.5,
})
frosty dock
#

you need to either use xmult_message with sound inside or remove_default_message + message

languid kiln
#

Hello! I really didn't want to be spoon fed code but at this point it is the only way I'm gonna figure this out.
Basically, I want to make a joker that swaps the cards in hand with cards played. I tried a bunch of different things and this was the closest one to actually working:

SMODS.Joker {
  key="swap_joker",
  loc_txt = {name = "Swap Joker", text= {"Cards in {C:attention}hand{} are","scored instead of"," cards {C:attention}played{}"}},
  rarity = 2,
  atlas = "swap_joker",
  cost = 4,
  unlocked = true,
  blueprint_compat = false,
  eternal_compat = true,
  perishable_compat = true;
  calculate = function (self, card, context)
    if context.before then
      local temp = G.play.cards;
      G.play.cards = G.hand.cards;
      G.hand.cards = temp;
    end
  end
}

This swaps the card positions alright, but for some reason none of the cards are scored and there is a bunch of jank with it, like for example after playing a hand the cards previously in hand aren't usable anymore. Can someone please help me solve this?
-# Also if there is another way to achieve the joker description I'd love to learn about that

gilded blaze
#

you just swapped the references of 2 card areas that hold cards

#

of course it's gonna break

languid kiln
#

but this ended up somehow not even carrying the cards properly and it had worse jank

#

i hope someone doesn't roast me for this code i genuinely have no idea what I'm doing 😭 im new to balatro modding

daring fern
languid kiln
#

doesn't shallow_copy return a table tho? I thought that would get rid of the card objects being a Card

frosty dock
#

it copies the existing Cards into a new table, it doesn't recreate them

urban wasp
#

my attempts have been in vain

#

i'm talking about the sprite to the right of red deck here

daring fern
urban wasp
#

oh ok

urban wasp
# daring fern You would have to hook `Card:set_sprites`, also that's called the `center` sprit...

this is my best shot, but it's not replacing anything; what am i doing wrong?

local original_card_set_sprites = Card.set_sprites
function Card:set_sprites(_center, _front)
    original_card_set_sprites(self, _center, _front)
    if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_bof_l_wooden" and self.config.center and self.config.center.set == "Card" then
        self.sprites.center = G.ASSET_ATLAS["wooden"]
    end
end
#

the "l" in the key is intentional

frosty dock
#

it's "Default" for base cards and "Enhanced" for enhanced cards

urban wasp
#

ah

#

ok now i'm confused

local original_card_set_sprites = Card.set_sprites
function Card:set_sprites(_center, _front)
    original_card_set_sprites(self, _center, _front)
    if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_bof_l_wooden" and self.config.center and self.config.center.set == "Default" then
        self.sprites.center = G.ASSET_ATLAS["wooden"]
    end
end
#

ok the crash just needed a nil check but it still doesn't work

frosty dock
#

well yeah self.sprites doesn't exist

#

look at how base Card:set_sprites actually works

urban wasp
#

oh what then how do i change the sprite

#

i thought that'd be it

frosty dock
#

the sprite is stored in self.children.center and you need to create an actual Sprite, e.g., using SMODS.create_sprite

urban wasp
#

i mean i have a texture in an atlas of just that

#

i assume then i need something more than that?

frosty dock
#

yeah but that's an atlas and not a Sprite

#

Also the atlas key likely needs your mod prefix unless you've specifically made it not

urban wasp
#

ok well that's a step in some kind of direction

local original_card_set_sprites = Card.set_sprites
function Card:set_sprites(_center, _front)
    original_card_set_sprites(self, _center, _front)
    if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_bof_l_wooden" and self.config.center and self.config.center.set == "Default" and self.children then
        self.children.center = SMODS.create_sprite(0, 0, self.T.w, self.T.h, "bof_wooden", { x = 0, y = 0 })
    end
end
#

i tried doing what i saw but i don't think i got it all down

#

they're attached to the cards in some way just not where they're supposed to be

daring fern
# urban wasp they're attached to the cards in some way just not where they're supposed to be
if self.children.center then self.children.center:remove() end
self.children.center = SMODS.create_sprite(0, 0, self.T.w, self.T.h, 'bof_wooden', {x = 0, y = 0})
self.children.center.states.hover = self.states.hover
self.children.center.states.click = self.states.click
self.children.center.states.drag = self.states.drag
self.children.center.states.collide.can = false
self.children.center:set_role({major = self, role_type = 'Glued', draw_major = self})
urban wasp
#

that worked perfectly thank you

willow nimbus
#

getting this error because of SMODS.Font, not sure what the mistake is here

wintry solar
willow nimbus
#

yeah sure hangon

#

please ignore the name of the mod i started making it around the start of last year

#

also have noticed that it only crashes when i try and use it as a font in a loc_txt

long sun
#

how can i not ignore it 😭

willow nimbus
long sun
#

okay 🥀

wintry solar
willow nimbus
#

that is

#

not surprising

#

i really only picked up development two days ago

wintry solar
#

They predate font support

willow nimbus
#

Okayyyy yeah that makes sense

#

Easy fix though

#

Cheers

gilded blaze
#

when will smods go out of beta

willow nimbus
#

i have 1.0.0-beta-1620a and ive put that in the json

#

it still says this though, despite the fact that i've changed the dependency in the json

slim ferry
#

did you save the file

willow nimbus
#

i did yeah

#

both the main.lua file and the json

slim ferry
#

did you reload the game after that

willow nimbus
#

yeah

slim ferry
#

are you editing the mod in the mods folder instead of some copy located elsewhere

willow nimbus
#

ive saved both files several times and ive reopened the game several times

willow nimbus
#

might just restart my pc and hope for the best honestly

#

oh

#

got it

#

just disabled and reenabled the mod in the mods menu

silk latch
# frosty dock if you want to initalize a config variable based on something in `G.GAME`, you h...

So like this?

SMODS.Consumable { -- I, Super Jump
    key = 'superjump',
    set = 'WheelofFate',
    atlas = 'ghostfort',
    pos = {
        x = 0,
        y = 0
    },
    set_ability = function(self, center)
        center.ability.extra.xmult = 1.5
        center.ability.extra.duration = math.ceil((2 + (G.GAME.extended_duration_turns or 0)) *
            (G.GAME.extended_duration_mult or 1))
    end,
    --    select_card = 'consumeables',

    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.extra.xmult,
                card.ability.extra.duration
            }
        }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult,
            }
        end
        if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
            card.ability.extra.duration = card.ability.extra.duration - 1
            if card.ability.extra.duration <= 0 then
                SMODS.destroy_cards(card, nil, nil, true)
            end
        end
    end,
    use = function(self, card, area, copier)
    end,
    can_use = function(self, card)
        return true
    end
}
frosty dock
silk latch
weak grove
#

how do i apply accendant stake to a custom stake i made?

frosty dock
frosty dock
weak grove
#

got mad.

weak grove
frosty dock
weak grove
#

well whats the key i should us

#

e

#

?

#

what r u saying?

frosty dock
#

the key as it actually is, which is "cry_ascendant", lower case. also applied_stakes are prefixed by default, which means you need to add prefix_config for it

frosty dock
weak grove
#

config?

frosty dock
#

prefix_config = { applied_stakes = { mod = false } } if you need that spoon-fed

weak grove
#

well jeez im kinda new to applying stakes

#

whats the {mod = false} for?

frosty dock
#

smods otherwise assumes that the stake you want to apply is from your own mod

#

which it isn't, so you need to let it know that you've supplied the correct prefix yourself

weak grove
#

ahhh

frosty dock
#

this is all explained in smods docs if you wanna learn about it in more detail

glass scaffold
#

I have it bookmarked for when I decide to make another stupid thing in my mod, but yeah, it has almost every little thing documented.

glass crown
#

i put this patch into my mod, but it doesnt seem to be taking effect? its supposed to just literally duplicate the hand level up code in the hand level up function basically, but nothing new happens, not even a crash. can someone point me to whats going wrong here exactly? (its worth noting, while im currently trying to just duplicate the level up, im gonna clean this up more later and make it like work better)

#

nevermind i figured out a way cleaner, faster, working implementation of exactly what i wanted to do LMAO

sturdy compass
#

Dev ingenuity lol

frosty dock
#

In this case, smods is adding an extra parameter: function level_up_hand(card, hand, instant, amount, statustext)

glass crown
#

ahhh i see okay noted for the future

silk latch
# frosty dock not sure why you'd name the parameter `center`, but I guess that's fine. you do ...

so

SMODS.Consumable { -- I, Super Jump
    key = 'superjump',
    set = 'WheelofFate',
    atlas = 'ghostfort',
    pos = {
        x = 0,
        y = 0
    },
    set_ability = function(self, card)
        card.ability.extra.xmult = 1.5
        card.ability.extra.duration = math.ceil((2 + (G.GAME.extended_duration_turns or 0)) *
            (G.GAME.extended_duration_mult or 1))
    end,
    --    select_card = 'consumeables',
    config = {
        extra = {
            xmult = 1.5,
            duration = 2,
        }
    },
    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.extra.xmult,
                card.ability.extra.duration
            }
        }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult,
            }
        end
        if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
            card.ability.extra.duration = card.ability.extra.duration - 1
            if card.ability.extra.duration <= 0 then
                SMODS.destroy_cards(card, nil, nil, true)
            end
        end
    end,
    use = function(self, card, area, copier)
    end,
    can_use = function(self, card)
        return true
    end
}
frosty dock
#

setting xmult in set_ability is redundant but this looks fine to me

silk latch
#

cool

#

just wanted to make sure lol

white zinc
#
        if context.reroll_shop then
            self.config.current_reroll_cost = context.cost + 1
        end
        if context.end_of_round then
            G.GAME.current_round.reroll_cost = self.config.current_reroll_cost
            G.GAME.round_resets.reroll_cost = self.config.current_reroll_cost
        end
    end```

this is the code i have right now for a deck who's rerolls only increase in price. the problem with this is that with the way i coded it, chaos the clown and both reroll vouchers basically scam you. is there a better way i can code this deck so that these don't break? or would i need to patch the game to fix these issues manually?
weak grove
#

whats the code for a ui box?

white zinc
weak grove
red flower
#

you can put ui code wherever

#

i honestly wouldn't recommend doing anything ui related if you are very new

red flower
weak grove
#

i am very new to making ui

white zinc
# red flower what does it do currently

chaos the clown sets the rerolls to $0 when you buy him, but doesn't give you a free reroll in any future shop. the vouchers (last time i checked) give you a discounted first reroll price when bought but then it goes back in all future shops

#

or are you asking ab the code?

red flower
#

no it was that

#

and what is your deck supposed to do? just increment by 1 extra each time?

#

ah no i see

#

i would hook function calculate_reroll_cost

white zinc
fading rivet
#

wait its a deck

#

deck calculate

red flower
#

or am i misunderstanding

white zinc
red flower
#

yeah ok then i would hook that function and change the logic for your deck

#

instead of using calculate

white zinc
#

i've never done hooks before. can you link me to the documentation?

red flower
white zinc
#

so i would just put the code i have in my calc function into a hook?

red flower
#

no, the logic should be different

#

you can look at the original, its like 5 lines
you would need a global that takes into account the increases like you had with self.config (which i just realized that is wrong because self.config is not saved it should be back.effect.config) and then change the current cost to that while taking into account the free rerolls

white zinc
red flower
#

yes

#

well, the lovely/dump but yes

white zinc
red flower
#

yeah

white zinc
#

there's already a global reroll counter?

#

i assume i'm looking for the function that actually rerolls the shop

glossy dagger
#

Someone can say whats wrong with my code? (The problem is that "valid_fishing_card" appears as null (This is my first time coding pls dont be so hard))

red flower
white zinc
#

there's the Game:update_shop(dt) code, but i assume that runs each time the shop is loaded, not specifically rerolled

weak grove
#

how to get past this?

red flower
#

i dont understand why youre looking for reroll code

fading rivet
#

but i wouldn't recommending hooking it

weak grove
white zinc
fading rivet
#

theres definitely a better way

fading rivet
red flower
#

this one

white zinc
#

oh, no i missed that

#

OHHH i was looking in the wrong code

fading rivet
#

also if that doesn't work, G.FUNCS.reroll_shop probably exists

white zinc
#

apologies

red flower
#

that doesnt solve the problem

fading rivet
#

hmm

red flower
#

i already gave a solution!!

glass crown
#

how would i go about making a deck start with no numbered cards? (A - 10)

fading rivet
#

you can't edit that file so that vscode doesn't implode

red flower
glass crown
#

ooo thank you! :3

glossy dagger
glossy dagger
red flower
#

do you call reset_vremade_mail_rank in the rest globals function

glossy dagger
#

how i do that?

red flower
#

read the comment in that section of vremade and check the bottom of the jokers.lua file

weak grove
fading rivet
#

do you need step by step instructions?

red flower
glossy dagger
#

I am a disaster dude

red flower
#

what is that line

fading rivet