#💻・modding-dev

1 messages · Page 684 of 1

frosty dock
#

neither do I, I was working off your assumption

queen crescent
#
local uno_data = {
    values = {
        '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King', 'Ace'
    },
    colours = {
        Red = 'Hearts',
        Blue = 'Spades',
        Green = 'Clubs',
        Yellow = 'Diamonds'
    }
}
gilded blaze
#

I meant behind

#

is it a local within a function

#

smh

queen crescent
#

uh no, its just a local
behind it is a planet card

frosty dock
#

however this also seems bad since it creates more conflicts with other crossmod

queen crescent
#

at the same time this exists
-# also local!!!

frosty dock
#

I think you just patch in your modifications after the table here

queen crescent
#

first time patching so uhhhh

#
[manifest]
version = "1.0.0"
priority = 0


[[patches]]
[patches.pattern]
target = '=[SMODS jen "jen.lua"]'
pattern = '''
local uno_data = {
'''
position = 'at'
payload = '''
uno_data = {
'''
match_indent = true
```the patch so far
frosty rampart
#

wait i'm confused
don't patches happen before smods can load any mods

#

no wait nvm i see the issue with just making it global

slim ferry
#

they do

#

yea

frosty rampart
#

@queen crescent i think your best bet is to copy the uno card loading code into your own mod and just run it with only the custom uno cards you want to make
and then hook relevant functions and whatever

sly heron
#

.

frosty dock
#

In this case that's jen.lua so patching happens right before pwx is loaded

queen crescent
#

yay!!!

#

now to return the suit string on the level

fading rivet
#

is there info_queue stuff for blinds?

grizzled tide
#

bump

sly heron
#

bumping

gilded blaze
sly heron
gilded blaze
#

at which point during the draw?

#

first hand drawn, and during pack openings that draw cards?

grizzled tide
#

ehh scratch that i found a workaround

gilded blaze
#

I have an example patch here to do exactly tha- I wasted half an hour of my life then

queen crescent
sly heron
gilded blaze
#

it should be SMODS.Blind{...}, not SMODS.Blind = {...}

#

the latter overrides SMODS.Blind, causing crash when smods tries to take ownership of The Wheel

wanton jolt
#

21

final jewel
#

hey so I cant figure out how to add my logo to the title screen

#

So this code is from maximus but like it doesnt work

slim ferry
final jewel
#

yeah but its not a card

slim ferry
#

oh wait

#

logo

#

nvm

#

oops

final jewel
#

np

frosty dock
final jewel
#

Oh I'll look in that

frosty dock
#

-# just run the code in there

tulip pecan
#

Is there any way to display in the joker description how many retriggers it's been given from the joker retriggers option? The way I'm currently handling retriggers is setting a value to a card (in this case card.ability.uma_retriggers) to basically give that card parmanent retriggers. What's the best way to show how many retriggers a card would have?

slim ferry
#

probably do something similar to SMODS.localize_perma_bonuses probably, thats used for playing cards so youll just need to patch in adding the retrigger count somewhere in Card:generate_ui i think?

true mortar
#

Quick question: using the "create_card" function, how do you specifically create self made jokers. i can manage to create base game jokers but somehow i cant find the proper ID for my self made ones

slim ferry
#

j_modprefix_key?

true mortar
#

sorry, but what is the modprefix?

slim ferry
#

the prefix defined in your mod's metadata file

rapid stag
#

when selecting a hand to play, in G.hand.highlighted outside of calculate, how do i see which cards will score

true mortar
slim ferry
daring fern
rapid stag
#

...what the fuck is this function 😭

#

excellent

#

i was thinking of doing next(SMODS.find_card('j_splash')) to cover that, but i'm wondering if there's a util func or smth that will cover anything that changes stuff that changes hands. i'm wondering if i should iterate over the cards to check for things like SMODS.always_scores() and SMODS.never_scores()

#

that doesn't really cover individual instances of add_to_hand or remove_from_hand passed from context.modify_hand from other jokers though

daring fern
tulip pecan
slim ferry
#

uhhh

#

oh wait

#

generate_card_ui

#

i think

tulip pecan
true mortar
#

how do i update a mod that i have on blalatro mod manager

slim ferry
#

It has an update button for mods that have an available update

frosty dock
#

-# yeah wrong channel, mod devs don't use mod managers

true mortar
#

sorry i made the mod

#

i was wondering how i push my new changes on the mod manager

frosty dock
#

did you not configure auto update?

viscid talon
#

how do i make a specific boss blind play a specific track. for example, if i have a custom boss blind called b_hatch_evilplant and a music track called music_evilplant.ogg, how would i define that

#
    key = "evilplant",
    path = "music_evilplant.ogg",
    select_music_track = function()
    end
}
#

im aware i need to have smth like this ^ but how would i go about it

true mortar
frosty dock
viscid talon
#

ok thanks

median veldt
#

Is the mod manager even like. Good

viscid talon
#

it has claude code iirc

true mortar
median veldt
#

I once thought of making a mod manager inside of Balatro, or at least one that checks for updates.

frosty dock
#

the version checker doesn't constantly look for updates, give it a few hours and it'll be on there

frosty rampart
true mortar
median veldt
#

I just always forget to update my mods. LOL.

viscid talon
#

??????

viscid talon
#
SMODS.Sound {
    key = "evilplant",
    path = "music_evilplant.ogg",
    select_music_track = function()
        return G.GAME.blind.config.blind.key == 'bl_hatch_evilplant' and 100 or nil
    end
}```
frosty rampart
#

specifically at the start iirc

viscid talon
#

o

frosty dock
viscid talon
#

thats so weird

#

oke

frosty rampart
#

thunking it

true mortar
median veldt
#

And does it deal with updates?

frosty rampart
#

same mod index that bmm uses

median veldt
#

I see.

#

I think I may hold off.

frosty dock
viscid talon
#

now i get an index null value error

#

on line 23

#

this is line 23

#

return G.GAME.blind.config.blind.key == 'bl_hatch_evilplant' and 100 or nil

frosty dock
#

yeah i omitted some nil checks

normal crest
#

finish the drawing

frosty dock
#

i was too lazy to include them

viscid talon
frosty dock
#

return G.GAME.blind and G.GAME.blind.config.blind.key == 'bl_hatch_evilplant' and 100 or nil this should do

viscid talon
#

thanks

frosty dock
glossy plume
#

okay so i'm just messing around with modding stuff and i'm trying to make one joker that combines every single joker (or as many as i can get), is there any way to make it so stuff like the mults from jimbo and jolly joker trigger seperately instead of how i currently have it where its just adding everything together?


        if context.cardarea == G.jokers and context.joker_main then
            
            local result = {mult = 0, chips = 0}

            
            -- Jimbo
            result.mult = result.mult + 4

            -- Jolly
            if next(context.poker_hands["Pair"]) then
                result.mult = result.mult + 8
                result.chips = result.chips + 50
            end
            -- Zany
            if next(context.poker_hands["Three of a Kind"]) then
                result.mult = result.mult + 12
                result.chips = result.chips + 100
            end
            -- Mad
            if next(context.poker_hands["Two Pair"]) then
                result.mult = result.mult + 10
                result.chips = result.chips + 80
            end
            -- Droll
            if next(context.poker_hands["Flush"]) then
                result.mult = result.mult + 10
                result.chips = result.chips + 80
            end
            -- Crazy
            if next(context.poker_hands["Straight"]) then
                result.mult = result.mult + 12
                result.chips = result.chips + 100
            end
            
            -- Half
            if to_big(#context.full_hand) <= to_big(3) then
                result.mult = result.mult + 20
            end

            if 


            return result
        end ```
normal crest
#

that message and the one below should be what you need

rapid stag
glossy plume
#

omg it works

#

tysm

silk latch
#

how do I get a # to properly show up in a localization string? (doing \# says it's an invalid escape sequence)

frosty dock
#

you have to pass it as a variable

#

i.e. #1# and vars[1] = '#'

silk latch
#

thanks

silk latch
#

Holy fuck I finally got the localization to work with the values LET'S FUCKING GO

#

btw what color do I use for the background of ^Mult?

frosty rampart
#

there's no standard

#

if you have spectrallib it defines its own gradient, otherwise it's up to you

true jasper
#

is you're using spectral lib use emult

glossy plume
silk latch
#

This is meant to have a 1/4 chance to give $100 when sold during a Boss Blind, but it doesn't work for some reason.

daring fern
#

And remove the context.end_of_round

frosty rampart
glossy plume
silk latch
daring fern
daring fern
silk latch
glossy plume
#
            
        effects[#effects + 1] = {
             repetitions = 1,
         }
   end



  return SMODS.merge_effects(effects)
 end ```

I also tried it with the context.repitition thing part there and it didnt work either
#

idk why the formatting just like

#

died

silk latch
#

Trying to get this to work properly, but the actual scaling is incorrect for some reason

tulip pecan
#

How does generate_card_ui in common_events.lua work with these lines that just seem to run the localize function, but doesn't set any variables to the function output?

grizzled tide
#

how do you get the current boss blind as an object? I want it to modify its chip_text before entering the blind

daring fern
grizzled tide
#

mm is there any way i can grab the text ui for the score required at least then

#

i just want to modify the text, i can properly set the score with set_blind

glossy plume
#

Is there like documentation anywhere for how all the vanilla jokers are made because i can’t find anything and the code in the jokerforge stuff doesn’t seem to work for anything that isnt like a basic mult or chip hoker

primal robin
#

Wait I cannot use different atlases for center and soul sprite? What a hell

#

this sucks

knotty solstice
#

Idk how to code but I took a quick 5 minutes look into the documentation

#

If It works I can explain but Idk If It'll work

rapid stag
#

sanity check: SMODS.calculate_effect({ ... }, G.GAME.selected_back)?

tulip pecan
#

How to I access the extra ability section of a joker inside the generate_card_ui function? the table passed through _c is card.config.center, so I can't read card.abililty.extra from there. I need to be able to toggle on a description element for any card if they have a certain extra value set.

daring fern
rapid stag
tulip pecan
#

no card for me here

rapid stag
#

what version of steamodded are you on

tulip pecan
#

beta 1503a, but the bit i just posted was from base game files

rapid stag
#

try latest release

tulip pecan
#

ill give that a try

daring fern
tulip pecan
#

i forget that patches change stuff

primal robin
#

if you forced look into generate_card_ui then you're in trouble, good luck

naive coral
#

how do increase the weight of another joker within a joker?

daring fern
naive coral
#

ty

gilded blaze
#

latest smods has a new optional feature object_weights, which allows weight modifications up to single objects

#

do this first

SMODS.current_mod.optional_features = {
    object_weights = true,
}
grizzled tide
#

does anyone know how to get the current list of blinds in pool available for the current ante

true mortar
#

how would i do that?

elder rune
#

I figured it out in a weird way, literally just removing it in set_badges (typically badges[2])

frosty dock
true mortar
#

how do i change the github meta files

frosty dock
true mortar
#

Sorry, i really dont know my way around github. what do i need to do

wild patrol
#

Really wish there was an easier way to edit mods on the mod manager

#

I get why it is the way it is but it's such a hassle

#

I'm still trying to figure it out having to manually edit the download link every release

sly heron
#

what create_card do?

frosty dock
frosty dock
wild patrol
#

It doesn't for me for some reason

#

I probably have it set-up wrong

#

But whenever I try to change something the bot gives a merging error

frosty dock
wild patrol
#

Twitch Integration Mod

frosty dock
wild patrol
#

I meant when I make a new release

#

I have to make an edit to the download link

frosty dock
#

then you shouldn't have fixed-release-tag-updates set

wild patrol
#

I tried removing it but the bot wouldn't let me merge

frosty dock
wild patrol
#

Ah

#

I'll take another swing at it later

naive coral
#

is there a way to make my enhancements display on top of the card? i have a symbol on it and want it to be on top

ancient mango
#

how do i make a custom deck?

#

someone?

sly heron
ancient mango
#

help

#

why did it crash

normal crest
# ancient mango

in your joker's loc_txt, text should be a table, not a string, so text = { 'I want this to add 30 chips' }

#

also for the atlas you don't need to include your mod prefix

silent sail
#

how would one go about adding joker display compat?

fading rivet
sly heron
fading rivet
sly heron
#

but how do i use this?

fading rivet
#

iirc incantation, familiar, and grim use it

#

or certificate

ancient mango
#
SMODS.Joker {
    key = "jimbo",
    atlas = "atlas",
    config = { extra = { chips = 30 } },
    discovered = true,
    loc_txt = {
        name = 'Test Jimbo',
        text = { '{C:chips}+#1#{} Chips' },
    },
    calculate = function(self, card, context)
        if context.joker_main then
            return { chips = card.ability.extra.chips }
        end
    end
#

why does it say nil

daring fern
ancient mango
# daring fern https://github.com/Steamodded/smods/wiki/Localization#loc_vars
SMODS.Joker {
    key = "jimbo",
    atlas = "atlas",
    config = { extra = { chips = 30 } },
    discovered = true,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.chips } }
    end,
    loc_txt = {
        name = 'Test Jimbo',
        text = { '{C:chips}+#1#{} Chips' },
    },
    calculate = function(self, card, context)
        if context.joker_main then
            return { chips = card.ability.extra.chips }
        end
    end
}
```?
mystic river
#

but it's just a wrapper for create_card

frosty dock
dry raft
#

I'm having some real trouble getting my mod icon to load, must the textures be in {Mod root}/assets, or can that folder be called something else? I have dedicated ones to many assets, like /blinds/, /basics/, /cards/ etc., this is in Eris-dev/basics/1x/modicon.png and the 2x counterpart too.

shell timber
#

it must be in assets/1x/...

#

you can have subfolders in each of those

dry raft
#

ohh okay

slim ferry
#

This erises me

dry raft
#

well the modicon is a compressed version of eris and its moon so...

dry raft
grizzled tide
#

does anyone know how to get the current list of blinds in pool available for the current ante

dry raft
#

My mod now doesn't load, expects a string for a line that literally is just " ], // no conflicts yet"

final jewel
#

How do I give a temporary discard

frosty rampart
#

ease_discard(1) will add 1 discard for the current/upcoming round only

final jewel
#

ok I though it was a G

frosty rampart
#

i mean it probably is, but the ease function handles the animation too

final jewel
#

oh yeah

dry raft
#

ohhh

slim ferry
#

ease_hands_played

ancient mango
#

i wanna make a deck that makes all jokers negative, but i dont now how to do that at all or where to start

final jewel
#

I though that was modifying the number of hand played this round

slim ferry
#

thunk naming conventions

dreamy lodge
#

Is custom Perma bonuses possible? I wanted to give an Xmoney perma bonus but I looked on the smods wiki there isnt an option for that egg

frosty dock
inner terrace
#

There's been a couple of people encountering an issue with my mod, where the longest animations (125+ frames) are only appearing as a red/white sprite
I'm still uncertain what's causing it
I can't really reduce the size of the files/animations themselves without removing frames

frosty dock
inner terrace
#

Uh oh
Is there any way to fix it? As far as I know, I can't, like, stitch two animations or columns together for a card based on how SMODS implements it

dreamy lodge
frosty dock
frosty dock
primal robin
#

poland jonkler

frosty dock
#

welp if i'm gonna touch animated sprites, do we think something like this is worth the hassle?

GitHub

Specifically, this allows the first frame in an animated atlas to be repeated an amount of times that can be specified per-atlas, using a variable named firstframes, and save over 50% texture memor...

#

specifically my comment

This is a good idea, but it's fairly specific to blind chips. A more versatile addition would be a multiplier to the duration of each frame. Let me know if you want to have a go at this, else I could do it too.

inner terrace
#

Oh, interesting!

versed swan
# frosty dock gonna add it to the list of things to do 🫡

Reminds me, I wrote a system for one of my mods that basically streamlines adding custom card bonuses since even tho I only had to account for 6 bonuses (2 scoring params, 3 operators), it resulted in having to potentially deal with 24 keys

versed swan
#

For those mods it would greatly reduce the complexity of atlases caused by duplicate frames

inner terrace
#

I have very little reference point for how difficult that would be considering I'm still relatively new to lua and balatro modding, but it sounds awesome, if nothing else

frosty dock
#

hmkay i'll do it

#

i do have to figure out how to make it efficient since we need to check for what frame we're on every update

gilded blaze
#

man, I couldn't imagine the performance if I had still been using my old 14yo Mac

frosty dock
gilded blaze
#

I also refrained from using quantum enhancements (made a new enhancement combining 8 vanilla ones instead) because of performance issues too

frosty dock
#

atp we need a solution for quantum enhancement lag or to scrap them

versed swan
#

Is there anything specific about their implementation that is causing the lag?

frosty rampart
#

ruby's looked into it, a big part is that it calls card:set_ability() a lot but there's still some unexplained lag that was happening even when she disabled all those calls and all the QE contexts

primal robin
#

why do we use set_ability for quantum enhancements btw

frosty rampart
#

scoring purposes i think? idk ruby knows more

gilded blaze
#

that's the part I'm concerned about
it gets called way too often

primal robin
#

I more care about "why", not "how often'

gilded blaze
#

reminds me of Chiseled cards in Ortalab jumping around when dragged

primal robin
#

This is SMODS bug

#

Also quantum enhancements

frosty dock
#

I haven't looked at ts in a WHILE but have we looked at fake changing the ability table

frosty rampart
#

again, please talk to ruby if y'all are planning on doing stuff with QE, she has a WIP rework of it already underway iirc

primal robin
#

why not just implement Card:quantum_set_ability idk

frosty dock
#

I'm planning on nothing tbh

#

I'd probably rather review quantum ranks than rework quantum enhancements

versed swan
gilded blaze
#

it's kind of a mess anyway, I'm not even confident enough to make any says here

primal robin
#

I want to look into ruby's approach

frosty dock
#

I should also have a look at it tho

primal robin
#

I think we can start working from scratch

frosty dock
#

also have we ever established what an actually good api for quantum anything should look like

primal robin
#

Is there a possibility that we can afford breaking changes at some point?

frosty dock
#

if we can burn anything to the ground and start from scratch, it's quantum enhancements

#

if you're using it despite the lag, you're a maniac and deserve your mod breaking

frosty rampart
#

imo i think scrapping the contexts entirely might be a good idea
"quantum suits" are handled just by hooking Card:is_suit, i see no issue with hooking SMODS.get_enhancements or a similar function moved to exist in Card

primal robin
#

Highly depends on for what quantum enhancements are used for

#

if it's only check is enhancement present then yes this works

#

If it checks ability then it's more complicated

frosty dock
#

"quantum suits" don't exist in my books and they may get a more sophisticated API after quantum ranks

#

I don't think the context is currently the culprit though

primal robin
#

smeared jonkler is basically quantum suits jonkler

frosty rampart
#

yea my "scrap the contexts" opinion is unrelated to the lag tbh

frosty dock
#

the contexts provide more utility than what's gained from scrapping them imo

#

Also up for discussion is how the context should even function

frosty rampart
#

fair

frosty dock
#

I definitely think we're looking for modifying a map throughout the context calc. doing it directly on the table is fine, but we can look at making proper return keys for it that are more useful

primal robin
#

Question. Does current quantum enhancements support functionality of { m_steel = false }?

#

So if steel, discard it

#

Another question: does it supports effects available only during some contexts like All Steel cards at end of round count as Gold?

versed swan
#

I wonder if it would be beneficial/feasible to just develop a baseline "quantum mechanics", something that can be built from, given there are three distinct attributes that are being considered for quantumization

frosty rampart
primal robin
versed swan
frosty dock
primal robin
#

Okay, good

frosty dock
primal robin
#

I think that all we need to do is just create Card:quantum_set_ability

#

Because Card:set_ability doing a lot of unnecessary work, which includes: sizing, sprites changing, debuffing...

#

I supposed to do my job and not balala 😭

frosty dock
#

lmao

primal robin
#

Do you have any tests for quantum enhancements shit? I'll try to do quick attempt for optimizing them

frosty dock
primal robin
#

no, copied directly from dump

frosty dock
#

shucks, should probably do that

sly heron
#

So I have this code here G.E_MANAGER:add_event(Event({ func = function () local card = create_card("Joker",G.jokers,true,4,nil,nil,nil,"") card:set_edition({ negative = true }) card:add_to_deck() card:start_materialize() G.jokers:emplace(card) return true end }))
and I want make that insted spawning a legendary joker it spawns joker from a pool how could I make that?

primal robin
primal robin
daring fern
median veldt
#

whats the cardarea and/or card set for the cards in the Editions section of the collection

slim ferry
#

the card set is just Edition as far as i know

#

the cardarea idk but i assume its the same as other collection menus?

median veldt
#

i'd assume so too but i still dont know what that area is tbf

rough furnace
#

Why do you need it?

primal robin
daring fern
primal robin
#

Also game lags much less while selecting a hand just hovering a cards

median veldt
rough furnace
#

Although I wonder how your checking when to clone that it causes issues with the collection

dry raft
median veldt
#

I just added a check for if the set is Edition

dry raft
#

also the bottom heart lines up perfectly with the rest of him

#

my vscode keeps lagging, I have my whole mod folder open and it's 100+ folders, how do i make vscode stop scanning the folders for coding errors?

slim ferry
#

dont open your whole mod folder

#

and just add mods you need for library purposes as a library in vscode workspace settings

near coral
#

Currently I have a sticker that's supposed to have all jokers with it be sold or destroyed at once, meaning if one is sold all are sold and the same thing with being destroyed

#

However my coder made it to where when one is sold the rest are destroyed and you're simply given the sell value, how can it be changed to have them actually be sold as to not trigger destruction effects when sold

near coral
#

There's something up with that guy I swear

floral spindle
#

how do I get my joker to display colored text like the "spade" text here

frosty rampart
#

documented on the smods wiki ^^^

dry raft
#

I'm having trouble making a planet, this is my code but it never works. I gave up on localisation.
-- Asteroid Belt
SMODS.Consumable {
key = "asteroid_belt",
atlas = "atlas_p1",
set = "Planet",
cost = 3,
pos = { x = 0, y = 0 },
config = { hand_type = 'ers_Mixed Bag' },
loc_vars = function(self, info_queue, card)
return {
vars = {
G.GAME.hands[card.ability.hand_type].level,
loc_txt = {
name = "Asteroid Belt",
text = {
"Level up Mixed Bag",
"{C:red,s:1.1}+1{} Mult & {C:blue,s:1.1}+12.5{} Chips"
},
},
G.GAME.hands[card.ability.hand_type].l_mult,
G.GAME.hands[card.ability.hand_type].l_chips,
colours = { (G.GAME.hands[card.ability.hand_type].level == 1 and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[math.min(7, G.GAME.hands[card.ability.hand_type].level)]) }
}
}
end
}

frosty dock
#

```lua
-- code
```

#

please

#

anyway loc_txt goes in the consumable table, not inside loc_vars

near coral
#

My coder keeps misunderstanding what my teal seal supposed to do so I'm asking for help here as I feel it's just simpler to do than try to explain it over multiple testing logs

When played it doesn't score and it never directly triggers jokers, when held in hand it does -10% score requirement

#

They kept misunderstanding it as it still doing the -10% score requirement when it scores, when in reality it's never supposed to score

#

Am I able to get at least a skeleton of that to present to them

dry raft
frosty rampart
near coral
#

The misunderstanding lies in the 'does not score and does not trigger jokers' part

frosty rampart
#

is there like a language barrier or something?
also why is your coder still not in this server

#

no, you would use context.modify_scoring_hand

frosty dock
#

context.modify_scoring_hand works for unscoring the card

frosty dock
#

if you want to be explicit about it not triggering any jokers, even if they target unscored cards, you'd have to do that

#

but i doubt that's actually what you mean

near coral
#

Also yes there is a language barrier, albeit slight but it's enough to have misunderstandings such as this

frosty rampart
#

yea i gathered the effect was just supposed to be "the card doesn't count as part of the scored hand"

frosty rampart
# near coral They are, I'm just more social

please inform them that it's quite frankly infuriating to have to use you as a proxy, and we'd much rather talk to the coder directly if they need help with anything in the future

#

(just in general it's frustrating to have to go through a third party)

near coral
#

I'm doing this to be nice and help them, I frankly believe they value their free time which is why they don't bother outside of sending me the builds

primal robin
#

2 optimization prs by me in 2 days

frosty rampart
near coral
#

The only message they ever sent here was the one offering to code for me, I don't think they're a talker

#

If it's frustrating to you that I'm the one looking for help just don't help me

frosty rampart
#

my point is just I think it's their loss if they're not willing to use the resources provided to them, including the community

near coral
#

Yes it is their loss, but it is also my loss if several builds in the same problems persist and they don't seem the social type so I bring it upon myself

near coral
frosty dock
near coral
#

Oh

#

What about the part where it doesn't trigger jokers, is that currently possible

#

Like if it's a 2 rank it won't trigger even steven

idle plaza
#

Pretty sure a card not being scored already covers that

near coral
#

If it's a 9 rank but still scales cloud 9 that's plausible for me

near coral
#

Being unscoring just doesn't trigger jokers that require it to score

daring fern
near coral
#

Seeing as you seem unsure maybe it'd be good to run a rudimentary test on that before I relay it

frosty rampart
near coral
#

If it still scales stuff that's fine, it just can't cause the trigger

fading rivet
#

how can I tell if a card is generated in the shop in its set_ability function?

vital wren
#

how can i use # in a localized string without it trying to become a variable? i tried escaping it with \ and it didn't like that

normal crest
#

pass it as a variable, so #1# and then in loc_vars return { vars = { '#' } }

daring fern
vital wren
#

lol, okay

near coral
#

Also why the hell does it take up the whole line when I do a code box

daring fern
near coral
#

o

silent sail
#

how would one make an enhhancement that either has the card not count towards played handd size or not count towards hand size

frosty rampart
#

for hand size, you can either make it increase card.ability.card_limit by 1 (like how negative works, increasing hand size to 9 while it's present), or decrease card.ability.extra_slots_used by 1 (leaving hand size at 8)

dry raft
frosty rampart
#

yea all in jest ice cards can bypass the played card limit

dry raft
#

when I have struggled I have turned to other mods to see how they did it lul

silent sail
#

how do i somehow always accidentally have hte same ideas as things

frosty rampart
#

no such thing as an original idea, just roll with it

dry raft
#

play limit -> overall limit

frosty rampart
#

no yea i meant that as in "it does what your first request does"

#

as opposed to held card limit

frosty rampart
silent sail
#

ah cool atleast i got that goig for me

dry raft
#

yeah so if they temp change play limit it could just be changed to temp change card limit

#

like how I can change Jimbo from being useless +4 mult to be an even more useless +4 chips with a small change

silent sail
#

went and looked at the ice cards and i think the code is spread elsewhhehre nbecause nothing happens when i use wahhts in the lua

frosty rampart
#

yea it's all in patches

#

ctrl-f for "m_aij_ice" in lovely/lovely.toml

silent sail
#

ah

wanton jolt
#

whats the least buggy way to change the y pos of a card and soul sprite in the case of an animated sprite

silent sail
#

ok i managed to get it to take up no handspace

#

couldnt figure out the selection size stuff

#

idk why it says 3 i set it to 1 but yeah

sturdy compass
#

Not very

rapid stag
fading rivet
rapid stag
#

even if this isn't a specific joker or deck effect, you could still accomplish that via SMODS.current_mod.calculate

#

although you could alternatively do this in a create_card hook

fading rivet
#

forgot that context existed

rapid stag
#

i have a deck that guarantees the apperance of a pareidolia in a future shop if you have midas mask and vampire and i do that via a create_card hook

#

i implemented a somewhat more generic system to do so, so that i could make potential use of it with other effects and such

#

honestly, i might actually PR it

#

...oh, shop_create_flags exists girldmDead

daring fern
# silent sail idk why it says 3 i set it to 1 but yeah
local oldhighlight = Card.highlight
function Card:highlight(is_higlighted)
    local g = oldhighlight(self, is_higlighted)
    if SMODS.has_enhancement(self, 'm_modprefix_key') and not is_higlighted and self.area == G.hand and self.config.modprefix_key_enabled then
        self.config.modprefix_key_enabled = false
        SMODS.change_play_limit(-1)
    end
    return g
end

local oldaddhighlighted = CardArea.add_to_highlighted
function CardArea:add_to_highlighted(card, silent)
    if SMODS.has_enhancement(card, 'm_modprefix_key') and self == G.hand and not card.config.modprefix_key_enabled then
        card.config.modprefix_key_enabled = true
        SMODS.change_play_limit(1)
    end
    return oldaddhighlighted(self, card, silent)
end

local oldcardarearemovecard = CardArea.remove_card
function CardArea:remove_card(card, discarded_only)
    if Card.is(card, Card) and card.config.modprefix_key_enabled then
        card.config.modprefix_key_enabled = false
        SMODS.change_play_limit(-1)
    end
    return oldcardarearemovecard(self, card, discarded_only)
end
rapid stag
#

sanity check: card.edition.key?

#

i guess i'll do some cursed shit like lua 'e_'..card.edition.type
for now until someone affirms

#

where do i specify edition in Card:set_seal 🥴

torpid flicker
#

how do i detect when a specfic consumable is used?

daring fern
daring fern
fringe oxide
#

hey do yall know how to make deck sleeves?

idle plaza
#

I do

#

What do you need?

fringe oxide
#

6*

idle plaza
fringe oxide
lyric wadi
#

i hate the colours field

#

what the hell am i doing wrong i followed the example why is it always index into nil

idle plaza
lyric wadi
#
loc_vars = function(self, info_queue, card)
        local aoran = 'a'
        local rank = 3
        local suit = 'Clubs'
        if card.ability and #card.ability.extra.full_stack > 1 then 
            rank = localize(card.ability.extra.full_stack[card.ability.extra.index][1], 'ranks') or 3
            suit = card.ability.extra.full_stack[card.ability.extra.index][2] or 'Clubs'
        end
        if card.ability and card.ability.extra.full_stack[card.ability.extra.index][1] == 8 or card.ability.extra.full_stack[card.ability.extra.index][1] == 14 then aoran = 'an' end
        return { vars = { rank, suit, card.ability.extra.increment, card.ability.extra.xmult, aoran },
                colours = { G.C.SUITS[suit] }
            }
    end,
idle plaza
# lyric wadi

The colours table needs to go inside the vars table that you return in your loc_vars

lyric wadi
#

i get that im stupid but my hate for the colour field is justified

#

why tf are you there

idle plaza
#

The hate is justified, it's a very strange format

wary moth
#

Sooo, I been wanting to do a certain UI effect for my mod that I just have no idea how to start doing, was curious if anyone could point me in the right direction

So.. my mod is making a remixed version of each joker, but currently it does this just by adding 150 jokers and disabling the vanilla ones.
Theres still a chance the vanilla jokers are relevant (like, if I have an effect that turns a joker into its vanilla card), so I thought it'd be cool if instead of having 10 more pages of jokers to sift through, that it shows my remixed versions first, and that there would be a button I could press on the collection page that would switch between that and the non-remixed cards.

Can anyone help point me in the right direction on how to do something like that?

#

I think all I need to know how to do is:

  • override what shows up on the collection screen
  • add a button to the collection screen
  • (optional) be able to get/set what page of the collection screen I am on
frosty dock
# wanton jolt bump

you can change the sprite's animation.y and it should use that from the next frame change

#

animated sprites are a bit weird

shell timber
#

and then find out what pressing the < > buttons does and call that function

gilded blaze
#
---@field no_collection?: boolean|fun(): boolean
wary moth
wary moth
frosty dock
# wary moth what magic is this?

this is part of a lua Language Server Protocol definition, which translates to: the field no_collection can either be a boolean or a function that returns a boolean

#

the function part is useful to you because you can use a toggle's state

faint yacht
#

no_collection can be dynamically changed in-game, too.

wary moth
#

So, I suppose, all I need to know then is how to add a button onto the collections page? Is there an easy way of doing that?

#

I suppose alternatively I could also add a hotkey that just switches between the two views

gilded blaze
wary moth
sly heron
#

I was trying to make a joker that if some joker was in the pool it would destory it and gain xmult but it crashes can someone help me with that?
Heres code:

        if context.setting_blind and not context.retrigger_joker then
            local destroyed
            for _, joker in ipairs(G.jokers.cards) do
                if joker.config.center.pools.food then
                    joker.getting_sliced = true
                    destroyed = joker
                    break
                end
            end
            if destroyed then
                SMODS.scale_card(card, {
                    ref_table = card.ability.extra,
                    ref_value = "basexmult",
                    scalar_value = "gainxmult"
                })
            end
        end
        if context.joker_main then
            return {Xmult_mod = card.ability.extra.basexmult}
        end
    end```
wary moth
#

basically, turning the "if" statement to also check if pools exists at all before it checks if pools.food exists

sly heron
#

now Its not carshing but dosent work im gonna try do something with it

fading rivet
#

also with the current smods the attribute system exists

daring fern
# sly heron I was trying to make a joker that if some joker was in the pool it would destory...
calculate = function(self, card, context)
    if context.setting_blind then
        local destroyed_cards = {}
        for k, v in pairs(G.jokers.cards) do
            if v:has_attribute('food') then
                table.insert(destroyed_cards, v)
            end
        end
        if next(destroyed_cards) then
            SMODS.destroy_cards(destroyed_cards)
            SMODS.scale_card(card, {
                ref_table = card.ability.extra,
                ref_value = 'basexmult',
                scalar_value = 'gainxmult',
                no_message = true
            })
            return {message = localize({type = 'variable', key = 'a_xmult', vars = {card.ability.extra.basexmult}}), colour = G.C.MULT}
        end
    end
    if context.joker_main then
        return {xmult = card.ability.extra.basexmult}
    end
end
ancient mango
#

i want to make something but i dont have any ideas

mystic river
gilded blaze
#

it's a very simple change to SMODS.collection_pool really

red flower
#

then do it 🫵

gilded blaze
ancient mango
#

how do i change the textures of joekrs?

frosty dock
#

yeah that's an easy change

frosty dock
#

but also i have some additional features planned for animated sprites

fading rivet
ancient mango
fading rivet
#

put in the new position in the atlas

ancient mango
#

i mean like texture the vanilla joekrs

fading rivet
#

oh

#

idk

ancient mango
#

i wanna make a texture pack

ancient mango
#

oh, i was just wondering if there was another way cause i already know malverk exists

wild patrol
ancient mango
#

what mod is this

ancient mango
#

its very cool

wild patrol
#

No this is development of a mod?

ancient mango
#

ah

#

that looks like a gameplay image

wild patrol
#

that's cause it is?

#

to show off what's been udpated

ancient mango
#

k

slim ferry
#

because this is the dev help channel

slim ferry
#

modding support is the playing help channel

wild patrol
#

I didn't even know modding support existed

#

for some reason never showed up on my list

drifting garden
#

how does one make a targeted joker invisible?

#

also how do you get a joker to sick to a specific position on the screen, i've gotten it to move where i want it to move when i click on it, but it always gets snapped back every game update

true mortar
#

what is the id of a speed tag? It's not tag_speed?

gilded blaze
#

it's tag_skip

drifting garden
#

I figured out my previous questions, but now I have another. How can I fix align_cards() to act as though there are less jokers than there actually are in the card area based on a specific count. Say I do a for loop over the jokers checking for a specific attribute, how can I then make align_cards() treat the rest of the jokers as if those counted jokers do not exist. They will be invisible so their position and alignment is irrelevant.

gilded blaze
#

why make the jokers invisible instead of making a new off-screen card area and store those jokers there

drifting garden
#

i want them to trigger normally

#

i couldn't figure out how to make that work without leaving them in the joker area

whole lava
gilded blaze
drifting garden
gilded blaze
#

huh

#

the effect is to still allow invisible jokers to work while not allowing the player to align them?

drifting garden
#

i just want the joker card area to skip over the invisible cards when doing alignment

#

they will always have a specific attribute with this, so its easy to distinguish them

#

im just not sure how to correctly update align_cards() to get it to completely ignore them for everything

gilded blaze
#

patch this line

wintry solar
#

What do the invisible jokers do?

gilded blaze
#

wait nvm

drifting garden
gilded blaze
#

there are more intrusive patches you need to make it work

#

😭

drifting garden
#

you just can't see or interact with them

gilded blaze
drifting garden
#

its basically a workaround for fusing any 2 jokers together without trying to patch every possible trigger condition from one joker into another

drifting garden
#

hence why im trying to get align_cards() to ignore them

gilded blaze
#

what I meant is that

#

e.g. you have an invisible joker this way, and suppose it's at slot 3 (4 other jokers are visible)
what you're able to see are the 4 visible jokers

wintry solar
#

That sounds like an awful workaround

gilded blaze
#

when you realign visible ones, how would the invisible one react

drifting garden
#

the invisible one is permanently locked to the position of another joker

gilded blaze
#

that's awful to implement

drifting garden
#

okay

#

ill work it out

gilded blaze
#

takes immense effort for a wacky effect that doesn't make sense to a lot of people

wintry solar
#

You’d be better off dynamically creating invisible card areas and calling to calculate that area within the calc function, similarly to how blueprint works

drifting garden
drifting garden
# wintry solar You’d be better off dynamically creating invisible card areas and calling to cal...

Also how would that actually work, because blueprint is a joker in your joker card area that has its calculate function called by the game. This requires any joker regardless of trigger condition or blueprint compatibility to trigger its effect whenever it should normally. The first thing I did was remove it from the card area, but I immediately ran into the issue of not having a way to trigger any joker regardless of its condition when it is not in the main joker area.

wintry solar
#

Well you should have some sort of base card that represents the fusion, no?

drifting garden
#

i got it to work anyway

primal robin
#

I seen you mentioned that you was implementing a thing like "card count as all enhancements" or smth

frosty dock
gilded blaze
#

since the effect is slightly different from combining 8 vanilla enhancements

#

premium enhancement it is:
8 vanilla enhancement in 1, with a few differences:

  • lucky aspect is guaranteed
  • 1 in 15 chance to destroy card, rather than 1 in 4
daring fern
silent sail
#

ah hok

#

thanks

#

ok so it works but theres a biig issue of if you try clicking on one when your hand is full it permanantly removes play size

#

any idea on how id fix that?

#

ok so actually its worse selecting multiple cards will decrease the selection limit

silent sail
#
local oldhighlight = Card.highlight
function Card:highlight(is_higlighted)
    local g = oldhighlight(self, is_higlighted)
    if SMODS.has_enhancement(self, 'm_baggutro_ghostcard') and not is_higlighted and self.area == G.hand and self.config.baggutro_ghostcard_enabled then
        self.config.m_baggutro_ghostcard_enabled = false
        SMODS.change_play_limit(-1)
    end
    return g
end

local oldaddhighlighted = CardArea.add_to_highlighted
function CardArea:add_to_highlighted(card, silent)
    if SMODS.has_enhancement(card, 'm_baggutro_ghostcard') and self == G.hand and not card.config.baggutro_ghostcard_enabled then
        card.config.baggutro_ghostcard_enabled = true
        SMODS.change_play_limit(1)
    end
    return oldaddhighlighted(self, card, silent)
end

local oldcardarearemovecard = CardArea.remove_card
function CardArea:remove_card(card, discarded_only)
    if Card.is(card, Card) and card.config.baggutro_ghostcard_enabled then
        card.config.baggutro_ghostcard_enabled = false
        SMODS.change_play_limit(-1)
    end
    return oldcardarearemovecard(self, card, discarded_only)
end
#
SMODS.Enhancement {
    key = 'ghostcard',
    pos = { x = 1, y = 0 },
    loc_txt = {
        name = 'Ghost Card',
        text = {
            [1] = 'Played card {C:attention}Always{} scores'
        }
    },
    atlas = 'CustomEnhancements',
    any_suit = false,
    replace_base_card = false,
    no_rank = false,
    no_suit = false,
    always_scores = true,
    unlocked = true,
    discovered = true,
    no_collection = false,
    weight = 5,
    calculate = function(self,card,context)
        if context.cardarea == G.hand then
            card.ability.extra_slots_used = -1
        end
    end
}
daring fern
silent sail
#

alrighty

daring fern
silent sail
hushed stump
slim ferry
#

the hand tables in context.poker_hands are always at least an empty table, you should check next(context.poker_hands["Full House"]) instead

bold eagle
#

how would I make a joker with exponential mult

frosty dock
idle plaza
frosty dock
#

bleh you beat me to that, i'll just scrap what i was writing

bold eagle
#

so I've just gotta install amulet and make my mod dependent onn it and it'll just work?

idle plaza
#

Yeah

bold eagle
#

sweet

#

thank you

#

do I need to list a version for it in dependencies?

idle plaza
#

I don't know whether or not you need to list a version, but I think it's for the best since you wouldn't want, for example, players seeing issues that can only be caused because they happen to have some outdated version of Amulet compared to what you're running.

bold eagle
#

ok

bold eagle
#

when I try to put the version in with amulet in my dependencies my mod no longer shows up in the mod menu

royal carbon
#

My probability joker is crashing to desktop when I hover over it with Oops, what am I doing wrong? I can hover over it in the collection just fine (without Oops anyway) and get no nils. (I think) Relevant code is:

loc_vars = function(self,info_queue,center)
        local multnum, multdenom = SMODS.get_probability_vars(self, 1, center.ability.extra.multodds, "goldenmult")
        local moneynum, moneydenom = SMODS.get_probability_vars(self, 1, center.ability.extra.moneyodds, "goldenmoney")
        return {vars = {multnum, multdenom, moneynum, moneydenom, center.ability.extra.multgive, center.ability.extra.moneygive}}
    end,```
normal crest
royal carbon
#

Still happens

silent sail
#
local oldhighlight = Card.highlight
function Card:highlight(is_higlighted)
    local g = oldhighlight(self, is_higlighted)
    if SMODS.has_enhancement(self, 'm_baggutro_ghostcard') and not is_higlighted and self.area == G.hand and self.config.baggutro_ghostcard_enabled then
        self.config.m_baggutro_ghostcard_enabled = false
        SMODS.change_play_limit(-1)
    end
    return g
end

local oldaddhighlighted = CardArea.add_to_highlighted
function CardArea:add_to_highlighted(card, silent)
    if SMODS.has_enhancement(card, 'm_baggutro_ghostcard') and self == G.hand and not card.config.baggutro_ghostcard_enabled then
        card.config.baggutro_ghostcard_enabled = true
        SMODS.change_play_limit(1)
    end
    return oldaddhighlighted(self, card, silent)
end

local oldcardarearemovecard = CardArea.remove_card
function CardArea:remove_card(card, discarded_only)
    if Card.is(card, Card) and card.config.baggutro_ghostcard_enabled then
        card.config.baggutro_ghostcard_enabled = false
        SMODS.change_play_limit(-1)
    end
    return oldcardarearemovecard(self, card, discarded_only)
end
#

how would i fix this to prevent my hand size being made smaller when trying ot select with a full hand

idle plaza
#

If you start the code block with ```lua you'll get text coloring

silent sail
#

woah

#

thats cool

idle plaza
silent sail
#

nono its meant to be able to be selected beyond your play size

#

it works but its very buggy atm

#

like if i select all normal cards and try select one it will decrease my play size instead

rapid stag
#

how do i check if a card is flipped? cirDerp

silk latch
#

How does the key part of prefix_config work when creating a Consumable type?
I know that

    prefix_config{
        key = {mod = false}},

is a thing, but how do I actually define the prefix for the item type itself?

frosty rampart
frosty rampart
silk latch
#

wait so then where do I actually put this

frosty rampart
#

you don't need to have a prefix_config in your specific definition

bold eagle
#

is this channel only really used for technical questions or can balance ones be asked here

frosty rampart
bold eagle
#

ok

#

thanks

rapid stag
#

this isn't returning true when i put seals or editions on anything

primal robin
#

that's not how it works

frosty rampart
#

you need to do a second loop, right now you're just checking if G.jokers.cards.seal etc

primal robin
#

ipairs cannot have multiple tables as input

frosty rampart
#

ipairs is taking a table, that part's fine

rapid stag
#

it's a table call

#

i've done it on another implementation and that worked fine

frosty rampart
#

but yea your existing loop should have cards instead of card_obj, and then inside it you should do for _, card_obj in ipairs(cards) do

rapid stag
#

ohhh

bold eagle
#
loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_CENTERS.m_zwp_whimsical
        local whimsy_tally = 0
        if G.playing_cards then
            for _, playing_card in ipairs(G.playing_cards) do
                if SMODS.has_enhancement(playing_card, 'm_zwp_whimsical') then whimsy = whimsy_tally + 1 end
            end
        end
        return { vars = { card.ability.extra.emult, 1 + card.ability.extra.emult * whimsy_tally } }
    end,
#

for some reason the total emult isnt displaying correctly in game

#
j_zwp_exwhimsy ={
            name = "Compounding Whimsy",
            text = {
                "Gives {X:dark_edition,C:white}^#1#{} for",
                "each {C:attention}Whimsical Card{}",
                "in your deck",
                "{C:inactive}(Currently {X:dark_edition,C:white} ^#2# {C:inactive} Mult)"
            }
           }
#

thats the localization

near heart
#

Hello Zarcheus.

#

That is an interesting problem you have there Zarcheus.

#

Too bad no one will help you.

bold eagle
#

nevermind I got it working

#

wrong variable name

primal robin
#

How can I make effect "<vanilla poker hand> counts as <another vanilla poker hand>"?

fringe oxide
#

whats wrong with my sleeves

rapid stag
#

ok so i'm working on a spectral card that should shuffle seals and editions accross cards and jokers, but for some reaosn, some are getting removed outright instead of being moved somewhere else

here's the entire use function, what am i doing wrong

primal robin
#

You need:

  • collect all seals and editions you can transfer and store them in a list
  • cleanup all editions/seals on all cards
  • for each filtered seal
    • collect all cards available to target
    • roll a card to apply
    • apply upgrade
    • exclude this card from available cards
    • if all cards was used, discard leftover seals
    • repeat until all seals distributed
  • repeat for editions
rapid stag
#

that's pretty much what i wrote. it goes through everything, grabs all the seals and editions, cleans them up, goes through each grabbed seal, picks a random applicable card from the pool, applies, removes that card from the pool, repeats until all seals are assigned, then repeats for editions

#

but as i show, it's deleting some seals and editions for whatever reason

primal robin
#

erm this doesnt work yk

rapid stag
#

for removing them from the pool?

primal robin
#

this things do nothing essentially

rapid stag
#

hhhhhhhh

silk latch
#

(It's the ConsumableType file)

rapid stag
#

so how do i properly remove the items from the pool

primal robin
#

First, you need to make sure that pool is separate object and not belongs to smth like cardarea

#

fullObjPool is fine because it's result of merging multiple arrays which returns new array

#

but onlyJokerPool is reference to G.joker.cards which is live object belongs to cardarea

frosty rampart
primal robin
#

So first step will be local onlyJokerPool = SMODS.shallow_copy(G.joker.cards or {})

rapid stag
#

won't it not take if i do shallow copy?

silk latch
frosty rampart
#

again, you don't need to have it anywhere at all. delete line 5 entirely

rapid stag
#

i was gonna say if i do copy_table, it'll crash because recursive. but shallow_copy i thought would make it no longer reference the original items, which i need to be able to actually assign the seals/editions

primal robin
#

no, copy_table will cause stack overflow

#

SMODS.shallow_copy takes array of items and make it's copy, that's it

#

items stay the same, but array containing them is new

rapid stag
#

so :set_seal on a objects in a shallow copy will still apply a seal to the original object?

primal robin
#

you're not copying cards, only array containing cards

silk latch
#

Okay at least there's something now

rapid stag
#

ahhh

primal robin
#

it's 1-layer copy, not deep

rapid stag
#

ok so how do i properly remove the items from my pools once i've assigned a seal or edition to them

primal robin
#

pseudorandom_element returns 2 things: rolled item, and key rolled

rapid stag
#

table[key] = nil?

silk latch
primal robin
#

So, ```lua
local onlyJokerPool = SMODS.shallow_copy(G.joker.cards or {})

for _, seal in ipairs(seals) do
local target_card, target_key = pseudorandom_element(onlyJokerPool, "cirno_rng_key")
if target_card then
onlyJokerPool[target_key] = nil
-- apply seal
end
end

silk latch
#

not the consumable, the category

rapid stag
#

got it

#

wait no, that's not gonna work

#

i need to remove from both pools

primal robin
#

then you need find index of target card by looping and remove it aswel

#

kinda sucks but you have no choice

#

I feel like you're not quire understand what is "reference" in programming yet

fringe oxide
normal crest
# primal robin bump

most checks for hands do next(context.poker_hands[hand]) so maybe try setting a metatable to context.poker_hands when it's created so that when indexing hand you return smt different

rapid stag
#

i'm assuming local declarations only last for the remainder of the condition

primal robin
#

Always was

#
local t_obj, t_key
if red_seal then
  t_obj, t_key = pseudorandom_element()
else
  t_obj, t_key = pseudorandom_element()
end
#

and, you're looping a bit wrong

#
for k, v, in pairs(pool) do
  if v == t_obj then
    pool[k] = nil
    break
  end
end
#

pairs and ipairs difference is inportant

#

you want pairs, not ipairs

rapid stag
#

it's a keyed table?

primal robin
#

number is also a key

rapid stag
fringe oxide
fading rivet
fringe oxide
#

do they all need to be individual sleeve pngs then

normal crest
#

change px to 73 and py to 95

#

in the atlas

fringe oxide
fading rivet
#

it already knows how big the image is

silk latch
fading rivet
#

not the suit object

silk latch
#

I want to leave the suit intact

fringe oxide
#

thx

fading rivet
frosty rampart
fading rivet
#

oh

#

i might be stupid

frosty rampart
#

yea they only want to change the rank of the card

fading rivet
#

how do I have no emojis of this from actually good artists 😭

frosty rampart
#

anyway the rank also has to be the key of the rank, not the id
so it should be "King", not "13"

fading rivet
#

i'm in like 8 teto servers

silk latch
#

It at least doesn't crash now.
(It letting me select up to 2 cards is just from me copying most of Strength's code as a base and adding/changing shit from there, in the future it will only select 1)

#

but uh

#

yeahhh

#

okay I think that should be it fixed

#

damn you, ouija

brittle root
#

trying to destroy consumables and im failing miserably

daring fern
brittle root
#

🙏

#

that worked tysm 🙏

frosty rampart
#

ya returning remove only works in one or two specific contexts, SMODS.destroy_cards is what you'll want to use most of the time

silk latch
#

how do I apply a perma.bonus to a card from using a consumable?

daring fern
fringe oxide
#

my "casual" voucher isnt showing up on my custom sleeve

normal crest
fringe oxide
normal crest
#

after that line

fringe oxide
normal crest
#
apply = function(self, back)
  CardSleeves.Sleeve.apply(self, back) 
  -- rest of your code
end
fallen timber
#

Why there are no colors~~ and no values~~ at all? nvm about values im just dum
en-us.lua

        Weapon = {
            c_liroxfunstuff_weapon_stick = {
                name = "Stick",
                text = {
                    "Next played hand have {C.chips}+#1#{} Chips",
                    "Has {C.green}3 in 4{} chance to appear in first 3 shops",
                    "Has {C.green}#2# in #3#{} chance to become Metal Pipe",
                    "Pretty much useless"
                },
            },

weapons.lua

newWeapon(
    "weapon_stick",
    0,
    {extra = {baseChips = 50, chips = nil, event = "before_card", interations = 1}},
    function(self, info_queue, card)
        return {
            card.ability.extra.chips,
            3, 4
            -- todo: add propabilities
        }
    end,
    function(self, card, area)
        card.ability.extra.chips = card.ability.extra.baseChips * G.GAME.blind.ante
    end,
    function(self, card, area)
        apply_weapon(card.ability.extra)
    end
)

globals.lua

function newWeapon(key, cost, config, loc_vars, update_values, use, pos, can_use, replicatable, has_soul)
    pos = pos or {x = 0, y = 0}
    can_use = can_use or function(self, card, area) return true end 
    if replicatable == nil then replicatable = true end
    if has_soul == nil then has_soul = false end

    SMODS.Consumable({
        object_type = "Consumable",
        atlas = "weapons",
        key = key,
        set = has_soul and "SoulCard" or "Weapon",
        config = config,
        loc_vars = loc_vars,
        pos = pos,
        soul_pos = has_soul and {x = pos.x, y = pos.y + 1} or nil,
        cost = cost,
        unlocked = true,
        discovered = false,
        use = use,
        can_use = can_use,
        update_values = update_values
    })

    if replicatable then -- todo: add in BookOfLifeDrop pool
    end
end
rapid stag
fallen timber
#

like, because its a consumable or because its in locale file

gilded blaze
#

in en-us.lua, c: is the correct colour format, not C.

fallen timber
#

so for locales its c: instead, noted

#

now next question: how to make some cards have different type names? for example there are planets and dwarf planets in the same category

daring fern
fallen timber
daring fern
fallen timber
#

ohh that

fallen timber
daring fern
fallen timber
#

its not working for me apparently? is usage of HEX("colors") here ok or i need to use smth else?

fallen timber
daring fern
fallen timber
# daring fern Code?
function newWeapon(key, badge, cost, config, loc_vars, update_values, use, pos, can_use, replicatable, has_soul)
    pos = pos or {x = 0, y = 0}
    -- badge = badge or function(self, card, badges) badges[1] = create_badge(localize(badge), get_type_colour(self or card.config, card), nil, 1.2) end
    badge = badge or function(self, card, badges)     table.insert(badges, create_badge(text, get_type_colour(self or card.config, card), nil, 1.2)) end

    can_use = can_use or function(self, card, area) return true end 
    use = use or function(self, card, area) apply_weapon(card.ability.extra) end
    if replicatable == nil then replicataable = true end
    if has_soul == nil then has_soul = false end

    SMODS.Consumable({
        object_type = "Consumable",
        atlas = "weapons",
        key = key,
        set = "Weapon",
        config = config,
        loc_vars = loc_vars,
        pos = pos,
        soul_pos = has_soul and {x = pos.x, y = pos.y + 1} or nil,
        cost = cost,
        unlocked = true,
        discovered = false,
        use = use,
        can_use = can_use,
        update_values = update_values,
        set_card_type_badge = badge
    })
    if replicatable then -- todo: add in BookOfLifeDrop pool
    end
end
newWeapon(
    "weapon_dagger",
    "test",
    2,
    {extra = {baseChips = 50, chips = nil, event = "before_card", interations = 1}},
    function(self, info_queue, card)
        return {
            card.ability.extra.baseChips,
            card.ability.extra.chips
        }
    end,
    function(self, card, area)
        card.ability.extra.chips = card.ability.extra.baseChips * G.GAME.blind.ante
    end,
    nil,
    { x = 1, y = 0 }
)
daring fern
fallen timber
#

isnt it redefined? badge = badge or function() {} end?

floral spindle
#

how do I check each card in context.full_hand to see if one has an enhancement

idle plaza
fallen timber
idle plaza
fallen timber
idle plaza
fallen timber
tulip pecan
#

How would I add a Joker Display line for any potential joker (vanilla or modded) that has a certain config item that my mod sets? Would it be a similar method to patching generate_card_ui and simply checking for the value?

fallen timber
floral spindle
#
        if context.individual and context.cardarea == G.hand and not context.end_of_round and context.other_card:get_id() == 14 and context.other_card:is_suit(card.ability.extra.suit) then
            hasstonecardinscore = false
            for card in context.scoring_hand do
                if SMODS.has_enhancement(context.other_card, "m_stone") then
                    hasstonecardinscore = true
                end
            end            
            if context.other_card.debuff and hasstonecardinscore == true then
                return {
                    message = localize('k_debuffed'),
                    colour = G.C.RED
                }
            else
                return {
                    x_mult = card.ability.extra.xmult
                }
            end
        end
    end```
#

this code crashes game

#

how fix

fallen timber
#

may you provide the crash log?

gilded blaze
idle plaza
daring fern
gilded blaze
#

just straight up use SMODS.Consumable

#

why intermediate method

fallen timber
#

i use it like 16 times

#

i dont like repeating code

#

so i just made a function

gilded blaze
#

this is lowkey better

#

define each object as a table
put them all into a larger one
then run a loop

fallen timber
#

may i see how you define joker_table?

daring fern
gilded blaze
fallen timber
gilded blaze
#

it's better than your previous one, sure
but it's still not ideal

#

it's best you put each object in a separate file
and make a folder containing all those files
then in main.lua (your main file), load all items in that folder

#

otherwise you end up with an ever-inflating single file

#

😭

fallen timber
#

i already have separate files like jokers.lua, weapons.lua, decks.lua, etc all in items folder

gilded blaze
#

if you don't plan to have 100+ weapons, fine then

fallen timber
#

i already made all of them

normal crest
#

18k lines....

fallen timber
#

the only 2 things left are texture atlas and weapon execution system

gilded blaze
normal crest
#

I'm scared

fallen timber
normal crest
#

hi Lirox I'm sleepy

wary moth
#

Is there a standard way to create your own "events" for jokers to calculate?
Like, my mod adds the ability to click tags to use a charge of that tag to do some action, and I'd like for jokers to be able to react to it

daring fern
wary moth
daring fern
wary moth
meager oracle
#

whats the function for checking edition?

im using if context.other_card.edition == "e_prefix_edition" then but its not working :(

daring fern
meager oracle
#

ok ty

mystic river
#

card.edition is a table if the card has an edition
check card.edition and card.edition.type
or what something said, that also works

wary moth
daring fern
wary moth
#

ty!

gilded blaze
#

just don't do SMODS.calculate_context({before = true, after = true}) directly

#

objects that rely on those contexts expect more fields, which will certainly crash the game

elder yoke
#

Hello everyone, i got a question regarding a joker idea i have. Is it possible to make a joker that makes face cards function like wild cards? I want to try and make one but i don't know whether that is even possible or not.

gilded blaze
#

oh

#

huh

#

is_face takes Pareidolia into account

#

ah, context loop

#

😭

wary moth
#

I need to figure out how to set my project up so that I have context menus so I can actually navigate these contexts

gilded blaze
#

replace context.other_card:is_face() with SMODS.Ranks[context.other_card.base.value].face

elder yoke
#

Okay

wintry solar
wary moth
# wintry solar What sort of menu do you mean?

for my IDE
I just been opening files with the default IDE, which is Visual Studio for me, (probably since I usually work in Unity) but theres no context menus of any kind showing when I press G. for example, it won't show me what options are available from it, I been having to memorize, reference documentation (which is hard to navigate sometimes to find what I need exactly) or print values to see what is in them, or, just ask questions here

daring fern
wary moth
#

Oh hell yeah, thank youuuuu that looks like a lifesaver

frosty dock
#

No, smods detects context loops.

wary moth
#

How can I mimmick the ability of a joker by joker key? (if possible)

frosty dock
daring fern
frosty dock
#

true, just wanted it to be known that this will no longer work

#

or maybe it makes sense to actually redirect that to the new function? probably

ancient mango
#

i want to make something but i dont have any ideas for what to make

vital wren
#

lovely patches Card:open to not set G.STATE = G.STATES.TAROT_PACK etc.

how would i go about checking what type of pack is open?

daring fern
vital wren
#

ahh, config.center

#

that worked perfect! thanks!

final jewel
#

Does the global calculate happend before every other calculate in the same context ?

wintry solar
#

No, afterwards

primal robin
final jewel
#

shit

wary moth
#

Just curious, has anyone took advantage of lua metatables for balatro modding?
Been learning more lua, and it looked super powerful, so I was curious if there was any applicable examples of it, cause I thought it'd be fun to see

umbral zodiac
#

i have metatable addiction

#

only really for minor things tho

wary moth
primal robin
umbral zodiac
#

but also basically every object in balatro uses metatables in order to make object oriented-like programming with them

#

this is one i have tho
very very simple

wary moth
umbral zodiac
wary moth
#

I'm more used to object oriented programming (came from working in C# for Unity), so lua has been.. interesting to learn

wary moth
primal robin
#

metatables is a way to define getters/setters by using middleware basically

wary moth
daring fern
wary moth
#

So
I'm making a mod that remixes all the cards in vanilla balatro (called "Disheveled")
and, so far I was just adding new jokers/consumeables/etc that suppress the originals from showing up in the pool
But I came to the realization after making an effect that reacts to you gaining a "juggle tag" specifically
And I realized that, if someone else made a key check for that in a different mod, I would like the keys to inherently also apply to the disheveled versions. So gaining a "disheveled juggle tag" I want to also trigger "juggle tag" effects for example
One idea I had on achieving that was changing the metatables of any "key" values to override the __eq when comparing it
But, I realized that was probably... awful, and probably annoying to set up anyways
(The other option I'm concidering after Somethingcom515 showed me the mimic joker effect, was to just override the base jokers with all values of the Disheveled variants instead of having entirely new copies of each thing. But, that also is probably really messy too so, I probably just wont worry about it)

daring fern
wary moth
wary moth
ancient mango
normal crest
ancient mango
wary moth
#

How can I figure out if the game is in the "select blind" screen? (Or any screen that is viable for calling G.FUNCS.reroll_boss(), to be specific)

normal crest
ancient mango
normal crest
#

there are way too many...

ancient mango
#

i mean the common ones'

umbral zodiac
#

would heavily recommend GPL3 as it's the standard for balatro modding and basically allows people to do whatever with your creation including making their own versions or using your code so long as they also use gpl3

#

i believe i got that correct

ancient mango
#

ok

#

thank you

#

i will do that

daring fern
ancient mango
#

also in file explorer there is an option to show hidden items liek AppData or .git and such is there a way to do that in vscode

grizzled tide
#

Is there a function I can hook to make a playing card score even when debuffed (like for jokers we can hook can_calculate)

tranquil axle
#

modding people, I remember there being a place where I can see the game code after lovely injects applied, where is that?

tranquil axle
#

ty

daring fern
wary moth
#

Is there any way to check for key presses?
Might help me debug a little

daring fern
wary moth
#

Thats perfect thank you

past spade
#

looking to replicate the "only get legendaries you dont have gold sticker on yet" mechanic for my own stake, where in the code is that located?

ancient mango
#

why does my mod not show up

frosty dock
ancient mango
#

oh

#

desciption

#

how do i make it multipel lines long

#

i just realized i messed up the icon pos

gilded blaze
#

4 Aces, 12 Face Cards, 36 Number Cards
13 Number Cards, 13 Red Stakes
13 Face Cards, 13 Aces

#

I see nothing wrong here pepeg

ancient mango
#

also how do i change the icons for ace face and number and not just suit cause deckskin only lets you change the icon for suits i think

#

i want to make it
4 Diamonds, 12 Clubs, 36 Spades
13 Number Cards, 13 Red Stakes
13 Face Cards, 13 Aces

#

someone?

frosty dock
ancient mango
#

what do you mean

wary moth
#

This is how I am creating a tag

G.E_MANAGER:add_event(Event({
    func = function()
        local tag = Tag("tag_dishevel_juggle")
        tag:set_ability()
        add_tag(tag)
        play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
        return true
    end
}))

Is there a way to make this immediately call apply on the tags upon it being created?

frosty dock
ancient mango
frosty dock
# ancient mango <@538635176847343636>

make atlases with the exact key the vanilla atlases for the icons use (using prefix_config or raw_key), I think that's ui_1 and ui_2 for the low and high contrast versions respectively. this is unconditional though, so if that's not good enough you'll have to patch the code responsible for creating the corresponding sprites

grizzled tide
ancient mango
frosty dock
ancient mango
#

thanks

#

yay it works

grizzled tide
#

does anyone happen to know how to force the visuals of a playing card to update?

#

im using debuff card in the before context but its not working

ancient mango
#

is there a way to change the path of an atlas at runtime and it will change its texture?

fading rivet
#

look into the pixel smoothing code

wary moth
#

Is there a way to get tags to call apply?

fading rivet
elder yoke
#

Can someone please help me? Im trying to make a joker that makes all face cards function like wild cards but i can't get it to work.

fading rivet
#

send your code

elder yoke
fading rivet
elder yoke
#

like this?

fading rivet
#

get rid of SMODS.Ranks

#

and yeah

elder yoke
#

okay, lemme see if it works.

elder yoke
# fading rivet and yeah

okay so something went wrong. there is a mistake but i can't figure out how to fix it, i have been trying the last couple of minutes but nothing works

fading rivet
#

if it says it expected something that means you got a syntax error

elder yoke
#

i got unclosed brackets now

slate turtle
#

hi

#

long story short; i'm working on a mod and i'm looking for people who can actually make sprites /nf

#

if you can make sprites and wish to help me out, contact me via DM.

ancient mango
#

what does pixel art smoothing even do

sleek valley
ancient mango
#

the problem is how do i change the atlas not how to reload the change

#

what use is it to reload it if i cant change it

sleek valley
#

ah right, mb

fading rivet
primal robin
fading rivet
#

look into the code of it and figure it out

#

trial and error along with examining code is one of the best ways to learn

slate turtle
#

i'm working on a mod and i'm looking for people who can actually make sprites /nf

#

if you are willing to help me out, please contact me via DM.

dusty fractal
#

Does anyone know how to ontact the poeple behind BMM

#

so i can fix a missing thumbnail

#

oh wait i fucked up and made it not a jpg

#

LOL

onyx sonnet
#

Is there a way to attach an info-queue to a button in UI?

elder yoke
#

Can someone please help me? Right now im trying to make 2 jokers that have special functions when put together. The last 2 cards are supposed to work together, one gives chips and the other mult. Now i want to make so when both of these jokers are put together in the joker slot, they both give xchips and xmult alongside their original bonuses.

fading rivet
#

if its there, do extra

elder yoke
fading rivet
#

use next(SMODS.find_joker("j_modprefix_jokerkeyn")) to see if the other joker exists