#💻・modding-dev

1 messages · Page 428 of 1

manic rune
#

hi astra

normal crest
#

hi bepis!!

manic rune
#

hii

tall jewel
#

does anyone happen to know why this happens when adding custom UIBoxes?

sonic cedar
#

bepis you need to get off forsaken

tall jewel
tough temple
#

hey why aint my silly mod loading

sonic cedar
#

where metadata

sturdy compass
#

no metadata

sonic cedar
#

no metadata?

sturdy compass
tough temple
#

metadata?

sonic cedar
#

STOP

#

metadataless

tough temple
#

dang

#

this tutorial didnt tell me bout none of that

sturdy compass
tough temple
#

it just told me to set up a normal love2d project

#

Damn

tall jewel
sonic cedar
#

hi aure’s cat

tough temple
#

yeah i was wondering how it would get the name

tall jewel
#

I have to draw the uiboxes manually anyways

tough temple
#

yall are a huge help ngl thanks

sturdy compass
#

It's what this channel be for

sonic cedar
sonic cedar
tall jewel
sonic cedar
sturdy compass
sonic cedar
#

you can’t deny its existence any longer

#

It’s grown too powerful

sturdy compass
#

lmao

#

Manifesting a tech-support channel to make modding-chat more bearable

sonic cedar
#

Oh my god lsp def is actually competent now

sturdy compass
#

insane

sonic cedar
#

Im so stupid smh

tough temple
#

yall can i input a specific color into joker texts?

#

more specifically i want this color

sonic cedar
#

yes

plush vault
tough temple
#

awsome

plush vault
#

I need opinnions on wich one would fit better a Joker, here is the pitch:

[Lucky Seven][Rare]

  • Playing a seven gives random permanent bonuses
    Bonuses can be:
    +7 chips
    +7 mult
    +0.07 xmult
    +0.07 xchips
    and 10% chance to "Jackpot" and give all 4 bonuses

And here are the contenders so far for what to draw (those are mockups with google images):

Option A is mostly as is, just pixel-arted with gold chips in the background
Option B is stacked dice, showing a 6 and a 1 in a dark room
Option C is pieces of the 4 suits of 7's stitched together

tough temple
#

🔥

subtle merlin
#

Holy fuck im stupid, i forgot scope and was wondering why my program was crashing

faint urchin
#

I made an ObjectType for some modded jokers I made that belong to a specific group, and certain jokers should treat the cards in that ObjectType differently. How do I check if a card is in that ObjectType? Is there a better way to do that?

north lodge
plush vault
#

I enjoy plasma deck shenanigans :'>

north lodge
#

So long as you're okay with it not feeling very vanilla as a result, I see no problems with it then. I would possibly just skew it to not be 55% chance of stacking x score. (10% jackpot, half of the remaining 90% = 45%)

#

I like the dice option. The 6 1 is subtle but good I feel. Optionally you could put 7s on each side, but I think that's worse.

tough temple
#

the joker is loading but the sprite isnt

#

its just the default sprite

faint urchin
#

atlas needs to be lowercase

tough temple
#

oh

#

HEEELLL YEAH

#

better

unkempt rover
#

Someone help me?

#

I want to make a joker that when another joker is destroyed, it gains chips, but I don't know how the joker will identify when a joker is destroyed.

plush vault
#

I cant draw dice

unkempt rover
empty coral
#

How could I detect if a played hand has suits different from

#

A. a set list of suits
or B. (ideally) suits other than the starting suits of the deck

unkempt rover
empty coral
#

i.e a played hand has clubs on checkered deck

#

that would be a suit other than the starting suits

#

may be hard since the game turns the other suits into spades and hearts so it may think it has all 4 to start that's why I consider just a set list

unkempt rover
#

From what I understood, that’s what you meant

hybrid shadow
#

bump

modern kindle
#

if im trying to account for modded suits can i still just look in card.base.suit or is modded that has_no_suit still

faint urchin
#

Is it possible to add a custom badge to a vanilla joker?

hasty mist
#

Can i not use commas here?

unborn bay
#

what are you even trying to do

hasty mist
tall wharf
#

you'll have to loop thru it

#

also i don't know if that's the best way to go about it

hasty mist
#

😭 😭 😭

#

i dont understand for loops at all

strange wasp
#

Hi, I am slowly piecing together the smods wilki and looking at other mods and examples for reference. I am wondering as to what files you typuically use
I know localization is for the descriptions of things in said language (ex: en-us = english.) But what about the other ones?

unborn bay
#

lmao

hasty mist
#

i guess its time to learn for loops

#

could i perhaps have assistance in this

sleek cliff
#

Ok, I just want to make sure I have this right where I want this to destroy and replace a joker, I feel like im missing something with the destroy function

chrome widget
# strange wasp Hi, I am slowly piecing together the smods wilki and looking at other mods and e...

Hi Jovbau, I believe they're tagged with IETF language tags https://en.wikipedia.org/wiki/IETF_language_tag

An IETF BCP 47 language tag is a standardized code that is used to identify human languages on the Internet. The tag structure has been standardized by the Internet Engineering Task Force (IETF) in Best Current Practice (BCP) 47; the subtags are maintained by the IANA Language Subtag Registry.
To distinguish language variants for countries, regi...

strange wasp
chrome widget
#

It's just that one file!!

#

en-us.lua is the entire english localization for the game

strange wasp
sturdy compass
#

No they mean like

#

All of them files

#

Like main.lua, metadata.json, etc.

chrome widget
#

Oh like every file

#

main.lua is the lua standard for the entry point file of a program

wintry solar
chrome widget
#

Balatro requires assets/1x and assets/2x when it comes to setting up its visuals

#

Otherise... it kinda depends on your organization

strange wasp
chrome widget
#

For SMODS, you'll also ideally need a json file names [mod-name].json which is your metadata

strange wasp
#

What I am trying to get at is, which folder is used for what thing. (Example: localization is language.

chrome widget
sturdy compass
#

For main.lua and your .json files, those all go in the root mod folder

strange wasp
hasty mist
#

is there a template for for loops?

chrome widget
#

there are three types of for loops in basic lua

  • basic arbitary for loop: Iterates max - min number of times. i is the index, which is the number of iterations
    -- code
end```

- indexed list for loop: Iterates over the elements in a given list, provided those elements are indexed with sequential numbers (`1, 2, 3, 4, 5...` and so on). `i` is the index, and `v` is the value assigned to the index key
```for i, v in ipairs(list) do
    -- code
end```

- key-value loop: Iterates over the elements of a non-indexed table. `k` is the key, and `v` is the value assigned to that key. If you need an index, you can either declare one yourself and then increment it each loop, or use one of the others
```for k, v in pairs(table) do
    -- code
end```
sturdy compass
#

No

chrome widget
#

root is the uppermost folder. that folder you've named root isn't uppermost--it's inside the root folder itself

hasty mist
#

ive always avoided these because of how complicated they are

#

but im forced to actually learn them now

sturdy compass
#

I would not really call loops complicated

#

They’re a pretty basic part of any programming language Emoti_Shrug

chrome widget
#

Functionally a loop is simple: whatever code is inside the loop block is run multiple times. Then the program moves on once the loop has finished

hasty mist
#

well i havent learned them yet 😭

#

i am trying to make a deck that removes every modded joker from the pool

#

i was told i should loop through G.P_CENTERS and check for original_mod

#

this is proving very difficult

chrome widget
#

yep yep. Though I will say that specific task isn't like the absolute easiest or anything, it's totally doable

#

You probably want to hook the vanilla function get_current_pool

hasty mist
#

how would i do that?

#

thats the first thing i need to do right

chrome widget
#

Do you know how to hook functions?

hasty mist
#

ive done it before yeah

#

im not fully versed in it though

chrome widget
#

Okay, then first you hook get_current_pool. Store the existing version of the function in a local variable, then redefine it;

function get_current_pool(_type, _rarity, _legendary, _append)

end```
#

Then, you need the values that the original version of the function returns, because that includes the pool to modify. So you call your stored version of the original function as a function, and pass in the arguments:

function get_current_pool(_type, _rarity, _legendary, _append)
    local _pool, _pool_key = ref_get_pool(_type, _rarity, _legendary, _append)
end```
hasty mist
#

alright, this makes some sense to me so far

#

following along best i can

#

alright so

chrome widget
#

Now, if we want to modify specifically the joker pool, we want to check if the type being accesed is 'Joker'. As well, since you said this is a deck effect, we also need to check that that deck is currently active

hasty mist
#

yeah, it's just the joker pool

#

as for checking for the deck, can i not just put the hook in an apply function?

#

thats what ive been doing

chrome widget
#

That would mean you hook and redefine it every time the deck is chosen, which means over multiple runs in a single game session it would indefinitely nest the hooks

hasty mist
#

i see

chrome widget
#

However, the easiest way to do this modification is to use the Back's apply function to set something like this:
G.GAME.modifiers.no_modded_jokers = true

#

Then, in the hook, you can use that:

function get_current_pool(_type, _rarity, _legendary, _append)
    local _pool, _pool_key = ref_get_pool(_type, _rarity, _legendary, _append)

    if _type == 'Joker' and G.GAME.modifiers.no_modded_jokers then

    end
end```
hasty mist
#

oh, that's convenient

#

yeah

#

so, checks for jokers and the deck modifier

chrome widget
#

Now is where you loop through the pool. The pool given by get_current_pool is an indexed list of joker keys (meaning all the entries in the list look like this)

#

Everything in Lua is structured as "tables" which are boxes of data where each object has a key (which identifies it) and a value (which is the actual data being stored). In this case, the keys are those numbers, incrementing from 1

hasty mist
#

yeah, makes sense, so this is how the pool data is stored?

chrome widget
#

Mhm. It's basically just a giant list of those entries counting from 1 to however many jokers you have loaded total

#

Since it's an indexed list, you can use the second for loop type I mentioned before that's specifically built for it

   -- code
end```
hasty mist
#

i see

chrome widget
#

Well... actually, you should use the first one, but this is maybe slightly easier to learn?

hasty mist
#

so should this also go in the hook?

hasty mist
#

never seen the first one before

chrome widget
#

yep yep:

function get_current_pool(_type, _rarity, _legendary, _append)
    local pool, pool_key = ref_get_pool(_type, _rarity, _legendary, _append)

    if _type == 'Joker' and G.GAME.modifiers.no_modded_jokers then
        for i, v in ipairs(pool) do
           -- code
        end
    end
end```
#

In this case, your list is pool

hasty mist
#

alright this makes sense so far

chrome widget
#

Since we're not using the arbitrary for loop, we're going to have to construct a second list to store the actual data we need. I.E. you want to return a version of pool that only has vanilla keys. That means you can either take them out of the one that already exists (which the first one allows you to do), or just move them to a new one

#

So instead, declare a new table first:
yep yep:

function get_current_pool(_type, _rarity, _legendary, _append)
    local pool, pool_key = ref_get_pool(_type, _rarity, _legendary, _append)

    if _type == 'Joker' and G.GAME.modifiers.no_modded_jokers then
        local new_pool = {}
        for i, v in ipairs(pool) do
           -- code
        end
    end
end```
subtle merlin
#

How would i be able to tell if a card gains an enhancement during scoring?

chrome widget
#

Now, the for loop is iterating inside every key and value inside the pool. v, or the value, is the string key of a joker in the game, all of which are actually used to index the card data in G.P_CENTERS. The way tables work is that if you know the key, you can just provide the key to the table to access whatever value it has stored in that key

So on the first iteration of the for loop, i equals 1, and v very likely equals 'j_joker' since that's the first joker in vanilla. This means you can get the data for that joker by doing G.P_CENTERS[v], which is equivalent to doing G.P_CENTERS['j_joker']

hasty mist
#

alright alright that makes sense

real terrace
#

man what the fuck does that mean

maiden phoenix
real terrace
#

coding is gonna be hard

chrome widget
#

Lastly, there's a shortcut to adding new entries to indexed lists. If you do #list on an indexed list, it gives you the number of entries currently in the list. And if you want to add a new entry to the list, you just need to do list[key] = value. So, if you do list[#list+1] = value, you're adding a new value at the next sequential index in the list

#

So for your new table, you want to just keep adding entries to it of the vanilla jokers you find, which would be new_pool[#new_pool+1] = v

daring fern
#

How would one draw a sleeve on a sleeve?

chrome widget
# chrome widget So for your new table, you want to just keep adding entries to it of the vanilla...

So you build your table with all your vanilla jokers by making sure they're vanilla, by doing like you said and checking the center for original_mod, and then adding them to the new pool

function get_current_pool(_type, _rarity, _legendary, _append)
    local pool, pool_key = ref_get_pool(_type, _rarity, _legendary, _append)

    if _type == 'Joker' and G.GAME.modifiers.no_modded_jokers then
        local new_pool = {}
        for i, v in ipairs(pool) do
            if G.P_CENTERS[v].original_mod then
                new_pool[#new_pool+1] = v
            end
        end
    end
end```
hasty mist
#

i see

#

i think i understand now

#

or at least enough to start to understand loops now

chrome widget
#

What this ends up doing is that any joker that's modded is not added to the new pool, so its relative size (and number of entries) goes down by 1. If Greedy Joker was modded, then it would end up like this:

#

Greedy Joker is never added, and Lusty Joker is added at the index of 2 instead. Every following item in the list is added at 1 less as well, and that just keeps happening as you exclude more from the table

hasty mist
#

makes sense yeah

chrome widget
#

Now all that's left to do is return your new pool. The easiest way to do it is just overwriting the old pool, and then returning both the original return values

function get_current_pool(_type, _rarity, _legendary, _append)
    local pool, pool_key = ref_get_pool(_type, _rarity, _legendary, _append)

    if _type == 'Joker' and G.GAME.modifiers.no_modded_jokers then
        local new_pool = {}
        for i, v in ipairs(pool) do
            if G.P_CENTERS[v].original_mod then
                new_pool[#new_pool+1] = v
            end
        end
        pool = new_pool
    end

    return pool, pool_key
end```
#

And that should be it. If you've selected this deck, no modded jokers will be available

hasty mist
#

alright, cool! i'll test it out now

#

hm, seems not

#

hold on

chrome widget
#

Which line is 138?

hasty mist
#

this one

#

let me try again i might have done something weird ingame

gray quartz
#

i goes in there, not v

#

i think

chrome widget
#

No G.P_CENTERS uses string keys

gray quartz
#

oh ok

#

would the index work tho or no?

chrome widget
#

OP

#

I KNOW WHY

#

You're gonna have to also check that v ~= 'UNAVAILABLE'

#

Or maybe it's in lowercase

hasty mist
#

along with the type and modifier check?

chrome widget
#

get_current_pool sets keys for jokers that you can't get (due to not being able to find duplicates or whatever) to that value

hasty mist
#

or the original_mod check

chrome widget
#

In the same line but before original mod check

hasty mist
#

alright

#

if v ~= 'UNAVAILABLE' and .P_CENTERS[v].original_mod then?

thorn furnace
#

meow

hasty mist
#

or should it be or

chrome widget
#

Nope, and is correct

gray quartz
#

G before .P_CENTERS and ur set

hasty mist
#

awesome

#

oh whoops typo

chrome widget
#

I believe the nil access is because it tried to look for G.P_CENTERS['UNAVAILABLE'] which is not valid

#

So that should prevent that

hasty mist
#

alright

#

it still seems to be allowing modded jokers though

#

let me try something

daring fern
# thorn furnace meow

You would do lua G.E_MANAGER:add_event(Event({ func = function() if not G.jokers then return false end SMODS.add_card({set = "Joker", stickers = {"eternal"}}) return true end })) In apply.

daring fern
hasty mist
#

hm yeah still not working

gray quartz
empty coral
chrome widget
#

Oh duh

#

It would be not G.P_CENTERS[v].original_mod

#

Since you need to check that it doesn't have a mod

#

I believe what the current code does is only give you modded jokers lmao

hasty mist
#

oh right i literally thought of that too but second guessed myself

#

😭

daring fern
chrome widget
hasty mist
#

anyways, thank you!

#

nope it works perfectly now

chrome widget
#

Yay!!!!

gray quartz
hasty mist
#

for reference if i wanted to exclude all modded cards, (I don't, this is just for learning) would i simply remove the "Joker" check?

#

or would it be more complicated than that

chrome widget
#

No yeah it should genuinely be that aimple

hasty mist
#

awesome thanks

chrome widget
#

It wouldn't exclude Tags, Suits, or Ranks though

#

Since those aren't "cards" internally

hasty mist
#

thatll be the deck + sleeve effect then

#

lmao

chrome widget
#

Have fun!!!!! Also mrrp 🏳️‍⚧️

hasty mist
#

yesss 🏳️‍⚧️

#

thank you so much!!

#

i am very grateful

maiden phoenix
#

setting local values in calculate outside of context checks will reset them

#

Save the table in card.ability

hasty mist
#

what size are sleeves?

#

px and py

#

oh, 73x96

turbid igloo
#

guys how do i give the player money if they have set joker?

karmic sand
#

Hi if I wanted to detect if the player has the crystal ball voucher how would I go about doing that i know you can do other_consumable but idk if other_voucher is a thing lol

daring fern
karmic sand
#

Thank you gamer o7

daring fern
#

How does one make seals on cards on the title screen be the right size?

primal robin
#

@tall wharf here's much better check for nested folder

if SMODS.current_mod.path then
        local normalized_path = SMODS.current_mod.path:gsub("\\+", "/"):gsub("/+$", "")
        if not normalized_path:match("/Mods/[^/]+$") then
            local mod_folder = require("lovely").mod_dir:gsub("\\+", "/"):gsub("/+$", "")
            local last = normalized_path:match("/([^/]+)$")
            local correct_path = mod_folder .. "/" .. last
            error(string.format(
                [[


Mod installed incorrectly.

Right now it's placed in %s, which is called "Nested folder".
To make it work properly, move mentioned folder in %s,
so result mod directory should be %s
]],
                normalized_path,
                mod_folder,
                correct_path
            ))
        end
    end
frigid blaze
#

Can you tell me how to make it possible to draw more than 5 cards?

vale glen
#

There's also this function, but haven't personally tried it.

faint yacht
#

What are the conditions for drawing additional cards?

daring fern
#

paper zealot
#

Balatro, currently:

native zinc
#

i mean maybe it's an ipairs/pairs thing

#

somehwair in all that code

daring fern
paper zealot
#

Almost definitely an infinite loop or recursion problem, then, though I can't see it in the code you posted

daring fern
obtuse silo
#

how would i use this to put cards into the consumable slot?

daring fern
obtuse silo
#

alr lemme try that
just wasn't sure on the exact terminology

orchid badger
#

i have a few fun ideas for a mod, could someone or a few people just give some tips on how to mod balatro? i have little to no experience with modding or coding

karmic sand
#

im trying to make my consumable give the player +1 hand size for the round when the consumable is used, how would I go about doing this?

daring fern
cobalt iron
#

Is there a section for decks in the steammodded documentation, I can't find it

pure salmon
manic rune
#

🤔 will this crash with talisman

primal robin
#

nope

karmic sand
#

what context would i use to check if the player is in a round is it just context.in_round?

obtuse silo
#

for some reason it's saying there are "missing coressponding "end"s"

faint yacht
#

elseif, not else if.

formal parrot
#

How can i check if

#

Another joker is sold

faint yacht
#

context.selling_card and context.card.

manic rune
#

check the set

mint raven
#

heyo people, sorry for the potentially dumb question but been trying to follow some tutorials for balatro modding (mainly the video in the forum post of the modding starter pack) and I think I copied it pretty one to one yet my lil test mod isn't showing up in the mods list nor is the test joker showing up in the game at all, anything I may have missed?

formal parrot
manic rune
#

follow my tutorial to get mod loaded in instead...

mint raven
manic rune
#

dont use steamodded header, use a metadata file

manic rune
#

scroll up just a lil bit :3

mint raven
#

oh the your first mod github thing?

manic rune
mint raven
#

huh I may be blind

#

well thanks

#

will see if this works

cobalt iron
#

is there a way to set the cards a deck will have?

mint raven
manic rune
#

thanks :3

paper zealot
manic rune
#

imagine using header in 2025 smh

mint raven
paper zealot
#

For now, just removing one M should be enough to get it recognised and loaded by Steamodded

paper zealot
obtuse silo
#

this is only spawning tarot cards with an unceasing purple square effect

manic rune
#

🤔 whats math.fmod

mint raven
#

imma just do what bepis says and use their tutorial lmao

#

fixing typos did not do it

obtuse silo
#

it's so the first slot is a tarot
the second slot a planet card
etc.

paper zealot
# mint raven fixing typos did not do it

Apparently MOD_AUTHOR also requires square brackets around the author, so MOD_AUTHOR: [ Cyro ]. But yes, definitely better to learn the updated better way of doing things

vivid grotto
#

I am attempting to add a new enchantment and have a joker apply this enchantment to any card played. Can someone tell me what is wrong with my current implimentation that is resulting in the crash: Oops! The game crashed: Card.lua:251: Could not find center "backstabbed"

obtuse silo
#

with tarots

#

because it's returning the set

manic rune
cobalt iron
#

How can I loop through all playing cards after pressing play?

vivid grotto
manic rune
#

for _,v in ipairs(G.play.cards) do if you meant played cards, theres G.playing_cards too if you want full deck 🤔

shell axle
#

idk where to put this

manic rune
shell axle
#

usually if it shows which mod is causing it ill put it in the right mod chat

#

but this one doesnt specify

manic rune
shell axle
#

lol sorry :(

manic rune
#

but in cases like this

#

uh

#

your best bet is finding what mod is causing that crash

shell axle
#

ill try that ty

obtuse silo
#

is there any way to have a booster pack contain multiple types of card

manic rune
#

what

#

no

vivid grotto
cobalt iron
manic rune
karmic sand
#

what is the check for a player being in a round?

manic rune
#

G.GAME.blind.in_blind?

karmic sand
#

is there somewhere i can see all the like checks and stuff in a list?

manic rune
#

nop

karmic sand
#

im always having to search thru other jokers logic for checks and its annoying

primal terrace
#

Help how do I remove perma_debuff after it has been set

manic rune
#

im pretty sure its not in ability, its just v.debuff and v.perma_debuff

primal terrace
#

It sets it just fine if I do v.ability.perma_debuff = true

cobalt iron
manic rune
#

huh

karmic sand
#

omg i had this error for like a solid 2 hours last night i cant remember the fix but you got this champ pray

manic rune
#

make sure to use events if this is in apply btw

cobalt iron
#

I already have those

manic rune
#

whats the code

cobalt iron
manic rune
#

you didnt use an event

#

😭

cobalt iron
#

it's on the bottom

#

wait

cobalt iron
manic rune
#

i sent this above btw

thorn basin
#

I tried to put a sound effect for when my joker upgrades but for some reason the game crashes.
I followed all the steps from the documentation but the results are the same...
Is there a way I can fix this?

manic rune
#

how does your file look like

maiden phoenix
thorn basin
manic rune
#

try setting the key to Dodgeball_sfx, probably

thorn basin
#

oh wait

#

you just said the key

paper zealot
#

What's the point of the path parameter if it searches using the name of the key anyway? Odd

thorn basin
manic rune
#

is it still trying to search for Dodgeball.ogg

thorn basin
#

yeah

manic rune
#

what

#

did you save the file

formal parrot
#

The sell context doesn’t work work for me for some reason

manic rune
#

if it has this little dot then the file hasnt been saved yet

formal parrot
#

1 sec

#

I used the context from the wiki

#

Didn’t work

#

It says nil context

thorn basin
obtuse silo
#

because this code only gives me tarots

manic rune
cobalt iron
thorn basin
manic rune
#

??

#

can you show me where Dodgeball_sfx.ogg is put

#

in your folder

manic rune
vivid grotto
#

Hello again, I am having 2 problems with this enchantment if someone could help that would be very appreciated

  1. the resulting -mult or -chip is always 0 regardless of the original chip value for the card when added to the card
  2. when the enchantment is applied to the card before scoring the visual part of it isn't shown, but it is shown in the deck
manic rune
thorn basin
manic rune
#

looks like its checking resources for some reason

thorn basin
#

...huh

#

what should I do in this case?

formal parrot
#

SMODS.Joker { key = "qr", blueprint_compat = true, atlas = "jkr", loc_txt = { name = "QR CODE", text = { "{C:blue}+#1#{} hand size every time a card is sold", "{C:inactive}currently {}#2# {C:inactive}hand size", "{C:inactive}scan me", "DO NOT SELL" } }, unlocked = true, discovered = true, rarity = 1, cost = 4, pos = { x = 7, y = 0 }, config = { extra = { h_size = 0, add = 1 } }, loc_vars = function(self, info_queue, card) return { vars = { card.ability.extra.add, card.ability.extra.h_size } } end, calculate = function(self, card, from_debuff) if context.card and context.selling_card then cardarea = G.jokers, selling_card = true, card = card card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.add G.hand:change_size(card.ability.extra.add) end end, remove_from_deck = function(self, card, from_debuff) G.hand:change_size(-card.ability.extra.h_size) end, }

#

Bepis help😭

manic rune
thorn basin
#

oh...

cursive gazelle
#

card=card should be at the end

manic rune
#

it should be if context.selling_card and context.card then

#

and also

#

remove all of this

cobalt iron
formal parrot
#

The wiki said so

manic rune
#

its never meant to be put in your code

#

its just for reference

formal parrot
#

Lmao

#

😭i’m gonna kms

manic rune
#

ex:
cardarea here means context.cardarea refers to G.jokers/G.hand, etc etc
selling_card here means context.selling_card is a bool value
card here means context.card refers to the card thats being sold

vivid grotto
#

I aint very good with modding yet, but maybe try this

card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.add
G.hand:change_size(card.ability.extra.add)
return {
message = localize('k_upgrade_ex')
}

instead of

cardarea = G.jokers,
selling_card = true,
card = card
card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.add
G.hand:change_size(card.ability.extra.add)

vivid grotto
formal parrot
#

ATTEMPT TO INDEX global ‘context’ [ a nil value ]

#

IM GONNA END MY LIFE

cursive gazelle
#

its context.selling_card only i think

cobalt iron
manic rune
runic jay
#

Anyone know how to make a joker card set money to zero? I currently have config = { extra = { money = 0 } }, as the very first thing in the part that does all the calculating stuff, but I'm not sure it's going to work. It's my first time trying to make mods, and I know it's maybe a little ambitious for doing it for the first time

manic rune
#

oh

manic rune
pure salmon
manic rune
#

should be context.cardarea == G.play and context.main_scoring

runic jay
manic rune
pure salmon
#

you don't need anything in config.extra if you just want to set the money to 0

formal parrot
#

Bepis it won’t work 🥺

obtuse silo
tall wharf
#

amazing

cobalt iron
formal parrot
#

I’m gonna end it all bepis 😭 WHY WONT IT WORK BRO

#

Jesus christ man

pure salmon
hallow slate
#

How can I modify another mod's blind? I tried this but got an error cause it couldn't find it:

                return not (G.jokers and G.jokers.cards) and false or RGMC.funcs.jokers_greater_than_rarity(G.jokers.cards,"cry_epic",true) > 1
            end

            SMODS.Blinds['cry_pin'].recalc_debuff = function(self, card, from_blind)
                return card.area == G.jokers
                    and not G.GAME.blind.disabled
                    and RGMC.funcs.greater_than_rarity(card,'Legendary',true)
            end```
#

I'm trying to edit The Pin so it counts only certain rarities

cursive gazelle
#

@formal parrot you gave fromdebuff in calculate=function instead of context

thorn basin
runic jay
normal crest
#

hi bepis

formal parrot
hybrid shadow
#

bump

formal parrot
#

It worked 😭

manic rune
#

im trying to write an essay while having to keep an eye on my sister right now 😭

#

turned out having to write something while being screamed into your ears isnt a fun experience at all

manic rune
modern kindle
#

bepis

manic rune
#

hi dilly

modern kindle
#

hi

runic jay
#

Just realized that I forgot in my main question that it would trigger the money set to zero when you play a High Card. Hope that doesn't make it more complicated 😭

vivid grotto
pure salmon
#

sent the message early mb

pure salmon
#

returning mult and dollars like this automatically creates messages for them

pure salmon
#

what i do

manic rune
#

wouldnt that run everytime you play a hand

#

since all hands contain high card 🤔

pure salmon
#

ohhhh yeah

#

mb

vivid grotto
manic rune
#

context.scoring_name == "High Card" instead, probably

#

-# is that the right context

pure salmon
#

fixed

manic rune
pure salmon
#

sorry for spreading misinfo

manic rune
#

me when i purposely spread misinformation

pure salmon
#

i haven't actually needed to do that myself yet somehow

runic jay
#

Thank you man

pure salmon
#

also bepis now that you've seen the innards of grab bag did i do a good job or not

manic rune
#

looks more organized than yggdrasil thats for sure

pure salmon
#

idk if that's saying much or not

whole lava
#

how can i destroy played card?

manic rune
#
if context.destroy_card and context.cardarea == G.play then
  return{
    remove = true
  }
end
whole lava
#

ok thanks

pure salmon
#

context.destroy_card == [whatever card you want to destroy] if you only want to destroy a specific card

manic rune
pure salmon
#

idk i haven't poked around into the codebase yet

manic rune
#

-# please dont

runic jay
#

My entire computer just almost died when I tried to copy the text😭

pure salmon
#

i know my code is way more organised than bunco's but i like that mod a lot

#

i didn't put MY ENTIRE MOD IN ONE FILE for one

manic rune
#

mfkaa

pure salmon
#

i'm sure pwx is perfectly fine under the hood

#

after all jen is so proactive in accepting community feedback and making their mod as stable as possible

manic rune
#

so true

chrome widget
#

Morning everyone

manic rune
#

morning winter

chrome widget
hallow forge
#

morning BepisFever

plush vault
#

Morning Winter Bepis Math fever

manic rune
#

morning Hello Discord

#

morning Fel

vivid grotto
#

hey bepis, i tried changing the context for this enchantment and I am still running into the same problem, this is what I have now after a few bajillion iterations of nothing working:

SMODS.Enhancement{
key = "backstabbed",
loc_txt = {
name = "Backstabbed",
text = {
"{C:chips}-#1#{} chips",
"{C:mult}-#2#{} mult"
}
},
atlas = "centers",
pos = {x = 0, y = 0},
order = 100, -- Higher order means it appears on top
loc_vars = function(self, info_queue, card, specific_vars)
if not card or card.fake_card then
return { vars = { "2x Chip Value", "1x Chip Value" } } -- Show multipliers in collection
end
local chip_value = card.base.nominal_chips or 0
return {
vars = {
-2 * chip_value,
-chip_value
}
}
end,
calculate = function(self, card, context)
if context.cardarea == G.play and context.main_scoring then
local chip_value = context.other_card.base.nominal_chips or 0
return {
chips = -2 * chip_value,
mult = -chip_value
}
end
end
}

manic rune
empty coral
#

71x95y
?

manic rune
#

and also, you might want to check if base.nominal_chips actually exists 🤔

wintry solar
#

That should exist for every playing card

manic rune
#

yeah cool, just wanted to be sure
-# hi eremel

wintry solar
#

Hi bepis

runic jay
whole lava
#

how i can make card give more chip and mult?

manic rune
whole lava
#

thanks for that

pure salmon
runic jay
# pure salmon if you have a localisation file or a `loc_txt` variable, you can put `#1#` in yo...

`SMODS.Joker {
key = 'beggar',
loc_txt = {
name = 'Beggar',
text = {
"Sets money to $#0#",
"if played hand",
"is a {C:attention}High Card{}"
}
},

config = { extra = {} },
loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.mult } }
end,
rarity = 1,
atlas = 'TRBMod',
pos = { x = 0, y = 0 },
cost = 1,
calculate = function(self, card, context)
    if context.joker_main and context.scoring_name == "High Card" then
        return {
            mult = card.ability.extra.mult
            dollars = -G.GAME.dollars`

This is all I have with the card, so point out what needs to be done if anything

pure salmon
#

you never define card.ability.extra.mult

#

config = { extra = {mult = [some value]} }

vivid grotto
#

I believe he can remove that correct? as its not being used by the joker

pure salmon
#

oh, if you don't want your joker to give mult then yeah

#

also the first line of your description should say "Sets money to {C:money}$0{}",. you don't need the hashtags unless you're calling a value from loc_vars

vivid grotto
#

Hey Bepis, I tried what you recommended and its still giving -0 mult and -0 chips to the card
SMODS.Enhancement{
key = "backstabbed",
loc_txt = {
name = "Backstabbed",
text = {
"{C:chips}-#1#{} chips",
"{C:mult}-#2#{} mult"
}
},
atlas = "centers",
pos = {x = 0, y = 0},
order = 100, -- Higher order means it appears on top
loc_vars = function(self, info_queue, card, specific_vars)
if not card or card.fake_card then
return { vars = { "2x Chip Value", "1x Chip Value" } } -- Show multipliers in collection
end
if card then
local chip_value = card.base.nominal_chips or 0
return {
vars = {
-2 * chip_value,
-chip_value
}
}
end
end,
calculate = function(self, card, context)
if context.cardarea == G.play and context.main_scoring then
local chip_value = card.base.nominal_chips or 0
return {
chips = -2 * chip_value,
mult = -chip_value
}
end
end
}

pure salmon
manic rune
#

😭 i was gaslit thinking it existed

pure salmon
#

i use .nominal like all the time lol

manic rune
#

i use :get_chips_bonus()

pure salmon
#

oh

#

is that better?

manic rune
#

if you want it to account chips bonus too, then yeah

pure salmon
#

oh i don't

#

if you want bonus chips to also count do that

vivid grotto
#

OK, i changed it to card.base.nominal, it is properly being added to the card, but it isn't being used in scoring

#

wait wait wait, let me check something

#

yeah no its still not being used in scoring. Could it be the same reason the card has the original + chips and then below that it has the - chips and the - mult?

vivid grotto
manic rune
#

card:get_chips_bonus()

#

waitno

#

card:get_chip_bonus()*

vivid grotto
#

this just in, this is not proper synatx:

            chips += -2 * chip_value,
            mult += -chip_value
whole lava
proud ridge
#

one thing i realized about coding my mod in vscode is that if i have the actual balatro source code open in a different tab, it will allow me to see and autofill different variable and function names

#

which is turning out to be very helpful

#

what is the "effect" variable that is in the source code of the game for when the jokers are declared? what does it do?

manic rune
#

its just chips = ...

manic rune
manic rune
proud ridge
#
        j_jolly=            {order = 6,  unlocked = true,   discovered = false, blueprint_compat = true, perishable_compat = true, eternal_compat = true, rarity = 1, cost = 3, name = "Jolly Joker", pos = {x=2,y=0}, set = "Joker", effect = "Type Mult", cost_mult = 1.0, config = {t_mult = 8, type = 'Pair'}},
manic rune
#

yeah no please dont reference that for your jokers

#

use Vanilla Remade instead

bold sleet
#

8 out of 11 times SMODS will have you covered.

proud ridge
#

Ooohhhhh ok ok

#

i think i have that git repo opened? lemme go look

thorn basin
#

what is the name of the sound that plays whenever a joker has been upgraded?

proud ridge
#

where does vanilla remade have all of like the display text for the jokers? cuz i dont see it with the actual joker code

manic rune
#

description?

#

thats handled in the localization file

manic rune
proud ridge
#

oohhhh ok

tough temple
#

hello

manic rune
#

hi magic

tough temple
#

how would i make a joker spawn in shops naturally?

#

i set the rarity and i refreshed the store like hundreds of times i got every joker but mine

#

either it aint working or my luck is saddening

manic rune
#

it should spawn naturally if you the rarity is set up right, and you didnt mess with in_pool

tough temple
#

this is what ig ot

#

it looks good in the collection

#

ill set rarity to 1 and look for it again

manic rune
#

mm

#

yeah, it should spawn

#

probably your luck lol :p

tough temple
#

dang lol

#

my child

#

hes in the store

plush vault
#

I require debug wizards :'3

calculate = function(self, card, context)
        
        -- We want to re-calculate this pretty often (?) to to avoid moving the joker shenanigans I suppose

        card.ability.extra.value_left=0,
        card.ability.extra.value_right=0, --This is line 398 from the Error
        
        -- Using ceremonial dagger as the logic here, we start by declaring a pos variable

        local my_pos = nil

        -- Now we iterate through the jokers from the very first, if we catch that its ourselves stop.
        -- Otherwise, add it to the value on the left

        for i = 0, #G.jokers.cards do
            if G.jokers.cards[i] == self then 
                my_pos = i; break end   --This also stores our position
            else
                card.ability.extra.value_left = card.ability.extra.value_left + (G.jokers.cards.sell_cost or 0) --Adding value to the left count
            end
        for i = my_pos+1, #G.jokers.cards do --Now we check the jokers  on the right with my_pos+1
                card.ability.extra.value_right = card.ability.extra.value_right + (G.jokers.cards.sell_cost or 0) --Adding value to the right count
            end
        
        -- Calculate the difference 
        if (card.ability.extra.value_left > card.ability.extra.value_right) then
            card.ability.extra.difference = card.ability.extra.value_left - card.ability.extra.value_right
        else
            card.ability.extra.difference = card.ability.extra.value_right - card.ability.extra.value_left
        end

    if context.joker_main then
        return {
                        if(card.ability.extra.difference < 5) then
                            xmult = card.ability.extra.xmult - card.ability.extra.difference
                        else
                            extra = { message = ('Unbalanced'), colour = G.C.GOLD }
                        end
                            
        }
    end

    end
manic rune
#

this is where lua extension comes into play

#

please download it :3

plush vault
#

Joker functionality TLDR;
Checks value on the left and right of the joker, if the values are balanced, x5 mult, -1 for each difference

normal crest
#

please download it

plush vault
#

Wich one 🥲

manic rune
#

the one made by sumneko

plush vault
#

Does that exist in Netbeans?

manic rune
#

netbeans?

plush vault
manic rune
#

i

normal crest
#

No idea

manic rune
#

never used that before

#

:3

#

most people here use visual studio code

plush vault
#

I guess this is my call to change to a different IDE

manic rune
normal crest
#

sumneko

#

some cat

plush vault
#

Time to install it

manic rune
#

i can entrust everything to people with "neko" in their name

normal crest
#

bepisneko

modern kindle
#

they call em dilneko

manic rune
#

😭

plush vault
#

This is what the code looks to me btw

#

I don't even have highlights on the variables

#

💀

manic rune
#

thats crazy

#

oh also

#

index in lua starts at 1

plush vault
#

Oh

manic rune
#

and this should be card, not self

pulsar furnace
#

swap doesn't work, like it swaps but when doing something else it reverts

manic rune
#

this probably doesnt exist too

manic rune
plush vault
pulsar furnace
plush vault
#

You can archieve your dreams with enough elseif statements 🪄 ✨ (please dont)

proud ridge
#

ok so i have an idea for a joker called mini fridge, where it gains 1 Xmult for each food joker purchased (resets if a food joker naturally perishes), i am also tempted to make it give 0.5X mult per perishable joker purchased, should i just stick with the first bit?

manic rune
#

you can check sell_cost from them

#

and also

#

please reference from vanilla remade instead :3

plush vault
#

You are asking a lot for someone that didn't have VSC and was coding with rocks and sticks untill things worked

manic rune
plush vault
#

(I will look into it, thank you 💛 )

manic rune
proud ridge
#

just the first half? okie!!

plush vault
#

You could make the second half into a second joker even

"Binge eater" gains mult for each perished food joker

Encourages rerolling for things like popcorn to keep stacking it

thorn basin
#

How does the "replace" option actually work?
I'm trying to replace the sound the joker makes whenever he does the mult sound but it keeps doing the default one.

proud ridge
#

what is the best word to describe food jokers naturally dying? eaten? expire?

empty coral
#

consumed perhaps? idk they all have like different texts

last field
#

could anyone tell me if its possible to make a blind that translates the game to a language (im making a french blind)

proud ridge
#

is there a way to spawn in jokers/vouchers/tarohs/etc for testing?

manic rune
proud ridge
#

i have debug plus but i only see functions that give extra hands/discards/chips/mult/rounds/money/etc

#

unless there are keybinds im unaware of

manic rune
#

open up the collection menu while in run

#

hover on a joker, voucher, tarot etc

#

press 3

proud ridge
#

ooohhhhh

#

ok!! thanks :D

obtuse silo
#

you can also press Z and 1, 2 and 3 to create save states that persist between game shutdowns

thorn basin
pulsar furnace
#

how do i swap in context.before?

runic jay
#

So... what went wrong?

plush vault
#

Check line 41, says there may be a } missing

manic rune
#

LUA EXTENSIONNNNNNNNNNNNNN 🗣️

runic jay
#

`SMODS.Joker {
key = 'beggar',
loc_txt = {
name = 'Beggar',
text = {
"Sets money to {C:money}$0{}",
"if played hand",
"is a {C:attention}High Card{}"
}
},

config = { extra = {} },
loc_vars = function(self, info_queue, card)

end,
rarity = 1,
atlas = 'TRBMod',
pos = { x = 0, y = 0 },
cost = 1,
calculate = function(self, card, context)
    if context.joker_main and context.scoring_name == "High Card" then *
        return {
            mult = card.ability.extra.mult
            dollars = -G.GAME.dollars
    }
end

end
}`
Here's the entire thing with a star at line 41

#

Well it excludes the atlas and mod info

#

so not really everything

manic rune
#

wtf is that * doing there

#

😭

plush vault
#

Add a comma on the return after card.ability.extra.mult

runic jay
#

Still don't work

plush vault
#

New error or same?

runic jay
manic rune
#

sob

plush vault
#

Its haunted

manic rune
#

show the code again

plush vault
#

Use the Lua extension to unhaunt it

manic rune
#

but also, PLEASE download lua extension

#

i beg 🧎‍♂️

runic jay
#

How would one do that?

manic rune
runic jay
#

I mean I have lua installed, but I couldn't get it to work properly

manic rune
#

did you download the right extension

#

the one made by sumneko

last field
#

how can i make this work?

runic jay
manic rune
proud ridge
#

ok so in my actual joker context function, how do i detect when a joker is purchased?

manic rune
#

also

#

it should be a string, not just USA

#

and its "en-us"

lavish lake
plush vault
#

NO BULLY, it was the star to show us line 41

#

:((

runic jay
# manic rune

Plus: what's that program in the picture? I feel like I've seen the icon before

manic rune
#

france is "fr" btw

last field
#

ah

#

thanks

plush vault
#

If Bepis had one mult for every person who didnt know Visual studio code existed today that chatted in modding-dev, they would have 2 mult

manic rune
#

on top of changing G.SETTINGS.language, run init_localization() too, i think

runic jay
#

I'm an idiot, line 41 was the one below the line I put the star at 💀

manic rune
#

😭

#

im gonna cry

runic jay
#

Line 41 is return, {

#

Not if context.joker_main and context.scoring_name == "High Card" then

manic rune
#

its return {, not return, {

runic jay
#

oh

#

makes sense

#

GOD DAMN IT

#

STILL LINE 41

#

I HATE THIS SO MUCH

#

I EVEN PUT THE COMMA THE CORRECT PLACE THIS TIME

manic rune
#

.

#

no.

runic jay
#

omg...

#

I hate this so much...

last field
#

it doesnt work for some reason damn

runic jay
#

It works now...🥲

proud ridge
#

ok so in the steamodded documentation on github, the example G.joker gets used a lot when explaining returns and context n stuff, what exactly is that being used in place of? /gen

#

this is an example

hollow mango
#

what do you mean in place of

crisp coral
#

G.jokers refers to the jokers tray

last field
proud ridge
#

ok, cuz i am trying to figure out how to detect when you buy or acquire specific jokers

#

and i am not entirely sure how to go about it

crisp coral
#

if context.buying_card and context.card.config.center.key == "card_key" then

vivid grotto
#

I have an enchantment being applied by a joker that adds negative mult and chips. it is being applied before scoring, but the image doesn't show up until after its put back in the deck and it doesn't use the scoring added to the card. If I play the card that has the enchantment in a different round, it works.

#

Can someone help me figure out why it isn't scoring and the visual isn't being applied

umbral zodiac
#

will it work if i try and initialize a joker mid run

plush vault
#

Bepis good news I have VSC now, but I have no idea why it yellow : ^)

stiff quiver
#

Im getting this crash with this code, whats wrong with it? lua if context.setting_blind and pseudorandom("seed") <= (G.GAME.probabilities.normal * card.ability.extra.base)/card.ability.extra.odds then SMODS.create_card({set = "Joker", key = "dog"}) return {message = "woof"} end

stiff quiver
plush vault
hollow mango
#

I'm trying to display some simpleish custom graphics on the screen (current attempt is via :draw_shader, and while it's not crashing, and I'm certain the shader fires, it's not showing up). I'm currently just trying to get a white line to go across the screen. Does anyone have any resources to help with this? Or just any examples they know of I could try to learn off of?

sleek cliff
#

ill test it

manic rune
last field
# last field guh

how would I make this just change the language immediately instead of me having to restart in order for the game to change languages?

manic rune
#

you want it to be a string

wintry solar
#

I think I’ve figured out how I want the contexts to be set out in the docs

manic rune
#

:3 can i see

wintry solar
#

Are you capable of seeing into my brain

manic rune
#

maybe

#

turn on bluetooth eremel

brittle tide
#

making a Joker that has a 1/5 chance of destroying cards and adding a 10th of their value to its Xmult and I was wondering if theres a way to get the id of card in a way that works for this. I know that the "context.destroy_card" for the for loop is incorrect but I was just throwing stuff against the wall

last field
wintry solar
sleek cliff
manic rune
#

change G.SETTINGS.real_language too, my bad 😭

#

i just saw it existing in the game's code

sleek cliff
#

I'm trying to have it select a ramdom yet specific set of jokers to replace with it with another random but specific set of jokers

last field
#

Ohhh

#

so like this?

manic rune
#

maybe change both real_language and language

#

im checking the game's code rn to see if theres any more stuff you need to change

snow vale
#

can i use some of your bar thing from your mod code?

#

not everything

#

also ill add credit

plush vault
#

What context should I use to calculate how much the jokers on the left/right cost, considering, it should be recalculated every time the jokers are moved

manic rune
# last field so like this?

oh, this is more complicated than i thought it would be

it wouldnt translate stuff thats already in English to French

#

you want to use G:set_language()

manic rune
manic rune
snow vale
#

tyy

plush vault
#

Thats where it is :'>

manic rune
#

🤔

#

can you show me the full code of the joker

plush vault
manic rune
#

mm

#

this is still wrong

#

it should be G.jokers.cards[i].sell_cost

plush vault
#

OH

#

Thank you

manic rune
#

oh wait

#

damn your indentation is fked up

last field
manic rune
#

😭

manic rune
last field
#

alright

stiff quiver
#

i made this for a joker that gives more mult depending on how many "joker" you have but its not working, whats wrong? lua for i=1 , #G.jokers.cards do if G.jokers.cards[i].key == "j_joker" then result = result + card.ability.extra.upg end end

manic rune
plush vault
#

My apolocheese 🧀 I blame it on the Fel of the past

#

oh I see

manic rune
#

here

plush vault
#

Thankies 💛 ;V;

manic rune
stiff quiver
#

Thanks!

manic rune
#

actually you only needed to fix G.jokers.cards[i].key to G.jokers.cards[i].config.center.key but i like using ipairs :3

spice wadi
manic rune
#

yeah i just saw that

#

i was wondering why tf half of the code was green

#

😭

spice wadi
manic rune
#

hey

#

i love shrek

#

dont say that please

spice wadi
#

I'll say it again if I have to

sonic cedar
#

(hi bepis)
i have returned from my slumber to bring my issue!

this works, the card does in fact do a transformation, but it seems like it does the transformation twice
as in
it'll start the animation, then get overwritten by restarting and finishing the animation the second time around

how do i fix?

#

where is the image

#

is that just me

sonic cedar
manic rune
#

whats the image, i just came back from the bathroom 😭

sonic cedar
#

ok there it is

sonic cedar
manic rune
#

can you put a print in there to see if it runs twice

sonic cedar
#

oh duh

manic rune
#

also

#

you might want to wrap to_big around context.card.cost too 🤔

#

idk

#

just to be sure

sleek cliff
#

I can't even tell if I need the psudorandom element because theres no random chance, just random selection

manic rune
#

if its like "picking a random (x) from (y)" then you need it

serene granite
#

is it possible to make a joker that is stronger or like scales if its adjacent to a copy of itself?

manic rune
#

yes

#

check card.config.center.key

sonic cedar
#

for the love of god

serene granite
sleek cliff
#

i think Discord is dying

sonic cedar
#

is discord dying

manic rune
#

im sorry

sonic cedar
#

click it

manic rune
#

sob

#

yeah uh

sleek cliff
manic rune
#

try adding a context.main_eval to see if it works?

manic rune
#

you want to check the adjacent jokers' key

manic rune
sleek cliff
manic rune
#

oh

#

did you add can_use?

sleek cliff
#

not yet

manic rune
#

you need it 😭

hybrid shadow
#

ok i cant send my image discord might be dead

manic rune
#

you need to return true in there for the consumable to actually be usable afaik

hybrid shadow
copper thorn
#

gang sorry to barge in, im trying to make my first joker, and this popped up, what can i do ?

parj_Smiley is i suppose my joker

Oops! The game crashed:
[SMODS _ "src/game_object.lua"]:410: Failed to collect file data for Atlas parj_Smiley

i have my assets, my main.lua with no visible errors and my icon.png

(my images can't send if i could i would send screens)

sleek cliff
sonic cedar
#

ermmmmm awkward

manic rune
#

weird

sleek cliff
sonic cedar
hybrid shadow
#

whats even going on with discord rn

hallow slate
#

If I wanted to check Cryptid's configs from my own mod, how would I do it?

#

Trying to make sure I dont break anything with cross modding

manic rune
#

p sure it shouldnt do that

sonic cedar
#

no crash or anything it jut

#

didnt work

sonic cedar
# manic rune p sure it shouldnt do that
calculate = function(self, card, context)
    if context.buying_card and not context.blueprint
    and to_big(G.GAME.dollars) - to_big(context.card.cost) <=
    to_big(card.ability.extra.dollars) and context.main_eval
    then
        print("guh")
        hpfx_Transform(card, context)
    end
end
function hpfx_Transform(card, context)
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:flip()
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            card:set_ability(G.P_CENTERS["j_hpfx_ijiraq"])
            play_sound("card1")
            card:juice_up(0.3, 0.3)
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
    trigger = "after",
    delay = 0.15,
    func = function()
        card:flip()
        return true
    end,
    }))
    return true
end

current code

hybrid shadow
#

bumpity bump

sonic cedar
#

what am i looking at

hybrid shadow
#

it works fine in the main menu, but when i open the collection page mid run it crashes because of bad argument

proud ridge
sonic cedar
pulsar furnace
#

is there an easy way to cancel the consumables from disolving? like for letting use it again

proud ridge
#

oop

sonic cedar
#

at the top

proud ridge
#

ooohhhh

#
 if context.buying_card and not context.blueprint then
            
            if context.card.config.center.key == "gros_michel" or context.card.config.center.key == "cavendish" or context.card.config.center.key == "popcorn" or context.card.config.center.key == "ice_cream" or context.card.config.center.key == "ramen" or context.card.config.center.key == "egg" or context.card.config.center.key == "turtle_bean" or context.card.config.center.key == "seltzer" or context.card.config.center.key == "diet_cola" then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
                return{
                    message = 'Stocked!',
                }
            --end
        end
sonic cedar
#

```lua
code
```

proud ridge
#

ok so uhm, this code is supposed to detect when i purchase a food joker

#

then scale my joker

#

but it doesn't properly detect the jokers

#

im not sure why it isn't

sonic cedar
copper thorn
#

sorry to repost it so soon, but i'm really struggling

parjSmiley is i suppose my joker

Oops! The game crashed:
[SMODS "src/game_object.lua"]:410: Failed to collect file data for Atlas parj_Smiley

i have my assets, my main.lua with no visible errors and my icon.png

(my images can't send if i could i would send screens)

hybrid shadow
sonic cedar
#

file structure issue

sonic cedar
#

is your atlas too big maybe

hybrid shadow
# copper thorn yeah

does your atlas path have the same name as the actual images (and are the images the same name)

hybrid shadow
#

your 2x images and 1x images need to have the same name for SMODS.Atlas to be able to read it properly

copper thorn
hybrid shadow
#

crazy

proud ridge
#

that resulted in an error

proud ridge
hybrid shadow
proud ridge
#

it is commented out because i was testing soemthing and forgot to uncomment it out before sending it here

hybrid shadow
sonic cedar
proud ridge
#

oohhhh

#

that didnt seem to work either

sonic cedar
#

maybe you do have to change out context.card. for c. then

hybrid shadow
proud ridge
#

it says that c is a nil value

sonic cedar
hybrid shadow
sonic cedar
proud ridge
#

no i did not, i will try that

sonic cedar
proud ridge
#

how would i go about doing that? /gen

hybrid shadow
sonic cedar
#

game no like when you view deck
maybe applies to collection

sonic cedar
hybrid shadow
sonic cedar
#

if you're modding just use the commit

tepid crow
#

if there's a crash in the collection it's more likely to be your custom joker

#

deck view and collection are quite separate structures anyway

proud ridge
hybrid shadow
hybrid shadow
sonic cedar
#

was gonna send an image with obnoxiously large red circle

#

code button on the repo

tepid crow
#

wtf why can't I upload

maiden phoenix
#

discord moment

sonic cedar
plush vault
#

Oh i tought it was only me, I have been trying to upload a video for 20 mins 💀

hybrid shadow
sonic cedar
#

servers are dying

zealous glen
#

Ah that doesn’t make it big

tepid crow
#

@hybrid shadow

hybrid shadow
tepid crow
#

so it is your code

hybrid shadow
hybrid shadow
tepid crow
#

the whole convo around it implied it was an issue with smods lol

hybrid shadow
plush vault
#

Im having some issues with the display of the price on left/right sides, what I noticed was that blueprint does the check inside loc_vars, would that work here?, or do I need to move the math to somewhere else? x-x

#

Update: I fixed it by doing as blueprint, moving all the logic that calculates the display numbers into loc_vars

sonic cedar
#

i mean consumable troll_4k

hybrid shadow
sonic cedar
#

in your code

lusty pasture
sonic cedar
#

whyd you take it to moddingdev then 🥀

hybrid shadow
lusty pasture
#

Am i supposed to take it to modding chat?

sonic cedar
sonic cedar
hybrid shadow
sonic cedar
tepid crow
hybrid shadow
sonic cedar
#

if we could have images this would be 1 billion times easier

hybrid shadow
sonic cedar
#

ok carry on then
it's probably lars' thing since balalala uses self

north lodge
#

When exactly is a UI element method func called? The wiki says when it is being drawn, but is it called every frame then?

wintry solar
#

@manic rune
how does this look?

sonic cedar
hybrid shadow
sonic cedar
#

it's... it's so peak

tepid crow
hybrid shadow
tepid crow
#

Weird. In that case I'd still like to see the error haha

hybrid shadow
#

lemme get back to you on that after my sisters done dragging me to the store to get groceries

daring fern
#

spice wadi
wintry solar
#

I think it's more helpful than the current version, right?

#

is there anything you think it could have extra?

spice wadi
#

i think that approach is much better than the current one

sonic cedar
#

putting one joker's "why is the function triggering twice" on the back burner to ask another's
"why isnt this triggering at all actually"

spice wadi
#

only other thing i could think of is a section summarising some of the different variables (like context.scoring_hand for example) and maybe a summary table of all the contexts and their uses

sonic cedar
#

all of the contexts for real this time

sonic cedar
#

it's always the simplest answer huh

spice wadi
# wintry solar

then as far as im concerned this is gonna be a good guide 🔥

#

i do think a summary table would be good depending on how long the page ends up being

#

also im not sure if SMODS.calculate_effect was ever covered properly? if not then thatd be very helpful

proud ridge
#

ok now my joker is scaling when i purchase a food joker, but the game crashes when reloading, saying its attempting to index the value "card"

        local c = context.card.config.center_key
        if context.buying_card and not context.blueprint then            
            if c == "j_gros_michel" or c == "j_cavendish" or c == "j_popcorn" or c == "j_ice_cream" or c == "j_ramen" or c == "j_egg" or c == "j_turtle_bean" or c == "j_seltzer" or c == "j_diet_cola" then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
                return{
                    message = 'Stocked!',
                }
            end
        end
#

specifically happening on that first line

daring fern
spice wadi
#

im guessing the solution is to move the first line to be inside the if statement?

proud ridge
#

so do i need an if statement to check to see if it exists first?

wintry solar
#

what do you mean by a summary table though?

spice wadi
#

maybe literally just a table of the different contexts names and the descriptions for them

#

so its easier to see which context you might need to use

sonic cedar
#

that'd be sick actually

turbid maple
#

can I modify the effect of another joker through post_trigger? does changing context.other_ret work?

#

would try it myself but not home yet just brainstorming some ideas and trying to figure out how annoying this kind of thing would be to implement

spice wadi
#

<@&1133519078540185692>

turbid maple
#

have you tried reading the smods wiki

turbid maple
#

change the joker's return table

wintry solar
#

and just replicating information

spice wadi
#

i mean i wouldnt put the description verbatim

#

more

#

a very summarised version more to highlight its use case