#💻・modding-dev

1 messages · Page 359 of 1

smoky seal
#

Nope, nothing

shut crater
#

what is the overall goal?

red flower
#

never made a dummy joker but I'm assuming you need to add it to a hidden cardarea and add it as a calculation area to SMODS

naive raptor
#

how do i apply a random enchancement to a playing card?

smoky seal
cobalt arrow
#

here @shut crater

red flower
naive raptor
shut crater
shut crater
hexed heath
#

hmm just had a joker idea, x0.1 for every achievement in balatro unlocked

smoky seal
hexed heath
#

time to cook

red flower
cobalt arrow
shut crater
hexed heath
#

lol read that as "metal linguistic" instead of "meta linguitsic" at first

red flower
smoky seal
shut crater
#

there is no concept of a fake joker in vanilla as far as I'm aware

smoky seal
smoky seal
red flower
#

Not really no

smoky seal
#

Oof

red flower
#

I learned all of that by reading the code and being here

smoky seal
#

That's impressive

naive raptor
#

why is this throwing an error

smoky seal
red flower
thorny lion
#

i need to go make a mod actually it seems fun and cool

red flower
#

also the poll things are functions

#

they're in the smods docs

naive raptor
#

which page?

red flower
#

utility

buoyant merlin
#

How can you get the localized name of a joker?

thorny lion
#

someone should pin docs or something idk

buoyant merlin
#

Well, modded joker in particular

#

Vanilla "name" variable works fine with vanilla, but is just the key on modded

red flower
smoky seal
#

Okay, I guess I gotta go find an example of a dummy joker. I don't wanna clog up this with crappy questions, should I start a "Darren is dumb" thread lol

naive raptor
naive raptor
brisk rose
#

does anyone know if it's normal for the debugplus console to close when you run things?

#

and then you have to reopen it to see the output

#

it's annoying for eval

red flower
brisk rose
smoky seal
daring fern
#

Why does no_edition not do anything when using SMODS.create_card/SMODS.add_card?

red flower
#

it does for me, why?

buoyant merlin
naive raptor
#

i just found out i mispelled "enhance" as "enchance" like 7 times in my code

smoky seal
#

Wow, all it took was this

cobalt arrow
#

how I make a joker spawn table to SMODS.add_card ?

naive raptor
#

this line keeps crashing my game if pseudorandom('wildfire') < G.GAME.probabilities.normal / card.ability.extra.enhance_odds then

"attempt to perform arithmetic on field "enhance_odds" (a nil value)"

daring fern
shut crater
cobalt arrow
#

oh chaseoqueso... I fixed the crash

#

I don't know how

red flower
cobalt arrow
#

but it worked

smoky seal
#

Now for adding text to the UI 🙃

red flower
hard flume
#

What are playing cards store as in a global variable

#

Like G.jokers or G.consumables

red flower
#

G.playing_cards, it's not an area like those tho it's a list

#

G.deck.cards has the cards remaining in deck

cobalt arrow
#

@shut crater You were right...when I sell a consumable i can create a Joker

#

what's the best way to correct it?

brisk rose
#

that's all

#

it might be that one setting

#

lemme try it

red flower
brisk rose
#

based on their reply

#

lol

#

oh i guess not

#

sorry i'm blind

#

I just saw all the blyw text not going away but that was dioderent blue text

#

so yeah my b

red flower
#

yeah

cobalt arrow
#

can I specify context.selling_card to be jokers only?

red flower
cobalt arrow
#

it'll be like context.selling_card and context.card.ability.set == "Joker"?

red flower
#

ye

cobalt arrow
#

thanks

split saddle
#

hello and sorry for interrupting and wall of text, but i can't comprehend contexts and the docs aren't helping a whole lot. specifically, i want to see the cards that are being played and iterate through them to run a func, before scoring. i haven't been able to do any progress because i can't debug anything:
tried sendTraceMessage(context.scoring_hand) which crashed the game. tostring didn't help a lot and just printed table 0xhexvalues
I think i'm on the right track but it's hard feeling in the dark without proper docs and not a lot of lua experience
thanks for coming to my TEDTalkthe help :>

red flower
#

Try downloading debugplus and using print

#

But if there's anything particular you want to know about contexts I can help

split saddle
#

sure, thanks

split saddle
cobalt arrow
#

What is the best way to create a Joker pool to SMODS.add_card?

red flower
#

So a pool of specific jokers? Is it always the same?

cobalt arrow
#

only specific jokers can appear in the smods.add_card

brazen tusk
#

how does one juice a card?

red flower
red flower
cobalt arrow
#

I have a Joker that when you sell a Joker, it have a chance to create a Italian Brainrot Joker...

brazen tusk
red flower
cobalt arrow
#

oh ok

#

SMODS.ObjectType what are the codes for this?

sonic cedar
#

hey so my unlock isnt working? as in the joker isnt unlocking. for people that weren't here earlier, the joker is supposed to unlock once you beat crimson heart 10 times (i have it set to 1 for testing, but once the run was won no unlock happened?)

red flower
red flower
sonic cedar
#

got it

#

so wait it's because of how it's set up?

#

cause i used unlock_card on the others and they work

#

but since the way this unlock works unlock_card wont work?

#

am i getting it?

red flower
#

oh then no idea never messed too much with unlocks

marble flint
sonic cedar
#

since it's for an unlock

marble flint
#

yeah, G.GAME is reset in Game:start_run() (meaning that variable gets clobbered)

sonic cedar
#

😭

marble flint
#

something with profiles, idk

#

i've never manually saved data in this game before

red flower
red flower
red flower
cobalt arrow
#

and them the SMODS.add_card is this?

brisk rose
#

not sets of existing ones

#

but maybe not

red flower
raven forge
sonic cedar
#

oh hi youre fine 😭

raven forge
#

I was just surprised is all, people giving varying advice, ha

rare obsidian
#

can someone help me with shaders and editions and such

raven forge
#

it's very chaotic in here

sonic cedar
#

i could always open a thread if it's too much lmfao

quartz ravine
raven forge
quartz ravine
edgy reef
brisk rose
#

like they're doing

#

the profile is just a table and you can inset a new index just by defining it

#

so that's not the issue

sonic cedar
quartz ravine
low parrot
#

Hellooo, i'm trying to make a joker that converts every hand played into High Card, but i'm a little bit lost as to how to do it ;;

rare obsidian
brisk rose
#

putting it in the game state won't work

raven forge
#

it saves automatically

brisk rose
raven forge
#

oh right, I keep forgetting. listen to them

raven forge
sonic cedar
brisk rose
#

so you shouldn't need them in the actual finished code

queen scroll
raven forge
#

sorry Teso, might have named the wrong function

#

see ^

low parrot
raven forge
sonic cedar
#

ohhh ok

cobalt arrow
#

How I make SMODS.add_card only add cards from an ObjectType?

sonic cedar
queen scroll
#

i was gonna ask, is there anything new in steamodded that organises jokers that have variables which change every round, like mail-in rebate, or is it still the vanilla code?

red flower
raven forge
#

try checking docs, I can't recall the name

red flower
#

SMODS.current_mod.reset_game_globals

#

?

queen scroll
#

organizes as in they're not all seperate functions in state_events

split saddle
# split saddle get back to you in a bit

it's kind of annoying to reload the game every time when it takes so long but oh well...
how do you destroy a card? is there a specific function for it?
for i, v in ipairs(scoring_hand) do will iterate through all the cards in the scoring hand. v is the pointer to the card, right? that means this is the parameter to pass into the function for destroying cards, i think.

red flower
low parrot
sonic cedar
red flower
raven forge
queen scroll
split saddle
#

wait i will try it xdd

red flower
sonic cedar
split saddle
red flower
#

yeah

split saddle
#

schrödinger's King of Hearts

brisk rose
#

cheesyjokers is high on my lsst of mods I'm curruntly missing real bad due to not being updated in months

#

so idk how well it works currently

#

only months and not a year because elbe is also a gote

low parrot
split saddle
raven forge
red flower
split cairn
#

does anyone know how to make a consumable that changes a playing card's suit to a different one? i've been trying to make a consumable that changes up to 5 cards to Spades suit like The World tarot

split saddle
#

i'm still kinda lost... 😅 i don't really understand contexts other than gamestate ones

#

the smods documentation kinda lacking rn

raven forge
sonic cedar
#

i knew it 😭

#

ok there

raven forge
#

I really should bookmark that and tell it to everyone. you've made a great resource

red flower
#

thank you ❤️ I still need to finish some stuff first but I was planning to see if we could add it to the smods examples

split saddle
#

i'm going in goodbye

#

cya in an hour 😆

red flower
#

i made it this week : )
some cards might be wrong tho i still need to test them more

brisk rose
#

oh

#

you did the thing

#

why didn't you advertise it?

#

I knew you were working on it

red flower
#

my mod has 350 jokers of course i can make half of that in a week

raven forge
#

alright I'll get it into smods now-

red flower
wise walrus
#

might be useful to pin both smods and vanilla translation cards to the channel tbh, who has the ability to pin messages?

hard flume
#

How do I check that a card is of a specific suit again?

brisk rose
wise walrus
#

it can wait until stuff is finished ofc

queen scroll
brisk rose
#

he might be up for it

red flower
brisk rose
#

but yeah when shit's finished

unborn bay
sonic cedar
unborn bay
#

FUCK

#

i was beaten to it

red flower
#

i want to fuse with aiko

sonic cedar
red flower
#

i did

#

whats the joke

brisk rose
#

speaking of fusion, an entirely different type, i need to work on DeFused

#

it'll be a bitch for me, a very new coder to port it to 1.0

raven forge
# red flower why bepis

to be clear: this will alleviate the headaches of countless people which is why I'm putting in a link (with a wip disclaimer) in the smods wiki. Are you ok with being linked?

red flower
#

I'm probably not doing it myself but I might push other people to contribute the other object types, I'm mostly only comfortable with jokers for now

brisk rose
weak brook
#

anyone know if patches like this can work with other mods that arent smods? if so what does 'SMODS' in the target represent, like what would i replace that with if i wanted to patch another mod
target = '=[SMODS _ "src/utils.lua"]'

red flower
#

target = '=[SMODS Cryptid "path"]' works for cryptid for example

weak brook
#

thats how that works?

red flower
#

yeah

brisk rose
weak brook
#

is "Cryptid" the mod id

#

im confused by that part

red flower
#

i think so yes

split cairn
#

how can I stop the negative edition from inverting colors? can anyone help with this?

brisk rose
#

idk though

split cairn
#

the drawsteps

brisk rose
#

not to do it for me ofc, just to tell me what I'm in for

quartz ravine
brisk rose
#

and me defusing their jokers

#

the repo's mine I mean, just not the art or even really the code

#

I just wanted to play with the jokers from fusion mods without having to deal with the fusion mechanic

quartz ravine
shell timber
#

thanks, i made the template for that

brisk rose
brisk rose
quartz ravine
#

Thank's again!

brisk rose
#

np :3

brisk rose
#

made with @dense jasper 's card exporter

quartz ravine
#

I was wondering how you made it, it is really good looking

brisk rose
#

which uses a modified dyanmic form of notmario's template

quartz ravine
#

I like how this is the semi-official Mod style

brisk rose
#

unforutnately the card exporter mod no longer works, so I can't make one for my new modpack

brisk rose
quartz ravine
#

We scared off everyone else.

brisk rose
#

nah, it's chill, lol. the chat always does this

iron haven
#

oops

brisk rose
#

was gonna say

#

lol

quartz ravine
#

Why is it always you two!

split saddle
# quartz ravine We scared off everyone else.

nope, i'm still here just minding my business...
anyways, the thing is WORKING!! as INTENDED!!!! it just lacks the same oomph as castle. here's the problem. the joker destroys cards and upgrades from it. but right now, it upgrades first and then destroys the card which isn't pleasant to look at. instead, it would be better if it upgraded in tandem with the cards being destroyed. I think it has something to do with events but haven't managed to make it work

#

i feel like i have the blood of this chat in my hands now 😳

split cairn
#

is it possible to make jokers or consumables add consumable slots? if so, how?

shell timber
#

look at extra credit's forklift

raven forge
split saddle
raven forge
#

events in the game mostly just run one after another. in Balatro all the scoring math happens before all the animations do because all those calculations were just creating events which run later.

For your case you'll need to know blocking and blockable; if your event is blockable it'll wait until the previous blocking events are all done. You'll need to make one of the events (upgrading or destroying) have blockable = false

#

Actually you kinda want to start upgrading when the cards get destroyed; you probably want to create an event to upgrade when the cards get destroyed, say

gusty sequoia
#

What's the smods thing like change_base but for making something an enhancement?

raven forge
#

uh, it's getting complicated. sorry there's not really an easy way to do things

raven forge
gusty sequoia
split saddle
#

i'll put it away for now, maybe i'll come back later when i've {E:1,C:edition}improved my skills{}

sonic cedar
hard flume
#

Hi yall! Might have something to show off soon:3

quartz ravine
#

Hope it's cool!!!

hard flume
#

I've gotten buttons working on playing cards, but for some reason, I can't get them working on a specific suit.

quartz ravine
#

Weriddd

I had no idea a booster might pick a locked card!

hard flume
#

Do I need to say it needs to equal true?

red flower
hard flume
spring thistle
#

I'm trying to get the first bow joker in the joker slots to detect when an arrow is used, but firstBow is returning nil. What is wrong?

red flower
#

hmm that looks like it should work
are you sure the key is correct?

hard flume
#

Do I use the regular key or card_key?

red flower
#

it should be modprefix_suitkey

brisk rose
#

so, I'm trying to debug elbe's old exporter, and there's a crash which says that this function from balatro plus is being passed an integer for "args" when it expects a table. I can definitely see why it expects a table, but not sure if it's balatro+ or the card exporter that's doing something wrong

spring thistle
#

okay

nocturne delta
#

what command could i use to increase the joker slots through the game’s console? i’m not a dev, just messing around

spring thistle
brisk rose
#

or download debugplus if you haven't

red flower
quartz ravine
#

Does Lua really not have a native where function!

nocturne delta
brisk rose
split cairn
#

is there a way to make the "Sword & Shield" part appear on a second line?

hard flume
nocturne delta
#

but since i’m not a dev, it’s basically useless

red flower
quartz ravine
brisk rose
red flower
brisk rose
#

or do you mean like... cryptid code cards?

#

lol

quartz ravine
#

where is a filtering clause

jokers.where(x=> x.unlocked == true)

brisk rose
#

which is how a lua where would work anyway

rustic swallow
#

why does this show "1 in nil"

quartz ravine
#

Wow, I am so used to working in fully developed languages, I imagine lua is one where you'd actually have to implement a sorting algorithm too

brisk rose
red flower
brisk rose
quartz ravine
rustic swallow
nocturne delta
brisk rose
brisk rose
quartz ravine
#

I'm not saying it's bad, I'm only used to being pampered!

rustic swallow
hard flume
# red flower no idea, maybe

Nope, but. Wouldn't it crash if it was an issue with the key? It's not crashing, it's just not appearing on ANY suit. Which is weird.

nocturne delta
# brisk rose curious what mod you mean ngl

entropy, it’s an add-on for cryptid and it adds something called « inversed code cards »

and turns out the inversed « crash » code cards straight up gives you access to a menu where you can type any command, and it’ll input said command into the game’s console

for example : add_joker("j_joker")
would create a normal joker

nocturne delta
quartz ravine
red flower
red flower
#

did you save the file? i honestly have no idea looking at the code

hard flume
#

I did save the file but

#

Idk what could be the issue either

red flower
#

oh i was saying it to Dantuch0
i dont know what the issue with yours is either no

quartz ravine
rustic swallow
quartz ravine
gusty sequoia
#

How do I make set_ability actually work, because so far it just crashes for being a nil value

brisk rose
brisk rose
#

might just be the debugplus console ngl

red flower
hard flume
gusty sequoia
quartz ravine
#

Maybe you have two copies of this joker in your files? Last man standing wins

brisk rose
gusty sequoia
#

I'll be right back

gusty sequoia
hard flume
red flower
gusty sequoia
hard flume
#

I added the buttons normally, but now that theyre restricted to only appear on a specific suit, it's not working

quartz ravine
red flower
brisk rose
gusty sequoia
#

I think I might have figured out my problem but I'll know for sure when it's done

brisk rose
#

oh nvm

#

it can't

#

because it's patched in

wooden nexus
#

Odd question for load_file

gusty sequoia
#

Andddd it's still a nil value, I'll write the relevant code

wooden nexus
#

Is there a limit how deep i can have a file?

#

Like can i have a folder in a folder and then smods can see it?

gusty sequoia
#

I bet my code itself is also wrong

brisk rose
red flower
brisk rose
wooden nexus
#

I see. idk why smods is being weird then

red flower
#

does it crash

wooden nexus
#

No it just doesn't load

brisk rose
quartz ravine
#

omg, I am just so happy with how this card turned out

timid parrot
#

I mean the path limit on Windows is by default 256 characters lol

brisk rose
#

SMODS.load_file(path)()

wooden nexus
#

assert(SMODS.load_file('versions/addons/potassium.lua'))()

#

do i need the assert?

red flower
quartz ravine
#

You have to activate him by playing the G.Game.to_do_hand and then he deactivates at the end of the round. I got it to flip sprites too!

gusty sequoia
brisk rose
red flower
brisk rose
#

goat sona yugi when?

wooden nexus
rustic swallow
#

this is really weird

wooden nexus
brisk rose
#

don't "that's not yugi" me btw

quartz ravine
brisk rose
#

I don't give a fuck

brisk rose
#

idk yugioh

red flower
brisk rose
#

haven't watched it since i was like 5

wooden nexus
#

But yeah, I'm adding some mod support/ports and i still have no idea why

brisk rose
rustic swallow
naive raptor
#

anyone know what could be causing this?

red flower
gusty sequoia
wooden nexus
red flower
#

yeah

wooden nexus
#

lemme look

#

no

#

loaded the game and no print

red flower
#

hmm

gusty sequoia
wooden nexus
#

is it because i have smods.atlas commands in Potassium.lua?

red flower
#

G.hand.highlighted[i]:set_ability

gusty sequoia
timid parrot
#

so I haven't modded the game in 5 months and suddenly a bunch of my old inject code is no longer working (SMODS shenanigans). How would I go about making a boss blind destroy cards after scoring (similar to glass, 6th sense, etc.)?

red flower
gusty sequoia
#

I hope this works

wooden nexus
#

all i did was try to port the enhancement from Potassium

red flower
timid parrot
#

oh nice

gusty sequoia
#

This time it didn't even give me a crash message ;-;

timid parrot
#

what does "card" represent in that case? the blind instance?

red flower
#

i think so? i havent used it yet lol

wooden nexus
#

odd, the enhancement doesn't load in the normal one either

timid parrot
#

time to find out lol

quartz ravine
#

Oops, I just noticed that I forgot to turn this test off

gusty sequoia
#

so what does the crash without a crash message usually imply...?

red flower
#

if the game closes then it's usually a stack overflow

hollow sphinx
#

trying to make a joker that makes a random joker holo, but I want it to not target jokers that already have an edition (im not sure what to put for it to recognise that the jokers have an edition)

wooden nexus
#

oh i'm an idiot

#

i put smods.enhancement = {}

#

instead of SMODS.Enhancement ({})

#

I think that's my issue

hard flume
hollow sphinx
#

thx

gusty sequoia
#

The last thing it did before that crash thing was spin the card half-way, so I'm not entirely sure, but I think the problem might now be with the spin thing

timid parrot
#

new calc is great. Works like a charm

wooden nexus
#

Oh come on game

gusty sequoia
#

I'm also starting to think my SMODs needs an update

quartz ravine
red flower
#

different person

wooden nexus
#

Almost perfect

cobalt arrow
#

Doing a Collection of Consumables based in Epic:The Musical, trying to mix with Arcana Cards art style...did this fits it?

gusty sequoia
#

for i=1, #G.hand.highlighted do G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function() G.hand.highlighted[i]:set_ability(G.hand.highlighted[i], 'm_spinnyenh', nil);return true end })) end end }

I don't know what, but something here is causing the stack overflow that N mentioned

raven forge
#

you have a colon there, so you don't need G.hand.highlighted[i] a 2nd time?

keen tiger
#

whats the difference between G.STATES.NEW_ROUND and G.STATES.ROUND_EVAL?

gusty sequoia
#

So just take that out?

raven forge
wooden nexus
#

There we go

brisk rose
#

what is the colon in lua? does lit like... keep the same relative place in a table chain or smth?

keen tiger
raven forge
gusty sequoia
#

Okay, now the issue is in a whole different place

#

I'll figure this out on my own

raven forge
brisk rose
#

haven't done much with functions yet

#

only tables themselves with the like... 3 debugplus scripts that make up my lua expereince

brisk rose
keen tiger
#

okay, seems like new_round is a strange transitional state to round_eval/game_over

wooden nexus
keen tiger
wooden nexus
#

I got permission from MathisFun to port Potassium to Archived's add-on section

brisk rose
raven forge
wooden nexus
gusty sequoia
brisk rose
wooden nexus
#

I was a part of it too

raven forge
brisk rose
#

I happened to be away at that point, from the community and all that

gusty sequoia
wooden nexus
brisk rose
wooden nexus
#

the badge is to show what version it's from (and in this case Potassium is literally just one version and done)

#

Also for authenticity, I decided to use custom colors to match that OF potassium's chips and mult for the added content, but may have something for the full mile, idk

gusty sequoia
# raven forge I only just arrived, can you share your full code
set = "Tarot",
name = "Spinny",
loc_txt ={
   name = 'Spinny',
  text = {
   'Enhances 1 Card to be {C:attention}Spinny{}'
   }
  },
key = "SpinnyTarot",
pos = { x = 0, y = 0},
cost = 3,
atlas = "Atlas3",
can_use = function(self, card)
 return #G.hand.highlighted <= card.ability.extra.max_selected and #G.hand.highlighted > 0
 end,
 config = {extra = {max_selected = 1}},
  loc_vars = function(self, info_queue, card)
   if card then
 return { vars = { card.ability.extra.max_selected}}
 else
 return {vars = {0}}
 end
  end,
  use = function(self, card, area, copier)
  local used_tarot = card or copier
  G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
  play_sound('tarot1')
  used_tarot:juice_up(0.3, 0.5)
  return true end
  }))
for i=1, #G.hand.highlighted do
 G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function() G.hand.highlighted[i]:set_ability('m_spinnyenh', nil);return true end }))
 end
 end
}```
raven forge
#

quick tip, triple ``` opens a code block

gusty sequoia
#

This whole process is hurting my brain :(

gusty sequoia
#

I didn't know that

brisk rose
raven forge
quartz ravine
brisk rose
#

I posted the function it was having the error on

sturdy monolith
#

patch for shaders to update in realtime:

[[patches]]
[patches.pattern]
target = "engine/sprite.lua"
pattern = '''G.SHADERS[_shader or 'dissolve']:send("time",123.33412*(_draw_major.ID/1.14212 or 12.5123152)%3000)'''
position = "at"
payload = '''G.SHADERS[_shader or 'dissolve']:send("time", G.TIMERS.REAL)'''
match_indent = true
brisk rose
raven forge
gusty sequoia
buoyant merlin
#

Does anyone know why the second card destroyed here doesn't create a jack/run the code at all?
I'm using the same method as vanilla (Canio)

quartz ravine
#

The last joker it processed was j_jokerhub_forbidden_fruit @brisk rose

Does that joker do anything odd in it's Loc_vars or loc_txt?

#

In the call chain, it's trying to append {1:ortalab_greyscale, card_type:Joker}, so I am also not sure but it could be something to do with that edition

brisk rose
# quartz ravine The last joker it processed was `j_jokerhub_forbidden_fruit ` <@5922778115033006...
    key = "forbidden_fruit",
    config = {
        extra = {
            x_mult = 1,
            scaling = 0.1,
            rank = JHUB.pick_new_rank(0)
        }
    },
    rarity = 3,
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.x_mult, card.ability.extra.scaling, localize(card.ability.extra.rank, "ranks")}}
    end,
    atlas = "atlas_jokers",
    pos = { x = 0, y = 0 },
    cost = 8,
    pools = {
        Food = true
    },
    unlocked = true,
    discovered = false,
    blueprint_compat = true,
    eternal_compat = false,
    perishable_compat = false,
    calculate = function(self, card, context)
        if not card.debuff then
            --Upgrade/Reset
            if context.cardarea == G.jokers and context.before and not (context.individual or context.repetition) and not context.blueprint then
                local reset = false
                for i = 1, #context.scoring_hand do
                    local rank_check = false
                    if next(SMODS.find_card('j_mxms_perspective')) and (card.ability.extra.rank == 6 or card.ability.extra.rank == 9) then
                        rank_check = (card.ability.extra.rank == 6 or card.ability.extra.rank == 9)
                    else
                        rank_check = (context.scoring_hand[i]:get_id() == card.ability.extra.rank)
                    end
                    if rank_check and not context.scoring_hand[i].debuff then
                        reset = true
                        break
                    end
                end
                if reset then
                    card.ability.extra.x_mult = 1
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            play_sound('tarot1')
                            card.T.r = -0.2
                            card:juice_up(0.3, 0.4)
                            card.states.drag.is = true
                            card.children.center.pinch.x = true
                            G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
                                func = function()
                                        G.jokers:remove_card(self)
                                        card:remove()
                                        card = nil
                                    return true; end})) 
                            return true
                        end
                    }))
                    return {
                        message = localize('k_eaten_ex'),
                        colour = G.C.RED,
                        --card = card
                    }
                else
                    card.ability.extra.x_mult = card.ability.extra.x_mult + card.ability.extra.scaling
                    if next(SMODS.find_mod("Maximus")) then SMODS.calculate_context({scaling_card = true}) end
                    return {
                      message = localize('k_upgrade_ex'),
                      colour = G.C.MULT,
                      card = card
                    }
                end
            end
            
            --Scoring
            if context.joker_main and not card.debuff and card.ability.extra.x_mult ~= 1 then
                return {
                  Xmult_mod = card.ability.extra.x_mult,
                  message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.x_mult } },
                  card = card,
                }
            end
            
            --Pick rank
            if context.end_of_round and not context.repetition and not context.individual and not context.blueprint and not next(SMODS.find_card("j_mxms_stop_sign")) then
                
                card.ability.extra.rank = JHUB.pick_new_rank(card.ability.extra.rank)
            end
        end
    end
}
#

here's the full code for that joker

raven forge
#

@brisk rose sorry I got lost in the replies.

gusty sequoia
raven forge
#

could you say again which line it was?

quartz ravine
#
(3) Lua global 'localize' at file 'C:\Users\Adam\AppData\Roaming\Balatro\Mods/balatro-plus/src/bplus\override.lua:165'
    Local variables:
     args = number: 14
     misc_cat = string: "ranks"
     (*temporary) = C function: type
     (*temporary) = nil

Could be that function is throwing? Maybe try commenting out that one jonkler

brisk rose
analog spoke
#

I'm trying to make this work, but the first value isn't changing and the $ is never earned lol, any help?

quartz ravine
#

I DM'd you btw @brisk rose

analog spoke
#

I'm a slight bit of a noob here lol

analog spoke
#

knowing me, it's probably a spelling error lmao

raven forge
#

too tired

gusty sequoia
gusty sequoia
#

Thanks for the help :D

brisk rose
analog spoke
#

while I wait for a response

gusty sequoia
#

I can't understand why it would say there's a problem in a place there very much isn't, but for some reason it seems to think there is :(

buoyant merlin
raven forge
analog spoke
buoyant merlin
#

Yw!

sleek cliff
#

Ok, so it IS scaling, but it prints an "error" message

quartz ravine
#

Do you guys think this is a strong enough joker to use?

#

not all at once

sleek cliff
fair frost
#

Hi everyone, sorry to ask but is there a mod creation FAQ or setup guide anyone could point me to?
I'm not sure how to find out the Lovely edits I need to do for the desired outcomes

fair frost
#

Oh thank you!

analog spoke
#

accidentally made "flashbanged joker" instead of "brown joker" lmao

hasty mist
#

still trying to figure out what's wrong here, any ideas?

daring fern
hasty mist
high sinew
sleek cliff
chrome widget
#

.....huh

#

I took ownership of Luchador in order to redo the condition for its badge and... it doesn't prevent the default badge from appearing...?

brisk rose
chrome widget
#

Yeah

brisk rose
#

Went the same name?

#

Like as long as all the variables you're using are named the same it should overwrite it

#

Afaik

chrome widget
#

Since it's a vanilla item, it doesn't have a loc_vars function by default. Instead, its loc_vars are determined in Card:generate_UIBox_ability_table()

#

But it's...weird to me then that it wouldn't prevent vanilla changes to the description nodes since the modded loc_vars supports doing those itself

sleek cliff
#

oh these are gonna be a BITCH

brisk rose
chrome widget
#

I can, but it requires a lovely patch

#

And I'd like to avoid that

brisk rose
chrome widget
#

Okay no, it should ignore the default one.... which is why it makes this really odd

shut crater
#

But maybe that's just cause I'm coming off of a roffle blue seal video

sleek cliff
#

Maybe lmao

manic rune
#

how do i change the size of the card

#

its only supposed to be 32x32

daring fern
manic rune
#

oh, where was that

daring fern
manic rune
#

oh

#

crap

#

i think thats the only place i never checked, for some reason 😭

#

thanks

#

im sorry little one

burnt cairn
#

with take_ownership() do i have to do anything to specify what file im taking ownership from? or do i just put the key in the brackets like its in the same file

burnt cairn
#

🫡 thanks

manic rune
#

...why is still the size of a card 😭

#

its only the hitbox that got changed

faint yacht
#

Is the image aligned to the top left of the "card" on the atlas?

manic rune
#

its only one image

#

so it should be

faint yacht
manic rune
#

and idk why it still got stretched to be the same size as a card too

#

its a square 🥀

daring fern
manic rune
#

im not supposed to do that?

faint yacht
#

Using only pixel_size myself.

daring fern
manic rune
#

:3 i looked into pixel joker's code from morefluff and saw it using both, so i assumed i needed both of them

#

thanks guys

rustic swallow
#

how would i make this only count all cards as non face cards when the joker is there, currently it always is non-face cards

sturdy compass
#

Wrap the SMODS.find_card call in a next() wrapper

shut crater
sturdy compass
#

Also you need a mod prefix in the joker key

rustic swallow
#

so i put the mod name _prosopagnosia?

shut crater
#

j_modprefix_jokerkey

rustic swallow
#

should i use caps for modprefix

shut crater
#

You should put it how you typed it

daring fern
sturdy compass
#

Does your prefix have caps?

rustic swallow
#

yes

#

ok

sturdy compass
#

Then yes

shut crater
sturdy compass
#

That assumes it’s a hook

#

(Which I hope it is)

rustic swallow
#

i think it is

#

but i still dont know what to return

sturdy compass
#

That looks right

scarlet thorn
#

j_prefix_j_?

sturdy compass
#

But you still didn’t wrap the find_card call in a next() wrapper

sturdy compass
scarlet thorn
rustic swallow
#

my key contained j_

#

so thats why

brisk rose
rustic swallow
#

k

sturdy compass
#

That’ll get annoying in the future but you do you lol

scarlet thorn
#

You should define the joker with its shorthand

#

The game auto puts the class and mod prefixes

brisk rose
#

The game in this cause being smods

scarlet thorn
#

Unless you predefined it, or set it not to. But don't do that unless realllyyy neddessary

brisk rose
#

:P

scarlet thorn
burnt cairn
#

crashing due to an unexpected symbol near 'if' on line 19, im pretty sure this is syntactically correct?

brisk rose
#

fr though it does become part of the game by being injected by lovely

#

and i'm being an ass

daring fern
sturdy compass
burnt cairn
#

🦭 not surprised

#

im still workin it out

burnt cairn
#

ive got this other function that seems to do that just fine

#

is it the calculate that makes the difference?

scarlet thorn
#

That's an if statement in a function

#

You define the calculate value of the table as a function

burnt cairn
#

an if statement in a function in a table

scarlet thorn
#

And then have the if inside that function

burnt cairn
#

ah i see

brisk rose
#

but i may be mistaken

burnt cairn
#

im a little bit just making this up as i go along and hoping it works chinhands

brisk rose
#

that table being the enhancements original decleation,

faint yacht
#

m_glass?

brisk rose
brisk rose
#

afaik

scarlet thorn
#

I've iterated over pcenters, and got custom code running on every joker like that

burnt cairn
scarlet thorn
faint yacht
#

not m_glass.

scarlet thorn
#

That's also the one specified to be working

burnt cairn
#

fair

#

though the crash is unrelated to that line though

scarlet thorn
brisk rose
#

if you're editing the table in centers, what is take ownership even doing?

#

i don't see the point to be doing both?

daring fern
burnt cairn
#

im not really sure catplush

scarlet thorn
burnt cairn
#

the other function that does work was made for me so i dont entierly understand it

brisk rose
burnt cairn
brisk rose
scarlet thorn
burnt cairn
#

and the same nom

scarlet thorn
#

I'm being rage baited

#

And it's working

brisk rose
#

when the actual modifications to glass aren't treating it as a smods object?

rustic swallow
scarlet thorn
burnt cairn
#

im trying to change the xmult that glass cards give

scarlet thorn
burnt cairn
#

ill annotate the code rq to try to explain my reasoning

brisk rose
#

just the one you're changing

scarlet thorn
burnt cairn
#

i assumed that take_ownership was entirely replacing the thing i was taking ownership of

scarlet thorn
#

Nope

#

Have you made any of your own jokers yet?

burnt cairn
#

a few

#

none that have involved taking ownership though

scarlet thorn
#

Take ownership is like changing a specific function of a vanilla feature

burnt cairn
#

the more things i try to do the more things i realise i dont understand

scarlet thorn
#

But not everything about it

rustic swallow
scarlet thorn
burnt cairn
scarlet thorn
#

Yea

brisk rose
#

i think

burnt cairn
rustic swallow
brisk rose
burnt cairn
#

ah

scarlet thorn
brisk rose
#

take_ownership is for when you're treating the object as a smods object

#

i think

rustic swallow
brisk rose
#

it's not needed to change the centers table directly

#

afaik

scarlet thorn
#

Shouldn't be no

burnt cairn
#

so itd be someting like config = "glass.config.Xmult=1.5"?

brisk rose
# rustic swallow

use a json metadata file instead, it's just as easy to make and more modern

burnt cairn
#

that but with actually correct syntax

scarlet thorn
rustic swallow
#

ohh

#

thx

brisk rose
#

but with the correct syntax

scarlet thorn
#

Xmpl for example

brisk rose
#

:P

burnt cairn
#

🫡

scarlet thorn
burnt cairn
#

btw, whats the difference between SMODS.take_ownership() and SMODS.Enhancement:take_ownership()

sleek cliff
#

Thought I'd change the blue to red for classic villains >:3

willow plinth
#

i really like these

wintry solar
sleek cliff
#

gotta add some tarots and spectrals for some of them to work as intended tho

brisk rose
sleek cliff
#

Oh dog the moment Jokers are going to be crazy to make

brisk rose
#

you said you want to change the xmult of glass cards when you have that specific joker, right?

burnt cairn
#

yeah

#

to reiterate im just kinda guessing on how to implement everything

#

so if theres a better way do tell

brisk rose
#

I'd just something like this in your joker's add_to_deck:
G.P_CENTERS.m_glass.xmult = [value you want]

#

and change it back in the remove_from_deck

#

also there may be another layer between P_CENTERS and m_glass

#

idk

burnt cairn
#

minor issue with that

#

i plan to have a second joker that sets that value to another different value

brisk rose
#

and if you have voth of them?

burnt cairn
#

the jokers are "glass cards give less xmult but dont shatter" and "glass cards give more xmult but always shatter"

#

so with both itd probably be "glass cards give more xmult but dont shatter"

brisk rose
#

that's very solvable, lemme think of it for a second, do you have the shattering thing figured out?

burnt cairn
#

only the dont shatter one is implemented at the moment but its functional yeah

sleek cliff
#

ok, are there any examples of adding a planet card?

burnt cairn
#

the heirophant?

sleek cliff
#

no, I mean a new planet card

brisk rose
#

so, let the joker that increases the mult but they always shatter be joker 1 and the other be joker 2

Instead of putting this in the add_to_deck, it can be in the calculate function, You can do what I said there instead, and nothing else would need to be done there. Keep the setting it back in the remove_from_deck. Set it to only do the always breaking glass cards if joker 2 isn't present

For joker 2, set it to only change the xmult if joker 1 isn't present, also do this in the calculate function. And in the remove_from_deck, set it to be normal unless joker1 is present, the same way

#

@burnt cairn sorry had to edit it a few times

#

If they're deleted simeltanously this should still work? because there's no way it's literally simaltanious

#

but definitely test that

burnt cairn
#

im not sure i follow

brisk rose
#

okay, I was wrong about calculate, it should actually happen in update

#

limme type out a quick, probably malformed example

burnt cairn
#

i have a mental model of the logic of implementing it thats not much of an issue

#

i just have no idea of the lua / smods syntax

#

like the always shatter joker sets the chances to 1 in 1 and the never shatter joker removes the shatter check outright

#

the never shatter joker sets the xmult to 1.5 and the always shatter joker overrides the xmult with a 3

#

the removing the shatter check is already implemented

brisk rose
#
  {
key = 'joker1',
   update = function(self, card, dt)
    G.P_CENTERS.m_glass_xmult = [new value]
    end,
   remove_from_deck = function(self, card, from_debuff
    if not SMODS.find_card('j_joker2' then)
      G.P_CENTERS.m_glass_xmult = [original value]
      end
      end
}```
burnt cairn
#

🫡

wintry solar
#

Why is that in an update

brisk rose
#

joker 2 will only change the xmult if joker 1 isn't present

#

so i have symetrical design at mind i guess

#

and i didn't want it to only happen when blinds started

#

and that's the most general contezxt there seems to be

wintry solar
#

Just give glass a custom calc function

#

You don’t need to set it every frame

brisk rose
#

I don't like the take_ownership approach as much because it might interfere with other mods

#

but it's Bev's joker not mine

#

so they can do as they want

burnt cairn
#

i know how i want to do it nom i just, dont know how to implement it

burnt cairn
#

i dont care about mod interference i dont plan on releasing this

brisk rose
#

but like.. what is your logic you're after

#

then give your logical flow and someone can help translate it to lua

burnt cairn
hybrid shadow
#

random question, im new to balatro modding (was more focused on doing the card art for it up until this point) and was wondering if its possible to make a custom rarity that has an effect on all jokers of that rarity, or if id have to manually implement the effect in the code of each joker

brisk rose
#

but so is taking ownership of g;ass, though if you even play other mods that might touch glass, even if you don't release this, it might be a pain, but that's just my priorities

#

the thing is... idk how to rewrite the calculate function for glass

#

this I know how to do, lol

burnt cairn
#

so what ive got is
SMODS.Enhancement:take_ownership('m_glass', { SMODS.take_ownership(m_glass) m_glass = {max = 500, order = 5, name = "Glass Card", set = "Enhanced", pos = {x=5,y=1}, effect = "Glass Card", label = "Glass Card", config = {Xmult = 1.5, extra = 4}}, })
im just after the syntactically correct way of implementing this

brisk rose
#

not the values in G.P_CENTER

#

to do it that way

hybrid shadow
burnt cairn
#

does that need to be its own rarity

#

it could just be like a sort-of-category-but-not-really like food jokers

hybrid shadow
#

i mean i dont wanna clog up the descriptions of the jokers

theyre already conditional as is

burnt cairn
#

fair

brisk rose
burnt cairn
#

🫡 sweet

brisk rose
#

which i don't know

#

and what context to use

burnt cairn
#

ive got half an idea

#

ive been looking around all the glass functions and shit ill get there

thorn flame
#

am i cooking?

brisk rose
#

Idk who that is but I like the art

thorn flame
#

private joker

#

from full metal jacket

#

hair should be lighte

willow plinth
wheat pulsar
#

hi anyone know how to localize with different language a mod, i know that is with a localize folder but it doesnt work

burnt cairn
#

am i missing something

daring fern
burnt cairn
#

huh

#

what does the true mean here

daring fern
burnt cairn
#

ah

#

the mod badge is the thing that appears when you hover things that say the name of the mod right

burnt cairn
#

yeah

burnt cairn
toxic flicker
#

how do u debug shit

#

like

#

print

#

how do i print

burnt cairn
#

apparently i saved the 2x image file without upscaling it 🦭

cerulean bane
#

smol jokers...

quick kraken
#

Tiny jokers

manic rune
daring fern
toxic flicker
#

wait

#

is it just not going

#

😭

#

istg

#

its going

#

NVM IM JUST STUPID

#

BROOOO IM LOSING IT

#

DHASUFKADSULFHASDOFJADSUOFDJSA

burnt cairn
toxic flicker
#

if context.before and context.cardarea == G.play then

#

TS IS NOT LIKE

#

GOING

#

apparently it is never context.before and context.cardarea == G.play

#
    calculate = function(self, card, context)
        
        if context.before and context.cardarea == G.play then
            print("TungTungTungSahur")
            local enhancement_types = {"glass", "steel", "stone", "gold", "lucky"}
            for i = 1, #scoring_hand do
                local played_card = scoring_hand[i]

                -- Choose random enhancement
                local random_enhancement = pseudorandom_element(enhancement_types)
                played_card:set_ability(random_enhancement, nil, true)

                -- Choose random seal
                local seal_roll = pseudorandom()
                if seal_roll > 0.75 then
                    played_card:set_seal('Red', true)
                elseif seal_roll > 0.5 then
                    played_card:set_seal('Blue', true)
                elseif seal_roll > 0.25 then
                    played_card:set_seal('Gold', true)
                else
                    played_card:set_seal('Purple', true)
                end
            end
        end
    end
daring fern
toxic flicker
#

wa

brisk rose
toxic flicker
#

its not printing tungtungtungsahur :((((((((

daring fern
toxic flicker
#

give random enhancement and seal

#

but the context is never goin

daring fern
toxic flicker
#

OK

#

PROGRESS I GOT AN ERROR INSTEAD LETS GOOOOOOOOOO

#

ok but i thought that scoring_hand was the hand

#

hmm

#

whats the played hand called chat

daring fern
toxic flicker
#

WHAT THE FUCK MAN\

#

CARD.LUA

brisk rose
#

Lua: the land where everything is a table in another table

toxic flicker
#

ARE WE SERIOUS RN

#

LINE 246

#

ITS PHOTOGRAPH

brisk rose
#

Not the exe

toxic flicker
brisk rose
#

It's where the pre patched code lives

toxic flicker
#

ok

brisk rose
#

Well it's where lovely puts the code after patching it I mean

#

That's what the logs refer to

toxic flicker
#

OHHHHHHHHHHHH

#

okok

#

i used set_ability too so

#

:3

#

tyy

brisk rose
#

Np :3

toxic flicker
#

ohhh ok so its asserting it

#

and its failing

#

so its not getting a string

#

huh

brisk rose
toxic flicker
wintry solar
#

Show code

toxic flicker
#
    calculate = function(self, card, context)
        
        if context.before then
            print("TungTungTungSahur")
            local enhancement_types = {"glass", "steel", "stone", "gold", "lucky"}
            scoring_hand = context.scoring_hand
            for i = 1, #scoring_hand do
                local played_card = scoring_hand[i]

                -- Choose random enhancement
                local random_enhancement = pseudorandom_element(enhancement_types)
                played_card:set_ability(random_enhancement, nil, true)

                -- Choose random seal
                local seal_roll = pseudorandom()
                if seal_roll > 0.75 then
                    played_card:set_seal('Red', true)
                elseif seal_roll > 0.5 then
                    played_card:set_seal('Blue', true)
                elseif seal_roll > 0.25 then
                    played_card:set_seal('Gold', true)
                else
                    played_card:set_seal('Purple', true)
                end
            end
        end
    end
wintry solar
#

Your keys are wrong, they need prefixes

daring fern
toxic flicker
#

ts...

brisk rose
#

Wait

faint yacht
#

...wouldn't SMODS.poll_seal be easier?

brisk rose
#

Why are the enhancements hard coded

toxic flicker
#

im gonna lose it bro

#

where are you guys getting ts

brisk rose
#

Why is any of this hard coded? All it does is limit it to vanilla stuff

daring fern
toxic flicker
#

😦

#

i just didnt find it in there ig

#

rip

faint yacht
#

I just randomly came across it whilst searching through code... I used in booster pack generation of playing cards as local _seal = SMODS.poll_seal({mod = 10})

brisk rose
wintry solar
toxic flicker
#

gah

brisk rose
#

Ooh enhancements can be polled too

#

Nice

#

The reason to poll and not pick randomly from the table that has all them is if they're not pollable there's a reason

#

I don't think enhancements have weights though

wintry solar
#

It also respects weights and pool checks

faint yacht
#

If not defined, weight is 5.

brisk rose
toxic flicker
brisk rose
toxic flicker
wintry solar
toxic flicker
#

is ts not the docs

faint yacht
brisk rose
toxic flicker
#

OH I FOUND IT

#

i wasnt using the dropdown

#

the pages dropdown

#

yippee

brisk rose
#

Yeah there's a lot of stuff :3

toxic flicker
#

:3

brisk rose
#

Hehe its punctuation for me ngl

toxic flicker
#

real

brisk rose
#

Anyway, kitty

#

My dev partner. Along with all the plushies, lol

cyan lagoon
#

without type ~= string, this crashes when playing cards face-down. how can i fix it?

wintry solar
#

Use hand_chips and mult instead

cyan lagoon
#

G.GAME.current_round.hand_chips?

burnt cairn
wintry solar
#

Just the values I posted

cyan lagoon
#

just 'hand_chips'?

#

aight

wintry solar
#

Yup

cyan lagoon
#

wow, that easy

#

also, i have a joker that retriggers other jokers and context.final_scoring_step seems to be not retriggerable. how can i fix that?

burnt cairn
wintry solar
wintry solar
burnt cairn
#

if i remove the whole calculate and if thing it works completely as intended

#

except its universal and not tied to the joker

#

so it shouldnt break just because i put it in an if statement should it?

wintry solar
#

That’s because you’re doing two entirely different things and trying to compare them

toxic flicker
#

this pops up only some of the time and the seals dont ever even show up

brisk rose
toxic flicker
#
    calculate = function(self, card, context)
        
        if context.before then
            print("TungTungTungSahur")
            scoring_hand = context.scoring_hand
            for i = 1, #scoring_hand do
                local played_card = scoring_hand[i]

                played_card:set_seal(SMODS.poll_seal(stdseal,1,true), nil, true)
                played_card:set_ability(SMODS.poll_enhancement(std_enhance,1,true), nil, true)
            end
        end
    end
faint yacht
daring fern
brisk rose