#💻・modding-dev

1 messages · Page 661 of 1

dapper sun
#

we were both trying to figure it out at the same time

viscid talon
#

bump

#

how do i make it gain mult in the correct area

#

joker_main isnt working

umbral zodiac
#

hi i am lily

viscid talon
#

instead it gains mult on the cards

#

not the actual joker

dapper sun
#

hi lily

viscid talon
#

which is rly confusing

umbral zodiac
#

have some aqu code

--returns a movable's pixel position (center)
function aquill.get_movable_pixel_pos(mov)
    return {
        (G.ROOM.T.x + mov.VT.x + mov.VT.w * 0.5) * (G.TILESIZE * G.TILESCALE),
        (G.ROOM.T.y + mov.VT.y + mov.VT.h * 0.5) * (G.TILESIZE * G.TILESCALE),
    }
end
dapper sun
#

ty

umbral zodiac
#

this particularly works for cards but it should technically work for any movable element, though im unsure since ive never had to test it

thorny wigeon
#

Hey I don't wanna jump in mid conversation but I wanted to just say that I've been trying to make a mod all day and I've finally gotten to a point where all the art is finished.
I've followed multiple tutorials, copied multiple mods and tried to copy what they do, but mine doesn't work. The mod loader sees it and it's in the mod list with my custom icon, but the deck doesn't work. Originally I was trying to make it work like the Collabs so I just changed the face cards, but I ended up replacing the entire deck. I don't get any errors, the textures just don't load and going into "Customize deck" doesn't have any new options.

If I don't reply to anyone its because I need to dip for a bit :)

dapper sun
#

that format's old af

thorny wigeon
#

Darn

#

I've tried to go through the mods I have that are working but idk how to read any of them

faint yacht
thorny wigeon
#

I have to go for a bit but I'd appreciate any help

red flower
thorny wigeon
past ridge
#

i got this right after i clicked "play"

dapper sun
#

share code

past ridge
red flower
past ridge
#

no

red flower
past ridge
#

oh alr

red flower
#

you shouldn't be using dev steamodded tho

#

use the latest release

past ridge
#

oh kk

dapper sun
#

i'm still kinda stumped on how to adjust the rotation pivot point for a sprite, as i've tried changing all sorts of vars but can't find it

#

(the dot in the sprite is where it's pivoting from instead)

cloud thistle
#

bump

wraith jolt
#

Those anyone know who the person behind Luna Enchantment mod? I saw once looking for it again and can't find it

hardy vessel
#

Question about context.press_play, is there a way to get scoring cards from it? Because context.scoring_hand returns nil

vale zinc
#

In G.FUNCS.can_discard = function(e), just what is passed as the argument e?

frosty rampart
slim ferry
vale zinc
# slim ferry The discard button ui element

You mean this?

local discard_button = {n=G.UIT.C, config={id = 'discard_button',align = "tm", padding = 0.3, r = 0.1, minw = 2.5, minh = button_height, hover = true, colour = G.C.RED, button = "discard_cards_from_highlighted", one_press = true, shadow = true, func = 'can_discard'}, nodes={
    {n=G.UIT.R, config={align = "cm", padding = 0}, nodes={
        {n=G.UIT.T, config={text = localize('b_discard'), scale = text_scale, colour = G.C.UI.TEXT_LIGHT, focus_args = {button = 'y', orientation = 'bm'}, func = 'set_button_pip'}}
    }}
}}
slim ferry
#

yes

#

taht

vale zinc
#

That discard_button, is that a global variable that I can call up in any old function call?

frosty rampart
#

the little local right next to it seems to indicate no

vale zinc
#

How do I make it call-able in any circumstance?

frosty rampart
#

i think it gets saved as part of G.buttons or something, but i dunno the exact details off the top of my head

vale zinc
#

Do I just pass G.buttons.definition.nodes[3]?

frosty rampart
#

i'm curious, what's the use case for being able to arbitrarily disable any button at all? i feel like unless you genuinely need to do it for a bunch of different buttons, it might be better to just hook/patch into whatever determines the state of the button(s) you need to modify

tulip pecan
#

Nvm we figured it out

frosty rampart
# vale zinc [I tried that](https://discord.com/channels/1116389027176787968/1233186615086813...

in the patch:

local calc_returns = {}
local disable = false
SMODS.calculate_context({
  LAPSEMS_should_the_discard_button_be_blocked = true,
  full_hand = G.hand.highlighted
}, calc_returns)
for _, v in pairs(calc_returns) do
  for _, w in pairs(v) do
    if w.disable then
      disable = true
      break
    end
  end
  if disable then break end
end
if disable then
  if (G.GAME.current_round.hands_left >...

in the calculate function, replace return true with return { disable = true }, and just remove the return false entirely

vale zinc
frosty rampart
#

by passing it to the calculate_context function call, it gets populated with all the return tables from all the objects that calculate in-game

#

i can confirm that this works because i have the exact same setup in my own mod for my own custom contexts

frosty rampart
# vale zinc What things do you use it for?

for my custom dice consumables, i have a context for modifying the value of a roll (much like how modifying a probability works in smods), a context for triggering rerolls of the dice, a context for modifying what a die's min and max values are (so e.g. i have a voucher that guarantees all dice roll in the upper half of their usual range, by setting the min to the die's max / 2), and a simple "post_roll" context that triggers after the die finishes rolling and goes back to the consumables slot

thorny wigeon
#

How do you add new collabs so I can reskin all the collabs to have a colour for each suit?

frosty rampart
fading rivet
#

how could I get the number of chips a card scores before any extra effects, and permanently modify it if possible

sleek valley
#

im trying to make jokers that apply probabilities to every card in the played hand but it's not exactly how i want it

for k, scored_card in ipairs(context.scoring_hand) do
  if SMODS.pseudorandom_probability(card, 'prefix_joker', 1, card.ability.extra.burn_odds) then
    --effect in here
  end
end

if i put the for loop inside the pseudorandom_probability, then the game does one roll for all the card, but as it is right now, it rolls for every card but only applies to one, when i want it to roll for all and apply individually

#

so if two cards in the same hand land a 1 in 5, i want them both getting it, but rn only one does

slim ferry
#

Are you returning during the loop?

sleek valley
#

yeah, inside the pseudorandom_probability

#

should i not be?

slim ferry
#

returning ends the function

#

So yeah you shouldnt

sleek valley
#

ah
well now i feel dumb for not catching that sooner lol

slim ferry
#

You could do SMODS.calculate_effect instead

#

If rhat works for whatever youre doing

sleek valley
#

lemme test just setting the return outside the loop first, then we'll see

#

it works celebrationtime

fading rivet
sleek valley
dapper sun
#

i'm losing my mind

#

just asked her and it turns out she'd given up

primal robin
#

I mean theres no variables to adjust rotation point

dapper sun
#

exactly

#

that's why i'm going insane

#

idk how to change it

primal robin
#

Draw function do calcs how to translate and rotate itself

dapper sun
#

i'm already doing draw functinon stuff

#

the tilting and shit is shader stuff

#

i can't touch it

#

there's no way to with normal shader stuff

#

the offset shit doesn't even seem to work

primal robin
#

Now i see, dot placed in a center of soul sprite of regular size

dapper sun
#

yea

#

it's rotating around that instead of the actual center

primal robin
#

How did you do a sprite this big size

dapper sun
primal robin
#

What a convoluted way to do that

dapper sun
#

because there's no easy way to do it

primal robin
#

Isnt should be easier just override set_sptites function and create floating sprite of correct size

dapper sun
#

i've set the atlas

#

are you suggesting i set the floating_sprite to a new Sprite

primal robin
#

I mean, yes, since you need adjust actual sprite sizes

#

Theyre set on creation

dapper sun
#

well,,

#

the dot is centred

#

and it's not doing the tilt stuff either

#

since it's a new sprite

#

so this is even further from what i want

#

😭

short fulcrum
#

I'm trying to create a Joker that has a chance of making Jokers in the shop and booster packs Negative. The booster pack part seems to work, but the part for the shop only seems to work on the initial Jokers in the shop. Any Jokers after that (like from rerolls) aren't affected

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''
G.shop_jokers:emplace(create_card_for_shop(G.shop_jokers))
'''
position = "after"
payload = '''
local new_shop_card = G.shop_jokers.cards[#G.shop_jokers.cards]
SMODS.calculate_context({my_singing_jokers = {
    change_shop_cards = true,
    card = self,
    shop_card = new_shop_card
}})
'''
match_indent = true
#
    calculate = function(self, card, context)
        if context.my_singing_jokers and context.my_singing_jokers.change_booster_cards and context.my_singing_jokers.before_cards_added then
            for k, v in pairs(context.my_singing_jokers.pack_cards) do
                if v.ability.set == "Joker" and v.config.center then
                    if SMODS.pseudorandom_probability(card, 'mysingingjokers_permatorch', 1, card.ability.extra.odds) and ((v.edition and v.edition.key ~= 'e_negative') or v.edition == nil) then
                        v:set_edition({ negative = true }, true)
                        v:set_cost()
                    end
                end
            end
        end
        if context.my_singing_jokers 
        and context.my_singing_jokers.change_shop_cards 
        and context.my_singing_jokers.shop_card then
            print("card")
            local v = context.my_singing_jokers.shop_card

            if v.ability.set == "Joker" and v.config.center then
                if SMODS.pseudorandom_probability(card, 'mysingingjokers_permatorch', 1, card.ability.extra.odds)
                and ((v.edition and v.edition.key ~= 'e_negative') or v.edition == nil) then
                    
                    v:set_edition({ negative = true }, true)
                    v:set_cost()
                end
            end
        end
    end
}
#

I've been trying to fix this for like 3 hours and I'm starting to fall into despair

hardy vessel
#

Question about blind loc vars. How can I make the hand_mod value show up in the collection? It shows up in a run just fine, but returns nil in the collection

config = { hand_mod = 1 },
loc_vars = function(self)
    return { vars = { self.config.hand_mod } }
end,
collection_loc_vars = function(self)
    self:loc_vars()
end,
red flower
#

there's another loc vars for the collection

surreal quail
#

how do i make a mod change the in-game music

red flower
normal crest
#

kitty

versed swan
#

lovely question: What's the difference between dump and game-dump?

sturdy compass
#

Just a guess, but I'd imagine game-dump is the vanilla game files pre-patches being applied

versed swan
#

oh wait i should have checked if one or the other has been depreciated, i didn't clear my lovely dir before updating to 0.9

sturdy compass
#

ah I see

#

I still haven't updated so Cluegi

versed swan
#

nope, both generate

#

compared card.lua in both, identical

sturdy compass
#

wonky

frosty rampart
#

i've never seen the game-dump folder tbh, it's not a lovely thing

frosty rampart
versed swan
#

Installed but disabled

frosty rampart
#

hm i see
does it stop generating game-dump if you move it out of the mods folder?

tepid crow
umbral zodiac
#

i dont have frosts utils and i have game dump folder

red flower
#

game dump is supposedly the dump without patches

#

but i think its not working

frosty rampart
#

strange

#

i dunno why i have literally no memory of it then lmao

red flower
#

its new

tepid crow
#

Then again, I'm not a lovely maintainer (or even rust programmer) so this is just advanced guessing

red flower
frosty rampart
tepid crow
versed swan
#

(at least last i checked)

frosty rampart
#

yea fair, i realized that like right after i sent the message
it won't provide the source code unless you've already purchased the game, since it only generates it at runtime

tulip pecan
#

is it possible to get the default config = { extra = { } } values of a joker that is not currently in play? I heard something about self.config earlier but I don't know how to set that up, so any help would be greatly appreciated.

frosty rampart
#

G.P_CENTERS.j_modprefix_jokerkey.config should do it i think

gaunt thistle
#

not super super high importance to get it fixed since nothing really uses it yet

#

but it is pretty ugly

versed swan
#

i see

gaunt thistle
#

yeah just a dumb mistake on my part :P

versed swan
#

is the rotation unit in balatro degrees or radians?

primal robin
#

Radians

versed swan
#

thank you

#

actually how do you rotate attention_text?

#

tried rotate arg and it doesnt work

#

...oh, rotate takes 2 or truthy

near coral
#

So for a consumable that turns specific jokers into other specific jokers, is it possible to make it happen without editing the code of the vanilla jokers

#

I'm afraid that if the vanilla jokers are edited then it'll conflict with some other mods that also edit them

#

Actually let me reword it

#

Using a consumable that transforms jokers into other jokers, is it possible to assign vanilla jokers a specific joker to turn into without touching the code of said vanilla jokers

mystic river
#

is there a built-in way for the collection card of an edition to be a playing card or do i have to just make an atlas of a fake card

tepid crow
near coral
mystic river
#

e.g.

SMODS.Joker:take_ownership{"joker", {
 bizarrlo_upgrade = "j_stuntman"
}, silent)
near coral
tepid crow
#

Yeah

mystic river
#

big lookup table, then

near coral
#

Whar is a lookup table

mystic river
#

you need some method of taking the card you have as input and getting the card you want as output

mystic river
near coral
#

Oh

#

And it's in the consumable code?

mystic river
#

in lua it'd look like

MOD.empower_chart = {
 j_joker = "j_stuntman",
 j_greedy = "j_rough_gem"
 -- ,,,etc
}
mystic river
tepid crow
vernal path
#

color grading except each pixel is transformed into a joker rather than a different color using a LUT

near coral
mystic river
#

and the consumeable would have a line something like

 local orig_key = card.config.center.key
 local new_key = MOD.empower_chart[orig_key]
mystic river
#

you wouldn't define every individual joker effect on jimbo

near coral
#

I meant like "if [consumable] is used then turn into [joker]" type of stuff

vernal path
near coral
#

But on every joker thus spreading the table across every affected joker

hoary spear
#

How could I add like, "tags" to a joker/consumable/whatever, that other cards/jokers/consumables can check for? Like pokermon energy types but with multiple at once ?

mystic river
vernal path
#

oops sorry @hoary spear

hoary spear
#

Okay, config table was kinda what I was thinking to

#

Then how would the searching them work?

tepid crow
#

you'd probably do something like {tag1 = true, tag2 = true, ...} and then just check if the key exists

hoary spear
#

Mhm

vernal path
#

something like next(SMODS.find_card("j_jimbo").config.ability.extra.tag[tag1] or something
actually, i dont think thats valid but i hate lua so i can never remember how to do stuff like that
yeah that'd right lars

hoary spear
#

Thanks y'all:)

vernal path
#

yuh

tepid crow
mystic river
#

setting atlas to a custom suit kind of works, but it only renders the front, not the center

tepid crow
#

oh unless that's what you already meant with "atlas of a fake card" lmao

mystic river
#

yeah

plucky lantern
#

any advice on how to not be scared to start trying to make smthn? ugh i have smthn i want to make but like i'm scared of trying for some reason 😭

frosty rampart
#

mood lol
wanna talk about what you're trying to make? positive reinforcement from others might help

plucky lantern
#

-# yeah nvm i'm too shy for that i should probably give up like i do with everything else in my life

frosty rampart
#

hey no wait :<

#

you can dm me about it if you'd rather, my dms are very much open

near coral
plucky lantern
#

fair

near coral
#

If you do make something, then cool you get to show it off and built on it if you want
Though if not then there's nothing for people to care about and you end up complaining about your virtual stage freight in a dev channel for nothing

near coral
# plucky lantern fair

This is gonna sound kinda mean but know I'm not trying to make you feel bad, it just needs to be said bluntly
Nobody cares if you do or don't make something, in the event you do itg will rightfully be subject to constructive criticism, if someone is mean about it that's their fault for lacking the maturity

hoary spear
near coral
#

But please don't make the fate of your hypothetical project our problem, you can request help but emotional support is not obligate

vale zinc
#

Changing the background color with ease_background_colour{} resets the color after a Hand/Discard is used. How do I make it stick instead?

plucky lantern
frosty rampart
vale zinc
split creek
#

Any ideas why my patch might not be patching?

[patches.pattern]
target = "functions/state_events.lua"
pattern = '''ease_to = G.GAME.chips + math.floor(hand_chips*mult)'''
position = "after"
payload = ''' + math.floor(G.GAME.mtg_bonus_chips)'''
match_indent = true```
Targeting this part of state_events.lua:
```lua
G.E_MANAGER:add_event(Event({
      trigger = 'ease',
      blocking = false,
      ref_table = G.GAME,
      ref_value = 'chips',
      ease_to = G.GAME.chips + math.floor(hand_chips*mult),
      delay =  0.5,
      func = (function(t) return math.floor(t) end)
    }))```
split creek
#

Does it have to be the whole line?

frosty rampart
#

ye
"after" patches have to match a whole line and will inject a new line, they can't add onto an existing line
you probably have to do an "at" patch instead

split creek
#

got it, thanks!

versed swan
#

how do you rotate a ui element?
edit: add to the node's config table func="exampleFunc", then create the following function:

function G.UI.exampleFunc(e)
  e.T.r = number
end
frosty rampart
tepid crow
split creek
#

well i'm using at now and it's still not working. I've checked smods and it doesn't look like it changes this line (and the only other loaded mod is debugplus, which doesn't alter it either)

[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = '''ease_to = G.GAME.chips + math.floor(hand_chips*mult),'''
position = "at"
payload = '''ease_to = G.GAME.chips + math.floor(hand_chips*mult) + math.floor(G.GAME.mtg_bonus_chips),'''
match_indent = false```
frosty rampart
tepid crow
tepid crow
#

And I remember that being such a pain to find out myself by trial and error

tepid crow
tepid crow
split creek
#

Am i misunderstanding this warn message then?

tepid crow
#

No, you've got that right 🤔

split creek
#

I'm using the dev branch of smods...?

frosty rampart
#

do you maybe have any other mods that could be patching around there?

#

or maybe yea dev smods could be doing that too

tepid crow
#

that could be an issue? doubt it but could be

daring fern
frosty rampart
#

yea that sounds like something smods would patch in

split creek
#

oh you're so right

tepid crow
#

oh I'm testing this without smods lmao

split creek
#
[patches.regex]
target = "functions/state_events.lua"
pattern = "^(.*)hand_chips\\s*\\*\\s*mult(.*)$"
position = "at"
payload = '''$1 SMODS.calculate_round_score() $2'''```
#

I was looking for ease_to when i checked smods, so i missed this

split creek
#

Thanks everyone!

bold gyro
#

how do i make a card with a static base layer, but with an animated soul layer? is it possible to use two atlases (one ASSET_ATLAS, and one ANIMATION_ATLAS) on an object?

umbral zodiac
#

idk if thats a supported feature by default, but if its not you could prolly just apply the soul layer via drawstep

shrewd cobalt
#

How would I go about having a Joker's art change when it's spawned in shop? I want to have a funny rare chance a joker art is different when its spawned

daring fern
shrewd cobalt
#

Thanks!

granite jay
#

Is there a P_CENTER_POOL for Blinds?

daring fern
granite jay
#

Thx

true jasper
#

how would i make all planet cards (modded included) have something extra in their definition since im tryna make them all have the base rarity of common since im making planets have different rarities

normal crest
shrewd cobalt
#

is pseudorandom ran on set_sprites?

daring fern
jolly pivot
#

is there a way to change the sprite of a joker

#

oh wait is that it

#

set sprite

daring fern
jolly pivot
daring fern
jolly pivot
#

does that function have any special effects or is it instant

#

not necessary at all it would just feel better to me

daring fern
shrewd cobalt
daring fern
shrewd cobalt
#

That seemed to do it, thanks!

obtuse wraith
thorn ingot
#

Hi, guys. Super quick question.
How do I make this round the money up after halving.

ease_dollars(-(G.GAME.dollars / 2))

jolly pivot
#

math.floor() for rounding down

thorn ingot
tulip pecan
#

I'm trying to make a joker that debuffs all cards except hearts. This example here works, but it doesn't un-debuff cards converted with The Sun Tarot card, and also doesn't un-debuff the other cards when the joker is sold. How would I go about implementing these?

jolly pivot
#

is it constantly updating or does it just work once when the joker first loads

kindred niche
#

Is there an easier way to make a deck that changes all joker's to use the next highest operation in their calculate function than to remake all of them by hand, I just cannot think of how I would do it if it even is possible

#

Not even to mention the localization text too

#
return {
  mult = card.ability.extra.mult
}

-- Turns into

return {
  xmult = card.ability.extra.mult
}
#

As an example

slim ferry
#

Changing the localization probably isnt happening

#

But you can hook SMODS.calculate_individual_effect to convert the effects to the next operator

frosty rampart
jolly pivot
#

hrm

#

i want the joker to update dynamically

#

is that not possible this way

frosty rampart
#

but you can call card.children.center:set_sprite_pos elsewhere

jolly pivot
#

icic

thorn ingot
#

Hey again guys.

Do you know if I can reduce the appearance rate of specific cards? Like boosters.

So making a specific tarot or Odd Todd less likely to appear for an example.

gaunt thistle
#

patch qol requests? issues with the workflow? I humbly request lovely feedback

maiden phoenix
fading rivet
#

If I take ownership of a vanilla card and define its calculate method, will it still do its normal things if my calculate method doesn't return anything?

primal robin
#

no

#

you need either add old calculate as a hook or fully define entire card logic

sleek valley
#

is there a way to check the players current money and use that in a cards config?
like for example, im tryna make a joker that does a thing after the player spends half their total money

daring fern
daring fern
sleek valley
#
local bankroll = SMODS.Joker{
    atlas = 'joker',
    key = 'bankroll',
    pos = { x = 0, y = 1 }, soul_pos = { x = 0, y = 0 },
    set_badges = function(self, card, badges) badges[#badges+1] = tss_badges.Goob() end,
    discovered = false,
    unlocked = false,
    rarity = 2,
    cost = 6,
    config = { extra = { original_money = 0, cost = 0, attempted = false } },

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

    add_to_deck = function(self, card, from_debuff)
        card.ability.extra.original_money = G.GAME.dollars
    end,

    calculate = function(self, card, context)
        if context.money_altered and G.GAME.dollars <= card.ability.extra.original_money then
            card.ability.extra.cost = card.ability.extra.original_money / 2
        end
    end
}
#

i'm trying to get it to display in loc_vars too, which is probably where the problem is coming from

cobalt iron
#

how would I check for each unique enhancement in a played hand?

daring fern
sleek valley
#

sadly makes no difference to fixing the nil problem, but fixed

daring fern
tidal hemlock
#

do you need mod prefixes for pools?

daring fern
#

If one has a shader that makes parts of a card invisible how could one prevent editions from making the invisible parts visible again?

dapper sun
#

you can't

#

cardshaders and editions don't seem to be compatible

#

they draw over each other

#

for example, here's my cardshader healhbar being drawn over by the holographic shader

primal robin
#

you cant apply 2 shaders on a card?

#

That's a bummer

dapper sun
#

how do i make an info_queue show a joker's locked requirement description?

plain apex
#

does anyone know how can i take a life off of the player in multiplayer neither MP.UI.ease_lives(-1) or MP.GAME.lives = (MP.GAME.lives or 0) - 1 actually keeps the life gone when they go and lose a nemesis fight

dapper sun
#

try asking in the mmultiplayer server

#

#help-desk seems like the right channel to ask in

plain apex
#

did and got absolutely no response

dapper sun
#

maybe wait some more

plain apex
#

like i want to make some multiplayer content for my mod because some people are playing it in multiplayer pretty regularly recently but nobody will answer any of my questions about multiplayer support

primal robin
#

just ease lives may be not enough, you need to make sure you to sync it with server

plain apex
restive violet
#

I'm trying to look into how the pseudorandom works, but I'm running into an issue with math.randomseed(seed) in pseudorandom. Namely, pseudoseed seems to return a number between 0 and 1, while math.randomseed expects an integer as far as I can tell. What am I missing?

dapper sun
restive violet
#

oh nvm this is [probably?] my answer

restive violet
dapper sun
#

ah

#

cool

restive violet
#

oh omnipotententity has more useful content sweet. apparently luajit has an entirely different random seed

red flower
#

if i had a penny for every person that needed this information this month i-

plain apex
dapper sun
#

have you tried looking at the code for existing multiplayer jokers?

plain apex
#

i mean yes? but its not really clear how to get any of the information

#

took like multiple days just to figure out how to get the opponents score in the nemesis blind for items like this because nobody will answer me

green epoch
#

heyho, how could i check the first scored card? thank you

daring fern
# dapper sun bump

Patch generate_card_ui and set card_type to 'Locked' in the info_queue you want.

daring fern
green epoch
daring fern
dapper sun
subtle hawk
#

g

daring fern
dapper sun
#

ahh

subtle hawk
#

How would I create a card without discovering it...

dapper sun
daring fern
dapper sun
#

where would i put this,,?

shell timber
#

id assume youd put it where you set upgrade_center.card_type currently

dapper sun
#

ah ok

shell timber
#

though i may be wrong

daring fern
dapper sun
#

yeah i'm looking at it and idk abt that

#

ah ok

#

before or after?

#

or in the else

daring fern
dapper sun
#

ok

#

still not working

daring fern
dapper sun
#

oh

broken rivet
#

wouldn't you also need to use locked_loc_vars here

dapper sun
#

how do i make the text say locked instead of the joker's name, like this

daring fern
dapper sun
#

ty

#

not working

#
local generate_card_ui_hook = generate_card_ui
function generate_card_ui(_c,full_UI_table,specific_vars,card_type,...)
    if _c.card_type then card_type = _c.card_type end
    local ret = generate_card_ui_hook(_c,full_UI_table,specific_vars,card_type,...)
    if _c.card_type == "Locked" then full_UI_table.info[#full_UI_table.info].name = localize{type = 'name', set = 'Other', key = 'locked', nodes = {}} end
    return ret
end```
past bear
#

the thing is

#

i read the page and it just seemed like tips more than a tutorial

#

and i did not understand much..

#

does anyone else know any other or just a similar but clear way of understanding how to get started

dapper sun
#

that is the clear way of understanding how to get started

past bear
#

oh :(

dapper sun
#

Steamodded documentation

  • Check out the Mod Metadata page for how to get your mod detected by Steamodded.
  • Check out the API Documentation page for information on the basics of Steamodded's api.
  • For adding content, check the Game Objects part of the sidebar, which lists every object SMODS can create.
past bear
#

i will read those pages, hope i can learn something

#

thx

dapper sun
#

i'm just repeating verbatim a part of the page you linked

past bear
daring fern
dapper sun
#

ok

#

still nothing

#

i think maybe it's bc of name_styled?

#

also the snippet you gave me will only do the last ui element

daring fern
dapper sun
#

ah ok

#

still, that doesn't fix it

#

it seems it'll have to be a patch or smtn bc it uses dynatext

primal robin
#

full_UI_table so scary even I dont use it at all

rapid stag
#

2nd screenie has the set_ability

green epoch
#

anybody happen to know why i get a decode crash when i play a sound?

normal crest
# rapid stag

there is honestly so much here, what if you make the use function just the set_ability call in an event and leave the rest commented our or smt

#

that will at least tell us if the problem is the rest of your code there or smt else

green epoch
rapid stag
rigid solar
#

Does anyone know which color shift to apply to these areas to get these effects in pack sprites?

rapid stag
#

could try experimenting with multiply and darken only blend effects

slim ferry
thorny wigeon
#

I'm currently having a bit of an issue, a mod I'm making isn't actually showing the custom deck. I did everything exactly the same way as my mod from yesterday, but today I got an error saying it couldn't decode the PNG and CRC can be disabled. I re-exported my PNG, the error is gone but my deck is just a renamed default skin.

I just switched off pixel scaling and now it's crashing for 1x files so I have no idea why the PNG isn't working

normal crest
#

I did the same thing as you

#

with your mod

frosty dock
#

could well be that

slim ferry
#

also happens when the file extension doesnt match the file data right

#

or if it doesnt exist i think

thorny wigeon
#

But then why is it that when it doesn't give that error that my cards are just default?

thorny wigeon
frosty dock
slim ferry
#

Did you save it as something other than .png and remame it to a .png

frosty dock
normal crest
frosty dock
thorny wigeon
#

1x is the same

thorny wigeon
rapid stag
# normal crest I'm on the latest smods release by the way, 1224a

both repros show me being on the latest release. i'll ask with some of the people playing my mod if unlocks work for them and it's somehow just a me issue

in that case, i don't mind if it's just me - if it actually works for the people playing my mod, then that's fine

normal crest
#

I just noticed that

#

i don't actually know if that matters but might as well try

rapid stag
#

oh right, i should try to repro with unseeded cirDerp

slim ferry
#

unlocks are disabled on seeded runs...

wintry solar
#

Yeah seeded run block unlocks

normal crest
#

oh well that's why then

slim ferry
#

Dupid

thorny wigeon
#

What image editors do people use when exporting for balatro?

normal crest
#

personally libresprite

thorny wigeon
#

Have you ever had a decode error?

normal crest
#

i don't think so

rapid stag
#

i use gimp myself

thorny wigeon
#

This is so weird

#

the mod just isn't displaying, it's just the default balatro textures

#

I genuinely don't get why its doing this

rapid stag
green epoch
#

when i attempt to load an image i get an error saying that it couldnt open my image in mode r
msg = string: "[SMODS edensmod \"edensmod.lua\"]:3: Error reading file 'jokers/customimages' for mod with ID 'edensmod': Could not open C:\\users\\steamuser\\AppData\\Roaming\\Balatro\\Mods/edensmod/jokers/customimages in mode r
full log attached

thanks in advance if you know

#

i have no idea what mode r is, i've searched in this channel for it and the only piece of advice i've found is close whatever is using the file, but i dont have anything open that would be using it afaik

lyric wadi
#

how do i use card_to_draw

#

i want to increase the number of cards to be drawn

#

but from what i see in the example code there's only a way to overwrite the number

daring fern
lyric wadi
#

thank you

#
loc_vars = function(self, info_queue, card)
        local emptyCount = math.max(0,((G.consumeables.config.card_limit or 0) - ((#G.consumeables.cards or 0) + (G.GAME.consumeable_buffer or 0)))) + math.max(0,((G.jokers.config.card_limit or 0) - ((#G.jokers.cards or 0) + (G.GAME.joker_buffer or 0))))
        return { vars = { emptyCount, card.ability.extra.gold } }
    end,

okay which one did thunk misspell the misspelling again

#

consumeable is the bane of modding this game

daring fern
reef bobcat
#

if i set consumable type shop rate to 0, it wont be able to show up in the shop right?

mystic river
#

i believe this is so, yes

#

it might default to 0, actually

fading rivet
#

where do lucky cards store their chances to trigger?

mystic river
#

i believe it's somewhere in G.P_CENTERS.m_lucky

reef bobcat
#

ok so can I put consumables in the same lua file i program jokers?

rigid solar
#

Can SMODS.poll_rarity return "legendary"?

slim ferry
#

No

#

Legendary has weight 0 so it wont do that

rigid solar
#

figured

fading rivet
#

like via card.ability.something

wintry solar
#

do you want to try that image again?

fading rivet
daring fern
sturdy compass
#

Win + shift + s

frosty rampart
slim ferry
#

Or print screen key

fading rivet
#

I dont have wifi

frosty rampart
#

phone hotspot?

sturdy compass
#

I have my own server I lurk in not this one

fading rivet
mystic river
#

plug your phone into your computer so you can grab the screenshot that way?

fading rivet
fading rivet
#

I typically bring one for that purpose but I left it at home

wintry solar
#

have you tried holding your phone with two hands when taking a photo

fading rivet
#

okay i think I got it working

reef bobcat
#

ok so i managed to get the basics of implementing a consumable but now

#

how do i get a consumable to have a unique image?

#

cuz right now it's using the default fool image

slim ferry
#

the same way you do it for a joker

fading rivet
slim ferry
#

Or any other object

fading rivet
#

define at atlas

fading rivet
reef bobcat
#

the thing is, i did it like i normally do for the jokers

#

i put an icon in assets, then i put an atlas position

fading rivet
#

whats the consumables code look like?

reef bobcat
#
    key = 'canarycry_token',
    set = 'DCBalatro_Token',
    pos = { x = 0, y = 0 },
    config = { extra = { planets = 2 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.planets } }
    end,
    use = function(self, card, area, copier)
        for i = 1, math.min(card.ability.extra.planets, G.consumeables.config.card_limit - #G.consumeables.cards) do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    if G.consumeables.config.card_limit > #G.consumeables.cards then
                        play_sound('timpani')
                        SMODS.add_card({ set = 'Planet' })
                        card:juice_up(0.3, 0.5)
                    end
                    return true
                end
            }))
        end
        delay(0.6)
    end,
    can_use = function(self, card)
        return G.consumeables and #G.consumeables.cards < G.consumeables.config.card_limit or
            (card.area == G.consumeables)
    end
}```
#

it's just the high priestess

#

but i changed the key

#

and set

fading rivet
#

you never set the atlas

reef bobcat
#

i tried to

#

but i got an error

fading rivet
#

what error

reef bobcat
#

omg im so dumb

#

i forgot the comma

#

after the atlas thing

fading rivet
#

oop

reef bobcat
#

it's showing now

fading rivet
#

@dreamy thunder rn I have something along the lines of

store original calculate
take ownership of lucky card
overwrite calculate 
check main scoring, scored cards, and specific joker present
    return {mult = 4, dollars=1.3}
return original calculate
wintry solar
#

lucky cards dont have a calculate function

fading rivet
mystic river
mystic river
#

that is, the center's name field

fading rivet
#

ah

#

will that mess with anything else?

frosty rampart
#

it shouldn't off the top of my head

mystic river
#

you might have to reimplement its loc_vars and some other vanilla features

frosty rampart
#

ideally the localization is based on the key, but i wouldn't put it past thunk to do that sort of thing by name too lol

mystic river
#

iirc localization is key based, vars are name based

frosty rampart
#

ah

fading rivet
#

do I just put name in the take ownership section

mystic river
#

yes

fading rivet
#

k trying it out now

wintry solar
#

That will stop it from working without your joker

fading rivet
#

still fired twice

mystic river
#

hm

fading rivet
#

I did name="foobar_lucky"

#

wait I didnt save the file;-;

mystic river
#

that does make some difference :v

fading rivet
#

nope still twice

wintry solar
#

I imagine the check isn’t based on the name because of quantum enhancements

dreamy thunder
#

is .effect the name of the enhancement

fading rivet
dreamy thunder
#

looks like its not

mystic river
#

ah of course, thunk did the same thing two different ways

fading rivet
#

so would take ownership using effect work?

red flower
#

what are we trying to do

mystic river
#

should
though you may have to reimplement the normal calculate as eremel said

fading rivet
mystic river
red flower
mystic river
#

a lot of vanilla stuff is hard coded in a way that can't be directly overwritten by taking ownership

fading rivet
fading rivet
#

also this didn't work either

#

still triggered

dreamy thunder
mystic river
dreamy thunder
fading rivet
#

the weird thing is that my effect is triggered, and the default effect

red flower
#

you are reimplementing lucky anyway

#

why not just patch it out

dreamy thunder
#

^

fading rivet
#

whats the file name?

dreamy thunder
#

card.lua

red flower
#

card.lua search for "Lucky Card"

fading rivet
#

thx

reef bobcat
#

ok so i want my joker to create a specific consumable when triggered

#

how would i go about that?

daring fern
daring fern
granite jay
#

You know the “hand will not score” message?
How do you display that without the hand being debuffed?

fading rivet
#

what does lovely do if multiple locations match a pattern?

slim ferry
#

patch each location

#

unless you add a times value to the patch, then itll only patch the first times matching patterns

fading rivet
#

any idea why this wont patch then?

slim ferry
#

Dunno

#

Make sure youre patching the right file ig

fading rivet
#

i am

reef bobcat
#
    key = "blackcanary_joker",
    config = { extra = { poker_hand = 'Straight' } },
    pos = { x = 0, y = 0 },
    rarity = 2,
    cost = 6,
    blueprint_compat = true,
    eternal_compat = true,
    unlocked = true,
    discovered = true,
    atlas = 'blackcanary_joker',
    soul_pos = nil,
    loc_vars = function(self, info_queue, card)
        return { vars = { localize(card.ability.extra.poker_hand, 'poker_hands') } }
    end,
    calculate = function(self, card, context)
        if context.joker_main and next(context.poker_hands[card.ability.extra.poker_hand]) and
            #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 ({dcbalatro_token = 'c_sj_canarycry_token'})
                    G.GAME.consumeable_buffer = 0
                    return true
                end)
            }))
            return {
                message = localize('k_plus_spectral'),
                colour = G.C.SECONDARY_SET.Spectral
            }
        end
    end,
}```
#

effect keeps displaying error message :[

#

im trying to make it generate a specific consumable when a straight is played

reef bobcat
#

you mean this?

fading rivet
daring fern
fading rivet
reef bobcat
#

:0

daring fern
# fading rivet bump

Is this file called lovely.toml or in a folder called lovely and in your mod's folder?

vernal path
daring fern
frosty rampart
#

the triple quote format is just standard syntax, no issue there

vernal path
#

Ah
i guess that makes sense, I guess i've only ever seen single line patterns so there's never been any need for it :P

reef bobcat
fading rivet
#

all my other patch files work too

red flower
fading rivet
#

omg bruh

#

thx

#

wait i dont se it

vernal path
#

Yeah, was gonna say i dont see that in my card.lua?

red flower
vernal path
#

unless the lovely dump strips those

red flower
#

it doesnt

fading rivet
#

oh

#

theres 2 different lines

vernal path
#

ohhhh

fading rivet
#

the first doesnt have a space

vernal path
#

lolll

fading rivet
#

that doesn't explain why the first line wasn't patching though

#

still no luck

#

neither patched

reef bobcat
daring fern
fading rivet
red flower
#

you dont need to ping me im reading the chat

#

idk

past spade
#

is there a context like context.card_added that runs for the card being added?

red flower
#

you should use the add_to_deck function instead

past spade
#

does that work for stickers?

red flower
#

i dont think so

#

context.card_added doesnt work?

past spade
#

only seems to trigger the other jokers

slim ferry
#

You could hook Card:add_to_deck and Card:remove_from_deck and check for the sticker there

#

I guess

past spade
#

yeah guess I'll have to do something like that

#

unrelated, anyone know why this blind has the wrong texture specifically in the challenge restrictions screen? looks correct everywhere else

fading rivet
#

okay it seems like my patch i\snt being registered

#

any idea why?

junior tapir
#

I'd normally check if steamodded does some patches that makes the pattern unrecognizable, but the only patch it does over this piece of code doesn't change the pattern

fading rivet
#

okay so I completed restarted balatro and it started being recognized

#

weird

#

but somehow the original code is still firing

junior tapir
#

firing with not FooBar.average_probability() false?

slim ferry
#

So that probably was the issue

mystic river
junior tapir
#

I have a question: I can add my own menu in the settings through just 2 patches, but I want to do the settings possibly in my own config. How do I achieve that?

fading rivet
#

I tested in the console and FooBar.average_probability() was true

junior tapir
#

I don't use the console, what I'd do in this situation is make average_probability always return true/false and test it, maybe it becomes true/false right after the check you make because of some context synchronization is my guess

fading rivet
#

which it is

junior tapir
#

ohh so just next(SMODS.find_card("j_MODid_joker")) functionality

fading rivet
#

yeah

junior tapir
#

and does the conditional statement misfire with the next(...) function, or is the average_probability returning in one line the next(...)

slim ferry
#

SMODS.find_card already doesnt count debuffed cards by default

reef bobcat
#

ok i just realized my consumable needs a description text, how do i give it that?

junior tapir
#

ummm, why [1], seems off to me

slim ferry
#

Gets the first found card

junior tapir
#

ohh first card

reef bobcat
#

normally i go in the en-us file and add in the parameters

fading rivet
#

either way that wouldn't change my code from not working

#

the card isn't debuffed

reef bobcat
slim ferry
#

and its c_modprefix_key for consumables

fading rivet
#

oh wtf

#

okay so the actually cards effect is being triggered twice

#

its not the default

#

okay i'm now more confused

#

where are these numbers coming from

reef bobcat
#

im definitely doing something wrong, the consumable still doesnt have the text in game

junior tapir
#

I have a single consumable but it works like this:

SMODS.Consumable {
    ...
    loc_txt = {
        name = 'name',
        text = {
            'descr'
        }
    }
    ...
}
fading rivet
#

genuinely gonna crash out why is this not working

#

OOOOOOH

#

i think I foundn it

#

since i'm taking ownership of the card, I"m assuming its now subject to all of SMODS stuff

#

so the built in p_dollars in the config is now being treated as a value to always return

red flower
#

ah yes

fading rivet
#

OMG is from a patch intro the p_dollar check

#

whar is from the wanted effect

fading rivet
#

YES IT WORKS

keen sierra
#

so, most tutorials to make balatro mods are to make jokers, so i wanted to ask: i want to make a mod that prevents jimbo from appearing (for example, if all legendaries were gotten and jimbo is about to appear, it changes to a rare), so, can i ask where could i get the resources of how to do it?

red flower
fading rivet
#

what would the info_queue entries for foil, holochrome, and polychrome be?

red flower
fading rivet
#

thx

#

i forgor

#

okay wheel of fotunre should theoreticly work

#

nope

#

nvm it does work i forgot i had 4 oops

hidden aspen
#

I have a question about how SMODS works.

In Joker's default constructor, there is a function called inject, which will add this joker to all the ingame pools.

#

and this function will be called from the obj_table and obj_buffer

#

that are a part of the GameObject class

#

but. how do objects get added to obj_table?

#

because doesnt all this thing does basically create a table? how does this table end up in a global class array

red flower
#

doing SMODS.Joker({...})
calls the GameObject register function

#

(smods classes use a metatable so you can call them like a function)

hidden aspen
#

okay i see that register is appending to the obj_table, but how is register called then?

#

like i dont see any register call in the __call

red flower
#

that's for lsp

#

its this one im pretty sure

fading rivet
#

is the key for holographi cards just "holo" or something?

red flower
#

yes

#

e_holo

fading rivet
#

thx

#

just got the wheel to do now

hidden aspen
granite raptor
#

does this description make enough sense?

fading rivet
#

yeah looks good

#

Is there any spot I should save data to a blind?

daring fern
fading rivet
#

thx

wild escarp
#

Where are all the scoring cards stored?

#

Is it just context.scoring_hand?

daring fern
wild escarp
#

Thanks!

tranquil echo
#

woah

#

first time in in here

#

how do i view the voucher source code?
i cant find it

slim ferry
#

i assume youre looking for how vanilla vouchers are coded?

tranquil echo
#

yeah

#

specifically observatory

frosty rampart
#

use VanillaRemade, it remakes basically all vanilla content as if it was modded. It's a much better reference than actual vanilla code

slim ferry
tranquil echo
#

tysm fellas

tranquil echo
#

love yall

frosty rampart
#

happy to help

clear ocean
wild escarp
#

Anyone know why this calculate function doesn't work? I'd like this seal to give additional xchips for every scoring card that has that same seal, e.g. 1 scoring card of this seal gives 1.1x chips, 2 scoring cards of this seal each give 1.2x chips, and so on but it currently does absolutely nothing

calculate = function(self, context, card)
    if context.cardarea == G.play and context.main_scoring then
        local love = 1
        for k, v in ipairs(context.scoring_hand) do
            if v.seal == "Love" then
                love = love + card.ability.seal.extra.xchips_inc
            end
        end
        return {
            x_chips = love
        }
    end
end
red flower
#

is it entering the context, you should always try adding prints to if statements

from what i see the problem could be that the seal is missing the mod prefix

tulip pecan
#

Is it possible to implement a shader that goes over the entire game when a certain condition is met, like a vignette? if so, how would I achieve this?

red flower
#

there's a feature for that in the next smods version

tulip pecan
#

I have smods-1.0.0-beta-1224a, is this a feature in this beta release, or should I wait?

red flower
#

it's not in that release, no

tulip pecan
#

gotcha

daring fern
wild escarp
#

Thank you!

rapid stag
#

even just to patch it over so that i don't have to immediately untangle my code from half a year ago to figure out a fix

normal crest
rapid stag
thorn ingot
#

hi guys. Do you know how to make the finisher blind have a score multiplier?

I wanted to make a stake that makes them be x1.5.

Tried to look around for a starting point but couldn't find any.

wanton jolt
#

i believe its mult =

thorn ingot
# wanton jolt what do you mean

Having the finisher blinds require 50% more chips. So on ante 8 if the boss blind would require 200k chips base it now would require 300k.

wanton jolt
#

you want to change the base multiplier right

#

like are you looking for the 2x base?

thorn ingot
#

yeah I guess it would be times 3 in that case.

wanton jolt
#

mult = 3

thorn ingot
#

but only for the finisher

wanton jolt
#

you want to make a showdown blind right

thorn ingot
#

no, modify the current ones. it's for a new stake

wanton jolt
#

?

#

oh

#

OH

#

wait

thorn ingot
#

okay

#

omg

wanton jolt
#

G.GAME.modifiers.scaling = (G.GAME.modifiers.scaling or 1) * 2

#

this multiplies the base

#

for all blinds

#

idk if it affects boss blinds but it probably should

#

ante 1 will stay the same though

thorn ingot
#

that's fine. do you know if I can make this only affect ante 8?

#

and 16 and 24 and so on

wanton jolt
#

add a check for ante modulo 8

#

and u can do the scaling = 1 + ante modulo 8

#

i think

#

thats where i would start at least

thorn ingot
#

mmm, yeah that's a good starting point yeah.
Thanks a lot.

wanton jolt
#

np

hushed field
#

For people that have set up timers through events, what would be the best way to make timers continue when the game is restarted?

fading rivet
#

How could I modify the cost of a specific joker during a run

wanton jolt
#

card:set_cost()

fading rivet
#

thx

wanton jolt
fading rivet
#

does it update it for all future occurrences or no

wanton jolt
#

no

fading rivet
#

how would I do that then?

wanton jolt
#

how are you planning to increase the joker's cost

#

per round / ante?

fading rivet
#

when ever it appears in shop it should double

wanton jolt
#

oh wow

fading rivet
#

inflation 👍

hushed field
#

You can hook set_cost() and rely on a global variable. If you check whether the card where the cost is being set is the right one, you can intercept and double it

fading rivet
hushed field
#

I'd reckon card.lua?

wanton jolt
#

and then set the card cost as that global

fading rivet
#

yep found it

fading rivet
wanton jolt
#

good luck

hushed field
#

yeah, good point. That's what I meant, but I should've probably made that clearer, haha

fading rivet
#

hmm okay actually it might be easier to patch instead of hook

hushed field
#

Why's that? A hook should be fine for that function

fading rivet
#

oh wait actually there's some more jank

#

imma hook instead

hushed field
#

In that case, you can mess with the price before, no?

fading rivet
#

wait how do I hook into this again

#

I forgor

#

im doing this but its not working

primal robin
#

printscreen technology was forgotten once again

stuck ore
#

I'm having issues with an animated joker where after running for a couple seconds it goes black, I've tried putting it all in one line as opposed to a grid but then it's a weird red and white block like the polish flag?? Any ideas of where I screwed up? It could also just be that the animation is far too long because it is around 8000 frames but idk

fading rivet
#

also any idea why the code won't work?

primal robin
#

increasing inflation like this is definitely bad idea since set_cost called pretty often in various cases

stuck ore
#

So i figured out it is because the png isn't wrapping back to the left side for the animated joker, are all animated joker sprites one line as opposed to multiple rows?

fading rivet
#

wait nvm I know one

#

okay it works thx

stuck ore
#

what is the limit of frames per animated joker?

wanton jolt
#
calculate = function(self, card, context)
        if context.final_scoring_step and context.cardarea == G.jokers  then
            if context.scoring_name == "Pair" and #context.scoring_hand == 2 and not (G.GAME.hands[context.scoring_name] and G.GAME.hands[context.scoring_name].played_this_round > 1) then
                local c1 = context.scoring_hand[1]
                local c2 = context.scoring_hand[2]
                local suit = pseudorandom(pseudoseed('merge_suit')) < 0.5 and c1.base.suit or c2.base.suit
                local rank = c1:get_id()
                
                [... card enhancment, edition grabbing code, ...]

                local merged_card = create_playing_card({
                    front = new_front,
                    center = new_center,
                }, G.play, true, false, nil, true)
                
                merged_card.ability.perma_bonus = rank_to_chips(rank)
                merged_card.ability.felijo_stk_stitched = true
                if new_seal then
                    merged_card:set_seal(new_seal, true)
                end

                if new_edition then
                    merged_card:set_edition(new_edition, true)
                end
                
                G.E_MANAGER:add_event(Event({
                    delay = 0.3,
                        func = function()
                            c1:start_dissolve({G.C.MONEY}, true)
                            c2:start_dissolve({G.C.MONEY}, true)
                            return true
                        end
                }))
                G.E_MANAGER:add_event(Event({
                delay = 1,
                    func = function()
                        merged_card:start_materialize()
                        G.deck:emplace(merged_card)
                        return true
                    end
                }))

#

My joker is not deleting playing cards correctly, it can still be drawn to hand

#

when i look at G.hands.cards[x] it says added to deck = false, removed = true, being_removed: true

crisp coral
#

SMODS.destroy_cards(cards) instead of whatever the fuck you're doing

#

cards is a table or a Card

wanton jolt
#

it works thank you

wintry crater
#

my game crashed when i used the better hanged man card but the crash references an SMODS file and not my own. i know my code has to be the issue but i have no idea what happened

limber aspen
#

Code?

wanton jolt
#

let me check something

#

@daring fern how is your shader applied

#

this is ash card enhancement from aikoshen, with negative edition

frosty rampart
#

ash card isn't a shader tho, it's just the texture

wanton jolt
#

oh

#

i guess apply the shader last?

#

isnt there a layer system? i remember seeing such a thing when working with stickers

dawn granite
#

am i blind or is the game blind

daring fern
red flower
dawn granite
#

so it should be after the return right

daring fern
dawn granite
#

ah right

#

(good i double checked)

#

now the issue i have now is how do i make it so the sound plays when the chips animation happens and not when the cards are played (since that's what's happening rn)

daring fern
green epoch
#

anyone happen to know why when i play a sound it crashes? im using my prefix but it cant find resources/sounds/eden_outro.ogg

            mult = self.config.extra.mult,
            message = strings[math.random(#strings)],
            sound = "eden_outro"
        }```

"prefix": "eden",

daring fern
green epoch
sleek valley
#

is there a context for checking when a boss blind is beaten?
ik there's context.end_of_round but that goes for all blinds

mystic river
#

checking, not that I'm aware of
there's context.blind_defeated if you just want the timing

sleek valley
#

yeah, that works
is there a way to check the name/key of the blind to go with it then?

mystic river
#

I'm sure it's in some global variable, but i can't recall the name offhand

sleek valley
#

actually, come to think of it, i can probably just put a calculate function in the specific blind with context.blind_defeated, cant i?

mystic river
#

probably!

hushed field
#

Oh, didn't remove my own key from it

daring fern
daring fern
sleek valley
#

i think i got it now
my main problem is jsut figuring out how to make an achievement that triggers when this boss is defeated

#

which i realise should've been the first thing i asked .w.

hidden aspen
#

does anyone understand why in the generate_starting_seed function there are lines about legendary joker??

mystic river
sleek valley
#

yeah, i had done that, but it's not working

mystic river
#

that calculate function doesn't appear to be part of any object

sleek valley
#

yeahh idk where to put it tho, outside of inside the related blind which doesnt feel right

daring fern
mystic river
#

the blind would've worked fine (you could even put it in the blind's defeat function)
but yeah mod calculate also works

normal crest
#

what does that reaction mean

#

i can't see the emoji name

mystic river
#

ninja

#

he said what i was typing while i was typing it

normal crest
#

i see

minor anvil
#

is there a way to take ownership of Game:init_game_object() in SMODS?

daring fern
sleek valley
#

would there be a way to make a "playstation platinum trophy" kind of achievement? where you only get it if you have all other achievements?

wintry solar
#

Yes

#

Just count how many achievements you have

hidden aspen
#

when the game is doing a save/load, how can i save and load modded data? its a global parameter and not part of any specific item

mystic river
#

putting it in G.SETTINGS would work
G.SETTINGS[G.SETTINGS.PROFILE] if you want it to be profile specific

red flower
#

if it's just for that run save it to G.GAME

mystic river
#

that as well

hidden aspen
daring fern
mystic river
#

right, those words

minor anvil
daring fern
shy adder
#

How can i change the seal label's text colour

sleek valley
#

text_colour = HEX("FF0000")

red flower
frosty rampart
# sleek valley `text_colour = HEX("FF0000")`

text_colour is only on consumable types (and i would know, i implemented it)
it would certainly be nice to have it on other badges like this tho, i'll keep that in mind for when i get my laptop fixed

shy adder
frosty rampart
#

500 smods PRs 🙂‍↕️

crisp coral
sleek valley
red flower
#

murphy will never get his xmult

shy adder
#

I can change the seal's name colour with {C:red}{}, its very strange i cant do the same with seal's label

red flower
#

because they dont use the same formatting system

shy adder
#

ohh it makes sense

sleek valley
red flower
#

i should fix that to remove formatting as well since im pr'ing it

final jewel
#

is it possible to remove the use button ?

#

like my consumable is just sellable

frosty rampart
#

yes, but i don't think it's an easily toggleable setting or anything. iirc ego gifts in the dev branch of paperback remove the use button

sleek valley
red flower
#

yes :3

sleek valley
sleek valley
#

ah, i see

red flower
#

it's pull request, when you ask for them to add code to the repository basically

final jewel
#

yeah

sleek valley
red flower
#

does this need to do all the loops every time it needs to get the badge colour lol

sleek valley
#

good lord

thorn ingot
#

Hey guys. Back again.

Do you know how to make the score scaling affect only an specific ante?
I can't figure it out. fr.

#

Specifically to have the ante with the finisher blind require more chips.

sleek valley
#

i mean, you can just do mult = 8, in the blind itself

#

idk about a whole ante though

thorn ingot
#

Yeah, I have not been able to find any examples of that.

slim ferry
#

Hook get_blind_amount and check if any of the blind choices are the specific showdown blind?

granite raptor
#

if i wanted to replace a card within a booster pack as it's generated, what would be the best way to go about it? currently i have card:set_ability bound to an event that fires immediately within an context.open_booster calculation, but you're able to see the original card briefly before it turns into the new card. is there a more seamless way to do this? if i remove the event, i get a crash telling me G.pack_cards is a nil value, which i presume means the code is then running before the pack cards actually exist.

#

(i am aware of hidden and soul_rate but from testing this causes the card to be able to be capable of appearing in spectral packs regardless of soul_set which is undesired, i only want these cards to replace tarot cards)

thorn ingot
granite raptor
final jewel
frosty rampart
#

oh it's three patches, lovely/ego_gift_buttons.toml
(it's three patches because two of them are for controller buttons and the other is for keyboard/mouse buttons)

final jewel
#

oh ok

frosty rampart
#

also the patches use a custom function that checks if a given card is an ego gift, you'll have to reference that function or do your own work to determine if the card is of the consumable type you're working with

thorn ingot
#

btw, guys. Does this work to indicate I want the ante with the finisher blind?

G.GAME.round_resets.ante = G.GAME.win_ante

#

I swear I saw it before

frosty rampart
#

it should be == for comparisons, but that looks right otherwise

thorn ingot
#

ooh, thanks

daring fern
frosty rampart
#

oh that doesn't work if the win ante is modified

#

but yea clover's original one doesn't work for finisher blinds in endless mode

frosty rampart
slim ferry
thorn ingot
frosty rampart
# thorn ingot what does the % mean?

modulus, basically just remainder
if x % y == 0 then x is evenly divisible by y, which is the condition for finisher blinds to appear (in vanilla balatro that's antes 8, 16, 24, etc)

final jewel
#

thx @frosty rampart

thorn ingot
#

Guys... What's foiling my incredible rework?

SMODS.Stake:take_ownership('stake_blue', {
modifiers = function(self)
if (G.GAME.round_resets.ante)%G.GAME.win_ante == 0 and
G.GAME.round_resets.ante >= 2 then
G.GAME.modifiers.scaling == (G.GAME.modifiers.scaling or 1) * 1.5
end
})

#

It looks fine to me.

frosty rampart
#

you only have an end for the if statement, you need one for the function too

thorn ingot
#

I believe I had that before.

#

Yeah, just checked. It doesn't work too. 😭

blazing helm
#

also missing a end ya

thorn ingot
#

Thanks.

blazing helm
#

no prob

rapid stag
thorn ingot
hidden aspen
#

chat, whats the difference between save_run() and G:save_progress()

granite jay
#

Think stone card but no chips

errant arrow
#
if next(SMODS.find_card("j_TBC_joker1")) or next(SMODS.find_card("j_TBC_joker2")) == true then
                
end

am I overcomplicating my line of thought? can I just put math after the "true then" and then connect it to a variable?

red flower
#

if you want to see if you have one of those two jokers then that's correct except for the == true, next doesnt necessarily return a boolean

slim ferry
#

G:save_progress saves all progress

errant arrow
slim ferry
#

such as achievements and stuff

red flower
hidden aspen
errant arrow
#

i see

red flower
hidden aspen
#

e.config.event data is a custom table im passing on button press, i checked with print and its not null

red flower
#

what does the table have

hidden aspen
#

its an extended SMODS.GameObject, has stuff like key, name, etc

#

my own type

slim ferry
#

GameObjects cannot be saved

thorn ingot
# daring fern Code?
    modifiers = function(self)
        if (G.GAME.round_resets.ante)%G.GAME.win_ante == 0 and
        G.GAME.round_resets.ante >= 2 then    
        G.GAME.modifiers.scaling = (G.GAME.modifiers.scaling or 1) * 2
       end 
  end 
})```
slim ferry
#

Afaik

hidden aspen
#

thanks

red flower
#

recursive tables wont be saved properly

hidden aspen
#

gotchu

red flower
#

same with functions

daring fern
red flower
#

ok i got side tracked by the badge colour thing instead of working on my mod

clear ocean
#

is there a reason why this error pops up, i even added "gros" as second argument just in case

red flower
#

does any other process have that file open

clear ocean
#

outside of vscode(?)

daring fern
red flower
#

do you have it opened in vscode on its own or did you open the folder

clear ocean
#

i think the folder option i can close out of vscode

clear ocean