#💻・modding-dev

1 messages · Page 675 of 1

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

    meter_UIBox,
}

METER.meter_func = function()
        return {
                    n = G.UIT.C, config = {align = "cm", text_drawable = true}, 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" },
                            },
                            ref_table = METER,
                            ref_value = "meter",
                        }),
                    }
                }
end


METER.meter_UIBox= UIBox{
    definition=METER.meter_func(),
    config = {offset = {x=0, y=1}, align = "cm", bond = "Weak", text_drawable = true}
}
``` Also would it just be this then?
primal robin
#

Even this part have a lot of issues

left sonnet
#

I would love to learn

primal robin
#

METER is global variable, not local which is not okay unless it's unique enough

left sonnet
#

It is a bit vague but it will be the only one, and I plan on renaming it to something less generic, I agree

primal robin
#

then, meter_func and meter_UIBox specified inside METER in on top of file treated as elements of array aka [1] = meter_func, not meter_func = nil

#

A lot of text_drawable in ui, I personally not sure what it does but you definitely dont need it, it's internal variable

left sonnet
primal robin
left sonnet
#

C, C#, Python

#

I would understand C++ concepts if need be

#

Is this about them having random unassigned memory at the moment?

primal robin
#

in Lua, table is combination of dictionary and array, if you specify key = value, then it sets as key = value { a = "b", c = "d" }

#

But if you do like this { "a", "b" }, then they're inserted as elements of array and you'll get { [1] = "a", [2] = "b" }

#

{ meter_func, meter_UIBox } is same as { [1] = meter_func, [2] = meter_UIBox }

left sonnet
fading rivet
#

Any idea why giving a UI box an offset is making it fly offscreen?
I have its major set to G.hand, and every time it renders it just flys off down-right

#

Im trying to make it appear in the same place the blind payout does

left sonnet
#

Not sure though

#

That might explain why 2 meter-like objects fall rapidly down the screen right before the starting Jimbo animation

fading rivet
#

I got it to stay put if I force its VT.y to a certain position, but that makes any items it rendered have their collisions work on what would be the next frame

#

which is why my button was offset

left sonnet
#

Odd

#

Wait

#

Just to be sure, you didn't accidentally do y-=1 instead of y=-1

left sonnet
#

Oh, is that not valid syntax in Lua

fading rivet
#

unfortunately not

left sonnet
#

Damn

left sonnet
#

Just to be sure, I'm not missing anything here am I?
`# Implement meter UI definition
[[patches]]
[patches.pattern]
target = 'functions/UI_definitions.lua' # The file you want to patch.
pattern = '''
contents.dollars_chips,
contents.hand,
''' # The line(s) you want to patch. In pattern patches it should be the whole line(s).

Make sure it's unique in that file. (Unless you want to patch multiple different lines, of course)

position = "after" # Where you want to patch it: 'before', 'after' or 'at' (this last one replaces the whole pattern)

payload = '''
{n=G.UIT.O, config = {object=METER.meter_UIBox}},
''' # What code you want to append/replace it with.
match_indent = true`

primal robin
fading rivet
#

like the blind cash out screen

primal robin
#

parent is parent it needs to be rendered inside of

#

it belongs for rendering mostly

#

For movement major is used

fading rivet
primal robin
#

I mean highlt depends on what you want to render and where

fading rivet
primal robin
#

cash out consist of multiple parts

fading rivet
left sonnet
primal robin
#

so what's wrong here

fading rivet
#

but this is what I want it to look like

#

rn its just flying off the screen

primal robin
#

Just copy G.round_eval definition water

primal robin
#

Then you missed something while copying

#

it's pretty straightforward UIBox which positions itself in bottom center

fading rivet
primal robin
#

where's major

fading rivet
fading rivet
#

lemme add it back

#

wtf

#

this id exactly the same as I had before why is it working 😭

#

thx

primal robin
#

spectator effect

fading rivet
#

wait the buttons still broken

primal robin
#

it's just too under the screen

fading rivet
primal robin
#

There's a limited area where colliding occurs

#

It's some distance from the edges

fading rivet
primal robin
#

If it detects but on click nothing happens then button function you specify just does nothing for some reason

fading rivet
#

its just offset down right for collision

primal robin
#

Probably fucked up UI structure

#

when you mixing up things you shouldn't game may not display/process UI properly

fading rivet
fading rivet
primal robin
#

Why you draw it manually

fading rivet
#

honesty i dont know

#

I have a draw loop for my minigsme and put it in there

#

didnt think to add it to G.I somewhere

primal robin
#

Why you doing that in a first place

fading rivet
primal robin
#

If you're messing around with G.I then you're 100% doign something very wrong and janky

fading rivet
primal robin
#

Or it's somethign very complicated and specific

#

Just create UIBox, it handles rendering for you

fading rivet
primal robin
#

Because it needs to be attached to something

#

By default it's G.ROOM_ATTACH

fading rivet
#

but what would it be attached to if it's stand..
ah thx

fading rivet
primal robin
#

parent needs to be nil, because if parent is present, UIBox doesnt render by itself

fading rivet
#

ight

#

so major then?

#

or is there a parameter I didnt xatch

primal robin
#

major is for placing

fading rivet
#

...

left sonnet
#

Hey, does the role type go into the UIBox definition or the Object Node btw?

#

So like Major and such

fading rivet
#

WHY IS IT MOVING

#

I never touched this wtf

#

@primal robin any idea?

primal robin
#

again, where's major

fading rivet
#

okay its not moving now but it wont render (this is drawn seperately)

#

i did major = G.ROOM_ATTACH

fading rivet
rigid solar
#

So I made a stake above gold that basically applies 1 more green/violet stake... Is it normal that the scaling starting from ante 9 is that insane? Ante 9 is a bit harder than Ante 10 on gold, and Ante 10 is almost twice as big as ante 11 on gold, wtf

#

also ante 8 is a straight x2 which is quite big

left sonnet
#

You've messed something up I'd imagine

fading rivet
#

okay so now at least the UI box isn't lying anymore

#

now I need to figure out the actuall position

rigid solar
left sonnet
#

You say it applies it one more time right? Show me your multiplication/addition/additional application

glass scaffold
#

VERY weird question:

How do I get the profile's name and be able to pass it into a localization file?

rigid solar
left sonnet
rigid solar
#

that's all

left sonnet
rigid solar
#

?

left sonnet
#

G.GAME.modifiers.scaling

rigid solar
#

that's all there is to the code

#

that's what the game uses for that effect

#

that's the code from vanilla remade

left sonnet
#

You have to look deeper into it then

fading rivet
left sonnet
#

It's not an immediately helpful answer but it is usually unlikely that you can find the issue if you're just looking at the above-the-hood code or not checking variables like modifiers.scaling

fading rivet
signal lotus
#

is there a smod method that turns the highlighted card into a certain rank

#

also what does assert() do

left sonnet
left sonnet
signal lotus
#

oh

rigid solar
signal lotus
#

ok

signal lotus
#

how do i get the highlighted cards rank?

#

and how do i turn it to a queen

glass scaffold
signal lotus
#

do i just put like "queen" or something

glass scaffold
rigid solar
#

G.hand.highlighted[1].base.suit (assuming you only have 1 card highlighted)

glass scaffold
signal lotus
#

ok thanks

rigid solar
#

if you want the rank you do G.hand.highlighted[1]:get_id()

left sonnet
# fading rivet

And Major in this case acts as parent? Cause it affects what's moving it anyways

signal lotus
#

how do i do a certain rank]

#

like queen

#

i jyust put 11?

#

assert(SMODS.change_base(G.hand.highlighted[1].base.suit, G.hand.highlighted[1].base.suit, 11))

left sonnet
#

12

fading rivet
#

yeah

#

and instance type makes it render

rigid solar
#

also if you don't want to change the suit, you can just put nil

#

SMODS.change_base(G.hand.highlighted[1], nil, "Queen")

left sonnet
signal lotus
#

Oops! The game crashed:
[SMODS P"code.lua"]:38: Tried to call SMODS.change_base with invalid arguments: suit="Diamonds", rank="12"

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0406a-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
1: TheP by GhostlessYT [ID: Perv, Version: 1.0]
2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.4.2, Uses Lovely]
Lovely Mods:

Stack Traceback

(3) LÖVE function at file 'boot.lua:352' (best guess)
Local variables:
errhand = Lua function '(LÖVE Function)' (defined at line 575 of chunk [lovely debugplus.console "debugplus/console.lua"])
handler = Lua function '(LÖVE Function)' (defined at line 575 of chunk [lovely debugplus.console "debugplus/console.lua"])
(4) global C function 'assert'
(5) Lua field 'func' at file 'code.lua:38' (from mod with id Perv)
(6) Lua method 'handle' at file 'engine/event.lua:55'
Local variables:
self = table: 0x016d3310 {start_timer:true, timer:TOTAL, blockable:true, trigger:after, func:function: 0x01686fc0, delay:0.1, complete:false, time:48.048870866328, blocking:true (more...)}
_results = table: 0x00fc2c58 {blocking:true, pause_skip:false, time_done:true, completed:false}
(7) Lua method 'update' at file 'engine/event.lua:182'
Local variables:
self = table: 0x00fcd3e0 {queue_last_processed:39.533333333332, queues:table: 0x00fcd408, queue_dt:0.016666666666667, queue_timer:39.536464271982}
dt = number: 0.00995168
forced = nil
\

#

what did i do wrong

fading rivet
daring fern
glass scaffold
left sonnet
#

So I can just call the UIBox directly

fading rivet
#

any idea why this won't place the image properly?

draw_results = function(self)
        if self.ability.results_ui then
            local cover_UIE = self.ability.results_ui:get_UIE_by_ID("chart_cover")
            if cover_UIE then
                local SPRITE_DIM = 300
                local transform = cover_UIE.VT
                local w = transform.w / SPRITE_DIM
                local h = transform.h / SPRITE_DIM
                love.graphics.push()
            love.graphics.scale(G.TILESCALE*G.TILESIZE)
                love.graphics.translate(
                    cover_UIE.VT.x + ((cover_UIE.layered_parallax and cover_UIE.layered_parallax.x) or ((cover_UIE.parent and cover_UIE.parent.layered_parallax and cover_UIE.parent.layered_parallax.x)) or 0),
                    cover_UIE.VT.y + ((cover_UIE.layered_parallax and cover_UIE.layered_parallax.y) or ((cover_UIE.parent and cover_UIE.parent.layered_parallax and cover_UIE.parent.layered_parallax.y)) or 0))
                love.graphics.setColor(1, 1, 1, 1)
                love.graphics.draw(self.ability.cover_image, 0, 0, 0, w, h)
                love.graphics.pop()
            end
        end
    end,
left sonnet
#

No idea

fading rivet
#

welp this works ig

glass scaffold
#

Ok, I looked up how to try and concatenate the variable into the string, and we got that.

rigid solar
#

whoever coded it added an extra multiplication on accident

#

i just opened an issue for that

frosty dock
#

oh whoops

rigid solar
#

Im surprised nobody noticed this issue, I assume it's been there since the function exists

#

Surely many mods have some additionnal green/purple stakes

frosty dock
#

I don't think it's been used that much

#

I know cryptid has these kinds of stakes, but I'm not sure if it doesn't provide its own scaling

#

not sure beyond that, but I do think it not being noticed correlates with it not being used much

#

then again there's been errors in widely used parts of smods code that went unnoticed none the less, so maybe no one else has cared yet

frosty dock
left sonnet
#

Yes ante 8 makes sense

glass scaffold
frosty dock
#

the data you want to access is unavailable at the time localization is loaded

rigid solar
#

Which makes sense, I just didnt expect it to be this rough

glass scaffold
rapid stag
#

bump

frosty dock
round lion
#

has anyone tried giving a joker a frontsprite?

#

i don't mean a soul sprite, i mean an actual front sprite.

#

as in the layer the playing cards use

frosty dock
#

that works fine, you just assign a sprite to the card's children.front in set_sprites

rigid solar
frosty dock
rigid solar
#

oh ok

frosty dock
#

-# you can also add your own layers with separate shaders using SMODS.DrawStep

rigid solar
#

im not well versed into how sprites work, i havent toyed too much with them

wanton jolt
frosty dock
#

that's a perfectly well alternative

rigid solar
#

stickers have a shader applied to them by default tho right?

wanton jolt
#

you can remove them anyway

rigid solar
#

right

wanton jolt
#

i can give you the code i use for my stitches

#

because they dont have shine

median veldt
#

lemme get s video hold on

fading rivet
fading rivet
#

and get rid of the thing that adds its to G.I.NODE or wherever you put it

median veldt
median veldt
fading rivet
median veldt
#

ok so the first one

#

mmm then what

#

just add the variables that i didnt add?

#

in the config?

fading rivet
#

add this in the config
major = G.ROOM_ATTACH, type="room",instance_type="CARDAREA"

rapid stag
#

how can i make a sticker not add its localization text to a card's info_queue?
figured it out with a hacky solution: made a dummy entry in localiztion whose only purpose is to be removed via code patched into generate_card_ui that passes over the info_queue, looks for it and sets that info_queue index to nil if the key matches, then had the sticker's loc_vars return that key

fading rivet
median veldt
#

oh rlly

#

alright lets tryyyyy

median veldt
#

ya

fading rivet
#

if u don't do that it won't render

median veldt
#

figured

#

YAY BUTTON

#

of course i'll need to adjust some things and i have no idea where the text is but

#

its a button

#

also why does the temp_func only run once

fading rivet
#

remove that

median veldt
#

woops

#

thank you so much

signal lotus
#

i thought this a thing why didnt it work

median veldt
#

the node exists

#

oh also the code for continuing a run doesn't work

do I need to hook into some savegame function to save G.GAME.BALATROSTUCK2_current_class? because the issue is that its not saving

median veldt
#

~~well its not

#

wait hold on

#

i might just be: stupid

#

yeah I am

#

it was saving

#

i just didnt trigger a save

#

lmao

#

so yeah only problem is the text really

rapid stag
#

bump

granite raptor
#

what's the best way to add editions (or seals/enhancements) to played cards before scoring? the first approaches i tried with the before context each have their own problems and i feel like there's something i'm missing.

    calculate = function (self, card, context)
        if context.before then
            for _, playing_card in pairs(context.scoring_hand) do
                if playing_card.edition == nil then

                    -- Card scores as holographic and juices up before scoring but is visually editioned as soon as play is pressed, which looks odd
                    playing_card:set_edition("e_holo")

                    -- Card juices up and visually turns holographic before scoring, but does not actually score as holo
                    -- Additionally the juice up is immediately before scoring with no delay, which also looks odd
                    G.E_MANAGER:add_event(Event({
                        func = function ()
                            playing_card:set_edition("e_holo", true)
                            return true
                        end
                    }))

                end
            end
        end
    end
slim ferry
#

you should do the former but instead make it playing_card:set_edition("e_holo", nil, true)

#

iirc

#

this delays the animation but still actually applies the edition while scoring is calculating

#

wait no

#

its "e_holo", nil, nil, true im pretty sure

granite raptor
#

huh, i didn't see the fourth argument in vanilla balatro's card.lua file, is that a steammodded addition?

slim ferry
#

yes

#

-# you should set up the balatro and steamodded lsp for that since smods has comments saying what functions get overridden since recently

granite raptor
#

i think i had it set up at some point but ever since setting up git source control it doesn't seem to work(?)

slim ferry
#

oh huh

#

well i mean lsp does feel a bit janky sometimes

#

so it might make sense

granite raptor
#

i have a .vscode folder in my mod directory with a classes and lib but it's in my gitignore (since the lsp def doesn't need to be tracked i don't think) and i don't know if that's causing it to not work

slim ferry
#

that shouldnt cause any issues

granite raptor
#

basically i have the mod folder open in VSC, in the mod folder is the usual .lua files and localization folder and all that, as well as the aforementioned classes and lib under <mod directory>\.vscode\ . unless it needs to be <mod directory>\.vscode\lsp_def\classes or smth

slim ferry
#

wait

#

no the lsp should be in a settings.json file

#

in the .vscode folder

#

pressing F1 and selecting Open workspace preferences (JSON) should take you to creating one

granite raptor
#

oh looks like there is one but it's just. my figura LSP library for some reason??? haven't even made a figura avatar in ages

slim ferry
#

lmfaoo

granite raptor
#

then how would i add the steammodded directory as an entry in settings.json if the mod folder looks like this, would i have to add the whole file path or is there "it's in the same folder as settings" shorthand or smth

frosty dock
#

relative path:

granite raptor
#

okay update, having lsp_def in the mod directory works but if i add lsp_def/ to .gitignore the autocomplete/function view/whatever it's called just stops working which is. kind of annoying, i'd rather not have the entire smods lsp_def in my repo, is there a workaround here

frosty dock
#

-# mine actually has the whole mod folder, which I don't claim is ideal

granite raptor
#

unless i gotta save the workspace first or smth >_>

left sonnet
#

And as Cat said, having both SMods and your currently-working-on mod's folder in it

granite raptor
left sonnet
#

A hwhat now

granite raptor
#

symbolic link

#

ok, turns out the fix is

  • have smods and my mod folder in the same workspace
  • have lsp_def folder in both
  • add lsp_def to .gitignore (git is only tracking my mod folder)
frosty dock
#

weird, that shouldn't be necessary

pastel kernel
#

How do you make it so that a button returns a different thing based on what joker you’re holding? Cause I just found out that ultra greed and Neo metal simultaneously activate when I click one of their buttons.

rapid stag
#

what's your button code

#

i do actually need to look into this myself as i i plan on implementing some wacky button stuff

pastel kernel
#

I’m pretty sure it works beyond “different jokers call for different buttons” and you can just assign a new return based on what joker it’s on

rapid stag
#

i see. and your button node?

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,
}```
median veldt
#

how do i get contexts if I'm making a custom thing

#

like i don't have any code that actually calls use_ability yet i don't know what to put as the context

pastel kernel
#

ooobuttons = Card.highlight
function Card:highlight(is_highlighted)
    ooobuttons(self, is_highlighted)
    asc = {
        n = G.UIT.ROOT,
        config = { padding = 0, colour = G.C.CLEAR },
        nodes = {
            {
                n = G.UIT.C,
                config = { minw = 1, minh = 1, padding = 0.1, align = 'cm', colour = G.C.CLEAR },
                nodes = {
                    {
                        n = G.UIT.R,
                        config = { minw = 1, minh = 0.5, padding = 0.01, align = 'cl', colour = G.C.CLEAR, button = 'universaljokeruse', r = 0.1 },
                        nodes = {
                            UIBox_button { label = { "Use" }, scale = 0.4, minw = 1.3, minh = 0.7, colour = G.C.RED, r = 0.1, button = 'universaljokeruse' }
                        }
                    },
                }
            },
        }
    }
    if self.highlighted and self.config.center.evilbutton == true and not self.ability.extra.to_copy then
        self.children.love = UIBox({
            definition = asc,
            config = {
                parent = self,
                align = 'cm',
                offset = { x = -1.5 , y = 0 },
                colour = G.C.CLEAR
            }
        })
    elseif self.children.love and not self.highlighted and self.config.center.evilbutton == true then
        self.children.love:remove()
        self.children.love = nil
    end
end
-- WORK ULTRA GREED
function G.FUNCS.universaljokeruse()
    SMODS.calculate_context({greedbutton = true})
end
round lion
median veldt
#

it's nopt a card

#

its an Object

round lion
#

oh.

wintry solar
#

what are you trying to do

round lion
#

despite the de-cardeization, it still works like that.

median veldt
#

i'm writing the code that calls use_ability, and I don't know what to put in the function call

wintry solar
median veldt
#

here i'll back up a bit

#

you choose a Class

and this class has an ability

there's a button ingame that when clicked, it will call the class' use_ability function

Class derives straight from Object, so I don't think context is actually something passed yet

round lion
#

just call something like

if obj.use_ability then
obj:use_ability(obj, {whatever flags you want here})
end```
wintry solar
#

you don't need a context for that

median veldt
#

well

#

i do because different classes have different effects

#

actually i guess I still don't need contexts

wintry solar
#

yes but they will have their own functions

median veldt
#

yeah

wintry solar
#

so you just call the class's function when you click the button

round lion
#

is it a manually activated ability

median veldt
#

Yeah with the button

round lion
#

oh.

median veldt
#

You can only use it once per round (except for one which you can pay to use

round lion
#

you only need contexts if its a passive

wintry solar
#

that's also not true

#

contexts only exist because calculation calls the same function over and over again, the contexts provide different flags for different timings along with other useful information for each timing

round lion
#

thats stilll a "passive" activation

rapid stag
# pastel kernel ```lua ooobuttons = Card.highlight function Card:highlight(is_highlighted) ...

this is a bit of a hacky solution, but in the uibutton table call where you specify button, add ref_table = self

for your universaljokeruse func, add an e argument

then change your context call to a more generic one that allows you to distinguish that specific context, while making sure to pass in e.config.ref_table in your context table. so something like

function G.FUNCS.universaljokeruse(e)
    SMODS.calculate_context{ universal_joker_use = true, instigator = e.config.ref_table }
end

and then theoretically you should be able to distinguish between your different jokers in calculate by checking for card.config.center.key == context.instigator.config.center.key...? mr_bones

regardless, you should be able to work something out from there. your primary issue is that you're trying to make your button func distinguish between two different sources without a way to do so

although from there, you'll probably run into a problem where if you have duplicates, they'll both do something when you press the button on one

honestly, maybe instead of using a calculate context for this, you might be better off setting up a function in your joker, something like

function G.FUNCS.universaljokeruse(e)
  local card = e.config.ref_table
  if card.config.center.my_func and type(card.config.center.my_func) == 'function' then
    card.config.center.my_func()
  end
end
```? and then doing what you need the button to do in that function
round lion
#

as in it could happen without forced input

wintry solar
#

forced input could also use contexts though, it's about functions being used for multiple different things from different places, not whether it's passive or active

median veldt
#

oh shit okay uh

#

so that Class object

i've created one and I:
a) don't know how to check if it exists
b) don't know how to actually spawn one into the game

#

Oh sorry it's a GameObject

#

Same issues thoug

tranquil echo
#

alright time for my issue 😓
ive made a custom rarity. when entering the stop, my game just crashes immediately. this is the code for my custom rarity

    key = "effect",
    default_weight = 0,
    badge_colour = G.C.RED,
    get_weight = function(self, weight, object_type)
        return weight
    end,
}```
and here is the crash
round lion
#

how's text styling done

#

as in wheres the files for it

pastel kernel
round lion
#

smods' haunted.

#

i can't find how {button:} is done

pastel kernel
rapid stag
# pastel kernel …I think different buttons isn’t such a bad idea.

this isn't necessarily different buttons per se, just more actually trying to distinguish one button use from the other, since your issue was that your button use on one joker was triggering both what you wanted that button to do and your other joker's button functionality - you just weren't distinguishing between the two at all

deft gust
#

How do I implement a Shoot the Moon effect in code? The example mod I'm going by doesn't have an example for this

round lion
pastel kernel
#

Trying to figure out how to make a button work is already stress for one day.

fading rivet
pastel kernel
#

Trying to do it on multiple jokers will just make me suicidal.

round lion
#

welp, ONWARDS TO HITTING THE FUNCTION LIMIT

#

(and a shit ton of knuths arrows worth of coding warcrimes

#

like actually, wheres the commit that lead to this, my head feels like it will split open

pastel kernel
#

Saxton Hale - Spend $5 to increase operator, increases price by ^1.5 each use.

#

Actually make that $25

round lion
#

atp i think they killed a person to make that function possible

#

cause i cant even find a commit about it

tranquil echo
#

i might tweak i would LOVE help with my crash 😭

pastel kernel
#

LOVE? like LÖVE2D?

tranquil echo
#

yes

#

i think ive asked four times now across two different days and ive been ignored each time

#

and i cannot figure it out myself

pastel kernel
#

What’s ur crash

rapid stag
#

i've looked at this crash several times and can't figure out why it's doing that, sorry 😭

tranquil echo
#

😭

#

lovely

twilit hearth
#

how are you guys teaching yourselves how to make these mods? I need some advice

pastel kernel
#

and why is your version 1224?

tranquil echo
#

what

twilit hearth
#

if im being honest i started vibe coding but that can only get me so far. and also i feel dirty doing it

rapid stag
fading rivet
pastel kernel
twilit hearth
#

i wanted to die

tranquil echo
fading rivet
tranquil echo
#

shoulkd i do that

twilit hearth
#

vscode

pastel kernel
#

lovely 0.9 now

fading rivet
pastel kernel
#

1503? now

twilit hearth
#

LSP?

rapid stag
#

and also repeatedly ramming my head into the wall, too

versed swan
fading rivet
#

along with config set up for smods lsp

fading rivet
#

type hints and stuff

twilit hearth
#

I did not know that was a thing

#

is it an extension?

versed swan
#

Yes, theres one for VSCode

tranquil echo
#

version.dll in the balatro steam folder is for lovely right

fading rivet
versed swan
# fading rivet

these b*ts are getting crazy now theyre promoting lua???? /j mods do not ban pls

rapid stag
#

is it possible to set up something similar to a workspace library in notepad++

fading rivet
#

hold up funny idea

#

FRIXK NO CHROMECRASHRS

#

I dont got wifi

#

oh nvm the stuff is still stored in cache sick

pastel kernel
twilit hearth
#

oh wait

#

yeah I do have lua

fading rivet
fading rivet
twilit hearth
fading rivet
pastel kernel
twilit hearth
#

wait

#

I dont have smods downloaded???

fading rivet
twilit hearth
#

I have Steamodded

#

not smods

#

what did I do wrong here

fading rivet
twilit hearth
#

I tried to run smods beta or whatever from the github and it kept crashing

#

I think I installed this one from the balatro mod manager

#

well regardless I added those paths to the settings

twilit hearth
#

question

#

is the extra calculate function at the bottom necessary for essentially what is a worse golden joker?

rapid stag
#

...there's a mod manager?

twilit hearth
inner terrace
#

Hmm
Is it possible to rename "chips", or is that hardcoded where it appears? If a poker hand name is changed (using take_ownership and a localize() call), it more or less auto-updates everywhere else, but I can't find a similar method for something as base as the term chips

rapid stag
tranquil echo
#

no fucking idea

#

but it snot crashing anymore 😭

#

i replaced my custom rarities file with the one here, and then i added my custom rarity to this file, ran it once, and then i removed the vanillaremate part

#

and its working

daring fern
inner terrace
#

I'll have to look into it! That sounds sick

tranquil echo
#

what are some mods with custom card areas i can look at for reference

#

i dont wanna pester yall wit questions and so i just want examples ^^

rapid stag
# tranquil echo what are some mods with custom card areas i can look at for reference

for setting up the cardarea, you could look into the helper function introduced with steamodded 1221a: https://github.com/Steamodded/smods/wiki/1221a#modobjectcustom_card_areas-helper-function

and here's a screenshot of how i do this in my mod where i implement a custom 1-joker-large cardarea for certain custom decks

iirc atm you will also need to write a patch to add the cardarea to evaluation - something like:

[[patches]]
[patches.pattern]
target = '=[SMODS _ "src/utils.lua"]'
pattern = "-- TARGET: add your own CardAreas for joker evaluation"
position = 'before'
payload = '''
if [condition to check if your cardarea exists] then table.insert(t, [reference to your cardarea here]) end
'''
match_indent = true
overwrite = false
times = 1

see here how joyousspring does that

hope that helps

#

i'm new to custom cardarea stuff myself. so far what i know is that you can populate it using SMODS.create_card/SMODS.add_card by including area = [reference to your cardarea] in your arguments

tranquil echo
#

where do i put this patch

#

a little lost on that part

rapid stag
#

in a .toml file in the /lovely/ subdirectory of your mod

tranquil echo
#

mm ok ty

tranquil echo
#

youll never believe it

#

im having more strange nil index crashes!

#

lemme keep tinkering but i may have questions

#

wait i know exatcly whats going on holdon

#

im trying to make a consumable spawn a specific joker in a specific card area

#
    key = 'sparkling_water',
    atlas = 'Potions',
    set = 'effectGive',
    pos = {x = 1, y = 1},
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('tarot1')
                SMODS.add_card({
                    key = 'j_embr_sparkling_water',
                    area = 'embr_potionArea',
                })
                return true
            end
        }))
        delay(0.6)
    end,
    can_use = function(self, card)
        return true
    end
}```
rapid stag
#

...that's odd. my understanding of what T is in that context is to do with sprite rendering. it shouldn't be nil. do you still get this crash on the current release of steamodded?

tranquil echo
#

uhhhhhhhhhhhhhhhhhhhhhh let me update my steammodded

#

😓

rapid stag
#

wait a minute

#

does the area arg take a string?

#

it could be to do with that. try passing a direct reference to the cardarea instead

tranquil echo
#

why the FUCK did potassium turn itself on after i updated smods LMFAO

rapid stag
#

that's interesting

tranquil echo
#

how silly

#

but that fixed it

#

i need to play with the scalee but its there

#

oh wow you can just drag these freely😭

rapid stag
#

that means it's not being added to your cardarea correctly

#

could i see your cardarea definition

tranquil echo
#

fixed it ^^

#

i was using create_card instead of add_card

rapid stag
#

i was about to bring up the docs for these funcs, but yes, that would do it

rapid stag
median veldt
#

kind of bad, but it is what it is.

#

and here's a definition of one

median veldt
rapid stag
#

all good

#

hmm. are you running debugplus? if so that would be quickest to help determine if the class exists

rapid stag
#

in-game, try just simply doing eval BS2.Classes and eval BS2.Class in the console and seeing what that outputs. if you get anything other than nil, that means your things exist. but would also be useful to see if it's as you expect

#

as for spawning one, do you know where you want to spawn them? into the joker area? the consumables area? the hand area? your own custom cardarea?

#

you could also test spawning that with debugplus, too

median veldt
rapid stag
#

that makes sense

median veldt
#

there's only ever one at a time

rapid stag
#

but given that you want to spawn it, you intend for there somewhere for it to be, no?

median veldt
#

i'm actually not sure if i am getting the meaning of spawn right

rapid stag
#

i see

median veldt
#

i just need there to be the presence of the object so that its ability can be triggered

#

i suppose i could put it somewhere with no sprite or anything

tranquil echo
#

i hate to bother you over and over
however
what do i put in my utils.lua for it to properly patch? when using target = '=[SMODS _ "src/utils.lua]' it crashes complaning that utils.lua doesn exist which is correct.
i tried pointing it towards target = '=[SMODS _ "src/objects/cardarea.lua"]' and that loads the game but the new joker doesnt do anything
the attached crash is for the former case

rapid stag
#

in that case, you could make a variable in G.GAME to put it in

median veldt
#

G.GAME.BALATROSTUCK2_class

rapid stag
median veldt
#

figured, but like.

#

how

#

what value do i put

tranquil echo
# rapid stag ...what? the first one should work. what is the patch?
version = "0.1.0"
dump_lua = true
priority = 0


[[patches]]
[patches.pattern]
target = '=[SMODS _ "src/utils.lua"]'
pattern = "-- TARGET: add your own CardAreas for joker evaluation"
position = 'before'
payload = '''
if true then table.insert(t, embr.potionArea) end
'''
match_indent = true
overwrite = false
times = 1```
median veldt
#

what exactly is embr?

tranquil echo
#

my mod prefix

median veldt
#

m

#

i think this might be running before that's registered? maybe

#

not really sure.

rapid stag
median veldt
#

oh yeah true

median veldt
tranquil echo
#

omg that worked

median veldt
#

um.

tranquil echo
#

thank you i love you so much

median veldt
#

what value

#

i've never really created a custom gameobject

#

the gameobject is bs2_class_bstuck2_[class name]

rapid stag
#

under what condition do you want the object to be
i guess, spawned, since there isn't really a good term for it

tranquil echo
#

created?

median veldt
#

rather than "not exist" which is what it is currently i think

#

hold on let me check something

tranquil echo
#

i lied
it booted but it still doesnt work if its in the custom area

median veldt
#

i'm assuming this means that i am wrong in my judgment

tranquil echo
#

sorry twin but i have no idea 😭

#

mine is a really janky way doing things
the stuff in my custom card area is just regular jokers disguised as something else

rapid stag
median veldt
#

oh

#

wiat

#

nope

#

i know the problem

tranquil echo
#

this file is 3.5k lines long what am i looking for in here

median veldt
rapid stag
rapid stag
median veldt
#

i in fact do not!!!

rapid stag
median veldt
#

i needed to use ipairs

#

i know that, i just didn't catch it

rapid stag
#

i was about to bring that up yeah

median veldt
#

so basically i can just call use_ability directly on the thing

#

which is awesome.

tranquil echo
tranquil echo
median veldt
#

isnt it embr.potionArea

rapid stag
#

that would do it

tranquil echo
#

well
it is not unfortunately

rapid stag
#

what is the correct way to refer to your cardarea

tranquil echo
#

wait

#

is it not embr.potionArea?

rapid stag
#

could i see your cardarea definition please

tranquil echo
#
    game.embr_potionArea = CardArea( 
        16, -- x coordinate
        3, -- y coordinate
        game.CARD_W * 2, 
        game.CARD_H * 0.5, 
        {
           
            card_limit = 1,

            type = 'joker',
            
            highlight_limit = 1,
           
            no_card_count = true, 
            align_buttons = true, 
        }
    )
end```
pulled off of the smods wiki
#

in its own file

median veldt
#

G.embr_potionArea

#

i believe

tranquil echo
#

youre probably right

rapid stag
#

i gueeess that could work, but iirc what's recommended is to put it into your mod's global table and refer to it that way

tranquil echo
rapid stag
#

do you have a global mod table that you put things into?

tranquil echo
#

nope

rapid stag
#

i see. you should just be able to put it into a global variable anyway so that SMODS can access it

so before your cardarea definition, put

[your global variable name here] = nil
``` then immediately following it but before the end of the function, put
```lua
[your global variable name here] = game.embr_potionArea
``` then in your patch, change the payload content to
```lua
if [your global variable name here] then table.insert(t, [your global variable name here]) end
#

the name can be anything you want, so long as it is exactly the same across all substitutions

tranquil echo
#

aye that worked

#

you are so magical thank you

#

so much 😭

rapid stag
#

np 👍

median veldt
#

<@&1133519078540185692>

#

sigh

#

do you think the people who get hacked fall for the same scam that the accounts do or do they do multiple different kinds

#

cuz if so thats just sad

#

actually i'm pretty sure it is the same

#

like a virus

#

i once fell for that steam report scam and they had just done the same thing

thorn ingot
#

lmao, that one was funny. To be fair, coding too much messes you up.

median veldt
#

lmao??

thorn ingot
#

I meant the way the spam was worded.

median veldt
#

oh yeah lmao

#

what function can i hook into to set a variable at the start of every round?

rapid stag
#

elaborate on the start of every round? like when you start a blind? or when you start a new run/load it?

median veldt
#

the former

rapid stag
#

hook new_round()

median veldt
#

it's iin G.GAME so it'll save if you load it

#

kk

#

Lets hope I remember how to hook lets go its been a bit

median veldt
rapid stag
#

just new_round()

#

takes no args

median veldt
#

kk

#

did I do that right

rapid stag
#

yes

#

for anyone reading back over this and wanting the latter, that'd be Game.start_run(self, args)

#

but for that one, if you want a point in runtime that's still in the main menu, G.FUNCS.start_run(e, args)

median veldt
#

maybe cuz its lovcal

#

no that cant be right

rapid stag
#

probably because of the _

median veldt
#

cuz i have this one earlier

#

al i did was change the name

#

let me check what line that is

frosty rampart
#

it needs to be local new_round_ref = new_round, without the parentheses

median veldt
#

oh

#

woops

rapid stag
#

oh

median veldt
#

i knew that

frosty rampart
#

you should be copying the function itself, not the return value of the function

median veldt
#

yea

vocal helm
#

Is there a way to check for a poker hand in G.hand instead of G.play?

frosty rampart
#

pretty sure there's a function that evaluates poker hands for any given table of cards, but i don't know the name of it off the top of my head

frosty rampart
vocal helm
#

sweet, thanks!

daring fern
vocal helm
#

Ah; with that, how would I get a poker hand? i.e. checking for "Two Pair" in G.hand.cards

#

...where is G.FUNCS found in the code, anyway? I'm checking the lovely dump and I could also benefit from checking draw_from_hand_to_deck

daring fern
vocal helm
#

thanks!

#

thanks!

daring fern
frosty rampart
vocal helm
#

-# why select(3, ...)

daring fern
frosty rampart
#

ah, fair enough

daring fern
vocal helm
#

ahh, okay!

vocal helm
#

Thanks for the help!

median veldt
#

is there a function i can call that would serve the same effect as return { message = whatever } in a joker

like making a message pop up under a card

daring fern
glass scaffold
#

So does a calculate function for SMODS.Challenge work as normal or is there some trickery I need to know going in?

daring fern
vital wren
#

both ceremonial dagger and riff-raff trigger on context.setting_blind but ceremonial dagger triggers first. why does their order in the joker zone not affect the order of their resolution?

#

wait. i think i know what's wrong. my code

#

the event manager my nemesis

upbeat swallow
#

Is it possible to replace the Jimbo card that appears when you win/lose?

#

And possibly the default Jimbo joker that appears in games even if you disabled vanilla jokers

glass scaffold
daring fern
glass scaffold
glass scaffold
daring fern
gilded blaze
#

that would be start = 1, end = 1, step = 5

glass scaffold
#

Ok, about to test this nightmare out.

#

Nope.

gilded blaze
#

use #G.jokers.cards ~= 5 instead of not (#G.jokers.cards == 5)

#

the error would be not (#G.jokers.cards = 5), you're trying to assign instead of comparing

glass scaffold
#

apply = function(self, back) rather than the calculate?

#

This keeps throwing [SMODS WildcardCollection "crossmod/music_music_rotation.lu:48: attempt to index field 'jokers' (a nil value).

#

And for the life of me, I don't get how.

gilded blaze
#

that's because apply is called before areas are initialized

#

put that inside an event

glass scaffold
#

FINALLY it works

umbral zodiac
#

why is your game malignantly orange

glass scaffold
umbral zodiac
#

i know that

#

but like why so orange

glass scaffold
umbral zodiac
peak void
#

im curious, is there a way to get highlighted jokers/consumables the same way you can get highlighted cards in hand?

daring fern
peak void
#

oh, you can do that? thank you

umbral zodiac
#

note that the cards in that table will be in the order they were highlighted

#

not the order they’re placed in

peak void
#

unrelatedly, is it possible to get card retriggers from the use event of a consumeable?

#
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('timpani')
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
        for _, playing_card in ipairs(G.hand.cards) do
            if SMODS.has_enhancement(playing_card, 'm_bonus') then
                G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    delay = 0.4,
                    func = function()
                        playing_card:juice_up(0.3, 0.5)
                        ease_dollars(math.max(0, card.ability.extra.bonus_dollars), true)
                        return true
                    end
                }))
            end
        end
        delay(0.6)
    end,

Here's what I'm doing. It works, but obviously there's nothing that checks for retrigger effects like red seals or mimes. I'm like, fairly certain that it's just not possible to do this, which is probably fine, but it would be nice I guess

peak void
#

well this already works

#

it just adds $4 for every bonus card in hand when the consumeable is used

#

the goal is ideally to make it so that if the card would be retriggered in hand, it would give $4 again

daring fern
# peak void the goal is ideally to make it so that if the card would be retriggered in hand,...
for k, v in pairs(G.hand.cards) do
    if SMODS.has_enhancement(v, 'm_bonus') then
        local reps = {1}
        local j = 1
        while j <= #reps do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    v:juice_up(0.3, 0.5)
                    ease_dollars(math.max(0, card.ability.extra.bonus_dollars), true)
                    return true
                end
            }))
            if reps[j] == 1 then
                SMODS.calculate_repetitions(v, {repetition = true, cardarea = G.hand, card_effects = {{}, {jokers = {dollars = math.max(0, card.ability.extra.bonus_dollars)}}}}, reps)
            end
            j = j + 1
        end
    end
end
vital wren
#

is there somewhere i can hook that will let me do stuff just after a run starts but after any consumeables from deck/challenge have been gained?

mystic river
#

you might not need to hook it
have you tried reset_game_globals?

vital wren
#

wasn't aware of it. where does that get called?

peak void
mystic river
#

if it's too early you can probably just use an event to delay your thing

vital wren
#

neat, ill give it a try

sleek valley
#

would there be a way for a blind to debuff all scored cards?
like, i want to make it so that the unscored cards are the only ones that count to score

#

making them count was easy, just copy Splash code, but making the scored card not count is where im struggling

daring fern
sleek valley
#

is that... not the same thing?

daring fern
sleek valley
#

ah right
let's say debuff then

daring fern
sleek valley
#

maybe i wrote smth here wrong, idk

drifting garden
#

how can i allow the player to select 2 jokers at once while they have a card selected that wants to interact with 2 jokers? i know cryptid did it, but looking through the files i can't find where that code is :(

slim ferry
rigid solar
#

yeah basically you just manipulate G.jokers.config.highlighted_limit

wintry solar
#

you can use something like this for dynamic adjustments when you select ceertain cards

nimble jay
#

sorry if this is easy and im just missing it, but how do you check if the played hand has at least two scoring cards of the same rank and suit?

median veldt
#

what are events actually for?

#

no i was not

nimble jay
umbral zodiac
#

additionally since it’s a queue you more easily control the order of things happening

hidden aspen
#

because by default events block each other, and some animations are events it allows to do something on animation finish / chain animations

median veldt
#

mm

#

i see

#

also is it just me or is this just scuffed

versed swan
# nimble jay sorry if this is easy and im just missing it, but how do you check if the played...

I'm just gonna give this to you:

local function has_identical_cards(card_list)
  local ranks = {}
  for _,card in ipairs(card_list) do
    local rank = card:get_id()
    local suit = card.base.suit

    ranks[rank] = ranks[rank] or {}

    if ranks[rank][suit] == true then
      return true -- The for-loop stops here
    else
      ranks[rank][suit] = true -- After, we go check the next card
    end
  end
  -- All cards checked and nothing was found
  return false
end


-- To use the function:
if has_identical_cards(G.play.cards) then
  -- do something
end
sleek valley
tranquil echo
#

how would i check if a certain card is in a card area

#

and also, how would i change the functionality of an already existing enhancement

hidden aspen
tranquil echo
#

oh lovely

hidden aspen
tranquil echo
#

so many of my questions i just dont know where the answers are

#

tysm

median veldt
#

is it possible to like
card.use()
and it'll use it if card is a consumable

tranquil echo
#

wdym?

median veldt
# tranquil echo wdym?

like if I were to run a for loop through G.consumeables.cards and if they're a certain type of consumable, force it to be used

#

cuz i have a deck that i want to spawn two cards and use them immediately

tranquil echo
#

ah

#

i mean i thiiiink so?

turbid kindle
#

Infinite Tower
Legendary Joker

If your hope is known to shatter and you doubt that we'll survive [...]
All tags become Lightbulb Tags. Use this card to consume one Lightbulb Tag and gain +2 xMult.

Lightbulb Tag
At the beginning of blind, turn all playing cards in hand into the Brights suit and give them the light enhancement.

Brights (from 0 Error)
Brights have the special property of counting as all 4 vanilla suits.

Light Card (from Cryptid)
When played with 5 other scoring cards, gain x0.2 Mult and increase requirements by 5.

I'm making an expansion mod that requires both 0 Error and Cryptid and this is the first legendary joker. Thoughts?

tidal hemlock
#

ASaS has 4 special suits that acts as 2 of each vanilla suit

turbid kindle
#

You shouldn't compare your mods to other mods, because what you bring to the table is its own thing and you should keep it that way!

#

Besides Brights interact weirdly with flushes

tranquil echo
#

how do i change the description of something based on a condition?

#

😓

tranquil echo
#

i love oyu

#

uh
i may be stupid
but what if my description changes if a different card exists

#

can i put an if inside of my loc_vars?

vital wren
#

oh dang, i didn't know VR had an faq. im gonna read the whole thing and learn so much shit lol

red flower
tranquil echo
#

oh peak ok

#

im doing that then!

vital wren
#

how would i check a card's printed suit ignoring wild and smeared joker?

#

does card.base.suit do that?

rapid stag
#

yeah, checking card.base.suit will ignore wild & smeared

naive coral
#

i am trying to make it so a joker destroys itself if it is not clicked for 15 seconds. how would i go about doing this?

idle plaza
fading rivet
# naive coral i am trying to make it so a joker destroys itself if it is not clicked for 15 se...
local click_ref = Card.click
SMODS.Joker{
-- stuffs
  config = {
    extra = {
      timer = 15
    },
    immutable = {
      timer = 0
    }
  },
  click = function(self)
    local ret = click_ref(self)
    self.config.center.ability.immutable.timer = 0
  end,
  update = function(self, card  dt)
    card.ability.immutable.timer = card.ability.immutable.timer + dt
    if card.ability.immutable.timer >= card.ability.extra.timer then
      SMODS.destroy_cards(card)
    end
  end
}
#

I think that should work

fading rivet
red flower
fading rivet
#

fixed

median veldt
#

this in fact does not work

#

just says use is a nil value

idle plaza
#

The function you're looking for is Card:use_consumeable(area, copier)

median veldt
#

what do i set to copier?

idle plaza
#

You can just exclude it, I think it's for like, the Fool.

median veldt
#

okay so i'm assuming i have to destroy the card manually 😭

#

because it used the card but the card sitll exist

#

yeah ok

naive coral
fading rivet
#

crash?

#

no reset?

naive coral
#

no crash, its just the timer never gets reset

#

so it vanishes no matter what

fading rivet
#

I made this on my phone so i'm going off memory

naive coral
#

nah its alg (your really good then wow)

fading rivet
#

okay click probably doens't override like I thought it would then

#

when you click on the card does its UI show up like normal

naive coral
#

yes, the text is still there

#

acts like any other joker

fading rivet
#

okay then yeah it doens't override what I thought

median veldt
# fading rivet do this

im so sorry to bother you with more ui but i just have one small thing

how do i add l9ike a tooltip to my button

#

the tooltip is already in localization it's jsut c_bstuck2_[your class]

median veldt
#

yea i've got it

fading rivet
#
G.FUNCS.hover_minigame_proxy = function(e)
  if not e.parent or not e.parent.states then return end
  if (e.states.hover.is or e.parent.states.hover.is) and (e.created_on_pause == G.SETTINGS.paused) and
    not e.parent.children.alert then
      local _sprite = e.config.ref_table:get_uibox_table()
      e.parent.children.alert = UIBox{
        definition = G.UIDEF.card_h_popup(_sprite),
        config = {align="tm", offset = {x = 0, y = -0.1},
        major = e.parent,
        instance_type = 'POPUP'},
    }
    _sprite:juice_up(0.05, 0.02)
    play_sound('paper1', math.random()*0.1 + 0.55, 0.42)
    play_sound('tarot2', math.random()*0.1 + 0.55, 0.09)
    e.parent.children.alert.states.collide.can = false
  elseif e.parent.children.alert and
  ((not e.states.collide.is and not e.parent.states.collide.is) or (e.created_on_pause ~= G.SETTINGS.paused)) then
    e.parent.children.alert:remove()
    e.parent.children.alert = nil
  end
end
#
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
    if not G.GAME.round_resets.foobar_minigames then
        G.GAME.round_resets.foobar_minigames = { 
            Small = FooBar.get_next_minigame_key(),
            Big = FooBar.get_next_minigame_key()
        }
    end
  local _tag = FooBar.Minigame:init(G.GAME.round_resets.foobar_minigames[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
median veldt
#

DAMN!!!!

fading rivet
#

heres what I did for my thing

#

the important part is the func = 'hover_minigame_proxy', ref_table = _tag

median veldt
#

i'm a bit lost

fading rivet
#

that creates the function to be called one and provides data to it

#

wait not once sorry

#

called every frame

#

whenever its drawn

median veldt
#

i have the func i'm just not sure what i'm supposed to put in it?

fading rivet
#

lemme add comments

#
G.FUNCS.hover_minigame_proxy = function(e)
  if not e.parent or not e.parent.states then return end -- something broke, don't crash
  if (e.states.hover.is or e.parent.states.hover.is) and (e.created_on_pause == G.SETTINGS.paused) and
    not e.parent.children.alert then -- you are hovering, and you weren't hovering last frame
      local _sprite = e.config.ref_table:get_uibox_table() -- generates the popup
      e.parent.children.alert = UIBox{ -- display the popup
        definition = G.UIDEF.card_h_popup(_sprite),
        config = {align="tm", offset = {x = 0, y = -0.1},
        major = e.parent,
        instance_type = 'POPUP'},
    }
    _sprite:juice_up(0.05, 0.02) -- unneeded
    play_sound('paper1', math.random()*0.1 + 0.55, 0.42) -- unneeded
    play_sound('tarot2', math.random()*0.1 + 0.55, 0.09) -- unneeded
    e.parent.children.alert.states.collide.can = false -- if the popup goes overtop of the button, this makes sure the button won't be pressed accidently
  elseif e.parent.children.alert and -- you stopped hovering
  ((not e.states.collide.is and not e.parent.states.collide.is) or (e.created_on_pause ~= G.SETTINGS.paused)) then
    e.parent.children.alert:remove() -- kill the hover
    e.parent.children.alert = nil
  end
end
warped ocean
#

hey chat is there a way to make my joker message display chinese characters?

fading rivet
#

yeah

#

i forgor though lemme check aiko's

median veldt
fading rivet
#

wait chinese

median veldt
#

yeah you'd just need to change the font

warped ocean
#

oh thank you!!!

fading rivet
#

okay this works for japanese

median veldt
#

f:2 for simplified chinese and f:3 for traditional

fading rivet
#

just change the number till it works for chinese

median veldt
#

f:5 for japanese

warped ocean
#

now i can have comedic chinese text 🔥

median veldt
#

i wish there was a pixel font for the other fonts tbh

fading rivet
#

iirc you can make cusotm fonts

median veldt
#

yeah

#

but like

#

why is the default so... smooth..

naive coral
# fading rivet do this

how to do the hook part, im relatively new to this and have no clue how from what i can see in other mods code

#

dont think ive hooked something before

median veldt
#

i can explain hooks in a bit unless foo gets to it first

warped ocean
#

ye chat im not getting this to work 😭

naive coral
#

couldnt find hooks in the smods docs

warped ocean
#

it just pops up as the {f:2}

fading rivet
warped ocean
#

wait im a chud

#

nevermind

fading rivet
warped ocean
#

i forgot to save 😭

naive coral
#

vremade?

fading rivet
#

vanilla remade

median veldt
fading rivet
#

recreates the balatro jokers and stuff as if there they were a mod

warped ocean
#

welp nvm it still didnt work 😭

median veldt
#

ya

naive coral
#

neat

median veldt
#

namely the boosters i think its like a lot more than necessaryy

#

actually i think its like that on purpose

median veldt
warped ocean
#

message = "{f:2}新年快乐!{}",

#

wait

median veldt
#

oh

warped ocean
#

no is simplified

median veldt
#

i actually don't think text styling is supported in that

warped ocean
#

idk why it doesnt work

#

awww

#

sad

median veldt
#

i thought you were talking about loc_txt

warped ocean
#

ye nah lol

#

or unless u can pull from loctxt on message

fading rivet
median veldt
fading rivet
warped ocean
#

oh ye then ill prob do that!

fading rivet
median veldt
#

idk?

#

the button ig?/

#

not rlly sure what that means sorry

fading rivet
#

no like what has the code to generate the tooltip

median veldt
#

oh

fading rivet
#

like returning the UI nodes

warped ocean
#

or like i meant pull from locvars

median veldt
#

do i need to make it myself? if it's just from localization?

warped ocean
#

saddd ye

fading rivet
#

but you'll have to format it

fading rivet
naive coral
#

not too sure on what im doing wrong, but the game crashes with this text when booting it up but im sure its not to do with my lack of knowledge on hooks but it just being a local variable there.

median veldt
median veldt
#

or
wait you sent me yours

fading rivet
#

yeah I sent mine

#

which is mofidied from hover_tag_proxy

median veldt
#

i'd just have to replace the text in that with localize functions?

fading rivet
median veldt
#

what

fading rivet
#

the first and last 1 lines

#

one sec brb

median veldt
#

kk

#

none of that was in your snippet

fading rivet
#

k back

median veldt
#

your snippet is going over my head i'm so sorry i have no idea what to edit in this function

fading rivet
median veldt
#

I did NOT see that sorry

fading rivet
#

you want to call localize

#

with type = "whatever type your entries are located in"

#

key = "key to find your entry"

#

and nodes = some local variable you assigned to an empty set before hand

#

that will populate said local variable with nodes you can insert into our UI nodes

median veldt
#

i'm so sorry you're going to hate me
i'm still so confused 😭 okay hold on let me think aloud cut me off if i'm not getting it

#

i need to make a ui box

#

the code i can borrow from either an existing function ingame or i guess i could also just use your snippet from earlier if i modify it

thennn i put it in a variable in config called ref_table? or

#

yeaaah i'm sorry your codeblocks are not helpful 😭 i can't make heads or tails of any of it

i got the hovering code down, that makes sense i just. don't have a ui box nor do i know how to create it, and i'm not sure what ref_table is supposed to be

fading rivet
#

it can be whatever you want it to be

median veldt
fading rivet
median veldt
#

not necessarily, considering that the button gets remade when you change your class

#

it just needs to display the name and description of the related consumable

fading rivet
#

if so set ref_table class1name

median veldt
#

like i said, name and description of the related consumable

fading rivet
median veldt
#

the actual Class object doesn't need localization

median veldt
fading rivet
#

yep

median veldt
#

alright that's there

fading rivet
#

whats your func='' look like

#

and the function it points too

median veldt
fading rivet
#

change local _sprite ... to local _sprite = BS2.get_class_uibox_table(e.config.ref_table)
and make BS2.get_class_uibox_table(key) return the popup ui nodes

median veldt
#

and the ui nodes i can get from that one screenshot?

fading rivet
#

i swear I was holding shift

median veldt
#

your friendly neighborhood tooltip

#

that all the cards use

#

so i'm assuming I wouldn't really need to change much from that

fading rivet
fading rivet
median veldt
#

Descriptions

#

what the fuck does this have to do with paperback

fading rivet
#
local name = {}
localize{type="name", set="bstuck2_Class", key=e, nodes=name}
local desc= {}
localize{type="descriptions", set="bstuck2_Class", key=e, nodes=desc}
#

that'll give you text nodes you can insert for the name and description

median veldt
#

i am 100% not doing this right

#

oh yeah

#

i'm not

fading rivet
#

and text is a list of text nodes

#

just put them in the nodes key

#

like nodes={title}

median veldt
#

back to the paperback error

fading rivet
#

no clue what thats about

median veldt
#

did i mess anything up

#

is this even a popup??

fading rivet
median veldt
#

there doesnt seem to be as much code as i thought there'd be

fading rivet
#

also you don't need if title

#

it won't crash if its nil

median veldt
#

so like this

#

this is the paperback code.. i'm. really not sure why this is triggering??

#

wait no that still shouldn't error out??

#

i'm just going to turn off paperback for a sec i'll deal with that later

fading rivet
median veldt
#

that's more like it

fading rivet
#

whats the stack trace

median veldt
fading rivet
#

toki pona spotted

median veldt
#

:3

fading rivet
#

i've told you to do the same thing 3 times and you haven't done it omg

#

nodes=title

median veldt
#

sorry!!

fading rivet
#

nodes=desc

median veldt
#

Okay, Did I Do It Wrong

fading rivet
#

that should work

median veldt
#

mmmnope

#

same error, stacktrace looks the same

fading rivet
#

wtf

#

okay get rid of adding the nodes for now

#

made it nodes = {}

#

and see what happens

median veldt
#

same

fading rivet
median veldt
#

pardon?

fading rivet
#

the root node

#

make it a c or r node

median veldt
#

so like this

fading rivet
#

yeah

median veldt
#

alright

#

🤞

#

auuuugh

#

didn't even change anything

fading rivet
#

still crash

#

i got no clue then I didn't have this issue ;-;

median veldt
#

idk if this helps but here's that line in dumps

primal robin
median veldt
#

☹️

#

why is it this hard to add a damn tooltip 💔

#

this seems like there should just be a function for it

primal robin
#

localize function does not returns array of element, it returns array of array of text lines which you need manually pack into rows and then into column

#

or smth like this in short it's really shit

fading rivet
#

mb

red flower
median veldt
#

what

#

not sure what that is actually

red flower
#

detailed gets from a center like {T:} iirc

fading rivet
#

or do the smods patches/overrides not iplement into the skip tag area

red flower
#

this is a vanilla thing

median veldt
#

okay i'm going to assume detailed is more like the tooltip i'm thinking of

fading rivet
red flower
#

dunno

median veldt
#

i had set it to this, dunno if i misinterpreted your statement

#

but the {title=... thing didn't work with detailed either so

red flower
#

i dont recall the syntax

rapid stag
#

remind me how i dump localization files again?

red flower
#

so G.P_CENTERS[key]

fading rivet
#

forgor lua was 1indexed omg