#💻・modding-dev

1 messages · Page 343 of 1

cobalt arrow
#

hmm smart

#

yesss that was the problem

shut crater
#

the only thing this doesn't account for is the loc_vars text, which I have no idea how stencil displays the correct current value or if it just does that calculation in both functions

#

and I'm not at home rn so I can't check the source

cobalt arrow
#

oh no problems

#

you're help was wonderful

#

i'll try your idea of the loop and counter

shut crater
#

yeah lmk how it goes

cobalt arrow
#

o7

high sinew
#

how do i get tarots to spawn on specific conditions

digital niche
#

is there a documentation for unlock_condition?

unkempt thicket
#

unlock condition is like a condition for discovery, in_pool is a condition for spawning

digital niche
#

is there a place that explain unlock_condition better?

bold sleet
#

Can someone help me getting the localize function to actually do shit?

unkempt thicket
#

Also the thing itself is the function you don't need to add local function

red flower
bold sleet
#

yummers

placid star
#

is there a way to see these extra values with debug plus?

bold sleet
faint yacht
#

eval inspectDepth(table)

rough furnace
digital niche
#

how do i check for a enhancement in can_use in a consumable

rough furnace
#

I think I show all keys on the top level object so just indexing into it works too

red flower
# bold sleet now time to figure out how and why it works

if localize gets a string it grabs it from misc.dictionary, else you need to give it a table with the parameters you need
"name_text" gives you the name of the object as a string ("name" gives you the UI table), key and set are self explanatory

red flower
digital niche
#

in the selected cards

#

i want to select 2 cards and if both have "bonus" i can use the card

red flower
#

iterate through G.hand.highlighted and check for SMODS.has_enhancement(card, "m_bonus")

digital niche
#

oh wait, forgot the card

shut crater
#

that checks if the player has highlighted 2 cards and if the consumable has the bonus enhancement

#

to check if the highlighted cards have the enhancement you would need to loop over G.hand.highlighted and check each highlighted card for the enhancement

#

if either one does not have the enhancement, you can return false right away. If you make it through the entire loop without seeing any issues, then you return true

digital niche
#

how do i check if the card itself have the enhancement?

#

if the selected card i meean

placid star
#

how can you find the key of a highlighted joker?

digital niche
#

its my first time trying things arund consumables so im not sure how anything works

verbal hare
#

how can i make a dynamic debuff joker slot

shut crater
red flower
shut crater
placid star
shut crater
#

I could be wrong, I'm not at my computer rn

#

but that's my instinct

verbal hare
shut crater
#

that's tough because there's not a great trigger for when a joker gets moved around

#

the reason blueprint works is because it doesn't actually care what joker is to the right until calculate gets called

#

but if you want to update the ui and stuff to show that the card is debuffed then that's gonna be trickier

old cairn
#

if you want the code i'm happy to show it

shut crater
old cairn
#

if it works it works i dunno 🤷‍♀️

rough furnace
#

There's worse uses of update in vanills

shut crater
#

yeah no that's definitely the right way to do it I just always feel like I'm doing something wrong if I have to use update lol

rough furnace
#

Listen every steel joker loops over every card in your entire deck every frame

rough furnace
#

To count the number of steel cards you have

stark geode
#

ah

#

why every frame?

rough furnace
#

Its in update

#

No better place to run it

stark geode
#

huh

old cairn
#

if it didnt it wouldnt update the value in real time which would look a bit weird methinks

stark geode
#

game is wierd

rough furnace
#

It could be much more effinent and just check the two times it reads the value but that's how thunk made it

#

Its easier to implement

#

And less likely to have a bug from forgetting to calculate

#

I've been saying smods should have a lazy update for thing like steel joker

digital niche
#

almost sure i did it wrong

#

what does the i and the v stand for?

brisk rose
#

by convention

digital niche
#

so what do i need that i for?

brisk rose
#

p sure

#

but you could name it bob instead of i if you wanted, lol

placid star
#

so this is progress ig, but my joker doesnt get emplaced ito my other jokers card area, but i cant select it anymore(havent patched that into the card area) and as you can see my card areas #cards goes up

eager pendant
#

Is there any way to put HEX("dg0944") in {X:mult,C:white}{} instead of color?

brisk rose
rough furnace
#

Or use one in loc_vars

eager pendant
rough furnace
digital niche
gusty iron
#

Funny idea i had for a consumable:

"Combination"

Select 2 cards of the same rank. Combine their suits.

Examples:

7 of Hearts + 7 of Spades = 7 of Spearts

red flower
# digital niche almost sure i did it wrong

you kinda want to do the opposite of that

if #G.hand.highlighted ~= 2 then
    return false
end
for _, v in ipairs(G.hand.highlighted) do
    if not SMODS.has_enhancement(v, "m_bonus") then
        return false
    end
end
return true
digital niche
brisk rose
brisk rose
rough furnace
brisk rose
#

seems like a lot of people want to use them

#

because cards having dual suits. but no, not that way, seems like a nightmare, lol

placid star
#

okay so jokers go in just fine, but they dont appear in the box...

brisk rose
unkempt thicket
#

Very hardcoded and linear sprite setup

red flower
verbal hare
#

how can i make a debuff effect? im still looking for that

eager pendant
red flower
old cairn
brisk rose
#

also @unkempt thicket I think it's a good idea to move development back to main

#

oldcalc has no relevence anymore

unkempt thicket
#

I'll make a Pr to do that

brisk rose
#

anyone know what could be causing this?

#

the uh... enhancement was applied by a consumable from balatro+

gusty iron
#

Also would something like this be possible?

Upgrade Tree Deck:
No more booster packs, but you can do an upgrade tree, which gives you upgrades for either money or upgrade points (im still deciding)

brisk rose
gusty iron
#

ill be willing to put in the work

red flower
#

the booster pack part is easy :3

gusty iron
#

can i get the code for that rq then

red flower
#

5 dollars

gusty iron
#

here

red flower
#

use SMODS.change_booster_limit

gusty iron
#

peak

brisk rose
#

I think it worked, but... Silver Deck is a very unusual enhancement

lucid owl
#

this is debuffing every single hand that contains a high card (so all hands) - what the hell am i doing wrong?

#

this is how SMODS debuffs hands in blinds

#

so i'm not sure what's going on here

brisk rose
lucid owl
brisk rose
# brisk rose <@926648868811190372> idk if this is related to the code of the card or it goes ...
  config = { extra = 3 },

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

  can_use = function(self, card)
    return G.hand
      and #G.hand.highlighted > 0
      and #G.hand.highlighted <= card.ability.extra
      and #G.hand.cards - #G.hand.highlighted >= #G.hand.highlighted
  end,

  use = function(self, card)
    local enhancement = BPlus.u.random_enhancement("c_bplus_sigil_beast_enhancement")
    local seal = BPlus.u.random_seal("c_bplus_sigil_beast_seal")
    local destroyables = {}
    local destroyed_cards = {}
    for _, card in ipairs(G.hand.cards) do
      if not card.highlighted then
        destroyables[#destroyables + 1] = card
      end
    end

    for i = 1, #G.hand.highlighted do
      local card_to_destroy = pseudorandom_element(destroyables, pseudoseed("c_bplus_sigil_beast_destroy"))
      destroyed_cards[#destroyed_cards + 1] = card_to_destroy
      G.E_MANAGER:add_event(Event {
        trigger = "after",
        func = function()
          if card_to_destroy.ability.name == G.P_CENTERS.m_glass.name then
            card_to_destroy:shatter()
          else
            card_to_destroy:start_dissolve(nil, nil, 1.3)
          end
          play_sound("slice1", 0.96 + math.random() * 0.05)
          return true
        end,
      })
      local i = 1
      for index, card in ipairs(destroyables) do
        if card == card_to_destroy then
          i = index
        end
      end
      table.remove(destroyables, i)
    end

    for _, card in ipairs(G.hand.highlighted) do
      G.E_MANAGER:add_event(Event {
        trigger = "after",
        delay = 0.1,
        func = function()
          card:flip()
          play_sound("card1", percent)
          card:juice_up(0.3, 0.3)
          return true
        end,
      })
    end

    for _, card in ipairs(G.hand.highlighted) do
      G.E_MANAGER:add_event(Event {
        trigger = "after",
        delay = 0.2,
        func = function()
          card:set_seal(seal, nil, true)
          card:set_ability(enhancement)
          return true
        end,
      })
    end

    for i, card in ipairs(G.hand.highlighted) do
      local percent = 0.85 - (i - 0.999) / (#G.hand.cards - 0.998) * 0.3
      G.E_MANAGER:add_event(Event {
        trigger = "after",
        delay = 0.5,
        func = function()
          card:flip()
          play_sound("tarot2", percent, 0.6)
          card:juice_up(0.3, 0.3)
          return true
        end,
      })
    end

    for i = 1, #G.jokers.cards do
      G.jokers.cards[i]:calculate_joker { remove_playing_cards = true, removed = destroyed_cards }
    end
  end,
}
#

this is the code for the card

gusty iron
brisk rose
verbal hare
red flower
lucid owl
red flower
#

the docs seem to be wrong or outdated

gusty iron
#

GET OUTTTTT

#

WE DONT WANT YOU HERE

lucid owl
red flower
lucid owl
#

-1 subtracts one booster, 1 adds one booster, etc etc

gusty iron
#

i did -2 and

#

like

#

the packs are still there

red flower
#

weird

gusty iron
#

also ill probably make it so you can press rightbracket to open/close the tree, but you can only buy upgrades during the shop

lucid owl
gusty iron
#

so uh

#

any ideas

#

yeah SMODS.change_booster_limit isnt doing crap

red flower
#

does it work if you set it higher

gusty iron
#

lemme try

brisk rose
#

okay, this is weird, Beat (the balatro+ consumable) seems to only be able to roll Familiar decks as "enhancements"

gusty iron
#

nope

red flower
#

then you might be using it wrong

#

can i see the code

brisk rose
gusty iron
#
SMODS.Back{
   key = "upgradetree",
    atlas = "Backs",
    pos = {x = 3, y = 0},
    config = {},
    loc_txt = {
        name ="Upgrade Tree",
        text={
          "{C:attention}Booster Packs{} can no longer spawn,",
    "but, theres an {C:attention}upgrade tree{} in the shop."
        },
    },
    loc_vars = function(self, info_queue, center)
        return{vars={colours = { G.C.SUITS["Clubs"], G.C.SUITS["Diamonds"] }}}
    end,
    apply = function(self)
        SMODS.change_booster_limit(-2)
    end
}
brisk rose
red flower
gusty iron
#

still didnt work

red flower
#

weird

#

I'll try it tomorrow to see if something didn't break with smods lol

unkempt thicket
brisk rose
brisk rose
#

oh, that's even weirder

#

apperently it's any object from Familliar

#

not just the decks

gusty iron
#

...suddenly started working for some reason

#

oh well

#

time to work on the main portion ive been dreading.

#

The Upgrade Tree.

unkempt thicket
gusty iron
#

okay i have 2 ways of doing this, so i want some opinions.

should i:

A - Go the incrimental route, where the upgrade tree has its own currency which generates/gets earned.

B - Have the upgrade tree be based on money

brisk rose
brisk rose
brisk rose
#

oh nvm

#

I see there's a function to grab an enhancement

#

lemme see what that is

gusty iron
#

yeah

#

uh

#

ill make a forum for upgrade suggestions and the whole mod in general

verbal hare
brisk rose
#

the closest I can find is in utils

rustic swallow
#

anyone know how to make a joker count all cards as non face cards

brisk rose
# brisk rose

am I correct that the code in the consumable won't call this function?

#

the relevent one with the similar name about a random enhancement

regal ether
#

any reason this doesn't do shit when used?

rustic swallow
red flower
regal ether
#

ty

#

FIRE

daring fern
rustic swallow
#

so i use take_ownership?

willow plinth
#

what is better, card_eval_status_text or SMODS.calculate_effect or are they even the same?

#

(i know the signature is not the same but to me they seemingly do the same thing effectively)

daring fern
rustic swallow
#

then what do i do? im pretty new to coding

red flower
willow plinth
brisk rose
# brisk rose

can someone tell me at least if the error is contrained to balatro+ itself?

willow plinth
brisk rose
#

@dense crescent oh you're online, you can help

#

sorryt hat was a bit extra

red flower
daring fern
willow plinth
#

i've scrolled over that contexts page several times, i find it very hard to grasp

#

slowly i understand small pieces but some mods using this and some mods using that to do basically the same thing is also not helping lol

red flower
#

the best part is that there are undocumented contexts!

willow plinth
#

awesome

rustic swallow
willow plinth
#

and it's impossible to inspect because just printing it in calculate spams my logs

daring fern
lucid owl
willow plinth
#

i'd learn much faster if i could print out the whole context in readable speed, any tricks in that regard?

red flower
dense crescent
brisk rose
rustic swallow
brisk rose
willow plinth
brisk rose
red flower
willow plinth
willow plinth
red flower
#

yeah, smods replaces them for calculate_context most of the time

lucid owl
#

is there a way to give an object an alternate name? i need to change a blind's name if ortalab is present

willow plinth
#

i feel like i also need to take a crash course in lua about order of events/microtasks, i feel like i'm creating race conditions with every line i write

brisk rose
lucid owl
brisk rose
#

but I don't think having blinds of the same name causes anything but minor confusion?

lucid owl
#

and i don't think name changes can be done in loc_vars

red flower
#

they can

#

return a key and a set (optionally) in loc_vars
idk if they work for blinds tho

brisk rose
stark geode
#

for loop is not for looping

red flower
dense crescent
#

Is there an object with prefix 'm_' in that mod? cause I got enhancements from filtering all Center with prefix 'm_'

flat sorrel
brisk rose
#

is that why I only got vanillia seals too?

red flower
#

all mod things should be in P_CENTERS

brisk rose
dense crescent
brisk rose
red flower
brisk rose
#

from what I can tell

brisk rose
#

for some reason

dense crescent
brisk rose
#

which wouldn't have a prefix of m

#

the familiar prefix is fam

#

which depending on how you did the string matching I can see the issue

dense crescent
brisk rose
#

but in three tries, I shoulda got at least one actual enhancement

brisk rose
#

deck backs and momento cards so far

#

which is like tarots

red flower
#

how are you looking at the prefix

#

sorry ive not been following the convo

brisk rose
brisk rose
brisk rose
# brisk rose

seems to have a different name than the version in utils

dense crescent
willow plinth
# red flower calculate_effect does more because it can also calculate other effects but they'...

they are also similar in that they don't return anything, right? so i should be able to carefully replace card_eval_status_text with SMODS.calculate_effect

only weird thing i see often is mods calling card_eval_status_text(card, "extra", ....)
does that translate to the extra table of calculate_effect or can i just ignore it? (as i understood, the extra in calculate_effect is for adding an additional effect)

#

WHY DO I FORGET TO WRITE WORDS man sorry everyone who needs to read my garbage

brisk rose
#

as it stands all up to 3 get the same

red flower
willow plinth
red flower
#

yeah

willow plinth
#

calculate_effect wohooooo, card_eval_status_text boooooo

red flower
#

i wish i could make everyone replace create_card for SMODS.add_card

pearl jacinth
#

what happened

red flower
#

you attempted to index local 'res' (which is in fact a boolean)

#

are you making a mod or just playing?

pearl jacinth
#

making

red flower
#

can we see your code then

willow plinth
pearl jacinth
#

element potassium code

willow plinth
brisk rose
#

I lowkey hate that threads in text channels are a thing

#

I get the purpose

#

I just don't like the vibes

red flower
willow plinth
#

i've read bettercalc so often in the last two weeks i have no idea what it is, just that it came before me lol

red flower
#

they made some things about calculate more straightforward and gave a calculate function to most objects

brisk rose
#

it also means you can't trust mods updated last before newcalc became the standard not to do weird shit

red flower
#

i only started my content mod after bettercalc too so idk much about before it

willow plinth
#

you guys need better names for stuff lol

not that i know any better name but...still

brisk rose
#

took me months, lol

#

where's @dense jasper when we need him?

hasty mist
#

is there a way to change the appearance of a rarity badge on the fly

#

like

brisk rose
willow plinth
hasty mist
#

changing every second or so like the misprint text

brisk rose
willow plinth
#

yeah right

brisk rose
#

but that's not everything pre newcalc

willow plinth
# red flower @/john aure smods

i also mean in general balatro...centers are cards and cards are not just cards but also joker or even more but not always and backs are decks and waahahahahahaahahhaah

shut crater
#

what determines the order of jokers in the collection

brisk rose
pearl jacinth
#

the order they were created

brisk rose
shut crater
#

annoying but reasonable

red flower
willow plinth
brisk rose
#

all of the things do

red flower
hasty mist
#

actually, is there anything that lets you freely manipulate badges? or is that hardcoded

willow plinth
#

oh and centers are basically the "heart"/"core" of the card....maybe i get it slowly

hasty mist
#

like, the rarity badge

#

i want to animate it

shut crater
#

anything can be freely manipulated if you're determined enough

#

and know how to patch

red flower
brisk rose
#

like I think center means something different depending on context

willow plinth
shut crater
red flower
#

center usually means ability

willow plinth
#

aaahhhhhhh get me out of here

brisk rose
hasty mist
brisk rose
#

smods, balatro, love2d, lua

shut crater
#

we need more

#

quick, someone add an api

brisk rose
red flower
shut crater
#

lol

willow plinth
#

my mod is layers and layers of stinking shit added on to it mmmmmmhhhh yes

shut crater
#

I have also just created an additional layer for my own mod to sit on

brisk rose
willow plinth
#

you guys are spared from the obscure transpilation quirks from tstl at least

#

that's like an actual fucking layer

brisk rose
willow plinth
#

typescript doesn't even have multireturns - and arrays and objects are different things here

brisk rose
dense crescent
#

Is there another way for creating joker with forced rarity? I don't think SMODS.add_card { rarity = 0.99 } will work if there is a new rarity

shut crater
#

does anyone know the difference between mult, h_mult, and mult_mod

red flower
#

or maybe it was lowercase

brisk rose
#

rarities are strings now, thanks to the rarity api, so are an open set

brisk rose
#

or uh... they're keys I guess

shut crater
brisk rose
#

see, my thing is that smods/balatro is the only codebase I have major exposure to, so I have no idea how idiosyncratic the terminology is

#

why did keys used to be called slugs, despite balatro not seeming to use that in its own codebase? no clue

red flower
dense crescent
willow plinth
brisk rose
red flower
brisk rose
#

but there is a way to definie a rarity

red flower
#

also any modded rarity has to be a string

#

afaik

brisk rose
#

but yeah "under vanillia conditions" the numbers definie rarities

#

the implication is that rarity strings also work

red flower
#

the number is to hard set the weight

dense jasper
weak gate
#

How do I make a right click with the mouse do things in Balatro?

brisk rose
red flower
#

instead of doing pseudorandom() it replaces it with your number

dense crescent
#

I don't know but, this function just a wrapper for create_card() and call get_current_pool() that is hard coded to 'Common', 'Uncommon', 'Rare' and 'Legendary'

brisk rose
brisk rose
willow plinth
red flower
#

yeah

shut crater
#

I feel like I'm in the dumps 😔

#

but yes dumps are a powerful resource

willow plinth
#

i feel like i'm taking dumps into my code

shut crater
#

big mood

dense crescent
#

from lovely/dump

red flower
#

yeah that's not hardcoded

#

it checks if it's a number and does the weight thing else it checks if it's a vanilla rarity and assigns it to the respective number else it uses what you gave it

verbal hare
red flower
#

if you give it a correct one it doesn't poll

brisk rose
#

passes the string directly

shut crater
brisk rose
dense crescent
brisk rose
#

or is discord just not on your pc?

dense crescent
brisk rose
#

must be a bitch to develop a balatro mod on it

verbal hare
brisk rose
#

though if it's only 2gb, it's probably ddr2 or smth, which is very cheap?

dense crescent
brisk rose
dense crescent
brisk rose
#

oh that's grody

#

sometimes when they do they, they still use actual dimms, which is funny bevause it meas it's still upgradable if you're a good solderer

#

though I've never soldered in my life

tender ermine
#

How do you check how much score you have at the end of a blind?

#

Couldn’t find it myself

brisk rose
#

@dense crescent lemme know when you get balatro plus updated, I've been trying to do a release of my modpack, but I keep on running into little issues

willow plinth
#

and these negative icosahedra look RAD

#

my only question is this:

in my eyes i'm doing "make random negative copy of joker" first, then "destroy all negative jokers"

the intention was to also destroy the just created joker with that second action, but hm

tender ermine
# daring fern `G.GAME.chips`?

Idk, I don’t think that would be it, cause I would think that the score would be a separate variable than chips, but I will try it out later

daring fern
tender ermine
verbal hare
willow plinth
# willow plinth my only question is this: in my eyes i'm doing "make random negative copy of jo...

excuse the typescript but the calculate for the first action (copying) is this

if (
    G.jokers !== undefined &&
    G.jokers.cards !== undefined &&
    G.jokers.cards.length > 0
) {
    SMODS.calculate_effect(
        {
            colour: G.C.DARK_EDITION,
            message: localize("landedOnVertex")
        },
        context.blueprint_card ?? card
    );

    G.E_MANAGER.add_event(Event({
        delay: 0,
        func: () => {
            if (
                G.jokers !== undefined &&
                G.jokers.cards !== undefined &&
                G.jokers.cards.length > 0
            ) {
                const randomJoker = pickRandom({
                    options: G.jokers.cards,
                    seed: "icosahedron"
                });

                const copiedJoker = create_card(
                    "Joker",
                    G.jokers,
                    undefined,
                    undefined,
                    undefined,
                    undefined,
                    randomJoker.config.center.key,
                    undefined
                );

                copiedJoker.set_edition("e_negative", true);
                copiedJoker.add_to_deck();
                G.jokers.emplace(copiedJoker);
                copiedJoker.start_materialize();
            }

            return true;
        },
        trigger: "after"
    }));
}

the calculate for the second action (destroying) is this:

if (
    G.jokers !== undefined &&
    G.jokers.cards !== undefined &&
    G.jokers.cards.length > 0
) {
    const destructibleJokers = G.jokers.cards
        .filter((joker) => !joker.ability.eternal && !joker.ability.getting_sliced);

    if (
        destructibleJokers.length > 0 &&
        !(context.blueprint_card ?? card).getting_sliced
    ) {
        if (!(context.blueprint_card ?? card).getting_sliced) {
            SMODS.calculate_effect(
                {
                    colour: G.C.RED,
                    message: localize("landedOnEdge")
                },
                context.blueprint_card ?? card
            );
        }

        G.E_MANAGER.add_event(Event({
            delay: 0,
            func: () => {
                for (const joker of destructibleJokers) {
                    joker.ability.getting_sliced = true;

                    (context.blueprint_card ?? card).juice_up(0.8, 0.8);
                    joker.start_dissolve({ colour: G.C.RED }, undefined, 1.6);
                }

                return true;
            },
            trigger: "after"
        }));
    }
}

they get called after each other and both in the context context.ending_shop

any idea what i am doing wrong here?

#

sorry for flooding the chat

willow plinth
verbal hare
#

like after selecting a deck

brisk rose
willow plinth
#

no bueno i think

verbal hare
#

lmaoao

#

just a name to difference it, i dont think im going to upload it

willow plinth
#

oh is MiDeckTest and WDeckMod something different??

verbal hare
#

test was to look some differences cuz it was crashing

#

but im gonna delete it now lmao

chrome widget
#

Is SMODS.Ranks[card.base.rank].key the best way to determine something's rank within SMODS?

willow plinth
#

at least for cards

#

that's an integer and you can just work with that

chrome widget
#

does id account for modded ranks?

daring fern
willow plinth
verbal hare
willow plinth
chrome widget
#

Oh wait it's not base.rank, it's base.valuethat's typically used for internal SMODS stuff

#

Okay yeah I guess get_id() is fine and accounts for modded ranks, it grabs rank.id from the SMODS rank when it's set

#

It's not constrainted to vanilla ones

brisk rose
#

oh... smods.rank is a mess, the ordering is definied by the person who makes the rank object literally defining ranks that come afterit

#

there is no like.... way to sort by an index

#

which I guess makes sense tbh

chrome widget
#

wdym?

brisk rose
#

even if you want them to

#

at least from what I can glean of documentation

chrome widget
#

I'm still not entirely certain what you're referring to. Numerical value in what context?

#

They give their chip score value, and vanilla ranks at least have numerical ids

digital niche
brisk rose
#

but yeah if you just wanna poll for ranks it doesn't matter anyway

chrome widget
#

If you mean the vanilla ranks within the SMODS.Ranks table, they do have the order they're created, which is in SMODS.Rank.obj_buffer

#

Obviously for modded ranks, it depends on when the mod is loaded

brisk rose
daring fern
brisk rose
digital niche
digital niche
#

i want to check for 3 enhancements rn

brisk rose
#

I think the problem is with vanillia balatro straight detection come to think of it

#

not smodded

daring fern
chrome widget
chrome widget
#

The way Rank ids are determined is in order of application load

verbal hare
brisk rose
chrome widget
#

So multiple mod creators can't force ranks to have the same IDs, because they're determined automatically by the smods load. They could force them to have conflicting keys, but that should generally be avoided just as a design principle

willow plinth
#

i feel like you are talking past each other

digital niche
brisk rose
#

and they're coming at me with facts, which are fine, and pretty much what I presumed, but don't really apply to my musings

chrome widget
#

My pronouns are in my bio, don't refer to me with they/them pronouns pls

brisk rose
#

sorry, she

#

I wasn't assuming you were a they, I was just using the English language default pronoun

#

but yeah, I'll keep that in mind

pearl jacinth
#

how do i make a negative card

digital niche
pearl jacinth
#

well how do i make a negative consumable

brisk rose
#

I think he means in code

pearl jacinth
#

(don't answer perkeo)

chrome widget
#

use card:set_edition(e_negative)

brisk rose
daring fern
brisk rose
#

I have a habit of not doing that, so I'm sorry to anyone I use they for who doesn't wish to be referred to as such

digital niche
brisk rose
#

discord should really just display the pronouns field on messages

willow plinth
brisk rose
#

fair, what's probably worse(?) is my sometimes he/him defaultism when I do check and no pronouns are listed

willow plinth
brisk rose
#

My reason behind doing it is if I check, it means I actually am actively interacting with someone on a somewhat interpersonal and extended level a lot of times, and in that case, I inherently recognize that for anyone that doesn't actively prefer they/them, being referred to exclusively as such can feel odd and othering

#

like, you don't list pronouns, but because we interact so much, they/them would start to feel weird to use

willow plinth
#

i personally just don't care, feel free to mix it up lol

not to make fun of others, i get caring about it

frosty rampart
digital niche
#

for some reason everything here is becoming the m_mills_feral

#

did i do something wrong?

daring fern
verbal hare
digital niche
daring fern
# digital niche how do i check if it contains?

Put this somewhere in your code ```lua
function table.contains(table, element)
if table and type(table) == "table" then
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
end

digital niche
#

ok, what else?

brisk rose
#

and I don't trust folk

#

or really trust discord to not somehow detect it

frosty rampart
daring fern
digital niche
frosty rampart
#

dang

digital niche
daring fern
#

Which is possible but not normally.

digital niche
#

in that part it have to be one of them

willow plinth
digital niche
#

its not working lol

chrome widget
#

Hm I've never done this before, does anyone have any pointers towards animating the Blind Score requirement if an effect changes its value?

chrome widget
#

No I don't mean changing the value, I mean actually animating the text UI element itself

daring fern
chrome widget
#

Although after saying that I literally just found what the game does at least when it sets a blind, which is G.HUD_blind:get_UIE_by_ID("HUD_blind_count"):juice_up()

#

Or I think more preferrably, G.hand_text_area.blind_chips:juice_up()

vocal cedar
#

okay chatters
Im making a consumable that acts very similar to sigil, the "flip your entire hand over, change it in some way, then flip it back"
so it can be used freely whenever you have a hand drawn
so base blinds, arcana packs, and spectrals

this line of code doesnt work tho, works fine on blinds put not the packs

any tips?

#

i tried to copy sigils code from base game a

#

and no dice no pizza

high sinew
#

Is there a way to make a consumable check if a card has a certain enhancement to upgrade/them into a new enhancement

vocal cedar
#

you would check if G.hand.highlighted[i]:edition = "whatever

daring fern
vocal cedar
#

thats a netter way

#

much better

vocal cedar
willow plinth
#

globals.lua

vocal cedar
#

so

#

is there a state that the game sets at when

daring fern
vocal cedar
#

wait

#

hold on chat

vocal cedar
# daring fern

i copied that code exactly before and it didnt quite work

#

yeah its not working

#

it either only works in blinds

#

or works literalyl everywhere lmao?

daring fern
vocal cedar
#

just like a devcheck?

#

okay hold on

high sinew
daring fern
vocal cedar
#

so

#

perhaps i literally just do that lol

#

this seems scuffed tho

daring fern
vocal cedar
#

i got it working lol

#

its scuffed but works

vocal cedar
#

like

#

e_stone?

daring fern
vocal cedar
#

thank!

#

any reason why this isnt working

#

i am unfamiliar with lua lol

#

game isnt crashing, but using the card is softlocking my game

#

some noob shit i know but

#

im just trying to learn i think

daring fern
vocal cedar
#

flip all cards works perfectly

#

its the transform one

#

but here

#

game flips all cards, then just softlocks lol

daring fern
vocal cedar
#

nah

#

its something with the setting of the shit i think

#

let me try to hard code it rq

daring fern
vocal cedar
#

hmm okay

shut crater
#

my magnum opus

brisk rose
shut crater
#

is it?

brisk rose
#

I've heard of pow like a year ago

shut crater
#

I know barely any mods

#

I'm not surprised that I'm not the first person to come up with it though

vocal cedar
#

oh shit i need a return true

brisk rose
vocal cedar
#

IT LITERALLY JUST NEEDED A TRUE LOL

tall wharf
#

never punished

vocal cedar
#

@daring fern what exactly is G.P_Centers anyway?

daring fern
vocal cedar
#

oh okay

#

nice

desert ore
#

should I worry about how the back would look when flipped by amber acorn? things like chad stencil and ignore it, but idk

crisp coral
#

if thunk doesnt do it you dont have to

desert ore
#

would I not be able to hook the function that flips the jokers and for specifically its id, shows a different back? or is it not that simple

brisk rose
desert ore
#

the backs used to be different?

brisk rose
#

I didn't think they showed up different sizes anymore

#

like for wee and square

desert ore
#

no? they still do I think

brisk rose
#

ah I forgor

#

I guess it was modders who wanted to change that

desert ore
#

I like that functionality idk

brisk rose
desert ore
#

well it's like an immersion type thing, like you're actually playing a card game

frosty rampart
#

you're both right
the backs are solid, even if the joker has holes in it. however, the shape is still retained
(this was stencil, photograph, hanging chad, golden ticket, and half joker)

brisk rose
#

buy tnh in a real card game, they'd prpbably just be images printed on normal playing cards

marble flint
#

I have a double-sided joker that acorn shows the back of, but only because it's based off a real line of cards that were printed on both sides

brisk rose
desert ore
#

oh half joker look real weird there

#

ok yeah Irdc then

tall wharf
#

i think you can just punch a hole into the normal back

brisk rose
#

or wait...

#

do jokers always have red deck back?

#

I don't remember

tall wharf
#

no lol

desert ore
#

there's a bug with anhk/invis where it had the wrong back so I think not

marble flint
tall wharf
#

you can do the thing I said or maybe make a mask out of it?

brisk rose
#

or maybe drawstep?

#

with a ask like aiko says

#

mask

desert ore
#

can a shader even make something translucent?

marble flint
#

i need to figure wtf a smods.drawstep actually is

brisk rose
desert ore
#

huh

chrome widget
#

Grrr unblockable events are the bane of my existence right now

desert ore
#

my assumption would be that it can only add colors, but I haven't dared to touch shaders yet

marble flint
brisk rose
#

afaik

marble flint
#

i could theoretically move card calculation logic into shaders if i really wanted to

#

the only issue is that's dumb

brisk rose
marble flint
#

time to go take a video of that one vertex shader i wrote a while ago to establish that i know what i'm talking about

brisk rose
#

ugh, if it's not one thing it's another, i stg

manic rune
#

where are all the blinds' centers?

crisp coral
#

G.P_BLINDS

manic rune
#

thank

desert ore
marble flint
desert ore
#

alright, good to know

daring fern
#

How does one call a function in itself without causing an infinite loop?

willow plinth
willow plinth
daring fern
willow plinth
#

there's multiple way to stop recursion once a goal is reached though

the most basic thing is like this

function test(a)
  if (hasReachedGoal(a)) {
    return true
  }
  
  local new_a = something(a);

  return test(new_a);
end
#

but i think i misunderstand

manic rune
#

i noticed that defeating a boss blind will reset you back to small blind, and i initially thought that the code was in end_round(), but its not, anyone got a clue where the code could be?

willow plinth
#

just need to make sure of two things: have a case that terminates, and return your function call

digital niche
#

is there a way to just remove one of the selected cards in consumable?

#

like a way to differentiate the 2 selected things

daring fern
digital niche
#

tyty!

hard flume
#

Hi chat

digital niche
digital niche
daring fern
hard flume
#

I can't work on my Balatro Mod, away from Computer, so instead I'm working on ideas for it

digital niche
#

the first one i want to change to that enhancement, "m_mills_lots, the second one to remove

#

its crashing

daring fern
regal ether
#

many such cases...

digital niche
regal ether
#

well what argument is v supposed to be anyway

daring fern
regal ether
#

what parameter is that

digital niche
#

basically fusing

regal ether
#

interesting

digital niche
regal ether
#

also personally i would just check the Card.enhancement instead of using the smods function if possible

daring fern
regal ether
#

see THIS makes sense

#

arg1 is the card ok

digital niche
daring fern
digital niche
#

how do i check if a card have an enhancement? like any enhancement, not a specific one

#

just SMODS.has_enhancement()?

daring fern
digital niche
#

tyty!

glass scaffold
#

Can I do multiple calculate functions in a Joker or do I have to figure out some Lua magic to fit 2 effects in one functions?

daring fern
#

It works for most things that would be in the return.

glass scaffold
daring fern
glass scaffold
#

Here's what I got for reference

daring fern
digital niche
glass scaffold
daring fern
#

Iterate over all highlighted cards.

digital niche
#

but the idea of the mod is fusion, so i can have bonus+bonus, bonus+mult, bonus+wild etc

#

wait i dont think i got it right

daring fern
digital niche
#

sorry i really dont understand how that works

daring fern
digital niche
#

i think ill just lay down in all four and start eating grass like the caprine i am instead

daring heron
#

probably a pretty dumb question but how do i add multiple lines to the description?

#

(and how do i add a mod icon)

digital niche
#

just add a , and go to the next line

#

remember to add a " before the comma and in the start of the next line

daring heron
shut crater
daring heron
#

okay it works if i put it in the JSON, but which lines in the .lua should i keep?

shut crater
daring heron
#

well i tried, but then it just doesnt show up here

crisp coral
#

you don't need the lua header if you're using json

daring heron
#

??

shut crater
#

I can send you my mod repo if you want to see how I set mine up

daring heron
#

yes please

shut crater
digital niche
bold sleet
#

Hello. Question: Is there a way to check if any given card has an enhancement?
-# to this day I think enhancements are extra fucked up

daring heron
#

do i make it "text" instead of "description"?

daring fern
digital niche
bold sleet
#

So I don't have to ask again.

shut crater
daring heron
daring fern
bold sleet
#

oh

#

ty

digital niche
#

i think i didnt get it right, again

digital niche
shut crater
#

Can you explain the goal again?

vocal cedar
#

how does one target a joker? G.P_CENTER.Jokers?

daring fern
vocal cedar
#

i want to give iridescent to a random joker

daring heron
vocal cedar
#

just trying to figure out to call

digital niche
daring fern
digital niche
#

wait i think i know how

vocal cedar
#

just how do i target one of your random jokers

daring fern
vocal cedar
#

thank you

#

i need to just study the game objects lol

daring heron
#

so how do i add multiple lines of text in the json?

daring fern
digital niche
#

i can just say
if SMODS.has_enhancement(G.hand.highlighted, {'m_mult', 'm_bonus'})?

daring heron
#

ofc i wanna add more text

#

but how

digital niche
thorn flame
#

thoughts

digital niche
#

can i make something similar to it?

daring fern
daring heron
#

..

digital niche
daring heron
#

alright

shut crater
thorn flame
#

thats the problem

#

i was gonna add more jokers that allow you to get into debt

#

fwiw it may not stay in

daring heron
#

thats the problem

shut crater
#

It's generally (with some exceptions) bad design to create an ability that relies on another ability when that ability is rare or extremely conditional. It is generally better to design around ubiquitous mechanics

daring fern
thorn flame
#

i want to try to make debt more ubiquitous

shut crater
#

I think jokers are not the best way to do that

daring heron
#

this doesnt work

valid dove
shut crater
#

Just because of the cursed design problem of the variance of the joker pool

thorn flame
#

why didnt i think of that

valid dove
#

and it makes the joker a lot of fun to use haha

thorn flame
#

i need to start working on this fucki n mod EARLIER in the dyay when i can think criticaklly

valid dove
#

farming debt on the tooth was an experience

thorn flame
#

wow it really is

vocal cedar
#

is there a generic SMODS.has_enhancement that just checks if a joker HAS an enhancement

#

not a specefiuc

brisk rose
# daring heron yeah thats the problem. how

"description": "A description of your mod.", // [required] ! To use more advanced typesetting, specify your description as a localization entry at G.localization.descriptions.Mod[id]

vocal cedar
#

tryint to code a spectral to apply an enhancement to a random joker that does not already have an edition

shut crater
vocal cedar
#

and if get_enhancements returns nothing thats good

#

okay nice

daring heron
#

does anyone even know what i mean. i just want to add multiple lines to the description like how you can press enter normally in stuff

vocal cedar
#

would it return nil or none

hoary crown
#

crash when my blind is on screen

brisk rose
valid dove
vocal cedar
brisk rose
#

that's what what I sent means

#

i'm almost sure

brisk rose
#

The lack of newlines in the description field has been discussed many times before iirc

#

@daring heron

#

but you can do it in a loc entry

daring heron
#

how do i do that then

brisk rose
#

I mean without the /

#

in the folder for your mod

#

and make a file called en-us.lua

#

(or altneritvely default.lua. I've seen both be used

daring heron
#

like this?

brisk rose
# daring heron like this?

yes, but please stick to lowercase for all the folders inside your mod's folder. It's not technically nessacary but lua is case sensative, as is every OS besides Windows, so things can get weird

#

and you can just forgor what case you used

#

the mod folder being capital is fine

#

also same with the filename for default, that should be lowercase. idk if it needs to be because windows is strange, but that's how it is officially in the code

daring heron
#

do i need to lowercase the pngs too?

brisk rose
daring heron
#

okay, and then what do i put in the default.lua?

brisk rose
#

gimme a second to figure that out, lol

daring heron
#

alrighty

tall wharf
#

lowercase please

brisk rose
brisk rose
vocal cedar
#

how would i figure out what editons a joker has

wintry solar
#

Jokers don’t have enhancements

vocal cedar
#

does get_enhancements return it

#

yeah

valid dove
#

edition is not the same as enhancement

vocal cedar
#

im just trying to figure out if a joker has an editionbruh

#

endition*

eager pendant
#

Can you tell me how to put your color in loc_vars?

valid dove
#

enhancement = lucky, bons, mult
edition = polychrome, foil, holo

wintry solar
#

if card.edition then return card.edition.key end

vocal cedar
#

peak thank you

#

so if a joker has card.edition it returns true?

vocal cedar
#

theres a list of colors somewhere on the wiki

valid dove
vocal cedar
#

but do the {C:color}{} thing

valid dove
#

there are all the colors you ever need

eager pendant
vocal cedar
#

oh i see

daring fern
eager pendant
#

Would this be the correct code?

loc_vars = function(self, info_queue, card)
return {
vars = {
colours = { HEX("#FF00FF") }

vocal cedar
# daring fern No, `if not joker.edition then`
use = function(self, card, area, copier)

        local used_tarot = copier or self
        local cards = G.hand.cards
        --Flip cards
        flipAllCards(cards)
        --Make them stone
        transformCards(cards, G.P_CENTERS.m_stone, nil, nil)
        --Grab a Random Joker without an edition
        local jokers_without_enhancement = {}

        for _, joker in ipairs(G.jokers.cards) do
            if not joker.edition then
                table.insert(jokers_without_enhancement, joker)
            end
        end
        local joker = pseudorandom_element(jokers_without_enhancement, pseudoseed('random'))
        --Roll for initiative
        if joker and math.random() < G.GAME.probabilities.normal / card.ability.extra.odds then
            joker:juice_up(0.3, 0.5)
            joker:set_edition('e_frover_iridescent',nil,true)
            play_sound('frover_iridescent',1,1)
        
        else
            G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
                attention_text({
                    text = localize('k_nope_ex'),
                    scale = 1.3, 
                    hold = 1.4,
                    major = self,
                    backdrop_colour = G.C.SECONDARY_SET.Tarot,
                    align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and 'tm' or 'cm',
                    offset = {x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and -0.2 or 0},
                    silent = true
                    })
                    G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.06*G.SETTINGS.GAMESPEED, blockable = false, blocking = false, func = function()
                        play_sound('tarot2', 0.76, 0.4);return true end}))
                    play_sound('tarot2', 1, 0.4)
                    used_tarot:juice_up(0.3, 0.5)
            return true end }))


        end

okay so help me out here

setting used tarot to "self" but self is nil

#

literally fucking now

#

juice up crashes my game

daring fern
#

Use card.

vocal cedar
#

or CARD?

#

not self?

#

is card self?

daring fern
vocal cedar
#

okay got it

#

thank you lol

eager pendant
#

Would this be the correct code?

loc_vars = function(self, info_queue, card)
return {
vars = {
colours = { HEX("#FF00FF") }

valid dove
vocal cedar
#

it WORKS!!! thank you chat

wintry solar
eager pendant
brisk rose
daring heron
#

not really, it's okay lol

brisk rose
#

I think this is all you need

#

does that look right @wintry solar

#

besides the terrible indenting

daring heron
#

i did try and it didnt work

brisk rose
#

oh I see what I did wrong

last sentinel
#

Is there an effective way to have a joker change the hand recognition(similar to four fingers?), so like, if i have this joker, two pairs are considered full house or something like that

brisk rose
marble flint
#

preferably with a hook to only modify the original logic instead of replacing it

last sentinel
#

gotcha

daring heron
wintry solar
#

I haven’t used the loc file for my mod descriptions

brisk rose
#

yeah I must be parsing "G.localization.descriptions.Mod[id]" wrong

#

all it says is put a loc entry there

#

no more info

brisk rose
wintry solar
#

If cebee can send their code I’ll be able to sort it out

brisk rose
#

@daring heron

daring heron
#

the loc file?

#

or just the .lua script

brisk rose
#

I think it's the header json and loc file that are relevent here?

daring heron
#

loc file was just the one you sent me

bold sleet
#

Question: How do I make so it says +1 consumeable slots instead of joker slots?

daring heron
#

{
"id": "extradecks",
"name": "Extra Decks",
"display_name": "Extra Decks",
"author": ["CebeeDrawz"],
"description": "Extra Decks - Adds a multitude of new decks to the game",
"prefix": "extradecks",
"main_file": "main.lua",
"priority": 0,
"badge_colour": "8389dd",
"badge_text_colour": "fffff",
"version": "1.2",
"dependencies": ["Steamodded (>=1.*)"]
}

#

this is the json

brisk rose
#

idek if that's what that means in what ti says to do, but it's worth a try

brisk rose
#

but I'll let eremel take it from here because he actually has a clue what he's taking about, lol :3

brisk rose
#

so the desc should be fixed for them already?

wintry solar
bold sleet
#

tried with G.P_CENTERS.e_negative. key does not exist

brisk rose
wintry solar
#

No

brisk rose
#

oh sorry

#

i shouldn't talk out of my ass so much

wintry solar
#

Haha

bold sleet
#

Shit does not appear.

wintry solar
#

I don’t remember exactly how to change it, just search the game files for that key

daring fern
bold sleet
daring fern
wintry solar
#

Literally the next line

bold sleet
wintry solar
#

Oh that’s your file

bold sleet
#

Yes

wintry solar
#

Yeah add the _consumeable now

bold sleet
daring fern
bold sleet
#

Let's see...

#

woah, a crash!

wintry solar
#

Missing an e

daring fern
wintry solar
#

Thunk pls

bold sleet
tall wharf
brisk rose
#

so from what I'm getting, the keys for the loc entries are the same as for their respective editions, but negative_consumable of course isn't an actual edition but is just an alt text for if it's on a consumable?

#

couldn't thunk have used a dymanic description? lol

bold sleet
#

UI_definitions, line ~1100, it seems.

#

Not certain.

#

Nor I understand how it works.

wintry solar
#

info_queue[#info_queue+1] = {key = 'e_negative_consumable', set = 'Edition', config = {extra = 1}}

bold sleet
#

Let's see...

#

-# and if ti works do tell how you figured that shit out

wintry solar
#

I mean that’s straight from the game code

bold sleet
#

oh well

#

if it works it works

brisk rose
#

I mean.... it's literally the code that's already in the game for the same purpose

#

it's not rocket surgery

bold sleet
#

for me it is. brain is smol and dumb

brisk rose
#

oh same tho, I just mean how eremel knows is because that's how it is in the game

#

@daring heron looks like you're still online, are you gonna send your loc file for eremel so he can help you? I know it's basicaly what I aleady sent but it's helpful to have it exaclty

desert ore
#

when lovely patching, do I do it for the lovely dump, or for the base game code?

brisk rose
#

I mean the lovely dump insludes any number of mods

#

unless you're just playing vanillia, in which case I think it's nearly identical

#

you match with a pattern, so line numbers don't matter

#

so the base game code I'd say

desert ore
#

well rn I'm looking at the dump vs base game code and they are different, even with just steammodded

desert ore
#

ok that makes sense

daring fern
#

It depends on the patch priority though.

desert ore
#

how exactly does that work

rapid stag
#

bump

desert ore