#💻・modding-dev

1 messages · Page 89 of 1

hybrid iris
#

a bad sjdfkhsdkfjh

#

the problem is that like
h o w

weary jungle
#
    startRef(self, args)

    --reduce hand size by x after round
    G.GAME.TGTMchangeHandSize = 0
    --Get intrest amount
    IntrestAmt = G.GAME.interest_cap
    --Chance for a card to get cursed
    G.GAME.TGTMCurseChance = G.GAME.TGTMCurseChance or 0
    --Buff Face Card for a round
    G.GAME.TGTMFaceBuff = G.GAME.TGTMFaceBuff or false
end``` set globals (TGTMFaceBuff)
hybrid iris
#

even with a toggled global variable its like

#

sdjfhsdkfjh

#

I meant

#

the card still isnt acting like a joker in the end, it doesnt get triggered by all the contexts because it isnt a joker, it isnt in the right card area

weary jungle
#

do you have a keyboard smash button???

hybrid iris
#

im actually very trained in it

crisp coral
#

joker_main also gets called for consumables

hybrid iris
#

well yea i know

#

theres that for planets and the like

#

but thats it i believe?

weary jungle
#

hook functions

#

or somthing

hybrid iris
#

ive tried--

#

that was like

#

the first thing i tried actually

weary jungle
#

what happened!

hybrid iris
#

and it works for the basic effects

#

but it just doesnt seem to trigger for more complicated effects

weary jungle
#

wdym by basic and mor complicated

hybrid iris
#

sdkfjhsdfkjh

#

basic meaning +20 mult or +50 chips

#

complicated being anything that is triggered outside of just when scoring your hand and adding up all the numbers

weary jungle
#

like Xmult

hybrid iris
#

reading through the code its like

hybrid iris
hybrid iris
weary jungle
#

but like Xmult for kings

hybrid iris
#

yeah no too complex

#

almost all the calculation functions are designed to check for joker cards

weary jungle
#

if you didnt want to use patches you couldve gone with the spawn joker path

hybrid iris
#

i could have

#

but thats not the point

weary jungle
#

i do like it, very good mod

hybrid iris
#

i liked the challenge and i wanted the coolness to be acknowledged :(

#

ksdfhjksdhjf

#

okay cool, thank you

weary jungle
#

ksdhfjk

#

sdhfjk

hybrid iris
#

sdjfkhgksdjhfk!!!

weary jungle
#

hmm....

#

ok this is wierd

#

but we are getting off-topic

hybrid iris
#

okay fair

weary jungle
#

im doing something similar with runes, with the temporary upgrades

hybrid iris
#

ooh, yeah, i remember you discussing that

#

very neat too!

weary jungle
#

runes already made

#

wait... i forgot to ask

#

how do you see current ante

hybrid iris
#

oh right

#

,,,hm

#

G.GAME.round_resets.ante?

weary jungle
#

i tried blind_ante

#

also is it ok if i want 2 different versions of runes?

hybrid iris
#

oh hm,,

weary jungle
#

like they arent different runes, but the runes act differently

hybrid iris
faint yacht
#

G.GAME.round_resets.ante for reading, ease_ante(arg) for setting?

weary jungle
#

i think i was using G.GAME.round_resets.blind_ante instead of G.GAME.round_resets.ante

weary jungle
hybrid iris
#

up to you!

#

maybe a config for fun?

weary jungle
#

i dont want to hide it in a deck or a challenge

#

so button for cursed runes!!!

hybrid iris
#

mhm,,

#

oh heck yeah

weary jungle
#

these runes will have NO downside, except gain curse chance for any rune

#

muahahaha

#
Cursed Planet: delevel the hand
Cursed Tarot: selected cards turn into dummy cards (0 chip no rank/suit)
Cursed Spectral: Remove edition, enhancement and seal from 2 cards that have them```
#

i already have curses in the game, its just that itd be more prominent

#

oh this would be so much work

#

its fine

#

can you have conditional descriptions?

hybrid iris
#

i know its possible,,,

#

but its kind of hard if i remember correctly?

weary jungle
#

like if a, description is "hi" else description is "hello"

#

it could probably be loc_vars shenanigans

hybrid iris
#

you could,, probably look at the code for like, say, misprint?

#

yeahhh a lot of loc_vars shenanigans

weary jungle
#

like description is "#1#", loc vars is {(a and "hi") or "hello"}?

#

would that work?

hybrid iris
#

oh!

#

actually yeah that would work yes

weary jungle
#

i am so smart!!!

#

i am now a modder

#

i have no space in my nickname

hybrid iris
#

indeed you are now a modder

weary jungle
#

should you be able to change if the runes are cursed in a game or only before the match?

lost rover
weary jungle
#

the M rune...

#

idea, if cryptid is installed also create a negative jolly joker

#

for m rune

wintry solar
#

This is cool, and using patches is definitely easier than trying to hook all the relevant functions in an elegant way

hybrid iris
#

thank you!! ksdfjhskdfjh

#

yeahhh

#

though, looking through some of my issues now, it,, seems like its partly because of how steamodded implements the retrigger system?

#

i cant exactly tell where it is, but its like something something the code that evaluates the return is stuck inside callback and doesnt get called?

wintry solar
#

Uhhhh possibly, it depends how you’ve patched

hybrid iris
#

i, essentially went through everything and created a copy of each main/relevant joker calculation for consumeables

wintry solar
#

In state events?

hybrid iris
#

yea in stat events

#

a little in another file

weary jungle
#

can i add a global from G? like G.TGTMVARIABLE

hybrid iris
#

forgot what its called

#

for the contexts to go through

#

but im not sure if im missing something

wintry solar
#

Yeah that sounds like it should work properly then, it shouldn’t interact with retrigger api either depending on how you’ve done it

hybrid iris
#

hm,,, weird

#

my main issue is that like
return values essentially do nothing

#

and i cant tell if its a problem with my patching or if there's something that i've missed

wintry solar
#

Probably a problem with your patching

hybrid iris
#

hm,, fair, fair

#

at least contexts work!

#

sjdhsdjh thats, a start

wintry solar
#

Can you send an example of one of your patches?

hybrid iris
#

sure thing!

#

this is the one im focusing on rn

#

and heres how it ends up in the code

#

cleaned up a little*

wintry solar
#

Yeah okay, so you’ve got the retrigger stuff included in that, I believe there are some more retrigger patches that’ll need patching to work

hybrid iris
#

ahhh

#

okay gotcha

#

it kinda breaks whenever i dont include retriggers in this so i was a little forced to

hybrid iris
#

now i got a good direction to go in

wintry solar
#

I think if you put it back how the original statements were in the main game lua it should be fine

elder vapor
#

does having gemstones in glass make sense for the art

hybrid iris
#

but it brings up a lot more errors because of how the patches worked?
it added half of that callback function but not the other

tepid eagle
hybrid iris
wintry solar
#

I should be able to take a proper look later this evening

hybrid iris
#

okay, thank you!

#

its getting really late for me too so i might log off in a bit

elder vapor
#

kinda like if they're in a museum

tepid eagle
elder vapor
#

should i try to render the gems kinda like how the legendary jokers are done?

hybrid iris
hybrid iris
#

oh or maybe the opposite if you're aiming for a gem in a glass case look

elder vapor
#

i'll see what i can do

wintry solar
weary jungle
#
        name = "NAME",
        text = {"#1#"}
    },
    loc_vars = function(self, info_queue, card)
        return {vars = {(G.TGTMCURSEDRUNES and "CURSED DESC") or "NON CURSED DESC"}}
    end,```this would put cursed desc if G.TGTMCURSEDRUNES and NON CURSED DESC otherwise, correct?
elder vapor
weary jungle
#

how do i make a button

#

in settings

#

llike talisman

#

why dont i look at talisman

#

thanks guys

wintry solar
#

Don’t add a button to settings

weary jungle
#

what should i do?

mellow sable
#

add a config tab... like talisman

weary jungle
#

im looking at talisman and its complicted

mellow sable
#

UI code tends to be that way

#

and the code for Talisman isn't the cleanest

weary jungle
#

man if only there was a html like sub inspector.....

mellow sable
#

if someone made that for Balatro UI it'd be a life saver

weary jungle
#

someone wanted to

#

they said it would be hard

tepid crow
#

cuz it is 🙃

mellow sable
#

i would make one given infinite time and resources

weary jungle
#

curse you mathisfun and your very wierd code!!!!!

tepid crow
mellow sable
#

i'll cast the Card:calculate_joker spell on you

weary jungle
#

i can understand it though

elder vapor
mellow sable
#

try looking at this

#

helped me understand ui code @weary jungle

weary jungle
#

im going to copy some code and i am going to figure things out

mellow sable
#

each table is kind of like an HTML block

#

Here's a cleaned up version of the Talisman UI code if it helps you:

Talisman.config_tab = function()
  return {
    n = G.UIT.ROOT,
    config = {emboss = 0.05, minh = 6, r = 0.1, minw = 10, align = "cm", padding = 0.2, colour = G.C.BLACK},
    nodes = {
      {
        n=G.UIT.R, 
        config= {align = "cm"}, 
        nodes={
          {
            n=G.UIT.O, 
            config={object = DynaText({string = "Select features to enable:", colours = {G.C.WHITE}, shadow = true, scale = 0.4})}
          },
        }
      },
      create_toggle({
        label = "Disable Scoring Animations", 
        ref_table = Talisman.config_file, 
        ref_value = "disable_anims",
        callback = function(_set_toggle)
          nativefs.write(lovely.mod_dir .. "/Talisman/config.lua", STR_PACK(Talisman.config_file))
        end
      }),
      create_option_cycle({
        label = "Score Limit (requires game restart)",
        scale = 0.8,
        w = 6,
        options = {"Vanilla (e308)", "BigNum (ee308)", "OmegaNum (e10##1000)"},
        opt_callback = 'talisman_upd_score_opt',
        current_option = Talisman.config_file.score_opt_id,
      })
    }
  }
end
wintry solar
#

You can also look at any of my mods for ui code

weary jungle
#

i am going to go through each line!! and i will learn!!

wintry solar
#

Paired with my overview, I imagine you can get a reasonable grasp of it if you’re invested enough

weary jungle
#

i think im learning

#

what is a refrence table/value?

tepid crow
hardy viper
weary jungle
#

like #1# in loc_vars?

wintry solar
#

I battled with it for a while on the calculation context page till i found a layout that I was sort of happy with

hardy viper
# weary jungle like #1# in loc_vars?

similar but not quite. #1# signifies that it should look for the first value in the table returned from loc_vars, a ref table/value indicates that it should look for a value in some table. in loc_vars the value is fetched from a function only when necessary and with a ref table the value is a constant kept in a table that is always existent

weary jungle
#

ok

#

that seems mean

#

i have recived the information

wintry solar
#

It’s mostly useful for toggles and option cycles

#

Though you can also use it on text nodes

hardy viper
#

mfw dynatext

wintry solar
#

No, just regular text nodes

hardy viper
#

ik you were talking about regular text nodes

wintry solar
#

Yeah, dynatext is a bit different in how it works, with it being an object

#

I haven’t used it a whole lot tbh

hardy viper
#

ya not always very useful

weak depot
#

is there like a template for boss blinds that i can use for the animation?

tepid sky
hardy viper
#

love2d reference ?

zealous glen
#

Question: what number would you think makes the following Enhancement balanced:

When you defeat a Boss Blind, gain [value] xMult

#

It could be +Mult instead but this feels like a good place to add xMult

wintry solar
#

What does it start as?

split creek
#

How do you pass vars to a tooltip?

zealous glen
zealous glen
weary jungle
#

if you wanted feedback

wintry solar
tepid crow
wintry solar
weary jungle
#

but a small description would be appreciated

#

atleast for the useful functions

#

or maybe im just dumb and its fine...

#

dont take my word highly

tepid crow
weary jungle
#

yea

zealous glen
tepid crow
#

hmm, maybe 0.75 or something would be better yeah

#

1x feels like a lot, but maybe you'd want to playtest it

wintry solar
#

yeah it's a funny one, you can definitely get more than 1x scaling on other stuff per ante

#

but just 1x for free sounds really good

zealous glen
#

You also need to draw from benefit from it later

#

And find the Enhancement in the first place too

wintry solar
#

oh true, it's an enhancement

#

I think 1x might be okay in that case

wintry solar
tepid crow
#

just their locations 🙃

edgy reef
#

I mean, the files they are defined in are exactly the same name as the class

#

I don’t see why we would need to document class definition locations when you can just search <class name>.lua in the game directory

#

LocalThunk has good enough organization skills that this really isn’t an issue.

tepid crow
weary jungle
#

what eve n is native fs

hardy viper
#

loves filesystem management but with fewer limitations

weary jungle
#

ah..

#
    key = "RestBalatro",
    key_pressed = "m",
    held_keys = {'lctrl'},
    action = function(controller)

        if G.STAGE == G.STAGES.RUN then
            if not (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.PLANET_PACK or G.STATE ==
                G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.STANDARD_PACK or G.STATE == G.STATES.BUFFOON_PACK or
                G.STATE == G.STATES.SMODS_BOOSTER_OPENED) then
                save_run()
            end
            compress_and_save(G.SETTINGS.profile .. '/' .. 'debugsave' .. "0" .. '.jkr', G.ARGS.save_run)
            log("Saved to slot 0")
        end
        SMODS.restart_game()
    end
}``` This is not restarting balatro, it closes but doesnt reopen
#

this is probably a debug+ thing

mellow sable
#

I bundle nativefs so it can run without steamodded

weary jungle
#

why would you run it without steamodded

#

lovely.mod_dir.."/config.lua" would this be in the mods folder?

#

itd be in balatro/mods, mot balatro/mods/folder?

maiden phoenix
weary jungle
#

how do you defeat bonus cards

maiden phoenix
#

Put them on and find out 🥊 🥊

zealous glen
weary jungle
#

how do i get the setting to show up??

#
    local tabs = create_tabs({
        snap_to_nav = true,
        tabs = {
            {
                label = "TGTMConsumables",
                chosen = true,
                tab_definition_function = TGTMButton.config_tab
            },
        }})
    G.FUNCS.overlay_menu{
            definition = create_UIBox_generic_options({
                back_func = "options",
                contents = {tabs}
            }),
        config = {offset = {x=0,y=10}}
    }
end
``` is it this?? its not showing up in game
hybrid iris
#

another day another patch

#

had 4 hours of sleep and immediately am going back to modding: i may have a problem

weary jungle
#

ui is hard

hybrid iris
#

yeahh

weary jungle
#

how do you have tge settinh show in the settings

#

the setting isnt working

shell tangle
#

Are you trying to make mod config for your mod?

#

If so, you want a line that goes SMODS.current_mod.config_tab = function(), it's an SMODS function, unsure where it's been documented yet, and then you return a {n = G.UIT.ROOT, config = {whatever}, {nodes = {UI nodes in here}} and then end the function, and steamodded will pick up that UI code and put it in your mod page automatically.

#

Or, wait, are you trying to put it in the escape menu?

wintry solar
#

it's here

shell tangle
#

You can do it in the escape menu if you insist, I'd have to look into it to remember how, but, it's not advised, as if every mod put their config in that menu, that menu would be completely unusable. If you still want to do it, let me know, and I can try pointing you to some examples of it.

maiden phoenix
weary jungle
#
...
end```
#

this is how itd be?

shell tangle
#

Yeah, like that. I do recommend checking out Eremel's link.

weary jungle
#

i looked at it, why isnt it the wiki?

#

nvm

#

im an idiot

#

i thought mod config was config for mods like colors or something

split creek
#

Does anyone know how to get rid of the white title?

shell tangle
#

If you're talking about badge colors and prefix stuff, that's in the getting started section.

Maybe getting started should be separated into "Installing Steamodded" and "Creating Your First Mod".

weary jungle
#

nod config should be named mod config tab

shell tangle
teal estuary
#

is there any documentation on making your own stakes? cant seem to find any rn

split creek
# shell tangle What's your code for it?
    object_type = "Enhancement",
    key = "squirrel",
    atlas = "mtg_atlas",
    pos = { x = 0, y = 6 },
    config = { extra = {max = 6 }},
    no_rank = true,
    overrides_base_rank = true,
    always_scores = true,
    weight = 0,
    loc_vars = function(self, info_queue)
        return { vars = { self.config.extra.max } }
    end,
    calculate = function(self, card, context, effect)
        if context.cardarea == G.play and not context.repetition then
            effect.mult = pseudorandom_i_range(pseudoseed("mtg-squirrel"), 1, card.ability.extra.max)
        end
    end
}```
teal estuary
#

true

#

ty

weary jungle
#
    return {
      n = G.UIT.ROOT,
      config = {emboss = 0.05, minh = 6, r = 0.1, minw = 10, align = "cm", padding = 0.2, colour = G.C.PURPLE},
      nodes = {
        {
          n=G.UIT.C, 
          config= {align = "cm"}, 
          nodes={
            {
              n=G.UIT.O, 
              config={object = DynaText({string = "Beware traveller...", colours = {G.C.WHITE}, shadow = true, scale = 0.4})}
            },
            {
                n=G.UIT.O, 
                config={object = DynaText({string = "Lest you want to be cursed..", colours = {G.C.WHITE}, shadow = true, scale = 0.4})}
            },
          }
        },
        
                

        create_toggle({
          label = "Disable Runes Downsides..?", 
          ref_table = TGTMButton.config_file, 
          ref_value = "CursedRunes",
          callback = function(_set_toggle)
          end
        }),
      }
    }
end``` is this code wrong? its not showing up
wintry solar
weary jungle
#

as someone who is bad at ui, im sad

wintry solar
#

where are you trying to view it?

weary jungle
#

settings > mods

#

actually just settings mb

shell tangle
# split creek ```enhancement_squirrel = SMODS.Enhancement { object_type = "Enhancement", ...

I'm honestly unsure, do see a bit of Cryptid code in there, pretty sure object_type is unnecessary and gotten from Cryptid with the way it loads mods. Enhancements aren't really documented anywhere, so it's kind of rough.

You might be able to throw in a {C:G.C.UI.TEXT_DARK} into title or whatever it is for enhancements as a temporary fix if you want it to be legible while you test other things, but, it'd be best to wait for someone who actually knows what they're doing with SMODS enhancements to give advice.

weary jungle
shell tangle
weary jungle
#

what?

#

i think so

#

ok i found it

#

might be an issue

shell tangle
#

Well, you can see it now and work with it.
First thing is to try putting all three of those nodes into R row nodes, so that they line up in rows, instead of trying to be side by side in C columns.

weary jungle
#

oh

#

the c doesnt put the nodes in a column, it puts them in a row

shell tangle
#

It's finicky, but you can get the hang of it after messing around long enough.

And, yeah, it puts them in a single row because it's trying to place them as side-by-side vertical columns, with the middles of those columns lined up with each other.

tepid crow
#

ah, someone trying balatro UI

#

have fun >:)

wintry solar
split creek
#

Is there a way to get a card's suit in singular? What localization command would you use for that?

hybrid iris
#

i think you may have to do that manually unfortunately

split creek
#

I have an enhancement that has no rank, but does have a suit, and replace_base_card is true. The player still needs to know what suit it is, so I'm going to pass the suit in text in loc_vars

#

nvm i figured out the text lol

#

Is there a way to change the text color using a vars from loc_vars?

shell tangle
#

Yeah.

split creek
#

{C:#3#}words{} this is what I have right now

shell tangle
#

You use {V:1} instead of {C:}, and have it as loc_vars = {vars = {x}, colours = {colour variable}}.

elder vapor
#

cards not retriggering?

shell tangle
elder vapor
shell tangle
#

I assume stickers don't have a way to naturally apply repetitions, I don't know what it'd take without diving deep into the code myself, it might require a lovely patch somewhere.

elder vapor
#

yeah not entirely sure either

#

i have an eval_card function that i got from crypid that allows stickers to have a calculate function, although not sure if they can retrigger cards

edgy reef
#

Stickers already have calculate functions, it's just that they only trigger for jokers

#

And iirc Gemstones are for playing cards?

elder vapor
#

oh they do?

#

thats right, for rental and whatnot

#

gemstones can be for playing cards and jokers

#

some gemstones aren't compatable with jokers, although all gemstones can be used on playing cards

elder vapor
elder vapor
hardy viper
#

not card

split creek
#

return { vars = { self.config.extra.max, localize(suit_clovers, 'suits_singular')}, colours = { suit_clovers.hc_colour} } so this crashes the game when I try to pass these arguments (suit_clovers = SMODS.Suit {...})

elder vapor
#

ok i found a lead

#

retriggers are calculated in functions/state_events.lua (starting line 189) and only goes through eval.jokers.repetitions and eval.seals.repetitions

shell tangle
elder vapor
#

so i would need to patch in sticker support?

shell tangle
elder vapor
#

going through how repetitions are calculated for red seal, eval_card in functions/common_events.lua is where i'll need to patch stuff in for stickers

#

also in functions/state_events.lua after eval_card returns a value

shell tangle
split creek
shell tangle
#

There should be a thing in the collection menu, right?

#

Oh, you're asking like a check.

split creek
#

The issue is when you hover over the card in the collection, it tries to get the localization of the card, but it has no suit, so it breaks

shell tangle
#

There's likely to be a better way, but any Jokers like that I just have it default as Ace/Spades in code, to match castle/idol/rebate, and just overwrite the config with with the information it needs whenever it's applied to a card.

split creek
#

is there a way to print debug info

wintry solar
#

print()

split creek
shell tangle
#

What happens if you put it like {HEX()} or (HEX())?

split creek
#

crashes either way

#

return { vars = { self.config.extra.max, suit_text}, colours = {HEX('3dad2f')} } what do you mean colours is a nil valueeeeee

shell tangle
#

Odd. Does it crash with G.C.MULT?
And, I was talking about something like colours = {(HEX('3dad2f'))}, just in case.

split creek
#

colours is supposed to be in vars

#

oh my god

shell tangle
#

Is it? I swear it was separate, but I am still quite rusty to be completely fair.

#

100% my fault for misleading you if that's it.

split creek
#

no you're good

#

i've never been so happy

split creek
#

Does anyone know what the different contexts that an enhancement's calculate function will be called in?

elder vapor
#

would this patch work?

weary jungle
#

i did something and now my button is missing

#

also my text is in the center? instead of the top

tepid crow
wintry solar
weary jungle
tepid crow
elder vapor
#

trying to replace one block of code with another

tepid crow
# weary jungle

not sure, but pressing G+A when debug mode is enabled might help you understand

weary jungle
#

oh my god!!! the sub ispector!!!

wintry solar
tepid crow
wintry solar
#

or rather, outside of the nodes of the root element

elder vapor
weary jungle
#

well i cant SEE anything wrong with my ui now!

#

because there is an error screen

wintry solar
#

it also shouldnt be in an object node

weary jungle
#

fixed it

wintry solar
#

a toggle is not an object

weary jungle
#

but why is the button at the top?

wintry solar
#

because its in a container thats aligned to the top

#

the align property tells it how to align the things inside

weary jungle
#

ok i was trying to do something else but this is better

#

also do you like the spooky screen

elder vapor
weary jungle
#

did you go to functions/state_events.lua

#

and line 713

#

how do i make the button do things?

tepid crow
weary jungle
#
                        label = "Disable Rune Downsides..?", 
                        ref_table = TGTMButton.config_file, 
                        ref_value = "CursedRunes",
                        callback = function(_set_toggle)
                        config.TGTMCURSEDRUNES = not config.TGTMCURSEDRUNES
                        end
                    }),```is it like this
elder vapor
wintry solar
tepid crow
weary jungle
#

it just works with the ref_values?

wintry solar
#

and your ref_table is wrong

weary jungle
#

is it just config?

wintry solar
#

it's wherever you've saved oyur config

tepid crow
weary jungle
#

this one

wintry solar
#

that's the one

#

though calling it config seems unwise

#

I tend to use ModName.config

weary jungle
#

tell this to yourself!!!!

elder vapor
wintry solar
#

past self is big noob

weary jungle
wintry solar
#

yes I wrote this months ago

weary jungle
#

oh

#

oh yeah righ

#

i forgot

tepid crow
wintry solar
elder vapor
#

if eval is empty than next(eval) returns nil

weary jungle
#

i dont need this right?

wintry solar
#

no

tepid crow
weary jungle
#

curse you mathisfun and your wierd and efficient code!!!!!!

weary jungle
#

is any of this nessesary?

elder vapor
#

if next(eval) == eval.seals?

wintry solar
weary jungle
#

curse you mathisfun!!!!!!!!

wintry solar
#

my general advice is to not look at Math's mods if you don't know what you're doing

tepid crow
#

Math's mods are very confusing and definitely not standard nor easily readable

tepid crow
elder vapor
#

oh i'm not sure, that's what localthunk wrote

wooden nexus
weary jungle
#

yeah!

#

jimbo dating sim

tepid crow
# elder vapor oh i'm not sure, that's what localthunk wrote

Well, good thing I didn't either. So I googled it! This is what I found

Lua's next() function returns the next index of the said table and its value associated with the table.

  • When the next() function is called with nil value as the second argument, next returns an initial index and the associated value.
  • When the next() function is called with the last index of the table or with nil in the empty table, Lua next will return nil.
  • If the second argument ‘index’ is not present, then next() functions interpret it to be nil.
  • User can use next(t) to check if the table is empty.
  • The order in which the indices are enumerated is not that specific, also for numeric indices.
  • For traversing table in numeric order, user can use numeric for or ipairs function.
  • If next() function gives undefined, during traversing, the user can assign any value to any nonexistent fields of the table.
  • User can clear out or modify the existing fields in the table.
#

thanks discord formatting

#

really appreciate it

#

now this one stood out to me

User can use next(t) to check if the table is empty.

elder vapor
#

so basically

#

i patched in a non-joker/seal source for repetitions

#

and the next(eval) check brokey

tepid crow
#

almost

#

right now the if statement does this:
if (eval.seal) and (eval is not empty) and ...
which doesn't make a lot of sense

#

try checking if eval is not empty before you check for eval.seal

elder vapor
#

so if next(eval) and eval.seals and ...

tepid crow
#

it at least makes more sense to me that way yeah

weary jungle
#

Lets go. i did UI, i did consumables!! im on fire

#

whats next? shaders!!!

#

(im not doing shaders)

elder vapor
#

indexing nil with seals

tepid crow
elder vapor
#

not that i know of

tepid crow
#

it's just at mods/lovely/dump

#

find the functions/statevents.lua line that it errors on

elder vapor
#

it errors on a line that counts repetitions in the scoring hand

tepid crow
#

just show the line

elder vapor
#

oh sorry

#

line 713

weary jungle
#

hmm......

tepid crow
elder vapor
#

nope

#

like 968 is the line i actually patch

weary jungle
elder vapor
tepid crow
tepid crow
weary jungle
#
  return {vars = {(G.TGTMCURSEDRUNES and ("Gain {C:red}".. card.ability.extra.discards .. "{} discards")) or ("Gain {C:red}".. (card.ability.extra.discards * 2) .. "{} discards")}}
end,```
#

text = {"#1#"}

tepid crow
#

doesn't work like that

elder vapor
#

should i split my lovely patches up into different files lol

tepid crow
weary jungle
#

could i use an if statement?

#

no i cant...

shell tangle
elder vapor
tepid crow
#

oh were you the skyblock guy

shell tangle
#

Actually, question, why not make it a seal?

#

Nevermind, because it's also supposed to apply to jokers, right?

elder vapor
#

because i want the gemstones to not interfer with any current modification

#

and seals can't be applied to jokers

weary jungle
#

i made the runes, now i have to MAKE the runes.

tepid crow
#

you'd have to make a localization file for key yes

weary jungle
#

forcing me to make my mod better 😔

tepid crow
elder vapor
#

yeah uhh

#

not easy

#

especially for a first mod

tepid crow
elder vapor
#

uhhh i might've accidentally with a patch

#

targeting line 584

weary jungle
#

where is the localization wiki

tepid crow
tepid crow
weary jungle
#

i cant put down the cryptid mod....

runic sinew
#

is there a mod that adds the star suit?

elder vapor
weary jungle
#
return {
    descriptions = {
        Runes = {
            r_runes_laguz = {
                "Gain {C:red}#1#{} discards"
            },
            r_runes_Claguz = {
                "Gain {C:red}#1#{} discards"
            },
            r_runes_dagaz = {
                "{C:red}Disable{} boss blind", "{C:attention}No reward money from blind{} "
            },
            r_runes_Cdagaz = {
                "{C:red}Disable{} boss blind", "{C:attention}No reward money from blind{} "
            }
        }
    }
}```This is a good en-us.lua?
#

example, not done

weary jungle
#

if you send a variable w/ loc_vars, and there isnt a #1#, is that fine?

tepid crow
#

yeah that's fine

weary jungle
#

oh i have so much work.......

#

how do i use localization?

tepid crow
weary jungle
tepid crow
#

Replace the loc_txt entry. You should be able to check out my cardsleeves mod for localization on custom objects

elder vapor
# tepid crow Hmm, weird. Seems fine to me

i think whats happening is that every time next(eval) is ran (and stickers is apart of it) and a non-nil value is returned, the game assumes seals/jokers is a property of eval

#

so i gotta patch where i need to and put either next(eval) and eval.seals and .. or eval.jokers

weary jungle
tepid crow
#

honestly I'm not even sure that part does anything

edgy reef
#

It doesn't

tepid crow
#

cheers, I'll remove it then

weary jungle
#

how do i use different localization for name vs desc?

tepid crow
#

oh right, I missed that you didn't have that

#

look at the cardsleeves/localization/en-us.lua file

elder vapor
weary jungle
#

i think i figured it out

#

i used codex arcanum

elder vapor
#

if next(eval) then appears in both the seal checks and joker checks

#

so idek how i am supposed to replace them all

weary jungle
#

"r_rune_!!NAME!!" .. TGTMConsumables.config.CursedRunes and "C" this appends a C only when TGTMConsumables.config.CursedRunes right

#

will it append false??

#

TGTMConsumables.config.CursedRunes and "C" or "" to be safe

tepid crow
#

try it out and see

elder vapor
#

yeah this is going to be tedious

#

i'm gonna take a shower i'll be back later lol

weary jungle
tepid crow
weary jungle
#

attempt to concatinate boolean

tepid crow
#

which means the error is talking about what part of the code?

weary jungle
#

"r_rune_laguz" .. TGTMConsumables.config.CursedRunes and "C" or "" this also doesnt work

tepid crow
#

because it evaluates to ("r_rune_laguz" .. TGTMConsumables.config.CursedRunes) and "C" or ""

weary jungle
#

same reason

#

oh

#

wow

#

parenthisis time

#

this is what key = is

#

did i do something wrong

shell tangle
#

How do you get the r at the start?

#

I know base game, if it it's a consumable, it has c_whatever, doesn't matter what set, may possibly be applying that and missing it.

weary jungle
#

i just wrote it

tepid crow
#

depends on your class_prefix

weary jungle
#

thats a thing?

tepid crow
#

depends on what class you're subclassing

weary jungle
#

consumabletype?

elder vapor
#

@tepid crow good news, patched out all of the next(eval); no more crashes

#

now i gotta add the repetition for stickers in all of the places

weary jungle
#

how do i do it?

tepid crow
weary jungle
tepid crow
#

no your consumable type's class_prefix

weary jungle
#

how do i get that?

glass crown
#

is there documentation anywhere for all the config options for SMODS.Back and like how to apply them properly and such? im wanting to know all the options im working with with deck creation, especially with like maybe starting with jokers with various effects like eternal or negative n such on them

tepid crow
elder vapor
#

@tepid crow its done

#

in total it took 10 patches

tepid crow
#

hey that's pretty good

shell tangle
#

Nice job.

elder vapor
#

now time to make sure everything is functional so i can finally relase the next version

split creek
#

Does anyone know the best way to force a suit of a card with an enhancement? For example, when the playing card is generated, if its enhancement forces a suit, its suit gets changed.

weary jungle
#

what is a good consumable mod?

split creek
# split creek Does anyone know the best way to force a suit of a card with an enhancement? For...
# Force Suit
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "local card = Card(_area.T.x, _area.T.y, G.CARD_W, G.CARD_H, card_init.front, card_init.center, {playing_card = G.playing_card})"
position = "after"
payload = '''
    if card_init.center.force_suit then
        SMODS.change_base(card, card_init.center.force_suit)
    end
'''
match_indent = true```This is my currrent attempt
glass crown
weary jungle
#

cryptid doesnt use 0.9.8?

#

what???

#

look at top left

#

what is that doing there

#

why is that there?????

#

someone help me

split creek
#

debug mod

weary jungle
#

why does that show there

split creek
#

oh wait I have no clue

#

that's so weird

weary jungle
#

so... name goes to the title screen??? and i dont know why

lethal stratus
#

ohhh

#

you need to do that differently

#

name is an unassigned label

glass crown
#

i guess i have to look harder

weary jungle
#

wouldnt this?

weary jungle
lethal stratus
#

idr

weary jungle
#

you are my only hope!!!!

crisp coral
#

did you define a generate_ui

weary jungle
#

a what

crisp coral
#

okay then

weary jungle
#

how do i do that

elder vapor
#

finally got v0.2.0 out

weary jungle
#

what is a generate_ui

#

ill save this for tommorrow

true jasper
#

Whenever I try to commit something in vs to my github page it doesnt work and just loads forever

#

its been like this for a few minutes

timid parrot
rough furnace
#

Lol just found out that the game has a method for printing out tables as strings

#

Probably used for the save thing

#

but probably handy for someone nonetheless

#

actually it's not used anywhere

#

so it actually probably is used for debug printing

#

doesn't play nice with massive tables

#

theres also aprint which makes a box over the deck with info (but only works with debug mode enabled)

hardy viper
#

oh wait no smods defines inspect

wintry solar
#

tprint is nice to use

#

Just some of the tables are a pain in the arse for duplicated information

weary jungle
hardy viper
# rough furnace

how'd you magically summon the last thing you typed into the console

#

ive wasted several minutes of my life forgetting to type "eval"

maiden phoenix
#

You tried arrow up key?

hardy viper
#

nope !

#

didn't think that far

weary jungle
#

how do i make a generate ui?

maiden phoenix
hardy viper
hardy viper
maiden phoenix
#

Ah

elder vapor
#

is it just me or do i not get console logs

hardy viper
elder vapor
#

all i have is steamodded, lovely, debug plus, and my mod

weary jungle
#

im not sure what this means

hardy viper
elder vapor
#

if you don't mind, where's that at?

hardy viper
elder vapor
#

awesome, thanks

crisp coral
weary jungle
#

oh ok

crisp coral
#

it's usually due to the text node not having a proper parent node

weary jungle
#

is my localization correct?

crisp coral
#

here, your entire description didn't show, so there's a problem with your localizaton i believe

weary jungle
#

i was testing with the first one

crisp coral
#

no, consumables have the c_ prefix

weary jungle
#

im only looking at the first one rn

#

my mod prefix is TGTM

#

let me test something

elder vapor
#

c_TGTM_<consumable_key>

weary jungle
#

return {vars = {AmtDisc}, key = "laguz"} in my loc_vars

#

this is correct right?

#

am i supposed to have key in loc_vars?

elder vapor
#

for localization?

#

no

#
loc_vars = function(self, info_quque, desc_nodes)
   return { vars = { self.key } }
end
weary jungle
#

self.key?

elder vapor
#

its an example of what to send in loc_vars

#

usually it'd be something in the config

weary jungle
#

i send the key in the vars?

elder vapor
#

no

weary jungle
#

thats not what this says

elder vapor
#

an example of the loc_vars function

#

using self.key is an example of how to send variables

#

if you give me a second i can show my code

#

@weary jungle here's a sample

weary jungle
#

mine is like the same

#

i want to force use one jey

elder vapor
#

that's not the key of the consumable

#

c_TGTM_laguz

#

in loc_vars

weary jungle
#

ok i did

elder vapor
weary jungle
#

yes

#

its fixed

#

hopefully

elder vapor
#

the keys after laguz are wrong

#

in the localization its supposed to go <type prefix>_<mod prefix>_<consumable key>

glass crown
glass crown
#

the manifest file inside the steamodded folder packaged with it literally says its version 0.9.8

#

,, which apparently the 1.0 pre-release also says

tidal edge
#

if i wanted an enhancement to do something when discardded

glass crown
#

i guess i am wrong then

tidal edge
#

is there a check for that

#

was just wonering

weary jungle
#

how do i get the cards key?

#

this isnt working

timid parrot
#

Which key?

#

Are we talking playing cards, consumables, jokers, boosters, or vouchers?

weary jungle
#

the key at the botto,

timid parrot
#

Oh get its center

weary jungle
#

so card.center.key?

timid parrot
#

No I have to check gimme a min

#

iirc it’s card.config.center.key

weary jungle
#

didnt work, is it card.center.config.key?

glass crown
#

whats the best way to go about adding jokers to decks by default? as well as adding editions (specifically negative) and eternal to them?

maiden phoenix
elder vapor
#

wondering how this tallies up to 7 when i only have 6 slots in total

glass crown
#

okay, thank you!

weary jungle
elder vapor
#

haven't been able to get sendDebugMessage to work ever

timid parrot
#

make sure the logging is set to debug

elder vapor
#

ah i see it in the console now

#

yeah its adding 2 to the tally from jokers, not 1

elder vapor
#

its because the card's tally counter had gemslot in it, so i changed it to gem_slot_tally

mystic river
#

incredible

elder vapor
#

fixed now 💀

#

is there an easy way to add xchips?

mellow sable
#

Yes, if you use Talisman as a dependency

#

Then it’s just as easy as XMult

elder vapor
#

awesome

weary jungle
#

i am cooking?

#

when cursed runes

#

when not cursed runes

wintry solar
#

I have one I can send you later

weary jungle
#

how do i check if a joker is negative

#

this isnt working

hardy viper
weary jungle
#

...

#

why is my code not working? the nefarious tilde:

wintry solar
#

You need to check the edition, not the center

tepid eagle
#

one of my jokers tests for (v.edition and v.edition.negative)

weary jungle
#

like this?

weary jungle
weak depot
hardy viper
rough furnace
#

Its just on the Dev branch

weary jungle
#

i didnt relicre

hardy viper
# rough furnace Any lua you want

question, why is it that when you're modifying a global using eval, you have to do "_G.foo = bar" as opposed to a typical "foo = bar"

rough furnace
#

Cause the eval commands global object is actually a different object for me to be able to inject the dp variablw into it without making it a global

hardy viper
#

definitely understood that yeah egg

rough furnace
#

There might be a better way to do this but I don't know what it would be

#

Also it's kinda nice you can add fine variables that aren't global without clobbering the globals

hardy viper
rough furnace
#

Well I don't know how to control loclas in others code I can't easily inject it into the eval code cause it wouldn't be able to reference it and it also would screw up with ljne numbers (which isn't a big deal for eval but I still don't like doing it)

hardy viper
#

i was thinking debug.setupvalue before calling the function but I think that might only work after calling it?

rough furnace
#

Idk I could take a look

split creek
#

Hey I've been having this really weird issue where when I try to destroy a card in pre_discard (cause enhancements don't trigger at discard context) a weird ghost version of the card stays in the deck. Any ideas of how I could get around this? Thanks!

#

Here's the calculate function of the enhancement

        if context.pre_discard then
            if G.GAME.current_round.discards_used <= 0 and #context.full_hand == 1 then
                G.E_MANAGER:add_event(Event({
                    func = function()
                        destroy_card(context.full_hand[1],true)
                        return true
                    end
                }))
          card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize("mtg_sacrifice_ex"), colour = G.ARGS.LOC_COLOURS.club})
          end
        end
    end```

And here's destroy_card
```function destroy_card(card, noise)
    if card.ability.name == 'Glass Card' then 
        card:shatter()
    else
        card:start_dissolve(nil, noise)
    end
end```
weary jungle
#

oh the old ghost card

#

i dont know how to fix it

#

did you remove the card from the hand?

#

maybe add a table.remove(G.hand, something)

#

i dont know what the something would be

rough furnace
#

I'm not too familiar with ghost cards but I suspect it's being destroyed then being moved to the discard area causing the ghost card. I would take a look at trading card to see how it works

split creek
#

So trading card returns if the card is being destroyed, which enhancements can't return

#

I've just modified the effect to get around the issue

tepid crow
split creek
#

Well it's that trading card is triggered during context.discard, not context.pre_discard

#

enhancements in hand aren't triggered during context.discard

#

The destruction of the card occurs after context.discard, and I'm assuming that by destroying it at context.pre_discard, there's some issues being caused where the card is put into the discard pile while it's being destroyed

tepid crow
#

why would enhancements not have that context 🤔

rough furnace
#

Might be only called for jokers

#

Pre discard would be used for like golden seal

#

Wait no thats on play isn't it

#

Purple seal

split creek
#

Managed to fix the ghost card

#
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "local cards = {}"
position = "before"
payload = '''
    highlighted_count = math.min(#G.hand.highlighted, G.discard.config.card_limit - #G.play.cards)
'''
match_indent = true```
#

The problem was when I was removing the card during pre_discard, the code doesn't account for the change, so we have to redo the highlighted_count calculation

plain wyvern
#

uh. what was i doing lmao

#

skewed photograph

lethal stratus
#

look at this photograph
he's sitting weird

stable agate
#

Believe this is the right channel for a question like this; I'm working with a friend on making just custom card icons for the PC version of the game, swapping out the face cards basically, and was wondering if anyone knew or could tell me where to look for getting the requirements for cards in game (i.e dimensions, etc.)

hardy viper
round wing
#

Hello guys, mod beginner here. Is it possible to patch the localization files using Lovely?

stable agate
#

Do high contrast cards just need a separate sprite?

maiden phoenix
#

Yes

stable agate
#

got it. Thanks!

elder vapor
wintry solar
#

unless its changed in newest lovely, you can't

rough furnace
#

You can indirectly by patching the loading but not by just patching the localization file

#

I think SMODS has api's to modify localization

glass crown
#

how would i go about making a joker added to a deck by default negative?

#

nevermind, figured it out myself

stray warren
#

is it possible to have two separate next properties on a Rank? For instance, if I wanted an Ace to have a next for 2, and then if this other rank called "Apostle" was in the deck, another next for that? So that a Straight with an Ace and an Apostle in the deck can be made either like 'J, Q, K, A, T' or 'T, A, 2, 3, 4'?

#

Or is there an easier way to do that

wintry solar
#

I don't think multi ranks are supported yet

#

that's a similar issue, right?

stray warren
#

I'm not necessarily looking for multi ranks, if that's what I understand them to be. I just need some way for Aces to point to a 2 in general, but if a high straight is played, somehow treat the Apostle as the Aces 'next' rank

#

Would overriding something in the Straight and Straight Flush calculations be able to accomplish this?

#

So for example, when a hand is being checked for the hand type when cards are highlighted in hand, I want some code to run that checks if an Apostle is in those highlighted cards. If one is, do a manual check for if the specific ranks 'J, Q, K, A, T' are in those highlighted cards. If so, I want to return the fact that it is a Straight

#

If that makes sense

glass crown
#

I'm working on porting old decks from the old "deck creator" mod that I made myself, and so I'm gonna be asking a lot of questions here, probably in batches
however this question will not be in a batch

  • How would I go about adding a voucher to a deck?
rough furnace
#

Next is a table so I think you can just insert the other rnam into it

#

Not sure how it beaves in that case

zealous glen
#

I think I remember DFS being suggested

#

Or a DFS-based algorithm since you can stop when you first find a Straight

elder vapor
glass crown
#

when it comes to decks, base game does things a little differentlyyy

#

at least from what i can tell

glass crown
timid parrot
#

Lovely injections probably

glass crown
#

i should probably specify that i mean for a specific deck lmao

timid parrot
#

Yeah you most likely need to add an injection into card to modify booster pack behavior

shell tangle
# glass crown how would i go about increasing the size of arcana packs?

Here's how I did my booster pack size increasing deck, you'll probably want to add a check for specifically arcana, but just for reference, here's the code:


SMODS.Back{
  key = 'binah',
  loc_txt = {
    name = 'Book of Binah',
    text = {'{C:attention}+1{} Booster Pack {C:attention}Size','{C:attention}+1{} Booster Pack {C:attention}Choice'}
  },
  atlas = 'Decks',
  pos = {x = 1, y = 0},
  unlocked = true,
  discovered = true,
  trigger_effect = function(self, args)
    if args.context == 'booster' then
      G.GAME.pack_size = G.GAME.pack_size + 1
      G.GAME.pack_choices = G.GAME.pack_choices + 1
    end
    if args.context == 'booster2' then
      local size = args.size + 1
      return(size)
    end
  end
}

And here's the lovely patches I needed:

[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "G.GAME.pack_choices = self.config.center.config.choose or 1"
position = "after"
payload = "G.GAME.selected_back:trigger_effect({context = 'booster'})"
match_indent = true


[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "local _size = self.ability.extra"
position = "after"
payload = "_size = (G.GAME.selected_back:trigger_effect({context = 'booster2', size = _size}) or _size)"
match_indent = true
tepid crow
glass crown
#

thank you all for the help!

tepid crow
teal estuary
#

is this code usable in SMODS, or do i need to change something about it for it to work?

#

(apart from the obvious self into card)

tepid crow
#

is this code usable in SMODS
I don't even understand this question

#

anything that thunk does can be done in smods

teal estuary
#

oh, okay

#

neat

#

i meant as in, does SMODS do it differently

tepid crow
elder vapor
#

should i remove the streak in the middle?

spare elk
#

yeah no i have no clue what i'm doing wrong, im just trying to make aces of spades give x2 mult this shouldn't make me rage like it is doing rn

tepid crow
elder vapor
#

the glass behind the gem?

#

like that @tepid crow

teal estuary
#

is there a context for just the end of hand? i couldnt find one specifically, but i might just be stupid

tepid crow
glass crown
teal estuary
#

hmm

elder vapor
#

what context should i put to make sure it happens once before the hand starts scoring?

#

without any context it triggers 4 times, but with context.individual or context.before it never triggers

stray warren
#

well, for starters, card.area == G.play should be context.cardarea == G.play

hybrid iris
spare elk
#

👀

#

this is shaping up to be peak

hardy viper
#

nice

glass crown
spare elk
round wing
# elder vapor should be, what are you trying to acomplish?

Change text. Here's what I tried:

[[patches]]
[patches.pattern]
target = 'localization/en-us.lua'
pattern = '"-1 Hand Size"'
position = 'at'
payload = '"-2 Hand Size"'
match_indent = true

Initialization was complete, but patch isn't applied.

elder vapor
#

so it would be something like payload = '"-1 Hand Size",'

rough furnace
#

localization patches don't work

#

well I think they technically work if you put the full contents of the localization file as the target

teal estuary
#
    calculate = function(self, card, context)
      if context.cardarea == G.play and context.repetition and not context.repetition_only then 
        if card.ability.extra.repetitions > 0 then
        return {
          message = localize('k_again_ex'),
          repetitions = card.ability.extra.repetitions,
          card = card
      }
    end
  end
    if context.end_of_round and not context.blueprint then
      if pseudorandom('Uranium-235') < G.GAME.probabilities.normal/card.ability.extra.odds then
        card.ability.extra.repetitions = card.ability.extra.repetitions - card.ability.extra.loss
        return{
          message = "Half-lifed!",
          colour = G.C.RED,
          card = card
        }
  end
end
if context.end_of_round and not context.repetition and not context.game_over and not context.blueprint then
  if card.ability.extra.repetitions <= 0 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
        -- This part destroys the card.
        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 = "Decayed!",
}
end
end
end
}

i've got this hefty chunk of code, and i just cannot get it to work - when playing/discarding, it immediantly deletes itself and playes the "Decayed!" thing, for every card and when you win the blind, it throws an error

#

i'll quickly grab it, but its something to do with for

#

the idea of the joker is that it has X amount of retriggers, and has a 1/2 chance to lose 1 retrigger every hand (i couldnt figure out how to make it every hand, so right now its just end of round)

im not sure exactly whats wrong with it, its my first time working with chance and deleting a card 😭

hybrid iris
#

hm,,,

crisp coral
#

you forgot all the not repetition check for the half lifed end_of_round check

teal estuary
#

guh

crisp coral
#

and i can't check the crash but i'll just assume it's because it's trying to return a message after the card has been destroyed (via events)

teal estuary
#

is that just not context.repetition or not context.repetition and not context.reptition_only?

crisp coral
#

which should be fixed after you add the check ^^^^

#

just not context.repetition works

teal estuary
#

ty

#

testing it right now

crisp coral
#

i haven't seen context.repetition_only

teal estuary
#

its to do with seals, apparently

#

idk though 😭

#

i do have a question, is there a context to make this work after a hand is played, or is it condemned to only being at the end of a round?

hybrid iris
#

context.after?

crisp coral
#

the game does not have a context for start of hand surprisingly, but context.after works for end of hand

teal estuary
#

oh cool

#

thank you 😭

hybrid iris
#

what abt context.before?

teal estuary
#

it works! it lost 2, which is unintended, but it works! ~~it didnt show a message raisedcateyebrow~2 ~~

crisp coral
#

that's before scoring

hybrid iris
#

ahhh

#

okay actually that makes sense yeah

crisp coral
teal estuary
#

😭

#

Vitro (real)

#

it.. showed the half life message when it was destroyed? lmao

crisp coral
#

context.after might not support a message return

#

wait what lmao

#

try using card_eval_status_text instead of returning the message

teal estuary
#

sure, one mo

#

it lost 1 retrigger while playing a hand, and showed the message afterwards? whuhhhh

#

like i mean, close enough to what i wanted

#

(this isnt even using eval)

crisp coral
#

oh yea it goes joker_main > after > scoring animation

teal estuary
#

oh, wait, no im just stupid, i forgot balatro doesnt update in the way you think it would 😭

#

yuh yuh

#

it works!

crisp coral
#

just wrap your things in an after event

teal estuary
#

im sorry, i dont know what that is 😭 (also if its just to fix the number thing, tis' all good)

zealous glen
teal estuary
#

oooooh, okay, that helps 😭

#

ty

zealous glen
#

Because it’s applied immediately instead of in-sequence

#

It’s also necessary to account for it even if it’s applied immediately

#

For example, there’s a money and consumable buffer that keeps track of the “true” numbers before scoring Events start executing

#

This avoids your Consumeables overflowing, for example

#

Animation-wise, that’s how vibrating DNA works

teal estuary
#

thats actually very good to know, never knew

zealous glen
#

There’s a built-in function for it

#

juice_until? juice_card_until?

teal estuary
#

second one

nocturne garnet
#

yippee

teal estuary
#

i've got one more hiccup until this thing works perfectly - when it reaches 0, it doesnt delete itself and instead just.. keeps counting down 😭

#

it looks fine to me, but making events is still new to me

nocturne garnet
hybrid iris
#

i have the same question actually

#

this is a,,, weird, error

teal estuary
#

for some reason adding the outlined code made it work????

#

😭

hybrid iris
#

i have finally done it

teal estuary
#

thats sick

hybrid iris
#

to my knowledge, this is the first time this effect has been achieved at this level?

wintry solar
#

How does it work with more than one wild card?

hybrid iris
#

it picks the highest possible hand

#

though i believe it favors left over right?

#

*it also doesnt form like, two pair when its three cards

#

we spent a while trying to debug that

zealous glen
#

Did you reuse the Shortcut code?

hybrid iris
#

for straights?

zealous glen
#

I think some of it could’ve been reused

hybrid iris
#

somewhat, but not really

#

shortcut code is really simple

zealous glen
hybrid iris
#

had to add a lot more checks to make sure that it isnt using the wild card when there's a regular card that could replace it

wintry solar
#

So an ace, a ten, and three wild cards would give the straight?

hybrid iris
#

no, i believe it would give a four of a kind?

#

but in theory yes

wintry solar
#

Oh true

#

Interesting

nocturne garnet
#

can someone tell me why it doesnt say anything?
its SUPPOSED to make the blind say something (this should work normally), and it works for the default fallback when the blind doesn't have any localization, but when it does have localization it just doesnt work?

hybrid iris
teal estuary
#

how difficult would it be to add a new tab for a new set of cards? essentially making a new planet card tab on the collection

hybrid iris
#

as in new planet cards or a new consumable type

teal estuary
#

new consumable type completelt

#

planet cards was an example, its the first thing i thought of 😭

hybrid iris
#

ahh

#

then it should be easy

#

SMODS does it automatically i believe

teal estuary
#

ih wait really? sick

#

just need to learn how to make consumables then 😭

#

next question, is there a way to change something about an entire deck of cards? i specifically want to change every card with a specific rank, in the entire deck, no matter what

crisp coral
#
for _, v in ipairs(G.deck.cards) do
  -- do stuff
end
teal estuary
#

oh damn, thats also super easy

#

ty

hallow forge
lethal stratus
#

is it possible to make specific cards trigger music

mellow sable
#

Yes, see Jimball in Cryptid

hybrid iris
#

where's the mod if i may ask?

#

im kind of interested in seeing how it was implemented

elder vapor
#

is there a way to get all cards in a played hand? regardless if they score or not

mellow sable
#

Loop through G.play.cards

wintry solar
#

Some contexts send it as context.full_hand too

hybrid iris
#

,,,hm
this is a weird edge case

glass crown
#

okay, so weird question related to the decks im making:
how would i go about making planet cards (and any form of leveling) trigger twice?

mellow sable
#

Hook the level up function so it asks to level up twice instead of once

nocturne garnet
#

i forgot that its supposed to be the fucking key 😭

#

i've spent like 2 hours trying to fix this

glass crown
#

does anyone know where the level up function is at? having trouble finding it lol

#

unless i am misunderstanding something fundementally here

#

im very new to this .w.

elder vapor
glass crown
#

yeah, i found how to make something level up twice, now i just need to make it deck specific

#

speaking of, i might as well ask, how would i check what the current deck is? (specifically for the purposes of an if-then checking what the deck is)

tepid crow
#

But you probably only need the G.GAME.selected_back

#

(the other 2 are during deck selection)

glass crown
#
[patches.pattern]
target = "card.lua"
pattern = "level_up_hand(used_tarot, self.ability.consumeable.hand_type)"
position = "after"
payload = """
if G.GAME.selected_back == "vacuum" then
    level_up_hand(used_tarot, self.ability.consumeable.hand_type)
end
"""
match_indent = true```
this, *should* work to duplicate the level up right? im trying it and its not working and im not sure why (the key for my deck is "vacuum" by the way, im assuming the key goes after the equals?)
maiden phoenix
glass crown
#

ohhh i see okay, thank you

tepid crow
glass crown
#

yep, that did the trick! many thanks

#

ill inevitably be back with more questions relatively soon

young dew
#

hello, does anyone know how to get deck config variables in lovely's patches?

#

nvm i figured it out

fluid lagoon
#

did something change with the newest update for calling the amount of options for the deck customizations? am wondering cause I am getting an error in my code when trying to call the number of deck customizations there are

glass crown
#

does anyone have any idea of how id go about getting space joker to level up twice? it doesnt use the same level up function that other level ups use

young dew
#

how can i remove this bit of text from specific cards?

#

i want to make a special card that will have the properties of a wild card without actually being any suit

#

in this context the indication of the suit is useless and i want to remove it

#

oh btw haow can i put text under the +2 chips?

glass crown
glass crown
#

Having a very strange crash, all I'm trying to do is add Omen Globe to a deck, as shown here in the deck's code:

    name = "Undead Deck",
    key = "undead",
    pos = {x = 6, y = 2},
    config = { consumables = { 'c_ankh' }, vouchers = { "v_omen globe" } },
    loc_txt = {
        name = "Undead Deck",
        text = {
            "Start with {C:spectral}Ankh{}",
            "Start with {C:tarot}Omen Globe{}"
        }
    },
    loc_vars = function(self)
        return { vars = { }}
    end,
    atlas = "NegEnhancers"
}```
I tried giving it crystal ball too to see if that fixed the problem, but nothing happened. Anyone know what's going on here?
wintry solar
#

You have a space instead of an underscore in your voucher key

glass crown
#

,,,

#

well thats embarrasing

glass crown
#

thank you!

solid crag
orchid thunder
shell tangle
#

Because you're trying to return from global MC, not a table called MC located in global G.

orchid thunder
#

btw would this work or how can i put thsi into the table

tepid crow
#

yo if you're gonna do screenshots like that just copy paste

elder vapor
tidal ice
#

this is neat

zealous glen
#

Ooh

#

Jimbo Universe

true jasper
#

its been like this for 30 minutes when im trying to publish it to my github

glass crown
#

getting a strange error with this deck below, it only happens when i add the voucher config in. none of my other decks configured to have vouchers do this, so i have no clue whats happening here lmao

    name = "Repetition Deck",
    key = "Repetition",
    pos = {x = 2, y = 4},
    apply = function(self)
        G.E_MANAGER:add_event(Event({
            func = function()
                add_joker("j_ring_master", "negative", true, true)
                return true
            end
        }))
    end,
    config = {vouchers = { "v_reroll_surplus" } },
    loc_txt = {
        name = "Repetition Deck",
        text = {
            "Start with {C:dark_edition}Permanent{} Showman",
            "Start with Reroll Surplus"
        }
    },
    loc_vars = function(self)
        return { vars = { }}
    end,
    atlas = "NegEnhancers"
}```