#💻・modding-dev

1 messages · Page 597 of 1

frosty rampart
#

I believe that's G.hand.config.card_limit

brave blade
#

Can anyone help me with this?

faint yacht
#

Check for context.starting_shop, then look for .cards of G.shop_jokers, G.shop_booster and G.shop_vouchers and do what you want.

gaunt thistle
#

in theory we could load an smods stub first thing when we get access to lua state (so probably before boot.lua) that can do validation work and whatnot

#

but you'll be running in an environment with basically 0 love functions

brave blade
#

Do tooltips for stickers not work? This is what I have right now

sturdy compass
#

I think tooltips only work for centers and stickers are not centers

brave blade
#

Ugh that's annoying

#

Is there another way to do it without an annoying amount of effort?

sturdy compass
#

Probably not

granite jay
#

Anyone know how to make config menus that actually work?
I'm trying to make a settings menu in my mod so you can enable/disable certain jokers but for some reason it won't save.

#

Here's the github for my mod so you guys can see where I went wrong

#

(I copied UTDR's system but apparently they have the same issue mr_bones)

native bone
#

I've been stuck with displaying values. I cannot get the joker to display freindyMult for some reason. I looked at a tutorial, and that has not fixed the problem.

native bone
#

Does the config table start at 0?

native bone
native bone
fluid steppe
#

does anyone know how no_ranks works? i have this under my challenge description but it's not doing anything

        deck = {
            type = 'Challenge Deck',
            no_ranks = { r = '7' } 
        },
#

wait

#

no it's not no_ranks = { {r = '7'} } either

#

oh

#

it's no_ranks = { ['7'] = true }

#

wait no its not what

sturdy compass
#

You need to put the no_ranks table in deck = {}

fluid steppe
#

it is

sturdy compass
#

Huh this is pretty weird

next timber
#

ok djungelskog works properly now

#

oops wrong chat
whatever

fluid steppe
versed swan
#

Can you disable Steamodded with a .lovelyignore file?

fluid steppe
shadow haven
#

Ok so- For some reason this joker is supposed to only activate when cards are scored, but it activates at the end of the played hand for some reason, anyone knows why?

fluid steppe
#

context.joker_main is what the context is after cards are scored and jokers start triggering

shadow haven
fluid steppe
#

..you already have it there as far as i can tell, context.individual

fluid steppe
#

it was that i was putting it under the restrictions table when its its own table

shadow haven
#

from what i tested, it stopped activating at the end, but now it activates on ANY card played (only supposed to activate on kings/queens)

fluid steppe
#

uh

#

hold on

shadow haven
fluid steppe
#
calculate = function(self, card, context)
  if context.individual and context.cardarea == G.play and (context.other_card:get_id() == 12 or context.other_card:get_id() == 13) then
    return {
      ((context.other_card:get_id() == 12 and e_mult) or e_chips) = card.ability.extra.power 
      colour = ((context.other_card:get_id() == 12 and G.C.MULT) or G.C.CHIPS)
      card = card
    }
  end
end
#

try that

shadow haven
fluid steppe
#

did it work?

shadow haven
#

ITS WORKING

#

🙏

fluid steppe
#

nice

shadow haven
#

Thank you so much

brave blade
junior quartz
#

is this written correctly to perform the following mechanic?

fluid steppe
#

i mean. press start game and check yourself

junior quartz
#

i cant

fluid steppe
#

w

#

huh

junior quartz
#

they actually dont make balatro modding for chromebooks

#

and i dont have money

fluid steppe
#

damn

junior quartz
#

im not letting that stop me though

rocky plaza
junior quartz
#

yeah

#

i've tried like so much to get this thing to do anything

rocky plaza
#

i think u can do some shit with linux

junior quartz
#

but apparently my CPU is like one of the ones that cant

rocky plaza
#

to load linux as an alternate os

#

ah

junior quartz
#

yeah

#

and like

#

I own Balatro on here too

#

I use the mobile version

#

with my mouse

rocky plaza
#

ah

junior quartz
#

it's very annoying

rocky plaza
#

yeah theres no convenient solution for modding the mobile executable

junior quartz
#

i'm well aware brah,

rocky plaza
#

oh also u should probably put the segment that increases the joker's xmult inside an if not context.blueprint to prevent blueprint doing an extra scale

junior quartz
#

oh yeah u right

rocky plaza
junior quartz
#

ah

#

sorry I'm just not familiar with lua

#

i only know HTML and CSS currently

muted trout
#

does anyone know what investment tag is called in the files

daring fern
muted trout
#

ty

paper trout
#

does anyone know how to add a new stat for the run and a box to the ui that displays it (like for money, ante, etc.)
ive looked at the docs but i think im too stupid to figure it out 😭

rocky plaza
paper trout
#

yeah

rocky plaza
#

hoo boy its gonna be a rough ride

#

do you know how to lovely patch

paper trout
#

uhh no

#

you dont have to help if its too annoying lol

rocky plaza
# paper trout yeah

actually in general how familiar are u with modding balatro
in particular u need to hook functions and save data to G.GAME

#

cuz this task also involves making balatro UI

paper trout
#

ive added some jokers and tarots and all the easy stuff (before jokerforge so i at least know how to do that myself) but that's it

#

i dont wanna like

rocky plaza
#

yeah i would suggest practicing UI for a bit by making a fancier mod config page before adding to the scoring ui

paper trout
#

ok

rocky plaza
#

because UI can be really scary if u dont know how it works
the config tab is the least complex spot to start practicing ui

rocky plaza
#

look at thaumaturgy.lua, hooks.lua and the singular toml file if u do decide to look at it

paper trout
#

ok ty

rocky plaza
#

fortunately if u can add to the config page u can pretty much do whatever u want with the hand/discard ui

#

and etc.

unborn steeple
#

can someone help me with something extremely minor? I basically just need to know how to do one specific thing in lua

rocky plaza
#

what do u need to do

unborn steeple
#

basically I need to know what lines I need to put into my NameOfMod.lua file in order to make my localization/en_us.lua, uh, activate? I don't know how to say it properly

rocky plaza
#

is ur mod loading?

#

also check to see if ur localization file is set up correctly

unborn steeple
#

lemme double-check, hold on

#

hm.

#

okay. disregard me. apparently it just works

#

I had to do extra stuff to make my sprite edits work but the text edit works immediately apparently! thank you for your help and for your patience 🤝

rocky plaza
#

np

junior quartz
#

should i expect this to work or no

winter flower
junior quartz
#

they dont make steammodded for chromebooks

#

or steam, for that matter

winter flower
#

i

#

what

junior quartz
#

they do not make

#

steam

#

or steammodded

#

for chromebooks

winter flower
#

then what are you trying to do

junior quartz
#

make a mod

#

im not just gonna let my hopes and dreams die because i dont have the tools

winter flower
#

unless

junior quartz
#

i've tried.

#

i've tried so many things

#

i have spent hours on end researching

#

to try and find anything

#

but the CPU in this god forsaken hunk of junk isn't compatible with anything.

granite jay
#

Hey I’m making a card that deducts chips if certain cards are scored and I’m working on a failsafe to ensure chip count never goes below 0. For some reason, hand_chips doesn’t update after the card gives its score.

Any way the joker could get the amount of chips granted by the card so that can be taken into account?

naive agate
#

trying to make a card that adds .25 of first scoring face card's chips to xMult, this definitely looks like it wouldn't work but here's what I have so far
anything I'd need to do for this to work properly?

muted trout
#

how do i make something display as xmult in the descripotion?

slim ferry
unkempt bronze
#

Somehow, my booster pack can't be spawned in, due to it not having an area to spawn in, for some reason.

slim ferry
#

eval SMODS.add_booster_to_shop(<p_modprefix_key>)

unkempt bronze
#

add that to the code or?

slim ferry
#

run with debugplus

muted trout
slim ferry
unkempt bronze
slim ferry
#

are you in the shop

unkempt bronze
#

no

slim ferry
#

consider adding a booster to the shop whilst in the shop

muted trout
#

Like (currentlt 1x)

slim ferry
#

okay that link formatting doesnt work on discord ig whatever

unkempt bronze
slim ferry
#

did you get the key right

glass scaffold
slim ferry
#

thanks

unkempt bronze
muted trout
slim ferry
#

wdym display it "as xmult"

#

just add an X in front of it

muted trout
#

Iirc colored text used {C:something} have I been doing it wrong the whole time 😭

unkempt bronze
slim ferry
unkempt bronze
#

want me to show the pack code?

slim ferry
#

then its {X:mult,C:white}

slim ferry
muted trout
slim ferry
#

and also whatever debugplus is saying when you run the command

unkempt bronze
# slim ferry yes
    key = "Elements_of_the_Round_Table",
    path = "1357924680.png",
    px = 57,
    py = 93
}

SMODS.Booster {
    key = "mendeleev",
    weight = 0.25,
    kind = 'xiferp_Element', 
    cost = 8,
    pos = { x = 0, y = 0 },
    config = { extra = 8, choose = 2 },
    group_key = "k_element_pack",
    loc_vars = function(self, info_queue, card)
        local cfg = (card and card.ability) or self.config
        return {
            vars = { cfg.choose, cfg.extra },
        }
    end,
    ease_background_colour = function(self)
        ease_background_colour_blind(G.STATES.STANDARD_PACK)
    end,
    particles = function(self)
        G.booster_pack_sparkles = Particles(1, 1, 0, 0, {
            timer = 0.015,
            scale = 0.3,
            initialize = true,
            lifespan = 3,
            speed = 0.2,
            padding = -1,
            attach = G.ROOM_ATTACH,
            colours = { G.C.BLACK, G.C.RED },
            fill = true
        })
        G.booster_pack_sparkles.fade_alpha = 1
        G.booster_pack_sparkles:fade(1, 0)
    end,
    create_card = function(self, card, i)
        return {
            set = "Element Card",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = true,
            key_append = "xiferp_ele"
        }
    end,
}```
umbral zodiac
#

how do you add extra info to a mod for crashes like how talisman adds the current bignum setting

unkempt bronze
slim ferry
#

thats just that you wrote the command wrong

unkempt bronze
#

oh. should I have left the <>?

slim ferry
#

no

#

did you make the key a string

unkempt bronze
#

and I did the rest right

unkempt bronze
#

no

slim ferry
#

that youre running

umbral zodiac
#

i asked here so that i could offload the searching to someone else while i do the harder thing

wind steppe
#

so true

unkempt bronze
slim ferry
#

thats not a string

unkempt bronze
#

I made it a string, opened the pack, and then it crashed again

slim ferry
#

then its an issue with the pack

#

not the command

#

send the crash log

unkempt bronze
unkempt bronze
slim ferry
#

the type you return in your booster is wrong

#

it should be the key

unkempt bronze
#

of the cards or the booster?

slim ferry
#

in the return table of create_card

#

in the booster

unkempt bronze
#

so, set = "xiferp_Element",

#

is what it should be?

slim ferry
#

yes\

wind steppe
umbral zodiac
#

thanks ya

wind steppe
#

this is what talisman does:

umbral zodiac
#

hash time

unkempt bronze
# slim ferry yes\

Also, while you're here, the ERROR text should be Element Cards. How do I fix that?

slim ferry
#

dictionary in localization should have it under <b_key_cards>

#

if youre using loc_txt, it should go under collection in there

unkempt bronze
#

I don't have dictionary in localization, should I put one?

slim ferry
#

yes, it should be under misc

unkempt bronze
#

Don't even have misc, do have labels

slim ferry
#

misc is also what labels is supposed to be under

unkempt bronze
#

Ah. Also, the pack has no text or the right image

slim ferry
#

booster text should go under Other

unkempt bronze
#

and the image?

slim ferry
#

read the coordinates from your spritesheet correctly

unkempt bronze
#

it has one thing. The one design of the pack

#

at (0,0)

slim ferry
#

and did you make an atlas for it

unkempt bronze
#

where it should be

unkempt bronze
slim ferry
#

and are you using that atlas key

unkempt bronze
#
    key = "Elements_of_the_Round_Table",
    path = "1357924680.png",
    px = 57,
    py = 93
}```
Here's the altas part of the code (a different key than the jokers and the elements)
slim ferry
#

yeah, your booster doesnt even have atlas defined in your code

#

also boosters are also 71x95 like any other card

unkempt bronze
#

Oh.

unkempt bronze
slim ferry
#

b_xiferp_Element_cards = <collection name>

unkempt bronze
#

gotcha

#

thank you for all your help

naive agate
#

main.lua:1961: [SMODS VSMODS "ModdedVanilla.lua"]:2133: attempt to perform arithmetic on a table value

#

line 2133 is card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_mod * context.scoring_hand[i]

#

wait

#

hold on

hardy viper
#

i remember something like that existing

#

okay i checked

#

SMODS.current_mod.debug_info

muted trout
#

apparently something is nil

naive agate
#

main.lua:1961: [SMODS VSMODS "ModdedVanilla.lua"]:2133: attempt to perform arithmetic on field 'nomial' (a nil value)

daring fern
naive agate
#

oops

daring fern
naive agate
slim ferry
#

card:get_chip_bonus should only be used if you want total chips instead of base chips iirc

muted trout
wind steppe
#

why does this effect still trigger when this joker is sold?

unkempt bronze
slim ferry
#

localization keys should be all lowercase, did you do that?

#

also what image is the pack showing

unkempt bronze
#

the arcana pack

slim ferry
#

then you need to actually put an atlas in your pack

#

that would probably help

unkempt bronze
unkempt bronze
slim ferry
#

and?

#

it should still be lowercased in localization

unkempt bronze
#

as for the atlas?

slim ferry
#

show the booster code

unkempt bronze
#
    key = "Elements_of_the_Round_Table",
    path = "1357924680.png",
    px = 57,
    py = 93
}

SMODS.Booster {
    key = "mendeleev",
    altas = "Elements_of_the_Round_Table",
    weight = 0.25,
    kind = 'xiferp_Element', 
    cost = 8,
    pos = { x = 0, y = 0 },
    config = { extra = 8, choose = 2 },
    group_key = "k_element_pack",
    loc_vars = function(self, info_queue, card)
        local cfg = (card and card.ability) or self.config
        return {
            vars = { cfg.choose, cfg.extra },
        }
    end,
    ease_background_colour = function(self)
        ease_background_colour_blind(G.STATES.STANDARD_PACK)
    end,
    particles = function(self)
        G.booster_pack_sparkles = Particles(1, 1, 0, 0, {
            timer = 0.015,
            scale = 0.3,
            initialize = true,
            lifespan = 3,
            speed = 0.2,
            padding = -1,
            attach = G.ROOM_ATTACH,
            colours = { G.C.BLACK, G.C.RED },
            fill = true
        })
        G.booster_pack_sparkles.fade_alpha = 1
        G.booster_pack_sparkles:fade(1, 0)
    end,
    create_card = function(self, card, i)
        return {
            set = "xiferp_Element",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = true,
            key_append = "xiferp_ele"
        }
    end,
    loc_txt = {
        name = 'Element Pack',
                text = {
                    'Pick 2 of 8 Element Cards to use later',
                },
            },
}```
slim ferry
#

yeah, you still dont have an atlas set for your booster

unkempt bronze
#

oh, typo

#

I have an altas set for it

#

still says error on the button, but the pack's right

unkempt bronze
slim ferry
#

you have b_xiferp_element_cards under dictionary, right?

#

assuming you are actually using a localization file

unkempt bronze
#

is it supposed to be b_xiferp_element_cards?

slim ferry
#

yes

unkempt bronze
#

oh.

#

It worked as just xiferp_element for the cards themselves

#

Woo! Eris, may I make a joker of you?

slim ferry
#

🤷

#

i you want i guess

unkempt bronze
#

anything you want it to be or do? (5 2-letter words in a row, go me!)

slim ferry
#

i dont just have ideas lined up for the niche case that this happens

#

so no

unkempt bronze
#

oh

#

Well, while I'm here, might as well ask: how do you change two random cards in hand?

slim ferry
#
local options = {}
local chosen = {}
for _, c in ipairs(G.hand.cards) do
  options[#options+1] = c
end
for _ = 1, math.min(<cards to get>, #options) do
  local roll = pseudorandom(1, #options)
  chosen[#chosen+1] = options[roll]
  table.remove(options, roll)
end
``` i have this for choosing x random cards from an area
#

from there you should be able to do your suit changing stuff on cards in chosen

unkempt bronze
slim ferry
#

<cards to get>

unkempt bronze
#

ah

frigid cargo
#

how do i check how many cards are unscored in the played hand?

pale holly
#
 if context.individual and context.discard  and SMODS.pseudorandom_probability(card, 'cymbal_remancedream', card.ability.extra.numeratwo, card.ability.extra.odders, 'dreemurr') then
    context.other_card:set_ability(SMODS.poll_enhancement {key = "cymbal_remancedream", guaranteed = true})    
   end

Hi again, trying to make my joker give an enhancement to the cards i discard with a 1/6 chance each, prediscard and discard won't work so i'm not sure what is wrong

slim ferry
slim ferry
frigid cargo
pale holly
#

ah ? I wanted the luck to apply for every single discarded cards and not all of them at once

slim ferry
#

yeah

#

thats what that would do

#

context.discard is already for individually discarding cards

pale holly
#

pre_discard works the same ?

slim ferry
#

pre_discard triggers once before the discard

#

and with no other_card

unkempt bronze
slim ferry
#

nothing

#

its an empty table so cards can be added in in the loops

pale holly
unkempt bronze
#

ah.

unkempt bronze
slim ferry
#

no you would do an ipairs loop over chosen

unkempt bronze
#

ah

#

like the one in the main code!

#

How do I select a random seal? just like... pseudorandom_element(seal keys)?

slim ferry
#

SMODS.poll_seal("seed")

unkempt bronze
#

alright! And I take it similar setups exist for enhancements and stuff like foil?

slim ferry
#

there is SMODS.poll_enhancement, but SMODS.poll_edition wont exist until next release so you'll have to use the basegame poll_edition

unkempt bronze
#

alrighty!

unkempt bronze
# slim ferry SMODS.poll_seal("seed")
SMODS.Consumable {
    key = "magnesium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 0, y = 0 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,    
    loc_txt = {
        name = 'Magnesium',
                text = {
                    'Gives 2 random cards a random seal',
                    'and adds +10 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkemetal_chips = (G.GAME.xiferp_alkemetal_chips or 0) + 10
        local options = {}
        local chosen = {}
            for _, c in ipairs(G.hand.cards) do
              options[#options+1] = c
            end
            for _ = 1, math.min(2, #options) do
              local roll = pseudorandom(1, #options)
              chosen[#chosen+1] = options[roll]
              table.remove(options, roll)
            end
            for _, c in ipairs(chosen) do
              local seal_the_deal = SMODS.poll_seal("shuffletheseed")
                 local conv_card = chosen
                    G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    func = function()
                       conv_card:set_seal(seal_the_deal, nil, true)
                   return true
            end
        }))
     end
end
}```
I think I set something up wrong. It isn't adding a random seal to any cards, it's doing othing
#

Except give mult in a way I can fix

slim ferry
#

it should be local conv_card = c

unkempt bronze
#

any other changes?

unkempt bronze
slim ferry
#

no

unkempt bronze
#

still didn't apply any seals

slim ferry
#

oh wait

#
local options = {}
local chosen = {}
for _, c in ipairs(G.hand.cards) do
  options[#options+1] = c
end
for _ = 1, math.min(<cards to get>, #options) do
  local roll, i = pseudorandom(1, #options)
  chosen[#chosen+1] = options[i]
  table.remove(options, i)
end
#

made a small mistake

unkempt bronze
#

and it was...

slim ferry
#

i did not get the index from pseudorandom

unkempt bronze
#

Okay, ykw?

#
        G.GAME.xiferp_alkemetal_chips = (G.GAME.xiferp_alkemetal_chips or 0) + 10
            local options = {}
            local chosen = {}
                for _, c in ipairs(G.hand.cards) do
                  options[#options+1] = c
                end
                for _ = 1, math.min(2, #options) do
                  local roll, i = pseudorandom(1, #options)
                  chosen[#chosen+1] = options[i]
                  table.remove(options, i)
                end
            for _, c in ipairs(chosen) do
              local seal_the_deal = SMODS.poll_seal("shuffletheseed")
                 local conv_card = c
                    G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    func = function()
                       conv_card:set_seal(seal_the_deal, nil, true)
                   return true
            end
        }))
     end
end
}```

What did I do wrong?
slim ferry
#

i dont see any issues

unkempt bronze
#

no seal are being placed

slim ferry
#

okay well idk then

unkempt bronze
#

Must be setting things up weirdly. you know anyone who could help?

slim ferry
#

not specifically

unkempt bronze
#

well send me anyone you think could help

wicked leaf
#

is there a way to mess with rarity weight

#

and what are the default values for rarity weight

slim ferry
#

G.GAME.<rarity key>_mod

#

multiplier to rarity weight, starts at 1

wicked leaf
#

If I want to do rare, would it be 3 or Rare

slim ferry
#

rare

wintry solar
hushed field
#

Trying to figure out how to have the cards display temporarily in the info_queue box, but it seems they spawn permanently on the screen

hushed field
#

As you can see, I forgot to return the variable called _return

#

good job me

queen meadow
#

is there a way to make it so that when a booster pack is opened, that specific booster no longer appears in subsequent shops?

slim ferry
#
if context.open_booster then
    G.GAME.banned_keys[context.card.config.center.key] = true
end
``` i think this is what your looking for
queen meadow
#

how would I go about implementing this in SMODS.Booster?

slim ferry
#

youre making a booster that only opens once?

#

i mean

#

only appears once?

queen meadow
#

yep

slim ferry
#

probably just put G.GAME.banned_keys[card.config.center.key] = true inside of the create_card

queen meadow
#

got it

#

I'm trying to make a sinner pack for my 7 deadly sins jokers

and it'd be like a deal you can say yes or no to

plucky berry
#

guys how do i check for current mult inside the calculate function

slim ferry
#

mult

plucky berry
#

oh it was that easy

#

how would you code a smeared joker for custom suits?

slim ferry
#

hook Card:is_suit, look at vanillaremade smeared joker for reference

plucky berry
#

i looked at vanillaremade but the joker doesn't have any config = or calculate =

slim ferry
#

yeah

#

check under it

plucky berry
#

oh!

#

tnx

slim ferry
#

though it uses SMODS.smeared_check and i have no clue what that is

plucky berry
#

i think bunco does that with a joker and custom suits i'll check there

#

i just didn't realize that the check would be outside of the joker object

slim ferry
#

most jokers with more unique effects work like that

#

they just check if the joker is present in some other function

plucky berry
#

like shortcut or four fingers?

slim ferry
#

yeah

#

pareidolia too, it hooks Card:is_face

lavish elm
#

how to make an edition only appear for jokers and not playing cards?

slim ferry
#

paperback does this for dichrome, i'd look into that

#

right here

plucky berry
#

pokermon also does it with shiny

#

and it has a config button to enable and disable that edition for playing cards

lavish elm
#

ok thx

stone dagger
#

Hello, what's collection_rows in SMODS.ConsumableType?

daring fern
stone dagger
#

that's a thing?

#

so it says num of rows and columns since it's a pair?

#

of the atlas?

daring fern
red flower
stone dagger
#

ok. what's a collection I think Im missing key information

red flower
stone dagger
#

ahhhh I see

#

wasn't thinking about that ok makes sense

#

thank you xD

hushed field
#

I'm checking the start run function because I'm running into some awkward save system bugs. Am I right in assuming that when a previous run is loaded G.playing_cards is filled by just going through every card area and adding existing playing cards into it?

red flower
hushed field
#

Aaah, that explains things

#

I guess I'll have to disable that value when a card is abducted, then reenable it when abducting it

gusty compass
#

sorry if im disrupting anything here but would you know what is meant by this, using set_edition to set random editions to cards when the deck is selected?

gusty compass
#

alr

#
apply = function(self)
        G.E_MANAGER:add_event(Event({
            func = function()
                for k, v in pairs(G.playing_cards) do
                    --enhancements work
                    if pseudorandom("messydeck1") < 0.5 and v.config.center.key == "c_base" then
                        v:set_ability(G.P_CENTER_POOLS.Enhanced[math.random(1,#G.P_CENTER_POOLS.Enhanced)])
                    end

                    if pseudorandom("messydeck2") < 0.15 then -- this outputs an error
                        v:set_edition(G.P_CENTER_POOLS.Edition[math.random(1,#G.P_CENTER_POOLS.Edition)])
                    end

                    if pseudorandom("messydeck3") < 0.05 then -- this outputs a different error (might be my issue)
                        v:set_seal(G.P_CENTER_POOLS.Seal[math.random(1,#G.P_CENTER_POOLS.Seal)])
                    end
                end
                return true
            end,
        }))
    end```
#

seals output an error at Card.lua line 605 fyi

wintry solar
#

you need to supply the key to these functions

#

set_edition and set_seal

gusty compass
#

is there a way to have the array be dynamic and support other mods or would i have to predefine all of the keys?

faint yacht
#

poll_enhancement, poll_edition and poll_seal exist.

wintry solar
#

SMODS.poll_enhancement/SMODS.poll_seal to be accurate

#

soon SMODS.poll_edition too for consistency

gusty compass
#

alright, i will add those two, one sec

#

enhancements seem to be fine, but idk, G.P_center_pools may not support modded enhancements so might as well

wintry solar
#

it does

#

the set_ability function just works differently

gusty compass
#

oh, but might as well use poll for consistency?

red flower
#

yes, also don't use math.random

#

next time if you need to get something from a table use pseudorandom_element, you can also do pseudorandom("seed", min, max)

gusty compass
#

also how can i fetch from the three functions as arrays

#

alr

red flower
#

the poll functions give you 1 key

gusty compass
#

one key?

red flower
#

yes, they get a random element

gusty compass
#

oh

#

well thats fantastic

winter flower
#

is there something i can hook/patch to prevent endless mode from being gray

hardy viper
#

it's not an endless mode thing

#

actually im not sure what the question is exactly

slim ferry
#

default background goes from green to grey in endless

winter flower
hardy viper
#

oh odd

slim ferry
#

not during bosses

#

normally

gusty compass
slim ferry
#

did you put the parentheses after the function

hardy viper
#

i would think itd be in ease_background_colour_blind buti do not see it anywhere

gusty compass
#

like (SMODS.poll_enhancement)?

slim ferry
#

no

#

have you ever called a function before

hardy viper
#

ah nevermind it is

#

@winter flower common_events.lua:342

gusty compass
#

i know how to use functions but im not sure how to access the random value inside the function, since lua print(SMODS.poll_enhancement) outputs "function and a hash"

slim ferry
#

yes, because you arent calling the function

#

youre printing the function itself

hardy viper
#

( and its not a hash its the memory address of the function

gusty compass
#

yea mb, idk what it was

#

so what could i use to call it?

slim ferry
#

SMODS.poll_enhancement <-this is just the function
SMODS.poll_enhancement() <- this runs the function and gives back the output

gusty compass
#

i see, thanks

slim ferry
#

which is also why i asked if youve ever called a function before

#

because

#

you do this for literally ever functio

gusty compass
#

yea i call functions in lua but i didnt know what the poll function was, so i got a bit puzzled

#

thanks anyways

slim ferry
#

function should still have arguments

#

dont forget that

gusty compass
#

alright, ill give it a shot

stone dagger
#

Hello am I missing any configuration here when creating a consumable type and consumable?

SMODS.ConsumableType {
    key = 'support_spells',
    default = 'c_support_spells',
    primary_colour = HEX('cca652'),
    secondary_colour = HEX('cca652'),
    collection_rows = { 3, 3 },
    shop_rate = 0
}

SMODS.Consumable {
    key = "erebos_favour",
    set = "support_spells",
    loc_txt = {
        name = 'Erebos, Black-Hearted',
        text = {
            "After scoring a {C:attention}Flush{}",
            "lose {C:money}#1#${} and draw #1# at next draw"
        }
    },
    config = { extra = { money = 1 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.money } }
    end,
    atlas = 'TherosBD_support',
    pos = {x = 0 , y = 0},

Because Im getting this error and the collection name for the consumable type is ERROR which ya isnt a good sign.

slim ferry
#

your atlas key is incorrect

stone dagger
#

incorrect how?

slim ferry
#

there isnt an atlas with that key

#

which probably means you misspelled it

stone dagger
#

ah I get it

#

I know what happened, je suis dumb

#

Forgot to define the atlas xD

slim ferry
#

also localization

#

documentation is pretty cool

#

showing this because i assume youre using loc_txt for everything

stone dagger
#

yes I am

#

I did not find that documentation tho

slim ferry
#

its under SMODS.ObjectType

stone dagger
#

I only found the SMODS.Consumable not the type

#

ah ok

long sun
#

i can't see how Legendaries handle their unlock conditions by looking at VanillaRemade — how do i lock my Legendaries like vanilla Balatro?

daring fern
long sun
#

ah i see

#

so i just have to specify unlocked = false?

daring fern
long sun
#

awesome ^^ thanks

daring fern
long sun
#

i'm using V, but providing a colour in vars

#
return {
      vars = {
        localize(G.GAME.current_round.fainfol_card.suit, 'suits_singular'),
        card.ability.extra.xmult,
        colours = { G.C.SUITS[G.GAME.current_round.fainfol_card.suit] }
      }
    }```
#

this crash does not occur when hovering over it when unlocked

daring fern
long sun
#

ah i see

broken rivet
#

my horrible awful hack to use SMODS.is_poker_hand_visible()

long sun
#

i've tried fixing this draw function for ages now, but no luck — the voucher shader only seems to tilt when hovering over a specific different Joker that doesn't have a soul

daring fern
long sun
#

ah i haven't ^^;

#

i'll give that a go

long sun
#

this looks like an SMODS bug because this drawstep looks almost identical to the one that applies editions to souls

#

or maybe my joker setup is wrong

#

here's one of my Legendaries

#

right lemme test something rq

#

oh, weird. polychrome works as it should

glass scaffold
#

How do I change this to only focus on scored cards?

fossil ermine
#

does anyone know how i could make it so that the code checks specifically for one card being retriggered and then once its done retriggering and the next card is same suit, rank, etc that it doesn't give the xmult on the next card

#

how its supposed to work:

#

how it works:
jack of clubs played
next card is jack of clubs (xmult)
or
jack of clubs played
jack of clubs retriggered (xmult)
next card is jack of clubs (xmult)

slim ferry
glass scaffold
naive agate
#

want this to act like photograph, adds first scoring face card's chips * 0.15 to mult, but right now any hand that has more than one card and includes a face, it triggers for all cards and adds their chips to mult
anything i need to fix?

faint yacht
#

You'd want to use SMODS.scale_card to scale instead of return, perhaps.

lyric wadi
#

can yuo dynamically add boxes to a joker description

#

like maybe it starts with 1 box, but then after it gains an effect it adds a second box to its description

#

like this

daring fern
naive agate
#

this joker uses base chips to add to mult instead of the total chips

ivory wren
daring fern
sturdy compass
naive agate
#

card.base.nominal with this crashes anyways

daring fern
naive agate
#

yeah, but it's still stuck at X1 Mult

daring fern
naive agate
#

got it

naive agate
frigid cargo
#

Is there a way to make a joker play a sound on repeat?

red flower
#

<@&1133519078540185692>

frigid cargo
#

Hi N’

red flower
#

hi

frigid cargo
#

I am back

red flower
#

<@&1133519078540185692>

frigid cargo
lyric wadi
#

and how many boxes can i add

floral flicker
#

Hello, i have added my sticker, and the small badge sho the text error do you know why ?

frosty rampart
#

you need to localize it in a separate place for the badge

#

if you're using a localization file, it goes in misc -> labels, and it should be modprefix_stickerkey = "Ditto"

native bone
#

I cant figure out why the joker doesnt trigger the script that adds the mult to the joker. I play the hand, I added the return message thing, and it just doesnt trigger at all. I've looked at tutorials online and I have been stuck. I have tested the script for applying the mult, and that works just fine

floral flicker
rocky plaza
#

?

frigid cargo
#

Yes

rocky plaza
#

so not a music track, but a sound effect
then i think there would probably be some recursive shenanigans

frigid cargo
#

Wait i misread, it is a music track

rocky plaza
#

in that case they should autorepeat

#

is it staying silent after the song has finished

frigid cargo
#

I have yet to code it but i want the song to randomly play if i own a specific joker

rocky plaza
#

also music tracks can have a select_music_track function

#

or something

red flower
# lyric wadi variable but it's added at fixed intervals (probably after boss blind)

it's not very straightforward then, you would need to add the nodes to full_UI_table.multi_box in the joker's generate_ui
here's an example (this doesn't use the joker's generate ui anymore but it has the same structure)
https://github.com/nh6574/JoyousSpring/blob/e0cdbd2da1daeb698eb2ebe14693811e8ab59e65/src/card_ui.lua#L296

you can add as many boxes as you want but at some point you will run out of screen space lol

frigid cargo
frigid cargo
rocky plaza
nova eagle
#

so im trying to learn to make mods. i have the rules set up, but how do i customize the cards you start with, and actually make it appear in game?

rocky plaza
#

yeah you should be able to control the track timing with select_music_track

frigid cargo
long sun
#

i'm doing my unlock checking incorrectly — i'm using 3 hooks to emulate what double_gold does, however check_for_unlock doesn't do what i want to do

#

what's the correct function?

nova eagle
#

how come my custom challenge doesnt show up in game?

#

does anybody know how to fix that?

long sun
#

well we'd need to see your code

nova eagle
#

i've got this

#

as well as something in the main.lua to load the challenges.lua file

long sun
#

are you loading challenges.lua?

#

ah

#

can i see that code?

#

for the loading

nova eagle
long sun
#

can i see your JSON file?

nova eagle
lyric wadi
# red flower it's not very straightforward then, you would need to add the nodes to full_UI_t...

ok im gonna need a little more handholding for this
please correct me if my understanding is incorrect

  • you initialise an array called full_UI_table.multi_box
  • full_UI_table.main is the first box, aka the main description
  • to add another box, you add an entry to full_UI_table.multi_box , starting at index 2

what i dont see from the snipped you lniked is

  • how do i set the text inside each box
  • what the vars node and name_node contains
#

sorry for all the asks i really need all the heps to understand this

nova eagle
#

i'm also having the same issue loading stuff from jokers_2.lua

long sun
#

that way, it'll crash if it fails

nova eagle
#

what would that look like in code?

#

(im still new to making stuff in lua)

long sun
#

assert(SMODS.load_file(...))

nova eagle
#

no crash

long sun
#

hmm, okay

#

can i see Redditro.lua again?

nova eagle
long sun
#

could i see the new version?

nova eagle
#

i only did the assert thing with the challenges for now

faint yacht
#

-# Like a clock?

nova eagle
#

once i get that figured out it should be the same process to figure out why nothing else is working

#

(minus jokers.lua which works fine)

#

wait

#

i did a stupid

#

hold on

#

i forgot to do scripts/challenges.lua

#

ok that didnt fix anything

#

so now it looks like this

#

still doesnt crash, still doesnt show up

long sun
#

oh

#

move the parethesis inside the assert to outside the assert

#

eg. assert(SMODS.load_file("thing.lua"))()

nova eagle
#

hold up i did another stupid

#

i just realized the mod was disabled

long sun
#

;u;

#

that'd do it

nova eagle
#

oh, nope, still no showup

nova eagle
#

that didnt change anything either

long sun
#

mm

#

can i double-check your script again?

#

<@&1133519078540185692>

wind steppe
#

<@&1133519078540185692>

#

thank you mods

lyric wadi
#

three times???

#

wtf

long sun
#

oh it's happened a lot today

lyric wadi
#

also hello ghos

long sun
#

hai :3

nova eagle
#

i love the fast reaction time for that lol

long sun
#

i'm out of ideas ;u;" sorry

lyric wadi
#

once you're done i might ask you for help with... ui code....

nova eagle
#

amazing mods

lyric wadi
#

*shudders*

long sun
#

oh ya kusane do you know anything about unlocks?

nova eagle
long sun
lyric wadi
#

unfortunately not i havent bothered locking any of my cards

long sun
#

alrighty

#

what's ur UI thing ^^?

nova eagle
#

didnt work, but it taught me something

lyric wadi
#

im trying to make a joker that adds a box to its description

#

like this

nova eagle
#

is there a second thing i have to do? i think the issue isnt in loading the script, but actually creating the deck

long sun
#

oh like multiple abilities?

lyric wadi
#

N has pointed me to some example but i am having a hard time wrapping my head

long sun
#

u can add multiple tables in the loc_vars

nova eagle
#

so the rules are there, but theres nothing to call the key for the challenge

lyric wadi
#

yeah but i mean like dynamically adding a box during run time

long sun
#

u can use several keys for that i think

lyric wadi
#

like adding an extra box each time you defeat a boss blind

long sun
#

oh

#

ohhh

#

yeah i have no clue ;u; sorry

lyric wadi
#

😭

red flower
long sun
#

oh ya hai N, question

red flower
#

hi

long sun
#

i've got some hooks i'd like to unlock a card from

#

code is currently this but check_for_unlock is not the right function

#

do i need to hook it too, or is there a better function for this?

red flower
#

wdym it's not the right function

long sun
#

oh like

#

it has a bunch of hardcoded unlock codes in it

#

like this

wind steppe
#

yeah but you can pass anything into it

#

and just check args.type in your object

red flower
#

your joker should have a check_for_unlock as well

wind steppe
#

and unlocked = false

red flower
#

or card

long sun
#

oh, can i not use unlock_condition?

red flower
#

no, that's only for the hardcoded ones

long sun
#

ohhhhhhh i see

#

okayokay gotcha ^^ that helps

red flower
#

check the vanillaremade joker file

long sun
#

thanks!

#

ya i checked it out, and it told me it was equivalent ;u;"

#

i understand this now though

red flower
#

what it means is that they're equivalent but only for that condition so the reason I use check_for_unlock instead is as an example because mods will most likely use the function

long sun
#

oh kay

#

icic

#

(omg nice edgeworth pfp btw!!)

red flower
#

:3

long sun
#

gaming!!!!!

round lion
#

is phanta gonna go in your website's backstage

long sun
#

oh i haven't added my mods yet ;u; i forgot

#

it'll go next to my KTaNE things

feral tree
#

how do i make it so during an event the player cant play any cards for a select time?

granite jay
# daring fern Code?
                if hand_chips + context.other_card.chips + card.ability.extra.chips_penalty < 0 then
                    penalty = -(hand_chips + context.other_card.chips)
                end
                return {
                    chips = penalty,
                    colour = G.C.CHIPS
                }```
long sun
#

i finally got the shines on the souls to work!! it required self.ARGS.send_to_shader

rose hatch
#

Ghost seal? Who could kill such a cutie

loud summit
#

hi is this the right way to check if a consum(e)able has been sold?
if context.selling_card and cardarea == G.consumeables and not context.other_card.ability.extra.refundjeapordy then

maiden phoenix
# long sun :3

Me killing GhostSalt to have a chance to have a negative joker (the cops are looking for me)

frosty rampart
#

when does the game set challenge modifiers in G.GAME? i'm trying to change the scoring calculation for a challenge, but init_game_object and start_run hooks are too early

lyric wadi
#

i tried following n's guidance and so far not successfull

#

whioch part did i do wrong

#

or have i fundamentally misunderstood this completely

frosty rampart
granite jay
#

How do you get the suit from a card?

#

For a joker

quick prairie
#

if i wanted to make a DNA style joker, that instead creates a copy of the first destroyed card, what do i need to add or change from this or anything im perhaps missing that ill need to change from other stuff im stealing from DNA:

local copy_card = copy_card(context.full_hand[1], nil, nil, G.playing_card)
faint yacht
#
if context.remove_playing_cards and context.removed[1] then
  local _card = copy_card(context.removed[1], nil, nil, G.playing_card)
  _card:add_to_deck()
  G.deck.config.card_limit = G.deck.config.card_limit + 1
  G.deck:emplace(_card)
  table.insert(G.playing_cards, _card)
  playing_card_joker_effects({_card})
end
quick prairie
#

thanks

quick prairie
faint yacht
#

...per chance, did this go off multiple times?

quick prairie
#

yup

unkempt bronze
faint yacht
#

Was this copied by Blueprint?

quick prairie
#

yes, but i also had a second one

faint yacht
#

Move G.deck:emplace(_card) under table.insert(G.playing_cards, _card)?

unkempt bronze
#

Hey Ali

wintry solar
unkempt bronze
#

SMODS.poll_seal("shuffletheseed" and guaranteed = true) more accurate?

wintry solar
#

no

#

SMODS.poll_seal({key = 'shuffletheseed', guaranteed = true})

unkempt bronze
#

ah. No (seed, table) issues, gotcha

unkempt bronze
wintry solar
#

show your code

unkempt bronze
#
SMODS.Consumable {
    key = "magnesium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 0, y = 0 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,    
    loc_vars = function(self, info_queue, card)
        local xiferp_seal_the_deal = SMODS.poll_seal({key = 'shuffletheseed', guaranteed = true})
        return { vars = { xiferp_seal_the_deal } }
    end,
    loc_txt = {
        name = 'Magnesium',
                text = {
                    'Gives 2 random cards a random seal',
                    'and adds +10 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkemetal_chips = (G.GAME.xiferp_alkemetal_chips or 0) + 10
            local options = {}
            local chosen = {}
                for _, c in ipairs(G.hand.cards) do
                  options[#options+1] = c
                end
                for _ = 1, math.min(2, #options) do
                  local roll, i = pseudorandom(1, #options)
                  chosen[#chosen+1] = options[i]
                  table.remove(options, i)
                end
            for _, c in ipairs(chosen) do
               local conv_card = c
                      G.E_MANAGER:add_event(Event({
                         trigger = 'after',
                           func = function()
                                conv_card:set_seal(seal_the_deal, nil, true)
                           return true
                     end
        }))
    end
end
}```
wintry solar
#

your poll function is in a completely different place to your set function

unkempt bronze
#

put them both under the use?

#

now the code's mad because of the fact the use has to end right after setting seal_the_deal

#

and the entire code for Magnesium

#

nevermind, fixed it

quick prairie
# faint yacht Move `G.deck:emplace(_card)` under `table.insert(G.playing_cards, _card)`?

as an idiot, i didn't know what you meant by this, but i did manage to get it working somehow, though an issue I'm encountering is that it only puts the cards in hand after scoring ends. though im guessing that's because the remove thing only triggers at the end of scoring:

calculate = function(self, card, context)
        local extra = card.ability.extra
        if context.first_hand_drawn and not context.blueprint then
            local eval = function() return extra.card_destroyed_this_round == 0 and not G.RESET_JIGGLES end
            juice_card_until(card, eval, true)
        end
        if context.remove_playing_cards and extra.card_destroyed_this_round == 0 and context.removed and #context.removed > 0 then
            local copy_card = copy_card(context.removed[1], nil, nil, G.playing_card)
            copy_card:add_to_deck()
            G.deck.config.card_limit = G.deck.config.card_limit + 1
            table.insert(G.playing_cards, copy_card)
            G.hand:emplace(copy_card)
            copy_card.states.visible = nil
            if not context.blueprint then
                extra.card_destroyed_this_round = extra.card_destroyed_this_round + 1
            end
            G.E_MANAGER:add_event(Event({
                func = function()
                    copy_card:start_materialize()
                    return true
                end
            }))
            return {
                message = 'Memory Restored',
                func = function()
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            SMODS.calculate_context({ playing_card_added = true, cards = { copy_card } })
                            return true
                        end
                    }))
                end
            }
        end
        if (context.ending_shop) and not context.blueprint then
            extra.card_destroyed_this_round = 0
        end
    end
faint yacht
#

If hand is played, context.destroy_card occurs after the scoring is done, yeah.

quick prairie
#

bummer, oh well

daring fern
loud summit
#

oh thx

#

do you mean context.other_card?

slim ferry
#

no

#

it is context.card

loud summit
#

oh

quick prairie
#

hello, I'm trying to make a legendary joker that takes ownership of blue seals so that they instead create negative planet cards. Looking at the page for taking ownership, it seems like I would be instead overwriting blue seals only as opposed to letting a joker do it.
How do I make it so that having the joker instead replaces the existing blue seals? Would i just put the SMODS.Seal:take_ownership under an if statement inside of the calculate section, along with the behavior I'm changing?

slim ferry
#

take ownership outside of the joker and check if you have the legendary in the blue seal

loud summit
#

you kinda have to take ownershipo fully

#

yeah

quick prairie
muted trout
#

current issue: the joker is meant to create a planet card when a playing card is destroyed, but it's not doing so

slim ferry
#

remove context.joker_main

muted trout
#

may i ask how it's an issue?

wind steppe
#

joker_main is for main scoring

#

like when jimbo triggers

slim ferry
muted trout
#

i see tysm

daring fern
quick prairie
#

no clue what you mean by patch, you mean go into the games code and change the code there?

daring fern
quick prairie
#

well darn, that's a lot of words

drifting plover
pseudo furnace
#

My files aren't updating in the game after I've restarted and saved. Any ideas?

pseudo furnace
#

Any changes in code after a certain point stopped being updated ingame

wind steppe
#

reset profile

#

and start a new run

pseudo furnace
#

Nothing...

wind steppe
#

what were the changes

pseudo furnace
#

Mainly a new joker, and the loc_text for an old one

wind steppe
#

its loc_txt

#

also you restarted the game right

pseudo furnace
#

Yep

#

And profile

wind steppe
#

i think you’re not saving to the right place then

#

or you’re missing some important info that the game needs to register the joker

pseudo furnace
#

That might be it cuz I did move some files around

wind steppe
#

like the key

pseudo furnace
#

I'll check the key first

#

Key looks good

wind steppe
pseudo furnace
long sun
#

how can i check if a card scored, without using contexts?

wind steppe
#

smods doesn't load files automatically

#

except your mod's main file

pseudo furnace
#

I'll experiment a lil

loud summit
#

so you could check that ig

long sun
#

oh not what i mean

#

like, if i play a hand, i need a way of knowing if it was scored

loud summit
#

context.scoring_hand?

long sun
#

i suppose i could set a flag in the mod's calculate but there might be a pre-existing way

long sun
#

/lh

loud summit
#

im confusedp

#

what are u trying to do

long sun
#

okie so

#

one of my Jokers has a lock condition: Play a Junk with a scoring Steel card

#

and i need to check if the steel cards passed in with hand_contents scored

loud summit
pseudo furnace
long sun
#

you can't play a Junk if you have it disabled so that's fine :3

slim ferry
loud summit
long sun
slim ferry
#

Also theres SMODS.in_scoring

long sun
loud summit
#

oh

long sun
slim ferry
#

Im just asking why you cant do that

loud summit
#

unlock condition ig

long sun
#

because check_for_unlock doesn't have a context

slim ferry
#

Oh true

loud summit
#

i think the played hand is considered a cardarea?

slim ferry
#

Everything is in a cardarea

#

Well at least everything should always be in one

loud summit
#

yea so you can check that ig

long sun
#

problem: SMODS.is_scoring requires the scoring hand

#

i don't have that

#

lemme try something else though

loud summit
long sun
#

G.play.cards contains all played cards iirc, not all scored cards

#

okay i think i have a solution using my mod's calculate function

#

lemme test

loud summit
#

sounds conplex

long sun
#

not really

#

i'm really just doing what a Joker would do

native bone
#

Guys, I just realized something, this may save a couple of people a headache. The #X# tags are in the order that you return the loc_vars. So, for example, I have value1 and value2, and I want to display both.

#

In the description of the joker, you need to put #1# then #2# to display value1 and value2 in the correct order

daring fern
long sun
#

correct

#

ah ^^

long sun
#

alright my method works :3 thanks

wind steppe
#

anybody know what function makes the descriptions for the blinds show up in the collection

#

like that

long sun
#

woah that's long

loud summit
native bone
long sun
native bone
#

lol

#

On a more serious note, are the variables stored in the config field global or local? It seems to me they must be local, since I cant add to them. But I'm not sure

wind steppe
#

wdym the config field

#

like of a joker?

native bone
#

Yes

wind steppe
#

you should be able to add to them

#

how else would scaling jokers work

native bone
#

That is what I said lol

wind steppe
#

i would say youre probably doing something wrong

#

code?

daring fern
native bone
daring fern
native bone
daring fern
#

Same for the other config variables.

wind steppe
#

what function makes blind popups like this appear when you hover over them in the collection?

solemn shuttle
#

wait is G.GAME.hands["handtype lol"].level not the way to have a hand's level as a var
i noticed its considered a table despite being one value as opposed to a Number and trying to index it and tonumber() it isnt working either it seems

solemn shuttle
#

whoops yeah youre right 😭

#

ok it works now i Forgor syntax

native bone
#

How do you access the card being scored when in the scoring cards context?

unkempt bronze
#
SMODS.Consumable {
    key = "magnesium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 0, y = 0 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,    
    loc_txt = {
        name = 'Magnesium',
                text = {
                    'Gives 2 random cards a random seal',
                    'and adds +10 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkemetal_chips = (G.GAME.xiferp_alkemetal_chips or 0) + 10        
        local xiferp_seal_the_deal = SMODS.poll_seal({key = 'shuffletheseed', guaranteed = true})
          return { vars = { xiferp_seal_the_deal } }
       end,
    calculate = function(self, card, context)
            local options = {}
            local chosen = {}
                for _, c in ipairs(G.hand.cards) do
                  options[#options+1] = c
                end
                for _ = 1, math.min(2, #options) do
                  local roll, i = pseudorandom(1, #options)
                  chosen[#chosen+1] = options[i]
                  table.remove(options, i)
                end
            for _, c in ipairs(chosen) do
               local conv_card = c
                      G.E_MANAGER:add_event(Event({
                         trigger = 'after',
                           func = function()
                                conv_card:set_seal(xiferp_seal_the_deal, nil, true)
                           return true
                     end
             }))  
        end   
end
}```
This isn't working, what's wrong with it?
muted trout
#

is there a way to make it so the planet card produced is always of the most played poker hand?

rancid bridge
#

my friend made a jokerforge mod and this one specific joker crashes the game when it's loaded. any help with it would be appreciated <3

red flower
muted trout
red flower
muted trout
#

ty

unkempt bronze
#

(problem is: not giving out seals)

muted trout
daring fern
unkempt bronze
#

if I remove calculate it breaks

daring fern
muted trout
unkempt bronze
daring fern
unkempt bronze
#

testing...

#

no seals again

#

I use it, it's supposed to give two random cards seals

#

no seals on anything

unkempt bronze
native bone
daring fern
unkempt bronze
#

(It gives the chips as it should, but not the random seals)

unkempt bronze
muted trout
native bone
red flower
#

so card

red flower
# muted trout what i have atm
  1. dont do stuff outside a context check
  2. current_round.most_played_hand doesnt actually contain the most played hand at all times, because it checks per ante. the question just above the planet card one in the vr wiki answers that
  3. use the planet_for_handname as the key in add_card

all of these is explained in some way in that wiki btw, i recommend reading it fully if you ever have the time

muted trout
#

i did ctrl+f on the wiki and none of that was explained but ok tysm

unkempt bronze
red flower
#

hi i dont really want to read code

unkempt bronze
red flower
#

its been good i played a lot of ff8

unkempt bronze
#

good to hear

muted trout
unkempt bronze
red flower
red flower
muted trout
red flower
#

the idea of the wiki is that theyre literally code snippets you can copypaste

unkempt bronze
daring fern
#

pseudorandom only returns one value.

unkempt bronze
#

any clean fixes?

daring fern
unkempt bronze
#

local roll = pseudorandom(1, #options) Like this?

muted trout
daring fern
#

pseudorandom_element(options, 'seed')

unkempt bronze
#

I take it options is the table?

unkempt bronze
daring fern
unkempt bronze
#

oh.

#

local roll, i = pseudorandom_element(G.hand.cards, 'xiferp_card_changer')

unkempt bronze
muted trout
unkempt bronze
#

I know the pain

daring fern
muted trout
#

it's easy just copy paste the code

#

💡

daring fern
unkempt bronze
#

Because it's still not adding seals

daring fern
muted trout
unkempt bronze
daring fern
unkempt bronze
#

I ctrl-z'ed a bit too hard

unkempt bronze
#

anything off? Any reason the seals aren't being added?

muted trout
#

does anyone know how i can change this from always giving pluto to giving the planet of the most played hand?

unkempt bronze
#

I'd say check vanilla remade voucher "telescope"

daring fern
unkempt bronze
#

I just took someone's code that said those two were tables for however many cards

muted trout
#

all that and i didn't even have to bother with the wiki to begin with 🥀

unkempt bronze
#

anything for a fellow modder

muted trout
#

ok using blueprint on inflammation crashes the game

unkempt bronze
#

Ive managed to make the code work for one

#

ttwo might just be out of my depth

charred widget
#

Hi friends! I'm having trouble coding a retriggering joker, and it's not retriggering any cards. Can someone help me figure out why this is happening?

muted trout
#

it crashes when a planet card is being created

unkempt bronze
muted trout
#

how does that make blueprint crash

unkempt bronze
faint yacht
#
apply = function(self, back)
    G.STATE = G.STATES.SHOP
    G.GAME.shop_free = nil
    G.GAME.shop_d6ed = nil
end

seems a bit dangerous... but it works for starting a run in the shop.

muted trout
#

may be whatever but im making inflammation blueprint imcompat

drifting plover
#

I've already created the profile.jkr, I just need to export from JSON to JKR and it'll be done.

unkempt bronze
drifting plover
#

this is a editor profile xD

unkempt bronze
#

Pardon me, I just never saw one before

drifting plover
#

te perdono bro

muted trout
#

currently getting an error for something??????

#

ik i probably wont get a response to this anytime soon so for now im gonna try to replicate my code from before

sturdy compass
harsh wind
#

hey guys what does this mean 💔 (this is the best channel to ask this i think)

muted trout
harsh wind
muted trout
harsh wind
sturdy compass
harsh wind
sturdy compass
sturdy compass
muted trout
harsh wind
sturdy compass
#

Is this caused by a mod you made? Or are you just a player?

harsh wind
#

player

sturdy compass
#

Disable your mods one by one until it stops Emoti_Shrug

harsh wind
#

this is the only mod bro

#

💔

sturdy compass
#

Which mod

harsh wind
#

its a mod for a separate game that i dont think has a discord server i just thought this was the best channel to ask because balatro modding uses lovely 💔💔💔

harsh wind
#

my bad

quick prairie
#

generating negative planet cards from modified blue seals only ever makes enough to fill the space you would normally have if they weren't negative, is there anyway to go around this?

frosty rampart
#

show code

daring fern
quick prairie
#

yeah that would do it

quick prairie
#

another question, how do i detect the presence of a custom joker? i have the key for it but it doesn't seem to be detected. i am sure im missing something

daring fern
quick prairie
#

ah yes, of course i forgot one word

azure valley
#

So, I have a problem, a proposed solution that I think is a bit of a hack, and my request is to know if there is a better way:

I would like to run code when a particular kind of card is created. This is intended to make the (consumable) card target a random joker, and reveal the target to the player.

This card (currently) only shows up in booster packs, and while I would like for it to also show up in the shop, that's going to be a playing it by ear sort of deal.

My current, bad and hacky, plan is to use the mod calculate to trigger on open_booster (and possibly reroll and shop start) to search for an already created card of the type I want to initialize, and then modify it. open_booster will require a delay, which can be affected by the game speed, because the cards aren't actually created until the booster explodes, and there's no guarantee that the player won't be faster than the difference between the card being created and the delay timing out.

My second idea is to create a lovely patch to optionally run initialization code when creating a card, but I'm hesitant to hook to code if I don't have to.

Is there a better idea?

wind steppe
#

hook create_card