#💻・modding-dev

1 messages · Page 662 of 1

daring fern
#

No, assert crashes the game if the first input is nil or false, but pcall would prevent that crash.

clear ocean
#

yeah pretty much

#

again you can ask the dilly man himself

daring fern
clear ocean
#

the only change i made was switch it to an table since i like to organise my items so i didn't have to do something like 00_JOKER 01_JOKER

#

programming is weird

#

looking at system monitor (gnome task manager in layman terms) and nothing seems to be effected

#

i can try to restart which would roll out anything remaining in memory

#

okay restarting didn't fix the problem

#

wait

#

im stupid

#

i understand it now

#

talisman was typed as talismman in main

mystic river
#

that would have an effect yes

red flower
#

(im gonna guess no)

clear ocean
#

yeah i half haphazardly switch JOY with something

#

is there one effect i can use

red flower
#

effect is a color from my mod

clear ocean
#

OHH

red flower
#

you want G.C and "CHIPS"

#

it's called effect because of effect monsters

clear ocean
modern kindle
#

i just woke up so apologies but am i seeing i didnt do anything wrong after all

clear ocean
#

yeah you didn't

modern kindle
#

peak

#

im still awesome

clear ocean
#

but is somethingcom right or wrong about the pcall and assert?

modern kindle
#

uhh, i dont think theres necessarily anything wrong about it, i use pcall and such within my own mod pretty often
im of mind if it works it cant be wrong

clear ocean
#

OHH i see why

#

do i get rid of the whole SPLASH_BACK thingy if i want to keep the vanilla colours

red flower
#

yes

#

also the card thing can be replaced by a new system next smods

clear ocean
#

i heard it isn't on the release build yet and you shouldn't be developing with the dev branch

red flower
#

you can develop on dev, just don't release the mod or have your own dev branch

thorn ingot
#

uuu, I was looking around and now I see what you mean. Very new to this still.

How could I make it so all of those things trigger?
I could not find a lot of info about the modifier thingy.

clear ocean
red flower
clear ocean
#

cheers as always nh

#

did i do it right? dev build is 1416a correct?

red flower
#

yes

faint yacht
#

menu_cards, not menu_card.

clear ocean
#

once again me missing or mistyping one character/key comes to strike again

frosty rampart
#

yayyy menu_cards mentioned

#

so glad it's proving helpful

daring fern
#

short mauve
#

I always forget that damn ,

clear ocean
#

does this make sense?

#

decided to get rid of the tab since i probably won't need a whole lot to configure

clear ocean
#

joker concept idea: cotton-eye joe/jim/jimbo, idk the effect though

hardy vessel
#

Question about, I guess any files. Is it possible to see if a certain file exists? For example, if a custom sound exists?

tidal hemlock
clear ocean
#

Maybe I’ll think about it but I do like the idea of selling the card since the song is basically where did he come from where did he go

orchid thunder
#

anyone know were the draging knowledge for the shaking of the card is held

#

i want to make a rigid drag

near coral
#

When a new consumable type is added does the collection automatically update to have the extra menu housing the consumable types or no

#

Or is it manual

#

Cuz I've seen the menu across many mods but I'm asking to be safe

near coral
#

Ah ohkay

clear ocean
#

Maybe back then but it’s an automatic thing now

near coral
#

Also is the best way to turn a joker into a different joker to destroy the original and spawn the new one in

#

Like it does what's intended but I'm worried it'd accidentally trigger or scale some other vanilla or modded stuff

tulip pecan
#

how would I convert a consumable key like c_strength to the display name of the card? I tried using localize("c_strength") but it doesn't have the intended result.

tidal hemlock
near coral
#

Are you saying for me to borrow code from it?

glass scaffold
daring fern
red flower
near coral
#

I was asking if they were telling me to borrow fusion code or not

glass scaffold
near coral
#

Like does making jimbo into cavendish keep them as jimbo but with cavendish's abilities or are no remnants of jimbo left after it's engaged

near coral
#

Ohohkay

tulip pecan
#

Is there a way to make these two nodes display on top of each other?

            {
                n = G.UIT.C,
                config = { align = "bm", padding = 0.02 },
                nodes = {
                    {
                        n = G.UIT.C,
                        config = { align = "m", colour = colour_tarots, r = 0.05, padding = 0.05 },
                        nodes = {
                            { n = G.UIT.T, config = { text = ' ' .. uma_tarots_named .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.3, shadow = true } },
                        }
                    },
                    {
                        n = G.UIT.C,
                        config = { align = "m", colour = colour_planets, r = 0.05, padding = 0.05 },
                        nodes = {
                            { n = G.UIT.T, config = { text = ' ' .. uma_planets_named .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.3, shadow = true } },
                        }
                    }
                }
            }
        }```
red flower
primal robin
#

but displaying like this is better in this case by the way

red flower
#

probably would look ugly if the cards have long names

mystic river
#

(the fused jokers are changed properly but that's different)

near coral
#

Is it possible to set a predetermined function as crossmod support
Like if I wanna turn something into ortalab jester upon use would that be possible as long as ortalab is enabled

#

And the function be disabled if ortalab is disabled too

mystic river
#

in this case I'd want one function to do the check, and another to do the transformation

red flower
#

ok thank you thunk

near coral
vagrant bloom
#

wait

#

is that localthunk?

red flower
#

are you talking about what i said

vagrant bloom
#

yes

red flower
#

im saying that code is funny because it does nothing

#

which was written by thunk

vagrant bloom
#

oh lol

mystic river
#

it would if anything could change the status of disabled!

red flower
#

it would have been helpful to me if that were the case

#

im trying to make this

wintry crater
#

is there a place where i can see every single context listed cause i keep having to search through code to find the specific context im looking for cause i can never remember what theyre called

#

do i just memorize it at some point

red flower
final jewel
#

if card.ability.extra_value > 0 then how do I check if the sell value is greater then 0 cause that isnt working

red flower
#

card.sell_cost

hardy vessel
#

Is it possible to get a list of currently installed mods?

red flower
#

SMODS.Mods

#

SMODS.mod_list also

rapid stag
#

hmm

#

how does debugplus force unlock and discover cards?

hardy vessel
wintry crater
#

i know this is a really stupid question but why cant i print randomBlind

frosty rampart
#

it's outside the loc_vars
randomBlind only exists within the loc_vars function, because it's local

daring fern
#

fading rivet
#

How could I scale a value in G.GAME whenever a specific joker is created in the shop?

frosty rampart
#

calculate during context.modify_shop_card
context.card is the card that was just created in the shop, check if it is the specific joker

#

(it's called modify_shop_card because you can also use it to modify the card by e.g. applying editions/stickers, changing its cost, etc. much like the edition tags)

fading rivet
#

thx

fading rivet
frosty rampart
#

i don't think so
i assume you just want this in a mod calculate function, unless you only want it to increment if the joker is created while you have some other joker

fading rivet
#

its this

fading rivet
frosty rampart
#

it was added back in august
do this just as its own code, not inside any jokers or anything

SMODS.current_mod.calculate = function(self, context)
  if context.modify_shop_card then
    G.GAME.whatever = G.GAME.whatever + 1
  end
end
fading rivet
#

thx

clear ocean
#

any way to add a -x# chips keyword

thick drift
#

does anyone have experience with making a new card area? or is there somewhere in the documentation that I missed that goes over this stuff?

red flower
#

i have

#

there isn't documentation

thick drift
#

could I take a look at the project where you did it? Or is it part of vanilla remade?

red flower
#

the dev branch is better because it uses the new smods function for them

thick drift
#

awesome, thanks!

red flower
#

i should probably move that to the other file

stuck ore
#

What is the limit for how many frames an animated joker can have because when I give them a large amount it becomes the flag of Poland

umbral zodiac
#

it What

red flower
#

i don't think there's a limit what is the problem

stuck ore
#

Red and white blocks

#

Idk but I couldn’t get it to wrap so I just put all the frames in a line

#

Around twenty worked but when I went to around a hundred or more boom Poland

red flower
#

maybe the size is too big

stuck ore
#

Probably

#

I was thinking there might be some issue because the width of the image but since I can’t make it wrap back to read the image of a second row as part of the animation either way it becomes an artificial limit no?

red flower
#

i dont think it's the width but anyway i haven't heard about anyone having this issue before i couldn't tell you

stuck ore
#

Damn why do I gotta be a pioneer to Poland

red flower
#

you are sure the atlas is defined correctly right

stuck ore
#

I wouldn’t change the name of the file and when I adjusted the length of the image but cropping off enough frames it would work but when it was just the image it would fail

#

Also changing the px and py gave more red strips

clear ocean
#

i can't believe this is the first joker i made with art for this mod

#

idk what the name or effect should be

red flower
#

i just tried this and it worked fine maybe i didn't do enough

stuck ore
#

Sure one sec I’m on my phone

#

Well when I tried the image was 800 frames

red flower
#

oh ok i tried 100

stuck ore
#

Because I wanted to see how long of a video would work so it was like thirty second

clear ocean
#

Joker idea: the animation atlas is just like movie from start to finish, idk the effect or movie

stuck ore
#

If I can get this to work you bet imma do the bee movie

#
    key = "jokers_53",
    path = "animation.png",
    px = 71,
    py = 95,
    atlas_table = "ANIMATION_ATLAS",
    frames = 898,
}```
clear ocean
#

898 frames 👀

red flower
#

yeah i would guess there's a size limit for how much love2d can load or something

stuck ore
#

i will say that the frames itself weren't the issue because when it was the same amount of frames but in a brick as opposed to a line it went for a bit then went black

clear ocean
#

i mean you could do a speed up one like a lot of gifs

red flower
stuck ore
#

oh thats what I did I just started skipping frames

red flower
#

you should just try to do it manually with drawsteps

clear ocean
stuck ore
red flower
#

yes

#

but the whole image would load anyway

stuck ore
#

yeah if I figure out the limit I can seperate the rows by just simple changing the atlas when something happens but I wanted to see if I could get it to be seamless which was a hassle

clear ocean
# clear ocean

this could be a hot take: ken shouldn't had been painted as this grand villain just because apparently it is a bad thing to get cucked by a bee jerry seinfield when you have a severe bee allergy

#

might just me saying that though...

red flower
#

you can get it to be seamless by just copying the code the animaeted atli use but you make it jump a row down when it gets to the limit

stuck ore
stuck ore
red flower
#

in the vanilla code

#

AnimatedSprite:animate im pretty sure

stuck ore
#

sorry I haven't actually access the vanilla code before what is the directory of it?

red flower
#

it's under Mods/lovely/dump

#

i think the file is like engine/animatedsorite or something

pastel kernel
#

what's the preferred way to manipulate joker slots?

stuck ore
red flower
#

why is your lovely dump not dumping

stuck ore
#

I'm not sure why it's constipated

red flower
pastel kernel
#

mod can be card.ability.extra?

red flower
red flower
pastel kernel
#

yes but can it be c.a.e?

stuck ore
#

oh when I ran balatro it began dumping

red flower
pastel kernel
#

is it automatic removal when joker is removed?

red flower
#

what do you mean

clear ocean
#

new joker done

#

@tidal hemlock since you inspired the idea of selling the card for an effect how do you want to be credited in the mod credits

#

uh okay one issue

#

is there a way to prevent it from applying the negative onto itself

stuck ore
# red flower what do you mean

and do I just create a copy of the animatedsprite.lua in my mod, change the key of the ANIMATION_ATLAS to something else, give it a clause to wrap around, load it and it should be prioritized?

red flower
#

no

clear ocean
#

maybe an additional check in eligible_card where it skips if it has ability.extra.cotteneye_rounds

red flower
# red flower no

you should copy the code in that function i said and use an SMODS.DrawStep to replicate it for your joker

stuck ore
#

gotcha

red flower
pastel kernel
red flower
#

if you're adding slots in add_to_deck then yes you do

#

if it's tied to a card you can also just do card_limit = mod in the config iirc

pastel kernel
#

i'm currently doing some jokers for starspace, there's this one joker that gives joker slots every 2 skips, the thing i'm asking about is if i still have to use remove_to_deck to get rid of the added joker slots.

clear ocean
#

clearly i am not to be trusted with loop statements

clear ocean
#

is there a better way to check it isn't itself or another "cotten-eye jim"

red flower
#

card_you_are_checking.config.center_key ~= "j_prefix_cottoneye"?

clear ocean
#

i can try that

stuck ore
red flower
#

yeah i do not recommend copying mine for the record

#

maybe only the drawstep structure

clear ocean
#

so would this be fine?

stuck ore
#

It would be impossible, sorry but I have to ask, why did you create an entire animation choreography from six frames?

clear ocean
#
            if #jokers > 0 then
                local eligible_card
                while true do
                    eligible_card = pseudorandom_element(SMODS.Edition:get_edition_cards(G.jokers, true), 'cottoneye')
                    if not eligible_card.config.center_key ~= "j_gros_cottoneye" then break end
                end
                if eligible_card ~= nil then
                    eligible_card:set_edition({ negative = true })
                    eligible_card:juice_up(0.3, 0.5)
                end
                return { message = localize('k_active') }
            else
                return { message = localize('k_no_other_jokers') }
            end
clear ocean
#

yeah... idk if that worked 💔

#

wait i can see why

#

if not eligible_card.config.center_key ~= "j_gros_cottoneye" then break end

if NOT center_key DOES NOT cotten eye jim

red flower
#

yeah

#

you can't do not a == b anyway

clear ocean
#

how it feels

#

it works!

formal vessel
formal vessel
clear ocean
#

this was made in 2013

formal vessel
formal vessel
clear ocean
#

everything works except if all jokers are cotten eye

#

and it actually crashes the game not a soft lock lmao

red flower
#

you shouldn't do a while loop

#

make a list of all eligible jokers and pick from that

clear ocean
#

lowkey would be funny if i leave it and make it a divine punishment for having jokers where the entire point is to sell to make another joker negative

#

SMODS.Edition:get_edition_cards(G.jokers, true) so probably with G.joker make a table and then cycle out the cotten eye jimbos and then apply the negative

#

actually i think i have a better idea

thorn ingot
#

hi again, guys. I got the stake working. (It was surprisingly easy 😭 ).

      calculate = function(self)
     
          if G.GAME.round_resets.ante % G.GAME.win_ante == 0 
          and G.GAME.round_resets.ante >= 2 then
          G.GAME.modifiers.scaling = (G.GAME.modifiers.scaling or 1) + 1
        end
      end
})```

But now it doesn't reset when restarting a run for some reason. It scales in between runs.
I thought g.game was for that.
clear ocean
#

just add another or condition

#

so like this

red flower
#

if so don't

thorn ingot
#

damn, didn't think about that.

red flower
#

it will add the function to the stake from then on in all future runs

#

it's not good practice to take ownership after the game loads

thorn ingot
#

oooh I see

red flower
#

also it's not good practice to have a calculate function without context checks

clear ocean
#

clearly that didn't work 💔

thorn ingot
#

Aight, thanks guys. Let me get back to it. balatroheart

red flower
#

what are you trying to do

clear ocean
#

okay so the point of the cotten-eye joe joker is that after two rounds (like invisible joker) you can sell it to make another joker negative but sometimes when you sell it, it both applies to either itself or another copy, and i don't want that to happen

red flower
clear ocean
#

oh

#

💔

thorn ingot
#

oh

clear ocean
#

sorry

thorn ingot
#

haha

#

I'm trying to make the blue stake increase the spectral pack rate (done, omg) and increase the score needed in the finisher ante.

It's surprisingly difficult to do for someone with my experience, not a lot of info.

clear ocean
#

okay when its just one it actually works?

#

it applies the "no other jokers" message

red flower
clear ocean
#

okay so its really weird

#

so if you have another cotten eye jim it just kinda applies to itself? weird

#

if you just one it seems to always pick another joker

#

i think what is tripping up is that i am not handling the detection of a cotten eye jim let me look

#

if G.jokers.cards[i] ~= card or G.jokers.cards[i].config.center_key ~= 'j_gros_cottoneye' then hold up

red flower
#
local options = {}
for _, jcard in ipairs(SMODS.Edition:get_edition_cards(G.jokers, true)) do
    if jcard.config.center.key ~= "j_gros_cottoneye" then
        table.insert(options, jcard)
    end
end
local pick = pseudorandom_element(options, "seed")
clear ocean
#

is this supposed to be and

#

maybe thats what is going on

thorn ingot
clear ocean
#

since G.jokers.cards[i] ~= card is true to the other cotten eye joes (i presume card is for itself) it doesn't matter if is or isn't cotton eye joe

#

hopefully this works

#

it works!

#

finally

#

it just works

#

thanks nh

reef bobcat
#

i copied shoot the moon's effect but i want to change from queen to steel cards

#

how do i do that?

#

i assume it has to do with changing

#

context.other_card:get_id() == 12

reef bobcat
#

ok i figured it out

#

but now i find

#

that the steel card mult applies before the +mult

#

but that's fine

#

cuz i can do another change

#

to xmult instead of +

clear ocean
#

Joker idea; Chewbacca (Jimbacca?) Defense, idk the effect

kindred niche
#

How would I make a seal that force triggers either all or a random joker

tulip pecan
#

Is there a context that I can use for cards in hand that trigger around the same time as glass cards breaking? I want to apply enhancements after the hand scores, but I've been unable to target it properly

limber aspen
#

How do I display negative chips on card's tooltip?

tulip pecan
tulip pecan
# wintry solar Use `context.after` probably

That’s what I’m currently using, and it technically works, but the juice up function triggers at the start of the hand played, as well as the visual of the enhancement changing, even if it isn’t included in scoring.

wintry solar
#

Add true as the third argument of your set ability call

tulip pecan
fervent rampart
#

My mod wont show up when I use a JSON file for it as SMODS recommends. I've compared to every other mod I have, I've rearranged the things inside, checked file paths, checked that it's a JSON. I have the latest SMODS and every other mod works. I can't spot the mistake as hard as I try.
FusionForce-v1.1.1\FusionForce.json

{
    "id": "FusionForce",
    "name": "Fusion Force",
    "display_name": "Fusion Force",
    "author": ["Minus", "LunaAstraCassiopeia", "amstd", "Gappie"],
    "description": "Adds 20 new Fusion Jokers",
    "prefix": "fuseforce",
    "main_file": "FusionForce.lua",
    "priority": 0,
    "badge_colour": "BD597A",
    "badge_text_colour": "FFFFFF",
    "version": "1.1.1",
    "dependencies": [
        Steamodded (>=1.0.0~BETA-0827a), 
        FusionJokers
    ]
}```
slim ferry
#

The mods in the dependencies list should be strings

daring fern
#

fervent rampart
#

Okay I unstringed them after looking at something out of date, oops. But that was the last attempt to get this to work. But focusing on the dependencies is when I spotted the missing comma after the ]. That was all it was.

primal robin
#

I love copying same utility functions over and over in every mod I made Lum

#

Maybe I should make a library or smth

versed swan
#

<@&1133519078540185692> scambot

exotic hedge
#

Killed

versed swan
#

Thx

fading rivet
#

Are the keys for G.GAME.modifiers.no_blind_reward Small, Big, and Boss?

fading rivet
#

thx

#

how could I force the reroll cost to the specific value while for one of my decks?

tidal hemlock
#

just "Tatsu"

daring fern
fading rivet
#

thx

clear ocean
daring fern
#

blazing helm
#

how to sleep? googles says love.timer.sleep(0.1) but timer is nil :/

slim ferry
#

sleep as in?

blazing helm
#

as in make the thread wait a bit before continuing

slim ferry
#

os.sleep exists to pause a program but idk how that works in threads

blazing helm
#

oki ill test it

#

nope also nil :/

#

ill just do the sleeping in js, lua sucks

primal robin
brazen kite
#

is there a way to disable the shine shader on custom stickers

fading rivet
#

cryptid does it for its code stickers

brazen kite
#

i figure it's possible with overriding the draw function but i have no clue how to approach doing that

#

ill look in cryptid's code

#

ok i figured it out

#

for anyone in the future looking for the answer to this here it is

blazing helm
#

how would one approach rendering text? i need text to appear above a joker but when the next bit of text needs to be renders i want the older ones to get smaller, move up and get a bit more transparent. it should also slowly fade out. iv done basically no rendering stuff and i have no clue where to get started or how to get started lol >.<

hushed field
#

You're in luck, because that used to be super difficult. Balatro's UI, by default, does not interact with the shaders that make anything move, or change opacity. The dev version, though, has a new feature called CanvasSprite, which allows you to create text objects (and more, but I'm not sure yet how features beyond that work) that you can impact with shaders, like the ones that make cards move, or appear and disappear. Biggest issue is going to be that it's not documented yet, due to the feature still being worked on.

#

In the smods code, search all for SMODS.CanvasSprite will show you how its set up, and canvas_text should show you the specific drawstep. That's mostly important for if you want to change the layer it gets drawn on

#

For a concrete example, I'd check #1406859448596828210. That's Meta's mod, and Meta's the person who largely made the canvassprite system. I think her dev branch has some usage for it

blazing helm
#

i may be stupid but i dont see CanvasSprite in SMODS TwT nor do i see it in mata's mod qwq

red flower
daring fern
blazing helm
daring fern
blazing helm
#

oh ok

mystic river
#

"dev version", with the code formatting, is a confusing way to describe it
it's just the latest commit on the main branch instead of the latest release

minor anvil
#

how do you make config ui for your mods? specifically in smods

blazing helm
#

im confused over the syntax, how do i make a new CanvasSprite? there a init func but it doesnt return anything. (i fear i may be to stubid to use this qwq)

minor anvil
#

yipee

#

thank you

#

time to learn dark magic

red flower
#

my other mod used to have a simpler config i used to show but it doesnt anymore lol

minor anvil
#

i honestly just want the checkboxes to enable or disable certain x10 aspects

hushed field
# blazing helm im confused over the syntax, how do i make a new CanvasSprite? there a init func...

It's not super simple to figure out without documentation, no worries. https://github.com/MetaNite64/High-Roller/blob/dev/content/Misc/d2.lua#L78 This is the snippet from Meta's code I used to figure it out. You define the CanvasSprite when sprites are made, basically, though you can also do it during a drawstep, as long as you don't reinitialize it every time it's checked

GitHub

A Balatro mod adding a new "Dice" consumable type. Contribute to MetaNite64/High-Roller development by creating an account on GitHub.

red flower
#

but the tabs make the code a bit more complicated

#

let me find an old commit without them

minor anvil
#

me want code :>

red flower
minor anvil
#

thank you

blazing helm
red flower
#

thats my motto

hushed field
#

Easier to just learn the framework piece by piece

blazing helm
hushed field
#

You should have some control over how fast it disappears, iirc

minor anvil
#

this is so goated

#

time to make the new balatro

#

||time to make the new facebook thing joke||

blazing helm
hushed field
#

Yeah, that makes sense. It's straight up just the right way to design your mod. The dev features are there so you can work with them so you don't have to implement them only after the dev release became the official release.

#

But I meant that attention text also has a way to ease it, no? I think you can make it variable how long it stays up

blazing helm
blazing helm
#

the main porb i have with it is that it overplays but thats just how its gonna be ig

mystic river
frosty rampart
sleek valley
#

i know i can just whitelist hearts with yes_suits but im a lil confused on how to write it .w.

red flower
#

deck = { yes_suits = { H = true } }

#

from what im reading

sleek valley
#

tyy

#

soo does the whitelist/blacklist not affect standard packs?

shell timber
#

id assume not? you can try and see what card sleeves double checkered deck does

viscid talon
#

how do you have a joker work during a specific ante

#

is there like code that goes, if ante == 8 or

shell timber
#

if you look at vremade a bunch of jokers use the current ante for part of their random seed

#

so you could check against that value

viscid talon
#

how

#

do u know any examples

#

wait couldnt i just do mult = 1

#

or would that not work

shell timber
#

uhh

shell timber
#

and you'll find it

viscid talon
#

just checked and nothing beyond unlocks

red flower
viscid talon
#

that too

#

idk what it means

dreamy thunder
#

it is the current ante

viscid talon
#

oke but im confused, how do i have code apply to a specific ante

#

for example a joker that gives +12 mult if its ante 12

#

but not work in any other ante

dreamy thunder
#
if G.GAME.round_resets.ante == 12 then
end
red flower
viscid talon
#

thankies

#

thats all i needed

#

wondering abt making a divine idol that gives xmult depending on the ante

#

idk if that makes sense

#

ah well

sleek valley
red flower
#

no

#

i dont think checkered bans suits?

#

ah this is the sleeve nvm

sleek valley
#

no, im just trying to make a challenge run that only lets you use hearts, no matter where from, including packs

red flower
#

this is what it does

#

you can hook SMODS.add_to_pool to accomplish this nowadays tho

#

let me write it

#
local smods_add_to_pool_ref = SMODS.add_to_pool
function SMODS.add_to_pool(prototype_obj, args)
    if prototype_obj.card_key and prototype_obj.card_key ~= 'H' then
        return false
    end
    return smods_add_to_pool_ref(prototype_obj, args)
end
sleek valley
#

but i dont wanna add to pool, if anything i wanna remove from it lol

red flower
#

ignore the name

#

this is what it does

sleek valley
#

never done this before so idk

red flower
#

no, this is lua

sleek valley
#

oohh mb

red flower
sleek valley
red flower
#

you can either make a custom challenge rule and check for that in the hook or check for the challenge name

#

i have a challenge that uses an add to pool hook coincidentally

sleek valley
#

well that's hella convenient for me then :D
time to bug test now but i assume i wont be back here for the night lol

fading rivet
#

is there a way to get a list of all the valid contexts

red flower
#

for what

fading rivet
#

have it select a random context to do effects on

red flower
#

i wouldnt recommend that

#

there are many context that are not intended for things to happen

fading rivet
#

so just create a list manually then

red flower
#

yes

fading rivet
#

ight

#

thx

red flower
#

you cant get them all anyway

junior tapir
#

Is there an established way of saving data between launches?

red flower
junior tapir
#

Currently to the whole profile, but I've been thinking about run too for another thing

red flower
#

for the run it's G.GAME

junior tapir
#

oh I think I meant, beyond the profile, like how the settings are unified for every profile

red flower
#

G.SETTINGS i think

mystic river
#

I'd put that in the mod config personally
but that works too, not sure what the benefits would be of doing it once way or the other

red flower
#

oh im assuming from watching the video they sent earlier that theyre doing an smodsless mod

#

if it's smods then yes save it to the config

clear ocean
granite jay
#

How do you retrieve and hook the functions for all vanilla seals?

granite jay
wintry crater
#

when randomBlind == 2 it should debuff all face cards but anytime i try to make something debuff any type of card it never works. im pretty sure it never passes the context.debuff_card check but i dont know how to make this work and all other effects from randomBlind work just fine

slim ferry
#

context.setting_blind might happen after debuffs are calculated

#

try looping over all cards to call SMODS.recalc_debuff or whatever its called on them after setting the effect type

#

Oh and it should be context.debuff_card:is_face(true)

split creek
#

any idea where in the original source the code to display the stake chip here is? I've been digging and can't find it

#

nevermind i literally just found it LOL

wooden belfry
#

so are those just extra run modifiers?

#

-# ooohhh, I had an idea

#

-# an option like that, where you get to apply challenge deck effects

split creek
#

How do I get the actual atlas object for an smods center? Need to pass to the sprite init call

red flower
#

G.ASSET_ATLAS[center.atlas]

daring fern
#

hardy vessel
#

is it possible to check if a certain sound exists by its key?

red flower
#

if SMODS.Sounds[key] then

#

for modded at least

hardy vessel
#

perfect, ty

near coral
#

Does anyone know where to get the code for making a new consumable type

#

I imagine it's just a template that you put the name and colors for

red flower
#

check vanillaremade tarots/planets/spectrals

orchid thunder
#

is there any easy way to stop something from being draged past a certin points

red flower
#

wdym by past certain points?

shrewd cobalt
#

Is it possible to apply audio effects to the current track? Like reverb, muffled effects, panning, volume, etc

faint yacht
shrewd cobalt
#

Wuh woah
Okay

hardy vessel
#

How would I go about using or hooking a function from another mod?

mystic river
#

same way you'd use or hook a function from your mod, or smods, or vanilla
just probably do a check first to confirm the other mod is loaded

near coral
#

What does one mean by the secondary color of a consumable type

mystic river
fading rivet
#

how do I change this image?

near coral
mystic river
fading rivet
#

thx

#

whats the size?

mystic river
#

34x34, just like tags

#

(indeed, the default icon is literally an uncommon tag)

hardy vessel
mystic river
#

if it's not global, you can't

#

lua works that way on purpose

viscid talon
#

joker+

mystic river
#

you could lovely patch the other mod to put the function into a global, if you desperately need this
and/or just copy the function into your mod

junior tapir
# red flower if it's smods then yes save it to the config

just found I was using SMODS to find the relative mod path for the cursor images (I meaaan, there probably is a way to do it without it). By saving to config, I don't have a config file but I've seen a config file being just 'return {stuff}', idk how it works on a lower level

tulip pecan
#

This code is fully functional, but I'm just curious as to why it gives me a warning. I know that I can just quick fix to disable the diagnostic, but I'd like to know why it's happening

mystic river
#

next ==?
that may not work as expected if quantum enhancements are in play

daring fern
mystic river
#

get enhancements is for when you want all of them, yeah

red flower
sleek valley
#

is this just cause it returns false or is it an actual bug?

red flower
#

lol

#

let me test

#

no?

#

it gets the suit prototype

sleek valley
#

sorry, what does that mean exactly?

red flower
#

i was replying to somethingcom dont worry about it

#

im testing

sleek valley
#

ah okie

red flower
#

ah because im stupid

#

this also filters out ranks

sleek valley
#

ah .w.

#

happens to the best of us lol

tulip pecan
red flower
# sleek valley happens to the best of us lol

the problem is that prototypes dont all have a way to differentiate them
anyway this works

local smods_add_to_pool_ref = SMODS.add_to_pool
function SMODS.add_to_pool(prototype_obj, args)
    if SMODS.Suits[prototype_obj.key] and prototype_obj.card_key ~= 'H' then
        return false
    end
    return smods_add_to_pool_ref(prototype_obj, args)
end
sleek valley
#

tyyy

#

:3

red flower
#

i just add or {} to get rid of the warning personally

daring fern
past kelp
#

what should I do to stop my custom challenges from being named ERROR when I load them

tulip pecan
past kelp
#

ok

round lion
#

does smods already have a set default blind atlas?

red flower
#

yes the vanilla one

round lion
#

so if i dont set a position, my blinds will just show up as small blind, right?

red flower
#

i think so

orchid thunder
#

anyone help me figure out why this is crashing o why a node would be nil

past kelp
#

i acceedentally made a cool joker out of a corrupted texture

#

here is the file after being corrupted and before editing (possibaly not a true corruption but IDK)

sage crater
#

how did that corrupt in that way

past kelp
#

my pixel art editing software crashed so some stuff was me trying to leave liike the stroke

fading rivet
#

Is there a template for sleeves anywhere?

#

like the art

past kelp
#

but i hoestly dont know how the dots and bar appeared or even the different backround

daring fern
fading rivet
#

ooh wait i'm stupid

#

is the green one a template

daring fern
fading rivet
#

mmm

slim ferry
#

im fairly sure the full green one is the only one to be explicitly stated as a base for art

#

Though if youre just making another coloured sleeve just use red prob

fading rivet
#

this is my deck art

#

I had no idea what do to

tepid crow
#

The green one's technically the template

#

but if you think it's easier to work on top of the red sleeve go ahead

#

I'd personally just take the gray border from the basic 5 sleeves, and put your green dithering effect in the middle

daring fern
umbral zodiac
#

is there a "best" way to get a cards raw description text

daring fern
umbral zodiac
#

thanks man

near coral
#

I kinda need it

#

For like

#

My mod n stuff

#

Y'know

fading rivet
#

like this

frosty rampart
# near coral Please

the primary colour is basically useless, i dunno what vanilla even uses it for
the secondary colour is used to color the button for the consumable type in the collection, the badge, and the special color that gets defined for the consumable type in text styling (like how you can have {C:tarot}, {C:planet}, etc)

near coral
#

In that case nobody ever sets primary color to anything meaningful I assume

#

They just go #FFFFFF and call it a day?

frosty rampart
#

i'd say just go with the same as secondary_colour

near coral
#

Alr

versed swan
#

what's the best way to revert a card's size (card.T) back to its regular size

wild patrol
#

the worst deck idea in history

frosty rampart
frosty rampart
near coral
wild patrol
#

Uncheckers your deck

#

it's actually pretty broken lol

#

I jsut breeszed through all 8 antes

#

gonna add some nerfs to it

versed swan
wild patrol
#

because it's a meme from a streamer friend of mine

#

kappa maybe have blood stone always appear as perishable

#

was thinking of making the final boss always disable hearts

#

so you have to work your deck around it

#

instead of just flushing to the end

#

dunno gonna have to pitch some ideas around see how it goes

near coral
#

Calling all the way back to when I asked how to turn jokers into other jokers, the code I was given works but it seems anticlimactic when transforming
What visuals/audio should be done to make it more impactful (like when a joker triggers for example)

primal robin
#

I was checking this original_T, it's kinda bad

#

Because of it deck is blinking in deck selection menu

versed swan
near coral
versed swan
#

not sure if it will account for other cards that are resized by default

#

eh whatever, it's good enough for the bare minimum that i need for this stupid effect i have to implement

primal robin
#

it stores sizes of card when it was created

#

and of you change what joker is it, it doesnt update at all

versed swan
#

my point is that it doesn't account wee's size difference; wee has a set size when it's created that is not reflected in original_T

#

if it doesn't acknowledge wee then i'm not confident it acknowledges other size differences in other mods

frosty rampart
#

yea i think sleepy is agreeing with you that it's insufficient

versed swan
#

but it's good enough for the bare minimum of what i'm implementing

#

(which is randomly mess with card widths and heights)

near coral
#

What does card:juice_up do

#

I saw it in judgement's code and got curious

versed swan
#

it just makes the card do a little shake animation

near coral
#

Ah

near coral
versed swan
#

are you asking a question

near coral
#

Yes

#

Does it make the tarot shake or the summoned joker shake

versed swan
#

it makes card shake

#

if you want the summoned joker to shake you have to assign SMODS.add_card to a variable, say foo, then do foo:juice_up()

near coral
#

Oh

daring fern
versed swan
#

poor readibility

#

i suppose

near coral
#

Let me send the code for the consumable to better understand what I'm hearing

daring fern
# near coral Let me send the code for the consumable to better understand what I'm hearing
G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.4,
    func = function()
        play_sound('tarot1')
        return true
    end
}))
G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.15,
    func = function()
        card:flip()
        play_sound('card1')
        card:juice_up(0.3, 0.3)
        return true
    end
}))
delay(0.2)
G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.1,
    func = function()
        card:set_ability(_jokers[G.jokers.highlighted[1].config.center.key])
        card:set_cost()
        return true
    end
}))
G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.15,
    func = function()
        card:flip()
        play_sound('tarot2', nil, 0.6)
        card:juice_up(0.3, 0.3)
        return true
    end
}))
G.E_MANAGER:add_event(Event({
    trigger = 'after',
    delay = 0.2,
    func = function()
        G.jokers:unhighlight_all()
        return true
    end
}))
delay(0.5)
near coral
daring fern
near coral
#

Ok

near coral
daring fern
near coral
#

Alr

#

How do I turn it into one big code block

#

It's too short to be converted to a text file

fading rivet
#

```lua
code
```

daring fern
near coral
#

I said that cuz text files can be set to have the lua language

#

But since I have the code block shortcut now I don't need to

kindred niche
#
SMODS.Seal{
    key = "pink",
    atlas = "atlas_enhancers",
    pos = { x = 0, y = 0 },
    badge_colour = HEX("EB57BE"),
    calculate = function(self, card, context)
        if context.main_scoring and G.jokers and G.jokers.cards and
        context.area == G.play then
            local joker = pseudorandom_element(G.jokers.cards,                       
            "fs_pink_seal_random_trigger")
            if joker then
                G.E_MANAGER:add_event(Event({
                    func = function()
                        return SMODS.blueprint_effect(card, joker,                     
                        context)
                    end
                }))
            end
        end
    end
}

This seal is supposed to randomly trigger a joker when scored
I think the issue is with the blueprint_effect cause I am not entirely sure how it works, but I could be completely wrong and there is something else

daring fern
kindred niche
#

Yes

#

I think when making the code I was trying to make it copy the effect not trigger it, but got lost along the way

thorn ingot
#

Okay guys. Change of plans, increasing an specific ante scaling is too difficult is not even funny.

Would any of you know how to modify the blind requirement of the finisher blind? Give it a multiplier. Like times 2. There also isn't a lot of info on this.

junior tapir
#

I mean, I guess the source code has it's own way of saving without the config file and the config is just an smods convenience

minor anvil
thorn ingot
minor anvil
#

you can change the key to another

thorn ingot
#

can you do it for all? even the modded ones?

minor anvil
#

i believe so

thorn ingot
#

how could I do it on a modded one I don't know the player is gonna have.

#

seems like it requires the key name

minor anvil
#

not sure but you can do an injection to get all blinds and then multiply a specify blind, you'd still need the name ofc

thorn ingot
#

yeah, it might be similar to the ante thing, so really difficult, haha.
Thanks for the help, I might just do what you suggested. balatroheart

kindred niche
#

How do I make a seal on a scored card trigger a joker

frosty dock
#

check for the seal in context.individual for the area you care about

normal crest
#

if you're the actual smods cat then name all the smods versions

thorn ingot
#

btw, guys.

How do you take ownership by kind of only the showdown blinds?

kindred niche
kindred niche
#
SMODS.Seal{
    key = "pink",
    atlas = "atlas_enhancers",
    pos = { x = 0, y = 0 },
    badge_colour = HEX("EB57BE"),
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            local rand_joker = pseudorandom_element(G.jokers.cards, "fs_pink_seal")
            for _, joker in ipairs(G.joker.cards) do
                if joker == rand_joker then
                    return {
                        repetitions = 1
                    }
                end    
            end
        end
    end
}

Multiple variations of something like this

#

I also had card:get_seal() too at one point but it did not change in game either way if that was what you were referring to in your original response

frosty dock
#

and what exactly are you hoping to achieve?

kindred niche
#

When the playing card with the seal is scored, trigger a random joker you have

frosty dock
#

what do you mean by triggering the joker

kindred niche
#

If you only had the default joker that gives +4 mult, when the card is scored, trigger that joker, if you had 5 different jokers, youd randomly trigger the effect of one of them

#

I should check for blueprint_compat too I suppose just to make sure

frosty dock
#

so if you just had basic joker, you'd want it to give +4 mult when the card with the seal is scored??

kindred niche
#

Yeah and if you had like running man and that +4 joker, it would randomly give either the effect of running man or the +4 mult for example

frosty dock
#

joker evaluation doesn't work like that, jokers have different effects at different timings

kindred niche
#

So is it possible

frosty dock
#

you can't just take a specific scoring timing out of context

#

what you can do is add a retrigger to that joker for the entire hand

#

which will cause its effect to repeat in whatever timing one actually exists

kindred niche
#

I guess thats good enough

frosty dock
#

https://github.com/nh6574/VanillaRemade/wiki#retrigger_joker this is roughly how it works, you'd need some extra logic to determine the joker at the start of the hand and save that until the end, or else you'd get different jokers randomly retriggering or not

GitHub

Contribute to nh6574/VanillaRemade development by creating an account on GitHub.

#

Just a bit of advice, be more precise with what you want when asking questions here. What I thought you meant was that you had a joker that was supposed to have some kind of effect on cards with a specific seal

kindred niche
#

Alright thanks ill keep it in mind

wild patrol
#

Speaking of smods is there an easier way to keep up with new functions being added

#

Other than hoping you can find it in the commits pages

#

Would be nice to have a page dedicated to recent functions added in development version

wintry solar
#

We will document changes that are on the dev build when it moves to a release

#

If you’re using the dev build, you’ll either need to read the commits or know the right people to talk to

wild patrol
#

Not trying to be mean but even the release wiki is very lacking

wintry solar
#

In what sense?

wild patrol
#

Hard to explain but just seems like I see myself using the vanilla repo people link over the official smod one

#

Just easier to find stuff there

wintry solar
#

That’s because the vanilla remade repo is written in a guide way rather than a documentation way

wild patrol
#

I'd explain more but I'm limited on time rn

wintry solar
#

So if your question is “how do I do X?”, vanilla remade is more likely to have an explicit answer, whilst the smods wiki is more of a “here is everything you can use, go figure it out yourself”

wild patrol
#

I guess that about sums it up yeah

#

Not knocking what y'all doing very greatful for it

#

Hope what I said didn't come off as assholish

wintry solar
#

No I just think it’s important that people realise the difference in aims of the two resources, and that they both should exist alongside each other

wild patrol
#

Yeah

kindred niche
#
SMODS.Seal{
    key = "pink",
    atlas = "atlas_enhancers",
    config = { rand_joker = nil },
    pos = { x = 0, y = 0 },
    badge_colour = HEX("EB57BE"),
    calculate = function(self, card, context)
        if context.main_scoring and G.jokers.cards and context.cardarea == G.play then
            card.ability.rand_joker = pseudorandom_element(G.jokers.cards, "fs_pink_seal")
        end
        if context.retrigger_joker_check and card.ability.rand_joker == context.other_card then
            return {
                repetitions = 1
            }
        end
    end
}

What are the conditions for context.retrigger_joker_check to happen. Even without the extra check in that if statement, it is never true.

wild patrol
#

Both have helped out on the mod I've been working with

kindred niche
granite jay
#
SMODS.Joker{
    key = "sugamimi",
    config = { extra = {retriggers = 1}},
    pos = { x = 0, y = 8 },
    rarity = 4,
    cost = 20,
    blueprint_compat=false,
    eternal_compat=true,
    perishable_compat=true,
    unlocked = true,
     
    effect=nil,
    soul_pos={ x = 0, y = 9 },
    atlas = 'grasslanderJoker',

    calculate = function(self,card,context)
        if context.other_card and context.other_card.seal then
            local effects = {}
            if context.other_card.seal ~= 'Blue' then
                if context.end_of_round and context.cardarea == G.hand 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 G.GAME.last_hand_played then
                                local _planet = nil
                                for k, v in pairs(G.P_CENTER_POOLS.Planet) do
                                    if v.config.hand_type == G.GAME.last_hand_played then
                                        _planet = v.key
                                    end
                                end
                                if _planet then
                                    SMODS.add_card({ key = _planet })
                                end
                                G.GAME.consumeable_buffer = 0
                            end
                            return true
                        end
                    }))
                    effects[#effects + 1] = {
                        message = localize('k_plus_planet'), colour = G.C.SECONDARY_SET.Planet,
                        message_card = context.other_card
                    }
                end
            end

            if context.other_card.seal ~= 'Purple' then
                if context.discard 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()
                            SMODS.add_card({ set = 'Tarot' })
                            G.GAME.consumeable_buffer = 0
                            return true
                        end
                    }))
                    effects[#effects + 1] = {
                        message = localize('k_plus_tarot'), 
                        colour = G.C.PURPLE,
                        message_card = context.other_card
                    }
                end
            end

            if context.other_card.seal ~= 'Gold' then
                if context.individual and context.cardarea == G.play then
                    effects[#effects + 1] = {
                        dollars = card.ability.extra.dollars,
                        message_card = context.other_card
                    }
                end
            end

            if context.other_card.seal ~= 'Red' then
                if context.repetition then
                    effects[#effects + 1] = {
                        repetitions = card.ability.extra.retriggers,
                        message_card = context.other_card
                    }
                end
            end

            return SMODS.merge_effects(effects)
        end
    end,
}```
Anyone know a better way to code this?
I want a Joker to make it so any card with a seal has the combined effects of all four seals
real crown
#

How can I check if the source of a context.card_added is riff raff?

blazing helm
#

how to save custom data? at the moment im using add_to_deck and remove_from_deck to register and unregister callbacks but when the game reloads there not registered anymore. how would i save the custom data?

add_to_deck = function (self, card, deck)
    Twitch.Chat.register_callback(card, self.chat)
end,

remove_from_deck = function (self, card, deck)
    Twitch.Chat.unregister_callback(card)
end,

also is there like uid for cards? checking with the card itself seems stupid and i dont think it would even work lol

Twitch.Chat.unregister_callback = function (card)
for i, cb in ipairs(Twitch.Chat.Callbacks) do
    if cb.card == card then
        table.remove(Twitch.Chat.Callbacks, i)
        break
    end
end
wild patrol
#

@blazing helm you working on a twitch mod to?

#

How is yours working just curious ours is more of a twitch vs chat style back and forth

#

I just wanna make sure ideas don't overlap and they could coexist lol

#

If not oh well beaten to the punch I suppose

blazing helm
#

ours seem quite dif. mine, as the name EngagementBait suggests, is more using viewer engagement to make cards stronger (and sometime weaker) like one im working on rn gains chips every chat message sent

wild patrol
#

Oh nice

#

If you wanna collaborate something sometime let me know

#

Be nice to see these mods interact

blazing helm
#

sure! i just need to get the base mod working first lol also probably need to add the auto balancer running first as depending on the size of the streamer my jokers are ether completely useless or WAY to strong lol

wild patrol
#

Most the commands are done on our in we are just fixing up bugs and adding in jokers and stuff

#

There's a bug in the level down that crashes the game because level -1 isn't a thing

#

What I'm struggling with is balancing the commands with jokers

#

Cause I got funny commands but they are kinda more powerful than the jokers battling them

blazing helm
#

rip gl with that lol

wild patrol
#

Currently working on a deck based on a meme from a streamer friend of mine

frosty dock
hidden aspen
#

how can i emmit custom calculate call? i wanna send out a custom context at a certain point in the game, but i dont know how
(example of recieving vanilla context, but i wanna send out my own)

fading rivet
#

try uploading it in another server and send the media link

wild patrol
#

It's probably just the mobile app being dogwater

fading rivet
#

likely

wild patrol
#

That or my VPN

#

One or the other

fading rivet
#

if it doesn't embed I can at least view the image

hidden aspen
#

you can store custom data for the run in the G.GAME object

#

recursive tables wont be saved properly
there could be some issues with saving though if your object is too complicated

fading rivet
frosty dock
frosty dock
#

you can define a load function on the relevant object to achieve that

limber aspen
#

How do I display negative chips on card's tooltip?

blazing helm
blazing helm
frosty dock
#

Also the flag needs to be in the card's ability table

frosty dock
#

either way, setting it with add_to_deck won't register it until you buy it

real crown
#

Is there a way to check how a card was created from context.card_added?
I'd like to check if it was created by riff-raff specifically

frosty dock
#

card_added doesn't specify a source, no

#

you'd probably want to patch a custom context into riff-raff to make that work

real crown
#

In that case, is there a better way to do this?
The goal is to fill every empty joker slot with the joker that's added, and the main issue with riff-raff is that it adds 2 jokers at once, so I'd need to use -2 instead of -1 when calculating free slots (as context.card from context.card_added apparently doesn't count towards the #G.jokers.cards yet)

        if free_slots > 0 then
            for i = 1, free_slots do
                SMODS.add_card {
                    key = context.card.config.center.key,
                    no_edition = "true"
                }
            end
        end```
And it's completely possible I'm just overcomplicating it (this is inside card_added context and I also check if it's a joker)
wintry solar
#

I think you can take G.GAME.joker_buffer away instead of 1

real crown
#

I tried, if I use G.GAME.joker_buffer, then even if I add a card in another way (e.g.: buy it from shop), I'll end up with 1 more Joker than my slots

frosty dock
real crown
#

I feel that's also a possibility
I think the way it works is that before anything gets added, riff-raff fills it up to 4/5 slots with the copy of the first riff-raff joker, and then the two jokers from riff-raff get added and push it to 6/5
Or at least that's my assumption, may be wrong
Because of how I need to subtract 1 even when buying a normal joker as the joker I buy gets added after its copies, that would be how I imagine it works with riff-raff

#

Actually, doing - G.GAME.joker_buffer - 1 works for 1 riff-raff (ends in 5/5), doesn't work for 2 riff-raffs (6/5), and for 3 riff-raffs it works again (5/5), probably because there are no slots for the 2nd riff-raff to trigger in the first place

frosty dock
#

I suppose you need to update joker_buffer when adding your cards

fading rivet
#

How do I use quantum enhancements?

#

nvm

#

anyone know why using quantum enhancements targeting wild cards is stupidly laggy?

wintry crater
#

this joker is supposed to flip all jokers when the blind is selected but this code doesnt work

hushed field
fading rivet
#

I have a card which makes flipped cards act as wild cards

#

and whenever I select cards I lose a ton of frames

hushed field
#

Yeah, it makes it check very frequently to see if your selected hand is a specific poker hand, I suspect. I think there are ways to optimize it, but in my experience, quantum enhancements as a feature is just an insane performance drain in most situations

#

I know I removed any design that would need it from my mod so I didn't have to use it

fading rivet
#

hmm

sleek valley
#

anyone know what im supposed to change here for it to be each 5 dollars instead of 1?

fading rivet
slim ferry
#

why not check bootstraps

wintry solar
sleek valley
# slim ferry ~~why not check bootstraps~~

when i was looking through base game cards to base my code off, i went from first page down the list, so the bull was the first i saw and i didnt think to check for others
in short: i forgot bootstraps existed lmao

slim ferry
#

You should use vanillaremade to check vanilla code...

#

Well

#

Actually nvm this doesnt tell me that you arent already

sleek valley
#

:p

hushed field
#

@wintry solar Setting up the font like this, and just tested it both with and without the mod prefix because I wasn't sure whether Fonts needed it and this seemed quicker than to check 😛 I'm not sure why the text isn't glued right on the card, though, when it comes to movement.

wintry solar
#

should be text_font = 'key'

#

with mod prefix too

hushed field
#

oh jesus, haha

#

Yeah I fully just read the code wrong. just .font is how it's stored in the canvassprite, not how it's passed along

#

The movement's the bigger mystery, though

daring fern
#

fading rivet
wild patrol
#

I can't think of away to nerf the flush deck

#

how to you nerf a deck where every card is hearts

hushed field
wintry solar
wintry solar
hushed field
#

The counters in the first clip are fully glued to the card. The question marks on the enhancement seem to move from a different axis, though

wintry solar
#

I wonder if it’s a table issue

wintry crater
#

is there a way to lock a joker until a certain hand type is played in a run? i know how planet cards do it but i dont know if it is the same for jokers

hushed field
hushed field
fading rivet
#

I think I'll make it a config option then to enable

#

time to figure out how to do that

hushed field
#

Doing a quick test and setting the offset at x=0,y=0, I think the pivot point is no longer offset when the text is 🤔

wintry solar
#

I’m pretty sure the offset should just control where on the canvas the text is

#

I don’t believe it actually moves the canvas

white light
hushed field
#

I'm wondering if it's just a visual illusion, where the bottom left doesn't make you notice the lack of change as much, while centering it does 🤔

wintry solar
#

Have you tried centring the counter ones?

hushed field
#

Playing around with that now, yeah

#

I think it still sticks. Accidentally moved the sprite up, though. Wondering if maybe the sprite moved strangely, and that made the text seem more separate than it actuall is? 🤔

#

it's for sure the sprite. Moved it slightly right as well and it's pretty obviously moving off of the card now. That makes so much more sense, haha

#

Yeah, okay, I think it's a combination of the sprite offset, and that being less noticable when its idling because sprites don't pixel crunch as much when rotating, while the font does get affected by it

fading rivet
#

how can I make loc_vars change while your looking at the card?

hushed field
hushed field
fading rivet
#

thx

#

how do I do this?

hushed field
#

You'll have to set up a UI node that you pass along to main_end or main_start in the loc_vars. Depending on how complicated you want it to be, and how intergrated you want it to be in the actual description text, it can be quite the hassle

fading rivet
#

uhhhh

hushed field
#

This is how I've set it up for Deadpool

wanton jolt
#

did u switch custom fonts or did u use another nilla font

fading rivet
#

okay I think i got it

fading rivet
#

mines updating once a second

hushed field
#

one of the settings sets the refresh

#

i'm not sure which one, by heart

fading rivet
#

I copied what u have

hushed field
#

I'm not sure why the speed would be different then 😬

#

Might just be how fast my event updates the timer variable?

wintry solar
#

Could be game speed

fading rivet
#

wait im stupid

#

im using os.time which doesn't have ms

#

its refreshing fine it's just not precise enough lmao

#

wait how do I get ms

#

I dont know much lua

primal robin
#

os.time is float

fading rivet
primal robin
#

love.timer.getTime()

fading rivet
#

thx

sleek valley
#

why are the text nodes not in columns?

red flower
#

each text object should be in a row too

sleek valley
#

i'm gonna try saying that in the most non-judgemental way possible
but that feels kinda clunky imo

slim ferry
#

Tell that to thunk

red flower
#

thunk will not read this channel you can say whatever haha

slim ferry
#

Balatro ui code is pretty much made just for the use cases in vanilla balatro so its very clunky for use in modding

sleek valley
dapper sun
sturdy compass
#

Factual statement

primal robin
#

it works, you need to know only 1 UI system (hello unity), and you dont need draw everything manually. so it's not the worst outcome

hidden aspen
limber aspen
#

How do I get localized text from descriptions.other.text?

#

It works for vanilla but not in my case

#

By "in my case" I mean custom text that I added

#

Im trying to make -chips from rank being displayed

#

And in steamodded's localization I have card_chips_minus

primal robin
#

you need parse it first

limber aspen
#

How do I do that?

red flower
limber aspen
#

In descriptions.other

primal robin
#

also this is incorrect, type = "raw_descriptions" for .text field

red flower
#

or like perma minus chips

#

everything in Other should be parsed

limber aspen
#

What does parsing mean? Doing it like {text = 'ABC'}?

red flower
#

no the game parses all the localization text into its formatting

#

it shouldnt matter in this case tho like i said

#

if it's perma minus chips the look at SMODS.localize_perma_bonuses in the code

granite raptor
#

does this seem more like a common or uncommon?

tidal hemlock
#

pair it with hologram and chad to be most effective

past kelp
#

ok I want to make a challenge deck where all cards are debuffed how would I do that (sorry for asking during conversation)

granite raptor
#

it's like a variable photograph with somewhat more complex numbers lol
i feel like rarity is kind of a blend between effect strength & complexity

tidal hemlock
#

rarity, to me, is a combination of "how hard is it to achieve this effect" vs "how strong is this effect"

granite raptor
#

yea that's a fair way to look at it

past kelp
#

starting cards

daring fern
# past kelp starting cards
apply = function(self)
    G.E_MANAGER:add_event(Event({
        func = function()
            if not G.playing_cards then return false end
            for k, v in pairs(G.playing_cards) do
                v.ability.perma_debuff = true
            end
            return true
        end
    }))
end
past kelp
#

ok so v.ability.perma_debuff gives cards a permenent debuff efferct

past kelp
#

ok thanks

#

do I put the code in the challenges or somewher else

#

I am having trouble debugging this challenge so if anyone could help that would be nice

limber aspen
#

How do I add something directly into SMODS localization? When I add through other mod it works just fine

#

It seems like new entries just don't get added

red flower
#

you would need to be more specific

limber aspen
#

G.localization.descriptions.Other.card_chips_minus = {text = {'{C:chips}#1#{} chips'}}

acoustic drum
#

I'm trying to make a joker that destroys all scoring stone cards on the first hand of the round but this error keeps appearing and I can't figure out why
This is the calculation code:

calculate = function(self, card, context)
        if context.joker_main then
            return {
                x_chips = card.ability.extra.x_chips
            }
        elseif context.destroy_card and G.GAME.current_round.hands_played == 0 and not context.blueprint then
            if SMODS.has_enhancement(context.destroying_card, "m_stone") and not context.destroying_card.debuff then
                SMODS.scale_card(card, {
                    ref_table = card.ability.extra,
                    ref_value = "x_chips",
                    scalar_value = "xchips_mod",
                    message_key = "a_xchips",
                    message_colour = G.C.CHIPS,
                })
                return {
                    remove = true
                }
            end
        end
    end
red flower
#

it depends on how you want to use it

#

also you should put it in a localization file instead of inserting it into G.localization if that's what you're doing

red flower
acoustic drum
#

Oh alr I'll try switching to destroy_card, thanks

limber aspen
#

Nevermind, i just had duplicate

acoustic drum
blazing helm
#

??? what lmao im not allowed to ask questions? XD

#

oh so that one went through

#

lest try again lmao
how do i make the slider wider?

#

ok so when i post the code it gets block 😭

reef bobcat
#

Is it possible to make a joker that changes a hand type?

#

As in, if you play a hand type it gets considered as another

#

Like you play a pair but the game treats it like a flush

red flower
hidden aspen
#

how come juice_card_until not animate the joker even though it does get evaluated correctly?

runic jay
#

What could I possibly have done so wrong that the card literally does nothing?

wintry solar
#

You added a joker main check

runic jay
#

Yeah, it works now after removing it

brazen kite
#

is there a way to increase the spacing between the cards here (this is the collection)

#

if there isn't without like a lovely patch then i won't do it it's fine

reef bobcat
#
    key = "martianmanhunter_joker",
    pos = { x = 0, y = 0 },
    rarity = 1,
    cost = 4,
    blueprint_compat = true,
    eternal_compat = true,
    unlocked = true,
    discovered = true,
    effect = nil,
    atlas = 'martianmanhunter_joker',
    soul_pos = nil,
    loc_vars = function(self, info_queue, card)
        return { vars = { localize(card.ability.extra.poker_hand, 'poker_hands') } }
    end,
    if context.evaluate_poker_hand == 'Three of a Kind' then
  local poker_hands = context.poker_hands
  return {
    replace_scoring_name = "Four of a Kind",
  }
end
}```
#

definitely not doing this right

#

i think i get like the gist of it

#

but it's not clicking

reef bobcat
#

it's supposed to turn three of a kinds into four of a kinds

daring fern
reef bobcat
#
    key = "martianmanhunter_joker",
    pos = { x = 0, y = 0 },
    rarity = 1,
    cost = 4,
    blueprint_compat = true,
    eternal_compat = true,
    unlocked = true,
    discovered = true,
    atlas = 'martianmanhunter_joker',
    soul_pos = nil,
    config = { extra = { poker_hand = 'Three of a Kind' } },
    loc_vars = function(self, info_queue, card)
        return { vars = { localize(card.ability.extra.type, 'poker_hands') } }
    end,
        if context.evaluate_poker_hand and context.scoring_name == 'Three of a Kind' then
    return {replace_scoring_name = 'Four of a Kind'}
    end,
}```
#

changed it to this

#

but it says

#

unexpected symbol near if

#

so it crashed D:

red flower
#

this needs to be in a calculate function

reef bobcat
#

ok the game laucnhed

#

but when i went to hover over the card

#

it crashed

#

said something about the arg value

#

"attempt to index local args (nil value)"

mystic river
#

your card doesn't have ability.extra.type, it has ability.extra.poker_hand

reef bobcat
#

omg thank u all

#

you're all life savers

#

when something isnt in vanilla remade

#

i kinda dunno what to do lol

#

ok so

#

one more thing😅

#

if i want this effect to now apply to two types of hands

#

as in, a three of a kind and five of a kind

#

both get turned into four of a kind

#

how would i implement that

red flower
#

or context.scoring_name == "Five of a Kind" in your condition

#

you will need parentheses surrounding both scoring_name conditions

reef bobcat
#

thank u :))

#

it worked

tranquil echo
#

i know u can check if you used a type of consumable with context.consumeable.ability.set == ‘Planet/Tarot/Spectral’ but can you check for a specific consumable?

slim ferry
#

context.consumeable.config.center.key?

#

And for the vanilla keys you can check vanillaremade since it uses the same keys as vanilla

#

or look at vanilla

#

Or like the one keys reference, i dont have a link though

red flower
hidden aspen
#

I just learnt how to inject stuff with lovely... now this is a game changer

#

i replaced my hacked solutions with injecting and that made some bugs dissapear... life is good

tranquil echo
brazen kite
#

lovely injections are awesome and also using them often irrationally stresses me out but it'll be #okay

umbral zodiac
#

patches are evil but it’s more evil to use janky hooks

mystic river
#

patching in a function call is my favorite way to solve a problem

#

lets me keep my code in my files but i can still put it in the other files exactly where needed

hidden aspen
# umbral zodiac patches are evil but it’s more evil to use janky hooks

This was my evil janky hook before injections. Event in a separate queue that runs every frame to serve as DIY update function

--Hack for detecting state switches.
G.E_MANAGER.queues.vissamap = {}
VSMP.last_state = G.STATES.SPLASH
local event
event = Event {
    blockable = false,
    blocking = false,
    pause_force = true,
    no_delete = true,
    trigger = "immediate",
    
    func = function()
        if VSMP.last_state ~= G.STATE then        
            print({msg = "VANILA SWITCH", last_state = VSMP.last_state, new_state = G.STATE})
            -- ... i was doing buncha stuff here

            VSMP.last_state = G.STATE
        end

        event.start_timer = false
    end
}
G.E_MANAGER:add_event(event, "vissamap")
umbral zodiac
#

holy

frosty dock
#

Ho lee

hidden aspen
wintry crater
#

i want this joker to debuff itself if it hits a random chance but this code doesnt work. is there something internal that makes it so something cant debuff itself or is my code for this just wrong

hidden aspen
#

found in utility functions

mystic river
#

set a flag during after, check it during debuff card

slim ferry
#

Also fyi this wont ever undebuff itself

#

If you want it to do that

#

Since jokers dont calculate while debuffed

#

-# unless you hook Card.can_calculate for this joker

mystic river
#

true
you could use the mod debuff and calculate functions instead to get around that

wintry crater
red flower
hidden aspen
#

fool gotchu

#

never realised pseudorandom_probability exists, its not on the utils doc page

#

oh its on the calculate page

red flower
#

it should be in both honestly

wintry crater
#

why does this never get passed the "After!"

slim ferry
#

G.jokers.cards

#

Not G.jokers

#

Also you should be using SMODS.find_card instead of find_joker

#

Also you dont need to do the for loop to begin with if youre using that

past spade
#

some way to prevent selling consumables? tried context eternal check but it only seems to be for jokers

thorn ingot
#

hey guys.

How do I take ownership or modify a finisher blind within a stake?

I don't think there is any initial modifiers for that, and all the stuff I've tried makes the change global.

past spade
red flower
past spade
#

I check for context.trigger.from_sell, so that should be fine right?

red flower
#

probably

#

is the consumable doing it to itself?

#

or is it another card

past spade
#

a joker

red flower
#

the its probably good yeah

daring fern
#

astral pine
#

After scoring I wanna draw a card, check if the rank is in hand and draw another if it is (can repeat) but the played hand goes away while the events are running so context.full_hand empties out, is there something I'm missing or is that normal?

#
    if context.final_scoring_step then
        drawExtraCard = function()
            card_eval_status_text(card, 'extra', nil, nil, nil, {message = "Go Fish!", colour = G.C.ORANGE})
            play_sound('tarot1')

            draw_card(G.deck, G.hand, 0, 'up')

            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                func = function()
                    -- context.full_hand empties out before events are done running
                    for _, playing_card in pairs(context.full_hand or {}) do
                        if playing_card:get_id() == G.hand.cards[#G.hand.cards]:get_id() then
                            sendInfoMessage("Card drawn match ranks")
                            drawExtraCard()
                            delay(2)
                        end
                    end
                    return true
                end
            }))
        end

        drawExtraCard()
    end
daring fern