#💻・modding-dev

1 messages · Page 683 of 1

fading rivet
#

fr

#

debugplus console my beloved

valid sable
#

currently my colors are working minus the inner text, did I tried a few things and this gets it to not crash the game but no color

fringe oxide
#

whenever i do i just break some shi, i aint trying to lose progress

fading rivet
#

ight I think this should work

valid sable
fading rivet
#

i've legit spent 6 hours today trying to line up a single UI element
git has been a life saver when I frick things up

#

its still not lined up 😭

frosty rampart
#

balatro ui my loathed

fading rivet
#

its not even the UI really

valid sable
fading rivet
#

its the moveable element crap

frosty rampart
fading rivet
#

this

#

those circles should be in the top left corner of the card

frosty rampart
#

if you don't mind, can i take a look at your drawstep and where you define the canvassprite? i know it's for the joker jam so feel free to censor as much as you need

fringe oxide
#

game crashed when i tried,

valid sable
frosty rampart
#

if you were going for white then the color was just wrong, hex color #000000 is black

valid sable
#

oh LOL

frosty rampart
fringe oxide
#

i cannot code

fading rivet
valid sable
#

classic game developer completely forgetting which way the hex colors go lmao

fading rivet
# fading rivet

technicaly its a bit more complicated cuase its doing stencil shenangains, but I need the stencil to be in the right place first ;-;

frosty rampart
#

take out the prep_draw call

fading rivet
#

image gets drawn in the top left corner of the screen and is static

frosty rampart
#

it sets things up for balatro UI's auto-scaled stuff, which you don't want for drawing to this canvas
the reason it gets drawn in the top left is you're not actually drawing to the canvas. you need to either call love.graphics.setCanvas to point it to the canvas that's attached to the canvassprite, or just call canvas_object:renderTo for all the rendering functions. whichever's more convenient

fading rivet
#

ooooooooh

#

thx

#

that explains why one of my earlier setups worked but had a weird paralax effect

frosty rampart
#

you want it to be drawn static in the top left of the canvas because that'll be the top left of the card when the canvas is then rendered on the card later lol

fading rivet
#

okay lemme go boot up balatro and fix this lol

#

tysm

#

actaulyl imma do this tmr i should eep

#

gn

frosty rampart
#

no problem, sleep well

grizzled tide
#

how do you clone a cardarea, ive been struggling to figure it out

wary moth
#

is there a way I can make a card "use" a tag?
Like, an example might be: "This jokers consumes Juggle tags to gain +1 hand size" as an example

naive coral
#

how do i make the odds on a jokers text go down when an oops is obtained, i.e from 1/2 to 0/2. because i have one effect that should get increased, and the other should decrease accordingly. i feel as though theres a simple way to do this but i just cant think it rn

daring fern
true jasper
#

how do i add custom badges for cards

daring fern
wary moth
daring fern
wary moth
grizzled tide
#

is there a way i can remove the sell button when its in a specific card area

naive coral
#

I am trying to create a joker that has a 1/2 to double mult, and 1/2 to half mult. the problem is, is after a player gets oops, they both display as 2 in 2 which is wrong due to the fact that only one of these can trigger and its always double. how do i make it so the half mult goes to 0/2 after obtaining oops?

faint yacht
#

Reword it as 1 in 2 chance to X2 Mult, otherwise X0.5 Mult?

timid zinc
#

can neither of the joker effects trigger?

wary moth
#

Is there a way to register a value to be saved with the run?

#

specifically just trying to save a value I have set in "config" in some of my tags, but, just curious in general, if I have any global variables I want to save, like anything I'm keeping track of during the run

primal robin
#

Everything serializeable set in G.GAME is saved

grizzled tide
#

is there a way to check how many joker slots a card takes up

#

im trying to figure out how many slots a highlighted group of jokers are taking up

daring fern
grizzled tide
#

thank you!

wary moth
grizzled tide
daring fern
grizzled tide
#
G.FUNCS.worm_can_release_colony = function(e)
  local tot_slots_used = 0
  for  _, joker in ipairs(G.specificcolony and G.specificcolony.highlighted or {}) do
    tot_slots_used = tot_slots_used + 1+joker.ability.extra_slots_used
  end
  local can_use = (G.jokers.config.card_limit >= tot_slots_used + #G.jokers.cards) and (#G.specificcolony.highlighted > 0)
  e.config.button = can_use and 'worm_release_colony' or nil
  e.config.colour = can_use and G.C.MULT or G.C.UI.BACKGROUND_INACTIVE
end
#

G.specificcolony is a cardarea

naive coral
#

im currently rewording jokers in my mod that im tryna create, so this makes things alot clearer

naive coral
#

how do i use info_queue[#1116390750314307698_queue + 1] in the loc_vars to display a string/ credit someone? i want it to show a name in a tooltip and i cant figure it out

distant junco
#

It feels like the Booster Packs I've made aren't deciding jokers based on rarity... idk what to do!!@@

distant junco
# wintry solar What is your code?

SMODS.Booster { key = 'jam_booster_1', loc_txt = { name = 'Jammbo Pack', text = { 'Choose {C:attention}1{} of', '{C:attention}2{} {C:red}Jambatro{} Jokers' }, group_name = 'Jambatro??' }, atlas = 'jam_boosters', pos = { x = 0, y = 0 }, draw_hand = false, cost = 5, discovered = true, weight = 7, pools = { ["Jamboosters"] = true }, config = { extra = 2, choose = 1 }, create_card = function(self, card) return {set = "Jambatro", area = G.pack_cards, skip_materialize = true, soulable = false, key_append = "jammbo"} end, }

wintry solar
#

And what’s the issue?

distant junco
#

It feels like rarity is not accounted for when I open the packs like I always get rares n stuff

wintry solar
#

What smods version are you currently using?

distant junco
#

Newest

#

Though I wrote this code a good while ago

wintry solar
#

I am pretty sure things should be working properly but I will investigate

#

Can you share where you set up your pool?

distant junco
#

The joker pool?

wintry solar
#

Yup

distant junco
#

SMODS.ObjectType({ key = "Jambatro", default = "j_jam_greg", cards = {}, inject = function(self) SMODS.ObjectType.inject(self) end, })

coral flume
#

Anyone know why this isn't working?

if context.selling_self and card.ability.extra.currounds >= card.ability.extra.maxrounds then 
      local chosen_joker = pseudorandom_element(G.jokers.cards, 'randomseed13')
      Card = chosen_joker
      Card:add_sticker('eternal')
    end
wintry solar
#

Do you have any optional features on too?

distant junco
#

Who are you replying to

wintry solar
#

You

distant junco
#

Idk what you mean by optional features

wintry solar
#

Do you do SMODS.current_mod.optional_features anywhere to turn on thins like quantum enhancements

distant junco
#

No

wintry solar
#

Okay I will have a look today and get back to you

distant junco
#

Thanks

frosty dock
#

overriding global Card...?

daring fern
coral flume
coral flume
frosty dock
coral flume
#

Oh interesting

#

wish it said that lol

frosty dock
#

the sticker API is still a tad bit wonky tbf

coral flume
#

I thought it related to sticker_compat variables on jokers

frosty dock
#

we're looking to refactor it at some point

coral flume
#

Swag as

frosty dock
daring fern
coral flume
#

oh while i'm here, is there a quick way to make it avoid jokers with eternals already. Just remembered it should probably do that

frosty dock
#

what I said is true only for modded stickers

frosty dock
daring fern
frosty dock
daring fern
frosty dock
#

ok nvm

#

i forgor

teal grotto
#
    pos = { x = 0, y = 0 },
    atlas = "pinned"
}, true)```why doesn't this work 😭
daring fern
teal grotto
#

...

#

why

naive coral
#

how do i get tooltips to display any text i want?? i have no clue how to get it working

#

like the things that popup next to jokers when you hover over them

#

like how a sticker with perishable shows what it does next to the joker its on

true jasper
naive coral
#

yeah ik, i cant figure out how to add custom text into them

#

not the text of a joker or tarot, like text that i want, aside from creating a dummy joker

naive coral
#

some :'s are missing because of copy and paste or .txt files being funky

#

it just shows as a blank box

#

ive looked at 3 different mods, and im doing what they are i think, and not getting it to work

slim ferry
#

the text is not a string

naive coral
#

it is, its gone in the copy and paste

slim ferry
#

cant you just

#

upload the lua file instead of copying to a txt

naive coral
#

true

#

i jus didnt think of that because im dumb

slim ferry
#

thats just an arbitrary string in config

naive coral
#

the way i understood it i thought that calling the card.ability string would make it appear

#

how would i get it there

slim ferry
#

i assume youre trying to add a tooltip with info_queue[#info_queue + 1] = {key = 'Krypton_Deadin5s', set = 'Other', vars = {card.ability.extra.Deadin5s}}

naive coral
#

yes

slim ferry
#

but this creates a tooltip from the key Krypton_Deadin5s from localization files

#

under the category Other

naive coral
#

i think my braincells just created my first thought

#

if this is the case, holy i was braindamaged

#

OH MY GOD IM DUMB AS BRICKS

#

ok i think it got it now

#

yippeeeeeeeee

wintry solar
fading rivet
wintry solar
bold gyro
#

how do you check/set if a card has a shadow? (eg. glass playing cards don't have a shadow)

frosty dock
#

as per the shadow DrawStep, the following (self is a Card instance):

if not self.no_shadow and G.SETTINGS.GRAPHICS.shadows == 'On' and((self.ability.effect ~= 'Glass Card' and not self.greyed and self:should_draw_shadow() ) and ((self.area and self.area ~= G.discard and self.area.config.type ~= 'deck') or not self.area or self.states.drag.is)) then
#

(yes, glass card is hardcoded)

#
  • if it wasn't obvious, you can hook Card:should_draw_shadow() to change if shadow should be drawn
glossy sky
#

is there a variable that gets the boss blind requirement for the ante? I thought about using G.GAME.blind but that obviously only tracks the current blind. This is for a boss blind btw, so if there is a field on SMODS.Blind that has it that would also work for me.

mystic river
#

i believe that's Blind.chips
but tbh I'd just use debug plus to eval Blind and read the table myself

glossy sky
#

I guess I should clarify that I mainly need it to pass through loc_vars for the description, so blind.chips isn't an option here

bold eagle
#

I'm currently trying to make it so that when my custom rarity "Whimsical" is on one of your jokers, the custom rarity "Evil" wont show up, but when you have a whiomsical joker nothing changes

SMODS.Rarity {
    key = "evil",
    default_weight = 10,
    badge_colour = HEX('690404'),
    loc_txt = {
        name = "Evil"
    },
    get_weight = function(self, weight, object_type)
        return weight
    end,
    disable_if_empty = true,
    pools = {
        ["Joker"] = function(self,args)
            for i, v in ipairs(G.jokers.cards) do
                if v:is_rarity("zwp_whimsical") or next(SMODS.find_card("j_zwp_propeller")) then
                    return false
                end
                return true
            end
        end
    }
}
#

the weight is at 10 for testing purposes

#

and the propeller joker is another joker that I want to have stopping evil ones but isnt whimsical

bold eagle
#

I still have zero clue whats going on

maiden phoenix
#

You got your return true in the for loop so it stops after the first joker

bold eagle
#

that didn't work

#

it still shows up

maiden phoenix
#

Do pools actually support functions?

bold eagle
#

thats a good question

#

i just figured anything did

rapid stag
#

given that pools contain mostly water, if you put a function in one, they will most likely short out and sustain water damage girldmThumbsup

bold eagle
#

so thats a no

rapid stag
#

i actually don't know

bold eagle
#

dang

near heart
#

Hello Zarcheus.

bold eagle
#

i mean, it would have to be recieving true somehow

near heart
#

It looks like we both have some questions at the same time.

#

how can i get the blinds current skip tag and how can i use it to give the player the skip tag?
ive tried 'G.GAME.round_resets.blind_tags[G.GAME.blind:get_type()]' based on something a previous person asked but i cant seem to figure out what this actually returns and how i can use it to give the player the skip tag i want mid blind

maiden phoenix
# bold eagle i mean, it would have to be recieving true somehow

Something lazy you can do is put in your joker objects with the evil rarity this function

        in_pool = function(self)
            if G.jokers and G.jokers.cards and next(G.jokers.cards) then
                if next(SMODS.find_card("j_zwp_propeller")) then return false end
                for _, joker in ipairs(G.jokers.cards) do
                    if joker:is_rarity("zwp_whimsical") then
                        return false
                    end
                end
            end
            return true
        end,
#

There's prob a better way but I've never messed with pools

bold eagle
#

that was my backup plan

near heart
#

This Zarcheus character is really pissing me off.

tidal hemlock
bold eagle
#

im now having the issue of the rarity not being disabled once all jokers are out of it

#

unless im misinterpreting what disable_if_empty does

near heart
#

Noone will hear you scream Zarcheus.

#

I am not bullying anyone.

#

Especially Zarcheus985.

maiden phoenix
bold eagle
#

would that mean like, if I put no jokers into the rarity it doesnt show up or if I have all of the jokers in that rarity it wont show up

#

because I want to have the second one

maiden phoenix
#

I think it just means if you're polling from the empty rarity you won't get the default option?

hardy vessel
#

I'm having an issue with quantum enhancments and a Joker I have that gains chips when a card is enhanced. (Quantum enhancements cause the joker to gain chips four times). Is this because of a QE bug or is there a way to prevent the chip gain when a card gains a QE?

    calculate = function(self, card, context)
        if context.setting_ability and not context.unchanged and G.P_CENTERS[context.new].set == 'Enhanced' then
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_mod
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.CHIPS,
            }
        end
        if context.joker_main then
            return {
                chips = card.ability.extra.chips
            }
        end
    end
bold eagle
#

or when theyre out of the pool

maiden phoenix
maiden phoenix
slim ferry
#

I presume this is a steamodded bug

#

Since it should account for this

bold eagle
#

i worded my stuff poorly before

hardy vessel
maiden phoenix
bold eagle
#

ok, thanks for your help

wintry solar
bold eagle
#

1224a

#

so after it was added

#

but newer versions would just crash immediately

near heart
bold eagle
#

i got a newer version of smods but disable_if_empty is still not working

#
SMODS.Rarity {
    key = "evil",
    default_weight = 0.15,
    badge_colour = HEX('690404'),
    loc_txt = {
        name = "Evil"
    },
    get_weight = function(self, weight, object_type)
        return weight
    end,
    disable_if_empty = true,
    pools = {
        ["Joker"] = true
    }
}
wintry solar
#

Do you have debug plus?

bold eagle
#

yes

#

does that break it

wintry solar
#

Can you run eval get_current_pool("Joker", "INSERT YOUR RSRITY KEY HERE PLS", false, nil)

bold eagle
#

thats what it gave me

wintry solar
#

Okay now this one eval local t = {}; for I=1, 1000 do local r = SMODS.poll_rarity('Joker'); t[r or "none"] = (t[r or "none"] or 0) + 1 end print(t)

rigid solar
#

hey eremel while you're here, do you have an idea on when a new release with properly working attributes will be released?

#

really cool feature

wintry solar
#

They already properly work 😭

bold eagle
rigid solar
#

i mean with the features on the dev version

#

Card:has_attribute crashes rn lol

frosty dock
#

the current release is broken in several ways, so there's another one coming your way soon

wintry solar
#

Today or tomorrow

rigid solar
#

ok nice thx

wintry solar
bold eagle
#

hm

#

for some reason jimbos are showing up

frosty rampart
rigid solar
#

yeah because i literally just reported it 😛

frosty dock
#

VIP issue :p

rigid solar
#

wut

wintry solar
#

I used my mind powers to control N to implement the fix

frosty dock
bold eagle
#

the message changes depending on whether or njot I have an evil joker

#

which is another custom rarity

wintry solar
#

Isn’t that what you said it should do?

bold eagle
#

i

#

i dont really know

rigid solar
bold eagle
#

does the high number mean iots not there?

wintry solar
#

No the number is how many times that rarity will appear if you picked 1000 jokers

bold eagle
#

im trying to make it so that when you have all the jokers in a rarity that rarity wont show up any more

#

ah

maiden phoenix
near heart
#

thank you

bold eagle
maiden phoenix
# near heart thank you

This is basically what you have to put

        if context.setting_blind then
            add_tag(Tag(G.GAME.round_resets.blind_tags[G.GAME.blind:get_type()]))
        end
#

Not sure if this handle the orbital tag issue or not

near heart
bold eagle
#

but theres disable if empty

near heart
#

i try it out on an orbital tag see what happens

maiden phoenix
#

Basically there used to be an issue where if you just straight up add a tag, G.orbital_hand doesn't get set, meaning it's nil meaning it crashes

bold eagle
#

so wouldnt that make it stop jimbos?

near heart
#

lemme try something

maiden phoenix
#

Paste a screenshot of your code?

sly heron
#

My game crashes because of the atlas I made for the joker heres the code:
SMODS.Atlas { key = 'pomni', path = 'pomni.png', px = 71, py = 95 }
can someone help me fix it?

near heart
#

nvm i know why it happened

fading rivet
#

uhhh

#

do you have debugplus installed

maiden phoenix
#

What's the crash?

maiden phoenix
#

Is your file named "jeej_pomni" ?

fading rivet
#

run this in the console
eval for key, _ in pairs(SMODS.Atlases) do print(key) end

sly heron
fading rivet
#

oh wait ib blind thats filedata

#

yeah whats your file named

#

and you have both 1x and 2x

sly heron
#

Nwm, i fixed i put 1x and 2x folder insde other folder

near heart
# maiden phoenix Paste a screenshot of your code?

originally the idea for the joker was to give you a dupe of the skip tag when you skipped so i think since it triggers after it gives you the tag the blind technically doesnt have a tag type anymore so it returns nil and crashes
the idea for the joker was a little boring in the first place so im gonna change it to a different condition

fading rivet
maiden phoenix
near heart
#

thats what was causing the error in the first place sorry

maiden phoenix
#

Oh oop

near heart
#

having it as setting_blind worked fine

#

youre all good with helping me thank you 👍

wintry solar
bold eagle
#
SMODS.Rarity {
    key = "whimsical",
    default_weight = 0,
    badge_colour = HEX('FF1AFF'),
    loc_txt = {
        name = "Whimsical"
    },
    get_weight = function(self, weight, object_type)
        return weight
    end,
    disable_if_empty = true,
    pools = {
        ["Joker"] = true
    },
}    
#

thats the zwp_whimsical rarity

maiden phoenix
#

Not sure if ending_shop is too early

bold eagle
#

but thats not whats breaking things

bold eagle
shell timber
#

is disable_if_empty a thing?

maiden phoenix
#

Saw a lovely patch use it too so ig

wintry solar
bold eagle
#

what

#

oh the ones in the joker?

wintry solar
#

Ye

bold eagle
#
SMODS.Joker {
    key = "whimsyman",
    atlas = "placeholders",
    pos = {
        x = 0,
        y = 0
    },
    rarity = "zwp_whimsical",
    in_pool = function(self, args)
                for i, v in ipairs(G.jokers.cards) do
                    if v:is_rarity("zwp_evil") then
                        return false
                    end
                end
                for _, playing_card in ipairs(G.playing_cards or {}) do
                    if SMODS.has_enhancement(playing_card, 'm_zwp_whimsical') then
                        return true
                    end
                end
                
                return false
                
            end,
}
#

thats the only whimsical joker

wintry solar
#

An the evil joker?

bold eagle
#
SMODS.Joker {
    key = "evilman",
    atlas = "placeholders",
    pos = {
        x = 0,
        y = 0
    },
    rarity = "zwp_evil",
    in_pool = function(self)
        if G.jokers and G.jokers.cards and next(G.jokers.cards) then
            if next(SMODS.find_card("j_zwp_propeller")) then return false end
            for _, joker in ipairs(G.jokers.cards) do
                if joker:is_rarity("zwp_whimsical") then
                    return false
                end
            end
        end
        return true
    end,
}
wintry solar
bold eagle
#

this

wintry solar
#

Okay that looks accurate

#

If you give yourself the evil joker?

bold eagle
wintry solar
#

That also looks fine

#

If you remove that and add the whimsical one?

bold eagle
wintry solar
#

That looks less fine

bold eagle
#

yeah

#

and then the shop gets filled with jimbos

#

more so than it was

bold eagle
# bold eagle

and if I buy the evil card it says the same thing as this

wintry solar
#

Is your mod on GitHub?

bold eagle
#

yeah

#

can i send the link here

wintry solar
#

Yeah I’ll try take a look this evening

bold eagle
zenith quarry
#

    end```  i have this so far how do i check if any of the jokers have any stickers on them like eternal or rental or perishable
frosty rampart
#

there's no good way to check for any sticker, especially if you want to take into account other modded stickers

zenith quarry
#

i just want to check vanilla stickers

#

is that possible or no

frosty rampart
#

then the link i gave you answers that question

zenith quarry
#

ok let me check it out

#

this is actualy really helpful for other stuff to

#

thanks

frosty rampart
#

yep, happy modding

zenith quarry
#

one more question i dont know if the link you sent has this but is there a way to remove the stickers

fading rivet
#

its the same way you check if it has the sticker

#

but you set it to nil instead of checking for true

#

card.ability.sticker_key = nil

zenith quarry
#

ohh that makes sense

fading rivet
zenith quarry
#

i was checking for it like this though G.jokers.cards[i].ability.rental

fading rivet
#

hmmm

zenith quarry
#

but i might switch it to the way you sent

fading rivet
zenith quarry
#

G.jokers.cards[i].ability.sticker_key == _____________

slim ferry
#

iirc

zenith quarry
slim ferry
#

if i recall correctly

zenith quarry
#

oh ok

slim ferry
#

difference between this and directly removing the sticker value is that values related to the sticker will not remain

#

e.g. perishable round counter

fading rivet
zenith quarry
#

so i can check for perishable then remove perishable by putting card:remove_sticker("perishable")

#

?

slim ferry
#

yea

zenith quarry
#

or instead of card do G.jokers..cards

#

[1]

#

i

slim ferry
#

i mean its whatever card object yeah

#

that

fading rivet
#

yeah as long as you got the card object

zenith quarry
#

ok

fading rivet
#

[CARD OBJECT]:remove_sticker("key")

slim ferry
#

also if you want to reliably remove all modded stickers you can do

for _, sticker in ipairs(SMODS.Sticker.obj_buffer) do
    if card.ability[sticker] then card:remove_sticker(sticker) end
end
#

where card is again a given card object

zenith quarry
#

im not that good at modding but what does in ipairs do

slim ferry
#

loops over every element of a table

zenith quarry
#

oh ok

frosty dock
#

every element with a numerical key in order*

slim ferry
#

theres pairs and ipairs for this, difference being that ipairs only does integer indexes but always does so in order

#

yeah

#

ipairs will loop index 1, 2, 3, etc until it runs into a nil, pairs does everything in an arbitrary* order

#

not actuall arbitrary i think but its based on the order values are stored in memory? which isnt something you really have control over

zenith quarry
#

i did this but with multiple rentals its only removing one each hand played for i = 1, #G.jokers.cards do if context.joker_main then if G.jokers.cards[i].ability.rental then return { G.jokers.cards[i]:remove_sticker("rental"), message = 'Rental', colour = G.C.RED, } end end end

slim ferry
#

returning immediately ends the current function

#

also i recommend you put the loop inside of the context check rather than the other way around

zenith quarry
#

ok but how do i not end the function immediantly

slim ferry
#

store a local value that gets set to true if any rentals are found, then return after the loop if that value is true

zenith quarry
#
        if context.joker_main then
            local rent = false
            if G.jokers.cards[i].ability.rental then
            return {
              rent = true
              message = 'Rental',
              colour = G.C.RED,
            }
            end
        end
    end```  something like this
slim ferry
#

no

#
if context.joker_main then
    local rent = false
    for _, c in ipairs(G.jokers.cards) do
        if c.ability.rental then
            rent = true
            c:remove_sticker("rental")
    end
    if rent then
        return { message = 'rental', colour = G.C.RED }
    end
end
#

the ipairs loop is essentially the same as the previous one

#

except c replaces G.jokers.cards[i]

zenith quarry
#

am i able to just remove the return

slim ferry
#

you can also do that yeah

zenith quarry
#

final question how do i detect when the joker is sold

maiden phoenix
#

context.selling_self

frosty dock
zenith quarry
#

im new to making decks but how do i set the hand size equal to the size of the deck ``` SMODS.Atlas{
key = 'SD',
path = 'Rainbow.png',
px = 71,
py = 95
}

SMODS.Back{
key = 'SD',
atlas = 'SD',
pos = {x = 0, y = 0},
config = {
hands = -3,
discards = -3,
dollars = 0,
hand_size = __
},
apply = function(self, deck)
end
} ``` i have this right now

daring fern
zenith quarry
#

but i actual just figured it out

#

i had to use calculate to constantly set the hand size

near heart
#

is there a thing i can call to get the chips scored from the current hand

daring fern
near heart
#

thank you somethingcom515 seals on ever

near heart
#

i am encountering the nil orbital tag issue is there a remedy]

fringe oxide
#

how do you change the joker that shows when you boot up the game into another, modded joker (or a pool of jokers maybe?)

mystic river
fringe oxide
#

i mean that one, not the main menu

mystic river
#

ah
there's not a defined way to do that yet, but if you look through the vanilla code you can probably find the right thing to patch

fringe oxide
#

alr

fringe oxide
mystic river
fringe oxide
mystic river
#

that is not how tables are formed

fringe oxide
#

table?
i cant code lol

mystic river
shell timber
#

its ugly as hell but it is valid

frosty dock
shell timber
#

wait nvm i didnt read,

frosty dock
fringe oxide
#

thats how it looked last time

frosty dock
fringe oxide
frosty dock
fringe oxide
#

alr

fringe oxide
timid zinc
#

is there any way to make a boss blind not affect the background

near coral
wintry solar
#

There isn’t any support for non boss blinds at the moment

wild patrol
#

If it triggers at the same time shouldn't really be noticeable

#

That it's adding then subtracting 1

naive coral
#

how do i make a jokers shake, like invisible, to signify its ability is ready?

maiden phoenix
naive coral
#

k

near coral
#

Are you saying every blind makes the ante go up by default but mods just have to work around it?

wintry solar
#

There are no methods within smods to have custom blinds not as a boss blind

naive coral
#

does ortalab do that?

#

i swear they had custom normal blinds

true jasper
naive coral
#

ig he could consume that code to do what he wants tho

onyx sonnet
#

Trying to make a UI element similar to the poker hand nodes in the run info, but with a tooltip which uses loc_vars and text styling, but i can't figure out how to do that.
on_demand_tooltip doesnt satisfy my needs but the text im representing doesn't belong to a SMODS.Center and it also needs to use more than 1 color (so text styling akin to a card description) and DynaText doesnt seem to be able to do that

naive coral
#

anyone know why this edition doesnt retrigger the joker its on?

elder rune
#

For shaders, how would you get the screen width and height

naive coral
# naive coral anyone know why this edition doesnt retrigger the joker its on?

this code works fine if i say if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self then instead of
if context.retrigger_joker_check and not context.retrigger_joker and context.other_card == self then,
but this retriggers all other jokers which is not what i want. anyone know wy?

#

i want the edition to retrigger JUST the joker its on

daring fern
naive coral
#

PEAKKKKK

#

TY dude i can sleep now

wary moth
#

trying to apply foil to selected cards, and this is what I currently got:

for _, card in ipairs(G.hand.highlighted) do
  if card and card.set_edition then
    card:set_edition("e_foil", true)
  end
end

but, it sets the edition for ALL cards at the same time, and the sound stacks together to be really loud
Is there any way for me to either ONLY play the 1 sound, or, delay the applying foil effect per card?

naive coral
#

you could change the sound of foil to 0.2

#

yeah, im bad at coding how could you tell

#

or use the event manager and add a 0.1 delay

#

for _, card in ipairs(G.hand.highlighted) do
if card and card.set_edition then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
card:set_edition("e_foil", true)
delay = 0.1
return true
end
}))
end
end

wary moth
#

oh wait

#

I found documentation on it

naive coral
#

nice

#

then again tho the sound is ear candy

#

maybe just use a delay and event manager

wary moth
naive coral
#

oh wow lol

#

if it was my code sorry im not the best

wary moth
wintry solar
#

Just delete the true

wary moth
wary moth
#

yeah deleting the "true" did exactly what it should do, delayed the application to each card

#

sorry for the dumb questions, I am struggling to find documentation on these functions, I had to find like, obscure website that had the documentation on that function

naive coral
#

i feel that, but no question is a dumb question only you before it gets answered. then you become smart :D

#

thats my thought when i ask something its to not be as dumb

wary moth
#

Yup! slowly learning

naive coral
#

i feel like i know so much about modding, and then i try something i havent before and get stumped for like 2 hours

wary moth
#

Heres what I was workin on. I got on-click effects for my tags in my mod

frosty dock
#

neat

frosty dock
onyx sonnet
sly heron
#

I have problem with codeing my joker I want it to if there is a 3 in playing hand retrigger it three times and scale the xmult by 1.3 but It dosent work, is there anything I could fix it?
Heres code:
calculate = function (self,card,context) if context.repetiton then if context.cardarea == G.play and context.indvidual and not context.blueprint then if context.other_card:get_id() == 3 then SMODS.scale_card(card, { ref_table = card.ability.extra, ref_value = "XMult", scalar_value = "xmultgain" }) return { message = "Three!", repetitons = 3, Xmult_mod = card.ability.extra.XMult, card =card, } end end end end

mystic river
#

you misspelled individual
also I'm not sure that context happens during repetition? but it definitely doesn't happen misspelled so fix that and see what happens

vast bough
#

can ease_dollars be used everywhere, across consumables, enhancements, jokers, etc. what is the point of using it over dollars =

mystic river
#

you don't have to return inside a calculate to use ease_dollars

vast bough
#

so is it just a net positive to use ease dollars

mystic river
#

but i think returning dollars=something ends up using ease_dollars in the end anyway

mystic river
vast bough
#

we will find out haha

sly heron
mystic river
#

yeah you have to do these things separately

sly heron
#

Oh, ok.

slim ferry
#

and properly times it to when the joker animation plays

#

for anything outside calculate ease_dollars is the only option anyway

sly heron
safe dawn
#

Does anyone know how I would add credits to Jokers?
Also displaying side information, eg negative edition

frosty dock
slim ferry
#

i guess

ancient mango
#

is there a vscode extension for smods

frosty dock
ancient mango
#

i dont get it

#

how do i do it

frosty dock
ancient mango
#

i dont think it works

pastel kernel
#

do you check if ante is <= 4 like this?

if G.GAME.round_resets.ante  <= 4 then
red flower
#

also i recommend setting up the luarc file

ancient mango
#

workspace? also how do i setup the luarc

red flower
#

what do you mean did you read the link 😭

ancient mango
#

i did and i was confused what to put in the luarc

#

do i put this?

{
  "Lua.workspace.library": ["path/to/smods", "path/to/lovely/dump"]
}

red flower
#

yes

ancient mango
#

oh 😭

red flower
#

replace the paths of course

ancient mango
#

what does this mean

red flower
#

you might need to remove the "Lua." but i don't think so

ancient mango
red flower
#

that 'Lua.' might not be needed

#

it is needed when using the global vscode file

ancient mango
#

like

{
  "workspace.library": ["path/to/smods", "path/to/lovely/dump"]
}
```?
red flower
#

yeah

ancient mango
#

also would
%AppData%/Balatro/Mods/smods
work instead of
C:/Users/<user>/AppData/Roaming/Balatro/Mods/smods

#

in the path

red flower
#

i dont think so

ancient mango
#

😭

red flower
#

maybe it does idk never tried

ancient mango
#

lemme try

#

it still doesnt work

red flower
#

where did you add the file

ancient mango
red flower
#

.luarc.json

ancient mango
#

ah

#

it works

#

smods works with %AppData% but lovely/dump doesnt lol

#

i originally wanted to play hot potato but my texture pack stopped working cause i updated smods so ive spent the past 1-2h trying to fix it

short girder
#

does anyone know where the scoring happens in the game engine? needing it for a patch

slim ferry
#

somewhere in functions/common_events iirc

#

G.FUNCS.evaluate_play

pastel kernel
#

something's fucking up my balatro

short girder
sly heron
#

How do I use balance?

mystic river
#

return balance = true in your calculation table

sly heron
#

Thanks

pastel kernel
#

How do you check for money change

grizzled tide
#

do you guys happen to know how to grab the shop queue (as well as set the shop queue)

elder rune
#

and context.from_shop when buying

#

context.amount is how much its changing

frosty rampart
grizzled tide
pastel kernel
#

checking for when you redeem a specific voucher

torpid flicker
#

how do i make a jokers sprite change based on a condition?

#

ive seen set_sprite_pos() but idk how that function works i cant find documentation for it

fading rivet
torpid flicker
#

what are the args for it?

fading rivet
#

pos

#

which is a table akin to the one in defining the joker

torpid flicker
#

ok!

#

thanks

fading rivet
#

np

elder yoke
#

Hey guys, can any of you please help me with this problem? Im learning coding right now and i have made a joker card. the code and all works fine, it's just that the card itself is for some reason invisible. Does anyone know why this happens and how to fix it?
https://medal.tv/nl/games/balatro/clips/mrYZmFRyfPF7apOxD?invite=cr-MSx2a1ksMjMyNDg4MTQz&v=15

Bekijk Untitled van sargeant_death en miljoenen andere Balatro video's op Medal. #balatro

▶ Play video
dreamy lodge
elder yoke
#

im getting help from someone else right now

maiden phoenix
#

Does your mod have an asset folder? With 1x and 2x in it with your spritesheet in both?

elder yoke
#

Yeah i do have it, alongside images linked to it.

maiden phoenix
#

Does your pic file name goes [modprefix]_[key] ?

slim ferry
#

Wait no

#

That cant be the issue nvm

elder yoke
#

im getting help from someone else rn, and they know what's wrong with it

slim ferry
#

What do you have set for the pos in the joker

#

Oh okay

elder yoke
#

ty for the help anyway

maiden phoenix
#

Yea if they can load the game it aint a file issue

#

Oh

elder yoke
#

okay so the mistake was the pos coordinates, which i didn't really know much about. it's fixed now.

tidal hemlock
#

things will be added after other things are added to the mod (the two addeds, thanks english language)

ancient mango
#

is there an example for atlas?

tulip pecan
#

I'm using this code to replace all blinds with boss blinds, but the ante always increases every time you beat one, even if its the one replacing the small or big blind. How would I fix this?

true jasper
# ancient mango is there an example for atlas?
SMODS.Atlas({
key = "yourkeyhere",
path = "placeholder.png", -- must be  assets/1x/placeholder.png as well as the 2x folder
px = 71, -- width for most objects
py = 95, -- height for most objects
})```
-# no indentation since I'm on mobile
ancient mango
#

you couldve used spaces for indent

#

its monospace

true jasper
ancient mango
#
SMODS.Atlas({
 key = "yourkeyhere",
 path = "placeholder.png", -- must be  assets/1x/placeholder.png as well as the 2x folder
 px = 71, -- width for most objects
 py = 95, -- height for most objects
})

look

wild patrol
tidal hemlock
primal robin
#

hey look it's ranran

wild patrol
#

if chat is playing for u it's to make up for them playing poorly on purpose

#

it's a forced ante 1 boss

#

where chat plays the game for u

grizzled tide
#

does SMODS.current_mod.calculate happen before or after joker calculates

wintry solar
#

after

grizzled tide
#

sweet, thank you

median veldt
#

the retrigger context is going over my head

#

nvm i just remembered that vremade exists

bold eagle
#

I have an issue where even when the jokers in my custom rarity aren't in the pool, the rarity is still put into the pool of jokers that can appear, causing the shop to be filled with jimbos, with disable_if_empty not working

#

ignore the first 2 jokers they work fine

#

cause they aren't in custom rarities

rapid stag
#

i remember asking this before, but i forgot the answer girldmDizzy : during context.selling_self, does #G.jokers.cards include or exclude the card being sold

grizzled tide
#

I'm using smods.current_mod.calculate to get retriggers, but the message keeps appearing in the deck rather than the card im retriggering and SMODS.calculate_effect({repetitions = 1}, joker) end doesn't work

naive coral
#

how do i make a joker twice as likely to appear in shops and booster packs for every copy of itself owned?

daring fern
wary moth
#

how do you (without context) check if the game state is in a shop?

daring fern
wary moth
zealous path
#

how do i make this not lag like hell

daring fern
daring fern
# naive coral bump

Enable the object_weights optional feature and:

get_weight = function(self, weight)
    return weight*(2^#SMODS.find_card(self.key))
end
naive coral
#

thank you sooo much bro i could not figure out how get _ weight worked for the life of me

#

the documentation was vague (at least for me) and no mods had i that i owned

coral flume
#

How would I go about 'tutoring' for a card? Like drawing a specific card to hand

naive coral
#

can i make a card count as all rarities

daring fern
naive coral
#

ty

dapper sun
#

does anyone know what the variable the time extern in shaders is?

naive coral
#

how to detect if a specific joker has appeared in shop?

vital wren
#

how would i just force a card to be scored regardless of when it's happening? i'm trying to make 3s in hand get scored as if they were played whenever a hand is played. code:

if context.individual and context.cardarea == G.hand and context.other_card:get_id() == 3 and not context.end_of_round then
    local _context = {
        main_scoring = true,
        individual = true,
        cardarea = G.play,
        repetition = context.repetition,
    }
    return {
        pre_func = function()
            print("attempting to score 3s in hand")
            SMODS.calculate_effect(eval_card(context.other_card, _context))
        end,
    }
end```
the `pre_func` is working; i can see the `print`. but the `eval_card` doesn't seem to be returning anything that's being calculated
frosty dock
#

consider drawing them to play and returning them to hand after

vital wren
#

i was considering that. maybe in context.before just add them to G.play?

slim ferry
#

you can achieve this with an SMODS.score_card hook, i dont have it on hand rn but if you dont care about stuff like midas mask triggering it should be fine

vital wren
naive coral
#

i think that a legendary joker in paperback does something similar, maybe look for inspiration?

wary moth
#

I know that G.GAME will save serializable information to it onto the run
Is there something like that for the whole save-file? Like, if I wanted to keep track of high scores on cards for example?

daring fern
daring fern
wary moth
wary moth
#

perfect thank you so much

#

Oh!
Quick question, was trying to set the reroll cost in the shop to $0 (like the D6 tag effect) for my own clickable tag system, but, the vanilla-remake mod I was referencing did not appear to work when I copied what they did over, which is:

tagClickEffects["tag_dishevel_d6"] = function(tag)
    if G.STATE ~= G.STATES.SHOP then
        return cantUseTagMessage(tag, "Not in shop?")
    end
    if tryUseCharge(tag, G.C.GREEN, "Rerolls Reset!") then
        G.GAME.round_resets.temp_reroll_cost = 0
        calculate_reroll_cost(true)
        return true
    end
    return false
end

any ideas?

#

(you can ignore most of that, just whats inside the "if tryUseCharge()" block)

silk latch
wild patrol
silk latch
wild patrol
#

probably add something make it a regular boss if nobody is in chat

#

but I don't see why you'd play this mod with no viewers lol

#

minimum is at least 1

#

for everything to work

#

The entire mod is based on chat vs streamer interactions lol

silent sail
frosty dock
silent sail
#

thanking you

#

second question, why does this voucher not spawn? i keep getting blank vouchers instead (i have every voucher other than hieroglyph)

frosty dock
silent sail
#

aaah

#

yeah that makes a lot of sense

ancient mango
#

main.lua

SMODS.Atlas {
    key = 'atlas',
    path = 'CardsV2.png',
    px = 71,
    py = 95,
}
SMODS.Atlas {
    key = 'icon',
    path = 'Icons.png',
    px = 18,
    py = 18,
}

SMODS.DeckSkin {
    key = 'hearts',
    suit = 'Hearts',
    loc_txt = 'idk',
    palettes = {
        key = 'hc',
        ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace"},
        display_ranks = {"Ace", "King", "Queen", "Jack"},
        atlas = 'atlas',
        pos_style = 'deck',
        suit_icon = {
            atlas = 'icon',
        }
    }
}

SpidersCustomTextures.json

{
    "id": "SpidersCustomTextures",
    "name": "Spider's Custom Textures",
    "author": "TheSpiderNinjas",
    "description": "idrk what to put here, the cards are cool i guess.",
    "prefix": "sct",
    "main_file": "main.lua",
    "priority": 1.79769e308
}
#

why is my mod not appearing

wintry solar
#

your priority isnt a number

ancient mango
#

it is and thats not the problem

keen atlas
#

author is array

ancient mango
#

yea i changed it to an array

#

to get deckskin for all ranks would i have to copy this 4 times and change the suits?

SMODS.DeckSkin {
    key = "hearts",
    suit = "Hearts",
    loc_txt = "idk",
    palettes = {
        {
            key = "hc",
            ranks = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace",},
            display_ranks = {"Ace", "King", "Queen", "Jack"},
            atlas = "atlas",
            pos_style = "deck",
            suit_icon = {
                atlas = "icon",
            }
        }
    }
}
ancient mango
#

bru

#

i seem to have forgotten basic lua knowledge

#

how do i comment

frosty dock
#

-- comment

ancient mango
#

thx (im stupid)

frosty dock
#

i mean no other language does this, it's easy to forget 🤷‍♂️

normal crest
#

Np (im stupid too)

frosty dock
#

doesn't mean you're stupid

ancient mango
#

yea im too used to fkn python

sly heron
#

my game crashes after I tried use my custom poker hand.

sly heron
#

`SMODS.PokerHand ({
key = "pkr_youstupid",
chips = 9,
mult = 10,
l_mult = 21,
l_chips = 21,
example = {
{ 'S_A', true }, -- King of Spades, does not score
{ 'D_2', true },
{ 'H_8', false, enhancement = 'm_lucky' }, -- Negative Lucky 9 of Diamonds, scores
{ 'S_5', false },
{ 'D_J', false, seal = 'Red' } -- Red Seal 3 of Diamonds, does not score
},
loc_text = {
name = "You stupid!",
description = {"A hand containing a 2 and a ace"}
},
visible = true,

evaluate = function (parts,hand)
    if #hand >= 2 then
        local _has2 = false
        local _hasAce =false
        local eligible_cards = {}
        local other_hands = next(parts._flush) or next(parts._straight) or next(parts._all_pairs)

        for i,card in ipairs(hand) do
            if card:get_id() == 2 and _has2 == false then
                _has2 = true
                eligible_cards[#eligible_cards+1] = card
            elseif card:get_id() == 14 and _hasAce == false then
                _hasAce = true
                eligible_cards[#eligible_cards+1] = card
            end
        end

        if _has2 and _hasAce and not other_hands then
            return {eligible_cards}
        end
    end
end,

modify_display_text = function (self, cards, scoring_hand)
    return pkr_youstupid
end,

})`

ancient mango
#

three ` instead of one

frosty dock
ancient mango
#
this
is
three

this is one

frosty dock
#

rn you're returning nothing when a single card is selected

ancient mango
#

does print() work, if not is there someone else that will work

frosty dock
ancient mango
#

Wherr does it print to

#

Also what do you mean expand tables

frosty dock
frosty dock
ancient mango
wintry solar
#

New release fixing numerous bugs available now!

ancient mango
#

it took me ay WAY too long but the textures work

gilded blaze
#

that pip structures of the 9

#

it pains me

ancient mango
#

the what pains you?

#

@gilded blaze

gilded blaze
#

how suit pips are structured on the 9

ancient mango
#

why?

#

its symetrical

gilded blaze
#

I'm too used to the standard one

#

also the 7 😭

ancient mango
#

yea well the normal ones make me want to kill someone (cause autism) its so uneven the normal ones

rigid solar
ancient mango
#

?

sly heron
#

my game crashes when tried to play a sound (that path exists, idk why it carshes with this message).

slim ferry
#

mod prefix

sly heron
#

Game crashed while checking my custom poker hand

silent sail
#

im very confused, i have an edition with a chance based effect but it seems to steal the odds of any card that has odds

#

ok i fixed the description but now its stealing odds without telling me

viscid talon
#

Can challenges have a custom consumable slot number? if so, how would i program that in?

#

would smth like { id = 'consumable_slot', value = 4 }, work?

mystic river
#

idk if there's anything programmed in already, but those entries mainly serve as lines in the description (with vanilla having some hard coded effects if it sees any it recognizes)
using an apply function will definitely work

frosty rampart
#

yea if challenges don't have something specific you're looking for, the apply function will let you do literally anything to the run

mystic river
#

the calculate function can also do things

#

though in this case it wouldn't work very well

silent sail
#

loc_vars = function(self, info_queue, card)

    local info_queue_0 = G.P_CENTERS["p_baggutro_blackseal"]
    if info_queue_0 then
        info_queue[[#1116390750314307698](/guild/1116389027176787968/channel/1116390750314307698/)_queue + 1] = info_queue_0
    end
end,

is this the correct way to info que for a consumable?

viscid talon
#

apply function........

slim ferry
mystic river
#

seals don't live in G.P_CENTERS, they live in G.P_SEALS
(kinda arbitrary but that's thunk)
though I'm unclear if you can info queue a seal directly like a center; it's a smods function

slim ferry
#

but consumable info queues are the exact same as any other object

frosty rampart
gilded blaze
slim ferry
viscid talon
#
-- [REDACTED]
SMODS.Challenge {
    key = 'redacted',
    config = { consumable_slot = 2 },
    rules = {
        modifiers = {
            { id = 'joker_slots', value = 3 },
        }
    },
    jokers = {
        { id = 'redacted', eternal = true },
    },
    consumeables = {
        { id = 'c_emperor' },
        { id = 'c_emperor' },
    },

    apply = function(self, challenge)
        G.GAME.starting_params.consumable_slots = G.GAME.starting_params.consumable_slots + self.config.consumable_slot
    end,
}```
#

ive redacted certain info to prevent spoilers (this is NOT for the joker jam)

#

but would tbis be right

silent sail
gilded blaze
mystic river
# viscid talon but would tbis be right

apply doesn't take a "challenge" parameter, just self
this won't break anything today since you don't use it anyway, but it might if you come back in future and think it does something

gilded blaze
viscid talon
#

oe

gilded blaze
#

this is the piece of code that handles modifying starting parameters

silent sail
#

loc_vars = function(info_queue)
info_queue[#1116390750314307698_queue + 1] = G.P_SEALS["p_baggutro_blackseal"]
end,
is this right?

#

because its not working

slim ferry
#

p is not the prefix for a seal

#

seals do not have a class prefix

mystic river
#

that I in the length is erroneously capitalized
lua is case sensitive

#

info_queue is a different variable from Info_queue

slim ferry
silent sail
#

oh its not capitalised in my code how has it done that

mystic river
#

ah, discord
probably use the code markup. impossible to demonstrate but just wrap your code in triple backticks

median veldt
mystic river
#

` <- that guy, probably lives left of 1

median veldt
#

what the fuck

#
#info
#

yeah there you go

mystic river
silent sail
#
        info_queue[#info_queue + 1] = G.P_SEALS["p_baggutro_blackseal"]
    end,
median veldt
#

#awaw

#

why does it do that with only the letter i

mystic river
#

wow that's both specific and thorough

#

#i

median veldt
mystic river
median veldt
#

it's probably just #info*

#

what the hell 🥹

frosty rampart
mystic river
slim ferry
#

p is the prefix for booster packs

mystic river
#

oh yeah those guys

silent sail
#

i removed it but it still doesnt work

frosty dock
mystic river
#

oh yeah
self, info queue, card

gilded blaze
#

wrong arguments
game expects loc_vars(self, info_queue, card), not loc_vars(info_queue)

{
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_SEALS["baggutro_blackseal"]
    end
}
frosty dock
#

this was correct earlier, why did you change it.. 🤔

gilded blaze
silent sail
#

idk i just assumed it wasnt

frosty dock
#

huh

gilded blaze
#

it wasn't working because of something else, why would you assume it's the arguments

silent sail
#

hhonretly no clue

#

i cant spell ok then

#

splended

#

it works ok thanks guys

viscid talon
#

ok so theres a weird bug

#

it says this

#

however in game, it gives the intended amount

gilded blaze
#

did you modify consumable slots via apply

viscid talon
#

yeah

gilded blaze
viscid talon
#

omg

#

oke

#

im ngl i didnt know that was a thing

mystic river
#

i always forget about that column of challenges tbh

gilded blaze
silent sail
#

whats the prefix for enhancements?

gilded blaze
#

m

silent sail
#

thanking you

median veldt
#

is it possible to forcetrigger a card's enhancement ability?

gilded blaze
#

as long as it handles forcetrigger like how jokers do

slim ferry
#

assuming this is about the spectrallib forcetrigger feature yeah

#

as long as the enhancement has compat for it

silent sail
#
        info_queue[#info_queue + 1] = G.P_CENTRES["m_baggutro_ghostcard"]
    end,
#

how do i chhange this to get it working?

slim ferry
#

you misspelled P_CENTERS

silent sail
#

british english strikes again

frosty dock
#

i love inconsistencies

#

center / colour

silent sail
#

yep

topaz berry
#

Hey, I am trying to make a joker that can manipulate the base value of chips given from a player card, do you know where I can find there that value is stored in a playing card?

median veldt
#

okay actually maybe I should elaborate a bit
i don't really need to forcetrigger them, but i'm making a joker that makes it so held in hand abilities don't need to be in hand to trigger

gilded blaze
median veldt
#

i do not think that is the same thing at all but i think it might help

rapid stag
median veldt
slim ferry
#

wallet is quite different from just generally forcetriggering

topaz berry
median veldt
#

this is not related to what i was doing earlier

calculate = function (self, card, context)
        if context.before then
            -- undiscard
            G.E_MANAGER:add_event(Event({
                func = function ()
                    for _, _card in ipairs(G.discard.cards) do
                        _card.area:remove_card(_card)
                        _card:add_to_deck()
                        _card.from_discard = true
                        G.hand:emplace(_card)
                    end
                end
            }))
        end
        if context.after then
            -- rediscard everything
            G.E_MANAGER:add_event(Event({
                func = function()
                    local old_limit = G.hand.config.highlighted_limit
                    G.hand.config.highlighted_limit= 9999
                    local any_selected = nil
                    for _, _card in ipairs(G.hand.cards) do
                        if _card.from_discard then
                            G.hand:add_to_highlighted(_card, true)
                            any_selected = true
                            play_sound('card1', 1)
                            _card.from_discard = false
                        end
                    end
                    if any_selected then G.FUNCS.discard_cards_from_highlighted(nil, true) end
                    G.hand.config.highlighted_limit= old_limit
                    return true
                end
            }))
        end

I have ZERO idea why this doesn't work

#

After you play a hand, draw all cards from your discard pile. Discard them again after scoring.
here's what it's supposed to do

#

it does draw the cards but then the game just softlocks

#

yeah it just softlocks here

slim ferry
median veldt
#

That'll do it

#

😭

median veldt
#

And also I'm testing it by discarding a bunch of metal cards and they're just. Not doing anything

daring fern
median veldt
median veldt
median veldt
#

it's like really weird about it

buoyant shard
#

Can I access the current jokers as a list or an array?

frosty rampart
#

G.jokers.cards is a table of the jokers the player owns

granite jay
#

How do you make it so Legendary jokers can appear in shop normally?

buoyant shard
#

How do I check if there are curently exactly 5 jokers?

frosty rampart
buoyant shard
#

My joker is refusing to work. It's supposed to change art and retrigger a joker when there's exactly 5 jokers but it's doing nothing

        if context.retrigger_joker_check and not context.retrigger_joker and not context.other_card == self and #G.jokers.cards == 5 then
            if self.ability.extra.left and context.other_card == G.jokers.cards[1] then
                card.children.center:set_sprite_pos{x = 8, y = 1}
                self.ability.extra.left = false
                return {
                    repetitions = card.ability.extra.retriggers,
                    message = 'Again!',
                    card = card
                }
            elseif context.other_card == G.jokers.cards[5] then
                card.children.center:set_sprite_pos{x = 7, y = 1}
                self.ability.extra.left = true
                return {
                    repetitions = 1,
                    message = 'Again!'
                }
            end
        end
    end```
frosty rampart
#

well self.ability.extra.left doesn't exist, it should be card.ability.extra.left

buoyant shard
#

thanks

normal crest
#

that and and not context.other_card == self is not what you want, it should be and context.other_card ~= card

buoyant shard
#

It's still not working

#

#G.jokers.cards returns true and not 5 in the console, so how else do I check there's 5 jokers?

buoyant shard
#

ok nevermind

#

after console testing, it looks like context.retrigger_joker_check isn't returning true for some reason

buoyant shard
#

How did I scroll past that?

#

thank you so much!

median veldt
#

mhm!

median veldt
#

the issue is that for some reason it's not undiscarding every card in G.discard
it's leaving some behind

silk latch
#

Why are the values for TCFNA listed as nil?

            j_neonmod_tcfna = {
                name = 'The Campaign for North Africa: The Desert War 1940-43',
                text = {
                    "Gains {X:mult,C:white} ^#2# {} Mult per {C:enhancement}Enhanced{} card in your full deck",
                    "if at least half of the cards in your full deck are {C:enhancement}Enhanced{}",
                    "{C:inactive}(Currently {C:attention}#3#{C:inactive} out of {C:attention}#4# {C:inactive}){}",
                    "{C:inactive}(Currently {X:mult,C:white} ^#1# {} Mult)",
                },
            },
frosty rampart
#

you aren't actually returning anything in your loc_vars function

median veldt
silk latch
#

It was initially meant to be if they had an edition, enhancement, and seal, but getting that to work would be a nightmare

median veldt
#

Not really

silk latch
#

Yes really when I don't know what the fuck I'm doing

median veldt
frosty rampart
#

not really when it's documented ^^^

silk latch
frosty rampart
#

did you see the part where it checks for edition and seal too

silk latch
#

by stitching together shit from cryptid + steel joker

median veldt
#

Nonono look at my link again

#

VanillaRemade has a wiki

frosty rampart
#

yea the vanillaremade wiki answers a lot of common questions

#

including "how to check for edition", "how to check for enhancement", and "how to check for seal"

median veldt
#

Also please don't cross reference cryptid for the love of Jimbo

#

That codebase is a mess

#

At least not as a beginner

silk latch
#

Mainly just did that to figure out how to refer to the exponential mult lol

median veldt
#

Ah yeah fair

silk latch
#

So then would it be like this?

        for _, playing_card in ipairs(G.playing_cards) do
            if SMODS.has_enhancement(playing_card) and SMODS.has_seal and SMODS.has_edition then
                --- words
            end
        end
silk latch
daring fern
# silk latch updated version

No, it would be if next(SMODS.get_enhancements(playing_card)) and playing_card:get_seal() and playing_card.edition

rapid stag
#

is G.shop_jokers.cards still populated when context.ending_shop occurs?

sturdy compass
silk latch
#

okay so now what

sturdy compass
#

talisman moment

frosty rampart
#

replace talisman with amulet

sturdy compass
#

use Amulet instead

silk latch
#

(I've been getting this sort of crash when playing a hand)

#

fuckkkk

#

fine

frosty rampart
#

there is literally zero reason to use talisman over amulet

silk latch
#

I'm just lazy lol

keen atlas
#

thats new

sturdy compass
#

I'm betting it's from old talisman code stuck in a continued run

keen atlas
#

returned repetition is a omeganum somehow

#

what jokers do you have?

silk latch
keen atlas
#

wrap it in to_number(...)

#

also if your mod doesnt depens on talisman add to_number = to_number or function(x) return x end

silk latch
#

where would I put the to_number = to_number or function(x) return x end?

keen atlas
#

at the top of the file

silk latch
daring fern
silk latch
#

I did that but it's still not doing anything.

#

Have yet to update the description

daring fern
rapid stag
#

is is_rarity a function in Card or part of card.config.center?
card:is_rarity(...) / card.config.center:is_rarity(...)

rapid stag
true jasper
sturdy compass
#

Set card.cost = number?

white zinc
#

so i found this "mod" on gamebanana that changes the textures for some of the vanilla decks. however, it wasn't really a mod and just included the .png files. what's the easiest way to get these into my game?

tulip pecan
#

Where in the code does the game go through and trigger context.joker_main for each of the jokers? I want to make an effect that adds extra triggers to any joker that meets certain requirements, but this could happen for any joker, so I don't want to take ownership of them all just to edit the code as such, so I figured that either hooking or patching the code that triggers the jokers would let me re-trigger them somehow.

near coral
#

How do you make it to where stickers have a 30% chance of appearing, or is that the default

daring fern
near coral
#

Oh okay

tulip pecan
near coral
wary moth
#

What can I hook to that is effectively like a global update loop?

#

doesn't have to be a hook either necessarily

tulip pecan
tulip pecan
#

oh yeah i should probably read the wiki

daring fern
median veldt
daring fern
median veldt
#

what does that do?

daring fern
median veldt
#

I see

elder rune
#

Is it possible to make a rarity that doesn't create a badge

median veldt
#

Ok well technically anything is possible but you'd have to do patches or hooks

wary moth
distant junco
#
    key = "cosmic",
    loc_txt = {
        name = "Test Deck",
        text = {
            "Start with {C:purple}Satellite{},",
            "{C:blue}Planet Merchant{}, and {C:blue}Planet Tycoon{}",
            "Hands start at level {C:attention}0"
        }
    },
    config = { jokers = { "j_satellite",}, voucher = { "v_planet_merchant", "v_planet_tycoon" } },
    atlas = "vegas_jokers",
    pos = {x = 0, y = 4},
    discovered = true,
    unlocked = true,
    apply = function(self, back)
        local args = { level_up = -1, instant = true }
        SMODS.upgrade_poker_hands(args)
    end
}```
trying to make a deck and i keep getting a crash. when I comment out the config is doesnt
daring fern
distant junco
#

fuck

#

i thought i put vouchers

#

thanks

silk latch
#

How would I check for which other Jokers didn't trigger during a given ante?

gilded blaze
# silk latch How would I check for which other Jokers *didn't* trigger during a given ante?

takes a bit to set up, but it should be like this:

SMODS.current_mod.optional_features = {
    post_trigger = true, -- enable post-trigger calculation
}
function SMODS.current_mod:calculate(context)
    if context.post_trigger and context.other_card.ability and context.other_card.ability.set == "Joker" then
        -- add a triggered flag (unique to your mod)
        context.other_card.ability.modprefix_triggered = true
    end
    if context.ante_change and context.ante_end then
        -- remove triggered flags at end of ante
        -- code assumes all jokers are in G.jokers (optimal method to cover all possible joker cards omitted for brevity)
        for _, v in ipairs(G.jokers.cards) do
            v.ability.modprefix_triggered = nil
        end
    end
end
silk latch
#

Thanks

grizzled tide
#

Which function should I hook to affect all draws? I saw context. drawing_cards but I’m worried that it won’t consider when other jokers modifying

queen crescent
#

no way im doing things

grizzled tide
sly heron
slim ferry
#

calc_dollar_bonus should return a number, not a table

fallen timber
#

why my locale file doesn't work at all?
localization/en_us.lua:

return {
    descriptions = {
        Tarot = {
            c_liroxfunstuff_neon_weapon_purify = {
                name = "Purify",
                text = {
                    "Next {C:green}5{} scored jokers give {C.mult}+25{} Mult"
                },
            }
        }
    }
}

The key is right (i hope):

    object_type = "Consumable",
    atlas = "neon_weapon_purify",
    key = "neon_weapon_purify",
    set = "weapons",

The set:

SMODS.ConsumableType {
    key = "weapons",
    default = "c_liroxfunstuff_weapon_stick",
    primary_colour = HEX("e62314"),
    secondary_colour = HEX("e62314"),
    collection_rows = { 5, 6 },
    shop_rate = 4
}
queen crescent
slim ferry
#

But also custom consumable descriptions go in their own category, not Tarot

fallen timber
slim ferry
#

Yea

fallen timber
#

thanks!

sly heron
#

game is crashing after I want to check run info (i think i could be coused by new poker hand I added)

queen crescent
frosty dock
queen crescent
frosty dock
#

then put the code where that local is? gonna need more context if that doesn't help

queen crescent
frosty rampart
#

patch jen.lua

frosty dock
#

I mean it'd be better style to take that from some global table initialized once

#

like this you'll have to patch where this is

frosty rampart
#

but also get jen to make that not a local lmao

gilded blaze
#

I mean, if he's fine with cross-mod that is

queen crescent
gilded blaze
#

ah, patching is the only way then

#

you can do a simple patch to make it a global
then do the modifications on your end

gilded blaze
#

is there a redefining of uno_data?

#

that's an unnecessarily complicated pattern

#

you just need to patch the very first line

queen crescent
#

so like this?

gilded blaze
#

yes

#

target is a bit different tho

frosty dock
#

wouldnt that still override the old table on each call?

gilded blaze
#

it should be '=[SMODS jen "jen.lua"]'

frosty dock
#

uno_data = uno_data or {

gilded blaze
frosty dock
#

I don't even know what the function in question is

#

Just seems like a footgun

gilded blaze
#

I'm assuming it's a local table containing init values for adding several game objects related to suit/rank leveling

queen crescent
#

yes

gilded blaze
#

therefore it's called once

frosty dock
#

then is it not too late to modify it after the function has been called?

#

In which case you have to patch your modifications into the function

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


[[patches]]
[patches.pattern]
target = '=[SMODS jen "Jen.lua"]'
pattern = '''
local uno_data = {
'''
position = 'at'
payload = '''
uno_data = {
'''
match_indent = true
``` this is the thing so far
#

my brain is not braining

frosty dock
#

I don't think making it global helps you

queen crescent
slim ferry
#

making it global doesnt help bruh

frosty dock
#

to clarify, the table lives entirely inside the given function and has fulfilled its time by the time the function returns. however it only gets creates once the function is called, so there is no way to make use of it outside of the function

slim ferry
#

its a table that is used ONCE

#

Yeah

#

Its used once to loop over to create all the uno cards automatically

frosty dock
#

to make it a useful global, you'd have to define it before the function

slim ferry
gilded blaze
#

bruh DEAD

queen crescent
#

😭

gilded blaze
#

it's not like I have access to the mod files

frosty dock
gilded blaze
#

I have absolutely no idea what's behind uno_data