#đŸ’»ăƒ»modding-dev

1 messages · Page 61 of 1

zealous glen
#

The Joker list could probably be better but right now it looks like

{'joker_name',
joker_name = true,}
#

That way they're loaded in order

#

because I can use ipairs to iterate over the integer indexed table values exclusively

#

the gsubs are just to convert the key into a name for printing

#

This is how I load hooks

#

And this is the file structure showing off all folders

shell tangle
#

Looking through the code, I'm kind of wondering if their keys are specifically "Gold" or "gold_seal" and so on, but take ownership automatically adds the "s_" to it so it can't find it. @wintry solar Any thoughts?

wary crescent
cedar flame
#

the printout of G.P_CENTER_POOLS.Seal does say the key is just "Red"

zealous glen
cedar flame
#

so you may be right

zealous glen
#

localthunk moment—wait it's not their fault

wintry solar
shell tangle
#

Would it require an addition to Steamodded to make them into SMODS objects, or what? Maybe something as simple as appending s_ to any mentions of the seals in the code might work?

zealous glen
#

Append s_ raised to the negative first power before the color name so it cancels out when Steamodded prepends s_ /j

edgy reef
#

Yeah the key is added onto seals but they don't normally have one in the first place.

#

So no matter what SMODS will try looking at the key as s_Red

#

Issue has been made

cedar flame
#

oh thanks, you beat me to it! :P

mellow sable
#

yeah you can definitely do better than Cryptid

wary crescent
#

Is there a resource somewhere for Badge colors?

shell tangle
#

What do you mean? Just the vanilla badge colors?

wary crescent
opal spade
#

G.C.

#

^ most colors are there

shell tangle
#

globals.lua, get_badge_colour() in UI_definitions.lua, and loc_colour in misc_functions.lua.

wary crescent
#

Ah i see, ty 😎

cedar flame
#

i need to reload the shop (re-evaluate UI tree) after a function... is there an easy way to do this already or am i going to have to patch something together?

opal spade
#

[uibox] being the uibox you need to update

#

unless im misunderstanding what u mean by "reevaluate ui tree"

shell tangle
#

Doesn't seem to work for the shop for some reason.

opal spade
#

did you try doing it through an event?

cedar flame
#

yep!

#

hold on

placid frigate
#

so 1x is 71x95 what is the aspect for 2x and can i change it without re-doing the joker art?

opal spade
#

x2 is (71*2)x(95*2) = 142x190

#

you just need to take the x1 art and scale it up

#

scaling mode in your art program of choice should be nearest neighbour to about the program from trying to smooth out the pixels

#

idk what you mean by "can i change it"

placid frigate
#

like it scale it up without it looking weird

#

but i guess i just do scale mode

#

thank you

opal spade
#

a lot of programs by default use modes that try to smooth out the image bcos thats usually what the user wants when scaling images

placid frigate
#

ok I did it, thiank you

night pagoda
#

How to change sticker's compatibility with other stickers?

#

I mean I can probably check existing stickers in apply() but that doesn't seem right

night pagoda
#

I can't get the hoverable word in the deck preview to work, what am I doing wrong?
Tried to put the same description in the G.localization.descriptions.Joker/Voucher/Tag, with no luck

wintry solar
#

yeah the {T:key} pulls the loc_txt from the center object rather than direct from the localization tables

night pagoda
#

oh, oof, do I need to create a dummy center object just for that

wintry solar
#

I guess so, yeah

night pagoda
#

alright, thanks!

night pagoda
#

okay that's all it took to get it working

wintry solar
#

oh nice

tepid sky
night pagoda
maiden phoenix
#

Oh I didnt know you could load custom object as hover, last time I tried it crashed.

languid mirage
#

something's wrong with my joker... đŸ€”

tepid sky
#

call it: cut joker

#

cut it's litterally been cut

#

:)

opal spade
languid mirage
hollow flume
#

That's a very wide spade

opal spade
#

why are you misprinting all over the place

tepid sky
languid mirage
maiden phoenix
#

Is this to replace the glitched edition?

lusty epoch
#

I think it’s just a separate edition

languid mirage
#

it wont replace glitched no

lusty epoch
#

Maybe not even for cryptid

languid mirage
#

jen will add it to jen's almanac

tepid sky
maiden phoenix
#

Oh ok

languid mirage
#

anyways

#

I may have misprinted the misprint

opal spade
#

how many times does the misprint have to be misprinted for it to get printed correctly

languid mirage
#

depends on the shift tbh

crisp coral
#

she misprint on my misprint til i

tepid sky
zealous glen
tepid sky
#

how does one... make a base deck, like no modifications?

night pagoda
#

I'm trying to put a stake before the gold one and some weird shit happens (orange stake got duplicated and my stake is still at the end of the list), what am I doing wrong?

wintry solar
#

above_stake = 'orange'

night pagoda
#

oh, in that case do I need the take_ownership?

wintry solar
#

I don't know what unlocked_stake does

night pagoda
#

It is for which stake it unlocks next I assumed based on the vanilla stakes implementation in smods

#

I think take_ownership is broken or something because it just duplicated the stake

wintry solar
#

it's for some janky ass base game win counting

#

I rewrote stake unlocking to work based on applied stake completion

night pagoda
#

okay I don't really understand if I need it so I got rid of it

#

thanks for the help!

wintry solar
#

yeah it's not very useful

night pagoda
wintry solar
#

all it does is when you win on that deck it assigns a win to every stake below it if you haven't beaten them already

#

what does your loc_txt look like?

night pagoda
wintry solar
#

I think it needs your mod prefix

night pagoda
#

huh?

#

where?

wintry solar
#

cyan

night pagoda
#

that seems weird but I'll try

wintry solar
#

your loc table seems weird, I don't understand how you're making it

night pagoda
#

yeah, this doesn't make sense - it does retrieve exactly cyan and not bunc_cyan

wintry solar
#

how are you adding your localization stuff?

night pagoda
#

I use that for all of my stuff

#

and so far there was no problems like that

night pagoda
wintry solar
#

oh I see

#

okay

#
 loc_txt = {description = {
            name = "Test Stake FINAL",
            text = {
            "Required score {T:e_foil}scales",
            "faster for each {C:attention}Ante"
            }
        }},
#

it needs to be description

night pagoda
#

ah

wintry solar
#

I don't think stakes ever got updated to now just description

#

afaik everything else is consistent now, but I could be wrong

#

also sneak peak of info tips on stakes

night pagoda
#

so it is something that'd be changed in the future?

night pagoda
#

ouch why it adds this line

#

I don't want it

wintry solar
#

which line?

zealous glen
#

Presumably the last one

#

Since it’s not in their localization

night pagoda
#

"Applies Orange Stake" is not in the localization, I think it was added because I put that it applies the orange stake

#

yup

wintry solar
#

that's automatically added, yeah

night pagoda
#

can I get rid of it?

zealous glen
#

You can get rid of your last line

night pagoda
#

that won't be consistent with the other stakes then

zealous glen
#

I think Steamodded automatizes it since mods can have nonlinear stakes

#

Probably just a matter of Steamodded fixing vanilla Stake descriptions

night pagoda
#

okay, I'll hope that will happen in the future then

#

ty!

wintry solar
#

yeah if people are injecting stakes into the original line of 8 maybe they need changing

#

but I'd just recommend people add their stakes to appear after gold in the order

tepid sky
night pagoda
#

Wait, if there's a description field for the stake localization then the other one must be for the joker sticker?

#

because I'm not sure how to add that one

#

(this one I mean)

wintry solar
#

I think the sticker text is just outisde of the description part

zealous glen
wintry solar
#

I still think it shouldn't intefere with the base game stakes

night pagoda
#

still ERROR-ing

tepid sky
#

omg- i may of have done something :>

#

i may or may not have made a deck for every rank-

#

:)

wintry solar
#

oh yes

#

I have just worked through the code to that

tepid sky
#

anyways, anyone able to help me? i am trying to make a deck with absolutely no modifications but it just doesn't like it?

#

oh i did it?

#

i removed the:
g.playing_cards[i]:set_edition{{
base = true
}, true, true}

#

that seemed to have done it-

primal robin
tepid sky
#

it just isn't in the text

#

but to refer to the actual card in the code it is capitalized, otherwise it wouldn't work

frosty dock
static juniper
#

I have this condition, which is supposed to check for Steel cards in hand if the played hand contains a Full House.
if context.individual and context.cardarea == G.hand and context.other_card.config.center == G.P_CENTERS.m_steel and next(context.poker_hands['Full House'])
The problem is that it, for some reason, crashes the game after the hand is scored, and I don't know how to prevent it.

zealous glen
#

context.poker_hands doesn’t exist

#

Make sure to only execute the code if it exists

static juniper
#

What do you mean?

zealous glen
#

Not all contexts exist all of the time

static juniper
#

Oh right

#

(I thought you meant in general)

#

So, is there a way to check if it exists first?

zealous glen
#

Do the same thing you’re doing at the start

#

Though make sure that context is even called alongside the others you’re requiring

static juniper
#

Got it, added a and context.poker_hands before the other check and it's fixed 👍

tepid sky
stray orbit
#

any way to have a joker add mult and upgrade itself per card scored? as far as i can tell both use return which i imagine skips to the next step of scoring

shell tangle
#

Upgrading itself shouldn't use a return.

#

Steamodded has an example joker mod in the files, you can look at the Runner in there to see how it upgrades chips, and just do that for mult in context.individual.

stray orbit
#

ooh thank u

static juniper
#

Is there a way to make it so you need a specific type of card for a Joker to show up, like with Lucky Cat, Steel Joker, and Stone Joker?

lusty epoch
#

Or whatever enchancement

static juniper
#

Like this?

#

config = {enhancement_gate = 'm_wild', extra = {repetitions = 1}},

lusty epoch
#

No like a separate line

#

Ig that was misleading oops

#

here is how lucky hoker from cryptid does it

static juniper
#

So like this?

enhancement_gate = 'm_wild',
config = {extra = {repetitions = 1}},```
static juniper
#

Hooray

unkempt ridge
tepid sky
#

dancing cards 💀

tepid sky
#

ok i have no idea what i am doing, does anybody know how do i add a sprite that is in the foreground?

tepid sky
#

or atleast ontop of the background?

tepid sky
#

let me rephrase, how do i add a pickture that is visable?

#

that isn't a joker

lean ledge
#

I have a question about the game, more algorithm based than anything

#

How does the game remember the position you're on with the Random Seed?

#

Let me explain

#

The game remembers the seed, that's already one thing. But, it that was what it remembered only, every time you restart the game, it would start the seed from the start of the formula

#

Meaning, say, if you played a bunch, opened a pack with choices you didn't like, and then reset the game

#

Since all those Next() commands have been reset as well, the seed will go back as if you're using it from the first time

#

Giving you different output

#

And I'm trying to figure out how to make my game remember the position of the random seed as well as the seed itself

humble tartan
#

Anyone have any tricks to quickly previewing UI changes? Launching the game and navigating to the modded UI is such a pain

nocturne garnet
#

how do you get a joker by number?

#

like if i wanted to get the 5th joker (gluttonous joker) what would i use

maiden phoenix
#

Maybe check how the collection page does it

hushed cradle
#

i think each has an order

#

so you could iterate over the joker pool checking order

#

unless the joker pool is already in order

#

in which case just iterate in order

nocturne garnet
#

nvm

#

i found it

#

wait maybe nvm

zealous glen
# lean ledge How does the game remember the position you're on with the Random Seed?

I think each seed in the game (not the seed used for individual runs) saves its state in a specific place, and I imagine when the game is saved it saves the state of each of those seeds. So in theory, if the game saved and you advanced the state of some seed without saving, then went back, you'd have changed your (IRL) state by gaining the knowledge of what the next state of that particular seed was.

lean ledge
unkempt thicket
#

is there a way to check if a card area is visible or if the player is currently in the shop?

unkempt ridge
tepid sky
#

i weirdly like the idea-

cedar flame
hallow forge
#

i made a similar thing but it's a boss blind

unkempt ridge
cedar flame
#

ooh very nice!!

hushed cradle
#
calculate = function(self, card, context)
        -- main
        if context.joker_main then
            return {
                message = localize{type='variable',key='a_xmult',vars={card.ability.x_mult}},
                colour = G.C.RED,
                Xmult_mod = card.ability.x_mult,
                repetitions = 0
            }
        end
        -- end of round
        if context.end_of_round and not context.blueprint then
            if card.ability.x_mult - card.ability.extra <= 1 then 
                G.E_MANAGER:add_event(Event({
                    func = function()
                        play_sound('tarot1')
                        card.T.r = -0.2
                        card:juice_up(0.3, 0.4)
                        card.states.drag.is = true
                        card.children.center.pinch.x = true
                        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
                            func = function()
                                    G.jokers:remove_card(card)
                                    card:remove()
                                    card = nil
                                return true; end})) 
                        return true
                    end
                })) 
                return {
                    message = 'Smoked!',
                    colour = G.C.RED,
                    repetitions = 0
                }
            else
                card.ability.x_mult = card.ability.x_mult - card.ability.extra
                return {
                    message = localize{type='variable',key='a_xmult_minus',vars={card.ability.extra}},
                    colour = G.C.MULT,
                    repetitions = 0,
                }
            end
        end
    end,```
#

got this code for a joker that gives x mult and the x mult is supposed to decrease by 0.05 each round

#

instead tho it decreases by a random amount

#

is there another check i need?

#

in the games source, popcorn only uses end_of_round and not blueprint i think

maiden phoenix
#

There are multiple trigger in context.end_of_round

#

If you want the end of a scoring hand use context.joker_main
The end of a round looks like context.end_of_round and not (context.individual or context.repetition) iirc

hushed cradle
#

thank you

#

yep that works now

#

id tried checking context.repetition but it still didnt work

#

forgot individual was a thing

maiden phoenix
#

Iirc SMOD has a context that's just like that for end of round

#

Nvm it's for scoring hand

shell tangle
#

Honestly, I do think it would be a good SMODS addition.

wary crescent
#

I am quite happy with how these turned out! I've never really attempted doing art before this. These Jokers are available to play with!

cedar flame
#

i've almost got my mod completely functional but the last thing i'm stuck on is reloading the shop when redeeming a voucher... it doesn't seem like :recalculate() works in the context of the shop, either that or the way i'm adding areas to the shop (conditional returns of {G.UIT.R} objects from functions) is the wrong way to go about it

#

i'm just patching the function calls directly into the shop layout created in UI_definitions.lua (code here if anyone would be willing to take a look)

tepid sky
#

anyone able to help me with fusions?

night pagoda
#

How can I make so the game reloads when you modify config of the mod?

wintry solar
#

Design your config in a way that doesn’t require a reload đŸ€”

night pagoda
#

eh

#

I don't need it for all of the options I have, just for some of them

languid mirage
#

you can add like an apply button

wintry solar
#

Why do you need to restart?

night pagoda
#

to reset/reapply take_ownership, shader file replacements, sprite replacements

wintry solar
#

You could definitely do that without restarting

opal spade
#

is it possible to put a specific color into a localization file

#

like w/o a keyword just a value

zealous glen
#

I think not because the text processor expects a keyword, but you can add new keywords or hook the processor to accept hex values

#

The keyword is basically a key to access a color anyways

frosty dock
#

there's color variables though, i.e. you pass the color from loc_vars

opal spade
#

ik about color vars, just working with something where i dont have access to loc_vars

#

but i got the keyword for what i need to work

wintry solar
#

You can also just register the colours that you want to use

zealous glen
#

Which is what I suggested

orchid thunder
#

im having a problem where after i play a a hand my fps drops but then when i playa hand again or enter the pause menu it goes back up to like 60

#

anyone have a fix

languid mirage
#

so I wanted to try and make something like this, and apparently it's not that simple 😭 @zealous glen changing scale increases the size, but also offsets the edges further away from the center

I'll let you know if I manage to make it work, so far I'm clueless as to how all this works

zealous glen
#

I think it could be done either in the shader or outside of it

#

Though I don’t exactly have a better solution than recording the position and transforms of the card for each frame between now and however many seconds in the past the delay is set to

languid mirage
#

it is possible but you need to store copy of canvas from previous frame

#

tho I haven't looked into it too much yet

#

it is pretty hard to do for a specific card

#

hard in a way that you need to somehow make sure that everything else on the screen still moves and changes

zealous glen
#

Shouldn’t I just need a copy of the card itself in however many frames I need?

wintry solar
#

If you can work out which way the card is moving you could likely do it with a shader drawn before the in dissolve shader with the appropriate offset

zealous glen
#

An idea I just had is that in each call to draw the card, I could create an Event(?) to draw the card again with the same data, but after a few seconds

solid salmon
#

Hello fellow mod developers

languid mirage
#

should probably add that to the api at some point

#

extra shader values

#

it's not like you can find out how the player moved the card with a formula, lol

zealous glen
wintry solar
#

Without looking at how the event system would interact with the draw loop, I think passing previous position to a shader would be a mch better solution

zealous glen
wintry solar
#

so would sending an event every frame

zealous glen
#

Since the Event queue is a preexisting list of arbitrary length

#

Though I can see some issues with both approaches when the frame rate changes

#

I wonder how Weaver’s ultimate in DotA 2 works, since it restores his position and statistics to those a couple of seconds prior

unkempt ridge
sonic mortar
#

DM it to me

unkempt ridge
#

Like, everything is working correctly but
Somehow it's, affecting, the field???

sonic mortar
#

solved

unkempt ridge
#

don't let us cook ever again bro's
we burned the kitchen

gilded narwhal
#

Isaac Reference

unkempt ridge
#

The gangs all here-

regal wolf
#

all my homies fw IO

tepid sky
#

i have been trying for a while now, and i cannot figure out how to change a vanilla joker into a SMODS joker

#

anyone able to help?

wintry solar
#

What are you trying to do specifically?

tepid sky
#

i am trying to copy a joker from the base game, into a SMODS joker

#

so i can more easily change it

#

for example i would like my joker to figure out if a glass has been shattered and if it did i would like the joker (for example) add a lucky card to my deck

wintry solar
#

Did you take a look at the context guide you were sent yesterday?

tepid sky
#

yes but my mind cannot comprehand what i read-

wintry solar
#

Understanding contexts is the first step to making more than very basic jokers

tepid sky
#

then i think i know what i needa learn :,)

opal spade
# tepid sky yes but my mind cannot comprehand what i read-

the guide is a step by step explanation of how each contexts are fired
to add a code to the joker referring to a specific context you define the joker's calculate(self, card, context) and write code like for example if context.joker_main and not context.blueprint then <code> end

#

^ this specific condition would make an action for the joker during main scoring phase that wouldn't be copyable by blueprint

#

you can look at the vanilla's Card:calculate_joker(context) to see how it uses the contexts but you should keep in mind that self in Card is card in SMODS.Joker (SMODS.Joker uses self to refer to the object that vanilla would refer to with self.config.center)

#

^ modded vanilla is an example mod that converts a bunch of vanilla jokers into SMODS format, which should be really helpful

tepid sky
#

i know i used it for a phew things already :>

opal spade
#

dont copy paste the magic words, study what they actually do

hushed cradle
#
loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = {set = 'Other', key = 's_cere_green_seal'}
    end,```
#

how do i pass vars into the info queue things?

wintry solar
#

{key = card.ability.extra.balloon.."_seal", set = 'Other', vars = G.P_SEALS[card.ability.extra.balloon]:loc_vars(info_queue, card).vars}

hushed cradle
#

figured it out

wintry solar
#

this is what I do

hushed cradle
#

thank you tho

maiden phoenix
#

Are mod prefix case sensitive? Will j_mymodprefix_joker and j_MyModPrefix_joker both work the same?

crisp coral
#

should be case sensitive

limpid flint
#

in my previous experience testing for your space jokers, it appears that they are all lowercase tho

#

i mean if the prefix is SDM0 it will be registered as j_sdm0_joker

hushed cradle
#

can we start a petition to up the length of mod prefixes to 5 characters?

limpid flint
#

are they restricted?

hushed cradle
#

every time i type cere_ a part of me dies inside

#

yeah its max 4 chars

#

i think

limpid flint
#

but twewy is five

maiden phoenix
#

I'll test it out rq

limpid flint
wintry solar
#

it just auto sets it as first four characters if you dont define a prefix

hushed cradle
#

no way 😭

crisp coral
#

rip

maiden phoenix
#

We should normalize lowercase prefix smh

limpid flint
#

what does that mean

#

wasn't 1:1 to the mod
so it need to be exact?

maiden phoenix
#

Yep

#

(also you forgot a comma)

limpid flint
#

I swear to god

limpid flint
# maiden phoenix

good to know tho, i am not sure where did I have the conclusion they should be converted to all lowercase

maiden phoenix
#

It's just the norm, but sometime people don't follow it.

#

j_MyModPrefix_joker is just ugly in snake_case

limpid flint
#

that is CamelCase right

maiden phoenix
#

No thats PascalCase

#

camelCase is myModPrefix

#

So in the example above it would be a mix of snake_case and PascalCase

limpid flint
#

TIL, thanks

maiden phoenix
#

Fun fact btw the case name for css attributes is called kebab-case

limpid flint
#

oh because of dashes instead of under_score

maiden phoenix
#

Yea

unkempt thicket
#

how can i replace an info queue with other DynaText code?

wintry solar
#

what do you mean?

unkempt thicket
#

like instead of the text in there replace it with this

maiden phoenix
#

Does Balatro (or SMOD) saves each cards of the deck at the start of a run? Like if modifications or removal happens it stays the same?

regal wolf
#

Anyone managed to get UI Elements to have the same hover effect as Cards/Blind Chip etc.

#

It's very doable, but for some reason my method isn't working.

#
function Blind:draw()
...
    self.tilt_var = self.tilt_var or {}
    self.tilt_var.mx, self.tilt_var.my =G.CONTROLLER.cursor_position.x,G.CONTROLLER.cursor_position.y
...

Blind.lua uses this to create the effect. And both UI elements and Blind chips / Cards etc share Moveable, and Node. Which handle most of the movement etc. So it's very doable with some modifications to the UI element class.

night pagoda
#

Is it possible to create SMODS.ConsumableType without creating an entry in the collection?

edgy reef
#

No J in don’t think so

opal spade
#

collection is created automatically by going through G.P_CENTER_POOLS[Set]

#

it is possible but in a very janky way

edgy reef
#

Making a new pool technically works but you’ll have to manually inject or hook into get_current_pool for any additional functionality (e.x. default card, rarities, etc).

#

That’s handled exclusively by SMODS.ConsumableType which would auto-assume you’re making a consumable and try to add it to collections.

opal spade
#

you can also just make sure your item is not in the corresponding G.P_CENTER_POOLS while looking at collection

edgy reef
#

That would still create a button in collections it just wouldn’t display anything.

opal spade
#

it appears ive misunderstood the question

night pagoda
#

I need that because I want to create a type of card/consumable that is needed me in a technical way but it isn't actually a something that should be shown in the collection

opal spade
#

technical way as in?

night pagoda
#

Blinds but in a form of cards

opal spade
#

galdur does something like that for the stakes

night pagoda
#

It wouldn't make sense to have two blind entries - I need just one card object to do it for every blind anyway

opal spade
night pagoda
#

Yeah that's not really the thing I want

opal spade
#

if you want a consumable card that doesnt show up in the collection, you can make a card that ejects itself from the G.P_CENTER_POOLS, but that would mean you can only forced_key it into the game (also idk how smods would react to an empty/nil consumable type if you're making it with a custom type)

wintry solar
#

Would creating a custom card exactly when you need it work?

languid mirage
#

I think myst wanted to add something like that for lobcorp

#

idk how that went but might be a good place to start looking

stray orbit
#

i'm trying to make an animated joker sprite, do i need to add anything other than atlas_table = 'ANIMATION_ATLAS' and the number of frames to the atlas? i assume i do cuz right now it crashes saying attempt to index field 'atlas' (a nil value)

#

on steamodded 1.0.0 if it matters

#

and it only crashes when the joker appears

languid mirage
#

you can look at aura mod

stray orbit
#

ooh thanks

stray orbit
#

i got it working yay

primal robin
#

Why this patch doesn't work???

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = 'function get_pack(_key, _type)'
position = "after"
payload = """
print("Hello?")
"""
match_indent = true
frosty dock
primal robin
#

lumaangry fine

frosty dock
#

there's currently no way to lovely patch these overrides, but there should be soon enough

#

at least I forwarded it to meth

languid mirage
#

no way*

frosty dock
#

"No we have lovely patches at home"

#

My point stands, that isn't a lovely patch, it's a disgusting patch

nocturne garnet
#

is there a way to change text from a joker without using loc_vars

shell moat
#

How would I add a challenge restriction only if a different mod is installed? I'd like to disable one of the spectral cards from Mika's Mod Collection in a challenge I've made, but just putting it in the restrictions normally crashes the game if someone without MMC views the challenge restrictions ingame

#

This is how I've got my banned cards set up

lusty epoch
shell moat
#

That should help a lot, thank you :]

lusty epoch
#

keep in mind though that things in loborp all all in their own files and are formatted differently

#

so don't do a 1 to 1 of this

shell moat
#

The main issue is, while I have coding experience, none of it is with Lua (I made this challenge by looking at a lot of other mods), so I don't really know how to fix errors - I did this, but it crashes the game when loading mods with something about "chal" being a nil value

#

Which I assume is something to do with what you said about lobcorp, but I have no idea how to fix it

#

Actually I might know the issue, give me a sec

#

Yeah I don't know, I thought I'd put it in the wrong place but moving it caused other problems

shell moat
lusty epoch
shell moat
#

Ah I see, that's why chal didn't work

#

Thanks, I'll see if I can figure it out :]

crisp coral
#

either store challenge metadata in a table and modify it before turning it into a gameobject, or store the gameobject as a variable and modify it

primal robin
#

How can I get all ConsumableType in game?

#

If possible, with localization key

wooden nexus
#

Got something in the cooks

shell moat
#
noMMC = {
      ...
}
    
MMC = {
    ...
    {id = 'c_mmc_incense'}
}

And then put the entire challenge into an if/else with the only difference between the if version and the else version being which variable is inserted for the banned cards :P

nocturne garnet
#

thing im doing that requires two types of the same exact joker

#

specifically because loc_txt is so annoying for this

opal spade
#

I'm a bit confused what you want to do here bcos it's all doable with loc_vars

opal spade
nocturne garnet
#

alright i should probably have thought of that

opal spade
#

if you want the same joker to show completely different texts based on context, you can use loc_vars to call a different localization entry

#

also if it's just "purified" or "cursed" then you can make that (and the associated colour) into a variable

solid salmon
#

If I wanted to make a joker that functions after exiting the shop how can I do it?

frosty dock
#

just look at perkeo for reference

solid salmon
#

Ight

hushed cradle
#

are there any jokers that reset at the end of the ante or smth similar?

#

wait campfire

wary crescent
# wooden nexus

These look sick, will be adding these when you release them!

hushed cradle
#
-- atlas for stakes

local stake_atlas = SMODS.Atlas{
    key = 'stake_atlas',
    path = 'stakes.png',
    px = 29,
    py = 29,
    atlas_table = 'ASSET_ATLAS',
}

-- stakes

local steel = SMODS.Stake{
    key = "steel",
    pos = {
        x = 0,
        y = 0
    },
    atlas = "stake_atlas",
    applied_stakes = {"gold"},
    loc_txt = {
        name = "Steel Stake",
        text = {
            "{C:red}-1{} hand size",
        }
    },
    modifiers = function()
        -- -1 handsize
    end,
    colour = HEX("71797E")
}```
#

could anyone tell me where im going wrong?

opal spade
#

local desc_target = copy_table(target.description)

#

smods expects loc_txt.description

hushed cradle
#

yeah i got it

#

ty

#
loc_txt = {
        name = "Steel Stake",
        description = {
            name = "Steel Stake",
            text = {
                "{C:red}-1{} hand size",
            }
        }
    },```
#

not sure if thats fully right

#

but it works

wintry solar
#

you won't need the top name one

hushed cradle
#

cool

#

thanks

opal spade
#

why does smods expect loc_txt.description though

wintry solar
#

remnant of different apis being merged and it got missed in the update to make all loc_txts consistent

wooden nexus
hushed cradle
#

is there a way to tell more specifically what the current stake is?

#

atm ive added 4

#

and theyre 9, 10, 11, 12

#

at least thats what G.GAME.stake says

#

but if i had another mod that added stakes

#

would it shift all my stakes up by the number of stakes in the new mod

wintry solar
#

potentially yes

frosty dock
hushed cradle
#

is it possible to check which number my stake is?

frosty dock
#

<Stake>.order i think

hushed cradle
#

thank you

#

ill try that

wintry solar
#

what do you need it for out of interest?

hushed cradle
#

well i want my stakes to be shiny

#

so im gonna patch the get_stake_sprite

wintry solar
#

shiny = true

hushed cradle
#

no way 💀

#

thank you

wintry solar
#

iirc

hushed cradle
#

yep nice and shiny

#

do stakes have loc_vars?

opal spade
#

doesnt seem like thats the case

hushed cradle
#

damn

night pagoda
#

man tf am I doing 😭

opal spade
#

stake api is more functional than before though, i was rlly happy cutting a bunch of redundant hooks after the update

opal spade
night pagoda
#

nah I'm not talking about the size

#

it's more about it's placement - it appeared where the booster pack was opened but it didn't move anywhere after that

#

in theory there's three blinds stacked in the screenshot

opal spade
#

havent messed with cardareas but i think that means the cardarea is not right

night pagoda
#

oh, I think I know what's up

#

it's weirdly doesn't seem like an actual card and just a sprite without a card, in an empty card table

#

I mean yeah??? something definitely changed

#

I'm glad it alteast shows up

#

cursed

#

I will definitely need some kind of a new card type just to handle this

#

because rn I just use jokers

hushed cradle
#

what are you making, just out of interest?

night pagoda
#

you know that tag that rerolls bosses? I'm reworking that so it'd give these

hushed cradle
#

oo thats cool

night pagoda
#

so it'd be less random and more of "pick your own poison"

wintry solar
#

I thought stakes supported loc vars

hushed cradle
#

i mightve been doing it wrong, but i was doing it exactly how other loc_vars work

zealous glen
night pagoda
#

Yeah I probably'll do that

#

but I want to see how this works out first

hushed cradle
#

the sticker_pos in stakes, is that only from the same atlas as the chip sprite?

opal spade
austere schooner
#

that sounds like a fun incompatibility looming on the horizon with any joker that adds more items to booster packs

night pagoda
#

and also there's a possibility of a blind object outside of booster packs

#

and that, yes

austere schooner
#

or cryptid's ://RUN actually, I'm not sure the game would be too happy swapping the blind out mid-blind

wintry solar
#

it defaults to the base sticker sheet

hushed cradle
#

thank you

night pagoda
#

that looks real

wintry solar
crisp coral
austere schooner
#

thatd fix it

hushed cradle
#

if i have a stake after gold will it auto unlock when you beat gold?, or have i gotta mess about with gold stake to add the unlock?

wintry solar
#

it should do, yes

hushed cradle
#

cool

#

thanks

languid mirage
#

oh no among us balatro cards

#

surely thunk was held at gunpoint to add those to the game

hushed cradle
#

how do i get the badge and info for my sticker to show?

primal robin
night pagoda
#

Noted!

austere schooner
#

quick question, what is the default atlas for card backs

#

i'm running into a ton of nil atlas issues and it's giving me a headache

crisp coral
#

centers

austere schooner
#

ok so atlas = deck[7] or "centers" is causing a different, mysterious crash

#

it works if deck[7] has anything in it

crisp coral
#

is it appending cry_ into the atlas name

austere schooner
#

wait, original_key:source_deck... this isn't even part of my code, oh god i broke something else

crisp coral
#

😭

austere schooner
#

oh i fixed a typo and that broke source deck

#

because it's looking for "atlasenchanced"

#

yeah idunno even if deck[7] ~= nil then obj.atlas = deck[7] else obj.atlas = "centers" end is causing the same nil atlas issue which is weird since that's like pretty explicitly setting the atlas

wintry solar
#

What is deck[7]?

austere schooner
#

part of a table to set the atlas, it's usually either 'atlasenhanced' (defined earlier in the file) or nil

#

the idea being nil just uses the vanilla card backs...

hushed cradle
#

could you do obj.atlas = G.ASSET_ATLAS[deck[7]] and deck[7] or 'centers'?

austere schooner
#

it works fine if deck[7] is not nil is the thing, it only starts crashing when deck[7] is nil which is what i don't understand

hushed cradle
#

oh

#
local defective = SMODS.Sticker{
    key = "defective",
    badge_colour = Ceres.C.defective,
    atlas = 'sticker_atlas',
    pos = {
        x = 4,
        y = 0
    },
    loc_txt = {
        name = "Defective",
        text = {
            '{C:green}#1# in 3{} chance',
            'to do nothing',
        }
    },

    apply = function(self, card, val)
        card.ability[self.key] = val
    end,

    loc_vars = function(self, info_queue, card)
        return {vars = {G.GAME.probabilities.normal or 1}}
    end,
}```
#

this is driving me insane

#

it was working

#

and then it stopped

#

and im not sure what i changed to break it

#

also im now realising the apply function isnt needed

austere schooner
#

yeah the object atlas IS being set to 'centers' and smod's default fallback atlas is 'centers' so i have no bloody idea why it's crashing with an invalid atlas

wintry solar
#

You might need to call obj:set_sprites() (that might be wrong I don’t remember the correct syntax)

#

Although without knowing what you’re trying to do I’m not sure

austere schooner
#

programmatically generated enhancement decks

#

i basically have

--object_key, deck_internal_name, deck_name and deck[i] are provided from a table and are always valid
SMODS.Back { object_type = "Back",
    name = deck_internal_name,
    key = deck[3] .. "_deck",
    config = {cry_force_enhancement = "m_" .. object_key},
    pos = {x = deck[8], y = deck[9]},
    atlas = deck[7] or "centers",
    loc_txt = {
        name = deck_name,
        text = {
            "All {C:attention}playing cards{}",
            "are {C:attention,T:m_" .. object_key .. "}" .. deck[4] .. " Cards{}",
            "Cards cannot change enhancements",
            "{s:0.8,C:inactive}" .. deck[10]
        }
    },
}
hushed cradle
#
['Other'] = {
            ['cere_defective'] = {
                ['name'] = "Defective",
                ['text'] = {
                    '{C:green}#1# in 3{} chance',
                    'to do nothing',
                }
            },```
#

i have this in my loc file

#

but this is still blank

#

what am i missing?

night pagoda
#

there's also ['label'] but it should show the other things at least

wintry solar
#

It’ll be adding the mod prefix to centres

hushed cradle
#

ive got the label too

#

or should have

wintry solar
#

You need to tell it you’re using a raw atlas key and modify the one in deck[7] to have the prefix already added I think

crisp coral
hushed cradle
#

oh my god do stickers have a prefix?

wintry solar
#

Sorry I was meaning samario 😂

#

I don’t know where stickers go on the loc table

#

But I imagine they’d have a prefix

hushed cradle
#

ive got my mod prefix

#

dont see anything here about anohter prefix

wintry solar
#

Did you change your prefix to ceres yesterday?

hushed cradle
#

no i just left it

wintry solar
#

Fair

night pagoda
#

Is it possible to create a nothing card?

crisp elbow
#

I wonder with the new customize deck option, will SMODS try to hook into it to make a better ver. of AltTexture API?

#

I feel like you could genuinely do that now with not a lot of hassle as thunk finally supports "texture packs"

crisp coral
#

ish

wintry solar
#

I’d have to look at how thunk handles it

crisp coral
#

hardcoded to hell and back

crisp elbow
#

tears streaming down my face, okay

crisp coral
#

also need to modify the ui to fit all ranks and not just face cards

crisp elbow
#

good to know

wintry solar
#

But other than stealing the button, probably not

#

I’m still undecided whether to pull alt textures into an individual mod or not

plain wyvern
#

yeah uh it's a mess defluenceur

wintry solar
#

I don’t know what would be better, it’d be nice for it to be implemented in smods but I also think just having it as an external dependency for texture packs would suffice

#

Any one got any thoughts?

hushed cradle
#

not a single thought in my head

#

ever

opal spade
static juniper
#

Just woke up and saw the new update, is there going to have to be another modding patch to fit this update, or can I keep using what I already have?

mellow sable
#

It shouldn’t affect too much

#

If Cryptid loaded fine on the new update I think everything should be mostly good

plain wyvern
#

it doesn't change much

hushed cradle
#
local defective = SMODS.Sticker{
    key = "defective",
    badge_colour = Ceres.C.defective,
    atlas = 'sticker_atlas',
    pos = {
        x = 4,
        y = 0
    },
    loc_txt = {
        label = 'Defective',
        name = 'Defective',
        text = {
            '{C:green}#1# in 3{} chance',
            'to do nothing',
        }
    },

    loc_vars = function(self, info_queue, card)
        return {vars = {G.GAME.probabilities.normal or 1}}
    end,
}```
#

even putting the loc text in the thing doesnt work

#

why 😭

night pagoda
#

cursed 2

#

I wonder how balatro handles stopping duplicate objects from appearing

mellow sable
#

My favorite enhancement, small blind

zealous glen
night pagoda
#

I figured I could use the same thing as the poker hand preview uses

zealous glen
# night pagoda I wonder how balatro handles stopping duplicate objects from appearing

IIRC it keeps a flag for each object, maybe inside the pool, and sets that flag when the object is created or removed.

However, I think Blinds work differently. I know the game tracks how many times Blinds have been used, but I’m not sure what for. By all accounts, the way I read the code I don’t think it should work, but since it does, I must have misunderstood it

zealous glen
#

By the way, does the DLC break anything?

night pagoda
#

aside from itself not really for now

hushed cradle
#

i think for jokers and consumables etc it just checks for showman doesnt it?

zealous glen
#

What do you mean “aside from itself”?

#

I also imagine it could serve for an easy way to make texture only mode via Steamodded in the future

night pagoda
hushed cradle
zealous glen
hushed cradle
#

i just want my sticker to have text when you hover over it

#

but it doesnt want to

#

it was working

#

but i mustve changed smth

zealous glen
hushed cradle
#

but idk what

zealous glen
#

A text editor that saves changes?

hushed cradle
#

yeah but im not gonna spam ctrl z

zealous glen
#

See if there’s a diff

#

Or a history

hushed cradle
#

also i havent pushed any of it to git because ive been working on it today

zealous glen
#

Git wouldn’t have a history but the text editor might

#

Also see if the key names are correct

#

Two general questions about Lua:

  1. How to get a list of folders in a directory in Lua?
  2. How to read a text file in Lua?
regal wolf
#

Native fs.

royal ridge
hushed cradle
#

i beg to differ

languid mirage
#

you don't need nativefs

hushed cradle
#

also the sticker isnt actually displaying on jokers

languid mirage
#

just use love.filesystem balatrojoker

hushed cradle
#

is that not smth steamodded does?

languid mirage
#

steamodded uses nativefs

royal ridge
#

there was a change in 1.0.1g that altered a line in the code, blocking a steamodded patch

hushed cradle
#

i meant the sticker not displaying

#

no way

regal wolf
#

There’s a reason people don’t use love.filesystem.

languid mirage
#

nativefs literally uses love.filesystem balatrojoker

hushed cradle
#

me when my file isnt in the game directory

regal wolf
#

What kind of nativefs are you using lol

frosty dock
#

nativefs replicates lfs, removing the restriction of only being able to access specific folders

hushed cradle
#

theres acc no way

frosty dock
#

generally using love.filesystem is discouraged because it fails as soon as someone uses a custom mod folder

regal wolf
#

^

#

It’s also much less flexible than nfs.

#

I believe there is a nativefs patch you can add that overrides love.filesystems restrictions.

#

But I’ve never used it.

languid mirage
frosty dock
#

lovely has a command line flag for it

#

Also required for stuff like TS

languid mirage
#

and how would nfs figure out the flag value

frosty dock
#

there's a lovely module that has that information

languid mirage
#

so if it's not in nfs

#

your point?

mental nacelle
#

Is there an event for obtaining a joker?

frosty dock
#

my point is that love.filesystem physically can't access such a folder

languid mirage
#

ah

hushed cradle
regal wolf
#

This module provides access to files in specific places:
The root folder of the .love archive (or source directory)
The root folder of the game's save directory.
The folder containing the game's .love archive (or source directory), but only if specific conditions are met.

mental nacelle
hushed cradle
#

oh you can just do 0.1 * #G.jokers.cards then

languid mirage
#

well, if a mod would need to implement support for custom mod dir either way, there's no point in using nfs if there's a total of 0 people with custom mod dir and 1? mods with custom dir support (steamodded I assume has it)
Most mods that use nfs literally crumble if mod folder isn't the exact same name, so it's kinda funny

royal ridge
#

ok i fixed sticker.toml on my end

hushed cradle
#

please send me the patches 🙏

#

nvm 💀

royal ridge
#

wh

hushed cradle
#

god i hate myself

#

still doesnt show up here tho

#

is that also to do with a broken patch?

royal ridge
#

yeah

hushed cradle
#

damn

royal ridge
#

not sure how the collection started working for you lmao

hushed cradle
#

i fixed one of the patches

#

wtf is this

royal ridge
hushed cradle
royal ridge
#

fixing the patch made it work in both collection and run for me

hushed cradle
#

i clearly didnt fix it properly then

#

could you send me yours?

frosty dock
#

most non-smods mods include NFS themselves

royal ridge
# hushed cradle could you send me yours?
# generate_UIBox_ability_table()
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''if self.sticker or \(\(self.sticker_run and self.sticker_run~='NONE'\) and G.SETTINGS.run_stake_stickers\)  then loc_vars = loc_vars or \{\}\; loc_vars.sticker=\(self.sticker or self.sticker_run\) end'''
position = "before"
payload = '''
for k, v in ipairs(SMODS.Sticker.obj_buffer) do
    if self.ability[v] and not SMODS.Stickers[v].hide_badge then
        badges[#badges+1] = v
    end
end'''

not pull reqing this because the regex sucks but it should work?

hushed cradle
#

uh still not working for me

royal ridge
#

uhhhhh

#

yeah idk then

hushed cradle
#

nws

#

thank you

languid mirage
# frosty dock most non-smods mods include NFS themselves

yes, but my point is, you don't have to use NFS, unless the wild user with custom mod dir who doesn't want to use steamodded appears
so far most mod devs don't even care to support non exact folder name for non steamodded mods

#

It's kinda funny
I wonder how many mods need to copy-paste steamodded code for non steamodded support for a non steamodded modloader to appear balatrojoker

regal wolf
#

I meannnn, unless it’s a very simple mod, nfs is usually needed. There can also be many reasons why people don’t want to use steamodded.

#

It’s not hard at all to make something to support mod folders that aren’t exactly the same name as the devs. It took me about 5 minutes lol.

languid mirage
#

I think you missed my point with steamodded

#

Never said it's hard or anything, but it's the same code in every single mod who wants to support non steamodded

night pagoda
#

something finally fucking works?????

regal wolf
#

I mean, I’m sure a few people stole/copied code, but I don’t think most devs have done that.

languid mirage
#

You're still missing my point

regal wolf
#

I’m not sure I am, I just think your point isn’t a great one lol

languid mirage
#

its not about stealing, its about everyone reinventing the wheel for something they shouldn't have to

regal wolf
#

I understand what ur saying “what’s the point putting the same code as steamodded when they don’t use steamodded, why not just use steamodded etc etc”

languid mirage
#

nope lmao

regal wolf
#

I mean that’s exactly what ur saying

plain wyvern
#

is there a way to add a resource file through a lovely patch file? (i have steamodded installed)

regal wolf
#

“Reinventing the wheel”

languid mirage
#

I never said anything against non steamodded

mellow sable
mellow sable
#

Actually I said that weirdly

#

Basically it uses that to detect Steamodded mods, but it doesn’t just hook the Steamodded function because it also shouldn’t require it by design

regal wolf
#

Yeah exactly

mellow sable
#

Also I have to deal with Balamod support now

regal wolf
#

Oh dear

languid mirage
#

like, convenience of loading atlas, having config file, localization, and some other features like keybinds is very nice

regal wolf
#

I haven’t even looked into Balamod.

languid mirage
#

also fucking settings menu lmao

regal wolf
#

I don’t really understand ur whole argument

mellow sable
regal wolf
#

Yeah,,,

mellow sable
#

But most of them really could use Steamodded

#

Like if I moved Trance to Steamodded nobody would really care

regal wolf
#

Yes but also, some people don’t want to install stwamodded

mellow sable
#

And I think Talisman depends on Steamodded now too? At least, haven’t tested in a while without it and it adds some stuff with Steamodded

regal wolf
#

I’m of the opinion that, let people do what they want lol

#

I’m only ever going to make steamodded a dependency for something where it absolutely makes sense to do so.

#

Like custom content; etc

mellow sable
#

I think both arguments are fair

regal wolf
#

Of course, I respect the argument otherwise.

#

I would just say though, let people experiment!

frosty dock
#

i get people might not want to use steamodded because it's rather invasive in what it does

#

of course not all mods need this sort of invasiveness, mostly these are QoL mods or ones that are equally invasive themselves

languid mirage
regal wolf
#

?

languid mirage
#

I will say it directly: I wonder how long it takes until QoL mods create a non invasive mod loader with just qol steamodded features (Atlas, localization, config, centralised settings menu, keybinds)
Because what we have right now is straight up ass, lol

regal wolf
#

huh?

#

Wait I thought you were on the side of everyone using steamodded.

languid mirage
#

bruh literally said

#

I never said that

regal wolf
#

Oh I didn't see that message for some reason, my reception was really bad.

#

Ok I get ur point.

frosty dock
#

I mean I'm not fully opposed to splitting steamodded into a loader and a modding API, it's just that it would be harder to maintain which would in the end be a me problem

regal wolf
#

I feel like splitting it would be a lot of work, haha.

#

I'd love for there to be a straight up "Mod client".

languid mirage
#

I think qol mod loader doesn't really need that much updating though

frosty dock
#

surely there's some way to make something of that sort but with an integrated setting, though at that point it becomes a case of managing lovely patches in a way that's not possible currently

languid mirage
#

steamodded mostly gets updated with modding api

frosty dock
#

alternatively a reorganized version could have steamodded loading most of itself as a steamodded mod which can itself be disabled. again, get me to do that

languid mirage
#

would patches and other stuff work if it's something like a nested folder

frosty dock
#

no

languid mirage
#

ah so it would need to be 2 folders

frosty dock
#

patches must be exactly one directory deep into the mods folder (Mods/MyMod/lovely.toml or Mods/MyMod/lovely/*.toml)

languid mirage
#

I'm thinking that could be annoying to explain if it remains in the same repo

#

cuz people download zip

regal wolf
#

Yeah exactly.

languid mirage
#

and then they don't understand that it needs to be not nested

#

nested mod folders support when? balatrojoker

#

lovely v20.0.1?

#

there could be a config file which would tell lovely which folder is a mod root

#

I dunno

tepid sky
#

i have been trying to get this joker to have random hands everytime you leave the shop but i cannot for the life of me figure out what i am doing wrong

languid mirage
#

you need to also change G.hand size after changing the config value

#

you only change it on add to deck and remove from deck which only happen when sold/destroyed/debuffed

tepid sky
#

oooh okay

#

any tip on how i could change it?

nocturne garnet
#

i've seen cryptid's misprintize function dozens of times but i still dont get how they change every value of a joker

how do i get the named values or whatever??

#

like if someone had a card.ability.extra.NameThatIDoNotKnow, how would i get that value without knowing it

wintry solar
#

Loop through pairs(card.ability.extra)

nocturne garnet
#

tried

#

still cant get it

#

i am doing something wrong and i DONT KNOW WHAT!!!

languid mirage
zealous glen
regal wolf
#

Wait no not love.filesystem

#

nativefs.

#

I'll send you nativefs if you want?

zealous glen
#

Does Balatro or Steamodded come with it?

regal wolf
#

Steamodded does yes.

zealous glen
#

Because I want to use it for a mod

#

My idea is to make a mod that simplifies making texture pack mods

#

Oh, do you know if it can get the size of an image?

shell tangle
zealous glen
#

@wintry solar oh?

austere schooner
wintry solar
#

Did you never see it before?

zealous glen
wintry solar
#

I had a working version and then dropped it to move on to different projects

zealous glen
#

Do you have to manually add the Texture Packs?

tepid sky
#

my friend like it when it went tru 10 sizes per card 💀

zealous glen
#

You probably need to also make it change when added/removed from the deck

wintry solar
#

You just register them as an object

#

But I’m going to start on it from the ground up again

#

I have some structural changes I want to make

zealous glen
#

So it would only need folders with the images and a configuration .txt file

#

With three possible configurations:

  • Full spritesheet swap;
  • Individual sprite swaps, listed by object name;
  • Individual sprite swaps with a spritesheet, so that each sprite in row-major order is assigned to each object in a list.
austere schooner
#

I??????? Sure???

nocturne garnet
#

I THOUGHT IT WAS JUST THE NUMBER OF TIMES ITS LOOPED

shell tangle
#

That's why you'll often see k, v, for key, value.

nocturne garnet
#

I NEVER KNEW THIS

#

THATS WHY I ALWAYS USE FOR I,V

#

cant believe for all this time i didnt know

#

why does cryptids code seem so complex

zealous glen
nocturne garnet
zealous glen
shell tangle
nocturne garnet
zealous glen
#

Including full spritesheet replacement

zealous glen
wintry solar
#

That sounds like a way more complicated set up for someone who has no experience modding

zealous glen
austere schooner
#

is there any way to tell if a colour actually exists before trying to render with it and presumably throwing an error

austere schooner
#

like, the {C:red}

wintry solar
#

You’d just copy a template and change two words though

austere schooner
#

is there a giant table full of the colours

zealous glen
zealous glen
nocturne garnet
#

wait

shell tangle
wintry solar
#

But you’d have to have some sort of knowledge of the correct format anyway which would suggest reading some sort of documentation

red flower
austere schooner
#

ah, G.ARGS.LOC_COLOURS

#

The Coloures...

zealous glen
zealous glen
#

And most of the information in the file is accessible by playing the game

#

Only the file names aren’t

wintry solar
#

I remain to be convinced

#

If you could mock up a quick example of what a config might look like that would help

#

I’ll go dig out an old version that I have

languid mirage
zealous glen
#

Wait hold on

#

It ate the first line

languid mirage
#

oh I guess loc colors is also a thing, didn't know that

wintry solar
#

Loc colours is for loc txt colouring

zealous glen
#

They’re not mutually consistent but that can be improved

wintry solar
#

It’s going to need more information than that though

wintry solar
#

Dimensions for one

zealous glen
#

Which I already asked about

#

Can’t Lua read it?

#

If it can’t that can be an argument too

wintry solar
#

I dunno, it could be useful I guess but it seems like making a new system to make mods just for the sake of it

zealous glen
#

“I feel like .txt files are very intuitive”

shell tangle
#

I think it'd be good as a basic, non-modding tool, but if you want to do anything actually complex, like non-standard sizes, then you just use the API instead of the easy mod tool.

zealous glen
#

I mean yeah

#

This is for texture replacements

#

Nothing else

wintry solar
#
SMODS.Atlas({
    key = "hd_tags",
    path = "hd_tags.png",
    px = 34,
    py = 34,
})
SMODS.AltTexture({
    key = "hd_tags",
    texture = true,
    atlas_key = "alttex_hd_tags",
    type = "Tag",
    name = "HD Tags",
})
``` this is the previous iteration
zealous glen
#

Balatro HD

shell tangle
zealous glen
#

As Eremel pointed it, it does need to know the dimensions of the file to function properly, and I think alternative resolutions are simple enough they should be supported

cedar flame
#

oh this is the first i've heard of alttextures, is it properly in smods now?

wintry solar
#

no

cedar flame
#

rip 😔

#

just wanted to be sure

zealous glen
wintry solar
#

at the moment, yes

#

but I had planned to allow individual control

#

though individual control requires editing the individual objects and is more work

#

I also wanted to implement localization support

#

but having a pipeline of features is what was leading me to prefer packaging it as an individual mod like I did with Galdur, it gives me a lot more control to update it when I need to

zealous glen
#

The user should only need to provide the data and the mod automatizes the rest

shell tangle
shell tangle
wintry solar
fading blaze
#

Huh. Apparently I've been using Lovely to do all my modding. Steamodded doesn't seem to want to work on my end... this might explain why all my SMODS functions within said mods have been doing absolutely nothing...

shell tangle
zealous glen
fading blaze
#

Oh! Apparently I'm missing dependencies.

zealous glen
#

Like Legendere which only changes the Legendary Jokers

fading blaze
#

I'm using an outdated version of Steamodded.

zealous glen
#

I think not supporting that kind of retexture is a bit of a failure

zealous glen
wintry solar
#

I mean you can package it as the entire spritesheet with the alternate textures in the relevant places

zealous glen
#

Have an ordered list, higher takes priority

zealous glen
#

And it makes it difficult to use two different texture packs that change sets of Jokers without overlap

#

If one changes Food Jokers and the other Legendary Jokers, wouldn’t it be easier to tell if the code individually registered each

#

Again, I think they can be packaged in a row-major spritesheet, smaller than the game’s spritesheet

#

So you put the five Legendary Jokers into a single spritesheet that’s 5-by-2 Jokers in size

shell tangle
zealous glen
#

Row-major in order

shell tangle
#

So, just have it as key index = pos x?

zealous glen
#

It’s a bit tricky for Souls; there needs to be a standard

zealous glen
shell tangle
#

In a list of {'a', 'b', 'c'}, c = 3.

zealous glen
zealous glen
#

where i is the index in the input list

shell tangle
#

I think priority should be, get full sprite replacements working, test it out, make sure there's no bugs, then come back and add in individual texture support.

zealous glen
#

Wait I got the names wrong

#

i mod row is the remainder lol

#

it should be
 dividend

#

That’s why I was confused. Now I hope it’s correct

zealous glen
shell tangle
#

For now, if you want to do it, I think it should be separate from AltTextures, and most of the code would be finding a way to read the .txt file, and converting it into just a take_ownership call for any objects, and a atlas replacement for any textures that aren't objects, like the balatro title screen or shop sign.

zealous glen
fading blaze
#

Welp, just ended up figuring out that the latest version of Steamodded does not play nice with the Mac version of Balatro.

#

Went through the trouble to try and clone the latest Steamodded git, only for it to backfire.

#

Oh wait--

#

I figured it out.

#

I think.

static juniper
#

I'm trying to make a card that does something when money is gained. What's the best way to check how much money is gained from each source of money?

fading blaze
#

Nope. Still not liking it.

wintry solar
#

I'm still trying to wrap my head around how you would select textures if they were all individual like that

shell tangle
zealous glen
fading blaze
#

Oh wait-- the lovely injector might be out of date???

shell tangle
#

Basically, if you have cards a, b, c, d and pack 1 overwrites a, b, pack 2 overwrites a, c, then,
Priority for pack 1 takes over pack 2, so a and b use pack 1's sprites, c uses pack 2's, and d uses base game.

#

And obviously, if pack 2 has priority, then a changes to pack 2's sprite, but b still uses pack 1's.

wintry solar
#

I mean from a ui standpoint, how are you setting the priority of texture packs in the game

shell tangle
#

Probably just an up and down list, or left to right - you could make it take after jokers, and how the order matters for them.

fading blaze
#

OKAY GOT IT WORKING.

shell tangle
#

If you wanted to disable texture packs, then you'd do something similar to selling jokers - but I will say, as fun as that does seem, it could be far more effort than it's worth to do.

zealous glen
#

This isn’t an unsolved UI problem

primal robin
#

Is custom sticker can be applied on booster pack only?

zealous glen
#

Although I do like the idea of making use of Balatro mechanics and making it kinda like a CardArea

shell tangle
zealous glen
#

I think you can just say it takes priority left to right

shell tangle
#

Yeah, I'm just thinking from a fancy UI perspective.

crisp elbow
#

Is there any proper API documentation yet for Suits? I've mostly been taking a look at the Six Suits mod for reference and was curious on it

hushed cradle
# crisp elbow Is there any proper API documentation yet for Suits? I've mostly been taking a l...
local suit_atlas = SMODS.Atlas{
    key = 'suits',
    path = 'suits.png',
    px = 71,
    py = 95,
    atlas_table = 'ASSET_ATLAS',
}

local ui_atlas = SMODS.Atlas{
    key = 'ui_icons',
    path = 'ui_icons.png',
    px = 18,
    py = 18,
    atlas_table = 'ASSET_ATLAS',
}

local leaves = Ceres.SETTINGS.suits.enabled and Ceres.SETTINGS.suits.leaves.enabled and SMODS.Suit {
    key = 'Leaves',
    card_key = 'LEAVES',
    hc_atlas = 'suits',
    lc_atlas = 'suits',
    hc_ui_atlas = 'ui_icons',
    lc_ui_atlas = 'ui_icons',
    pos = {
        y = 0
    },
    ui_pos = {
        x = 0,
        y = 0,
    },
    hc_colour = HEX('419947'),
    lc_colour = HEX('419947'),
}```
crisp elbow
#

POGGERS ty

hushed cradle
#

nws

#

i think that demostrates most of the stuff

wintry solar
#

Right, I think I'll port over full sprite sheet stuff first, set up a modding forum and we can carry it on over there

shell tangle
#

Sounds good to me. I can either make a terrible example image or try doing some UI code to just do the basic shape of what I'm imagining, but I haven't interacted with CardArea enough to know how I'd make that function. I don't imagine it'd be too different from how Galdur's chips work, just that they'd be moveable afterwards and then that order would be read, probably on pressing an apply button, to figure out priority to load things in.

wintry solar
#

yeah I can picture what you mean

nocturne garnet
#

why wont this work 😭

cedar flame
#

does anyone know how to change the sort order of the default suits? i thought i was onto something with the view_deck function but it looks like SMODS overrides it...

shell tangle
#

Something something, CardArea:sort?

cedar flame
#

oh, lemme take a look at that

#

thanks!

shell tangle
#

Just a few random searches, might lead you in the right direction, but no idea for sure, haven't touched it myself.

cedar flame
#

i think this leads me to the same place i was looking, which is get_nominal

#

lemme get the code i have one sec

shell tangle
#

What happens if you overwrite local suit_map and rank_name_mapping in G.UIDEF.deck_preview?

#

I think it'll probably be hardcoded in several places throughout the code, though, that'd just change the sort function.

cedar flame
#

i didn't touch rank_name_mapping since i wasn't messing with the ranks, but i did try the other one with no changes... i think it's because SMODS overrides the deck_preview method as well

#

in core/overrides.lua

#

the other thing i was looking at was core/game_object.lua where it defines the Suit object

#

it sets max_nominal and suit_nominal

shell tangle
#

Are you just trying to make diamonds come before spades or something, or?

cedar flame
#

i'm trying to make the suits go clubs -> spades -> hearts -> diamonds

#

the cards have numbers that ascend in that order, plus 4 more suits

frosty dock
#

yeah the base game functions for this are absolute dogshit for extensibility

#

I've tried with lovely patches, it ended up being more lines than the actual function in full

cedar flame
#

oh god

#

i mean, i'll do it if necessary but rip

wintry solar
#

just overwrite the overwrite taps head

frosty dock
#

hopefully patching loaded files like from steamodded is possible soon with lovely

#

(rn it's possible without lovely but super cursed

cedar flame
#

do you happen to have the code you wrote somewhere?

frosty dock
#

the deck view override or patching steamodded files?

cedar flame
#

the deck view override

#

if it ends up being too too painful i'll look into what would need to change in steamodded i guess

frosty dock
#

uh yeah it's at line log10(naneinf) in core/overrides.lua

cedar flame
#

the important bit here being the table.sort call right?

#

which uses get_nominal

crisp elbow
# hushed cradle ```lua local suit_atlas = SMODS.Atlas{ key = 'suits', path = 'suits.png'...

getting this rn... here's the code snippet I have as well and I can confirm the textures are loaded.


--SMODS.Atlas {key = 'digits', path = 'digits.png', px = 71, py = 95}
--SMODS.Atlas {key = 'digits_hc', path = 'digits_hc.png', px = 71, py = 95}
--SMODS.Atlas {key = 'arms', path = 'arms.png', px = 71, py = 95}
--SMODS.Atlas {key = 'arms_hc', path = 'arms_hc.png', px = 71, py = 95}
--SMODS.Atlas {key = 'bottles', path = 'bottles.png', px = 71, py = 95}
--SMODS.Atlas {key = 'bottles_hc', path = 'bottles_hc.png', px = 71, py = 95}
SMODS.Atlas {key = 'webs', path = 'webs.png', px = 71, py = 95, atlas_table = 'ASSET_ATLAS'}
SMODS.Atlas {key = 'suitsui', path = 'suitsui.png', px = 18, py = 18, atlas_table = 'ASSET_ATLAS'}
--SMODS.Atlas {key = 'webs_hc', path = 'webs_hc.png', px = 71, py = 95}



--Actual suit code
local websuit = SMODS.Suit {
    key = 'Webs',
    card_key = 'WEBS',
    hc_atlas = 'webs',
    lc_atlas = 'webs',
    hc_ui_atlas = 'suitsui',
    lc_ui_atlas = 'suitsui',
    pos = {
        y = 0
    },
    ui_pos = {
        y = 0,
        x = 0,
    },
    hc_colour = HEX('47d7cc'),
    hc_colour = HEX('47d7cc')
}```
#

sorry for ping

#

also happens on the suit as well

wintry solar
#

aure can I create smods objects inside an inject function? will it mess anything up?

languid mirage
#

recursion potential?

wintry solar
#

it's a different object it creates

languid mirage
#

might be fine then

cedar flame
# cedar flame which uses `get_nominal`

that method seems to call back to self.base.suit_nominal which if i'm understanding correctly is set from max_nominal.value in the SMODS.Suit constructor. in theory i should be able to change the sort order with the code i've added to override that value but it doesn't work:

SMODS.Suit:take_ownership('Clubs', {
    max_nominal = { value = 0.00 }
})
SMODS.Suit:take_ownership('Spades', {
    max_nominal = { value = 0.01 }
})
SMODS.Suit:take_ownership('Hearts', {
    max_nominal = { value = 0.02 }
})
SMODS.Suit:take_ownership('Diamonds', {
    max_nominal = { value = 0.03 }
})
frosty dock
#

idk exactly how lua likes messing with an iterated table while within a loop, but I think it would be fine

frosty dock
cedar flame
#

oh

frosty dock
#

you'd want to change suit_nominal instead