#💻・modding-dev

1 messages · Page 674 of 1

tranquil echo
#

i changed that in my code too ^^

    key = 'effectgive',
    primary_colour = G.C.RED,
    secondary_colour = G.C.RED,
    default = 'PLACEHOLDER',
    collection_rows = {4,4},
}
#

me too

wanton jolt
#

oh then its b_embr_effectgive_cards = "Effects",

#

you put a k where a b shouldve been

tranquil echo
#

oh my god

#

im so sorry 😭

wanton jolt
#

its fine i know u read my screenshot

daring fern
wanton jolt
#

doesnt consumabletype embed the mod name to the key

#

if not then listen to somethingcom because they know this more than i do 😭

tranquil echo
#

i tried both of your syntax and niethe rworked 😭

daring fern
daring fern
tranquil echo
#
  
  misc={
    
    dictionary ={
      
      b_effectgive_cards = "Effects",
      
    },
    
  },
}```
#

thats it

wanton jolt
#

did u include the localization file in ur main

tranquil echo
#

oh my god

#

😭

#

thank you

wanton jolt
#

no i mean

#

wait

#

i'm dumb

#

localisation file shoud be in your mod folder / localization / en-us.lua

tranquil echo
#

oh my god finally

#

thank you fellas

tranquil echo
#

im tweaked out
what letter do i put here for my card key
[X]_embr_PLACEHOLDER = {

#

i have no idea

daring fern
tranquil echo
#

why c?

fallen timber
#

Spam?

tranquil echo
slim ferry
tranquil echo
#

i mean it worked but for what purpose

#

oh that makes so much sense

#

okay tyty

#

@noble ore please stop talking 😭

slim ferry
#

-# just ignore that c_base exists in vanilla

fallen timber
#

Do we ping mods

slim ferry
#

<@&1133519078540185692>

#

Spam

tranquil echo
#

oh my god it does?

#

im just blind

#

😭 im just slow

#

ty

fallen timber
tranquil echo
#

i am the serpent

fallen timber
#

Noted

tranquil echo
#

genuinely i think im slow

#

embr_effectGive = "Potion",
why is the label not showing 😭

#
    dictionary = {
      b_effectgive_cards = "Effects",
    },
    labels = {
      embr_effectgive = "Potion",
    },
  },```
idle plaza
tranquil echo
#

it doesnt work either way

#

capital G or not it does not display the label

daring fern
tranquil echo
#

nope

daring fern
tranquil echo
#

wait i just realized your pfp

#

you play poly bridge too?

#

peak

#

oh urray!! thank you

#

i was follwing what vanilla reamde was doing

wraith jolt
#

@daring fern I have been trying to figure out how you place seal and enhancement on Jokers, like a DaVinci Code. My God I am terrible at codding but I work with four other people who can code not even they know how you did this madness, dude you got share your secrets

daring fern
wraith jolt
slim ferry
#

Cant you just

#

Look at the repository

wraith jolt
#

I tried but can't find anything that outright said localization: Enchantment on Jokers or seal on Jokers hook

#

Or least my very not skilled eyes didn't catch it

wraith jolt
#

Could be better if I send message, so it not here in public?

pastel kernel
#

ok so this one is tricky, i am trying to make a joker that creates clones of used planet cards, and they all have a 1 in 4 chance of becoming negative.

#

i wann ask how to create clones of used planet cards

idle plaza
pastel kernel
#

i mean, i'd still have to keep track of the card being used.

granite jay
#

Is it possible to replace the small and big blinds with a random boss blind each?

idle plaza
pastel kernel
#

hmm... local card_to_copy, _ = context.consumeable

daring fern
# pastel kernel hmm... ```local card_to_copy, _ = context.consumeable```
local function better_copy_card(card, new_card, area)
    if not card then return nil end
    local area = area or (new_card and new_card.area) or card.area or G.jokers
    local cardwasindeck = new_card and new_card.added_to_deck or nil
    local copy = copy_card(card, new_card)
    if new_card and cardwasindeck then copy:remove_from_deck() end
    if card.playing_card then
        G.playing_card = (G.playing_card and G.playing_card + 1) or 1
        copy.playing_card = G.playing_card
        G.deck.config.card_limit = G.deck.config.card_limit + 1
        table.insert(G.playing_cards, copy)
    end
    if (new_card and cardwasindeck) or not new_card then copy:add_to_deck() end
    if not new_card then area:emplace(copy) end
    return copy
end
if context.using_consumeable then
    local copy = better_copy_card(context.consumeable)
    if SMODS.pseudorandom_probability(card, self.key, 1, 4) then
        copy:set_edition('e_negative')
    end
end
wraith jolt
#

@daring fern What the hook use for enchantment on Joker?

thorn ingot
#

Hi guys. Do you know how I could make SMODS.add_card add a card from the most played rank?

Been trying to figure it out, but no luck.

sleek valley
thorn ingot
sleek valley
#

yeah, i think that'll do!

thorn ingot
#

aight, thanks. balatroheart

fading rivet
#

really need to find a way to disable this omg

wraith jolt
fading rivet
#

an ex

#

oh

#

bruh

#

How could I make a dynamic UI
like say a piece that constantly moves across the screen

wraith jolt
#

I ask the mod and discord server and none them give me a solution

frosty dock
#

you'd have to take that up with discord themselves, and they probably don't care either

pastel kernel
#

how do you make this button affect a specific joker's values?

function G.FUNCS.stealmoney()
    ease_dollars(-5)
end
#

this is for ultra greed, when you press the button, it should spend 5 dollars and then give ultra greed x0.5 mult

wraith jolt
hidden aspen
#

you could have a global counter that checks how many times you've stolen, or you could send a context to jokers that money have been stolen from the shop

pastel kernel
#

how do you set up a global again

hidden aspen
frosty dock
#

Note: it's good practice to add your mod prefix to custom contexts your mod adds

wraith jolt
#

But actually modding questions, it possible to have a consumable permanently grants Jokers additional mult and chips, in similar way Hikers adds to cards.

But instead affect Jokers

hidden aspen
pastel kernel
#
 BB = {}
 BB.money_counter = { }```
frosty dock
pastel kernel
#

i think i'm supposed to make BB.money_counter an int value and not a table

frosty dock
wraith jolt
pastel kernel
#

one second, let me just show you the card description

#

running the game first

frosty dock
#

of course you'd have them be unable to spawn on shop cards

pastel kernel
#

it's not finished since i'm still trying to figure out how to get the button to activate this joker's scaling mechanism

frosty dock
#

Xnil

pastel kernel
#

i know

#

again, still figuring out a way to get ultra greed to scale via the button

wraith jolt
shell timber
pastel kernel
shell timber
#

main balatro

pastel kernel
#

ok so i found thislocal card = e.config.ref_table

#

ok idk what to understand from this

sleek valley
#

how could i check if a specific consumeable is unlocked/discovered?
trying to make a sort of artificial upgrade system where if you unlock the upgraded version of the consumeable, the original doesnt appear again

mystic river
#

G.P_CENTERS[key].discovered or G.P_CENTERS[key].unlocked

sleek valley
#

ty

#

well good to know this game was never made with the idea that consumeables could be locked lol

hidden aspen
#

does anyone know why this function never seems to be called?

#

i did a simple override but it doesnt print at all

#

and i get this error evaluating it with and without override

#

scale being nil is also kinda weird

#

actually G.GAME.modifiers seem to be empty ???

frosty dock
#

the base function is get_blind_amount, this function is for what vanilla doesn't already handle

#

the docs should probably clarify that

hidden aspen
frosty dock
dapper sun
sleek valley
open moth
#

Can you change sell conditions? I have a joker that gives extra joker slots, but want to prevent the joker tray overflowing

sleek valley
#

wait no nvm, im dumb

hoary spear
#

what would be the easiest way to make a deck retrigger all current jokers? ie say, "you have 3 joker slots, but all jokers retrigger once"

open moth
open moth
hoary spear
#
-- 3 joker slots, all jokers retrigger once each hand

return function(REW1RED)
    SMODS.Back({
        key = "resonance",
        loc_txt = {
            name = "Resonance",
            text = {
                "{C:attention}3{} Joker slots",
                "All Jokers {C:green}retrigger once{}"
            }
        },
        pos = { x = 5, y = 0 },
        atlas = "decks",
        config = {},
        apply = function(self)
            -- G.jokers does not exist yet when apply runs; limit is applied in hooks after start_run
            G.GAME.modifiers.rew_joker_slot_limit = 3
            G.GAME.modifiers.rew_all_jokers_retrigger_once = true
        end
    })
end
#

i have no idea wht i was on for this stuff at all

#

there has to be a more consistent way to make this

idle plaza
final jewel
#

yeah I ask this some days ago but how do I make this work the problem is that I am changing a seal in the context.before and I need it to work in the context.main_scoring. like now its working with the code but the animation is wacky like first the seal is disappearing and I dont want that. So Somethingcom said that I need to hook the drawstep but yeah it doent work.

lyric wadi
#

can you dynamically enable and disable the soul layer for joker?

#

or is that a static setting

final jewel
#

idk

#

wait I'll record the problem

#

it just remove it before applying the new one

sleek valley
#

i guess rearrange the order of operations?
make the cards flip over first and then apply the change while it's flipped

final jewel
#

yeah idk I guess Im gonna do that

#

Yeah So I Know its not a good practice but by doing that it is working so yeah

#

is their a way to know if the card is already flip

red flower
final jewel
#

okok nice

#

yeah I scrap the idea seals are weird af

#

it just won't work I think

dapper sun
#

resisting the urge to just make my own keybind system, ,,

past spade
#

how would I change the sprite of a deck (smods.back) mid run?

sleek valley
dapper sun
#

how do i add screenshake?

fading rivet
frosty dock
#

make a second released keybind and set some flag in the held one to check for in the released one, which is then reset. if you think you have a better way to do that, do feel free to send a PR

dapper sun
fading rivet
#

If I want to insert my own function into game instances, would I have to do it via patching, since G seems to be created when reading my mod files

#

or is there another way to do it

fading rivet
#

oop my minigame state doesn't exist

#

any idea why my function isn't being called when I press the bottom button

local blind_tag_ref = create_UIBox_blind_tag
function create_UIBox_blind_tag(blind_choice, run_info)
    local ret = blind_tag_ref(blind_choice, run_info)
    if not ret then return ret end
  local _tag = Tag("tag_uncommon", nil, blind_choice)
  local _tag_ui, _tag_sprite = _tag:generate_UI()
  _tag_sprite.states.collide.can = not not run_info
    ret.nodes[#ret.nodes+1] = {
        n=G.UIT.R, config={id = 'minigame_'..blind_choice, align = "cm", r = 0.1, padding = 0.1, minw = 1, can_collide = true, ref_table = _tag_sprite}, nodes={
            {n=G.UIT.C, config={id = 'minigame_desc', align = "cm", minh = 1}, nodes={
                _tag_ui
            }},
            not run_info and {n=G.UIT.C, config={id="minigame_container",align = "cm", colour = G.C.UI.BACKGROUND_INACTIVE, minh = 0.6, minw = 2, maxw = 2, padding = 0.07, r = 0.1, shadow = true, hover = true, one_press = true, button = 'foobar_select_minigame', func = 'hover_tag_proxy', ref_table = _tag}, nodes={
                {n=G.UIT.T, config={text = "Play Minigame", scale = 0.4, colour = G.C.UI.TEXT_INACTIVE}}
            }} or {n=G.UIT.C, config={align = "cm", padding = 0.1, emboss = 0.05, colour = mix_colours(G.C.BLUE, G.C.BLACK, 0.4), r = 0.1, maxw = 2}, nodes={
                {n=G.UIT.T, config={text = "Play Minigame", scale = 0.35, colour = G.C.WHITE}},
            }},
        }
    }
    return ret
end
#

its calling the regular skip blind function

#

nvm found it

#

one of my patches was overriding the callback

sleek valley
#

yippee :D

dapper sun
#

...wait i can just

#

what i'm doing is already far outside the realm of balatro anyways

inner terrace
#

I think I'm going insane
I'm dealing with an "attempt to perform arithmetic on field 'extra'" error but every call to card.ability.extra has some subvalue, either .extra.bankrupt_at or .extra.spritenum
alright it's happening even when there's absolutely no calls to card.ability

tranquil cypress
#

OOOOO

broken rivet
#

also do you have to play every fucking part simultaneously

dapper sun
#

wdym simultaneously

broken rivet
dapper sun
#

?

#

that was me testing keybind stuff

broken rivet
#

uhhhh

#

oh

dapper sun
#

pressing, holding, and releasing

broken rivet
#

OH

dapper sun
#

look at this beauty,,

fading rivet
dapper sun
#

go ahead

fading rivet
#

🎉

#

call update_inputs in one of the various update functions i'd assume?

dapper sun
#

yea

#

here's the full file

fading rivet
dapper sun
#

you'll have to hook love.keypressed shrug

primal robin
#

Me when I have fully custom controller for most kind of keybinds jangschna

fading rivet
#

assuming theres one for keyreleased too?

dapper sun
#

i assume so

fading rivet
#

i'm also maing a bunch of minigames lol

primal robin
#

game already have tracker of pressed, held and released keys in each frame

dapper sun
#

nice

#

i saw a bit of that earlier ,,

#

oh?

fading rivet
#

-# me eating the entire ui

dapper sun
#

😋

dapper sun
#

yea where

primal robin
#

G.CONTROLLER.held_key_times

fading rivet
#

thx

dapper sun
#

ty

#

i may stick with this method tho since it seems easier

fading rivet
#

man why does balatro have to be a well coded game
I have to actually spend time making good systems that work and are readable

hidden aspen
#

w glorps

idle plaza
dapper sun
#

thanks tricky tony very cool

#

managed to turn it into a lua table tho

fading rivet
dapper sun
fading rivet
#

easy to plug into a program and parse

dapper sun
#

and yet the only time deltarune uses it is for the japanese localization

#

this 100% could've been a json file

#

also all songs are stored in the same functions

#

how do i get the position in the bg music?

pastel kernel
#

how to destroy diamonds after scoring?

dapper sun
#

context.after

#

iterate through the cardarea you wanna destroy cards from and if they're diamonds destroy them

near coral
#

How do I make a joker scale with how many cards aren't in the deck

pastel kernel
#

Played Diamonds give ^1.15 Mult, but have a 1 in 4 chance of being destroyed after scoring

fading rivet
primal robin
#

^1.15? Isnt it just absolutely busted?

fading rivet
#

I dunno the exact code, but erosion knows the full deck size, and blue knows the current deck size

#

subtract then and you get that

tidal hemlock
pastel kernel
dreamy thunder
#

#G.deck.cards should be total cards in deck

#

and #G.playing_cards total playing cards

pastel kernel
#

???```lua
if context.individual and context.cardarea == G.play and
context.other_card:is_suit(card.ability.extra.suit) then
SMODS.calculate_effect ({
emult = card.ability.extra.emult,
colour = SMODS.Gradients["busterb_eemultgradient"],
card = card
})
if SMODS.pseudorandom_probability(card, self.key, 1, card.ability.extra.destroyodds) then
if context.destroy_card then
remove = true
end
end
end
end

idle plaza
pastel kernel
#
if context.individual and context.cardarea == G.play and
            context.other_card:is_suit(card.ability.extra.suit) then
                SMODS.calculate_effect ({
                    emult = card.ability.extra.emult,
                    colour = SMODS.Gradients["busterb_eemultgradient"],
                    card = card
                })
            end
            if SMODS.pseudorandom_probability(card, self.key, 1, card.ability.extra.destroyodds) then
                    if context.destroy_card then
                        remove = true
                    end
                end```
wary crescent
pastel kernel
#

wait

idle plaza
# pastel kernel ```lua if context.individual and context.cardarea == G.play and cont...
            if context.individual and context.cardarea == G.play and context.other_card:is_suit(card.ability.extra.suit) then
                return {
                    emult = card.ability.extra.emult,
                    colour = SMODS.Gradients["busterb_eemultgradient"],
                    card = card
                }
            elseif context.destroy_card and context.cardarea == G.play and context.destroy_card:is_suit(card.ability.extra.suit) and SMODS.pseudorandom_probability(card, self.key, 1, card.ability.extra.destroyodds) then
                return {remove = true}
            end

This is how it should look instead.

pastel kernel
#

g i forgor to put remove = true to the return table ong

granite jay
idle plaza
#

Power of sheer dedication I guess

near coral
fading rivet
near coral
#

Is that supposed to detect the deck size or scale for each card not in the deck

fading rivet
#

that tells you the number of cards not in the dexk

near coral
#

Ok

pastel kernel
#

how do you make a card that destroys a joker but also bypasses eternal

daring fern
near coral
#

Is the "improve your run!" text in the shop a sprite or editable text

#

I wanna make it say impair instead of improve on bzr stakes

daring fern
near coral
#

Alright

thorn ingot
#

Do you know if this table still works. I tried to use it, but it crashes.

rapid stag
#

keyed? i thought that was an indexed table

wanton jolt
#

highlight limit in card area is not respected

#

what did i do wrong

#

also i can't seem to click the combine button as it does nothing

thorn ingot
rapid stag
daring fern
thorn ingot
#

uuu, thanks to the both of you. Will try it.

wanton jolt
#

how do i change the soul_pos

rapid stag
#

during runtime?

wanton jolt
#

yeah

rapid stag
#

i have a function in a custom joker that goes

change_soul_pos = function(card, newSoulPos)
  card.config.center.soul_pos = newSoulPos
  card:set_sprites(card.config.center)
end

and this still works for me

#

newSoulPos expects a table of { x = [number], y = [number] }

#

honestly, i should probably PR this as a base API addition for jokers, lot of people seem to want to change their joker's soul sprites during runtime

wanton jolt
#

oh ok i just refresh the sprites then

rapid stag
#

yes

wanton jolt
#

the sprite changes dont persist on reload

rapid stag
#

oh, right. i ran into that problem myself before and IIRC what i was told to do was to hook set_sprites and have it set the sprites to what i want them to be according to my conditions

but i was running into crashes when i tried and i wasn't getting any help with those crashes, so i instead just wrote another function on the joker that i standardise across all jokers that i need to do that with, which sees what sprite it needs to be based on the conditions i set, then sets it - and in my start_run hook, i add an event that iterates through all jokers in G.jokers, looks for that function and calls it.

#

it's a hacky solution, but it works. if you figure out the way to actually properly do this, please let me know

wanton jolt
#

is there a function i can call when the card has loaded with all its ability

frosty rampart
#

what's the goal

wanton jolt
#

just apply the new sprite_pos and soul_pos on run reload

frosty rampart
#

use an event in the set_sprites function
the event will delay it enough that the card ability is set up by the time the code runs

wanton jolt
#

ok now how do i move the soul pos above the card

rapid stag
#

what?

wanton jolt
#

i want to move the soul pos in the y axis

rapid stag
#

the actual sprite itself? you might want to look into drawstep stuff for that

wanton jolt
#

fuck

#

i rlly didnt want to do that

frosty rampart
#

yea you'll need a custom drawstep to change the physical position of where the sprite is drawn

#

you can probably copy/paste the soul sprite drawstep from smods and edit from there

wanton jolt
limber aspen
#

How do I draw sprite from love.graphics.newImage (or from balatro Sprite class)?

umbral zodiac
#

what are you trying to do?

limber aspen
#

I'm trying to create an object that will be moving on screen and calling a function when hovered over

lyric wadi
#

how do i force spawn a joker with eternal

#

SMODS.add_card({set = 'Joker', key = 'j_egg', force_stickers = {"eternal"}, no_edition = true}) didnt wrok im stupid

daring fern
subtle hawk
#

Because in case with the egg you don't need to force it

#

Egg is already eternal compatible

lyric wadi
#

what do you think is worse

#

eternal egg or eternal credit card

frosty dock
#

Definitely credit card

#

it's a flat $20 that you don't gain interest on, whereas you get temperance value out of an eternal egg

subtle hawk
daring fern
subtle hawk
#

Oh

sleek valley
#

how can i check if a highlighted card in hand is a face card?
trying to make a blind that only lets you play face cards of the same suit

sleek valley
daring fern
sleek valley
#

unless there's something i dont know about

subtle hawk
#

Show the full code that crashes?

sleek valley
daring fern
subtle hawk
# sleek valley

What exactly are you trying to do? I'm pretty sure context.debuff_hand isn't even used to debuff cards

#

And well. There is no card

sleek valley
sleek valley
sleek valley
daring fern
subtle hawk
sleek valley
subtle hawk
sleek valley
#

you can play anything but faces need to be the same suit

#

playing only faces would be diabolical tho lol

subtle hawk
sleek valley
#

bro's a legend 😭 🙏

thorn ingot
#

Hey again guys. Would you know why this code sometimes works and others it doesn't?

#

I don't get it. I'm trying to make 2 copies of the most played rank.

subtle hawk
#

That's hard to read

thorn ingot
#

That's how... prototypes look like.

fading rivet
#

welp good news I don't have to deal with balatro UI jank
bad news I have 0 helper tools from balatro

#

i'm hoping love.graphics works similar to p5, since I have a lot of experience with it

subtle hawk
thorn ingot
thorn ingot
fading rivet
thorn ingot
fading rivet
#

hmmmm

#

does it work for face cards for sure?

thorn ingot
#

yeah

fading rivet
#

;-;

#

idk then

thorn ingot
#

damn

#

life

subtle hawk
fading rivet
#

its probably something with what evgast said

fading rivet
#

i just know I had a problem with one of my cards that wouldn't generate face cards cuase I was getting them wrong

#

wait clover

#

when it genreates the wrong card is it a 10 of spades or something else

#

or just a 10 of any suit

thorn ingot
#

I think so too. I've seen examples of this being done as a global. But I had already tried that and it didn't quite work either. But this kind of worked, though.

#

I'll keep on trying

daring fern
subtle hawk
#
SMODS.current_mod.reset_game_globals = function(run_start)
    if run_start then 
        G.GAME.rank_played = {} 
    end
end
SMODS.current_mod.calculate = function(self, context)
    if context.before then 
        for k, v in pairs(context.full_hand) do
            G.GAME.rank_played[v:get_id()] = (G.GAME.rank_played[v:get_id()] or 0) + 1
        end
    end
end```
I think that should work? Question mark
thorn ingot
subtle hawk
#

Oh oops

thorn ingot
#

Hold on, I might get some video. brb.

fading rivet
thorn ingot
#

aight

fading rivet
#

and go until it gives the wrong card

#

my suspicion is that it not finding the 5oak card

#

so it should return the 3oak card

thorn ingot
#

okay, brb

fading rivet
#

if that doesn't work add 3 million print statements

#

why is it skipping one ;-;

subtle hawk
thorn ingot
#

okay, got the goods

fading rivet
thorn ingot
#

It makes the 2 copies of the 10th rank but not of the king

subtle hawk
#

I would recommend going with globals whether you figure out what's wrong ot not, simply because that's more accurate 🤷‍♂️

fading rivet
#

go my 500 print statements

daring fern
# thorn ingot

The problem is because the rank you are inputting into SMODS.add_card is the id, not the key

subtle hawk
#

Oh😭 😭

thorn ingot
fading rivet
subtle hawk
#

String with a number vs. a number

#

I think

thorn ingot
daring fern
# subtle hawk I think

No, the problem is every rank that is not a number between 2-10 uses it's name instead of it's id as it's key.

subtle hawk
#

Not only (f)aces

daring fern
daring fern
thorn ingot
fading rivet
thorn ingot
#

yeah it made an 8.

Also, for the record. I've been able to make face cards with the code in the video.

#

Hold on!!!!

It seems to be working quite well now. Will keep on testing it.

Thanks everyone who spent time with the problem. balatroheart

sleek valley
subtle hawk
daring fern
sleek valley
#

perfect, tyy :3

subtle hawk
#

Is there a function that runs when all mods are loaded or smth like that

subtle hawk
#

Figures

#

Thanks

fading rivet
primal robin
#

the inventing osu mania in balala, crazy

#

parsing osu maps when

fading rivet
sleek valley
dapper sun
#

funny how 2 people here are doing rhythm game stuff in balatro

#

(my mod's gonna have both lightners live and fnf)

subtle hawk
#

There's no API to add badges to cards in a pool right?

#

Making sure that I didn't just make the stupidest hook ever

dapper sun
#

just do it manually idk

subtle hawk
fading rivet
fading rivet
#

is the dt in all the update functions in ms, seconds, or something else

drifting garden
#

is this where I can ask for help regarding making my first mod?

primal robin
#

use G.real_dt instead

fading rivet
lyric wadi
#

how do you dynamically change the buy and sell cost of a card

#

but like not in an Egg way where it's only an additive bonus to the sell cost

frosty dock
sleek valley
frosty dock
#

yeah for sure, you'd want real_dt for that

fading rivet
tranquil echo
#

hallo!!
im crashing upon shop enter and im not sure why. i think its an issue with my custom rarity but im a little lost on why

    key = "effect",
    default_weight = 0,
    badge_colour = G.C.RED,
    get_weight = function(self, weight, object_type)
        return weight
    end,
}```
pastel kernel
#

how do you check if you're selling a food joker

fading rivet
pastel kernel
#

nope

fading rivet
#

if not then you gotta hardcode the vanilla ones

pastel kernel
#

i thought cryptid has me covered

#

i'm using spectrallib

fading rivet
pastel kernel
#

no

#

it;s using spectrallib

#

cryptlib but better

fading rivet
fading rivet
#

typically its along those lines

pastel kernel
#

ok so apparently context.card:is_food() works

mystic river
#

i imagine spectrallib added that yes

dapper sun
#

where do i find the sources for mod audio? SOURCES only contains vanilla audio

#

oh nvmd

#

SMODS_Sounds

#

nvmd x2

#

it just returns nil

dapper sun
#

nvmd x3 sometimes it does???

#

wait that's SMODS.Sounds

#

not SMODS_Sounds

#

i'm still stumped

rapid stag
#

SMODS.Sound

#

singular

frosty dock
dapper sun
#

i'm after the streams not the sounds

frosty dock
#

<@&1133519078540185692>

#

quick work as always, 10q

sleek valley
#

been seeing a concerning influx of bot activity as of late tbh

#

not even just here, but on a couple other servers im in too

lyric wadi
#

question again

#

can you change what rarity badge a joker would display without actually affecting its true rarity value

median veldt
#

i mean you can do anything technically

#

i think you'd have to hook something but yeah

lyric wadi
#

what about at runtime

#

like changing the badge on the fly

median veldt
#

you could add code to your hook for that

like

#

likeeeeee maybe hook into whatever displays that specific badge and add a check for if its that joker, adn then check against a certain value on that joker instead of its actual rarity

#

i'm not explaining this well bu tyeah

#

i have my own question actually- why isn't debugplus showing logs, i have to tab into the terminal that appears

its only showing its own logs and none others

lyric wadi
#

uhh check settings maybe

#

like the settings has a thing that determines what level gets logged

median veldt
#

yeah it's set to info and my logs are info

#

theres this

#

but ingame theres nothing

sleek valley
#

oh good, so it's not just been me having problems with it!!

median veldt
#

i actually haven't updated debugplus in ages

#

let me try that before i complain

#

yeah ok same problem

wanton jolt
lyric wadi
#

oh jeez uhhh

#

how???

#

like is there a config to prevent a joker form showing badge and then generate a fake one

#

or do i have to hook into the function that generate badges

mystic river
median veldt
hardy vessel
#

How would I check if a consumable is hidden (like the soul or black hole) so it can be avoided from checks?

sleek valley
mystic river
#

shrug
show logs is checked and the log level is high enough, right?
idk what log level print is

wanton jolt
#

is there a hook for when you load a save

#

because for some reason the Cat pool doesnt want to exist on gameload when Yahimod is installed even when i populate it in my own pools.lua and its not applying my sigils on those cards

(and right now to remedy my issue i just do a pool merge on new game load)

left sonnet
#

Hey folks, does anyone know the code section responsible for the area with and under the shop/blind signs? I've been looking around and the closest I've found is the UI for score, hands, discards, so on

frosty rampart
hardy vessel
dapper sun
#

i love communication between threads

#

and from there i just had to :tell()

rapid stag
#

does anyone have a solve for negative cards not showing in the deck view?

gilded blaze
frosty dock
#

peak

#

if anything implements this I might try it in a certain way

wanton jolt
#

how do i show "no space" on the card area when it can't buy the totem

daring fern
wanton jolt
#

thank you

median veldt
#

heyyy so i'm trying to add something that might be too ambitious and I really don't know what I'm doing
are there either like specific tutorials or examples i can pull from to make this
i've got like a husk of what i need but it doesn't actually do anything
-# ideally someone could do it for me with credit (at least enough for me to implement the rest, like the base types and necessary ui and stuff) but I get if you would rather just tell me how i could go about it

basically I have a set of consumables that when used, set a variable in G.GAME (you are choosing a class)

and when you have a class, a button will appear that will allow you to use an ability once per round (based on what class you're using) (except for one that costs money instead of once per round)

it will also ideally display in text what class you have, or maybe it can just do that on the button (with popup explaining it)

#

i can zip up and send my current codebase if necessary

slim ferry
median veldt
#

yeah i looked at that it went very much over my head

slim ferry
#

well like the only other option then is to just look at other mods i think

median veldt
#

thats what im trying to do but the only one that i have in mind (my mod is an extension of it) 's codebase is so fucking ass

slim ferry
#

ui node types are also like the one thing thunk actually comments in the code saying what they are

#

what mod might that be...

median veldt
#

balatrostuck

#

i think i've made myself clear

slim ferry
#

ah

#

amazing stuff

#

anyway theres two links at the bottom of the ui guide that lead to some custom ui code

median veldt
#

also i lost the screenshot but

local peepee
local poopoo

just wonderful stuff

slim ferry
#

better than cryptid variable names

median veldt
slim ferry
#

at least

#

just beware that ui is very janky

median veldt
#

all i have is the consumables and the variable setting

#

and like a husk of the Object for the class

#

yeah, bleh
i could probably figure it out but it's extremely overwhelming

median veldt
fading rivet
#

I got UI fresh on my mind rn lol

left sonnet
# fading rivet I got UI fresh on my mind rn lol

Hey, are you familiar with offsetting in UI? I'm trying to fine tune the y coord of my node but it doesn't seem to be affecting anything

config = {align = "cl", maxw = 3, padding = 0.1, r = 0.08, minw = 2, hinh = 0, hover = true, shadow = true, colour = G.C.CLEAR, juice = true, offset = {x = 0, y = 3},
fading rivet
#

like really big

#

see what happens

left sonnet
#

Bet, 1 sec

left sonnet
fading rivet
#

hmmm

#

idk then I never messed with offset

#

you could put an empty box before it for a margin

median veldt
#

Do you maybe want to take a look at my shell of a codebase

fading rivet
#

sure

left sonnet
#

Odd

#

It's not covered in the UI guide either

fading rivet
#

hmm

#

yeah idk

left sonnet
#

I guess I'll try to set the offsets to be global variables so I can mess about in-game

fading rivet
#

i've been dealing with this crap so I haven't touched offsets

left sonnet
#

What in Jimbo's name am I looking at

fading rivet
left sonnet
#

Is this like Guitar Hero

fading rivet
#

yeah

left sonnet
fading rivet
median veldt
fading rivet
median veldt
#

Its rlly well done but damn

fading rivet
#

this thing is held together with hopes and dreams

median veldt
#

lmao

#

It Looks Good

fading rivet
median veldt
#

sorry there's like. part of an attempt to get something but I really don't know what I'm doing

#

UI is nowhere near my strong suit

fading rivet
#

go go gadget zip bomb

median veldt
#

I've never done it

rapid stag
#

is context.consumeable card or center? like do i get the key by going context.consumeable.config.center.key or by context.consumeable.key?

median veldt
fading rivet
median veldt
fading rivet
#

okay I can't run your mod rn, but does the button show up in the UI

#

if not thats the first thign you should do

#

before making it a button

#

@median veldt

median veldt
median veldt
#

If you can't run it because of the dependency, you can remove the dependency, as it currently doesn't use anything from it

median veldt
fading rivet
#

<@&1133519078540185692>

median veldt
#

how much you wanna bet this is a bot

#

1400 members is wild though

fading rivet
#

yk at least it wasn't a blatant porn server

median veldt
#

yeah true

fading rivet
fading rivet
median veldt
#

only issue with ui stuff is it's really confusing to me

fading rivet
median veldt
#

all i have right now is just the play hand button copied and pasted with like one thing changed

median veldt
#

Would it help if I showed you like exactly where I want the button and what I want it to look like

fading rivet
#

thats how I got this working at the start

median veldt
#

kk

fading rivet
#
local blind_tag_ref = create_UIBox_blind_tag
function create_UIBox_blind_tag(blind_choice, run_info)
    local ret = blind_tag_ref(blind_choice, run_info)
    if not ret then return ret end
  local _tag = FooBar.Minigame:init((G.GAME.round_resets.foobar_minigames or {})[blind_choice])
  local _tag_ui, _tag_sprite = _tag:generate_UI()
  _tag_sprite.states.collide.can = not not run_info
    ret.nodes[#ret.nodes+1] = {
        n=G.UIT.R, config={id = 'minigame_'..blind_choice, align = "cm", r = 0.1, padding = 0.1, minw = 1, can_collide = true, ref_table = _tag_sprite}, nodes={
            {n=G.UIT.C, config={id = 'minigame_desc', align = "cm", minh = 1}, nodes={
                _tag_ui
            }},
            not run_info and {n=G.UIT.C, config={id="minigame_container",align = "cm", colour = G.C.UI.BACKGROUND_INACTIVE, minh = 0.6, minw = 2, maxw = 2, padding = 0.07, r = 0.1, shadow = true, hover = true, one_press = true, button = 'foobar_select_minigame', func = 'hover_minigame_proxy', ref_table = _tag}, nodes={
                {n=G.UIT.T, config={text = "Play Minigame", scale = 0.4, colour = G.C.UI.TEXT_INACTIVE}}
            }} or {n=G.UIT.C, config={align = "cm", padding = 0.1, emboss = 0.05, colour = mix_colours(G.C.BLUE, G.C.BLACK, 0.4), r = 0.1, maxw = 2}, nodes={
                {n=G.UIT.T, config={text = "Play Minigame", scale = 0.35, colour = G.C.WHITE}},
            }},
        }
    }
    return ret
end
#

this uhh does something i forgor what

#

oh this actually inserts the ui

median veldt
#

either one of the two spots really

fading rivet
#

oh over there

#

okay thats much easier

#

I thought u wanted it on the left

#

which meant you would've had to update and redraw the ui

median veldt
#

nah it works better since it semi-ties to that thing that's next to it

fading rivet
#
function G.UIDEF.foobar_minigame()
    local nodes = G.FOOBAR_MINIGAMES[G.GAME.foobar_current_minigame]:generate_gameplay_ui()
    local t = {n=G.UIT.ROOT, config = {align = 'tm', r = 0.15, padding = 0.15}, nodes={
        {n=G.UIT.R, config={align = "cl", colour = G.C.CLEAR,r=0.15, padding = 0.1, minh = 2, shadow = true}, nodes={
            {n=G.UIT.R, config={align = "cm"}, nodes={
            {n=G.UIT.C, config={align = "cm", padding = 0.1}, nodes={
                {n=G.UIT.C, config={align = "cm", r=0.2, shadow = true}, nodes=nodes}
            }}
        }}
    }}
  }}
  return t
end

function G:update_foobar_minigame(dt)
    if not G.STATE_COMPLETE then
        stop_use()
        ease_background_colour_blind(G.STATES.SHOP)
        G.FOOBAR_MINIGAMES[G.GAME.foobar_current_minigame]:set_ability()
        local minigames_exist = not not G.foobar_minigame
        G.foobar_minigame = UIBox{
            definition = G.UIDEF.foobar_minigame(),
            config = {align='tmi', offset = {x=0,y=0}, bond = 'Weak'}
        }
        table.insert(G.I.NODE, G.foobar_minigame) -- manually insert cuase it doesn't show up for some reason
        G.GAME.FOOBAR_MINIGAME = true
        G.STATE_COMPLETE = true
    end
end
median veldt
#

hold on

#

ok im so sorry you might need to walk me through this a little bit

fading rivet
#

sorry i'm just posting code so I can talk about it without confusing you with stuff I did'nt post

median veldt
#

mm ok

fading rivet
#

what you need specificly is this

table.insert(G.I.NODE, G.foobar_minigame) -- manually insert cuase it doesn't show up for some reason
#

this'll make the game draw your ui

median veldt
#

ok what would happen if i basically copied and pasted your code into my thing

#

would it work or do i sitll need some patches

fading rivet
#

uhh it would crash

#

well

median veldt
#

mmmminus some things that are obvious

fading rivet
#

acutally It would do nothing cuase I had to patch a custom game state in

#

but you shouldn't need to do that

median veldt
#

yeah i only need it to show up during play

#

though i guess i'd actually want it to show up during always

fading rivet
#

do you want the UI to always appear, or only if you have selected a class

median veldt
#

the latter

#

but then always after that

fading rivet
#

okay thats more annoying but still possible

#

so in whatever function that selects the class

#

your going to need this

median veldt
#

it puts a string into G.GAME.BALATROSTUCK2_current_class for the reccord

fading rivet
#
function G.UIDEF.BALATROSTUCK2_class_ui()
  return {ui table}
end

-- code that selects class
if G.BALATROSTUCK2_class_ui then
  for i,value in ipairs(G.I.NODE) do
    if value == G.BALATROSTUCK2_class_ui then
      table.remove(G.I.NODE, i)
      break
    end
  end
  G.BALATROSTUCK2_class_ui:remove()
end
G.BALATROSTUCK2_class_ui = {
  definition = G.UIDEF.BALATROSTUCK2_class_ui(),
  config = {align="up to u", offset={also up to you},bond="Weak"}
}
table.insert(G.I.NODE, G.BALATROSTUCK2_class_ui)
#

then to make sure you get rid of it when they leave the run add

#
local create_run_ref = G.start_run
function G:start_run (args)
  local ret = create_run_ref(self, args)
  if G.GAME.BALATROSTUCK2_current_class then
    G.BALATROSTUCK2_class_ui = {
      definition = G.UIDEF.BALATROSTUCK2_class_ui(),
      config = {align="up to u", offset={also up to you},bond="Weak"}
    }
    table.insert(G.I.NODE, G.BALATROSTUCK2_class_ui)
  end
  return ret
end

local go_to_menu_ref = G.FUNCS.go_to_menu
function G.FUNCS.go_to_menu (e)
  for i=#G.I.NODE,1,-1 do
    if G.I.NODE[i] == G.BALATROSTUCK2_class_ui then
      G.I.NODE[i]:remove()
      table.remove(G.I.NODE, i)
    end
  end
  return go_to_menu_ref(e)
end
#

@median veldt

median veldt
#

mmokay hold on

#

alright, i'm not quite sure what to put for the things you left up to me

fading rivet
#

and my align is 'tmi'

median veldt
#

what about the align and more importantly the ui table at all

#

isnt there docs for the align

fading rivet
fading rivet
fading rivet
median veldt
#

I just. Do Not understand it nor how to put it together

fading rivet
#

have you worked with html before?

#

its kinda like that

median veldt
#

yeah

fading rivet
#

its basicly a table element

#

with nested table elements

median veldt
#

i see i see

#

i wish there was like

fading rivet
#

lemme find a ss of one of my decks i'll draw some boxes

median veldt
#

a visual editor for ui and it gives you the ui table and the align stuff

#

that'd be nice

fading rivet
#

but i'm busy with my current mod rn lol

median veldt
#

once you get the chance that would be so helpful

fading rivet
#
--- Generate Bonus tab UI

function G.UIDEF.foobar_view_bonuses ()
    local ret = {n = G.UIT.ROOT, config = {align = "cm", minw = 3, padding = 0.1, r = 0.1, colour = G.C.CLEAR}, nodes = {
        {n = G.UIT.C, nodes = {}}
    }}
    local pushcol = function (r)
        r.nodes[1].nodes[#r.nodes[1].nodes + 1] = {n = G.UIT.C, config = {align = "tm"}, nodes = {}}
        return r
    end
    pushcol(ret)
    local row_limit = 5
    for _, set in pairs(G.GAME.foobar_adaptive.clearedBlinds) do
        for key, _ in pairs(set) do
            if #ret.nodes[1].nodes[#ret.nodes[1].nodes].nodes >= row_limit then ret = pushcol(ret) end
            local N = {}
            localize{type = "other", key = "ba_" .. key, nodes = N}
            local B = G.P_BLINDS[key]
            local out = {n = G.UIT.C, config = {colour = G.C.WHITE, maxw = 4, padding = 0.1, r = 0.1}, nodes = {
                {n = G.UIT.R, config = {colour = mix_colours(get_blind_main_colour(key), G.C.BLACK, 0.7), r = 0.1, padding = 0.1, align="cm"}, nodes = {
                    {n = G.UIT.O, config = {object = SMODS.create_sprite(0, 0, 0.5, 0.5, SMODS.get_atlas(B.atlas) or 'blind_chips', B.pos)}},
                    {n = G.UIT.T, config = {text = SMODS.Blind:get_obj(key).name or "ERROR", scale = 0.5, colour = G.C.WHITE}}
                }}
            }}
            for _, line in ipairs(N) do
                out.nodes[#out.nodes + 1] = {n = G.UIT.R, nodes = line, config = {align = "cm"}}
            end
            -- Please don't do this
            -- this is not a good idea
            -- store references somewhere instead
            ret.nodes[1].nodes[#ret.nodes[1].nodes].nodes[#ret.nodes[1].nodes[#ret.nodes[1].nodes].nodes + 1] = {n = G.UIT.R, nodes = {out}, config={align="tm", r=0.2, padding=0.1}}
        end
    end
    return ret
end
#

okay heres the code for the ss that I'm going to find

median veldt
#

aight

#

Oh could I in theory take a ui table from like

the play button or something that looks similar

and modify it

fading rivet
#

okay here we go

median veldt
#

i seeeee

fading rivet
#

heres what that generates

#

now lemme draw in the tables

#

@median veldt here's what the boxes look like

median veldt
#

i see

fading rivet
#

idk why the wheel is blue

median veldt
#

I'm Blue...

#

Okay okay hm

fading rivet
sturdy compass
#

Guys I don't think Sushi is either green or blue

median veldt
#

I forgot about my status lmao

#

threw some stuff together now hold on

frosty rampart
#

do you gain 1 Mult when a hand is played and lose 1 Mult when a discard is used

median veldt
frosty rampart
#

green 💚

median veldt
#

where did I even go wrong

#

i just copied and pasted the play hand button and changed like one thing

fading rivet
median veldt
#

i did again just copy it idrk what those variables except func mean

fading rivet
#

id remove it

median veldt
#

mm

median veldt
#

i hate errors that aren't direct lol

fading rivet
fading rivet
median veldt
#

both?

#

you mean that and this one?

#

i didnt see this one

fading rivet
#

yeah that one too

#

who needs controller support

median veldt
#

same error

fading rivet
#

oooooh

#

you need a root node

median veldt
#

ohwoops

fading rivet
median veldt
fading rivet
#

same error?

median veldt
#

yeah

fading rivet
#

well first off nodes isn't a array-like table

median veldt
#

it happens when I use the card for the record

fading rivet
#

the roots nodes is the child node

#

instead of a table containing the child node

median veldt
#

mmmi'm a little confused

fading rivet
#

add those

#

after that i'm not sure whats wrong

#

its probably someting simple but I think i'm too tired to figure it out

median veldt
#

mmmmSame error yeah :/

fading rivet
median veldt
#

nope

#

hm

fading rivet
#

yeah i got no clue

#

imma sleep on it and see if I can figure anything out

#

gn

median veldt
#
function G.UIDEF.BALATROSTUCK2_class_ui()
  return {n = G.UIT.ROOT, config = {r = 0.1, minw = 8, minh = 6, align = "tmi", padding = 0.2, colour = G.C.BLACK}, nodes = {{
    n=G.UIT.C,
    config = {
      id = 'bs2_class_button',
      align = "tmi",
      minw = 2.5,
      padding = 0.3,
      r = 0.1,
      hover = true,
      colour = G.C.BLUE,
      button = "temp_func",
      one_press = true,
      shadow = true,
--       func = 'can_play'
    },
    nodes={
      {n=G.UIT.R, config={align = "bcm", padding = 0}, nodes={
        {n=G.UIT.T, config={text = localize('b_play_hand'), scale = text_scale, colour = G.C.UI.TEXT_LIGHT, focus_args = {button = 'x', orientation = 'bm'}}}
      }},
    }}
  }}
end

heres like a codeblock instead of a screenshot just to be safe

fading rivet
#

oh i mean tmi in the ui box

#

not the node

median veldt
#

oh

fading rivet
#

keep the nodes the way they wer

median veldt
#

i have that set to tr

fading rivet
#

still nothing?

median veldt
fading rivet
#

asfoilkjnd fuisdnfauhsljdnfasipje;f ds

median veldt
#

same

fading rivet
#

okay gn

median veldt
#

yeah sleep on it

#

gn!

fading rivet
#

i'll let u know if I think of anything

#

my brains been fried from love graphics 😭

median veldt
#

i'll wait and see if anyone else here has any ideas

thorn ingot
#

Hey guys. It works perfect (needs testing for niche scenarios).

But I was wondering. How do I reset the text of the rank variable when the player finishes a run.
Or, how do I make the text of the rank in the collection be constant? So, it always says 'random'.

naive coral
#

i am trying to get a sound to play, but i cannot for the life of me get it working. the game doesnt crash or anything, it just doesnt work. any ideas/tips?

daring fern
naive coral
#

in the return?

#

like in the braces {}

frosty rampart
naive coral
#

ty

daring fern
median veldt
median veldt
median veldt
naive coral
#

sorry about not specifying, but i ideally wanted the sound to play as the jumpscare does, ie not where return was

#

it did work there tho

naive coral
#

what is thi issue?

#

this is the code, what am i doing wrong?

thorn ingot
#

Hey guys. Do you know why this tag gives 4 enhancements to the deck the first time and then 3 on subsequent? Don't get it.

gilded blaze
# naive coral

play_sound("Krypton_EvilScream", 1, 0.9)
1 is the pitch percent, 0.9 is the volume

naive coral
#

i figured it out alr, sorry shouldve deleted

#

it was a file organising issue, it was in a folder named sound not sounds

gilded blaze
thorn ingot
#

lmao, I might have done some borrowing.

gilded blaze
#

that's not how you check if a playing card has an enhancement

thorn ingot
#

really? It works though

#

But don't doubt it

#

Do you know how it would be?

gilded blaze
#

it works because it selects the entire G.deck.cards

thorn ingot
#

aaah

#

makes sense

gilded blaze
#

use next(SMODS.get_enhancements(card)) to check instead

#

the reason it gives 3 enhancements is because the selection does not really exclude enhanced cards

#

causing a previously enhanced card to be selected again

thorn ingot
#

Yeah, I had seen that one before. Kind of been scraping by. I try to cut corners to get to design.
But, yeah that makes sense. Thanks.

thorn ingot
gilded blaze
thorn ingot
#

lmao

gilded blaze
#

your case would be G.deck.cards[i]

#

I put card as an example duh

thorn ingot
#

alright, will get back on it. 😭

#

Okay It works very well now. Thanks.

sleek valley
#

what's the key to replace the main menu card with an ace of hearts again?

faint yacht
sleek valley
#

yeah, that
but i dont know the exact wording for the set or key

faint yacht
#

...do you wish to have an another card with the original or outright remove it?

sleek valley
#

i want to remove the original and replace it with an ace of hearts instead

#

i already have the block of code correct, i just need to figure out the key

fading rivet
#

its also playing everywhere for some reason

#
select_music_track = function(self)
                    return G and G.GAME and G.FOOBAR_MINIGAMES and G.GAME.foobar_current_minigame and G.GAME.foobar_current_minigame.key == "fbminigame_foobar_projectsekai" and G.FOOBAR_MINIGAMES[G.GAME.foobar_current_minigame] and G.FOOBAR_MINIGAMES[G.GAME.foobar_current_minigame].current_song == ret.key and 10000000 or 0
                end
faint yacht
sleek valley
#

ah, thank you

faint yacht
fading rivet
#

thx

fading rivet
faint yacht
#

...why the or 0?

fading rivet
#

This function is called each frame to decide what music to play. Return values that are not nil, false or a number are converted to zero. The music track that returned the highest value is to be played.
now that I thinka bout it I could just not have that though

faint yacht
#

Just don't return anything if conditions don't pass.

fading rivet
#

yay it wotks

#

well it doesn't play in main menu at least

#

guh okay now it doesn't work in the song

#

go my 500 print statements

thorn ingot
#

Opandora's box has a lot of stuff with music. Maybe you can reference that.

#

In fact let me pull it out

#

it's at the bottom

#

Don't know if it helps though.

fading rivet
#

oh I'm stupid

#

I tried to get the key attribute of a string

thorn ingot
#

Pretty awesome.

sleek valley
dreamy thunder
fading rivet
dreamy thunder
#

makes sense

fading rivet
silent sail
#

how the hell do i do a 7x11 pixel art A

gilded blaze
#

don't use a triangle frame, use a pentagon one instead

left sonnet
#

Hi, do UI elements get updated automatically? For example, if I made a config for a mod, and I were to change a value in a UIBox, like the colour to red with a command, would it change immediately?

sleek valley
left sonnet
silent sail
#

is this better?

sleek valley
left sonnet
#

Ah

sleek valley
#

i mean, you can use Ctrl + M in debugplus to reload atlases but that's it

left sonnet
#

Is there a way to add it to the update loop of the game?

sleek valley
fading rivet
#

if you use commands to change a UI box it'll be reflected in game

sleek valley
#

huh, didnt know that

fading rivet
left sonnet
#

Oooooh I see what the issue is

sleek valley
#

that still doesnt change the code directly tho tbh, so it's better to just restart the game with trial and error imo

fading rivet
left sonnet
#

At the very least for the config menu, it is updating, but you have to re-open the config menu for it to take place, so I guess I need to like copy it and delete it each time it detects a change

fading rivet
#

prevents reloading the game 5 million times

#

if only I could do the same for my ui testing ):

left sonnet
#

Have you tried the DebugPlus watch command? I've never gotten it to work

sleek valley
left sonnet
#

Less of a bother than wasted time really

fading rivet
#

^

left sonnet
# fading rivet nope

I'd give it a shot, apparently it can watch a lua file and update it in-game any time you make a change to it

#

But I think it wants an ID and the times I've used it on a non-shader it's given errors about functions that are only called at the start of the game

sleek valley
sleek valley
#

fair enough .w.

fading rivet
#

the loading screen is quite long

sleek valley
#

that much i can agree with

#

i just dont have the skill to patch it myself and im too focused on the main point of my mods to bother anyway

left sonnet
#

Any of you guys worked with UIBoxes? The nodes in my UIBox seem to be missing/invisible

#

Sending snippet in a sec

fading rivet
left sonnet
#
    meter = 0,
    meter_active = true,
    pink = HEX("FFFDD492"),
    meter_func,

    meter_UIBox,
}

METER.meter_func = function()
        return {
                    n = G.UIT.ROOT, config = {align = "cm", nodes = {
                        create_progress_bar({
                            colour = METER.pink,
                            bg_colour = G.C.PURPLE,
                            label_position = "Right",
                            bar_rotation = "Horizontal",
                            min = 0,
                            max = 5,
                            w = 4.3,
                            h = 0.6,
                            tooltip = {
                            text = {"Meter flavour text here" },
                            },
                            ref_table = METER,
                            ref_value = "meter",
                        }),
                        }},
        }
    end

 METER.meter_UIBox= UIBox{
        definition=METER.meter_func(),
        config = {offset = {x=0, y=1}}
    }```
left sonnet
#

Good question

left sonnet
#

In the patch file there's

{n=G.UIT.O, config = {object=METER.meter_UIBox}}```
fading rivet
#

id recommend inserting it into one of the G.I tables

fading rivet
#

this is what I did for my balatro ui based minigame stuff

left sonnet
#

Is there somewhere I can read up on this or is it one of those things you learn? I don't believe the UI structure guide on the wiki mentions this, or recalculating for that matter

left sonnet
fading rivet
left sonnet
#

Yeah that unfortunately seems to be the method

fading rivet
#

I had the same problem with my UI not being rendered lol

left sonnet
#

I'm gonna go eat first in hindsight, my brain's blanking on every word in there

sleek valley
median veldt
#

If you want

fading rivet
#

I forgor

left sonnet
fading rivet
median veldt
left sonnet
#

That's odd then, it still doesn't render 😭 I'm so buns

#

1 sec

fading rivet
fading rivet
#

I was right it was a stupid issue

#

you didn't make a UI box lmao

#

its just a regular table

left sonnet
#

METER = {
    meter = 0,
    meter_active = true,
    pink = HEX("FFFDD492"),
    meter_func,

    meter_UIBox,
}

METER.meter_func = function()
        return {
                    n = G.UIT.C, config = {align = "cm", nodes = {
                        create_progress_bar({
                            print("Implementing contents.meter"),
                            colour = METER.pink,
                            bg_colour = G.C.PURPLE,
                            label_position = "Right",
                            bar_rotation = "Horizontal",
                            min = 0,
                            max = 5,
                            w = 4.3,
                            h = 0.6,
                            tooltip = {
                            text = {"Meter Flavour Text" },
                            },
                            ref_table = METER,
                            ref_value = "meter",
                        }),
                    }},
        }
    end


if G.METER then
  for i,value in ipairs(G.I.NODE) do
    if value == G.METER then
      table.remove(G.I.NODE, i)
      break
    end
  end
  G.METER:remove()
end

 METER.meter_UIBox= UIBox{
        definition=METER.meter_func(),
        config = {offset = {x=0, y=1}, align = "cm", bond = "Weak"}
    }

G.UIDEF.METER = METER.meter_func()

G.METER = METER.meter_UIBox
table.insert(G.I.NODE, G.METER)

local create_run_ref = G.start_run
function G:start_run (args)
  local ret = create_run_ref(self, args)
  if G.GAME.METER then
    G.METER = METER.meter_UIBox
    table.insert(G.I.NODE, G.METER)
  end
  return ret
end

local go_to_menu_ref = G.FUNCS.go_to_menu
function G.FUNCS.go_to_menu (e)
  for i=#G.I.NODE,1,-1 do
    if G.I.NODE[i] == G.METER then
      G.I.NODE[i]:remove()
      table.remove(G.I.NODE, i)
    end
  end
  return go_to_menu_ref(e)
end```
#

There it is

fading rivet
#

the file should already be loaded

left sonnet
#

Oh bet

median veldt
left sonnet
# median veldt oh Lmao how do I do that

NameOfYourUIBox = UIBox{
definition = {Function that has the layout of your script, imagine the config tab function for example
You could also just define your nodes here},
config = {align="cm", offset={x=0,y=0}}
}

#

Align and offset are optional values, they can be whatever

median veldt
#

so like right here?

#

add UIBox?

left sonnet
median veldt
#

What do you mea

left sonnet
#

You need an Object node to put a UIBox into

#

For example

median veldt
#

holy shiiitttt

left sonnet
#

{n=G.UIT.O, config ={object=YourObject, align="cm", etc}}

median veldt
#

i dont have that actually but it works

#

i just need to position it better and i'm Not quite sure how to do that

fading rivet
median veldt
#

i dont Quite know how the positioning works and how to get it perfect

fading rivet
#

id look at the card areas to see what they use

median veldt
#

alr

left sonnet
#

Similar issue rn

near coral
#

This rekoj is supposed to scale for every card that isn't in the deck, however it isn't scaling at all even after a supposed fix

#

Oh wait nevermind they set it to a max of 52 specifically

median veldt
fading rivet
#

that or G.I.CARD

median veldt
#

ok hold on i uh think im in the wrong file

#

i was looking in UI_definitions but theres nothing with G.I.

fading rivet
median veldt
#

hm none of these really define it

#

interestingly

left sonnet
median veldt
#

i dont have object at all

#

im not the person to ask about ui

left sonnet
#

I know but you're the only one who I can talk to who's had the same issue 😭

#

I'm trying to do it without an object like you to see if it works

mystic river
fading rivet
#

look at the method it's in

median veldt
#

alr

left sonnet
fading rivet
#

wait nvm im stupid

#

ignore that

left sonnet
#

You're good lol

fading rivet
left sonnet
#

Testing

fading rivet
left sonnet
#

It crashes when I try to start a new run, will try without the print

fading rivet
left sonnet
fading rivet
left sonnet
#

Oh right

fading rivet
#

you delete the HI

#

UI

#

then when you go back into the run you need to recreate it

#

otherwise there's no UI to draw

left sonnet
#

Sorry for any silly questions, but if I have it saved to a table for example, and I have the call that inserts it, what would be the issue?

fading rivet
left sonnet
#

As in if it's deleted to clear the duplicate, what would stop it from copying METER.meter_UIBox to G.METER?

#

Wait

#

I might've found the issue

#

Nvm I've not

#

I did change if G.GAME.METER to if METER.meter_UIBox though because I never actually assign G.GAME.METER, unless that's intentional

left sonnet
# fading rivet that would duplicate the entry

So is this not sufficient then? It only assigns it when we're creating a run, which is only where I want it to be
if METER.meter_UIBox then G.METER = METER.meter_UIBox table.insert(G.I.NODE, G.METER) end

left sonnet
#

It appears to, still not sure on the Drawable issue though

#

It is from the graphics.draw at the start, but I don't know where it wants an argument

#

Okay wait I had my config unclosed 😭

#

Okay that wasn't the issue but somehow it wasn't giving an error either

#

The only Drawable I see is text_drawable so I'll try that

#

Setting text_drawable to true on them didn't seem to help

#

Ah, Drawable is a love property understandably

#

What's the purpose of using graphics.draw here if I've already set up a UIBox? Surely the Balatro UI should handle it

primal robin
#

UI shenanigans here ehehe

left sonnet
#

Yes indeed

#

My "UIBoxes aren't rendered", and as you do with Balatro, I'm peeking and poking til I find something

primal robin
#

You dont need do anything related with manipulating of existence of element inside G.I.NODE or G.I.UIBOX or G.I.CARDAREA or anything else

#

Unless you need render in very specific layer in specific conditions

#

Which in 99% cases you dont need

#

Game deleted all nodes in almost everywhere between stage transitions, you dont need to do it manually

#

Also, you need to create UIBox when needed, not during game loading, UI is not supposed to exist or be manipulated that early

left sonnet
left sonnet
primal robin
#

depends on what you want to achieve