#💻・modding-dev

1 messages · Page 518 of 1

lament agate
#

yeah exactly

#

what do i do

cursive gazelle
#
local elapsed = math.max(0, raw_elapsed)```
#

Try this

#

In your update

#

I think your raw_elapsed might be negative that’s why i used math.max here , maybe try math.abs() aswell

cursive gazelle
#

Love.timer.getTime() may reset everytime you enter the game so you either save the value in your config or do math.abs

lament agate
#

where do i put the math.abs

cursive gazelle
#

Instead math.max

#

But try both

lament agate
#

got ot

cursive gazelle
#

Idk how love handles time variables

lament agate
#

do i need to mess with something else?

cursive gazelle
#

No they’re okay

thorn basin
#

what do you guys usually use when making sound effects for editions?

cursive gazelle
#

Software?

#

The best and “payed” is fl studio
Good alternative is lmms

thorn basin
#

sadly me no money

#

🫠

cursive gazelle
#

Lmms is free

thorn basin
#

aight

cursive gazelle
#

I’m better off pirating it

thorn basin
#

ths?

lament agate
#

this*

#

thanks btw @cursive gazelle

cursive gazelle
#

No problem

thorn basin
#

(yeah no, i better use lmms since I have a some experience from it)

cursive gazelle
#

(Music softwares gives you the feeling of driving a jet)

#

So many stuff thrown at you

thorn basin
#

yup

cursive gazelle
#

Good luck tho

thorn basin
#

thx

manic rune
#

how do you update the blind score hud again

#

i forgot

lament agate
#

G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)

lament agate
#

i suppose

manic rune
#

o is that all

#

thanks

rare phoenix
#

how would i make a joker that plays a video after it's effect

manic rune
#

look into how yahimod did it

rare phoenix
#

i tried that

#

it makes me want to explode

vast night
#

Hi everyone. I have a small problem. Im trying to detect when the current hand would beat the blind, so i have a context.before that sets a variable to the current score and a context.after that checks if the current score - old score is >= the blind requirement. i feel like this is a little unconventional so feel free to correct. me. the main problem is that the context.after triggers before scoring for some reason. can someone help me?

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult
            }
        elseif context.before and not context.blueprint then
            print('before')
            card.ability.extra.old_chips = to_number(G.GAME.chips)
        elseif context.after and context.main_eval then
            print(to_number(G.GAME.chips))
            print(card.ability.extra.old_chips)
            if to_number(G.GAME.chips)-card.ability.extra.old_chips >= to_number(G.GAME.blind.chips) then
trail tide
#

I found the problem

rotund sable
manic rune
#

u dont

#

i was under that impression too but luckily it works without needing it

thorn basin
#

it says that the sound effect doesn't exist meanwhile there's the sound effect in the sounds file

latent perch
#

Maybe try comparing to G.GAME.current_round.current_hand.chip_total instead

cursive gazelle
rotund sable
#

Isn't ogg the preferred type?

thorn basin
latent perch
cursive gazelle
thorn basin
#

😅

solemn shuttle
#

the image is from the MARIO Creepypasta
(TL;DR spooky SMW romhack)

the in-joke regarding it is more related to a friendgroup (x2download2 is the file name for a sound effect we associate with it for one, and the eyeballs unable to be found line is a common quotable when it’s referenced)

#

there’s more to it but that’s the gist

manic rune
#

since talisman already got functions to compare big nums i think

unborn bay
#

uh no

#

its either wrap all around to_big

#

or wrap around to_number

#

or hope that the player is using luajit2

red flower
#

what bepis is saying is that if both are bignums already you don't need it

unborn bay
#

-# still better to be safe than attempt to compare table with number

red flower
#

yeah

pulsar gull
#

is there a context in smods that triggers after each joker individually scores?

#

context.other_joker triggers before they score appearently

red flower
#

context.post_trigger
it requires enabling an optional feature

pulsar gull
#

optional feature?

#

how do i do it

red flower
red flower
#

can we delete talisman

manic rune
#

i agree

thorn basin
#

I made a ui code that should reveal the next drawn 5 cards but they all reveal the first next one, how can I fix this?

maiden phoenix
#

It's cut off on the right

thorn basin
maiden phoenix
#

You're always fetching the last card

thorn basin
#

so what can I do to fetch the other next ones?

maiden phoenix
#

Replace each G.deck.cards[#G.deck.cards] by the correct number

thorn basin
#

so it would be G.deck.cards[1] and the next one same but with 2?

maiden phoenix
#

yes

thorn basin
#

aight

red flower
#

no

#

you need to subtract from the total

thorn basin
#

oh

red flower
#

the deck goes in reverse order

maiden phoenix
thorn basin
#

so G.deck.cards[#G.deck.cards - 1]?

red flower
#

yeah

thorn basin
#

aight

red flower
#

you would start at - 0

thorn basin
#

thx you both for the help!

maiden phoenix
#

Can you call incorrect info help? 😅

thorn basin
#

well, you still tried and that's what matters!

ancient aurora
#

Hey!
I've been trying to create a joker that copies a random rare joker at the start of the round (and reverts back at the end of the round).
Using set_ability seems to change it to a rare joker permanently, so that isn't helpful. I was thinking of perhaps changing all the center elements (loc_txt, atlas) but seemingly base rare jokers don't store them directly in the center. Any suggestions on how I could implement this joker?

maiden phoenix
ancient aurora
#

I've tried a similar approach to that, but seemingly if I use set_ability or change the joker's center in card.config.center with the a random rare card's center, the original joker's calculate function gets overriden as well

maiden phoenix
#

Not in the joker's calculate itself, do you know what a hook is?

ancient aurora
#

Unfortunately no I don't think I'm familiar with that sorry. I'm fairly new to these mods still - sorry

bold sleet
#

Hello good people. Does anyone know how to change the chance of rarities appearing in the shop and wherever?

maiden phoenix
# ancient aurora Unfortunately no I don't think I'm familiar with that sorry. I'm fairly new to t...
Klei Entertainment Forums

In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...

#

Basically you want to do what's in it for the calculate_joker function

#

Soon this won't be necessary cuz N added a pr for mod calculate so pog

ancient aurora
#

This sounds useful, thank you!

maiden phoenix
frigid cargo
#

Bump

crisp coral
#

if it's only one specific joker why don't you put that on the joker

ancient aurora
maiden phoenix
#

Nice, yw

frigid cargo
maiden phoenix
#

I'm pretty sure you can do G.jokers.cards[1]:set_edition("e_negative") since sleeve effect are applied after the deck

manic rune
#

2 questions

#
  1. how do i check if a card is in collection
  2. how do i check if the player is in a run
maiden phoenix
manic rune
#

🤔 i thought cards are flagged when they are created in the collection

red flower
#

i dont think they are

manic rune
#

bleh

#

is the cardarea G.collection

#

or smt

#

actually, i should just print G.I.CARDAREA and check that for myself probably

red flower
#

no, i think they just don't have an area

manic rune
#

wuh

#

really?

#

hm

red flower
#

the other day someone tested and card.area in the collection is nil

#

the area should be G.your_collection[i]

manic rune
#

will this work then (doesnt run when you are not in a run, and when the card is spawned in collection)

red flower
#

yeah

manic rune
#

mmmmm

#

lemme do a quick round of testing rq, thank

red flower
#

i think it's better that way because cards can be in other places

#

for like mod menus and stuff

manic rune
#

mhm

#

alright it should work now, thanks

vague crest
#

i assume theres probably a lot of answers for this but i know that theres some sort of pool a lot of mods use for "food jokers" in the context of jokers that give random food jokers for example

#

is there a simple way to add my jokers into that pool?

vast night
red flower
#

you can do pools = { Food = true } but you need to either add the pool yourself or only load it when cryptid is installed or something

unkempt thicket
#

Vanilla food jokers should be in that pool naturally as a part of smods.

manic rune
#

question, what does this mean

fresh jungle
manic rune
#

😭

chrome widget
#

The pinch behavior on the sprite basically basically eases the width of the sprite towards 0

#

And I believe setting drag to the prevents it from being dragged by normal means?

manic rune
#

ahh icic

#

whats self.T.r then?

manic rune
normal crest
#

is probably just makes it appear bigger for a frame, as if it was being dragged, but dunno

manic rune
#

im trying to figure out a way to "prevent" popcorn and other food jokers from being destroyed by its own effect
-# by making a copy of itself

normal crest
#

i think you can prevent it by setting context.blueprint

manic rune
#

wuh

normal crest
#

Cus all of them have not context.blueprint on their destroy condition

manic rune
#

oh shit you are right

#

srockw you rock

#

i was tryna do all this 😭

modern kindle
#

Yea you can just set context blueprint
I do that as well

fossil nebula
#

Im trying to copy the yahimod explosion gif, i have the whole code for that(or at least i think i have). Problem is I have no idea what should i change/add for it to work in my mod. Can someone give me a step by step explanation 😭

    function loadThatFuckingImage(fn)
        local full_path = (Yahimod.path 
        .. "customimages/" .. fn)
        local file_data = assert(NFS.newFileData(full_path),("Epic fail"))
        local tempimagedata = assert(love.image.newImageData(file_data),("Epic fail 2"))
        --print ("LTFNI: Successfully loaded " .. fn)
        return (assert(love.graphics.newImage(tempimagedata),("Epic fail 3")))
    end

    function loadThatFuckingImageSpritesheet(fn,px,py,subimg,orientation)
        local full_path = (Yahimod.path 
        .. "customimages/" .. fn)
        local file_data = assert(NFS.newFileData(full_path),("Epic fail"))
        local tempimagedata = assert(love.image.newImageData(file_data),("Epic fail 2"))

        local tempimg = assert(love.graphics.newImage(tempimagedata),("Epic fail 3"))

        local spritesheet = {}
        for i = 1, subimg do
            if orientation == 0 then -- 0 = downwards spritesheet
                table.insert(spritesheet,love.graphics.newQuad(0, (i-1)*py, px, py, tempimg))
            end
            if orientation == 1 then -- 1 = rightwards spritesheet
                table.insert(spritesheet,love.graphics.newQuad((i-1)*px, 0, px, py, tempimg))
            end
        end
        --print ("LTFNIS: Successfully loaded spritesheet " .. fn)

        return (spritesheet)
    end
#
G.effectmanager = {}

function playEffect(effect,posx,posy)
    if effect == "explosion" then
        play_sound("yahimod_snd_explosion")
        neweffect = 
            {
            name = "explosion",
            duration = 100,

            frame = 1,
            maxframe = 17,
            fps = 20,
            tfps = 0, -- ticks per frame per second


            xpos = posx,
            ypos = posy,
            xvel = 0,
            yvel = 0,
            }end
    table.insert(G.effectmanager,{neweffect})
end

    -- EFFECT MANAGER!!! 
    -- this is where on-screen little gifs play

    if G.effectmanager then
        
        --print("Effect manager has "..#G.effectmanager)
        for i = 1, #G.effectmanager do
            local _xscale = love.graphics.getWidth()/1920
            local _yscale = love.graphics.getHeight()/1080
            --print("G.effectmanager[i].name".. G.effectmanager[i][1].name)
            if G.effectmanager[i] ~= nil then
                if G.effectmanager[i][1].name == "explosion" then
                    if Yahimod.imageexplosion == nil then Yahimod.imageexplosion = loadThatFuckingImage("explosiongif.png") end
                    if Yahimod.imageexplosionsprite == nil then Yahimod.imageexplosionsprite = loadThatFuckingImageSpritesheet("explosiongif.png",200,282,17,0) end
                    imagetodraw = Yahimod.imageexplosion
                    quadtodraw = Yahimod.imageexplosionsprite
                    _imgindex = G.effectmanager[i][1].frame
                    _xpos = G.effectmanager[i][1].xpos-(200/2)
                    _ypos = G.effectmanager[i][1].ypos-(282/2)
                    --print("_imgindex".. _imgindex)
                    love.graphics.setColor(1, 1, 1, 1)
                end
                
                love.graphics.draw(imagetodraw, quadtodraw[_imgindex], _xpos, _ypos, 0 ,_xscale,_yscale)
            end
        end
    end
manic rune
#

why is this running infinitely

#

hm

chrome widget
manic rune
#

mm

chrome widget
manic rune
#

🤔 how

#

im trying to figure out how to filter out jokers with those effects specifically

chrome widget
#

Food jokers are all intentionally written to avoid their own destruction behavior when called with blueprint, so that's the simplest way. You can also do whatever weird metatable bullshit to prevent value scaling (which I've done before)

cursive gazelle
#

Similar

#

At least

manic rune
rocky plaza
#

any idea why this could be the case?

cursive gazelle
#

Make the transmutable effect a global variable

#

That’s how i do it with my flip mechanic

cursive gazelle
normal crest
rocky plaza
chrome widget
rocky plaza
#

hold on

#

so this is with the code i sent earlier

#

gonna record again with card.ability.mul_transmutable = true commented out

normal crest
manic rune
rocky plaza
chrome widget
#

A joker? A deck? A challenge?

manic rune
#

literal hooks, theres no objects or anything handling it

#

my mod adds extra effects to the jokers, and im using hooks to run calculate on them

chrome widget
#

Okay so it's for the sake of calculation. You're trying to add a context to prevent food joker destruction?

manic rune
#

that could work, yeah

chrome widget
#

Unfortunately, food jokers aren't, as a whole grouped in the vanilla game. Basically, the best option IMO is create a list of the jokers who you want to prevent decay/destruction effects on for the vanilla jokers, extending the Cryptid model for it, because for mod compatibility other mods are likely to also have added to that same list that cryptid uses. Then, in a hook/patch for Card: calculate_joker, check if the card center being calculated is one of those valid food jokers, and if it doesn't have context.blueprint I contexts added to them, set context.blueprint_card to be that card itself, and set context.blueprint to 1, and then reset those values along with the function's return

olive meadow
#

Hello, I hope I am not interrupting a chain of thought. I am new to modding/lua in general and was wondering if anyone knew of a good guide/tutorial? I am currently looking to just do a test mod where upon certain game actions (play hand) I write the game state to a file (currently planning on json) and then read that into python. Thanks!

chrome widget
#

Essentially, you're going to be telling the card to calculate as if it's copying itself

manic rune
#

aw so i gotta hard-code it, basically

chrome widget
#

The only way to not hard code it doesnt necessarily respect non-food jokers in addition and also requires metatable magic

#

Which is basically the prevent_scale context I have in an open SMODS pr

normal crest
chrome widget
#

Which does blanket prevent food jokers from decaying, but also would prevent any modded items that need to decrement values as well

wintry solar
chrome widget
#

Fortunately you can rely on the fact that everyone is painfully reliant on Cryptid compatibility, as much as I dislike it

chrome widget
manic rune
#

mm i see

#

i think eremel has the same opinion with all of my pr anyways lol

normal crest
#

Food pool isn't really cryptid compatibility at this point

#

Many people do stuff with food jokers

chrome widget
#

It's honestly a mistake on the vanilla game's part to not have given them some grouping in code

manic rune
#

im tryna get this passive to work btw

#

:3

#

-# thought it would be cool to show idk

red flower
#

they should have used a function to get eaten instead of copy pasting the code on each at least

chrome widget
#

Yeah lol

normal crest
#

Yummy

manic rune
#

agreed, maybe we could start a campaign to make thunk do that.....

chrome widget
#

If they had a shared function you could easily do this exact effect

red flower
#

i dont think that would be bad for smods tbh

chrome widget
#

Hmmmm strokes chin

manic rune
#

yeah, i dont think anyones been patching into that stuff too

#

so not much patch fuck up either

chrome widget
#

Want me to just import the Food pool and do all that in a PR?

manic rune
#

yes please

chrome widget
#

Idk if that's considered too unvanilla for SMODS

wintry solar
#

I don’t think they need a specific function to be removed

manic rune
#

but the fact that they are using self = nil AFTER self:remove() is so annoyingdsalfdsfkd

normal crest
#

Can we make it so that if a Joker has a pool in its center and that pool doesn't exist, the pool is created. Or would that cause issues

wintry solar
#

Though I haven’t looked at the code

manic rune
#

adding a prevention in :remove() doesnt help when the card is just nil afterwards

#

sob

normal crest
final jewel
#

Guys I want to have an extra choice in a specific type of pack but I don't understand how to make it directly in the voucher. Like I know I could write some line in the pack that check if you have the voucher but I was wondering If it was possible to not do this ?

wintry solar
#

Setting self to nil seems wonky though, classic thunk code 😂

manic rune
#

EXACTLY

#

sob

manic rune
#

my idea was to, uh, run calculate_joker on those vanilla jokers and see if they return messages like k_eaten_ex, k_extinct_ex

#

:3 its a bad approach i know but im desperate

manic rune
#

so i just add in context.blueprint, boom

#

;3

stiff quiver
#

what are the odds of a joker being rental?

final jewel
red flower
#

i think

manic rune
#

ughhhhhhh guess im just gonna, do what cryptid is doing then

#

:<

stiff quiver
#

its what i thought too, wanted to be sure, thanks N' !

chrome widget
manic rune
#

no but it works well see..........

chrome widget
#

But yeah the more comprehensive option I created basically created an empty proxy ability table for every card in the game to which it's valid, saves their original tables for reference, and then has meta methods that run every time a value is changed or set on the ability table

manic rune
#

this also means my OTHER destruction prevention code doesnt work for food jokers, bleh

chrome widget
#

So it intercepts the value assignments and sends some contexts for jokers to respond to to modify them

manic rune
#

im doing this for my own scaling effect :3

chrome widget
#

It's an extension of a boss blind effect I created for my own mod that prevents scaling, which also has the consequence of preventing food joker degredstion

manic rune
#

it doesnt use metatables though shrug

chrome widget
#

The metatable method is a little heavier but more elegant overall I would say

wintry solar
#

Does it also prevent counters from changing?

chrome widget
#

I.E. like invisible rounds

#

The more jank thing is blanket preventing UI messages after scaling has been prevented which is far more obtuse

#

Which it does do, and I think I found a decent solution, but sheeeeesh

wintry solar
#

Yeah I think that’s my issue with anything like this for something so simple as changing internal values, it just becomes another talisman esque coding problem

manic rune
#

what the hell happened in cryptid

#

also i think scaling modification shouldnt really be a part of smods due to how jank/annoying it can be to manage

#

-# and we literally had a discussion over this a few hours ago in modding-chat lol

modern kindle
chrome widget
modern kindle
#

hi winterrrrrrrrrrrrrrrrrr

chrome widget
#

Hi dillyyyyyy

broken rivet
#

should i use SMODS.ObjectType for something like this or make an entirely new class and lovely edit smods

modern kindle
red flower
#

you can extend the smods objects

chrome widget
#

Either way even if the validity for SMODS is questionable, it's a requested enough feature due to scaling being a primary game mechanic that I'd like for people to be able to use it

#

And the more centralized it is, the less conflicts there are

red flower
#

hi dilly

broken rivet
modern kindle
#

we have optional features as is, i dont personally see the harm in it existing as that feature

modern kindle
broken rivet
#

i was thinking lovely edits just to ensure other mods could use the class since my mod loads pretty late

manic rune
#

is this it

#

:3

red flower
#

or make another api mod

manic rune
#

ugh but the thing is that how do i detect if the joker IS destroying itself though

#

since theres a counter thats supposed to decrease when that happens

#

sob

#

-# i still think the checking message one is goated asf

normal crest
#

It really would be nice to have a function responsible for eating jokers that you could just hook

red flower
#

thats what i said!

normal crest
#

I'm just agreeing with you, a bit late

manic rune
#

im agreeing with you later than rock

red flower
#

also it would be more user friendly if people want to make their own food jokers

manic rune
#

i think i might just, add (Doesn't work when most Joker foods are destroyed by their own effect)

#

sob

red flower
#

i would just say eaten

manic rune
#

yeah but then theres cavendish

#

and gros michel

#

which use Expired instead

normal crest
#

They expired in your stomach

manic rune
#

wtf......

normal crest
#

Isn't it extinct tho

manic rune
#

or extinct, yeah

#

still not eaten though :3

chrome widget
manic rune
normal crest
#

They go extinct cus you ate them

red flower
#

i have eaten all the bananas

manic rune
#

yeah im just gonna add it

#

ugh

#

i THOUGHT i was onto something

manic rune
#

recycling food jokers is a nice effect too.........

chrome widget
#

Objectively most of it is

manic rune
#

sadly it gotta be done manually and not automatically

chrome widget
#

This is basically my job rn

candid prism
#

you know the mods a bad idea when the rarit lua will be larger than the whole rest of the mod

normal crest
#

We're the ones who stuck around after learning to make mods

manic rune
#

rarit lua

chrome widget
#

Basically this shit is going right on my resume once it's done

red flower
#

the last of us

broken rivet
red flower
#

i hate take_ownership

chrome widget
#

Main developer of multiple major Balatro mods, coordinated deployment and Q/A testing, that kinda shebang

manic rune
limber blaze
#

since

broken rivet
#

i guess i could only do mod compat code after all mods are loaded

modern kindle
chrome widget
#

Somehow it's gonna end up being more relevant experience than my past job 😭

limber blaze
#

card:remove is called "often"

#

and also

#

theres no way to determine if its being removed from self destruction

#

i was attempting to prevent self destruction once

#

its very janky

manic rune
#

i can def see why since ive been working on it for 1-2 hours now

#

sob

chrome widget
#

What to do when I get home....... work on stupid deck credit jank

red flower
#

after i finish work i will open aseprite and if i dont feel like dying after 30 minuts i might make a new mod

chrome widget
#

I've managed to pretty much arrange the styling for the boxes in a way that I like, but I'm also gonna have to carry this other into other screens like the view deck UI, and some form of hover behavior on the deck in main gameplay

manic rune
#

.

#

hm

#

wait hold on

#

i might be onto something

chrome widget
#

But ughhhhh the deck selection UI is weirddddddddddd. It makes everything objects at lower levels to be handled by replacing the UIBoxes with the deck name and description individually rather than just recreating the whole panel

#

Which idk maybe it's cheaper but it being so fragmented sucks to mod

#

And ultimately no one's going to appreciate the various UI work that went into the mod because it's for really small unintrusive visuals

#

Like NO that caused me actual physical pain

red flower
#

does your mod have anime

chrome widget
#

Make my mods boy

manic rune
#

N' can you work on bsr....

red flower
#

does bsr have firefly

manic rune
#

in next update

#

aka break update

red flower
#

i love breaking

manic rune
#

same

red flower
#

i need to try out firefly e2

manic rune
#

my idea for the break mechanic is to

#

attack a card so hard it fucking debuffs itself for the whole ante

#

:3

red flower
#

lets goo

manic rune
#

but in exchange it gives you significantly more buffs compared to normal attacks though

hybrid shadow
#

crazy idea but changing the calculate functions of objects should be smth that can be done through code like

function "[objprefix]_[modprefix]_[obj]" calculate =
[etc code]```
manic rune
#

so maybe that makes up for the fact that thinning your deck too much wll potentially cost your run

normal crest
red flower
hybrid shadow
#

isnt take_ownership able to be overrode by other mods that load after

modern kindle
red flower
chrome widget
#

My mod has anime because JoJo

manic rune
#

winter's mod has by far the BEST shader ive ever seen imo

chrome widget
#

I am nothing if not a tgirl programmer weeb stereotype

manic rune
#

still unchanged till now

#

:3

chrome widget
modern kindle
#

i have not seen winters shader

manic rune
#

the stand fire one

#

its so fucking sick

chrome widget
#

Oh yeah that one

normal crest
manic rune
#

and ive legit never seen a better shader till now

#

HOW IS IT SO BUTTERY SMOOTH THOUGH 😭

modern kindle
#

where can i see it

manic rune
#

no clue, she sent that a while ago

chrome widget
#

Lemme see if I have a video somewhere

manic rune
#

this one?

#

oh yeah it is

red flower
#

oh yeah i really like that one

modern kindle
#

yea that is neat

manic rune
#

hm

modern kindle
#

i need to make some form of a neat shader for my boss card at some point

manic rune
#

i think i can figure out how to detect when a food joker is destroyed

#

hmmmm

chrome widget
#

Yeah I didn't have any video saved on my phone

modern kindle
#

i will save you on my phone in order to make up for it

ocean sinew
#

W

final jewel
#

Why that isn't working

ocean sinew
#

when is this releasing

chrome widget
#

In the current version auras aren't on automatically, instead they "flare" whenever they do return effects and such, with the exception of Tohth and Epitaph, which do it on hover because their deck prediction effects are passive

manic rune
#

- copy_card(card)
- add something to the clone to refer to the original card
- run calculate on the clone
- add context.blueprint... to the original card first to prevent it from being killed, let the original card calculate normally
- if Card:remove() runs and its the cloned card, do something with the original card <- aka self-destruction prevented!!!

#

is this good??

chrome widget
#

And they play when you hover over them in the collection

manic rune
#

🤔

#

-# i wonder if vouchers' keys are stored like that too or its inconsistent

final jewel
manic rune
#

no i still need to duplicate the card since the calculate function of vanilla jokers arent stored in G.P_CENTERS, fuck

chrome widget
#

But the Killer Queen: Bites the Dust one is a good example of the aura flares on actual card effect

manic rune
#

cant believe its actually the effect

#

sob

chrome widget
#

Yeah!!!!!!! I'm actually 90% sure it was Eremel who wrote that? At least according to the Cardsauce credits

manic rune
#

ooh

chrome widget
#

info_queue[#info_queue+1] = {key = "codercredit", set = "Other", vars = { G.csau_team.eremel } }
yeah it has a coder credit

#

Regardless I was a late addition to Cardsauce so all the canon Stands I've worked on have mostly been bugfixing and visual effects. However, I've made nearly all the Stands for my own mod

final jewel
chrome widget
ocean sinew
#

this mod is fire

manic rune
ocean sinew
#

as a fan of Jojo you did a very good job

#

I liked the sprites a lot

manic rune
#

im a fan of jojo too, and i can confirm

chrome widget
#

None of the spritework on Cardsauce is me, you can thank the massive list of Cardsauce contributor artists

#

I've made some sparse bits of art for my own mod tho

final jewel
manic rune
#

why is it still creating itself infinitely here

#

does the flag not work?

chrome widget
#

Out of curiosity, put it in the ability table, set it on self before being copied, and then unset it on the original after the copy

ocean sinew
#

you would want to check for a variable and then set it to false later

#

oh wait you set the variable

#

then idk 💀

chrome widget
#

That said I'm not 100% sure you need to be creating a copy here

#

Which would circumvent this entirely

chrome widget
#

No yeah I'm just confused based on the effect why you need to run both calculated rather than running it on the original one with the blueprint context preventing its destruction

manic rune
#

ugh scrap that, even if it works, the clone's calculate can still mess with the game anyways

manic rune
#

so that i can drop the counter of the destruction prevention effect by one

chrome widget
#

Ah I see

manic rune
#

so the clone is supposed to help with that

#

but the clone's calculate can mess with the game, so

#

im just gonna scrap it and give up, this doesnt seem possible

#

sob

chrome widget
#

The clone's calculate doesn't need to mess with the game, I think you can effectively prevent that

manic rune
#

really? what if in the calculate they are doing stuff that changes the game's values though

chrome widget
#

I mean yeah technically not wrong

manic rune
#

istg balatro is the ONLY game that even experienced coders like you can have difficulties figuring out when food is being eaten 🥀

red flower
#

i only eat pizza thats the problem

manic rune
#

fair

ocean sinew
#

which u can just add

#

and check with :IsJokerType(<type>) or :IsConsumableType(<type>)

#

it already done

red flower
#

i hate pascal case

solemn shuttle
#

what are the args for play_sound again
ik it starts with play_sound(pitch, vol,
but is there more or

chrome widget
#

sound, percentage, vol

ocean sinew
#

but I want to add the edit card thingy before which u can activate using SMODS.optional_features.edit_cards = true

solemn shuttle
#

hm, i see
-# i ask because a joker's sound was playing early for me when it was scoring during joker_main so i gotta tinker lol

ocean sinew
#

then people will be able to edit card atlas values name key rarity etc in-game with edit button

solemn shuttle
red flower
#

yeah

solemn shuttle
#

yeah that was a quick fix, joy

fallow breach
#

how would i check for rerolling the boss blind?

#

i tried context.reroll_boss and i'm pretty sure that doesn't work

rocky plaza
fallow breach
#

😔

red flower
fallow breach
#

forgive me i'm new to lua what does hooking mean

red flower
solemn shuttle
#

-# tho in my case i just settled for banning the blind LMAO

red flower
#
local reroll_boss_ref = G.FUNCS.reroll_boss
G.FUNCS.reroll_boss = function(e) 
  reroll_boss_ref(e)
  SMODS.calculate_context{modprefix_reroll = true}
end

and then you can use context.modprefix_reroll

(replace modprefix with your mods prefix)

modern kindle
#

thinkin about N rn

red flower
#

thinkin about N rn

manic rune
#

mmmm

#

i think i got the self destruction prevention working

normal crest
#

how'd you do it

ocean sinew
manic rune
fallow breach
#

thanks guys

normal crest
#

won't it copy the +0 mult

#

and immediately die

solemn shuttle
manic rune
modern kindle
#

wrong it copied all the 0 mult and destroyed 2 other cards

manic rune
#

i mean, probably, but my effect resets the ability value of popcorn first lol

normal crest
#

i shee

red flower
modern kindle
#

woah its srock hi srock

normal crest
#

hello

modern kindle
#

how are you doing buddy pal

normal crest
manic rune
#

is it bad for me to feel proud of this

ocean sinew
#

50% yes 50% no

modern kindle
#

i want to be a contrarian

normal crest
modern kindle
#

im always proud of bepis but everyone else already said no so i have to say yes

modern kindle
ocean sinew
#

I'll be the middle

#

I'll say no and yes

normal crest
#

that's how you get your vote invalidated

manic rune
#

what are you gonna do with a +0 mult popcorn...

modern kindle
#

look at it

#

also depends, if its a negative +0 popcorn i still like it

#

its negative

olive meadow
modern kindle
#

or if its another edition i have

#

which reminds me i need to work on the edition im doing rn to not make it a hook

manic rune
#

. oh

red flower
normal crest
manic rune
#

it does, actually

manic rune
#

it just created a popcorn with +0 mult

#

lmao

ocean sinew
#

can it go below 0 mult?

normal crest
# manic rune

but didn't you just say you changed the values before copying

modern kindle
#

negative mult my beloved

manic rune
#

i have 2 destruction prevention effects

#

one is "prevent destruction", the other also resets the ability table (food synergies)

modern kindle
#

what happens if its paired with my fridge

manic rune
#

shrug

modern kindle
#

lmao

#

that doubles the values for 5 rounds

manic rune
#

i will record this rq, one sec

normal crest
#

better api

red flower
#

better bepis

normal crest
#

thats rude

modern kindle
#

what can be better than bepis

manic rune
#

everything

red flower
#

if bepis is so good where's bepis 2

red flower
#

actually bepisfever sounds like a sequel

manic rune
#

.

normal crest
manic rune
#

there we go

red flower
normal crest
#

it got eaten twice

#

delicious

manic rune
#

both of the jokers got eaten

#

sob

#

you can see that the first one didnt reset its values, while the second one reseted though

#

:3

red flower
#

thats cool

normal crest
#

weird that the eaten message shows twice on the left joker

manic rune
#

yeah

#

but hey it works, im NOT complaining considering how yanky this is

#

sob

normal crest
#

i am complaining

#

mwahahha

manic rune
modern kindle
#

turtlebean my detested

manic rune
#

man i love seeing useless(?) passives on jokers lol

ocean sinew
modern kindle
#

thats 4 more dollars

austere schooner
#

yeah logically that should just give you the money twice

azure laurel
#

hey, sorry if im interrupting a conversation but i need help to code a joker, its like misprint but givin you random amount of money instead of mult, i tried ti use the smods recreation from the smods vanilla remade repository but i dont understand how works the misprint randomness, i will apricciate any help given

manic rune
#

which MEANS

#

EVERYTHING WORKS PERFECTLY

#

OH MY FUCKING GOD

red flower
#

lets goooo

vestal magnet
manic rune
#

adds random extra effects on jokers

#

i fucking thought self-destruction prevention was basically impossible

ocean sinew
manic rune
#

cant believe i clutched

#

ghhhhhhhh

red flower
red flower
ocean sinew
#

oh yeah

#

I forgot

chrome widget
#

Alright heading home from bowling, time to mod

azure laurel
red flower
chrome widget
#

Lane conditions were rough

red flower
azure laurel
manic rune
modern kindle
wintry solar
chrome widget
chrome widget
wintry solar
#

do they have cool designs

red flower
manic rune
#

i want to see

chrome widget
#

Technically I currently own eight but at least four of them are nearly a decade old

manic rune
#

oh wow

#

-# can i see them all :3

#

im actually curious

chrome widget
#

So I'm probs gonna trash or donate them. Their surfaces aren't super good anymore

manic rune
#

in vietnam bowling is like, SUPER uncommon

#

ive legit never seen a vietnamese talk about bowling in my life

red flower
#

oh yeah here bowling is practically not a thing

manic rune
#

same

chrome widget
#

Also yeah it varies by country. Japan and Mongolia? afaik have fairly big bowling scenes but it's pretty uncommon across most of Asia

azure laurel
manic rune
#

i dont think its fixable

#

without making this even more yanky than it should

#

the fact that im using copy_card is probably illegal enough already :3

red flower
modern kindle
#

everything is always fixable

manic rune
#

dilly can u fix it for me

red flower
#

(yes the description is longer than the actual effect)

manic rune
#

anyways, what effect should i add next

modern kindle
manic rune
#

something unique but also somewhat universal

azure laurel
ocean sinew
#

where is the game seed stored?

red flower
#

G.GAME.pseudorandom.seed? i think

manic rune
#

G.GAME.pseudorandom.seed-

#

yeah

#

-# damn im slow

ocean sinew
#

I wanna make a joker that randomly changes the seed

red flower
#

i think that would be impossible to visualize as a player

chrome widget
manic rune
#

seeds are normally inaccessible until you lose/win a run

manic rune
#

so, while it does make a difference to everything, you wont know about it

red flower
#

yeah and even if they were the player would have no idea what changed

manic rune
#

mhm

ocean sinew
#

what about a joker that tells everything thats going to happen in this seed for next round and changes seed at end of round

modern kindle
#

you could make an extra tab in the run info that shows how the seed changed, ie showing shop diffs and such

manic rune
#

also, hows this for an effect

[Passive]
If Joker is destroyed, creates a Tarot/Spectral card
(Must have room)
#

:3

manic rune
red flower
ocean sinew
manic rune
#

i see

modern kindle
manic rune
#

Tarot is 0%, Spectral is 100% :3

modern kindle
#

there not much to gain unless you can make it a more 'favorable' seed and how youd quantify that is unknown to me

red flower
ocean sinew
#

me when I get when this joker is destroyed create a copy of it and if joker is destroyed creates a tarot/spectral card on popcorn:

chrome widget
manic rune
#

you can have some pretty fun combos like that :3

modern kindle
manic rune
#

also i should, probably nerf discards and hands effects

#

giving +3 hands seems a bit too much lol

chrome widget
ocean sinew
manic rune
#

+2 at most

modern kindle
manic rune
#

also the destruction prevention effect is so good when it hits this

#

:3

#

i cant believe i actually found it naturally lol

ocean sinew
#

W

#

getting invisible joker with passive:prevents destructions and keeps values

manic rune
#

that one would be the passive i sent above

#

the reset ability one is more suitable for food jokers

#

but still good nonetheless

latent perch
#

or is it just useful for ankh

latent perch
#

I see

manic rune
#

:3

modern kindle
#

hi eremel!

wintry solar
#

hi dilly

modern kindle
#

i hope youre awesome today

olive meadow
#

Confirming that my thought process is right here:

Are there any syntax/styling recommendations for lua?

chrome widget
# manic rune -# can i see them all :3

1st pic

  • Black Widow 3.0 (Hammer, 2024)
  • T-Zone Frozen Blizz (Brunswick, 2019)

2nd pic

  • Primal Rage Remix (Motiv, 2015)
  • No Rules (Roto Grip, 2016)

3rd pic

  • Alpha Crux (Storm, 2016)
  • White Dot (Columbia 300, 2017)

4th pic

  • Fanatic BTU (Brunswick, 2016)
  • Tag Cannon (Motiv, 2017)

All are 15 lbs, ~7 kg

(Sorry, collecting release info took me a long time)

wintry solar
#

omg T-Zone Frozen Blizz is lush

chrome widget
#

The White Dot also has a specific pattern name but I couldn't find it. Both it and the T-Zone are polyester balls (spare balls), which are a lot simpler engineering wise and so they get sold for longer periods of time. They've been selling WDs since like 2002 or smth with a different pattern assortment every year or couple of years, whereas everything else in this photo except the Widow and the T-Zone (also polyester) has been retired in the years since their initial releases

manic rune
#

im a sucker for blue -> pink/purple gradients so T-Zone Frozen Blizz looks so nice for me :3

chrome widget
#

I picked it up cause tgirl colors

manic rune
#

ic

chrome widget
#

This is the full assortment seemingly

wet crag
wet crag
chrome widget
#

So are most people, I just happened to end up doing it professionally

wet crag
#

Damn. So when you want better work conditions do you. Go on Strike?

#

Do you go Cold Turkey?

#

Heh. Heh.

chrome widget
#

LMAO

wet crag
#

Let's put a pin in it and circle back later.

#

Heh.

timid zinc
#

what fps do boss blinds animate at?

final jewel
#

what does that do

timid zinc
#

it makes it so you cant overfill your consumable slots by having multiple things that give you consumables at once

olive meadow
timid zinc
#

like this

red flower
# final jewel what does that do

what Sophe said + it allows other cards to do stuff with consumable count during scoring because the cards dont get added until after scoring (due to events)

#

you can omit it but it will make some effects be wrong

timid zinc
olive meadow
#

Ah got it thanks

timid zinc
#

if it has arguments make sure to pass them into the hook as well

chrome widget
#

Anyone with a little bit of UI knowledge, would you know at all why attempting to call e.UIBox:recalculate() crashes here?

#

My crash log refers to this line in UIElement:set_values, but I don't know why it would fall into this line since I'm manually setting the UIT off of G.UIT.O in the code

final jewel
#

calculate = function(self, card, context)
-- From VanillaRemade (so thx VanillaRemade)
if context.last_scoring_step and context.cardarea == G.hand and context.other_card == card and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = function()
if SMODS.pseudorandom_probability(card, 'giga_bluePlus', self.config.extra.odds, self.config.extra.chances, 'bp_prob') then
SMODS.add_card({key = 'c_black_hole'})
else
if G.GAME.hand_played then
local _planet = nil
for k, v in pairs(G.P_CENTER_POOLS.Planet) do
if v.config.hand_type == G.GAME.hand_played then
_planet = v.key
end
end
if _planet then
SMODS.add_card({key = _planet})
end
G.GAME.consumeable_buffer = 0
end
end
return true
end
}))
return { message = localize('k_plus_planet'), colour = G.C.SECONDARY_SET.Planet }
end
end,

#

I'm not able to make this work

chrome widget
red flower
#

i wouldnt mind the the crash logs printed the whole table honestly lol

chrome widget
#

The issue here is that I need to recalculate for switching to decks that don't have an artist credit, otherwise it doesn't orrectly reset the width/height of the main description element and it leaves this weird gap

#

But for whatever reason, attempting to recalculate the UIBox just causes a general failure

final jewel
#

What is this

red flower
red flower
final jewel
red flower
#

final_scoring_step also doesnt haave cardarea == G.hand or other_card btw

#

i dont think that code is causing that warning

final jewel
#

oh

red flower
#

unless im missing something

red flower
#

im guessing when switching to one without

chrome widget
#

Always crashes

red flower
#

hmm

final jewel
glad island
chrome widget
#

my vague assumption is that it has something to do with the other nodes here, since it's calling a very top level UIBox returned from G.UIDEF.run_setup_option(). Each of them has an update function that replaces one of the UIBoxes here when the deck selection is changed (and I hate how this is setup, it feels so jank), but the're all running basically simultaneously

#

My artist credit is added as a third row beneath the name Movable() and the Back:generate_UI() call

azure laurel
#

hey can i make another question, how i can make a joker alter the consumables, jokers or shop slots? like juggler or the drunk

daring fern
azure laurel
#

and in the config tab?

azure laurel
azure laurel
# daring fern

so i dont need to put the modifications to the config tab?

azure laurel
#

thaks for the help

vast night
latent perch
rotund sable
#

when are we going to butcher talisman?

knotty compass
#

Is there a place that explains balala shaders well? I wanna try doing something with them but it just looks so intimidatingg

distant junco
#

how can i change the enhancement of a card?

short girder
#

can vouchers have calculate?

red flower
red flower
distant junco
#

cool

short girder
# red flower yes

if i just put the calculate function does the game automatically understand that i want it after the voucher has been redeemed

red flower
#

yes

#

it calculates when it's in the voucher area

distant junco
#

how can i check if a card has an enhancement

ivory citrus
#

Hi, me again. This is my first time trying do enhancement, and I don't know why it's not working.
The error message says it's something related to the atlas.

cursive gazelle
#

Add
atlas=“modprefix_atlaskey”,

dense ginkgo
#
    config = {
        extra = 2,
        choose = 1, 
    },

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.choose, card.ability.extra } }
    end,

    weight = 0.9,
    cost = 4,
    kind = "BTCTPack",
    
    create_card = function(self, card, i)
        ease_background_colour(HEX("cc3b49"))
        return SMODS.create_card({
            set = "Batrocities",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = false,
        })
    end,
    select_card = 'jokers',

    in_pool = function() return true end
}

Does anybody know why this booster pack is crashing balatro?

cursive gazelle
#

What’s the crash

short girder
#

folks, can i add a string.find(v,'certainPrefix') to a for k,v in pairs(G.P_CENTERS) loop to check if something has a certain prefix in its key?

ivory citrus
red flower
#

(also it would be k not v)

short girder
short girder
#

alright this should work

red flower
cursive gazelle
#

Its capital A

#

Lua is case sensetive

chrome widget
normal crest
cursive gazelle
#

Just incase

red flower
chrome widget
#

????? wuh

#

let me remove all my custom code and try it

red flower
#

i think the problem might be something else, like in the UIBox you're adding as an object

short girder
#

im going to assume this isnt a me problem since it doesnt say stack overflow

chrome widget
#

nope yeah it still crashes on my end for whatever reason

#

maybe something in the changes I made to Back:generate_UI()

vernal path
#
[SMODS modularous "modularous.lua"]:21: Error reading file 'content/extra.lua' for mod with ID 'modularous': Could not open C:\Users\legom\AppData\Roaming\Balatro\Mods/modularous/content/extra.lua in mode r```
why would this crash happen? The file exists, and it doesn't crash if i dont try to load it.
#

is it because its open in another program (vs code)? It's never had an issue before

red flower
distant junco
short girder
#

okay this is the third time the game has crashed out of memory issues when it hasnt done anything like that in ever im assuming its a me problem

red flower
vernal path
normal crest
distant junco
void socket
#

hey so can anybody help me my face card textures aren't being loaded

short girder
#

holy shit do i have a ransomware what the fuck

#

my cpu is at 100% with memory at 92

void socket
#

`
local atlas_key = 'mc_atlas'
local atlas_path = 'mc_lc.png' -- Filename for the image in the asset folder
local atlas_path_hc = 'mc_hc.png' -- Filename for the high-contrast version of the texture, if existing

local suits = {'hearts', 'clubs', 'diamonds', 'spades'} -- Which suits to replace
local ranks = {'Jack', 'Queen', 'King'} -- Which ranks to replace

local description = 'The Mechanism' -- English-language description, also used as default

-- Registers the mod icon
SMODS.Atlas { -- modicon
key = 'modicon',
px = 32,
py = 32,
path = 'modicon.png'
}

SMODS.Atlas{
key = atlas_key..'_lc',
px = 71,
py = 95,
path = atlas_path,
prefix_config = {key = false},
}

if atlas_path_hc then
SMODS.Atlas{
key = atlas_key..'_hc',
px = 71,
py = 95,
path = atlas_path_hc,
prefix_config = {key = false},
}
end

for _, suit in ipairs(suits) do
SMODS.DeckSkin{
key = suit.."_skin",
suit = suit:gsub("^%l", string.upper),
ranks = ranks,
lc_atlas = atlas_key..'_lc',
hc_atlas = (atlas_path_hc and atlas_key..'_hc') or atlas_key..'_lc',
loc_txt = {
['en-us'] = description
},
posStyle = 'deck'
}
end
`

short girder
#

i have three windows open??

normal crest
#

just restart your pc

dense ginkgo
short girder
#

yeah best course of action

normal crest
#

Happens to me as well, after opening and closing balatro a lot, probably a memory leak somewhere

short girder
# dense ginkgo

can you copy the crash and send it here instead of screenshotting it

ivory citrus
# cursive gazelle SMODS.Atlas

I did as you said, and when the error messages appeared, I entered what it asked for, and although it no longer crashes, but the image I need does not appear.

normal crest
cursive gazelle
normal crest
#

the SMODS.Atlas call goes before you define the enhancement

chrome widget
# red flower i think the problem might be something else, like in the UIBox you're adding as ...

okay yeah I turned off all my mods and added this as an override in SMODS, still crashes

G.FUNCS.RUN_SETUP_check_back = function(e)
  if G.GAME.viewed_back.name ~= e.config.id then 
    --removes the UI from the previously selected back and adds the new one

    e.config.object:remove() 
    e.config.object = UIBox{
      definition = G.GAME.viewed_back:generate_UI(),
      config = {offset = {x=0,y=0}, align = 'cm', parent = e}
    }
    e.config.id = G.GAME.viewed_back.name
    e.UIBox:recalculate()
  end
end```
#

exact same place

red flower
#

there's nothing that is using the same object you remove right?

ivory citrus
chrome widget
short girder
#

In this case, replace atlasName with your atlas' name.

#

Let's go!!! It worked!!

short girder
normal crest
red flower
chrome widget
#

rather flummoxed. befuddled. confused. hoodwinked. bamboozled

ivory citrus
#

I'm very thankful

distant junco
red flower
#

you need to get the card you want but it depends on your code

vernal path
#

is it possible to make this text render correctly? The effects listed in the (currently) bit are picked from the loc vars

vernal path
#

damn, very sad

#

oh well

red flower
#

either use main_end or use key to change descriptions in a localization file

vernal path
#

well that would be 9 localizations for the same joker. I suppose I could just make it c:attention and leave it as that

distant junco
red flower
#

context.other_card

red flower
#

code is free

distant junco
red flower
chrome widget
#

huh

distant junco
red flower
distant junco
#

for now, im just making stone cards into glass cards, but end goal, just the first scored stone card

chrome widget
red flower
chrome widget
#

Since one level up, if it was somehow adding there, would be the third child of four, made fourth of five with the added cardsleeve earlier

red flower
#

yeah

chrome widget
#

But organization wise it seems correct? Because if it added it one level up, the text box would probably end up somewhere around here

#

Since it'd be a row node added in the third slot, expecting a column
Deck > desck > new added node > stake colum

short girder
#

Folks, anyone know how to handle orbital tag randomizing?

red flower
#

add_tag(Tag("key", false, 'Small'))

#

iirc

chrome widget
#

And the topology ultimately looks correct

| UIBox | - ID:1470 w/h:9.9/7.964
  | ROOT | - ID:1556 w/h:9.9/7.964
    | R | - ID:1514 w/h:9.9/3.8
      | R | - ID:1513 w/h:8.8987804878049/3.64
        | C | - ID:1512 w/h:8.8987804878049/3.64
          | C | - ID:1472 w/h:0.6/3.44
            | T | - ID:1471 w/h:0.19/0.415 TEXT:<
          | C | - ID:1509 w/h:7.2987804878049/3.44
            | R | - ID:1487 w/h:7.2987804878049/3.3
              | R | - ID:1486 w/h:7.2987804878049/3.3
                | C | - ID:1485 w/h:7.2987804878049/3.077868
                  | C | - ID:1475 w/h:2.0487804878049/2.777868
                    | R | - ID:1474 w/h:2.0487804878049/2.7512195121951
                      | O | - ID:1473 w/h:2.0487804878049/2.7512195121951 OBJ:CardArea  -- deck visual
                  | C | - ID:1482 w/h:4.2/2.777868
                    | R | - ID:1477 w/h:4/0.45
                      | O | - ID:1476 w/h:0/0 OBJ:UIBox  -- name
                    | R | - ID:1479 w/h:4/1.12
                      | O | - ID:1478 w/h:3.57/1.12 OBJ:UIBox  -- description
                    | R | - ID:1481 w/h:4/0.807868
                      | R | - ID:1480 w/h:4/0.807868    -- this is my node here, made a row node when back has no artist
                  | C | - ID:1484 w/h:0.45/2.777868
                    | O | - ID:1483 w/h:0.45/2.7 OBJ:UIBox  -- stake column
            | R | - ID:1508 w/h:7.2987804878049/0.14
              | B | - ID:1488 w/h:0.1/0.1
              | B | - ID:1489 w/h:0.1/0.1
              | B | - ID:1490 w/h:0.1/0.1
              | B | - ID:1491 w/h:0.1/0.1
              | B | - ID:1492 w/h:0.1/0.1
              | B | - ID:1493 w/h:0.1/0.1
              | B | - ID:1494 w/h:0.1/0.1
              | B | - ID:1495 w/h:0.1/0.1
              | B | - ID:1496 w/h:0.1/0.1
              | B | - ID:1497 w/h:0.1/0.1
              | B | - ID:1498 w/h:0.1/0.1
              | B | - ID:1499 w/h:0.1/0.1
              | B | - ID:1500 w/h:0.1/0.1
              | B | - ID:1501 w/h:0.1/0.1
              | B | - ID:1502 w/h:0.1/0.1
              | B | - ID:1503 w/h:0.1/0.1
              | B | - ID:1504 w/h:0.1/0.1
              | B | - ID:1505 w/h:0.1/0.1
              | B | - ID:1506 w/h:0.1/0.1
              | B | - ID:1507 w/h:0.1/0.1
          | C | - ID:1511 w/h:0.6/3.44
            | T | - ID:1510 w/h:0.19/0.415 TEXT:>
    | R | - ID:1539 w/h:9.9/2.2
      | R | - ID:1538 w/h:8.9/2.2
        | O | - ID:1515 w/h:8.9/2.1 OBJ:UIBox
    | R | - ID:1541 w/h:9.9/0.9
      | O | - ID:1540 w/h:0/0 OBJ:OTHER
    | R | - ID:1555 w/h:9.9/1.064
      | C | - ID:1550 w/h:2.4/1.064
        | C | - ID:1549 w/h:1.91/0.61
          | C | - ID:1544 w/h:1.2/0.41
            | T | - ID:1542 w/h:1.1/0.2075 TEXT:Seeded Run
            | B | - ID:1543 w/h:0.1/0.1
          | C | - ID:1548 w/h:0.41/0.41
            | C | - ID:1547 w/h:0.41/0.41
              | C | - ID:1546 w/h:0.41/0.41
                | O | - ID:1545 w/h:0.35/0.35 OBJ:Sprite
      | C | - ID:1553 w/h:5/1.064
        | R | - ID:1552 w/h:1.408/0.664
          | T | - ID:1551 w/h:1.408/0.664 TEXT:PLAY
      | C | - ID:1554 w/h:2.5/1.064
#

Ugh this is a headache

#

I've tried delaying the recalculate with an event but some issue. Some reference gets fucked up in setting these nested UIBoxes

ripe thicket
#

how do I make it so that a consumable spawns a random joker that has a specific badge?
like I have this irl grass consumable and I want it to summon a random joker that has the "IRL Jimbo" badge when used

cursive gazelle
red flower
cursive gazelle
#

Guessing the group is a table

chrome widget
#

Other.........

#

Huh

red flower
chrome widget
#

What is that, I have no clue. Once I get back from the store I can look at the code

red flower
#

my guess was the stake selection but i removed it entirely and it was still happening

#

so idk

chrome widget
#

Oh you're right that would be between it. Because below it is the seeded run text, the toggle, and then the play button

#

So maybe Stake Selection is occurring strangely later and there's a frame in there where it hasn't been rebuilt?

ripe thicket
cursive gazelle
#

You need to make a global table that contains all the keys for those jokers and call it in create_card or add_card to get a random one

red flower
#

oops didnt send the image

#

<@&1133519078540185692>

#

ty mods

#

sneaky

chrome widget
#

Toggle meaning the actual toggle control or the rows that appear when you hit the toggle?

#

(also thank you for helping me debug this, I probably would've figured it out on my own but I do appreciate it because I've not been very effective)

red flower
#

the rows appear when you hit the toggle, the toggle itself is not the problem

#

i just removed it and it stopped crashing
now i dont know how to fix that

chrome widget
#

So basically, the game is clearing the rows without setting the UIT setting to not be an object when they're not visible

#

And by default they're not there, so there's an object node that will crash on recalculate because it hasn't been told not to look for an object by just making it a row or column or wharever

#

Given that, I probably have a decent solution

red flower
#

again?? <@&1133519078540185692>

chrome widget
#

Kills you kills you

#

Mr. Electric, KILL HIM

karmic creek
#

long day in the spam mines

fossil nebula
#

how do i make joker that gives a specific booster pack?

hallow slate
#

How would I properly, in loc_vars, put something like "2 of Clubs"? Like if I wanted a random rank/suit combo

frosty rampart
#

check how The Idol behaves in vanillaremade

frosty rampart
fossil nebula
ripe thicket
daring fern
frosty rampart
#

yea that works if you want to open it directly (i think). if you want it in the shop, do this instead

if context.starting_shop then
  G.E_MANAGER:add_event(Event({
    func = function()
      local booster = SMODS.add_booster_to_shop('p_modprefix_boosterkey')
      booster.ability.couponed = true -- only use these two lines if you
      booster:set_cost()              -- want the booster to be free
      return true
    end
  }))

  -- this return is also optional, only if you want the joker to give you a message
  return {
    message = [your message],
    colour = [your color]
  }
end
normal crest
ripe thicket
daring fern
fossil nebula
daring fern
ripe thicket
#

thank you all for the help :D

fossil nebula
#

and i put local in local_vars and the rest before return?

daring fern
distant junco
#

how can i change the rank of a card

daring fern
daring fern
#

Replace Ace with the key of the rank.

distant junco
#

Swag

fossil nebula
#

the round end screen goes up and you can't choose cards

daring fern
fossil nebula
daring fern
fossil nebula
daring fern
# fossil nebula how should that work?
G.E_MANAGER:add_event(Event({
    func = function()
        G.E_MANAGER:add_event(Event({
            func = function()
                local booster = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2, G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS.p_modprefix_key, {bypass_discovery_center = true, bypass_discovery_ui = true})
                booster.cost = 0
                G.FUNCS.use_card({config = {ref_table = booster}})
                booster:start_materialize()
                return true
            end
        }))
        return true
    end
}))
fossil nebula
#

oh wait nvm

#

im dumb

fossil nebula
daring fern
fossil nebula
#

like it works now

#

so if there's no way to do that it's still fine

#

but it would just look better

rough furnace
#

chat

daring fern
# fossil nebula but it would just look better

Maybe you could set G.STATE_COMPLETE = true outside of the event, then move the code into only 1 event instead of 2 and hook G.FUNCS.end_consumeable and set G.STATE_COMPLETE = false?

fossil nebula
#

to the event?

daring fern
# fossil nebula to the event?

The hook would go outside the joker and the code inside the joker would be something like this:

G.STATE_COMPLETE = true
G.E_MANAGER:add_event(Event({
    func = function()
        local booster = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2, G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS.p_modprefix_key, {bypass_discovery_center = true, bypass_discovery_ui = true})
        booster.cost = 0
        G.FUNCS.use_card({config = {ref_table = booster}})
        booster:start_materialize()
        return true
    end
}))
fossil nebula
fossil nebula
#

it works

#

but i have other questions

#

how do i make this booster not appear in shops and can i make that it gives only negative cards?

daring fern
frosty rampart
#

first one: make its in_pool function always return false

fossil nebula
#

Thx

errant arrow
#

so im a little slow, smods's wiki has an area for repeating joker effects... it's under Calculate Functions

chrome widget
#

This was the fix. Setting the node that contains the seed textbox to be a row when its object is not valid, and then back to an object when its object will become valid. Not doing so in the vanilla code is arguably bad practice

local ref_toggle_seeded = G.FUNCS.toggle_seeded_run
function G.FUNCS.toggle_seeded_run(e)
    if e.config.object and not G.run_setup_seed then
        e.config.object:remove()
        e.config.object = nil
        e.UIT = G.UIT.R
        e.UIBox:recalculate()
    elseif G.run_setup_seed then
        e.UIT = G.UIT.O
    end

    return ref_toggle_seeded(e)
end```
red flower
#

great job

fallow breach
#

is there an easy way to add random cards between separate pools, like a joker that generates a planet or a tarot, or a joker that generates a tarot or a spectral

chrome widget
#

CattoBlush🙇‍♀️ thank you v much

red flower
pure salmon
#

is this allowed before i test

chrome widget
#

youll want to check if it has in_pool first

#

otherise you could try to call a nil reference

red flower
#

also it would be center:in_pool()

pure salmon
#

got it

#

wait how would i nil check for a function

misty radish
#

How would I use an image as a rarity badge?

frosty rampart
red flower
#

if enhancement_center.in_pool and enhancement_center:in_pool()

rocky plaza
#

how would i make a certain type of enhancement not show up in a standard pack? make in_pool() always return false?

pure salmon
#

oh yeah because everything in lua is a variable

red flower
#

unless you want it to show up naturally somewhere else

pure salmon
misty radish
pure salmon
#

not really a typo

rocky plaza
misty radish
pure salmon
#

no but it was more a misunderstanding than it was a mistyping

misty radish
#

Ah
Okay

spare elk
#

been a while since i last asked smth here, is it possible to make eternal consumables? if so, how

frosty rampart
#

what exactly is the goal?

spare elk
#

a consumable that can't be sold

spare elk
#

oh dang
you can tell how ancient i am for not knowing a single line of code lol

fallow breach
#

so i've got some issues

#

it works as intended mostly, but it fills up every empty slot instead of only creating one card

#

it also lags the shit out of the game when the boss is rerolled

#

and will crash it without even showing an error screen if i reroll enough

manic rune
#

why are you doing context stuff in there?

fallow breach
#

that's all under calculate

manic rune
#

-# not SMODS.calculate_context, the code below it

#

what the

#

please dont hook in calculate

fallow breach
#

where do i hook then...