#💻・modding-dev

1 messages · Page 472 of 1

daring fern
#

Yes.

hidden sable
daring fern
hidden sable
#

by any chance is there a way to designate a soul atlas, if not that's fine just wanna know if it's a thing

hasty mist
#

what in this code is causing this to upgrade hundreds of times

hasty mist
#

im not sure where to even put my repetition check

red flower
formal quest
#

So I'm hooking create_card to replace planet cards as they're created, and my code is causing a crash I don't really understand

local create_card_ref = create_card
function create_card(...)
    --pre
    local result = create_card_ref(self, ...)
    --post
    if next(SMODS.find_card("j_givl_spaghettification", false)) and result.ability.set == "Planet" then
        for _, value in ipairs(SMODS.find_card("j_givl_spaghettification", false)) do
            if pseudorandom('j_givl_spaghettification') < G.GAME.probabilities.normal / value.ability.extra.odds then
                return create_card("c_black_hole")
            end
        end
    end
    return result
end
hasty mist
#

oh

#

right

subtle merlin
#

Quick question: How can I tell if a card has no seal, no enhancement, and no edition?

hasty mist
#

what context should i even use, just joker_main? before?

urban wasp
#

...like this? this just makes it always play

SMODS.Sound({
    key = "music_all",
    path = "music_all.ogg",
    select_music_track = function()
        local count = #Cryptid.advanced_find_joker(nil, "crp_all", nil, nil, true)
        if count ~= 0 then
            return 1.7e308
        else
            return 0
        end
    end,
})

-# btw cryptid is a dependency which is why i'm using their function

urban wasp
#

ah

red flower
red flower
daring fern
#

Where is the code that puts all of G.vouchers.cards in the run info vouchers?

red flower
hasty mist
formal quest
red flower
daring fern
red flower
formal quest
red flower
# formal quest How should I use it here?

I don't remember the arguments for create_card off the top of my head but also you probably shouldn't be using create_card inside create_card

my honest opinion is that create_card is one of those functions that you shouldn't mess with if you don't know what you're doing, but if you still want to do it try to learn what it does first

formal quest
#

Is there another way I can replace the card with another as it's created?

red flower
#

What's the intended effect?

formal quest
#

If the joker succeeds its roll, the planet card will be a black hole. This applies anywhere, not just booster packs, hence why I'm not trying to modify the vanilla spawn chance.

formal quest
daring fern
formal quest
red flower
#

i think it's a somewhat complicated effect

#

the thing that replaces planets with black hole is create_card usually

turbid field
#

Is it possible for me to code the re-drawing of an already just scored card back into hand?

#

I ask because I want to make this joker idea of mine functional

#

Just curious, because if an already played/discarded card is untouchable in the code until the next round starts, im boned

shell timber
#

it is possible

#

i think Victin did something like this

#

though they seem to be offline

turbid field
#

ok awesome

#

I just hope it isn't too tedious of an implementation

formal quest
daring fern
formal quest
#

create_card_ref.forced_key = "c_black_hole"?

bitter portal
#

bump

#

Also, how do I prevent my modded Edition from showing up on playing cards?

formal quest
daring fern
# formal quest Why
local oldsetability = Card.set_ability
function Card:set_ability(center, initial, delay_sprites)
    if conditions and self and self.config and self.config.center and center and center.set == "Planet" then center = G.P_CENTERS["c_black_hole"] end
    return oldsetability(self, center, initial, delay_sprite)
end
```?
formal quest
daring fern
cursive sentinel
#

i tried patching mid line but it doesnt seem to work like this, what have i done wrong?

[[patches]]
[patches.pattern]
target = 'card.lua'
match_indent = true
position = 'after'
pattern = '''
(100-G.GAME.discount_percent)
'''
payload = '''
*G.GAME.grogoroth
'''

tried to patch self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)/100))

daring fern
#

Or use regex I think.

cursive sentinel
#

so rewriting it? what an overwrite patch looks like if i may ask?

#

ive only ever added stuff in patches

daring fern
# cursive sentinel ive only ever added stuff in patches
[[patches]]
[patches.pattern]
target = 'card.lua'
match_indent = true
position = 'at'
pattern = '''
self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)/100))
'''
payload = '''
self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)*G.GAME.grogoroth/100))
'''
cursive sentinel
#

ok so position at changes pattern to payload

#

thanks !

vague crest
#

how would i check if the player has a consumable?

shell timber
#

next(SMODS.find_card("c_whatever"))

vague crest
#

would i just leave the brackets empty if it doesnt have to be a specific consumable?

wheat jewel
#

Does the game allow jokers to change card suits when scoring cards?

#

tryna know for a joker i'm making

shell timber
#

oh if you want any consumeable you can just do #G.consumeables.cards >= 1

vague crest
#

for context im looking to check if the player has one and if it does itll destroy the consumable and give a random card an edition

#

actually i can just look at how tobi the corgi does it

#

and its soooo simple im rejoicing

leaden hollow
#

can someone help me with this? it almost works in game, except the joker pops up with the message 'ERROR' and the effect doesn't work:

    loc_vars = function(self,info_queue,card)
        return {vars = {card.ability.extra.chips}}
    end,
    calculate = function(self,card,context)
        if context.individual and context.cardarea == G.play and context.other_card:is_suit(card.ability.extra.suit) then
            context.other_card.ability.perma_bonus = (context.other_card.ability.perma_bonus or 0) + card.ability.extra.chips
            return{
                chips = card.ability.extra.chips,
                message = localize('k_added_ex'),
                color = G.C.CHIPS
            }
        end
    end,
formal quest
# daring fern ```lua local oldsetability = Card.set_ability function Card:set_ability(center, ...

Something's wrong. Even after removing most of the conditions it doesn't do anything.

local oldsetability = Card.set_ability
function Card:set_ability(center, initial, delay_sprites)
    if self and self.config and self.config.center and self.ability and self.ability.set == "Planet" then
        --for _, value in ipairs(SMODS.find_card("j_givl_spaghettification", false)) do
            --if pseudorandom('j_givl_spaghettification') < G.GAME.probabilities.normal / value.ability.extra.odds then
                center = G.P_CENTERS["c_black_hole"]
            --end
        --end
    end
    return oldsetability(self, center, initial, delay_sprite)
end```
daring fern
vague crest
#

i have a card here that gives editions to playing cards before the hand is scored but it's not scoring the editions as part of the hand yet, does anyone know a fix?

vague crest
daring fern
vague crest
#

oh is it that simple ok

#

works beautifully YIPPEE ty

wheat jewel
#

if jokers are unable to change suits then i guess imma think of a new effect

cursive sentinel
#

is assets = resources ?

cursive sentinel
cursive sentinel
#

bcs in base game is resources

daring fern
cursive sentinel
#

then where shall i put a "sounds" file?

wheat jewel
#

cuz i'm lost

daring fern
cursive sentinel
wheat jewel
# wheat jewel

I did make some changes by looking at sigil but it ain't workin

cursive sentinel
daring fern
cursive sentinel
#
G.E_MANAGER:add_event(Event({func = function()
    G.GAME.grogoroth = G.GAME.grogoroth * 2
    play_sound("alllmer")
    print("double")
    for k, v in pairs(G.I.CARD) do
        if v.set_cost then v:set_cost() end
    end
return true end }))
#

Oops! The game crashed:
Thread error (Thread: 0x028ccd337e70)

Could not open file resources/sounds/alllmer.ogg. Does not exist.
stack traceback:
[C]: at 0x7ffef51f58a0
[C]: in function 'newSource'
engine/sound_manager.lua:63: in function 'PLAY_SOUND'
engine/sound_manager.lua:197: in main chunk

cursive sentinel
#

ahhh

#

so "drx1_alllmer" ?

daring fern
cursive sentinel
#

thanks !

formal quest
cursive sentinel
formal quest
cursive sentinel
wheat jewel
urban wasp
#

why isn't there a space here?

lunar finch
#

When I make a main.lua text doc is the type supposed to change?

cursive sentinel
#

the juice up is just for juicy

urban wasp
#

it shouldn't be "main.lua.txt"

lunar finch
#

Its just main.lua but it says its a text doc

daring fern
urban wasp
#

enable file extensions in explorer (assuming you're using windows)

wheat jewel
cursive sentinel
#

i dont think you need "context.main_eval" at all

#

i may be wrong tho

lunar finch
urban wasp
lunar finch
#

Okok

cursive sentinel
lunar finch
#

That worked thank you

cursive sentinel
#

the line is play_sound("drx1_alllmer")

hasty mist
#

why cant i eval calculate using arrows

daring fern
cursive sentinel
#

wdym?

daring fern
daring fern
cursive sentinel
#

i need to?

hasty mist
#

still no

cursive sentinel
#

im sorry, never added sound 😔

hasty mist
#

wait

#

nvm

#

i got it

cursive sentinel
#

so i need to do a smods.sound for each sound i wanna add?

cursive sentinel
#

alright, thanks !

vague crest
#

one last little bugfix before bed hopefully; it works well but theres unintended behavior where the shop slots disappear the moment you sell it, which creates some annoying moments where you sell the joker to replace it with something else, and then that something else goes away. whats the fix for something like this?

urban wasp
daring fern
urban wasp
wheat jewel
urban wasp
#

like could i just make a loc_var that's just " " and use that or

daring fern
urban wasp
#

i want the space to have that background though; i don't want it to be cut off

daring fern
daring fern
serene granite
#

ok this is kinda random but im just curious, is it possible to create a custom deck that forces the shop to have only jokers of one kind of rarity

vague crest
urban wasp
urban wasp
#

also you can very very very slightly see the m there lol

serene granite
# daring fern Yes.

any idea how that would work or look, mind you i havent even touched making a custom deck, just kinda thinking for the future

daring fern
serene granite
#

ooh

#

are there any good mod examples with custom decks

urban wasp
#

i'm looking to change a part of cryptid code when my mod is installed but i'm unsure on how to do it because most examples i've seen of lovely patching are on vanilla or smods functions. how do i tell lovely to look at a file in a different mod?

daring fern
serene granite
#

i cant find the steamodded guide for decks

daring fern
serene granite
#

why is it called back? i guess that confused me sorry

#

wait idk if thats what im looking for

urban wasp
urban wasp
#

oh

#

i'm sobbing 😭

#

the switch-up is just too funny

#

i love the unintended humor

#

what's this?

serene granite
#

heyy so i am working on my jokers that are kind of like certificate, and they work rly well finally but only problem is im realizing that the cards arent appearing in the deck / full deck. i can still draw them as if they are in the deck but i cant see them in there, any advice?

serene granite
#
  SMODS.Joker {
        key = "KingSalmon",
        unlocked = true,
        discovered = true,
        blueprint_compat = true,
        eternal_compat = true,
        perishable_compat = true,
        rarity = "AC_Fish",
        cost = 6,
        atlas = "Jokers",
        pos = { x = 4, y = 3 },

        loc_txt = {
            name = "King Salmon",
            text = {
                "Creates a {C:dark_edition}Holographic{}, {C:attention}King{}",
                "with the {C:mult}Mult{} enhancement",
                "at the start of every round"
            }
        },

        loc_vars = function(self, info_queue, card)
            info_queue[#info_queue + 1] = G.P_CENTERS.m_mult
            return { vars = {} }
        end,

        calculate = function(self, card, context)
            if context.first_hand_drawn then
                local _card = SMODS.create_card { set = "Base", enhancement = "m_mult", rank = "King", edition = "e_holo", area = G.discard }

                G.E_MANAGER:add_event(Event({
                    func = function()
                        G.hand:emplace(_card)
                        _card:start_materialize()
                        G.GAME.blind:debuff_card(_card)
                        G.hand:sort()

                        if context.blueprint_card then
                            context.blueprint_card:juice_up()
                        else
                            card:juice_up()
                        end

                        return true
                    end
                }))

                SMODS.calculate_context({
                    playing_card_added = true,
                    cards = { _card }
                })

                return nil, true
            end
        end,


daring fern
serene granite
#

ohhh

serene granite
serene granite
#

its the same code, i just changed the word create to add

#

also its too big for me to send on discord which is annoying

urban wasp
#

"Upload message as file"

languid canopy
#

hi there, this is my code for a boss that debuffs all cards but desactivates when a consumable is used or sold, but it doesn't work (doesn't crash, the debuff part works but not the disactivation part), can you guys give a little help ?

serene granite
# daring fern Code?

also the certificate example uses create card, so im surprised that doesnt just work

daring fern
urban wasp
#

confused

tepid coral
#

Just started modding Balatro recently and I am enjoying it so far

gaunt thistle
# urban wasp confused

you need to either escape the quotes inside of the target string or use ''' instead of "

urban wasp
#

ah

#

okay it work now

#

okay it doesn't work now

#

spawning a mythic joker doesn't change anything...

#

oh well hmm this is like thought to be in cryptid's code by the game right
so it doesn't find the rarity cuz it's not in cryptid

#

possibly? i'm not sure to be honest

#

if that is the case, how do i fix?

hollow crest
#

guys what's the G and where can I find the references

#

I've been seeing stuff like G.GAME but idk what they are

maiden phoenix
#

If you're on VSCode do Ctrl+shift+f and look for "self.GAME" iirc

hollow crest
#

nvm I found them in one of the luas in the exe

bitter portal
#

bump

molten musk
#

i want a lovely injection example or docs? like smods

hidden sable
#

i finally realized something, the reason it causes a stack error is because 1 blueprint is multiplying its own blueprint power by the amount of blueprints there are in the chain, so instead of other_card being a blueprint, i need to check if other_card is a blueprint and check down the chain for the actual card to trigger that instead

#

i would just check the a lot infront of the blueprint, and if it's another blueprint, then add 1 to the slot to check?

#

i can do that with a for loop for the #G.jokers right?

bitter portal
river apex
#

Is it possible to make a joker that trigger its effect X times where X is calculated before the activation ? (but changes each round like a random value for example)
Like a Chad but for himself (giving +chips for example) and the number is random each times ?

faint yacht
#

Perform the calculation and set a value on the Joker itself in context.before (or context.setting_blind for round-specific randomization), then you'll have to nest the desired effects.

river apex
#

What does it mean ?
If a want to add a bonus it is usually a return that I use
But if I want to have the effect multiple times I cannot just return with "repetition" right ?

lament agate
#

SMODS.Shader doesnt exist?

hardy viper
lament agate
#

got an error saying attempt to index "shader"

maiden phoenix
#

Try adding your mod prefix to the shader value in edition?

hardy viper
#

yup needs prefix

lament agate
#

pray for me

small tartan
#

After much pain i made it work (second toggle)

#

And in english works too

bitter portal
daring fern
bitter portal
#

wtf there's no way thats how they do it for something like negative

#

Negative doesnt show up on regular playing cards

unborn bay
#

smods adds negative playing cards

#

as for that factoring under wof, wof is hardcoded to only give foil, holo or poly

bitter portal
formal parrot
#

That’s not what they meant

daring fern
bitter portal
#

well then....

#

This is what i get for making an edition that gives card limit 😭

#

the translations are messed up on non joker cards too...

red flower
#

yeah negative is pretty hardcoded

bitter portal
#

and i spent so long on that shader too...

unborn bay
#

the hard part about making a shader is making the shader

bitter portal
#

okay welll. i have no ideas, but surely one of you can think of something else to do for "scafold" cards

proper tangle
#

hello! i'm attempting to make a joker that is similar to 8 ball; does anyone have a recreation of its code that i could use?

proper tangle
#

ty!

#

yeah the card i'm trying to make is 8 ball but "8" -> "Spade" and "Tarot" -> "Code"

#

so that should be pretty easy

small tartan
bitter portal
#

But im looking to change it to something else entirely

small tartan
# bitter portal Yeah

How Easy is to make them scaffold? Because negative surclasses it if it's not super easy

bitter portal
bitter portal
rose wasp
#

is overriding internal logic (like saving to file and counting chips) available to modify from steamodded? i want to implement my idea at https://discord.com/channels/1116389027176787968/1389894638135148574 as a fun programming challenge, but im not sure if its possible with current modloaders (i could just modify sources and make binary patch, but its not that fun and flexible)

bitter portal
small tartan
#

You could do if you have 3+ scaffolds, every scaffold gives you mult or something

bitter portal
#

Ooh maybe

small tartan
rose wasp
primal terrace
proper tangle
#

does anyone know what the message should be for adding a code card? i know adding a tarot card is localize("k_plus_tarot"); is adding a code card localize("k_plus_code")?

#

(cryptid mod)

primal terrace
#

The stuff that Cryptid adds has the prefix cry_

proper tangle
#

ah

#

got it, cry_plus_code

#

one last thing: how might i add my custom joker at the beginning of the run (so i can test it easier)?

manic rune
#

press 3 on your joker in the collection menu

proper tangle
#

ah gotcha

rotund sable
#

how do i make a retrigger joker like chad from cryptid? i looked at his code but he uses contexts that i can't find anywhere in patches etc.

#

i want to retrigger jokers of specific rarity

manic rune
#

its in smods

pastel kernel
#

What’s the snippet for leveling up poker hands? (All hands in this case)

thorn furnace
#

Bump

rotund sable
daring fern
manic rune
#

:3

#

fuck

#

anyways, yeah, its context.retrigger_joker_check, context.other_card refers to the card its checking and returning repetitions = x will retrigger that joker by that amount of times i think

daring fern
normal crest
#

Hi bepis

manic rune
#

whos bepis

#

hi srockw :3

normal crest
#

hi beria

manic rune
#

hi

normal crest
manic rune
#

truly

#

just to be sure, the first card in G.deck.cards will be drawn first right?

red flower
#

no

#

the last

manic rune
#

i see

#

must be the middle one then, thanks :3

red flower
#

just to be clear i wasnt being sarcastic lol

manic rune
#

.

#

why????

#

why is it the last one

red flower
#

probably so the animation looks better or something

manic rune
#

im gonna cry

#

anyways, thanks, yeah i thought that was sarcastic because of how weird that sounded 😭

rare torrent
#

how do i make this only trigger if the only scoring card is an ace? calculate = function(self, card, context) if context.individual and context.cardarea == G.play then local hand = context.full_hand if #hand == 1 and hand[1].base.value == 14 then return { mult = 5, card = self } end end end it's currently doing nothing

daring fern
red flower
#

card.base.value is the rank key iirc, not the id

rare torrent
solid grotto
#

How do I access my localization? I feel like I'm misinterpreting something because the localization page on smods wiki is not at all in depth

idle plaza
solid grotto
#

I just cannot make the decription show up

red flower
solid grotto
#

Do I need j_ on everything

ocean goblet
#

via what context would i check for a blind being defeated/won

red flower
solid grotto
#

Every joker I mean

#

I know blinds are bl_

#

And such

red flower
red flower
#

the prefixes are in the docs

proper tangle
#

ty everyone!! will add more to this but for right now i'm happy :3

ocean goblet
idle plaza
ocean goblet
#

i wanna check for essentially any type that isnt small blind or big blind

daring fern
idle plaza
#

Oh ok

solid grotto
red flower
red flower
solid grotto
#

I was wondering if you were referring to some other document

#

I see

#

Still no description despite adding the j_ prefix

red flower
#

show more of the localization file too

bold sleet
#

Chat, question: Is there a way to grab the base of a card from one atlas and the soul layer from a different one?

red flower
#

in the definition, no

solid grotto
#

This is all my localization for my jokers

#

And one of my jokers

red flower
#

i said only j in the localization

solid grotto
#

Ohhhh

red flower
lament agate
#

desc showing Xnil despite being declared already

red flower
#

you put mult instead of xmult

lament agate
#

wait

#

nevermind

#

yeah

#

kill me already

#

i feel old

#

im 18

solid grotto
#

Okay, so I removed the j_ prefix from the joker code and kept it in the local
But I sitll get no desc

red flower
#

also while this is probably not the issue as smods removes it, i would recommend not adding the prefix manually to the keys

solid grotto
#

Idk what dod it

#

Did it

#

But it works now lol

#

I guess removing my mod prefix from the key was the solution

stiff quiver
#

so um, random question, in a scale of 1-10 how hard is it to create a cardarea and a context?

#

and how would i do it?

formal parrot
#

7

#

Card area with Ui

stiff quiver
#

thats way lower than what i expected

formal parrot
#

Idk about custom context tho

ocean goblet
red flower
#

cardarea depends on what you want it to do
context 1

red flower
stiff quiver
#

cardarea i just want it to hold jokers outside of where jokers are held, its for a joker that stores jokers, if that makes sense

#

and the context is well, for triggering the jokes there

formal parrot
#

STEAL HIS CODE 🔥

#

/j

#

Ask for permission

pastel kernel
#

Are we only supposed to use ogg files and not wav?

stiff quiver
#

i dont even know who Aiko is lol

crisp coral
#

yes, ogg is preferred

stiff quiver
#

but i'll see what they made and if it'd work for me i'll ask them to use their code

crisp coral
#

wav is usable but has large filesize

#

just never use mp3

stiff quiver
formal parrot
#

Fun fact the joker is named after me

#

:P

knotty compass
#

heya! question, anyone knows how to set cards rank to a random one?

formal parrot
#

Use math.random

red flower
#

never

formal parrot
#

Muhahahahahahaha

pastel kernel
#

I swear to fucking god if this doesn’t work

#

GOD FUCKING DAMN IT

#

Maybe if I turn off highest priestess

#

These poker cards, they better level up

rotund sable
#

"FirstTry" :clueless:

pastel kernel
#

“Attempt to compare number with table”

rotund sable
#

Last time I had this error was with Talisman installed

red flower
#

yeah poker hand levels are tables with talisman

#

if thats what youre doing

pastel kernel
#

Or if played hand contains one.

red flower
#

whats the code

pastel kernel
#
        if context.cardarea == G.play and context.scoring_name == 'Flush' and not context.blueprint then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    play_sound('dd1_lovin')
                    card:juice_up(0.3, 0.5)
                    update_hand_text({ sound = 'button', volume = 0.7, pitch = 0.9, delay = 0 },
                        { level = 'x' .. to_big(card.ability.extra.multiplier) })
                    for poker_hand_key, hand in pairs(G.GAME.hands) do
                        local current_level = hand.level or 1
                        local levels_to_add = math.max(0, math.floor(current_level * (card.ability.extra.multiplier - 1)))
                        if levels_to_add > 0 then
                            level_up_hand(card, poker_hand_key, true, levels_to_add)
                        end
                    end
                    update_hand_text({ sound = 'button', volume = 0.7, pitch = 1.1, delay = 0 },
                        { mult = 0, chips = 0, handname = '', level = '' })
                    return true
                end
            }))
#

it can also disable bosses, they're meant to be character accurate to the real dark donald.

red flower
#

yeah its this part

#

talisman wont like those two lines

pastel kernel
#

what do i do?

red flower
#

try wrapping all of them in to_big

daring heron
#

So how does one make a custom color text?

formal parrot
#

Check text styling on the wiki

daring heron
#

Oop yeah

formal parrot
#

The spring is so joyous

red flower
#

always

formal parrot
#

N have you participated on some yu gi oh esports or something, asking from curiosity

red flower
#

i have played in some online tournaments

daring heron
red flower
pastel kernel
#
        if context.cardarea == G.play and context.scoring_name == 'Flush' and not context.blueprint then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    play_sound('dd1_lovin')
                    card:juice_up(0.3, 0.5)
                    update_hand_text({ sound = 'button', volume = 0.7, pitch = 0.9, delay = 0 },
                        { level = 'x' .. to_big(card.ability.extra.multiplier) })
                    for poker_hand_key, hand in pairs(G.GAME.hands) do
                        local current_level = hand.level or 1
                        local levels_to_add = math.max(0, math.floor(current_level * (to_big(card.ability.extra.multiplier) - 1)))
                        if levels_to_add > 0 then
                            level_up_hand(card, poker_hand_key, true, levels_to_add)
                        end
                    end
                    update_hand_text({ sound = 'button', volume = 0.7, pitch = 1.1, delay = 0 },
                        { mult = 0, chips = 0, handname = '', level = '' })
                    return true
                end
            }))
            return {
                message = localize('k_level_up'),
                colour = G.C.MULT,
                sound = "dd1_laugh",
                card = card
            }
        end
red flower
#

these zeroes too

pastel kernel
#

What do I do

red flower
#

to_big(0)

pure salmon
#

someone submitted this bug report

#

for some reason, it only happens when you have 5 cards above the hand size limit, and at least one temporary card

#

under these conditions, using immolate crashes the game

#

the culprit is this table.sort function

#

i can't figure out why this would crash the game though

red flower
#

usually that error means that there can be two sort orders for the same array iirc

#

do you add a playing_card to your temp cards

pure salmon
#

yeah there has to be temporary cards in your hand for the crash to happen

pastel kernel
red flower
pure salmon
#

strangely the error doesn't happen if you TURN cards into the temporary edition with debugplus

#

just if they're created by an ephemeral

red flower
#

yeah, thats why i asked if you fill card.playing_card

pure salmon
#

oh

#

to be honest i don't exactly understand what that does but i'll try it

red flower
#

should be like this

pure salmon
#

ohhh that second line is the one i'm missing

pastel kernel
#

what the fuck

pure salmon
#

i see, it assigns every playing card a unique integer value for sorting

#

so when immolate calls table.sort the game sees cards with the same value and crashes

pastel kernel
red flower
#

like context.before or something

daring heron
pastel kernel
red flower
#

yeah but remove the and context.cardarea == G.play

bold sleet
#

Help, animated atlas is not going

-- Atlas tm
SMODS.Atlas {
    key = 'oscillator_atlas',
    path = 'oscillator_joker.png',
    px = 71,
    py = 95,
    atlas_table = "ANIMATION_ATLAS",
    frames = 2
}

-- inside whatever joker
        atlas = "oscillator_atlas",
    pos = { y = 0},
red flower
pastel kernel
red flower
#

instead of that do next(context.poker_hands["Flush"])

red flower
bold sleet
#

god

#

dammit

rotund sable
#

@bold sleet

pure salmon
#

thank you very much n' the crash is resolved

#

i would have had no idea to do that

bold sleet
rotund sable
#

Fps can be moved as a local variable inside the update function

bold sleet
#

was gonna 'fix' it with repeating events lmao

rotund sable
#

Mod 40 is the frames in animation

pastel kernel
#

How do I make it so that it doesn’t show a small “lvl. 12” pop up at the end

rotund sable
#

Like it stays?

#

And you don't want it?

#

SMODS.smart_level_up it was I think

pastel kernel
#

Anytime it levels up all poker hands

#

It shows a random “Lvl. 12” at the end

#

Then it disappears

rotund sable
#

SMODS.smart_level_up_hand

ocean goblet
#

how would i go about adding a specific extra card to the selection of a booster pack when it is opened?\

pastel kernel
rotund sable
#

?

#

I assume you're just using level_up_hand

pastel kernel
#
  calculate = function(self, card, context)
        if context.before and next(context.poker_hands["Flush"]) and not context.blueprint then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    play_sound('dd1_makudonarudo')
                    card:juice_up(0.3, 0.5)
                    update_hand_text({ sound = 'button', volume = 0.7, pitch = 0.9, delay = 0 },
                        { level = 'x' .. to_big(card.ability.extra.multiplier) })
                    for poker_hand_key, hand in pairs(G.GAME.hands) do
                        local current_level = hand.level or 1
                        local levels_to_add = math.max(0, math.floor(current_level * (to_big(card.ability.extra.multiplier) - 1)))
                        if levels_to_add > to_big(0) then
                            level_up_hand(card, poker_hand_key, true, levels_to_add)
                        end
                    end
                    update_hand_text({ sound = 'button', volume = 0.7, pitch = 1.1, delay = 0 },
                        { mult = 0, chips = 0, handname = '', level = '' })
                    return true
                end
            }))
            return {
                message = localize('k_level_up_ex'),
                colour = G.C.MULT,
                card = card
            }
        end
#

replace level_up_hand?

rotund sable
#

That fixed it for me

#

SMODS.smart_level_up_hand

lament agate
#

whats the name for rare tag

red flower
#

tag_rare iirc

ocean goblet
#

is there a way to check the specific type of a booster pack that has been opened?

formal parrot
#

Wrong chat

red flower
ocean goblet
red flower
#

whats the error

small tartan
#

Guys since the abandoned deck function is hardcoded, how can i make a deck spawn with ranks i want only?

quick kraken
#

You look at what abandoned deck does and do something similar

lament agate
#

is this right

small tartan
quick kraken
#

How does one check whether a card is enhanced at all?

small tartan
quick kraken
#

I tried #(SMODS.get_enhancements(context.other_card, false)) > 0 but it didn't work

quick kraken
red flower
#

add_tag(Tag("key"))

red flower
quick kraken
#

And that returns a boolean?

small tartan
quick kraken
#

or nil upon no enhancements?

lament agate
#

whats the key tho

#

tag_rare?

red flower
lament agate
#

@red flower how do you detect if the chips is higher than the mult

#

in the scoring

#

operator

red flower
#

hand_chips > mult ?

lament agate
#

thans

primal robin
#

to_big ehehe

lament agate
#

your mom's to_big

small tartan
#

@red flower to make KQJ dissolve, and 8,9,10 (with change_base) into FCR (my custom ranks)?

Second question, should i do Prefix_F, prefix_C etc?

zealous glen
lament agate
#

i have no idea

#

either way

#

it doesnt output the chips

#

any idea?

small tartan
small tartan
#

Like to make KQJ dissolve

red flower
#

joker? consumable?

small tartan
#

The cards in the deck

red flower
#

for what

lament agate
small tartan
#

Basically i want to turn AKQJ 10-2 into only A 10-2 and then turn 10,9,8 into FCR (custom)

red flower
small tartan
#

Ohhh Sorry, i'm doing a custom deck

red flower
#

probably :start_dissolve()? never worked with decks much sorry

small tartan
#

Oh okay, thanks anyways!!

lament agate
#
    config = { 
        extra = {
            chips = 200,
            xchips = 3
        }
    },
    loc_vars = function(self, info_queue, card)
        return { 
            vars = {
                card.ability.extra.chips,
                card.ability.extra.xchips
            }
        }
    end,
    calculate = function(self, card, context)
        if context.joker_main and context.full_hand then
            local hand_chips = context.poker_hands[context.scoring_name].chips or 0
            local mult = context.poker_hands[context.scoring_name].mult or 1

            if hand_chips > mult then
                play_sound('tngt_neverforget', 1.2)
                card:juice_up(0.5, 0.5)
                
                return {
                    colour = G.C.CHIPS,
                    chips = card.ability.extra.chips,
                    xchips = card.ability.extra.xchips
                }
            else
                card:juice_up(0.1, 0.1)
            end
        end
    end
}
#

chips doesnt output

red flower
#

whats the intended effect

lament agate
#

chips and xchips if chip counter number higher than the mult one

red flower
#

at the moment the joker triggers?

lament agate
#

after calculating the cards i presume the easist

red flower
#

ok that doesnt do that

lament agate
#

ah shit

#

what do

red flower
#

remove these

manic rune
#

hand_chips and mult are global variables which represent the chips and mult at the time i think?

lament agate
#

oh ok

#

thats it?

red flower
#

maybe

lament agate
#

testing

#

it works!!

#

ty

normal crest
#

np!!!

lament agate
#

who invited him

manic rune
hidden sable
rotund sable
#

do i really need to have SMODS.optional_features.retrigger_joker = true for retrigger jokers to work? because without this it isn't retriggering anything

shell timber
#

you do

small tartan
#

Sigh i'm going crazy

#

I May be stupid

bold sleet
#

help, my shit ain't doing stuff after all cards are scored and what not.

#

Am I stupid or is this shit lying to me?

#

and how fix

red flower
#

remove the cardarea check

bold sleet
#

Triggers instantly then.

#

Triggers the very second I play the hand.

#

unsurprisingly

small tartan
#

I can't figure out change_base correctly

bold sleet
red flower
bold sleet
#

alright!

small tartan
bold sleet
#

You are using modded ranks?

small tartan
bold sleet
#

So we can check it here

small tartan
#

Rn i can't login with GitHub because of passkey issues

#

@bold sleet @daring fern Sorry if i upload like this

bold sleet
#

perishes

small tartan
#

XD

#

Tomorrow with the other pc i'll upload to git tho

bold sleet
#

scream

small tartan
#

:3

In my defense, it's my First mod

bold sleet
#

At least you do some proper formatting.

small tartan
#

Sometimes, some other times it's a bit wonky

#

Depends if i'm coding on the go on my phone

bold sleet
small tartan
#

Thats not mine tho

#

I'm not so skilled XD

rotund sable
#

i have many in my codebase

#

i dont regret a thing

small tartan
rotund sable
#

you can also disable the whole file by

---@diagnostic disable: lowercase-global
small tartan
#

:0

#

I feel like reverse iron man, doing Toys with bleeding Edge tech

red flower
#

i think its better to use an uppercase global for convention but eh

rotund sable
#

i mainly use it for non-present talisman

red flower
#

oh i just open my mods folder when i work

rotund sable
quick scarab
#

game seems to crash when I try to use this joker but it seems like it's not its fault

#
config = { extra = { Xmult_gain = 0.15, Xmult = 1 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.Xmult_gain, card.ability.extra.Xmult } }
    end,
    calculate = function(self, card, context)
        if context.before and context.main_eval and not context.blueprint then
            local enhanced = {}
            for _, scored_card in ipairs(context.scoring_hand) do
                if next(SMODS.has_enhancement("m_fnaf_pizza")) and not scored_card.debuff and not scored_card.vampired then
                    enhanced[#enhanced + 1] = scored_card
                    scored_card.vampired = true
                    SMODS.destroy_cards(scored_card)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            scored_card:juice_up()
                            scored_card.vampired = nil
                            return true
                        end
                    }))
                end
            end

            if #enhanced > 0 then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain * #enhanced
                return {
                    message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
                    colour = G.C.MULT
                }
            end
        end
        if context.joker_main then
            return {
                xmult = card.ability.extra.Xmult
            }
        end
    end,```
#

Also I'm trying to make a joker where it destroys a card with a specify Enhancement when scored

#

before the hand is played

errant fulcrum
#

I'm using Negate Texture Pack template as a base, but this doesn't seem to be working
SMODS.Atlas{key = "Seal", path = "Enhancers.png", px = 71, py = 95, prefix_config = { key = false } }

red flower
hidden sable
#

this is balanced right

#

wrong chat 😭

small tartan
wheat jewel
#

Tried to implement the code of telescope to detect if a planet card is associated with your most played hand but it doesn't proc the Xmult upgrade

errant fulcrum
#

What's the parameter for the badge name on seals?

#

Looks like it's label

daring fern
daring fern
wheat jewel
#

Tried to move things around

#

added back the variables to the local variables i realized that

wheat jewel
#

main issue is making the game check the type of planet card used and whether it's associated with your most played hand

granite nymph
#

does anyone know why the rank is not working?

#

the suit works now

daring fern
wheat jewel
#

imma have to check what command allows for me to print to a console

rotund sable
#

print()

#

:o

wheat jewel
#

LOL

wheat jewel
#

since that is what gets printed out

granite nymph
#

the rank isnt showing the description

wheat jewel
#

tried this but it doesn't work

daring fern
granite nymph
#

ERRROR is supposed to be the rank

wheat jewel
idle plaza
sullen brook
#

So I'm a little confused... What is "juice_up" in the context of applying seals to a card? Is it the little wiggle it does?

idle plaza
sullen brook
#

Appreciate it. I'm trying to figure out the ins and outs of consumables and how they apply certain statuses. Stuck (no pun intended) on stickers rn.

hexed stump
#

ohoho I finally have figured out stickers

sullen brook
#

@hexed stump So in this code snip, I've got code that applies a seal, then I'm trying to apply a perishable sticker, but it simply does nothing. I don't think I'm referencing the appropriate object, just not sure of the exact syntax to do so.

red flower
#

youre applying the sticker to the consumable

hexed stump
#

^

#

typing is slow bc my keyboard is unhappy

sullen brook
#

Ah, ok... Yeah, that sounds about right

hexed stump
#

I ccidentlly did that when I was first trying to apply stickers

sullen brook
#

card, in this case, is referencing the consumable card played

hexed stump
#

Yep

red flower
#

yes

hexed stump
#

So you'll want to specify the highlighted card instead

sullen brook
#

so instead of card, would I reference #G.hand.highlighted?

red flower
#

G.hand.highlighted[i]

sullen brook
#

[i] because of the for loop, which circles through all selected cards

red flower
#

exactly

idle plaza
red flower
#

\#

hexed stump
#

Okay I’m on my phone now though I’ve still gotta suffer through the keyboard for coding

modern kindle
#

hi N

red flower
#

hi D

modern kindle
#

how are you my friend buddy pal

idle plaza
red flower
red flower
modern kindle
#

hell yea, im very tired but im doing okay
wondering what i shall have for dinner tonight

#

went out and bought my little brother a wii power adapter causae he lost his

#

might this weekend go to another game shop and see if i can find anything good

sullen brook
#

@red flower @hexed stump Thanks a ton you two, been bashing my head against that for a bit now. Building the mod whilst also learning LUA and how to do all this at the same time is a bit of a challenge. This community is an absolute godsend.

hexed stump
#

Yeah everyone was nice and helpful when I started too

frigid cargo
#

Real

hexed stump
#

It’s a very nice place

sullen brook
#

Those perishable stickers aren't ticking down, but that's a struggle for another day. Gotta go do the 'merica day thing.

modern kindle
#

we gotta start being meaner

hexed stump
red flower
#

there's also card:set_perishable() iirc

hexed stump
#

That’s probably better for vanilla stickers

serene granite
#

Hey N, remember when you helped me with the certificate like joker? for some reason, i just realized the cards are being added to my deck but i cant see them in my full deck screen

#

is there a reason for that, also sorry for bugging you so much haha

red flower
#

uhhh

#

i think i forgot to add that stuff when i switched to the smods function

#

let me test and fix it

serene granite
#

oo ok ! thank you

chrome widget
#

What's the field for the mod that a center originates from?

#

is it just center.original_mod?

red flower
#

im pretty sure yes

#

.mod is the last take ownership iirc

chrome widget
#

is the mod a string or is it the full mod object?

red flower
#

it's the full mod object

chrome widget
#

cool

faint yacht
#

.config.center.original_mod, yeah.

red flower
serene granite
#

wait what was the fix?

zealous glen
zealous glen
modern kindle
chrome widget
#

hello hello!!!

modern kindle
#

Winteerrr

chrome widget
#

Doing challenges for my mod

#

And by doing, I mean thinking, because we put so little thought into them

zealous glen
zealous glen
urban wasp
# urban wasp spawning a mythic joker doesn't change anything...

bump

for context, i'm patching into cryptid's lib/content.lua and making it so that if you have any of these rarities from my mod, the exotic music will also play. for some reason, exotic music doesn't play when any of these rarities are owned, and i'm stumped

daring fern
red flower
urban wasp
daring fern
# urban wasp i've never done a hook before, but that'll probably work. any documentation on h...
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...

chrome widget
wheat jewel
#

I tried to implement DNA's code into a joker but i'm trying to make it duplicate multiple cards in a hand, but it only does one even in a for loop

rotund sable
wheat jewel
rotund sable
urban wasp
# daring fern Why not just hook `SMODS.Sounds.cry_music_exotic.select_music_track`?

did i do this wrong?

-- hook into the music_exotic select_music_track function thing to add more of my rarities
local original_select_music_track = SMODS.Sounds.music_exotic.select_music_track
SMODS.Sounds.music_exotic.select_music_track = function()
    return (original_select_music_track and original_select_music_track())
        or #Cryptid.advanced_find_joker(nil, "crp_exotic_2", nil, nil, true) ~= 0
        or #Cryptid.advanced_find_joker(nil, "crp_mythic", nil, nil, true) ~= 0
        or #Cryptid.advanced_find_joker(nil, "crp_exomythic", nil, nil, true) ~= 0
        or #Cryptid.advanced_find_joker(nil, "crp_2exomythic4me", nil, nil, true) ~= 0
        or #Cryptid.advanced_find_joker(nil, "crp_22exomythic4mecipe", nil, nil, true) ~= 0
        or #Cryptid.advanced_find_joker(nil, "crp_exomythicepicawesomeuncommon2mexotic22exomythic4mecipe", nil, nil, true) ~= 0
end
urban wasp
#

why is it crashing? what did i do wrong

daring fern
urban wasp
#

ah

wheat jewel
# rotund sable

So i'm guessing I should place it inside of where the copy is created?

daring fern
wheat jewel
#

should be working now

serene granite
hexed stump
#

💪 got my code in separate files finally no more scrolling down 1500 lines to work on an unrelated thing

wheat jewel
#

Is it possible to have stone cards also include their original card rank through a joker?

tawdry oriole
#

how do you create a custom info-queue? (rather than using a vanilla one)

daring fern
tawdry oriole
# daring fern You would create a custom localization entry and refer to that.

that i figured
i'm using info_queue[#info_queue + 1] = {key = "mucho_tooltips_thecore", set = "Other"} in the loc_vars code of the joker (before the return) and the code itself in the localization is this one

return {
    Other = {
        mucho_tooltips_thecore = {
            name = "...",
            text = {{"..."},
            {"..."}}}
    }
}

yet this is what appears

serene granite
#

how do i call specific tags in smodded, i want to make orbital tags with a joker but idk what to call for that

#

also negative tags maybe

red flower
serene granite
#

ok will do !

daring fern
serene granite
#

and it would be the same for negatives?

wheat jewel
daring fern
wheat jewel
#

fixing it atm

daring fern
#

It would be SMODS.find_card instead of find_joker

wheat jewel
#

got it

hardy viper
#

from_omega

daring fern
#

Hooks shouldn't be in a joker.

wheat jewel
daring fern
wheat jewel
daring fern
wheat jewel
#

looking at the documentation on SMODS atm i get what has_no_rank does now

wheat jewel
daring fern
oblique pond
#

if you have a showdown blind with an in_pool, do you have to re-make the only appears on multiples of win antes restriction

daring fern
# wheat jewel I think this might work
local oldsmodshasnorank = SMODS.has_no_rank
function SMODS.has_no_rank(card)
    if next(SMODS.find_card("j_modprefix_key")) and SMODS.has_enhancement(card, "m_stone") then return false end
    return oldsmodshasnorank(card)
end
daring fern
#

Move it out of the joker.

wheat jewel
#

Ohhh gotcha

chrome widget
#

Is there an effective way to do alt win conditions for challenges?

placid star
#

does table.remove() accept a table named index instead of a position? (whoops)

primal robin
#

no

maiden phoenix
chrome widget
#

shrug guess so?

round iris
#

hello!! i am aware that for multi-part jokers you can set where their Atlas sprite is independently but i was curious to know if for different parts of a joker sprite you could set their screen position differently? trying to have the effect of a joker that mostly sits flush with normal jokers but has things happening independent of it and am not sure how to achieve such an effect without seperately controlling the screen positions of the different parts,,,

thorn basin
#

guys, do you know if there's a way to make the perma_bonus to apply extra mult instead of chips?

daring fern
thorn basin
#

ooooh, there's a list of perma_bonuses

#

thank you!

vague crest
#

attempting to make a joker which either duplicates or destroys cards in played hand, chosen at random, and it just 9/10 times destroys every card?

#

is somethng off with the math here ive attempted so many times im refusing to believe its just that im just getting that luck every time

#

very occasionally it wont destroy one of the cards

#

i dont actually have the duplication set up yet but that shouldnt matter for this part

#

it seems to be a proper 1 in 2 if i only score one card so is the calculation maybe taking place more times than it should or something?

vast night
#

hi. i couldnt find anything so im asking here. where do i find the mods folder via SMODS?

bold sleet
daring fern
vague crest
#

cool will try 🙏

bold sleet
#

hold on

vast night
bold sleet
#

Ah uh...

tepid crow
#

what do you need it programatically for?

vast night
vague crest
daring fern
vague crest
#

OH wait i think i see

daring fern
vast night
#

like

tepid crow
#

current_mod doesn't always exist/isn't always properly defined

vast night
#

i remember using smtn but i just cant remind myself of it

vast night
tepid crow
vast night
#

while smods is loaded obv

daring fern
vast night
vast night
tepid crow
unborn bay
#

can't you like pass parameters to a love2d thread

#

you can just pass the current mod directory that way

tepid crow
vast night
tepid crow
#

if you want the current mod's path there's SMODS.current_mod.path (current_mod is only defined the first time the file is ran)

serene granite
#

ok this is an idea for a joker i have but im not sure if its possible so im asking here to get an idea

is it possible to detect if the first two cards played in a full house are smaller than the last three, then have an effect happen if that is true?

tepid crow
#

also there is an SMODS.https if you need it

vast night
vast night
thorn furnace
#

Bump

#

I notice the error doesn't happen if I change the button function
But I have the function defined

serene granite
serene granite
#

then how do u know its possible?

hidden sable
#

don't argue with the ways of mr poly bridge

#

he has all seeing knowledge

#

but only on if this are possible

serene granite
#

gosh ok

maiden phoenix
#

You check if your hand is a full house, you check your cards, get the min and max rank, check if the first two cards are equal to the min, gg

serene granite
#

ooo ok i like that approach, basically just checking the first 2 instead of all the cards twice kinda

maiden phoenix
#

I mean you specified "if the first two cards played in a full house is smaller than the last three"

serene granite
#

yeah i just wasnt thinking that way,

limber blaze
#

how i would do it is like

maiden phoenix
#

If the two small cards can be anywhere else that's a bit more complex

limber blaze
#

get the max rank of the first two and get the min rank of the last 3 and compare them

#

youd only need to check 1 thing that way

serene granite
#

hmmm so like compare the biggest rank of the first two to the smallest rank of the last three

limber blaze
#

yes

#

please correct me if this logic is bad

#

but im pretty sure it would work

serene granite
#

in my head i think that works

fallow breach
#

does anyone know where custom challenges go in the mod folder?

serene granite
#

thanks for the help, this joker will prob be the most complex one for me so i appreciate it

red flower
fallow breach
#

okay i just wasn't sure

#

they just go in the main lua file then

red flower
#

yeah

steel dock
#

hi

serene granite
#

is it e_poly or e_polychrome

daring fern
serene granite
#

thanks

errant fulcrum
#

Anyone know why my modded seal shows up as a stone card in the collection?

idle plaza
errant fulcrum
#
    name = "Rabbit Hole",
    key = "s_rabbit",
    badge_colour = HEX("4F483F"),
    config = { mult = 5, chips = 20, money = 1, x_mult = 1.5  },
    loc_txt = {
        -- Badge name (displayed on card description when seal is applied)
        label = 'Rabbit Hole',
        -- Tooltip description
        name = 'Habbit Hole',
        text = {
            'Draw a {C:attention}7{} into',
            'your hand when played'
        }
    },
    loc_vars = function(self, info_queue)
        return { vars = {self.config.mult, self.config.chips, self.config.money, self.config.x_mult, } }
    end,
    atlas = "Sigils",
    pos = {x = 5, y = 0},

    -- self - this seal prototype
    -- card - card this seal is applied to
    calculate = function(self, card, context)
        -- main_scoring context is used whenever the card is scored
        if context.main_scoring and context.cardarea == G.play then
            SMODS.create_card(set == 'Playing Card', area == G.hand, no_edition == true, rank == '7')
        end
    end,
}```
#

Dawg

#

I reversed the axes

errant fulcrum
#

Oh. I dont know

hidden sable
scarlet imp
#

I want to have to Joker with an active ability, like how a "Use" button pops up for Consumables but on a Joker. Anyone know where I could start?

daring fern
granite nymph
#

how qwould i go about making a joker not appear in the shop, judgmenet, or any other sources besides a specific joker spawning it

hexed stump
#

Now I need to do the other 19

#

(Which is really only like, 6 tangibly different things)

fallow breach
#

why aren't the jokers appearing as negative in the challenge?

chrome widget
#

it's edition = 'negative' instead

fallow breach
#

ah alright

scarlet imp
#

anyone who's worked with UI before, can you help me find the problem in this code?

local use = {n = G.UIT.C, config = {align = "cr"},
  nodes = { { n=G.UIT.C, config = {
              ref_table = card,
              align = "cr",
              maxw = 1.25,
              padding = 0.1,
              r = 0.08,
              minw = 1.25,
              minh = (card.area and card.area.config.type == "joker") and 0 or 1,
              hover = true,
              shadow = true,
              colour = G.C.UI.BACKGROUND_INACTIVE,
              one_press = true,
              button = "use_card",
              func = "can_use_joker"
          },
          nodes = {
              { n = G.UIT.B, config = { w=0.1 ,h = 0.6} },
              { n = G.UIT.T, config = { text = localize("b_use"), colour = G.C.UI.TEXT_LIGHT, scale = 0.55, shadow = true }}
          }
      }
  }
}
return {
  n = G.UIT.ROOT,
  config = {padding = 0, colour = G.C.CLEAR},
  nodes = {
    { n = G.UIT.C, config = {padding = 0.15, align = "cl"}, nodes = {
        { n = G.UIT.R, config = {align = "cl"}, nodes = { sell } },
        { n = G.UIT.R, config = {align = "cl"}, nodes = { use } }
    }},
  }
}

If I comment out the definition for use, this code works fine. For context, I'm trying to add a "Use" button to Jokers

errant fulcrum
#

Can anyone tell me why this is spawning a card of a random rank
SMODS.add_card({set = 'Base', area = G.hand, no_edition = true, rank = '7'})

errant fulcrum
#

1.0.0-beta-0530b

red flower
#

update :3

granite nymph
#

colors dont work :(

errant fulcrum
proper tangle
#

two questions:

  1. how might i generate a random rank?
  2. how might i create a joker that has to store five ranks and re-randomize them when a blind starts? (is there something similar that i could use as a base in cryptid?)
granite nymph
proper tangle
#

damn

serene granite
#

heyy so i am trying to make a joker that works kind of like faceless joker but instead of face cards, it works when steel cards are discarded, do i detect the steel cards being discarded using m_steel or is it something else? any advice for this

crisp coral
scarlet imp
#

this is a hook

crisp coral
#

does sell local exist

granite nymph
#

if there’s a behavior a vanilla joker does always sample vanilla remade

solemn shuttle
#

how does one refer to the shop rate of a (custom) consumable? [im doing voucher stuff/adjusting said rate for context lmao]

i see in the docs that it's G.GAME[key:lower() .. '_rate'] [in the ObjectType page]
but

say the key for the consumable is nix_consume,

would i do G.GAME[nix_consume:lower() .. '_rate']
or use the prefix additionaly
-# so wsh_nix_consume

or am i missing smth here

crisp coral
#

hm

scarlet imp
crisp coral
#

what's the crash

daring fern
solemn shuttle
#

OHHH

scarlet imp
#

hang on, do I need to have can_use_joker defined somewhere in my code before I can use this? that might be what's causing it

thorn basin
#

does someone know which command is for getting the total value of chips scored from a played hand?
I was trying something like "card.ability.extra.chips = context.scoring_hand.chips" but I'm not sure if this would work...

crisp coral
#

looks like it

serene granite
solemn shuttle
scarlet imp
#

alrighty thank you guys

daring fern
thorn basin
daring fern
thorn basin
#

thx!

glass scaffold
daring fern
glass scaffold
thorn furnace
#

Noticed something weird with one of my UI buttons
The first time you click on it, it's all messed up
But the second time (and all times after), it works properly
Can't figure out why

red flower
#

u need to warm it up first

thorn furnace
#

wha

red flower
#

u need to punch it until it works like an old tv

thorn furnace
#

real

red flower
#

never seen that tho

proper tangle
#

how can i get a list of all ranks currently loaded?

#

not just all ranks available in the deck, but ALL ranks

thorn furnace
scarlet imp
manic rune
proper tangle
glass scaffold
#

Ok, 2 issues now, but at least I avoid crashes.

Anyone know how to get both debuffs to work and to fix that ugly blind at the top left?

thorn furnace
manic rune
#

if its the same problem, then you want to force it to run :recalculate() again after its loaded

red flower
manic rune
#

yeah, basically making an ui reload itself

thorn furnace
#

o

#

like this?

#

ignore scale and h that was done to debug

proper tangle
#

notepad++ spotted!!

manic rune
#

you probably only need to use recalculate on it once

scarlet imp
#

function:

-- "Can use" function for Jokers
function Card:can_use_joker(any_state, skip_check)
    if not skip_check and ((G.play and #G.play.cards > 0) or
        (G.CONTROLLER.locked) or
        (G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) then
            return false
    end
    if G.STATE ~= G.STATES.HAND_PLAYED and G.STATE ~= G.STATES.DRAW_TO_HAND and G.STATE ~= G.STATES.PLAY_TAROT or any_state then 
        
    end
    return false
end

I left the main section empty for now since I just want to make the button appear first

thorn furnace
manic rune
#

what does your button code look like

red flower
thorn furnace
#

i have it patched into the ui

manic rune
#

🤔 does it really need patching, i thought u can achieve the same with just hooks

red flower
thorn furnace
#

/more compatible

manic rune
#

anyways, i think the func should be in G.UIT.B's config maybe?

thorn furnace
#

ultimately i want the mod to interfere with as little things as possible

thorn furnace
scarlet imp
manic rune
#

mhm

thorn furnace
#

okii

manic rune
#

i have to go buy breakfast rq, if it still doesnt work uhhhhhh :3

scarlet imp
glass scaffold
#

(ignore the discord overlay.)

red flower
#

uhh maybe the image is the wrong size

#

like you put x1 in x2

unborn bay
#

this looks like you- FUCK

glass scaffold
unborn bay
#

its always 34x34

#

when did someone tell you that blind chips are 17x17

scarlet imp
# red flower 1

alright last thing, the way it's formatted can I have a can_use and use function inside each specific card like for consumables, or do I need to place that inside the main section of this function?

red flower
#

i mean i havent read what youve done honestly

glass scaffold
red flower
thorn furnace
unborn bay
#

wasn't it e.UIBox:recalculate() here or smth

manic rune
#

weird, it should be defined

thorn furnace
unborn bay
#

i forgot idk

manic rune
#

🤔 the text input code only needed me to use e:recalculate()

#

maybe its different for this

thorn furnace
manic rune
#

damn

red flower
#

func is called every frame

thorn furnace
#

yea but it should only recalculate once

#

stack overflow implies that it broke via recursion or something

red flower
#

my guess was that recalculate called recalculate again when it defined func

#

but yeah it shouldnt reach there

thorn furnace
#

o

#

so I tried putting e.UIBox:recalculate() in the original function and it didn't even give me like an error message it just closed my game

red flower
#

yeah theres some overflowing situation going on

daring fern
#

The problem seemed to be that the values weren't being removed so when they were calculating they were also keeping the values of previous enhancements.

final jewel
#

what do I write after card = ... , if I want the message to be shown under the joker ?

manic rune
#

message_card = card?

real night
#

how do you give a poker hand a specific amount of chips or mult

flat siren
#

i have the opposite problem, i want the message to be under the card and not the joker

vague crest
#

if im creating a joker via another joker (for example riff raff) how would i give that joker a specific edition?

manic rune
final jewel
#

yeah like that SMODS.add_card{key = "j_xxxxx", edition = "e_negative"}

vague crest
#

ohhh ok

manic rune
#

if its the same context

#

else uhhh message_card = just any card you want it to be shown under

vague crest
#

so if im adding just any random joker id do it like so?

manic rune
#

looks like it