#💻・modding-dev

1 messages · Page 223 of 1

hushed field
#

You'll wanna pass it on to info_queue! I wish I could give you the specific syntax but I'm not at a PC to check

frosty dock
#

info_queue[#info_queue+1] = G.P_CENTERS.c_hanged_man in loc_vars

hushed field
#

Aure'll know 😋

quartz ravine
#

At work, we do 👑 emojis when someone helps a lot

frosty dock
#

yeah but it's going through malverk APIs, which I don't know the internals of

worthy stirrup
#

right, thanks again though

frosty dock
#

I'd check all the file names and confirm with malverk docs to start

worthy stirrup
#

okay, ill look through it

quartz ravine
#

It's my first time making an edition, which context window woudl you recommend I use for scoring and applying xMult? I was going to try context.individual and context.cardarea == G.play

worthy stirrup
#

what file would the sets be in?

frosty dock
worthy stirrup
#

because if i remember correctly, theres a file that has them listed

frosty dock
#

the sets are correct

worthy stirrup
#

oh

quartz ravine
#

Man DebugPlus is AMAZING. I was able to tweak my shaders so much today using the shader watch command.

stray dagger
frosty dock
#

other than that, it depends on what you level of knowledge in lua and/or coding in general is

stray dagger
#

how long does it take to learn

#

lua

frosty dock
#

do you have any programming experience at all?

stray dagger
#

so like 6months

quartz ravine
#

Hey John that was totally the right window, thank you!

Do you see some other error? It isn't apply the xMult

frosty dock
stray dagger
#

not really

#

i mean i sometimes use roblox studio

frosty dock
#

I'd say lua is a fairly easy first language to pick up, but I do recommend taking at least some time to learn the basics and concepts before jumping into mods. there's a lot to learn from the code of other mods too, but it's important that you learn to understand that code and don't just end up copying it mindlessly

stray dagger
#

do you havee some suggestions

frosty dock
stray dagger
#

oh thank you

frosty dock
#

it's more in-depth and you don't need to understand it all

#

if you need help at any point or need someone to explain something to you, please feel free to ask

stray dagger
#

how did the make it go backwards?

frosty dock
#

i don't see anything backwards, it's just right-aligned

stray dagger
#

it was a bunch of spaces

quartz ravine
#

Hi guys, running into an issue getting my custom editions to apply mult or chips.

Here's an example of what I am doing. We do hit the log message, but the edition's special perk does not apply.

frosty dock
#

it'd be like card.edition.extra

#

because of course editions are extra and need to do things differently thunk

worthy stirrup
#

i honestly have no idea whats causing the crash, ive replaced all the broken code with another and it still works, im gonna scream

#

wait

quartz ravine
#

So I bet that if I want to increment a value, I would not do it like this

worthy stirrup
#

i swear to god if its because i missed a bracket

#

okay, it wasnt that

quartz ravine
#

What does your crash say?

worthy stirrup
#

holy shit

#

i found it

#

in all the code it calls for 'Planet' and for some reason, i need to call for 'planet'

#

now its the keys that are crashing

#

fuck it, we arent doing planets

quartz ravine
#

I know it doesn't fit at all but I love this lol

knotty copper
#

How do you replace the textures for the default 8bitdeck?

frosty dock
#

ideally you don't do that and use a DeckSkin instead

frosty dock
#

oh

#

that's not a thing for decks

glad osprey
#

dam

frosty dock
#

change T:t_hanged_man to T:c_hanged_man

#

that gives you the tooltip when you hover over "Hanged Man" (no galdur) or next to the deck description (with galdur)

glad osprey
frosty dock
#

should also colour code it ngl

glad osprey
#

oh yea

gaunt wolf
#

How do you make a balatro mod?

glad osprey
gaunt wolf
#

thx!

glad osprey
gaunt wolf
#

OH! it uses lua?

glad osprey
#

yes

frosty dock
#

I'd {C:tarot} the hanged man

gaunt wolf
#

Man, i only know python. Guess I'm using lua now

glad osprey
#

theyre like second cousins

gaunt wolf
#

oh good

#

whew

gaunt wolf
glad osprey
#

its just a small part of a huge mod

timid oyster
#

Does anyone know what to do about this?

glad osprey
#

download loader api version 1.0 or higher

distant grove
#

how to add another context

glad osprey
#

as in create one?

distant grove
#

the chips works

#

but not the mult

dreamy thunder
#

you have "=="

#

instead of "="

#

and remove the "and" at the end

#

of chips_mod

distant grove
#

replace it with a ,?

timid oyster
knotty copper
glad osprey
#

add

chips = 0,
mult = 0,
``` to the return, i find that sometimes it doesnt listen to chips/mult = otherwise
frosty dock
dreamy thunder
#

you dont need anything there

glad osprey
distant grove
#

k

distant grove
distant grove
#

i think theres a spelling mistake

#

somewhere

glad osprey
#

show code

distant grove
#
  if context.discard and
    not context.other_card.debuff
    then
      card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_mod 
      card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
      return {
                message = "Guts Harvested",
                colour = G.C.CHIPS,
                card = card 
      

      }
    end 
    if context.joker_main and card.ability.extra.chips > 0 and card.ability.extra.mult > 0 then
            return {
                message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } },
                chip_mod = card.ability.extra.chips,
        message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } },
        mult_mod = card.ability.extra.mult,
                colour = G.C.CHIPS}
      end 
      end```
#

my terrible

knotty copper
distant grove
#

indentation

pseudo cape
#

what should this goober do?

#

a friend reccommended it do something with hearts

distant grove
#

eat all played heart cards

#

and add +10 mult

#

fr!

pseudo cape
#

hmmm

#

that do be a decent idea

gaunt wolf
#

How about, 2x mult +2$ for each card it eats

#

eats a different suit every turn

pseudo cape
#

that seems a lil over powered

gaunt wolf
#

but it destorys them

#

so it's balenced (kinda)

distant grove
#

yea but x2 per card??

pseudo cape
#

2x mult is still a ton

gaunt wolf
#

hmmmm... yeah

#

maybe 1.75?

distant grove
#

+x0.25

#

and it starts off at x1

#

mult

pseudo cape
#

$2 per destroyed card is already almost as much as trading card gives too

gaunt wolf
#

yeah, ok needs workshoping

distant grove
#

okay something weird is going on with my joker

#

why is the chips value false in the game??

pseudo cape
#

if it's anything other than a number I think it defaults to false

#

could be misremembering tho

distant grove
#

i got chips_mod=3

#

my joker is kinda like the castle

#

except with +mult too

#

might get rid of the mult part and only make it chips + money

#

to make it balanced

glad osprey
long sun
#

hiya!

frosty dock
#

m

long sun
#

so i can't check how an SMODS Gros Michel would work, since SMODS removed its examples

bold sleet
#

Hello good people! I have come here to ask where does the info_queue of any given card get stored.

long sun
#

so, how do i remove a card from the pool when sold, and add a different one to the pool?

long sun
#

o7 thanks :D

glad osprey
#

no

bold sleet
#

hi squid

glad osprey
#

hi

bold sleet
#

how is your balatro modding experience going?

glad osprey
distant grove
#

holy fuck

bold sleet
#

me when the

#

the consumable area

#

I uh...

#

Have been working on other shit.

bold sleet
distant grove
distant grove
tepid crow
distant grove
#

yea

bold sleet
bold sleet
distant grove
#

sure

bold sleet
distant grove
#

holy moly

frosty dock
distant grove
#

wait

bold sleet
#

Can you send over the whole joker?

distant grove
#

oh sure

bold sleet
#

ty

distant grove
#

and the heck

#

oh

bold sleet
distant grove
#
  key = 'TheRats',
  loc_txt = {
    name = 'The Rats',
    text = {
      "This joker gains {C:chips}+#1#{} Chips",
      "and {C:mult}+#1#{} Mult",
      "per discared card",
      "{C:inactive}(Currently {C:chips}+#3#{C:inactive} Chips)",
      "{C:inactive}(Currently {C:mult}+#4#{C:inactive} Mult)",
      "Gut Harvesting go BRRR"
    }
  },
 atlas = 'TheRats.png',
 pos = { x = 0, y = 0},
 config = {extra =
 { chips = 0,
 mult = 0, 
 chips_mod = 3, 
 mult_mod = 4}
},
 loc_vars = function(self, info_que,card)
  return {
    vars = {
      card.ability.extra.chips_mod,
      card.ability.extra.mult_mod,
      card.ability.extra.chips,
      card.ability.extra.mult

    }
  }
end,
calculate = function(self, card, context)
  if context.discard and
    not context.other_card.debuff
    then
      card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_mod 
      card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
      return {
                message = "Guts Harvested",
                colour = G.C.CHIPS,
                card = card 
      

      }
    end 
    if context.joker_main and card.ability.extra.chips > 0 and card.ability.extra.mult > 0 then
            return {
                message =  { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } },
                chip_mod = card.ability.extra.chips,
        message =  { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } },
        mult_mod = card.ability.extra.mult,
                colour = G.C.CHIPS}
      end 
      end

       ```
#

alr

bold sleet
#

I wrap 'em in another UI component thing.

bold sleet
# distant grove ```SMODS.Joker { key = 'TheRats', loc_txt = { name = 'The Rats', tex...
SMODS.Joker {
  key = 'TheRats',
  loc_txt = {
    name = 'The Rats',
    text = {
      "This joker gains {C:chips}+#1#{} Chips",
      "and {C:mult}+#1#{} Mult",
      "per discared card",
      "{C:inactive}(Currently {C:chips}+#3#{C:inactive} Chips)",
      "{C:inactive}(Currently {C:mult}+#4#{C:inactive} Mult)",
      "Gut Harvesting go BRRR"
    }
  },
 atlas = 'TheRats.png',
 pos = { x = 0, y = 0},
 config = {extra =
 { chips = 0,
 mult = 0, 
 chips_mod = 3, 
 mult_mod = 4}
},
 loc_vars = function(self, info_que,card)
  return {
    vars = {
      card.ability.extra.chips_mod,
      card.ability.extra.mult_mod,
      card.ability.extra.chips,
      card.ability.extra.mult

    }
  }
end,
calculate = function(self, card, context)
  if context.discard and
    not context.other_card.debuff
    then
      card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_mod 
      card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
      return {
                message = "Guts Harvested",
                colour = G.C.CHIPS,
                card = card 
      

      }
    end 
    if context.joker_main and card.ability.extra.chips > 0 and card.ability.extra.mult > 0 then
            return {
                message =  { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } },
                chip_mod = card.ability.extra.chips,
        message =  { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } },
        mult_mod = card.ability.extra.mult,
                colour = G.C.CHIPS}
      end 
      end

       
distant grove
#

oh

#

how to do that?

bold sleet
#

To better format it with colour for me to better see stuff.

frosty dock
#

this is wrong on so many levels

return {
  message =  { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } },
  chip_mod = card.ability.extra.chips,
  message =  { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } },
  mult_mod = card.ability.extra.mult,
  colour = G.C.CHIPS
}
bold sleet
#
color = true
-- This stuff has color now!
frosty dock
#

in this house we just

#
return {
  chips = card.ability.extra.chips,
  mult = card.ability.extra.mult,
}
distant grove
#

yea im trying to make it like the castle

#

so i just do that?

frosty dock
#

yeah

knotty copper
#

Okay I tried making another deck skin but it is showing up as blank?
Not sure what exactly I messed up

local atlas_b = SMODS.Atlas {
    key = "skin_b",
    path = "skin_b.png",
    px = 71,
    py = 95,
}

local atlas_a = SMODS.Atlas {
    key = "skin_a",
    path = "skin_a.png",
    px = 71,
    py = 95,
}

local icon_a = SMODS.Atlas {
    key = "icon_a",
    path = "icon_a.png",
    px = 18,
    py = 18,
}

local icon_b = SMODS.Atlas {
    key = "icon_b",
    path = "icon_b.png",
    px = 18,
    py = 18,
}
SMODS.DeckSkin {
    key = "a",
    suit = "Diamonds",
    loc_txt = "a",
    palettes = {
        {
            key = 'lc',
            ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
            display_ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
            atlas = atlas_a.key,
            pos_style = 'deck',
            suit_icon = {
                atlas = icon_a.key,
            },
        },
        {
            key = 'hc',
            ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
            display_ranks = {"King", "Queen", "Jack"},
            atlas = atlas_b.key,
            pos_style = 'deck',
            colour = HEX("9734f0"),
            suit_icon = {
                atlas = icon_b.key,
            },
        },
    },
}
distant grove
#

by itself??

bold sleet
#

yup

#

There is some magic™️ under the hood.

distant grove
#

bruh

bold sleet
#

But you don't have to worry about it too much for now.

distant grove
#

i was following the castle example

frosty dock
glad osprey
#

yes thats how return{chip/mult} works

frosty dock
#

it does not include the upgrading

distant grove
#

oh

frosty dock
#

but the upgrading part looks fine to me in your code

bold sleet
frosty dock
#

just the joker_main is off

bold sleet
#

-# just so you know you aren't being ignored

distant grove
#

so i replace everything in the joker_main

wintry solar
#

Yeah you don’t need the greater than 0 checks either

distant grove
#

oh

wintry solar
#

Better calc is indeed magic

distant grove
#

i got the same crash

#

the hells wrong with 102

bold sleet
#

what was the difference between old_calc and better_calc?

wintry solar
#

Are you using a fresh copy of the joker?

distant grove
#

oh

#

im dum

#

forgor to change

#

mb

#

YES

#

thank you guys very much

frosty dock
#

idk what you mean by that

#

if you mean how to add any given card to info queue, that works like info_queue[#info_queue+1] = G.P_CENTERS.j_bla_blablabla

bold sleet
#

But where the fuck does that get stored in the card?

frosty dock
#

where does what get stored

bold sleet
#

Yes.

#

I need to access that specific thing.

#

...and figure out a way to not make it recursive.

frosty dock
#

where does what get stored?

bold sleet
#

the info_queue thing.

#

I assume it is a list of sorts.

frosty dock
#

the info_queue is a local variable in generate_card_ui

bold sleet
#
info_queue {
  "something",
  "something else",
  "you get the idea",
  "(...)"
}
frosty dock
#

it is used only to make recursive calls back into generate_card_ui

bold sleet
#

idk

frosty dock
#

and hence it does not exist outside of it

bold sleet
#

well sh*t

frosty dock
#

maybe this would be more productive if you said what you actually want to do and not some vague description of what you think you need to get there

bold sleet
#

I need to like, make so a card contains the information of another card and the other card contain the information of the first card.

#

Problem is:
A: I want to automate this process via a function
B: It is recursive so the game freezes.

red flower
#

check for not card.fake_card i think

frosty dock
#

well you have access to info_queue when you're adding the tooltip

#

either you can display it only on main descriptions and do what N' said

#

or you can check if it's already in info_queue and only add it if it isn't

bold sleet
#

Probably do the second one.

bold sleet
#

-# oh god it is almost 2 am already. Probably it is not a good idea to try to learn this stuff this late, oh well here we go

frosty dock
#
local is_in_q
for _,v in ipairs(info_queue) do
  if v == G.P_CENTERS.j_bla_theothercard then is_in_q = true; break end
end
if not is_in_q then info_queue[#info_queue+1] = G.P_CENTERS.j_bla_theothercard end
manic rune
#

-# totally not me last night

bold sleet
#

I need to somehow overwrite or well, extend the loc_vars function to account for automatically adding the info queue thing to every playing card.

manic rune
#

hi peak

bold sleet
#

The key for the other card I can do that with other stuff I have ready.

bold sleet
nova finch
#

is there a way to check if a probability triggers?

bold sleet
#

If it's not 8 am, you are not that late.

modern kindle
#

hey so ive been trying to hand over my mod to my lady so she can help test it out, ive installed lovely and smods correctly, and they work until i add my mod

once i add my mod it does not desire to find things properly, with console outputting this

INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] line not found
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] 2025-03-08 19:41:32 :: ERROR :: StackTrace :: Oops! The game crashed
[SMODS DMODS "Dilatro.lua"]:4285: attempt to index field 'jokers' (a nil value)

but its the exact same as the build that is working on my system

distant grove
#

did you make a main.lua file??

bold sleet
#

Second, can we see the code?

frosty dock
glad osprey
#

how do i check if the blind defeated is a boss blind or not

frosty dock
#

also a real crash log would be great

distant grove
#

engine/text.lua:188: attempt to index a nil value

#

well poo

modern kindle
#

one second ill provide the crash file

distant grove
#

wait

safe cobalt
#

cooking

distant grove
#

nvm

glad osprey
safe cobalt
#

hahahaha\

glad osprey
#

infact never touch food again

distant grove
#

i think the rats just broke my balatro

#

wait

manic rune
distant grove
#

yes they fucking did the what the hell

distant grove
#

engine/text.lua:188: attempt to index a nil value

bold sleet
#

You can put a not before G.GAME.blind.boss if you want.

frosty dock
#

replace this with context.main_eval

distant grove
#

why in the heck am i getting this

frosty dock
bold sleet
modern kindle
distant grove
#

probably in the Joker_main

#

area again...

modern kindle
#

i eblieve everything else is the same as my sys

frosty dock
glad osprey
#

what all card areas are there

modern kindle
# frosty dock what code is there around the line where it errors?

its justa joker i haveto increase the debt limit the player has, this line specifically is this

in_pool = function(self)
        local has_credit_card, has_gold_card, has_platinum_card = false, false, false

        for _, card in ipairs(G.jokers.cards) do
            if card.ability then
                if card.ability.name == "Credit Card" then
                    has_credit_card = true
                elseif card.ability.name == "j_dilatro_gold_card" then
                    has_gold_card = true
                elseif card.ability.name == "j_dilatro_platinum_card" then
                    has_platinum_card = true
                end
            end
        end

with the line specifically being

        for _, card in ipairs(G.jokers.cards) do
distant grove
#

its fixed

#

just had to change the context

frosty dock
modern kindle
#

iuts strange that i wouldnt have experienced this crash myself though no?
cause it does not occur on my system at all

frosty dock
#

you should change G.jokers.cards to G.jokers and G.jokers.cards or {}

pseudo cape
#

this is my first time doing suit specific stuff, I'm trying to do something similar to what castle does, but it adds chips when a heart is scored, instead of when a randomly selected suit is discarded, I think I'm missing something with the ```lua
context.other_card:is_suit


```lua
             if context.individual and context.cardarea == G.play then
                if context.other_card:is_suit('Hearts') then
                    return {
                        card.ability.extra.chips == card.ability.extra.chips + card.ability.extra.chip_mod
                    }
                end
             end
manic rune
#

the cap of the pepper bottle was loose.

pseudo cape
#

does anyone know what I should be doing different?

manic rune
#

and i didn't notice.

pseudo cape
#

uh oh

manic rune
#

welp, im not wasting any food though

manic rune
#

its doing exactly what its supposed to do 😭

pseudo cape
#

it don't be doing anything when a heart is scored tho

manic rune
#

yeah, i can see why

#

you are returning wrong

#

return{
chips = (how many chips you want it to give),
}

distant grove
#

the rats work now bepis

#

YAYYY

manic rune
#

nice :D

safe cobalt
#

imagine needing to atlas joker sprites manually

distant grove
#

file was too BIG

manic rune
#

oh, do they auto get compressed into one singular image file?

#

thats neat

pseudo cape
manic rune
#

you forgot the "chips ="

pseudo cape
#

I've got another part for actual scoring

manic rune
#

chips = card.ability.extra.(something) should work

pseudo cape
#

this is just for increasing the chips variable using the chip_mod

manic rune
#

oh.

#

you dont do that in return

pseudo cape
#

you don't?

manic rune
#

yeah, you only really use return when telling the joker to give mult, chips, and some other niche use cases

#

you should handle that outside of the return{} instead

dreamy thunder
manic rune
knotty copper
manic rune
#

😭

pseudo cape
manic rune
#

spent hours working on this

dreamy thunder
#

yk the braincell thing might be true

manic rune
#

automatically shows every stat debuffs attached to a card changes

#
  • it evenly distributes the whole string to 2 different lines
pseudo cape
#

minmoo be chippin

manic rune
#

oh, thats cute

pseudo cape
#

indeed

dreamy thunder
#

op i pinged on accident

manic rune
#

revo, please go to sleep

#

i went to sleep at exactly 4 lol

dreamy thunder
#

well its 4.03

#

so i gotta wait till its 5

frosty dock
#

you should probably use 'suit' in place of 'deck'

distant grove
#

eat the axlotol

frosty dock
pseudo cape
dreamy thunder
#

i jst gotta finish this up

distant grove
pseudo cape
#

we do not eat the minmoo, we respect the minmoo

distant grove
#

EATETH IT

pseudo cape
distant grove
#

IT IS VERY CHEWYYY

knotty copper
# frosty dock

Oh yup that fixed it thx 👍
Btw how do you set up the code to have a deck which covers all the suits?

frosty dock
#

due to how the menu is laid out, you need to create a skin for each suit

knotty copper
#

Ah thought so thank you again for the help though

nova finch
#

is there a way to check if a probability fails?

distant grove
#

how do i make my joker return to zero?

#

after an ante or round

glad osprey
nova finch
glad osprey
#

ah

chrome widget
#

Need some help with UI code for anyone more familiar with it. I'm making a joker that predicts what's in an upcoming booster pack, and I want the display to just kind of be somewhere around the joker, but I'm not 100% certain what happens with the generate_UI function when you add nodes to it

    -- boilerplate code to wrap loc_vars
    if card.config.center.discovered then
        -- If statement makes it so that this function doesnt activate in the "Joker Unlocked" UI and cause 'Not Discovered' to be stuck in the corner
        full_UI_table.name = localize{type = 'name', key = self.key, set = self.set, name_nodes = {}, vars = specific_vars or {}}
    end
    localize{type = 'descriptions', key = self.key, set = self.set, nodes = desc_nodes, vars = self.loc_vars(self, info_queue, card)}
    
    -- my actual code to try to attach the cardarea with the desc_nodes
    if not card.config.center.discovered or card.area.config.collection then
        return
    end

    if card.ability.predict_cards then
    desc_nodes[#desc_nodes+1] = {create_UIBox_generic_options({
        minw = nil,
        padding = nil,
        infotip = nil,
        no_back = true,
        contents = card.ability.predict_cards
    })}
    end
end```

It ends up putting them in the top left corner and I was under the impression it would just kind of append them below/above the description?
frosty dock
#

not really then

glad osprey
distant grove
#

thanks

chrome widget
#

I suppose it'd also make more sense to just put them above the packs it's inspecting too

distant grove
#

and i put the chips and mult

#

for value yea?

frosty dock
bold sleet
#

prob card.ability.extra.value = 0 then

distant grove
#

okay

frosty dock
#

adding an object node with a card or CardArea inside the description box seems reasonable

dreamy thunder
#

alright its done

#

gn chat

chrome widget
#

card.ability.predict_cards is a CardArea, if it helps

#

It just creates, populates, and holds it as long as it's hovering over the pack

frosty dock
chrome widget
#

Oh, interesting!

acoustic sundial
#

Hey friends, where can I find the logic for leveling up a poker hand? I took a look at burnt joker as reference but didn't take away much from it. Was hoping I could find a planet card in card.lua but didn't go so well either.

frosty dock
#

that element need not be some UIBox, it can just be a simple container that holds the object node

#

e.x. ```lua
{n=G.UIT.R, config = {align = "cm", colour = G.C.CLEAR, r = 0.0}, nodes={
{n=G.UIT.C, config = {align = "cm"}, nodes={
{n=G.UIT.O, config = {object = cardarea}}
}}
}}

chrome widget
#

And then just return that whole UI element?

frosty dock
#

return { vars = {...}, main_end = {<the UI element>} } in loc_vars

#

think it needs an extra set of {}, oops

chrome widget
#

Gimme a sec to try this

frosty dock
#

i should note that if you do ever need a custom generate_ui, you should probably base it off the base implementation steamodded provides, or call back into it if you're just extending it

frosty dock
chrome widget
#

Assuming it updated correctly (I just closed and reopened the game with the changes), it works basically identically. But thanks!!

#

Does the transform position of the object itself matter in the context of the UI box? Or would it take them as relative coordinates?

#

Because I am creating this at 0, 0, but I was under the assumption that it would be relative

frosty dock
#

uh huh

#

can i see that code again

#

are you creating the cardarea in a wider scope than the description? you should probably be recreating it on each loc_vars call

chrome widget
#

Yes, I would usually just create it once if possible

this is creating the card area, so the actual transform coordinates are the origin (this is called from the calculate function)

    0,
    0,
    (pack.ability.extra * G.CARD_W) * 0.75, (G.CARD_H * 1.5) * 0.5,
    {
        card_limit = pack.ability.extra,
        type = 'title',
        highlight_limit = 0,
        card_w = G.CARD_W * 0.7
    }
)```

And this is loc_vars, currently
```function jokerInfo.loc_vars(self, info_queue, card)
    if card.ability.predict_cards then
        local ui_box = {
            n = G.UIT.R,
            config = {align = "cm", colour = G.C.CLEAR, r = 0.0},
            nodes = {{
                n = G.UIT.C, 
                config = {align = "cm"}, 
                nodes = {{
                    n = G.UIT.O,
                    config = {object = card.ability.predict_cards}
                }}
            }}
        }
        return { vars = {}, main_end = {ui_box}}
    else
        info_queue[#info_queue+1] = {key = "artist_coop", set = "Other"}
    end
end```
#

I can definitely recreate it each time in loc_vars if needed, but I'm not 100% certain that's the issue since it'd still be being given the same values?

frosty dock
#

if the area just continues to exist, it will be rendered in its real position without any influence from loc_vars

#

loc_vars is doing nothing related to that card area being rendered in fact, so long as it's not being called. Try and see what happens when you show the description of the joker?

chrome widget
#

Just shows the regular description

frosty dock
#

a working example of card areas inside descriptions are polyminos in Bunco, and they most definitely work by creating a new card area whenever loc_vars is prompted

frosty dock
#

either way I think it's preferable to store the raw information instead of the card area because objects in ability tables tend not to play nice with saving

chrome widget
#

Gotcha, can do

#

Does raw information mean the center keys or created cards?

frosty dock
#

center keys would be the rawest information I can think of

#

if you track other information like editions, throw that in

#

anything that lets you construct the card you want to display

chrome widget
#

I mostly went with cards because the SMODS changes in Pack:open expect still being able to return a card outright from whatever booster's create_card function (including a comment lamenting that fact), so I guess I can just destroy it if need be

    -- due to SMODS, I have to support creating an actual card here. hopefully pack creators
    -- don't have it materialize before it leaves the pack
    card = _card_to_spawn
else
    card = SMODS.create_card(_card_to_spawn)
end
pack_cards[i] = card```
frosty dock
#

right, that's a thing

#

cards in ability table are just as good or bad as CardAreas

chrome widget
#

Then I guess i'll just grab the center, destroy the card, and waggle my finger at whoever gives me a card from the function

frosty dock
#

mhm

#

anyways it's nearing 3am, I better go to sleep

wintry solar
#

how are you not advancing the pools?

frosty dock
glad osprey
#

how do you change the scale of a card

#

like wee joker

frosty dock
#

display_size

stiff locust
#

how do I check if a hand is the final hand played in a round? the method I have been using is no longer working suddenly

glad osprey
#

is it just card.display_size

chrome widget
# wintry solar how are you not advancing the pools?

Very hacky change to the pseudoseed function to store advancing seed values as long as a "mode" is set to only return predicted values rather than actually set the main G.GAME.pseudorandom table

    local _pseed = 0
    if not G.GAME.pseudorandom.predict_mode or not G.GAME.pseudorandom.predicts[key] then
        _pseed = pseudohash(key..(predict_seed or G.GAME.pseudorandom.seed or ''))
        G.GAME.pseudorandom.predicts[key] = {
            value = _pseed,
            pos = 0
        }
    end
      
    if G.GAME.pseudorandom.predict_mode then
        _pseed = math.abs(tonumber(string.format("%.13f", (2.134453429141+G.GAME.pseudorandom.predicts[key].value*1.72431234)%1)))
        G.GAME.pseudorandom.predicts[key].value = _pseed
        G.GAME.pseudorandom.predicts[key].pos = G.GAME.pseudorandom.predicts[key].pos + 1
  
        return (_pseed + (G.GAME.pseudorandom.hashed_seed or 0))/2
    else 
        _pseed = math.abs(tonumber(string.format("%.13f", (2.134453429141+_pseed*1.72431234)%1)))
        return (_pseed + (pseudohash(predict_seed) or 0))/2
    end
end```
#

Hacky because it's all built around maintaining the one (1) time vanilla uses the predict_seed parameter to find the first legendary spawn in the run, and the code is only build to predict the first value of any given seed by default since the vanilla code sets it to the starting value every time if you pass it in

#

Which is why it only ever uses it right after creating the seed the first time

frosty dock
#

default is { w = 71, h = 95 }

#

it goes on the center and you can change these values to scale the display size

#

e.g. display_size = { w = 71*0.7, h = 95*0.7 } for something wee-sized

glad osprey
#

can i apply them to a deck

#

nvrm

bold gyro
#

Hey y'all, where is the code for the effects of challenges? (eg. X-ray Vision making 1 in 4 playing cards face down)

bold gyro
stiff locust
#

no that's

#

when you play your last hand

#

I want the final hand of the round

bold gyro
#

ooh

stiff locust
#

aka the hand you beat the blind with

glad osprey
#

oooooooh

#

context.end_of_round

stiff locust
#

no but

#

I need context.after

#

on the final hand

glad osprey
#

that would require the game to know that hand would win

#

so uh

#

youd have to make that yourself

stiff locust
#

clash royale grrr sfx

chrome widget
#

if it's a joker:

turbid maple
#

Is there a reset_game_globals but after each hand? or do I need to start patching and/or hooking

chrome widget
#

at any point in the calculate function, you can use hand_chips * mult to get the current value of chips and mult during the full effect triggers, because AFAIK they're globals in the actual vanilla/smods functions

#

So at the point the joker triggers, you should just be able to compare G.GAME.chips + (hand_chips * mult) >= G.GAME.blind.chips to know if the current hand will win the blind. Position depend of course, if you have any other jokers in the context that check for it

sonic cedar
#

this calls a global “joker” and crashes

did i mess something up?

turbid maple
#

the problem seems to be that joker is a global for some reason

#

and not the variable referencing the joker you're changing

sonic cedar
#

would the variable in question just be the id of the first joker?

#

like a j_prefix_joker thing

stiff locust
#

if context.after and (G.GAME.chips + hand_chips * mult) > G.GAME.blind.chips then

#

does not pass

red flower
chrome widget
# stiff locust this is already the method i was using and it's not working

I have a similar context and I'm like 95% sure this isn't bugged

    card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_mod
    return {
        message = localize{type='variable',key='a_chips',vars={card.ability.extra.chips}},
        chip_mod = card.ability.extra.chips, 
    colour = G.C.CHIPS
    }
end```
sonic cedar
chrome widget
#

Instead here I'm just checking if the score catches fire rather than beating the blind with cumulative chips

stiff locust
#

yeah idk what to say it's just not passing

red flower
sonic cedar
#

see i get that

#

but

#

how do i format the card i’m changing

stiff locust
#

wwwait

sonic cedar
#

like the same way i formatted the CENTERS?

red flower
#

are you doing this inside calculate?

sonic cedar
#

should i not be

red flower
#

no, that's fine
inside calculate use card instead of joker

sonic cedar
#

ohhhhhhh

#

ok i’ll try

#

OH

#

UM

#

does it just change or is there a way to like make it

#

flip?

#

yk what i mean?

red flower
#

you need to do the animation yourself

wintry solar
#

Flipping is a very easy event

sonic cedar
#

oh ok

stiff locust
#

i fixed it

sonic cedar
sonic cedar
turbid maple
#

hell I guess I just hook play_cards_from_highlighted but i don't know how right that is

chrome widget
#

Oh right I'm probably going to have to call loc_vars manually, huh

wintry solar
#

Look at how the enhancing tarots do it

red flower
sonic cedar
red flower
#

same return

sonic cedar
#

ok cool

#

it didn’t work i think

#

can i send to make sure i did it right

red flower
#

yeah

sonic cedar
#

kk

lavish lake
red flower
# sonic cedar

should be
func = function() card:set_ability(G.P_CENTERS["j_hpfx_ijiraq"]) end

sonic cedar
#

ohhhhh

red flower
#

missing an end

sonic cedar
#

oh shoot

#

ok THERE

red flower
#

i think it's correct but I've used func like once

sonic cedar
#

only one way to find out

#

it's still mkv

#

foolish

lavish lake
red flower
#

that sounds awful

timid oyster
#

When using add_joker, how do you give it enhancements, seals or editions?

turbid maple
#

gahhh I can't just hook the hand play function

red flower
turbid maple
#

is updating a global after a hand played something I really have to lovely patch

sonic cedar
#

fix

#

ed

#

also darn
ill try and mask it with the flip then

red flower
turbid maple
#

okay yeah that might be a better place

#

context.after is good thank you

lavish lake
sonic cedar
turbid maple
#

maybe I do just lovely patch it

#

or just give up the preview

lavish lake
red flower
# turbid maple ehghhh

oh is it a jokerdisplay problem?
it's run in real time so just save the hand in a joker_display_values field until the hand is not played anymore

#

that's what I've done at least

turbid maple
iron iron
#

how do i turn played cards into an enhancement/suit

turbid maple
#

is there some global variable I can reference?

red flower
# turbid maple sorry what would that look like

This will keep the previous hand until a hand is not played anymore
card.joker_display_values.display_hand = next(G.play.cards) and card.joker_display_values.display_hand or card.ability.extra.current_hand
(replace that for whatever the current hand field is)

turbid maple
#

ohh thank you

lavish lake
turbid maple
#

you have to?

lavish lake
turbid maple
red flower
#

also yeah

hallow forge
turbid maple
#

don't tell me this is your chemistry class homework

lavish lake
manic rune
#

:3

red flower
#

it's been a month and ive only gotten 129 jokers done

manic rune
#

"only"

#

brother thats x10 of what i have done

red flower
#

and I'm making 170 more at least

manic rune
#

😭

#

ghhh im barely making any progress at all

hard flume
#

I've finalized my mod concept. I'm just stuck on a name.

red flower
green plank
#

quick question, would this be possible (i am the only coder in this mod project so asking in advance)

hallow forge
#

quality over quantity is always more pleasing

manic rune
#

yeah, i always try to make my jokers like that

#

i feel like at this point, i can make an API for rpg in balatro

#

😭

red flower
hallow forge
red flower
#

gun

manic rune
#

yeah, i added stats, buffs and debuffs, stats visualisers for both jokers and playing cards

hallow forge
#

role-playing gun?

manic rune
#

as well as description pages for more complex stuff

#

:3

hard flume
hallow forge
#

what's the mod about?

manic rune
#

honkai star rail

red flower
#

i like names that are not just one regular word because i like ego-searching

lavish lake
#

im seeing that you need to take ownership of some jokers

hallow forge
#

btw it's easier to make bloodstone 0.5 in 2 than 1 in 4

latent portal
#

question

#

is there a command to get the key of a certain card?

red flower
#

card.config.center.key

hallow forge
#

card.config.center.key

tall tangle
latent portal
#

ty

green plank
#

the curse of homestuck

hard flume
hallow forge
#

chipcraft is better

manic rune
#

i added gacha system in shop

hallow forge
#

wasn't talking to you but cool

#

wait...

#

EQUIPMENT SLOTS

#

now i'm hyped

manic rune
#

yeah, equipment slots

#

their effects are unique too :3

#

you equip them to a joker from my mod, and they will start giving chips/mult equal to whatever is on there

#

on top of their existing effects

latent portal
#

and uh how do i do the little wiggly animation when a card activates

manic rune
#

:juice_up()

hallow forge
#

at end of hand?

manic rune
#

mhm

#

its added to joker_main

hallow forge
#

bad phrasing if you ask me

latent portal
manic rune
#

yea

latent portal
#

ty

manic rune
hallow forge
#

"during main scoring" or "during joker scoring" would be better

manic rune
#

but i actually dont know how to better name it

#

oh yeah

manic rune
#

area

#

to gain additional buffs

#

and there are a ton of other interactions between jokers too, allowing for synergies

green mica
#

I tried making a custom consumable type and its crashing when I click the consumables section of the collection. Anyone know why that might be?

#

The error message isn't helping to much it's just telling me ui stuff isn't working which I kind of already got

turbid maple
#

I like that it's called juicing up the card

#

cute

hallow forge
#

funny thing i made a skill trees mod, might just make some cross-mod skills for this just for the rpg mod synergy, would be funny

manic rune
#

that would be really cool :3

distant grove
#

woop

red flower
distant grove
#

ignore that

hard flume
#

I'll probably start working on my mod soon-ish tbh. I'm making dinner, but I want to get started as soon as possible.

distant grove
#

that was for another friend

green mica
#
SMODS.ConsumableType {
    key = "Element",
    primary_colour = "FFFFFF",
    secondary_colour = "000000",
    loc_txt = {
        name = "Element",
        collection = "Elements",
        undiscovered = {
            name = "Not Discovered",
            text = {
                "Purchase or use",
                "this card in an",
                "unseeded run to",
                "learn what it does"
            }
        }
    },
    collection_rows = {6, 6}
}

-- Helium
SMODS.Consumable {
    key = "e_helium",
    set = "Element",
    loc_txt = {
        name = "Helium",
        text = {
            "Gain a Juggle Tag"
        }
    },
    atlas = "test_mod",
    pos = { x = 1, y = 0 }
}```
#

all this stuff is pretty much just placeholders idk what I wanna make yet

#

just trying to see if I can make a new consumable type

manic rune
#

welp, with playing cards finally showing debuffs

#

guess i can continue finishing the jokers

latent portal
#

okay so

red flower
manic rune
#

sometimes i question my past self for using this

red flower
#

pela exposed??

manic rune
#

like, it should be 1.2 instead of 20

manic rune
#

😭

red flower
#

she's been cancelled

manic rune
#

naww 💔

latent portal
#

im making a joker that activates whenever a card is bought. i want to target the bought card, but using "card" targets the joker itself.

#

how do i make it target the bought card?

green mica
#

I don't think the atlas should be the issue cause I use it for other stuff that works but here it is:

    key = "test_mod",
    path = "TestMod.png",
    px = 71,
    py = 95
}```
red flower
#

I have no idea sadly

latent portal
#

really????

green mica
#

Well I appreciate the help anyways

red flower
red flower
#

context.card

latent portal
#

oh.

#

that.

#

makes sense

#

thanks!

#

also

#

how do i check whether a card is a joker or not

manic rune
#

now that i check back how i made the uis

red flower
#

card.ability.set == 'Joker'

manic rune
#

i actually dont know wtf i did lmfao 😭

latent portal
#

sorry for asking so many questions btw im just new to this

#

thank u

manic rune
#

oh uhh also, is there any fast way to remove this, Ice suggested using a hook before but i hope thats not the only option...

latent portal
#

wow it. actually worked second try

#

btw how does this card look

manic rune
#

freaky joker

latent portal
#

its a joker mimic

manic rune
#

oh, that makes sense

latent portal
#

it turns into the next joker you buy

manic rune
#

id honestly go with a design where its face is literally melting, if i were to ever add one of those shapeshifter jokers lol

#

i think it looks alright, though it doesnt seem that interesting if i have to be blunt

hard flume
manic rune
#

is this real chat

latent portal
minor furnace
#

gotta love actual life and responsibilities getting in the way of me working on modding 🙃

red flower
manic rune
#

:(

green plank
#

ik this is gotta be so easy to fix but uh Erm

manic rune
#

you have #2# but not the second var in loc_vars

red flower
#

you need to return one more value in vars that is the current mult

manic rune
#

so it doesnt know where to look at

#

its looking at a wall and determining numbers from that rn

green plank
manic rune
#

yes, add another var to loc_vars so that it knows where to read for the (Current X(n) Mult) part

green plank
#

oh

green plank
#

is that rex:r

#

that is nilaxe

manic rune
#

no, thats go mining

#

i find go mining a bit more fun than rex:r

#

;3

green mica
#

I figured it out :D

#

When I looked up stuff about the colors it said it should take hex codes normally but I guess you have to use HEX() or it doesn't work

nova finch
#

how do i do the hovering effect that's done in hologram and the legendaries?

manic rune
#

they are different

#

legendaries use Soul to get that floating sprite

#

editions use shaders

stray warren
#

But the hologram's floating sprite is still using soul_pos

distant grove
#

My next joker might be the Yun office

manic rune
#

huh

#

wait, hologarm is a joker?

nova finch
distant grove
#

Or brotherhood of iron

distant grove
nova finch
manic rune
#

oh yeah, the one which increases xmult when a playing card is added

#

i forgot

#

i thought you were talking about the edition

#

sorry, its still soul

nova finch
#

thats holographic

#

so how do i

#

do that

manic rune
#

soul_pos = {0,0},

#

add that to your joker

nova finch
#

oh ok

green plank
#

it's literally wee joker but with exponential mult

nova finch
green plank
#

i haven't modified it yet

latent portal
#

is it possible to check if a card is flipped?

#

as in, if it's currently face down

red flower
#

card.facing == 'back'

#

i think

latent portal
#

thank you!

green plank
#

i definitely did not see this coming

runic pecan
#

The more I read about lua’s metatable the more BS it feels towards Talisman’s un-comparable table numbers.

topaz monolith
#

This may sound impossible, but I need to know so I know whether it is possible or not.

I currently have an idea that joker1 will allow joker2 to be stocked into shops in the current run if joker1 destroys itself. Similar to Gros Michel and Cavendish.

How can I make this happen so that joker2 can be put into shops now when joker1 is destroyed?

novel violet
#

gros michel and cavendish both are in here

topaz monolith
#

Thanks

solar eagle
#

is there a context for when a joker is added to your build, that triggers on the joker being added?

#

actually wait i did this already

manic rune
#

add_to_deck = function()

end

solar eagle
#

add_to_deck

#

i already used it lol

manic rune
#

mhm

solar eagle
#

i just forgot

manic rune
#

also, hi yme :D

solar eagle
#

can i define a custom function on a joker and then call it?

manic rune
#

what do you mean by that

tall wharf
#

i mean i did it

manic rune
#

nice job aiko :3

solar eagle
#

like how you can define a load function
load = function(self, card, card_table, other_card)
which is then called elsewhere

latent portal
#

YES

solar eagle
#

i'd like to do the same thing but call the function in the joker's calculation code

tall wharf
#

kinda

latent portal
#

I MADE A JOKER BY MYSELF

#

WITHOUT ASKING FOR HELP

#

!!!!!

solar eagle
#

if not possible ig i could just make it a local function, but more annoying

manic rune
solar eagle
#

yea i guess that works

manic rune
#

and besides, if you are gonna use it in calculation anyways then you can just define a function outside, its less work

manic rune
#

for enhancement, its

card:set_ability(G.P_CENTERS["enhancement key here"],nil,true)

#

i dunno about suits though

#

oh yeah

#

check the tarot cards code

tall wharf
#

hi

manic rune
#

good morning

#

are you feeling better

tall wharf
#

why is my trib quartered

#

send help

manic rune
#

:3

#

the "All values are halved" got retriggered

#

crazy

tall wharf
#

can i just copy shit from Cryptid

#

the misprintize

manic rune
#

probably? you will need to check whether they have hooks and patches for that too

#

-# theres definitely misprintize-related patches, i remember seeing one

unkempt thicket
#

Why does this assertion fail?

nova finch
#

i know how to spawn a random joker with SMODS.add_card, but how do i spawn a specific one?

sturdy compass
chrome widget
#

I am once again having ui troubles 😔. I was advised to use this pattern to display a custom UI using loc_vars, so circumstantially it can return main_end with a UI element displaying a cardarea

    if info_queue then
       info_queue[#info_queue+1] = {key = "artist_coop", set = "Other"}
       return {main_end = {}}
    end
    if card.ability.current_hover then
       return {main_end = {get_pack_ui(card, card.ability.current_hover)}}
    end
end```

However, it works on hovering over a booster pack, so I have to call loc_vars manually whenever the hover context gets fired, and I can't seem to make the cards disappear after the first call, they just linger
nova finch
sturdy compass
#

Show the code rq

nova finch
#

im trying to spawn the joker from the second image

sturdy compass
#

Your key input is wrong. The correct key would be, in your case, j_[MOD PREFIX]_ulti

nova finch
#

ohhh

#

i tried w just mod prefix

#

i didn't know i had to do j_ too

#

thank you!

tall wharf
#

fucked up in the crib playing aikoyori's fool

lethal mural
#

why is banned_keys not working here

#

nvm i figured it out i think banned_keys literally only works in challenge decks and nowhere else

#

gotta use no_pool_flag instead

#

i think

#

anyway

hard flume
#

Are consumables typically the same size as Jokers or are they a different size?

lethal mural
#

i think they are the same size but i can verify it rq

lethal mural
#

consumables are 63 x 93 while jokers are 69 x 93 but every "grid" on their sprite sheets are 71 x 95

hard flume
#

Got it

lethal mural
#

there are consumable templates somewhere (if its an existing type that is) in this server so you dont rly gotta worry about recreating it from scratch

#

like searching (x) template in the search bar youd probably find it

lethal mural
#

i'm at a complete loss

#

i'm guessing no_pool_flag only works on jokers and i wasted my time trying to use it on a booster pack

#

how the fuck do i make it not spawn ive spent three goddamn days trying to figure it out

#

banned_keys seems to be coded to only work for challenge decks and no_pool_flag seems to only work on jokers

tall wharf
lethal mural
#

breakthrough has happened i hope

#

i forgot to put "p_" in front of the banned keys

topaz monolith
#

What would the IF Context combination be if I need the Joker to destroy a certain card, but after scoring.

This is just basic as I need to get the main functionality working beforehand. I also did context.after and it was not triggering at all. "Working1" is supposed to be printed if it does find the correct context

tall wharf
lethal mural
#

you know what i give up

timid oyster
#

Is it possible to give Decks rules from Challenges? I'm wanting to make it so that no Jokers spawn in the shop but I can't figure out how to add no_shop_jokers to the Deck

lethal mural
#

If you can then I have been unable to because I've been trying to ban a specific booster from appearing on a modded deck and it literally refuses to work

timid oyster
#

Damn I've been trying for a while and can't figure it out

lethal mural
#

ive been trying for like three days

timid oyster
#

I did just start learning this today though so I'm not surprised lol

wintry solar
#

You can absolutely use banned keys

lethal mural
#

im not sure what im doing wrong then

#

ive tried with and without "p_" in front

#

they still appear

#

wait

vagrant moth
#

How do I make it so a card can be enabled by having, for example, a Bonus card or a Mult card? My current implementation gives the following error.

  key = 'empowered',
  loc_txt = {
    name = 'Empowered',
    text = {
      "Retrigger all {C:attention}Bonus{}",
      "and {C:attention}Mult{} cards"
    }
  },
  config = {},
  rarity = 1,
  atlas = 'MASS',
  pos = { x = 4, y = 1 },
  cost = 5,
  enhancement_gate = {'m_bonus', 'm_mult'},
  loc_vars = function(self, info_queue, card)
    return { vars = {} }
  end,
 calculate = function(self, card, context)
        --Replay the bonus and mult cards!
        if context.repetition then
            if context.cardarea == G.play then
                if SMODS.has_enhancement(context.other_card, 'm_bonus') or SMODS.has_enhancement(context.other_card, 'm_mult') then
                    return {
                        message = localize("k_again_ex"),
                        repetitions = 1,
                        card = card,
                    }
                end
            end
        end
    end
}```
tall wharf
#

??????????

vagrant moth
#

Shader code?

lethal mural
#

ok it turns out i fucked up entering the keys

#

god im actually fucking STUPID

chrome widget
#

Encountering a previously considered but strange design question when it comes to this card:

Having a tool to predict card packs is cool, but it does inherently "peel back the curtain" in a way on the pseudorandom values that drive most of the game's logic, so for example both of these standard packs as shown as having identical contents, when that's inherently untrue (I just can't simply predict which pack the player will open first if they open both). It also means that if a player passes on multiple of the same pack type in a row in different shops, the seeds will never advance, regardless of what other cards are bought, showing multiple shops in a row as having "identical" contents in their boosters

#

So the solutions are... one, probably make the joker unable to be found before a specific ante to make it likely that the player has economy to skip packs less, two, pull some bull to show seed advancement multiple times to show packs as having different contents and then manipulate the sprites when you open them to match what they saw with the pack they picked

#

The latter is a ton of work though

vagrant moth
bold gyro
#

Hey y'all, I get a crash "attempt to index field 'extra' (a nil value)" because of the code below. Why does this happen?

config = { extra = { can_tag = 1 } },
calculate = function(self, card, context)
    if context.after then
      card.ability.extra.can_tag = 1 --crash occurs first at this line
    end
    if context.end_of_round and G.GAME.blind.boss and card.ability.extra.can_tag == true then
      add_tag(Tag('tag_ethereal'))
      card.ability.extra.can_tag = 0
    end
  end
runic pecan
bold gyro
runic pecan
bold gyro
#

yes

runic pecan
#

And at the moment that run started, is can_tag already defined in extra?

bold gyro
#

okay starting a new run stopped the crashing, ty!

plush cove
#

calling for backup here! I'm trying to make a Joker that gains X0.25 mult whenever a specific hand is levelled up, and I have this so far

-- Global events hooks
local CommonEvents_luhRef = level_up_hand
level_up_hand = function(self, card, hand, instant, amount)
    sendInfoMessage(hand)
    CommonEvents_luhRef(self, card, hand, instant, amount)

    if to_big(amount or 1) > to_big(0) then
        SMODS.calculate_context({ mstg_level_up_hand = true, mstg_level_up_hand_name = hand })
    end
end

And I think I've done everything right, but for some reason, while it does detect the context, it just...doesn't pass along the name of the hand. And my little sendInfoMessage bit returned nothing!

The levelling up and everything still works, but I kinda need to get the hand information. Any assistance? Thanks in advance!

#

i've also tried doing this as a lovely patch, but still no cigar

#

i'm extremely puzzled

#

Update: Nevermind, I fixed it. Apparently I got too used to typing "self" in my hooks, and that ended up confusing the code and making it register nothing

slender cape
#

just made this post on smelly reddit and then remembered that the discord exists

nocturne garnet
#

assuming you're trying to make a special planet

slender cape
#

just change the existing planets

nocturne garnet
#

ohhhh

slender cape
#

assuming thats harder

nocturne garnet
#

as in like change localizations or just change one specific planet

slender cape
#

im changing most of them

#

are you free to hop in a call im like rlly new to modding

nocturne garnet
slender cape
#

how would i format that in like the main.lua

#

oh right sorry

#

would i have to do that for each individual planet i want to change

nocturne garnet
#

basically yea

slender cape
#

ill give it a shot

#

for the SMODS.Joker: bit do you know if it would be .Planet or .Consumable

#

and if not how would i check

slender cape
#

awesome

#

its throwing up an error for this code about not closing the curly brackets

SMODS.Consumable:take_ownership('saturn',
    {
        badges[#badges + 1] = create_badge(localize('k_planet_q'),card_type_colour, nil, 1.2)
    },
    true
)
frosty dock
#

that code is not inside of any function

slender cape
#

its in function SMODS.INIT.TexturePackTemplate()

#

oh wow i never changed the name of that from the template

frosty dock
#

that's not what I mean

#

it is directly inside of a table

#

you don't need a SMODS.INIT function at all btw

slender cape
#

huh ok

frosty dock
#
SMODS.Consumable:take_ownership('saturn', {
  set_card_type_badge = function(self, card, badges)
    -- the code
  end,
})
#

mobile wtf

slender cape
#

would 'the code' just be the thing i wrote inside the other one

frosty dock
#

specifically the line where you create the badge

#

I'm not sure what the true is supposed to be doing

slender cape
#

got it

#

idk it was in the joker example you posted

frosty dock
#

definitely not like this

slender cape
#

not sure if its a required field or not but its not doing me any harm

#

oh ok

frosty dock
#

right it's outside not inside, just looked weird on mobile

#

you don't need it

#

it just makes it so it doesn't add your mod badge to what you're changing

#

sorry I just woke up haha

slender cape
#

ooh okay it works i think

#

wrong colour but at least it works

spring lantern
#

so im trying to store the first discard of a round before destroying it, and then when a consumable is used create new playing cards with the same suit/rank but with added enhancements, i have no clue what i'm doing when it comes to creating the new cards themselves sadly

#

right now it throws this error:

#

okay i forgot about P_CENTERS, now the crash log is different

tall wharf
#

development resumes tomorrow

spring lantern
#

i had suit and rank the wrong way around 🤦‍♀️

#

okay so this happens right before the crash should i be concerned

#

i'm following how base game uses the create_playing_card func but i don't know if steamodded changes something about how this func is used

slender cape
#

is anyone familiar with the Booster:take_ownership_by_kind() function cause i cant get this code to work


    SMODS.Booster:take_ownership_by_kind('p_celestial_normal', { atlas = 'boosters_owp' })
    SMODS.Booster:take_ownership_by_kind('p_celestial_jumbo', { atlas = 'boosters_owp' })
    SMODS.Booster:take_ownership_by_kind('p_celestial_mega', { atlas = 'boosters_owp' })```
#

its not throwing an error or anything it just isnt overriding the atlas

frosty dock
slender cape
#

i havent been able to find any examples so idk how its meant to be used

frosty dock
#

take_ownership_by_kind takes a booster "kind" instead of a key and applies to all of that kind

#

So SMODS.Booster:take_ownership_by_kind('Celestial', {...})

slender cape
#

woah holy shit that worked thank you

spring lantern
#

hello aure smart smods man may i have your assistance

frosty dock
#

no

spring lantern
#

crying

frosty dock
#

||I jest, of course||

spring lantern
#

hold on it looks li8ke this now

frosty dock
#

at a glance, you're setting seals and editions wrong

#

newc:set_seal(...)
newc:set_edition(...)

topaz monolith
#

Raking my brain for almost two hours. How do you give the player a tag from a joker? More specfically, the Ethereal Tag?

frosty dock
#

add_tag(Tag('tag_ethereal')) iirc

spring lantern
#

either way i'm getting the same error, i think the issue is in create_playing_card

frosty dock
#

what's the error again

spring lantern
#

but it's hard to say because the crash log points to a base game script

spring lantern
frosty dock
#

can I see what's in your file dumps around the line where it crashes?

spring lantern
#

it's this func

frosty dock
#

that seems... unrelated

#

oh

#

{L6W.C.secondary}

spring lantern
#

all i can gather is that _draw_major.dissolve_colors is nil?

#

oh my god...

frosty dock
spring lantern
#

bruh

#

aight let me try it now

#

no way that was literally it

#

works like a charm

#

thank you but like damn how am i this much of a goofball with syntax 😭

tall wharf
#

br

spring lantern
#

br

tall wharf
#

how do people make good looking shader wtf

#

i can barely wrap my head around the math

topaz monolith
#

When a booster pack is openning, how do I check if its a specfic booster pack? The four(?) Spectral packs to be precise. Currently making it so that the joker earns Xmult if Spectral packs are opened

spring lantern
#

when context.opening_booster (i think that's the name) you can access SMODS.OPENED_BOOSTER and check if the booster is a spectral pack

shadow rapids
#

is there way to check fir a card with no enhancements?

spring lantern
#

i have NO idea how im gonna do this

manic rune
#

cryptid

#

:3

spring lantern
#

yup, time to dig through that mess

manic rune
#

orrrr you can ask aikoyori for reference

spring lantern
#

@tall wharf hi

manic rune
#

their edition halves the values of cards

hushed field
#

doubling joker values is luckily not too difficult, I found. It only gets hard if you wanna be clever like me and exclude certain values from the multiplication

#

but you can just store the pre-multiplication values for safekeeping, then iterate through their ability.extra and x2 every value

tall wharf
manic rune
hushed field
#

modded may have the problem that certain values or intended behaviours break

manic rune
#

since my guess was that you go through a number of vars like "mult" and such in the card.ability.extra to multiply that up

spring lantern
tall wharf
spring lantern
#

:0

#

thank u

hushed field
#

So it's really gonna depend on what your approach to compatibility is

manic rune
#

orrr wait, are you just multiplying all the values in card.ability.extra?

tall wharf
#

tho playing cards are different

#

they have nominal value that they use

hushed field
#

I think Cryptid only multiplies values with chips or mult in the name? Or has some exceptions? I haven't checked that code in a while

hushed field
tall wharf
#

so i guess you should multiply the nominal value

manic rune
#

...

#

oh, thats gonna fuck up my mod so bad

#

😭

hushed field
#

I'm checking now just to be sure, because I remember there being so many checks, haha

hard flume
#

Hi chat. I'm debating making my mod a generic dumping grounds mod because I have so many ideas

manic rune
#

do you guys think it would be interesting for certain jokers in my mod to synergize with vanilla jokers, like having literal effects saying "If (x) is to the Joker's right, (y)"

hushed field
# tall wharf not really

it just checks to see if the number isn't one of a few values you don't wanna multiply, right?

hushed field
manic rune
#

ehh, i dont think i will ever put Rare jokers in the mechanic if im really gonna do it

#

mostly just common/uncommon jokers

hushed field
#

I've been playing around with it, because I like some synergies between my jokers and the vanillas, but the vanilla jokers, because they aren't movie jokers, are inherently weaker because they can't earn you explicit Synergies from my synergy system, so no joker slots or bonus value.

manic rune
#

for now, im intending to make Literal Trash synergize with Joker, giving both of them x mult for example

hushed field
#

Referencing specific jokers also gets weaker the more jokers there are ofc

manic rune
vagrant moth
#

How do I give a Joker two enhancement_gates?