#💻・modding-dev

1 messages · Page 643 of 1

harsh belfry
#

oh damn weird as shit order

#

editions are before on jokers

#

but after on cards

wild patrol
#

didn't seem to work '

#

but tinkering with it

#

also is the else needed?

harsh belfry
wild patrol
#

if the random number doesn't hit it's still gonna be false wouldn't it?

harsh belfry
wild patrol
#

ah

harsh belfry
#

if it doesn’t set debuff and it already has it will still be

wild patrol
#

what about the SMODS.debuff_card() function?

harsh belfry
#

you should just be preferring smods apis

wild patrol
#

SMODS.debuff_card(card, debuff, source)

#

guessing source would be card.ability.extra.odds

harsh belfry
#

source is just a string

#

not odds

#

???

#

source is the source

wild patrol
#

like I said rusty with lua lol

harsh belfry
#

does it show the debuff at all but doesn’t act like it

#

or does it just not

wild patrol
#

nothing happens

#

let me lower the odds to make sure it's gaurenteed

harsh belfry
#

oh yeah the context if statement needs to be both pre_joker and before a playing card is triggered

#

i am currently out so can’t reasonably make that for you

#

but one N’ has been hovering

wild patrol
#

that's fine

#

I'll tinker

#

atleast I have an idea what i'm supposed to do

harsh belfry
#

notably main scoring does not trigger before the playing card does and therefore debuff should not work I think since it would be debuffing after

wild patrol
#

is it possible to add like a debug text somewhere

#

like to see errors in console that wouldn't typically crash a game

red flower
#

print()

harsh belfry
#

do you have debugplus

wild patrol
#

yeah

harsh belfry
#

cool

#

use print

#

you can use it even without but the lovely console is a bitch and a half to read

wild patrol
#

isn't lovely needed to mod balatro tho lol

harsh belfry
#

yes

wild patrol
#

oh nevermind misread what u said

harsh belfry
#

i say lovely but it’s a love2d thing

#

lovely just reenables it

wild patrol
#

where should I put print()

harsh belfry
#

in the if and else

wild patrol
#

ok

harsh belfry
#

different messages

#

see if either and which print

wild patrol
#

when I spawn the bootleg joker i made

#

just spams the console with g lol

harsh belfry
#

lmfao

#

you printed nothing

#

but also weird

#

like show me the code again

#

with the prints

wild patrol
#

I put it before the if

#

so that might be it lol

harsh belfry
#

eyup

#

calculate gets called so much

wild patrol
#
            if SMODS.pseudorandom_probability(self, 'e_ttv_bootleg', 1, card.ability.extra.odds) then
            print()
                card:set_debuff(true)```
#

gonna try this

#

same thing only this time when I hover over the jokers

#

wait I forgor to remove the old one

harsh belfry
#

okay can literally anyone else help this guy please I literally can’t look up SMODS shit or anything

wild patrol
#

it's fine i'll tinker around

#

the print didn't work

#

i'm gonna just tinker with spaghetti code until something just works

slim ferry
#

source should be a somewhat unique string

wild patrol
#

was actually just about to try

#

because mentioned it earlier

dapper sun
#

how do i get whether the cursor is over a ui node

red flower
dapper sun
#

ty

#

nope

#

wait lemme do some more testing

#

yea nope

red flower
#

ah i just tested and it works for interactable stuff

#

what are you trying to detect

dapper sun
#

hovering over a ui node in an overlay menu

red flower
#

which kind of ui node

dapper sun
#

G.UIT.R

red flower
#

is there a reason

dapper sun
#

to make the colour change when hovered over

red flower
#

there's a config for that im pretty sure

quick scarab
#

hey

dapper sun
#

oh ty

#

nope

#

don't see a config for that listed in the smods documentation

red flower
#

im looking for it

dapper sun
#

thanks

quick scarab
#

I'm trying to make a card that randomly gets a debuff and a buff at the same time but I can't seem to be able to do so without finding some sort of error anyone has any ideia in how to fix this

#
SMODS.Joker {
    key = "nedd",
    blueprint_compat = true,
    rarity = 2,
    cost = 4,
    atlas = 'Joker',
    pos = { x = 8, y = 3 },
    config = {extra = { nedd_buff = 0, nedd_debuff = 0, chips = 400, mult = 50, xmult = 1.30, h_size = 3, hands = 1 } },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = { key = "fnaf_sprite_WIP", set = "Other" }
        return { vars = { card.ability.extra.chips } }
    end,
    calculate = function(self, card, context)

        local hand_size
        local hands
        local chip
        local multi
        local xmulti
        local current_hand_chips = hand_chips
        local current_hand_mult = mult

        if context.setting_blind then

            card.ability.extra.nedd_buff = pseudorandom('neddbuff', 1, 5)
            print(card.ability.extra.nedd_buff)
            card.ability.extra.nedd_debuff = pseudorandom('nedddebuff', 1, 5)
            print(card.ability.extra.nedd_debuff)

            while card.ability.extra.nedd_buff == card.ability.extra.nedd_debuff do
                card.ability.extra.nedd_debuff = pseudorandom('nedddebuff', 1, 5)
                print(card.ability.extra.nedd_debuff)
            end

            if card.ability.extra.nedd_buff == 4 then
                hand_size = card.ability.extra.h_size
            elseif card.ability.extra.nedd_buff == 5 then
                hands = card.ability.extra.hands
            end

            if card.ability.extra.nedd_debuff == 4 then
                hand_size = -card.ability.extra.h_size
            elseif card.ability.extra.nedd_debuff == 5 then
                hands = -card.ability.extra.hands
            end
            G.hand:change_size(hand_size)
            ease_hands_played(hands)
        end

        if context.end_of_round then
            
            if card.ability.extra.nedd_buff == 4 then
                hand_size = -card.ability.extra.h_size
            elseif card.ability.extra.nedd_buff == 5 then
                hands = -card.ability.extra.hands
            end

            if card.ability.extra.nedd_debuff == 4 then
                hand_size = card.ability.extra.h_size
            elseif card.ability.extra.nedd_debuff == 5 then
                hands = card.ability.extra.hands
            end

            G.hand:change_size(hand_size)
            ease_hands_played(hands)

            hand_size = 0
            hands = 0
            chip = 0
            multi = 0
            xmulti = 0
        end

        if context.joker_main then

            if card.ability.extra.nedd_buff == 1 then
                chip = card.ability.extra.chips
            elseif card.ability.extra.nedd_buff == 2 then
                multi = card.ability.extra.mult
            elseif card.ability.extra.nedd_buff == 3 then
                xmulti = card.ability.extra.xmult
            end

            --- debuff
            if card.ability.extra.nedd_debuff == 1 then
                if (current_hand_chips - card.ability.extra.chips) <= 0  then
                    chip = card.ability.extra.chips - (current_hand_chips - card.ability.extra.chips)
                else
                    chip = -card.ability.extra.chips
                end

            elseif card.ability.extra.nedd_debuff == 2 then
                if (current_hand_mult - card.ability.extra.chips) <= 0  then
                    multi = card.ability.extra.mult - (current_hand_mult - card.ability.extra.mult)
                else
                    multi = -card.ability.extra.mult
                end
            elseif card.ability.extra.nedd_debuff == 3 then
                xmulti = 1-card.ability.extra.xmult
            end
            return {
                chips = chip,
                mult = multi,
                xmult = xmulti,
            }
        end
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-1*hand_size)
        ease_hands_played(-1*hands)
    end
}
#

I was trying to implement something to stop the card into making the player's score go to the negative, but that failed.
And I had also placed something so that when I get rid of the card the effects are removed.
It kinda didn't work out.

#

crash log for when you remove the card

red flower
# dapper sun thanks

hmm no it doesnt seem to detect hover unless its an object or button
maybe you can make it a dummy button?

dapper sun
#

wdym dummy button?

#

also it does have a button callback

red flower
#

oh then its weird the first thing didnt work

#

can you add a func to it and check e.states.hover.is?

dapper sun
#

ok

#

it works now tyyy

viscid light
#

i know that Joker sprites are 71 by 95 but I think theres supposed to be an empty border around each sprite, right? like this?

dapper sun
#

yea

viscid light
#

okay, cool

#

thanks :>

vale zinc
#

When I call this custom context, it kicks in immediately after "Play Hand" is pressed. How do I make sure it only happens when G.FUNCS.draw_from_play_to_discard() is called?

local old_draw_discard = G.FUNCS.draw_from_play_to_discard
G.FUNCS.draw_from_play_to_discard = function(e)
    SMODS.calculate_context({LAPSEMS_after_played_hand_has_scored = true})
    old_draw_discard(e)
end
red flower
#

it should only be called then

normal crest
#

That means clicking the play hand button calls that function

#

Or it leads to it being called

vale zinc
#

For stuff that I want to happen after a hand has finished scoring, I have to put it in an event with trigger = 'after'. Is there any workaround to that, say, in the context definition itself?

wild patrol
#

well i'm getting somewhere

#

lol

red flower
vale zinc
red flower
#

ah

lethal belfry
#

alright what determines load order exactly. i thought these were doing that, but apparently they aren't sorting anything

red flower
#

you need an event

#

there's no real way around it

wild patrol
#

well the debuff sorta works

#

but seems the odds get ignored

viscid light
#

not too bad, in my opinion

#

needs a bit more detailing but eh

red flower
lethal belfry
#

i see

red flower
#

you can 1) instead of looping through the folder make a list of filenames and loop through that or 2) be lazy like me and add numbers to your filenames

lethal belfry
#

alright if it's just the file names then that's doable

#

i can't believe somehow 11 comes before 1 so i have to put 01. that's so stupid

red flower
#

well thats is alphabetical lol

viscid light
#

me trying to use Balatro black and it gave me this

stoic void
#

sorry for being annoying

storm kraken
#

what

viscid light
#

-# sorry

gaunt folio
#

how can I make this work? Its supposed to be in pool only if you have a six-seven rank (yes, I know, I know), but it shows up in a standard 52 deck

spiral mural
#

how do i tell that a card is a playing card

unkempt bronze
#

May I have a playtester?

#

Also, the following bit of code isn't working

#
         if context.yes_is_no == true then
           if context.individual and context.cardarea == G.play then
            G.GAME.xiferp_lineseven_xmult = (G.GAME.xiferp_lineseven_xmult or 1) + 5
            local destructable_jokers = {}
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= card and not SMODS.is_eternal(G.jokers.cards[i], card) and not G.jokers.cards[i].getting_sliced then
                    destructable_jokers[#destructable_jokers + 1] =
                        G.jokers.cards[i]
                end
            end
            local joker_to_destroy = pseudorandom_element(destructable_jokers, 'coronium_poisoning')
            if joker_to_destroy then
                xiferp_xif_x = joker_to_destroy.config.center.rarity - 1
                      print "card making time~!"
                      SMODS.add_card { set = "Joker", rarity = xiferp_xif_x }
                      SMODS.add_card { set = "Joker", rarity = xiferp_xif_x }
                joker_to_destroy.getting_sliced = true
                G.E_MANAGER:add_event(Event({
                    func = function()
                        joker_to_destroy:start_dissolve({ G.C.RED }, nil, 1.6)
                        return true
                    end
                }))
            end
        end
        end
        if context.individual and context.cardarea == G.play then
            if SMODS.pseudorandom_probability(card, 'c_xiferp_coronium', 1, card.ability.extra.odds) then
                SMODS.destroy_cards(card, nil, nil, true)
                SMODS.add_card({ key = 'c_xiferp_comykelium' })
        end
    end
end
}```
#

It's not accessing the "card making time~!" line

shell timber
#

whats context.yes_is_no

unkempt bronze
#

It's what I use on occasion for delayed usage

white hull
#

also it should be print("your line")

unkempt bronze
dawn granite
#

or smth like that idk

#

you might just wanna fix the line first tbh

unkempt bronze
#

they weren't working before I added the print line

#

Yea, line's right but still doesn't work

dawn granite
#

ah right

#

i'm only like just learning lua myself so i only know a couple things tbh

wild patrol
#
    key = 'bootleg',
    shader = 'holo',
    prefix_config = {
        -- This allows using the vanilla shader
        -- Not needed when using your own
        shader = false
    },
    config = {
        extra = {
            odds = 1
        }
    },
    in_shop = true,
    apply_to_float = false,
    sound = { sound = "ttv_fart_sound1", per = 1.2, vol = 0.4 },
    disable_shadow = false,
    disable_base_shader = false,
    loc_txt = {
        name = 'Bootleg',
        label = 'Bootleg',
        text = {
            [1] = '{C:green}1 in 2{} chance to fail'
        }
    },
    unlocked = true,
    discovered = true,
    no_collection = false,
    get_weight = function(self)
        return G.GAME.edition_rate * self.weight
    end,
    

--    loc_vars = function(self, info_queue, card)    
--        local new_numerator, new_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'e_ttv_bootleg') 
--        return {vars = {new_numerator, new_denominator}}
--    end,

    calculate = function(self, card, context)
    if context.pre_joker or (context.main_scoring and context.cardarea == G.play) then
            if SMODS.pseudorandom_probability(card, 'e_ttv_bootleg', 1, card.ability.extra.odds) then
                card:set_debuff(true)
            else
                card:set_debuff(false)
            end
        end
    end
}```
#

tried the pseudorandom but error just says my local denominator is a nil value

slim ferry
#

card.ability doesnt work because its an edition and not a card

#

it chould be card.edition

#

well

#

its card.ability in collection but not in game

#

im pretty sure

wild patrol
#

I think i've tried that before in previous attempts i'll try again

dawn granite
#

does anyone know how to make it so you can make a tag out of another tag
i don't mean something like double tag where it makes a copy, i mean a tag that just makes a random tag (either just purely randomly or from a specific set of tags)

wild patrol
#

3 hours

#

finally

#

it works

#

now to see if the odds actually work

wild patrol
#

the odds work

#

Finally

slim ferry
#

that youre using

unkempt bronze
#

of the yes_is_no?

slim ferry
#

yes

shell timber
#

i can almost guarantee its not a context

unkempt bronze
#

in the code of the rest of the card

slim ferry
#

can you

#

show that

shell timber
unkempt bronze
#

that's not the issue line!

shell timber
#

no it is

unkempt bronze
#

The issue line is it won't make new jokers

slim ferry
#

can you just show where the context is defined

unkempt bronze
#

whole card in code

slim ferry
#

im not seeing a context

shell timber
#

so its not context.yes_is_no

slim ferry
#

getting defined

#

yeah

shell timber
#

it should be card.ability.extra.yes_is_no

unkempt bronze
#

simple fix

#

any other issues?

shell timber
#

you should try learning how to debug your code

slim ferry
#

you should also https://tryitands.ee sometimes because i can guarantee you that people wont find every single issue in your code immediately

unkempt bronze
#

I'm gonna try it

#

also, may I have a playtester for the current version?

unkempt bronze
#

lemme get a bit a code

unkempt bronze
#

({ key = pseudorandom_element({ 'c_xiferp_scandium', 'c_xiferp_gallium', 'c_xiferp_germanium', 'c_xiferp_technetium', 'c_xiferp_hafnium', 'c_xiferp_rhenium', 'c_xiferp_polonium', 'c_xiferp_astatine', 'c_xiferp_francium', 'c_xiferp_radium', 'c_xiferp_actinium', 'c_xiferp_protactinium' }, 'Prediction_Order' )} ) something like this, but with tags?

slim ferry
#

this should work

slim ferry
#

hardcoding every tag is also like not happening

unkempt bronze
#

yeah, Imma just work on my own mod

dawn granite
# slim ferry this should work

so where it says selected_tag is where the key for the tag would be right
sorry if this is like blitheringly obvious i'm just very tired right now

slim ferry
#

yeah

dawn granite
#

if i wanted to make it so it randomly picked like one of 5 tags how would i go around that

slim ferry
#

you can just skip the get_current_pool stuff then and do a pseudorandom_element on a table of the tag keys to get the selected tag

dawn granite
#

so here in the example code the table would go into

slim ferry
#

tag_pool

dawn granite
#

i'm so tired i keep forgetting where vs code is 😭

#

so, like this?

slim ferry
#

yeah

#

well the keys should be strings

#

but besides that yeah

dawn granite
#

ah right gotcha

#

dunno how i didn't realise that

unkempt bronze
#

May I have a playtester?

#

(ping if interested)

wild patrol
#

Is there a decent way to visually edit a shader in balatro?

#

to make a custom one

slim ferry
#

shadertoy is like the closest thing i think

#

or you can use debugplus watch shader which allows updating the shader in real time iirc

#

though i forgot how that command works exactly

dawn granite
#

have i put this in wrong or something?

wild patrol
#

I tried shadertoy but I gues i can't just copy paste the shader code into the website to get a visual version

#

wanna see if I can get a shader to look like this

#

to give that real bootleg stank

red flower
#

idk where you want it but it should be inside a function

gusty sequoia
#

Is there a way to make it where the message says +X mult?

(With X being replaced with the variable number thing)

red flower
gusty sequoia
#

it says +nil, but it's progress

red flower
#

you need to replace variable with your variable

gusty sequoia
#

Ah, thanks

#

It worked, thanks :D

hidden notch
#

I used CardArea:handle_card_limit() to increase my Card-Area Limits, I noticed that the function has fundamentally changed and I'm unsure on how to increase/decrease Card-Areas correctly now... Any tips?
I used it to simply increase an Areas limit but I also used it to fill up 2 additional slots (Basically a Joker that uses both Joker-Slots and Consumable Slots)

red flower
#

wasnt it always just CardArea:change_size?

hidden notch
#

That's for simply increasing/decreasing the Total -> I can use that yeah
But what about the Extra-Slot thingy?

red flower
#

i think you need to hook CardArea:count_property and increase the return of extra_slots_used by 1 for the area the card is not in

wintry solar
#

what is this function called within?

hidden notch
#

I'm upgrading from 0827c and the function used to take parameters: CardArea:handle_card_limit(card_limit, card_slots)

wintry solar
#

yeah but whats the full context of the snippet you shared

hidden notch
#

That snippet is in the "Remove-From-Deck" function, and the Adding part is a conditional "On Blind Start"

#

I also have another Joker that used it like this:
-# Yes I know I commented out the wrong part in the remove-function

wintry solar
#

yeah, I think you should just use CardArea:change_size and word your effects accordingly

hidden notch
#

I'm gonna say it: I don't like that approach

#

Can I not edit the Extra-Slots used of another Area?

harsh belfry
#

i mean

wintry solar
#

no, it'll be auto recalculated

harsh belfry
#

i'm sure you can hook and do some funny stuff

#

-# you know, where its calculated

hidden notch
#

I don't quite get why that was removed, it was honestly really nice to not just outright remove the slots :/

wintry solar
#

because it didn't work properly

harsh belfry
#

well its fairly obvious it was not meant to be a public api, no?

#

stability is not what you expect

hidden notch
#

It not being public doesn't really count when I recall having been told to look at the code for things shrug_yui
Like, I don't wanna be mean here, I was just really surprised that the functionality is gone x'3
Sadge that it didn't work properly, I'll change the Flavour of my Cards then :(

harsh belfry
#

no you can still totally do it

#

just hook the function

wintry solar
#

oh yeah you could do that

red flower
#

this works fine

hidden notch
red flower
hidden notch
wintry solar
#

the code N sent in the image

#

just do that

#

it does exactly what you want it to do

harsh belfry
hidden notch
#

I am not that quick chill 😢

hidden notch
#

Yeah that will work wonderfully, Thank you @red flower!

wintry solar
#

unless it was hidden with a permanent_properties table within the cardarea or something

red flower
#

makes sense

gaunt folio
#

reposting, I'm trying to make a joker in pool if theres a specific rank in deck, but this code doesn't work?

red flower
#

the in_pool seems to be nested inside another function

gaunt folio
#

ah

#

ill try fixing htat

#

i think i see what i did wrong actually

#

yep i found it

#

fixed now

sly finch
#

Can somebody please tell me what's the context that checks if a playing card or card in hand is retriggered?

#

Not when a Joker is retriggered, only for when a playing card or card in hand is retriggered...

red flower
#

I don't think there's one but I might be wrong

sly finch
#

Dang...

grizzled tide
#

hey is there a mod which lets you add jokers into your joker slots for debugging?

grizzled tide
#

thx

sage crater
# sly finch Dang...

you can probably do something where you check if a card is triggered once, store that card ID somewhere, and then if a second trigger happens check it against the stored IDs and if it’s on that list, do something (and if not, add it to the list).
Then at the end of a round, clear the list.

spiral mural
#

how do i see what cards are highlighted WITHOUT knowing the card area

harsh belfry
#

i am sure you can figure it out from there

#

just loop through em

#

though like

sly finch
harsh belfry
#

manually specifying what areas is usually better

#

what is this for

spiral mural
#

i'll never tell

harsh belfry
#

tricky...

sage crater
#

assuming the right card trigger context is available

sly finch
#

As of right now, I don't know how to store the Card ID...

buoyant crag
#

how do you properly format a pattern for a patch file? new to it and it seems it never finds the line i give it no matter what i do

red flower
#

it needs to be the full line

#

also make sure you're checking Mods/lovely/dump instead of the vanilla files

#

because that's post-smods patches

buoyant crag
grizzled tide
#

guys, how do you get the name of a joker 😭

red flower
grizzled tide
#

thanks!

#

im sorry if this is a little obtuse but, whats the set/key for jokers?

red flower
#

Joker

#

the key you need to get from the joker itself

grizzled tide
#

sorry, im a little lost

#

i have the joker itself saved as a variable

frosty rampart
#

the key of a joker is unique to the specific joker
you can get it from a card object with card.config.center.key, where "card" is whatever variable you have the joker saved as

grizzled tide
#

thanks!

grizzled tide
#

btw, is there a mod which has a pretty good example of hooking onto set ability? i understand the very general concept of hooking, but I want to attach an additional line after the calculate function of whatever I transformed the joker into

#

that or at least calculate from using the joker key

frosty rampart
#

what's the goal exactly?

grizzled tide
#

I want to make a joker which acts like the most recently bought joker

red flower
#

does it have to be the most recent you own or even if you sell it

grizzled tide
red flower
#

good luck

glossy stone
#

gl mate

grizzled tide
#

😨

#

oh im cooked then

frosty rampart
#

yea that's gonna be tricky

glossy stone
#

meanwhile i havent played in a year and i IMMEDIATELY wanna come back to modding to revive a modpack i made which got wiped out when my computer broke

#

yatta

grizzled tide
#

been spending a stupid amount of time just to have this without the copying part 😭

#

is there a way to save a joker in a variable without being lost when exiting?

#

or an object in general really

mystic river
#

there is not
however, if you know the object will be saved somewhere, you can use a load function to restore the connection

grizzled tide
#

ah

#

ok uh- is there a way to run a joker with just its key 😭

frosty rampart
#

ortalab has pinkprint, which is fairly similar (copies ability of most recently sold joker)
you can try to reference how it works, but it's really confusing from just a glance lmao

grizzled tide
#

i was trying to read this to see if i could get somewhere 😭

quick scarab
#

I attempting to make my card description changes on the fly, but I have encountered a problem where it's simply isn't localizing the text, despite localizing stuff already in the games code, like k_plus_joker normally, any help?

#
SMODS.Joker {
    key = "nedd",
    blueprint_compat = true,
    rarity = 2,
    cost = 4,
    atlas = 'Joker',
    pos = { x = 8, y = 3 },
    config = {
        extra = {
                buff_description = localize('k_plus_joker'), -- 1
                debuff_description = localize('k_plus_joker'), -- 2
                nedd_buff = 0, nedd_debuff = 0,
                chips = 400,
                mult = 50,
                xmultplier = 0.70,
                h_size = 3,
                hands = 1
            }
        },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = { key = "fnaf_sprite_WIP", set = "Other" }
        return { vars = { card.ability.extra.buff_description, card.ability.extra.debuff_description } }
    end,

end
 
j_fnaf_nedd = {
   name = "Nedd Bear",
   text = {
       "Gives a random", 
       "{C:chips}Bonus{} and {C:red}Debuff{}", 
       "when {C:attention}Blind{} is selected",
       "",
       '#1#',
       '#2#',
   },
},

misc = {
  dictionary = {
      k_fnaf_nobuff = "No Buff Selected",
      k_fnaf_nodebuff = "No Debuff Selected",
  
      fnaf_va = "Voicelines for cards",
      fnaf_va_volumeslider = "Volume for voicelines",
  },
}
wild patrol
#

which one u think is better

#

still trying to figure out how to add randomness to the single one

quick scarab
# wild patrol

you can make both seperate commands, with the one wiping out the hand have a higher price or something

wild patrol
#

if I add them both I wanna make an opposite that adds random cards

#

trying figure that out that out

#

I got jokers

grizzled tide
#

ok

#

so

#

i found a "workaround"

#

and its much cooler

#

nvm it doesnt work 😭

wild patrol
#

wonder if it be possible to make a command that rotates the game ui

vale zinc
#

This code is adapted from Midas Mask, but even though it turns the last played hand into Stone Cards, it does so immediately with no animation. What must I do differently?

calculate = function(self, blind, context)
    if not blind.disabled then
        if context.after then
            G.E_MANAGER:add_event(Event({
                trigger = 'before',
                delay = 0,
                func = function()
                    if (G.GAME.chips >= G.GAME.blind.chips) then
                        local _,_,_,scoring_cards,_ = G.FUNCS.get_poker_hand_info(G.play.cards)
                        for _, scored_card in ipairs(scoring_cards) do
                            scored_card:set_ability(self.config.extra.mod_conv, nil, true)
                            G.E_MANAGER:add_event(Event({
                                func = function()
                                    scored_card:juice_up()
                                    return true
                                end
                            }))
                        end
                        return {
                            message = localize('k_lapsems_bl_mage'),
                            colour = blind.boss_colour
                        }
                    end
                    return true
                end
            }))
        end
    end
end,
grizzled tide
#

does anyone know how to apply a custom sticker

#

(this gives me an error, even though my prefix is lemon)

daring fern
grizzled tide
#

thanks! so for me it would be card:add_Sticker('lemon_s_mimic') right?

#

add_sticker*

daring fern
grizzled tide
#

sweet thanks

harsh belfry
#

well

#

if they were already having an error

#

this shouldn't fix it

#

you can directly call it and it'll work

#

its just that the add_sticker does one other thing

#

but this shouldn't solve the error

#

also it calls the should apply functions and such

#

which may cause further issues if they are not defined correctly

#

though actually considering the nil checks the error should be "resolved"

harsh belfry
#

instead of the center

grizzled tide
#

i saw someone else doing that- does it change anything?

harsh belfry
#

well from my knowledge it shouldn't work?

#

the source code doesn't seem to handle it

#

from a glance

grizzled tide
#

huh

#

no idea why mine works then

#

ill still change it just in case

harsh belfry
#

oh smods explicitly handles it

#

either way considering you have the center right there

#

no reason to use the key

red flower
# vale zinc This code is adapted from Midas Mask, but even though it turns the last played h...

what about this

calculate = function(self, blind, context)
    if not blind.disabled then
        if context.after then
            local scoring_cards = context.scoring_hand
            for _, scored_card in ipairs(scoring_cards) do
                G.E_MANAGER:add_event(Event({
                    func = function()
                        if (G.GAME.chips >= G.GAME.blind.chips) then
                            scored_card:set_ability("m_stone")
                            scored_card:juice_up()
                        end
                        return true
                    end
                }))
            end
            if (G.GAME.chips >= G.GAME.blind.chips) then
                return {
                    message = localize('k_lapsems_bl_mage'),
                    colour = blind.boss_colour
                }
            end
        end
    end
end
#

wait i mispasted something

#

there

grizzled tide
#

wait

#

no nvm i thought i realized smth

harsh belfry
#

oh thats funny because the nil check should prevent that

#

ah

#

you are explicitly bypassing that check

#

explains why the error can even appear, then

#

but your sticker key is seemingly incorrect

grizzled tide
#

i dont know how im bypassing it-

harsh belfry
#

true is bypassing the check
you SHOULD be

#

its just its crashing since your key is invalid in some way

vale zinc
grizzled tide
#

but its just prefix in json _ stickerid no?

harsh belfry
#

well, yes i believe so

#

perhaps the s_ is screwing with that

harsh belfry
#

in the key

red flower
#

does it have to show a message for each

grizzled tide
#

ok ill try keeping it smimic then

vale zinc
harsh belfry
#

this is not like a "i KNOW that is the issue"

#

it is just a guess

grizzled tide
#

ofc ofc

#

a guess is better than nothing

red flower
grizzled tide
#

(ignore error, its because of something else)

red flower
# vale zinc No, just the one.

there, it broke when i moved the message

calculate = function(self, blind, context)
    if not blind.disabled then
        if context.after then
            local scoring_cards = context.scoring_hand
            for _, scored_card in ipairs(scoring_cards) do
                G.E_MANAGER:add_event(Event({
                    trigger = "after",
                    delay = 0.7,
                    func = function()
                        if (G.GAME.chips >= G.GAME.blind.chips) then
                            scored_card:set_ability("m_stone")
                            scored_card:juice_up()
                        end
                        return true
                    end
                }))
            end

            if (G.GAME.chips + SMODS.calculate_round_score() >= G.GAME.blind.chips) then
                return {
                    message = localize('k_lapsems_bl_mage'),
                    colour = blind.boss_colour
                }
            end
        end
    end
end
vale zinc
grizzled tide
feral tree
#

how do i get :is_suit() to count debuffed cards of a suit?

red flower
#

:is_suit(suit, true)

grizzled tide
#

alright, i do want to add a little polish, how do i start a flip animation?

red flower
#

or something

grizzled tide
#

sweet, thanks

#

uh

#

this wouldnt cause errors if someone spam buys righ-

red flower
#

no why would it

grizzled tide
#

kk

red flower
#

it might look jank as it flips a million times

#

i have a similar transformation thing in my mod and i removed the flip animation for that reason

grizzled tide
#

o

#

noted

#

luckily (most) games you don't buy jokers that rapidly and in those amounts

grizzled tide
#

alright what does it mean for the whole game to close out without a crash repor-

daring fern
grizzled tide
red flower
daring fern
#

glass scaffold
#

So I took the advice of throwing the addition into an event function. Still nothing happening.

#

I've tried every single context that would make sense (joker_main, after, and another one I forgot)

daring fern
glass scaffold
daring fern
glass scaffold
#

But that was hilarious to me that it kept adding

frosty rampart
#

like i told you last time this happened, G.GAME.chips doesn't update until well after a hand finishes calculating, so on the first hand of a round you'll always just be trying to add 10% of 0 = 0
events will continuously re-run the function until it returns true, which is why you get the infinite behavior if you remove a return true

glass scaffold
frosty rampart
#

.

glass scaffold
# frosty rampart .

Yeah, I'm gonna try that rn. Should have earlier, but had work and forgot the next day.

glass scaffold
# frosty rampart .

Well, the code works. It's adding the chips a little too early, but that can probably be fixed by using an event.

frosty rampart
#

yea the event should get the timing done properly

glass scaffold
#

GitHub needs a contributor thing so I can throw you on there for that code.

gilded blaze
#

score modifications should be in context.after imo

#

it's a lot easier to work that way

glass scaffold
gilded blaze
#

I may be a contributor, but I still write my own function for that

#

then integrate it into calculation pipeline so that I can simply return something like {sgt_ascore = 300} to add 300 to score

jolly pivot
#

how would i let other jokers know if a specific joker is in the joker area

sturdy compass
#

you can check for other_joker.area == G.jokers

#

other_joker is a placeholder in this case

jolly pivot
#

okay sooo

#

if i want joker_a's effect to double if joker_b is also present,

sturdy compass
#

What exactly are you trying to do

jolly pivot
#

something tells me just checking for "joker_b".area wouldnt work

jolly pivot
#

i was originally making it retrigger them but that wasnt working exactly how i wanted it to

#

so now im trying to add a check for that joker in each of those specific jokers' code

#

to double the actual values while its present

sturdy compass
#

In that case, use next(SMODS.find_card('joker_key'))

jolly pivot
#

what would be the code surrounding it? imm a bit rusty so im having trouble visualizing how exactly thatll work

#

is it in some specific context?

sturdy compass
#

That code snippet would essentially act as a conditional

jolly pivot
#

i see

#

so just an if statement

sturdy compass
#

Hmm, I'm thinking about it more and it may be a lot more difficult to do what you wanna do than you might think because of edge cases

#

Plus I do not know the code you're working with

jolly pivot
#

i was planning to just put the check in the calculate function i already have set up to use twice the value than normal

sturdy compass
#

That'll probably work actually

#

Or if you wanna get really fancy, you can do effect_value * (next(SMODS.find_card('joker_key')) and 2 * #SMODS.find_card('joker_key') or 1) to make it work with multiple copies

jolly pivot
#

this is the only one that im confused about.
and another one thats nearly the same code as this.

#

because i think i have to make it loop the whole thing

#

actuallyy

#

hm

#

might not cause issues?

#

i wrote this code a while ago i apologize

daring fern
#

glossy stone
#

i wanna come back to balatro modding but i havent done that in like a year and all my stuff got wiped out

as the most washed person in this chat how do i start

jolly pivot
#

the worst mistake you can make is starting without a plan

sturdy compass
glossy stone
#

i alr have like

#

half? of the arts

#

still remainng

#

and i still remember all the jokers i implemented

#

i had 12 back then :(

jolly pivot
#

this is why you keep your stuff backed up on github or something similar

glossy stone
#

this was like a year ago

#

but yea ig

jolly pivot
sturdy compass
#

Yes

jolly pivot
#

i have no reason to not make it blueprint compatible then

loud citrus
#

how do i find the blind of the current anti without being within the blind

sturdy compass
#

Actually hmm

#

I’m not sure

#

It’s worth trying blueprint to see

sturdy compass
daring fern
jolly pivot
#

ic

#

i think id rather just make it incompatible than figure out a way to make it count blueprints

wild patrol
#

Bootleg Lucky Cat

glossy stone
#

Quick stupid question since I haven't modded in a damn year, we still use spritesheets like back then right

#

just wanna make sure

round lion
#

yep

#

but i think you can now use animation atlases on more things

glossy stone
#

okay nice nice

wild patrol
#
    key = 'bootleg',
    shader = 'holo',
    prefix_config = {
        -- This allows using the vanilla shader
        -- Not needed when using your own
        shader = false
    },
    config = {
        extra = {
            odds = 1
        }
    },
    in_shop = true,
    apply_to_float = false,
    sound = { sound = "ttv_fart_sound1", per = 1.2, vol = 0.4 },
    disable_shadow = false,
    disable_base_shader = false,
    loc_txt = {
        name = 'Bootleg',
        label = 'Bootleg',
        text = {
            [1] = '{C:green}1 in 8{} chance to fail'
        }
    },
    unlocked = true,
    discovered = true,
    no_collection = false,
    get_weight = function(self)
        return G.GAME.edition_rate * self.weight
    end,
    

--    loc_vars = function(self, info_queue, card)    
--        local new_numerator, new_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'e_ttv_bootleg') 
--        return {vars = {new_numerator, new_denominator}}
--    end,

    calculate = function(self, card, context)
    if context.pre_joker or (context.main_scoring and context.cardarea == G.play) then
            if SMODS.pseudorandom_probability(card, 'e_ttv_bootleg', 1, card.edition.extra.odds) then

            end
        end
    end
}```
#

reworked the bootleg abit

#

it disables the card.ability.extra.xChips = (card.ability.extra.xChips) + 0.25 with the 1 odds

daring fern
#

wild patrol
#

but I want it to disble the xchip mult and other abilities if the roll hits the odds

wild patrol
#
    key = 'bootleg',
    shader = 'holo',
    prefix_config = {
        -- This allows using the vanilla shader
        -- Not needed when using your own
        shader = false
    },
    config = {
        extra = {
            odds = 8
        }
    },
    in_shop = true,
    apply_to_float = false,
    sound = { sound = "ttv_fart_sound1", per = 1.2, vol = 0.4 },
    disable_shadow = false,
    disable_base_shader = false,
    loc_txt = {
        name = 'Bootleg',
        label = 'Bootleg',
        text = {
            [1] = '{C:green}1 in 8{} chance to fail'
        }
    },
    unlocked = true,
    discovered = true,
    no_collection = false,
    get_weight = function(self)
        return G.GAME.edition_rate * self.weight
    end,

    calculate = function(self, card, context)
    if context.pre_joker or (context.main_scoring and context.cardarea == G.play) then
            if SMODS.pseudorandom_probability(card, 'e_ttv_bootleg', 1, card.edition.extra.odds) then
                SMODS.calculate_effect(card.ability.extra, card)
            end
        end
    end            
}```
#

anything else I can try? I've tried SMODS.card_effect calculate_effect

#

or does the pseudorandom calculations only work in the jokers effects

red flower
quick scarab
stiff locust
#

nested means folder inside a folder

#

in this context

#

i think

red flower
#

it should be

return {
     misc = { ... }
}
quick scarab
#

Since I want to translate the text in other languages

#

But it worked for another joker when I wanted him to return a message similar to stone joker

red flower
quick scarab
red flower
#

oh wait i think i know what it is

#

are you putting the localize straight to config.extra like in the code you shared?

#

vanilla localization is probably loaded by then but not your mod's

quick scarab
#

Probably, can you double chack I just pushed the thing now so you can see it on the code

red flower
quick scarab
red flower
#

9 hours ago is not just pushed

quick scarab
#

ok its not important

quick scarab
#

either on pt_br or en-us it works

#

it localizes the message whenever I add a new card like stone joker

red flower
#

you need to use localize in loc_vars instead

quick scarab
stiff locust
#

just if you're in a round or not

red flower
#

G.GAME.blind.in_blind

stiff locust
#

oh thats quite simple

red flower
elder rune
quick scarab
#

it's this guy

elder rune
#

same game

long sun
#

is there currently an easy way to draw a shader on a deck?

#

i'd like to either use a draw function on the deck, or define a parameter

#

i tried to write a draw function but it's not working

#
draw = function(self, back, layer)
    back.children.center:draw_shader('booster', nil, back.ARGS.send_to_shader)
  end,```
daring fern
long sun
#

darn

#

i am not good at those :3 lemme see

red flower
#

that does it i think

long sun
#

omg

#

wait this is like

#

the thing

#

:3

#

lemme look at this, thanks

#

hmm

SMODS.DrawStep {
  key = 'deck_shader',
  order = 5,
  func = function(self)
    if self.children.back then
      local cback = self.params.galdur_back or (not self.params.viewed_back and G.GAME.selected_back) or
          (self.params.viewed_back and G.GAME.viewed_back)
      if cback then
        local shader = nil
        if cback.effect.center.phanta_deck_shader then shader = cback.effect.center.phanta_deck_shader end

        if (shader and (self.config.center.set ~= "Sleeve"))
            -- not the stake select from galdur or the stake chips
            and ((self.area and not self.area.config.stake_select and not self.area.config.stake_chips) or not self.area) then
          local t = (self.area and self.area.config.type == "deck") or self.config.center.set == "Back"
          if t and not self.states.drag.is then self.ARGS.send_to_shader = { 1.0, self.ARGS.send_to_shader[2] } end

          self.children.back:draw_shader(shader, nil, self.ARGS.send_to_shader, t, self.children.center, 0, 0)
        end
      end
    end
  end,
  conditions = { vortex = false, facing = 'back' }
}```
#

i'm not quite sure what this crash means

red flower
#

i think the shader is missing the prefix

long sun
#

o

#

oh yeah

#

true this is a custom one

#

huzzah! it works for this one

#

not quite here though

#

but that's because it has a hole in it

red flower
#

you probably need to draw the shader on every card

long sun
#

oh the problem is the card's base shader is being rendered too

#

you can see on the first deck that all the cards are shiny

#

would i have to patch to get the deck to not render its base shader?

#

or is there like, an option in the drawstep or elsewise

#

-# i don't know why there would be an option there but

wintry solar
#

uhhh there's a property you can set

long sun
#

(which is? :3)

wintry solar
#

card.ignore_base_shader = {deck = true} something like this, but it's probably mega jank with when the cards are drawn face up

#

let me look a bit closer

long sun
#

alr 👍

wintry solar
#

you can hook Card:should_draw_base_shader too

long sun
#

ah

#

ah yeah i'll do that then

#

that sounds more reliable

#

-# ish

wintry solar
#

hmmm

#

maybe not

#

this seems to only be for the center and front of cards

long sun
#

aw

wintry solar
#

this is the relevant drawstep

primal robin
#

Yo salty ghost

long sun
#

hihi

stiff locust
#

how to undebuff cards and how to flip cards
id like to undebuff every card and flip them all face up

#

which also means checking if theyre flipped

#

isnt that like card.flipped

red flower
#

card.facing == 'back'

#

card:flip() to flip

daring fern
#

smoky holly
#

do orbital tags just automatically pick a random hand when created via a joker effect?

red flower
#

they do now i think

stiff locust
#

im sure you could access and change the value of the tag right after you make it

#

force it to be whatever hand

loud summit
#

i assume its in its set_ability

smoky holly
#

nah i was just curious since we were avoiding making them out of worry it could cause problems

#

but hell yeah

red flower
#

i think it got fixed in like the latest smods or something

wintry solar
#

yeah I think it did

stiff locust
#

the key of the mars planet would be "c_mars" right

#

or is it p for planets specifically

red flower
#

its c yeah

stiff locust
#

well then im stumped

#

checking
if context.using_consumeable and context.consumeable.key == "c_mars" then

isnt passing when using mars

#

im guessing its not just .key and its like

#

.config.center.key or something

#

couldve sworn

#

oh thats definitely it

red flower
stiff locust
#

ok new different issue

#

when i use level_up_hand to level up a hand the level text and chips/mult values get stuck on screen

tardy pecan
#

Hello everyone! Help me install Lovely for Balatro. Error: Balatro.exe - System Error
Cannot continue code execution because the system did not detect C:\Windows\System32\version.DLL. To fix this problem, try reinstalling the program. My antivirus is turned off. What's wrong? I downloaded everything from GitHub.

stiff locust
#

i want it to not do that

frosty rampart
#

use SMODS.smart_level_up_hand

red flower
stiff locust
#

ok which is it

#

upgrade or smart

red flower
#

smart is for back compat now iirc

stiff locust
#

right so which one should I be using

frosty rampart
#

ah right
use SMODS.upgrade_poker_hands

red flower
stiff locust
#

also other thing

#

is there any easier way to level up every hand

frosty rampart
#

utility page on the wiki should probably be updated to document upgrade_poker_hands then

red flower
stiff locust
#

oh awesome

red flower
#

it wont do the black hole animation tho

frosty rampart
#

here's the documentation for upgrade_poker_hands from the 1221a release post

stiff locust
#

how recent is that version

#

im not good at keeping on top of smods updates

red flower
#

december 21 a

frosty rampart
#

(the latest version is 1224a but that was just a few bugfixes, released on dec 24)

stiff locust
#

i gotta update then

stiff locust
#

is it because of instant

#

this effect could be really annoying if its not instant

#

ok its not cause of instant

red flower
#

no idea honestly

#

it shouldnt do that

stiff locust
#

uhh

#

every planet card is doing this now

#

even without the joker with the effect

#

is this just an smods bug

#

could be engulf's fault

#

its not engulf

#

does this happen to anyone else or just me

red flower
#

did you start a new run

stiff locust
#

yes

red flower
#

hmm no idea

stiff locust
#

it might be my nopeus speed but i doubt it

#

oh that is it

#

is there a nopeus alternative yet

#

the text gets stuck if you have fast forward set to planets or higher

red flower
stiff locust
#

oh handy has it?

#

it doesnt seem like handy has it

#

or i cant find it

red flower
#

handy settings are complicated

frosty rampart
#

page 2 of quick actions

stiff locust
#

ok i think

#

my handy is just so outdated

#

that it doesnt have the speed settings

#

lol

frosty rampart
#

latest version is 1.5.1o

stiff locust
#

yeowch

#

ill update

red flower
#

oh its also here

frosty rampart
#

oh yea there it is

red flower
#

also smodsless jokerdisplay

#

i need to figure out how to load localization

stiff locust
#

what do i do with the lovely.toml file here

wind steppe
#

keep it in there

stiff locust
#

what

frosty rampart
#

don't worry about it

#

it's not relevant

#

idk why it's there

#

just drag the folder in

stiff locust
#

but then ill have a folder called Handy.1.5.1 and a folder called HandyBalatro

stiff locust
frosty rampart
#

delete Handy.1.5.1

frosty rampart
stiff locust
#

okay

#

that fixed the text getting stuck

#

my joker works now

#

awesome

gilded blaze
#

the key part is to pre-hook init_localization

ancient zenith
#

hi! is there any table containing all ranks/suits currently loaded (including modded ones)?

#

cant seem to find it in the smods docs

red flower
#

SMODS.Ranks SMODS.Suits

ancient zenith
#

ah

#

thank you

red flower
gilded blaze
#

yep

red flower
#

awesome

gilded blaze
#

you just need to append keys to G.localization

#

a pre-hook to it means that your added keys will be processed by the orig function, if it's in descriptions

primal robin
#

So much time people install it not properly so I decided to do this thing which crash on start

red flower
#

lol

stiff locust
#

oh

#

idk if i passed the stupid check or not

#

but the mod works so

gilded blaze
#

smods supports nested folders iirc
it's lovely files that aren't running

primal robin
#

that's why smods part have another idiot check for nested folder

red flower
#

lovely zip loading waiting room

gilded blaze
#

lovely zip loading waiting room

#

waiting for the day I forgor to remove the release and confuse lovely 0.9

#

btw I found a really weird behavior with smods a while ago

#

trying to specify smods version by .lovelyignoreing the other smods folders just doesn't work for some reason

primal robin
#

actually rename localization folder from loc_txt to actual localization and adding SMODS check kinda makes sense

real crown
#

Does anyone know what the issue can be? I don't get any crash logs, the game just freezes when entering the first shop:

function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
    local card = ccfs(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)

    if card.ability.set ~= "Joker" then
        return card
    end

    local card2 = SMODS.create_card {
        set = "Joker",
        rarity = "Uncommon",
        area = area,
        key_append = "m_uco"
    }

    return card2
end```

(The goal is to make all jokers uncommon)
tepid crow
#

infinite loop, presumably

frosty rampart
#

yep lmao, you need to also just return the regular card if it's a joker that's already uncommon

real crown
#

Good point, thank you!

red flower
primal robin
#

outsmarted myself

dawn granite
#

i am losing my mind my code is a mess and i don't know what to do (nun so che cazzo fa /ref)

frosty rampart
#

wrong: loc_vars = function(code goes here)
right:

loc_vars = function(self, info_queue, card)
  code goes here
end
gilded blaze
#

why does .lovelyignore not work there

dawn granite
#

now i'm more confused

red flower
#

you're missing an end but the while loop is unnecessary since none of the keys is UNAVAILABLE

dawn granite
#

an end where exactly???

normal crest
#

An end for the while loop

dawn granite
#

removed the loop since n' said it was unnecessary and apparently it hates me because it's giving me the same error

#

although it might be me putting in the play_sound thing wrong

#

i had added that fully myself (it's a funny joke i came up with while brainstorming ideas for the mod) so that's probably where the issue arises

real crown
#

I've only ever done deck and joker mods, what's the equivalent of apply = function(...) when it comes to "global" mods?
As in, apply it always, regardless of the deck you're playing?

frosty rampart
#

the mod's global calculate function
it's more similar to joker calculate than deck apply, check the release discussion for smods 0827 on github for details on how it works

real crown
#

Thank you!

grizzled tide
#

mm, i need a little help, I want to make a Joker basically act like a permanent Uncommon Tag (without it being free). Would I just input in the calculate function the way tags add cards to the shop or something else?

red flower
#

tags and cards don't use the same code unfortunately

#

i think there was a recent addition for this let me check

gilded blaze
stiff locust
#

is context.blind.boss and context.end_of_round a valid combination

red flower
grizzled tide
red flower
stiff locust
#

oh

#

do i still need end_of_round then

red flower
#

it is technically an end_of_round thing but idk if it's used in other contexts

stiff locust
#

i will keep it in case then

dawn granite
frosty rampart
#

play_sound calls need to include the mod prefix
so it's not just play_sound("florida"), it's play_sound("modprefix_florida") (where you fill in whatever your mod's prefix is for modprefix)

dawn granite
#

and is that added to the file name or does it just stay as florida

frosty rampart
#

your second screenshot is perfectly fine as is

#

you just need to add the mod prefix whenever you want to actually use the sound

grizzled tide
red flower
#
return {
  shop_create_flags = { set = "Joker", rarity = "Uncommon" }
}

is what it says you can do

grizzled tide
#

sweet, thank you

dawn granite
#

escb should be the prefix but it's still giving me this error

#

fyi changed the file name as well as all the relevant things to "adrenalinasound" to make things easier for me

hidden notch
dawn granite
real crown
#

I'm getting "attempt to index field 'center' [a nil value] here:

            if joker.config.center.rarity ~= 2 then
                G.GAME.banned_keys[joker.key] = true
            end
end```

Even though config.center.rarity is how baseball card checks for the rarity too
red flower
#

joker in this case is the center

#

so joker.rarity

real crown
#

I see, thank you! 😁

dawn granite
#

`SMODS.Sound({
key = "adrenalinasound",
path = 'adrenalinasound.ogg',
})

SMODS.Tag {
key = "sm-2021",
atlas = 'sm-2021',
pos = { x = 0, y = 0 },
loc_txt = {
name = 'Adrenalina',
text = { 'Create a {C:attention}Standard Tag{}, {C:tarot}Charm Tag{}',
'{C:attention}Buffoon Tag{}, {C:planet}Meteor Tag',
'or {C:spectral}Ethereal Tag',
'{C:inactive}WARNING: contains Flo Rida'}
},
min_ante = 1,
config = { spawn_tag = 1 },
loc_vars = function(self, info_queue, tag)
selected_tag = pseudorandom_element({'standard_tag', 'charm_tag', 'buffoon_tag', 'meteor_tag', 'ethereal_tag'}, 'modprefix_seed')
local it = 1
play_sound("escb_adrenalinasound")
end
} `

red flower
#

are you sure that's your mod prefix

#

also is it supposed to play every time you hover the tag

dawn granite
warped ocean
#

yo chat i need help with this joker lmao (codes a mess i know i basically stitched together sock and castle whilst changing some stuff, if the answer is super simple and im just dumb dont be surprised)

red flower
#

and is it in the right folder

warped ocean
#

(sry to interrupt)

dawn granite
dawn granite
warped ocean
red flower
red flower
warped ocean
#

yeah in the main file under function SMODS.current_mod.reset_game_globals(run_start)

dawn granite
dawn granite
red flower
#

no idea then

warped ocean
#

OMG UR A GODSEND

#

ty mate

grizzled tide
red flower
#

key = "j_modprefix_key"

#

it takes SMODS.create_card arguments

grizzled tide
dawn granite
#

escb is 100% the prefix i am so confused

red flower
#

can i see the folder structure for your assets

dawn granite
#

ignore the empty resources folder

red flower
#

i think your sound file is cursed

dawn granite
#

you know it probably is

#

considering it's a bitcrushed 3 minute eurovision entry with flo rida

#

i don't think it can get more cursed than that

mystic river
#

is the sound file name exactly as you typed it in the SMODS.Sound thing?

red flower
#

make sure it doesn't accidentally have double extension too

mystic river
#

or trailing spaces

dawn granite
#

yes, they both have adrenalinasound.ogg, and it doesn't have a double extension, i have file extensions on in file explorer so i would know if that was the case

#

here's the file info if that helps

warped ocean
#

yo chat, need some more help lol, everything works well mechanically, but when it triggers, the joker doesnt shake and doesnt do the "Again!" message

sturdy compass
#

Also I don't think you need to specify not context.repetition_only

red flower
#

it handles that automatically

gilded blaze
#

but not joker retrigger mr_bones

slim ferry
#

joker retriggers also do that

#

wdym

warped ocean
#

well ill be damned!!

#

thanks yall

sturdy compass
#

For some reason I remembered retriggering still needing a card argument and idk why lol

gilded blaze
slim ferry
#

i mean decks are like wierd to be fair

dawn granite
wintry solar
#

Joker retriggers are weird

#

Jank idea has jank code

dawn granite
#

well it's nothing to do with jokers like at all

grizzled tide
real crown
#

How can I prevent the first joker from appearing for a brief second? I destroy it as soon as I know it's a joker, but it's not enough and it still shows up only to be immediately destroyed

function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
   local card = ccfs(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)

   if card.ability.set ~= "Joker" or card.config.center.rarity == 2 or card.config.center.key == "j_joker" then
       return card
   end

   SMODS.destroy_cards(card, nil, nil, true)

   card2 = SMODS.create_card {
       set = "Joker",
       rarity = "Uncommon",
       area = area,
       key_append = "m_uco"
   }

   return card2
end```
sharp patrol
#

is there any api documentation for this

#

nevermind i found it

red flower
#

theres probably a cleaner way to do this with SMODS.add_to_pool

real crown
red flower
real crown
#

I mean it can give jimbos once the pool is out, but if I just ban not-uncommons, then everything that would spawn as a different rarity is a jimbo

red flower
#

oh yeah
im stupid, the correct way is to just make the other rarities rate 0

#

with this

red flower
real crown
#

I tried this, but commons are still showing up:

        G.GAME["common" .. "uco_mod"] = 0
end```
Or at least I'm guessing lower() means I need to input the key in lower case
#

r_common isn't working either

white hull
#

Is there a clean function to make copies of playing cards that I can use instead of what vremade's Cryptid does?

red flower
#

vanillaremade is the cleanest i know of which is why i write things that way

white hull
#

It works fine but it seems like the kind of thing that has a smods function

wintry solar
#

it doesn't

white hull
#

I see

#

What does G.playing_card = (G.playing_card and G.playing_card + 1) or 1 do? I thought it increased the total amount of cards, but that's G.playing_cards

red flower
#

it's the total amount added that round, some vanilla stuff uses it

#

not round, run

white hull
#

Oh interesting

real crown
dawn granite
#

here's the code in question

#

(play_sound commented out until i figure out what the fuck is wrong with the file

red flower
#

what the code is doing is picking a random tag when you read the tag description and then doing nothing with it

white hull
red flower
#

have you looked at the code for other tags

red flower
white hull
#

I see I see

#

Just tryna understand this stuff

dawn granite
red flower
#

double tag kinda does what you want, and you can see it has an apply functon where it does the effect

wintry solar
#

this is a tag that creates a different tag from a subset?

dawn granite
dawn granite
#

so i just make it that add_tag line in there instead of (context.tag.key) it'll be something along the lines of (context.selected_tag)?

red flower
#
apply = function(self, tag, context)
    if context.type == 'tag_add' then
        local lock = tag.ID
        G.CONTROLLER.locks[lock] = true
        tag:yep('+', G.C.BLUE, function()
            local selected_tag = pseudorandom_element({your stuff here}, "seed")
            add_tag(Tag(selected_tag))
            G.CONTROLLER.locks[lock] = nil
            return true
        end)
        tag.triggered = true
    end
end

like this

#

the context probably needs to be different tho

#

maybe 'immediate' instead of tag_add

dawn granite
#

i'll try both and see what works

#

i'll try tag_add first

#

ah god now i need to play the game i don't have the debug menu on me rn

#

ok tag_add didn't work so i'll do immediate

warped ocean
#

(i know the way i implemented it is ass and is prob the reason it isnt working but still lol) trying to make the suit cycle between the 4 every time the function is run (im currently using reset global values as a placeholder for when ill actually prefer to run it )

#

the shumbagala was just to test if the stuff gets ran, it does, just that for some reason the suit doesnt change

wintry solar
#

because every check is true

#

you change it from hearts to clubs then check if its clubs

warped ocean
#

oh wait

#

yeah im stupid

#

omg

sturdy compass
#

need to use elseif instead of multiple ifs lolol

warped ocean
#

i need to stop late night coding 😭

#

ty lmaoo

sturdy compass
dawn granite
#

bad news

warped ocean
sturdy compass
#

twas a joke

red flower
dawn granite
red flower
#

are those the correct keys

dawn granite
#

they should be

sturdy compass
#

Don't you need to use G.P_TAGS[key] for that?

red flower
#

i think tag_ goes first

frosty rampart
#

yea tag comes first

dawn granite
sturdy compass
# red flower nope

I overcomplicate the simplest shit in my head all the time I swear lol

dawn granite
#

i love how i've been showing this tag troubleshooting it in this channel for a while and no one has stopped and noticed "WARNING: Containts Flo Rida"

frosty rampart
#

not even close to some of the weirdest mod content we've helped debug

real crown
#

Is there a way to set the cost of a custom Spectral card?

frosty rampart
#

yes you can just set cost = x as part of the SMODS.Consumable definition, you don't need to do anything special

#

just like you would in a joker

real crown
#

Thank you!

dawn granite
#

ok it's working thank god

warped ocean
#

oh yeah i remember why i didnt do the elseifs

dawn granite
#

(or i can just move on to another joker but where's the fun in that)

warped ocean
#

this lol

#

there is an end 😭 idk what the issue is

sturdy compass
#

Can you show

warped ocean
#

Oh uh I already decided ill try to fix it tmrw so I closed my pc and stuff, sry I couldnt show-

sturdy compass
#

ope all good

hardy vessel
#

I'm trying to make a joker that let's you pick an extra card from a booster pack and I'm trying something similar to what I had for another that added another card to a pack, but it doesn't seem to be working at all. Am I missing something?

        if context.open_booster and not context.blueprint and context.card then
            local booster = context.card
            booster.ability.choose = booster.ability.choose + 1
        end
red flower
#

ok i hate that all the new features are divided between release notes lol

#

theres a recent functionality for this

real crown
#

Can you make a spectral card usable, destroyable, but not sellable?

hardy vessel
red flower
warped ocean
#

Oh nvm u already got the answer lol

wintry solar
#

maybe I should just copy the release notes onto the wiki for now and worry about putting them in sensible places some other time

dawn granite
#

ok unrelated issue to the still prevelant music issue
did i make this too small or is the tag developing mitosis

white hull
red flower
red flower
junior tapir
#

How do I check if a center is a plain card? A joker would be center.set == 'Joker' (doesn't work with 'Default', working with stickers)

should_apply = function(self, card, center, area, bypass_roll)
    local is_playing_card = center.set == 'Default'
    return is_playing_card
end
red flower
#

Default or Enhanced

#

oh wait i misread

white hull
#

try "Base"

dawn granite
#

thanks vsc for making me realise i pressed the restart key for too long

white hull
chrome widget
#

How do you add repetitions via enhancements/editions/what have you?

#

I know the main scoring context is used typically for other scoring

red flower
#

context.repetition works iirc

dawn granite
chrome widget
#

Is it the same context.repetition and context.cardarea == G.play?

#

Even if it's applying to the current card?

red flower
#

yeah, if i recall correctly it doesnt run for other cards

#

i tried it once because someone wanted to make an enhancement that retriggered adjacent cards

wintry solar
dawn granite
#

just making sure, what's the recommended size for the tag art? the friend of mine making all the art might've just gotten the dimensions wrong

white hull
#

34x34

junior tapir
chrome widget
#

Oh do editions not support multiboxes?

#

At least via tooltips

wintry solar
#

no info queues supprt multiboxes

junior tapir
#

I mean, to make sticker appear only on cards, I could make it not appear on jokers, tarots, planets and spectrals xd

north lodge
#

Best suggestion for trying to debug something that does not give a crash report or put anything in the log when it crashes?

chrome widget
#

Huh...... I'm having trouble getting these cards to receive the skip_blind context

#

I need all edition cards to upgrade when a blind is skipped, regardless if they're jokers or playing cards in the deck

#

Jokers receive it, but playing cards don't

red flower
#

im assuming the deck optional feature is on

chrome widget
#

Oh! Right, that's optiona;

red flower
tepid crow
#

^ sounds like an infinite recursion issue

north lodge
#

My only problem with an infinite recursion idea is that the game doesn't freeze, it just crashes and closes.

red flower
#

yes it does that as well

#

it can also crash and actually give a stack overflow