#💻・modding-dev

1 messages · Page 601 of 1

daring fern
#

Yes, you need to hook Card:calculate_seal

fluid steppe
#

yeah i did

#

well

#

actually no i did it differently

daring fern
fluid steppe
#

look

#

i did it differently

#

and it works

plucky berry
#

Guys im tryna do cerimonial dagger as an enhancement but it's softlocking the event is not triggering just once, pls help

            local my_pos = nil
            for i = 1, #G.play.cards do
                if G.play.cards[i] == card then
                    my_pos = i
                    break
                end
            end
            if context.full_hand == 1 then return end
            if context.cardarea == G.play and my_pos and G.play.cards[my_pos + 1] and not SMODS.is_eternal(G.play.cards[my_pos + 1], card) and not G.play.cards[my_pos + 1].getting_sliced then
                local sliced_card = G.play.cards[my_pos + 1]
                context.destroy_card = sliced_card
                sliced_card.getting_sliced = true
                G.E_MANAGER:add_event(Event({
                    func = function()
                        card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
                        card:juice_up(0.8, 0.8)
                        sliced_card:start_dissolve({ HEX("57ecab") }, nil, 1.6)
                        play_sound('slice1', 0.96 + math.random() * 0.08)
                    end
                }))
                if context.individual then
                    return {
                        xmult = card.ability.extra.xmult
                    }
                end
            end
        end```
fluid steppe
#

you cant tell me to do something different if it works

#

im not gonna rip out perfectly fine code to do it the way you did it when nobodys gonna be able to tell the difference

slim ferry
#

also you need a context check other than just the cardarea since this will trigger in a lot of unintended places i imagine

fluid steppe
#

there are some other context checks

#

oh also you should do context.fullhand <= 1 not == 1

#

because. cryptid

slim ferry
#

missing a #

#

and yeah

#

that

#

also i dont see the point in doing the played hand size check like that, not exists for a reason

plucky berry
#

xmult is not triggering tho

slim ferry
#

yes, you need to use context.main_scoring for playing cards

plucky berry
#

in both?

slim ferry
#

both what

plucky berry
#

before return xmult and before the slice event i mean

slim ferry
#

you need to replace context.individual with thgat

plucky berry
#

and for the destroying of the card which context should i check other than g.play

slim ferry
#

probably use context.before

plucky berry
#

aight

#

i'll try

slim ferry
#

idk if that gets calculated for playing cards but its worth a shot

#

since using main_scoring for that will make it get retriggered

plucky berry
#

i don't know how to code and i was getting a lot of comparing table with number errors

slim ferry
#

mods dont work with talisman by default

#

you need to do like a bunch of extra stuff because talisman turns a lot of numbers into tables

fluid steppe
#

you can add an incompatibility thing in your json file

plucky berry
#

i guess i'll get into that

slim ferry
#

vanillaremade wiki has a thing about talisman all the way at the bottom

plucky berry
#

i'm making a huge content mod so i've been busy with a lot of stuff

plucky berry
#

i'm the only developer

plucky berry
#

and i have like 50 jokers and a lot more

slim ferry
#

its more tedious than anything

plucky berry
#

yeah

slim ferry
#

good thing vscode allows you to search in all files so you can just search for < and >

plucky berry
#

didn't know that it'll be useful

lyric wadi
#

when the e shop goes up to e

plucky berry
#

wow i just got an attempt to compare table with number crash

#

without talisman

#

and i just added the contexts and the <= 1

slim ferry
#

yeah thats probably because it should be #context.full_hand

#

because context.full_hand is a table of cards

plucky berry
#

okay

#

xmult is still not triggering with context.main_scoring tho

#

ok i just removed the context and it's working

#

jk it's triggering too early

#

ok fixed it finally

lone oyster
plucky berry
#

the enhancement destroying the cards is causing this bug,,, how do i fix

prisma loom
#

How do I write this part properly?

#

im kind of a newbie

plucky berry
# daring fern Code?
    key = "cazzimma",
    atlas = "enhancements",
    unlocked = true,
    discovered = true,
    pos = { x = 2, y = 0 },
    config = { extra = { xmult = 1, xmult_mod = 0.2 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.xmult_mod } }
    end,

    calculate = function(self, card, context)
        if context.cardarea == G.play then
            local my_pos = nil
            for i = 1, #G.play.cards do
                if G.play.cards[i] == card then
                    my_pos = i
                    break
                end
            end
            --if #context.full_hand <= 1 then return end
            if context.before and context.cardarea == G.play and my_pos and G.play.cards[my_pos + 1] and not SMODS.is_eternal(G.play.cards[my_pos + 1], card) and not G.play.cards[my_pos + 1].getting_sliced then
                local sliced_card = G.play.cards[my_pos + 1]
                context.destroy_card = sliced_card
                sliced_card.getting_sliced = true
                G.E_MANAGER:add_event(Event({
                    func = function()
                        card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
                        card:juice_up(0.8, 0.8)
                        sliced_card:start_dissolve({ HEX("57ecab") }, nil, 1.6)
                        play_sound('slice1', 0.96 + math.random() * 0.08)
                        return true
                    end
                }))
            end
                if context.main_scoring then
                    return {
                        xmult = card.ability.extra.xmult
                    }
                end
        end
    end
}```
daring fern
daring fern
prisma loom
daring fern
prisma loom
#

👌

plucky berry
daring fern
plucky berry
#
    key = "cazzimma",
    atlas = "enhancements",
    unlocked = true,
    discovered = true,
    pos = { x = 2, y = 0 },
    config = { extra = { xmult = 1, xmult_mod = 0.2 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.xmult_mod } }
    end,

    calculate = function(self, card, context)
        if context.cardarea == G.play then
            local my_pos = nil
            for i = 1, #G.play.cards do
                if G.play.cards[i] == card then
                    my_pos = i
                    break
                end
            end
            --if #context.full_hand <= 1 then return end
            if context.before and context.cardarea == G.play and my_pos and G.play.cards[my_pos + 1] and not SMODS.is_eternal(G.play.cards[my_pos + 1], card) and not G.play.cards[my_pos + 1].getting_sliced then
                local sliced_card = G.play.cards[my_pos + 1]
                context.destroy_card = sliced_card
                sliced_card.getting_sliced = true
                G.E_MANAGER:add_event(Event({
                    func = function()
                        card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
                        card:juice_up(0.8, 0.8)
                        SMODS.destroy_cards(sliced_card, nil, true)
                        play_sound('slice1', 0.96 + math.random() * 0.08)
                        return true
                    end
                }))
            end
                if context.main_scoring then
                    return {
                        xmult = card.ability.extra.xmult
                    }
                end
        end
    end
}```
prisma loom
#

Does this function work for other Booster Packs?

#

(omen globe effect)

#

mixing the pool of the booster pack

plucky berry
#

i think that doesn't randomize the pool inside the pack, it selects a random pool before and then sticks to that

#

like you'd have one pack with only jokers and one with only spectral ec

plucky berry
#

i can share you a function that i used to randomize pools but it's probably garbage code (even tho it works for me)

plucky berry
#

my mod prefix is napoli so you'd need to change that possibly

#

this is an external function btw i just return G.GAME.modifiers.napoli_pool_shuffle_active = true when i need it

prisma loom
#

I just want to ask first if its possible to make this function have multiple sets as the first value:

#

cuz if its possible then it would work just with this piece of code

#

currently it works if I only type in 'Arcana'

daring fern
prisma loom
#

full pool mix

#

basically

daring fern
prisma loom
#

like add to the main.lua?

prisma loom
burnt tide
#

How can I change blind requirement when i use a deck ?

plucky berry
plucky berry
prisma loom
# daring fern Yes.

Wait, hold on
does SMODS.Booster:take_ownership_by_kind specifically works only on Arcana packs?

nvm

burnt tide
daring fern
daring fern
burnt tide
daring fern
prisma loom
burnt tide
prisma loom
#

what playing cards are called?

bold sleet
#

Hi chat. Is there a way to do this but also with custom stickers?

elder rune
#

trying to add a new consumable set

#

and the name shows up correctly

#

but not the badge color

daring fern
daring fern
prisma loom
prisma loom
prisma loom
#

and it includes both base and modified

bold sleet
slim ferry
#

lmao

#

cool

elder rune
prisma loom
bold sleet
slim ferry
#

its like some king of erratic pack from hypernova (play hypernova)

slim ferry
#

i need to shill my mod

elder rune
#

hmmm

#

if you play mine

bold sleet
elder rune
#

damn I guess you could say... that man shows

#

like some king of... showman

bold sleet
#

Showman taken to the next next level

bold sleet
elder rune
#

shwoman

#

nah twin idk

#

bruh is this like an unsolved mystery like

tranquil axle
#

hey so I want to make a balalo mod but I have a whopping 5 minutes of experience with them (but I do have a lot of minecraft modding experience), basically I want the mod to

  • greatly increase caps on hermit/temperance (like 3x)
  • make all the spectrals have same chances, so soul would be just as common as aura
    that's probably it I just wanna have more fun
#

and I have no idea how to do that, any help at all would be appreciated

#

hold on why is canio called caino in the code

elder rune
#

epic prank

slim ferry
#

thunk moment

#

wait until you find out that the key for seltzer is selzer
and gluttenous_joker for gluttonous joker

tranquil axle
#

no stop it

sturdy compass
#

caino

elder rune
#

I still dont know why the hell the color badge isnt correct for the damn consumable set

slim ferry
#

and that consumable is spelled "consumeable" literally everywhere

tranquil axle
#

anyway I think I found where the values are (game.lua init_item_prototypes line 547 or so), but I tried doing

Game.P_CENTERS.c_hermit.config.extra = 100;
Game.P_CENTERS.c_temperance.config.extra = 100;

and it crashed saying P_CENTERS was null

slim ferry
#

G.P_CENTERS

tranquil axle
#

alr

#

yaya it worked (probably)

elder rune
#

Also consumable descriptions doesnt appear for the operator cards

slim ferry
tranquil axle
#

IT WORKS

#

that was too easy

drowsy cloud
#

anyone know of a mod that has an effect that makes certain ranks count as other ranks i could take a look at the code for

slim ferry
#

ortalab has index cards that do that

#

i havent looked at it but i can tell you that its probably very complicated

#

since the current system for checking ranks doesnt allow for it very easily

drowsy cloud
#

ok thanks. i think there is a hacky less complicated way to do it that would have bad interactions with any rank choosing joker

slim ferry
#

its probably easier if youre making a card count as only one different rank that replaces the normal one

#

but multiple ranks is like hard

drowsy cloud
#

the two effects im trying to make are King + Queen can be paired/3oak/4oak/5oak and maybe also letting all face cards do that but the latter might be biting off a little more than i can chew

wispy falcon
#

Why do I get this crash?

    key = "mirror",
    shader = "cstorm_mirrorShader",
    in_shop = true,
    weight = 3,
    extra_cost = 5,
    badge_colour = G.C.CSTORM.GREY,
    --sound = { sound = "cstorm_static1", vol = 0.7 },

    calculate = function(self, card, context)
        if card.debuff then
            SMODS.debuff_card(card, "prevent_debuff", "source")
            if self.ability.set == "Joker" then
                local RNGesus = pseudorandom_element(G.jokers.cards, "mirrorReflect", not card.debuffed)
                SMODS.debuff_card(RNGesus, true, "mirrorEdition")
            end
        end
    end
}```
elder rune
slim ferry
elder rune
#

Everything looks like it should work

tranquil axle
#

sorry to interrupt again but I think I found the code that needs changing, I just want to remove that big if not forced_key and soulable... I think? Either removing that makes it not appear at all or appear normally, can't tell

slim ferry
wispy falcon
slim ferry
#

card.ability.set

tranquil axle
slim ferry
tranquil axle
#

oke

slim ferry
#

since mods can add other hidden consumables

tranquil axle
#

alr more code digging time

slim ferry
#

you should check lovely/dump from your mods folder

#

that has the code after lovely patches

drowsy cloud
wispy falcon
slim ferry
#

what is it even supposed to do

drowsy cloud
#

i'm pretty sure you'd end up with a 99.968% chance to find the soul in any mega arcana pack

tranquil axle
#

so heres the tweaked version from lovely/dump, now how do I change the constants?

wispy falcon
slim ferry
tranquil axle
#

yeah I know I need to do that I'm asking how I do

#

I just got here

tranquil axle
#

alr ty

solid salmon
#

chat

drowsy cloud
#

the documentation in the multiplayer mod is a work of art

solid salmon
#

chat

#

does anyone know how to make

#

a card sleeve?

slim ferry
#

check the documentation of the cardsleeves github

wispy falcon
solid salmon
#

neat

fluid steppe
#

was this worth the effort i put into it given it's a common food joker? yes someone could scale it using some other joker from some other mod and turn it into a shit ton of xmult. granted theres way better jokers to do that with but still it's what i'm telling myself

tranquil axle
#

Pattern '0.997' on target 'functions/common_events.lua' for pattern patch from uncapped\lovely.toml resulted in no matches
and my lovely.toml file:

[manifest]
version = "0.1.0"
priority = 10000

[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
pattern = '0.997'
position = 'at'
payload = '0.5'
match_indent = true
#

anyone know how to fix?

#

the docs say you can only do it on whole lines which is an annoying restriction

#

but multiplayer also touches that exact line and I want multiplayer as well

frosty rampart
#

go check in the lovely dump for how the line looks after multiplayer patches it, and then you can use that as your target

tranquil axle
#

ykw thats a good point

#

yo pog it works

#

time to have some big fun

#

finally my first soul in 5 months (not a joke)

#

ante 6, looks about right

#

tho the blueprint/brainstorm/baron (was ecto-d) were completely natural

#

actually what if ecto didn't decrease hand size

wispy falcon
#

How do you debuff a card with DebugPlus?

azure valley
wispy falcon
random elm
#

Does anybody know where I can find the specifc card ids of all playing cards

lavish elm
random elm
#

ah ok

#

ty

elder rune
#

Im trying to make a operator that takes the bitwise or between chips and mult, but it crashes on line 24 about trying to compare a table with a value even though im only putting in chips and mult into the function

tired moat
#

i’m bored if any mod developers need help with joker ability ideas pls message me

faint yacht
elder rune
fossil ermine
#

this keeps crashing game

#

i just wannya destroy the leftmost joker

red flower
#

what's the crash

fossil ermine
#

nvm fixed it

#

it was abt index stuff

wintry solar
#

the crash was because you had a # there, which gives the length of the table

fossil ermine
# fossil ermine

nah i added that cuz it was crashing but then i removed it when doin this fix

urban wasp
#

this modification causes every discarded card to draw two more cards when held in hand in any way; i just want it to draw cards when it itself is discarded

...
    calculate = function(self, card, context)
        if context.discard then
            SMODS.draw_cards(card.ability.extra.card_draw)
            return {
                message = "+" .. tostring(card.ability.extra.card_draw) .. " Cards Drawn",
                colour = G.C.BLUE
            }
        end
    end
...
daring fern
urban wasp
#

ty

solemn shuttle
#

is there a way to have it so you can change what suit a blind debuffs mid round

#

i know how to check for contexts in that regard ofc im just wondering how i can change the value and it actually Show ig

#

as adjusting blind.config.blind.debuff.suit or self.debuff.suit within the blind's calculate dont seem to work

copper perch
#

Sorry I keep coming back to this, its just this 1 card giving me troubles at the moment. Since context.end_of_round does not go off until the end of a PVP and theres no cards if 1 person does all their cards 1st, I figured out I'd need to set an else if for if its the final hand and once thats done scoring. Would there be a way to do this??

bold sleet
#

I ask again, is there a way to create cards with modded stickers for challenges?

fossil ermine
#

can a joker check that it actually destroyed a joker

#

when its trying to destroy a joker

bold sleet
#

Hold on, let me check the SMODS real quick.

#

... or not

red flower
bold sleet
#

I guess N' will answer faster than me.

red flower
#

or an event

fossil ermine
#

currently destroying it like this

#

and i want to like use it to make a counter go up if it destoys smth

red flower
#

like the issue is that the check for a joker being destroyed or not is exclusively done by what's destroying it in regular circumstances, so any joker that doesn't get destroyed is either because some modded shenanigans or the new smods context

bold sleet
#

sliced_joker.config.center.set == 'Joker', maybe?

#

idk

fossil ermine
#

that'd probs works

bold sleet
#

if card.ability.eternal then ... end

#

Do note that that only checks for the eternal sticker.

#

Not eternal-like effects.

#

I think smods added something like that

orchid bolt
#

theres probably code in ceremonial dagger for that kinda stuff

fossil ermine
#

yea found it

random elm
#

does anyone know why my tarot card image is missing

#

i defined the atlas properly and referenced said atlas in the declaration

#

and i have images in both the 1x and 2x folders

frosty rampart
#

show your full atlas image, indicate which one is supposed to appear for the card, and then show the tarot card's full code

random elm
tight pumice
#

Trying to learn some stuff so I'm messing around with making weird jokers. Making one that has a 1/2 chance per scoring card to either make the card lucky, or if its already lucky to destroy it. The random chance to make it lucky is working properly, but I'm having trouble getting it to kill the lucky cards

#

Anyone have a code example of deleting a card after scoring? Or an idea of what that might look like

#

Essentially treating it like a glass card that has rolled the RNG to shatter after the hand is scored

red flower
#

have you checked the code for glass cards

tight pumice
#

Yeah I've looked at it but I might need to more

orchid bolt
#

sixth sense scores a card before destroying it

tight pumice
#

Yes nice thank you

#

I knew I was forgetting a joker

frosty rampart
# random elm

and i assume your image file is named exactly clagiri.png in both the 1x and 2x folders?

tight pumice
#

So far I've been able to get by by either finding a directly related joker or frankensteining several parts of different jokers for whatever I'm trying to do

#

I'm knowledgeable on programming but totally new to anything lua

tight pumice
#

For this specific joker I've been stealing from Midas Mask for the turning them lucky and was attempting to look at trading card/glass for the card removal

random elm
#

i actually used this image elsewhere

#

it's a placeholder for this one

#

and it works fine there

tight pumice
#

And 8 ball for random events triggered on scoring

frosty rampart
#

strange

orchid bolt
#

does anyone know how to apply eternal to a joker via a joker effect
card.ability.eternal = true adds the sticker onto it but does not give it sell or destroy immunity

daring fern
orchid bolt
#

oh is that the issue

#

cuz yeah i am

daring fern
tight pumice
#

Is there a quick way to test jokers that you're working on?

daring fern
tight pumice
#

Alright I've gotta figure that out

#

I wasn't doing it before because I've mostly been doing this recreationally but I wanted to make this joker I'm working on uncommon and I don't want to deal with actually finding his ass in my run

#

Plus he's weird and I want to test him against various situations

#

Idk what I did exactly but he now seems to annihilate every single lucky card both in hand and scored

tight pumice
#

I think I've fixed that particular bug, but if it works the way I currently expect it to, it's still not quite right

red flower
#

context.destroy_card doesn't happen in context.before

#

oh wait it's indentation issues

tight pumice
#

Yeah really still trying to wrap my head around context stuff

red flower
#

i was wrong the identation is just weird, the problem is that context.desteoy_card already goes through each card so you don't need the loop

tight pumice
#

I'm not being very tidy atm I've just been throwing stuff around for funsies

red flower
#

also check for lucky enhancement by doing SMODS.has_enhancement(context.destroy_card, "m_lucky")

tight pumice
#

Gotcha

#

Is there any way for me to not kill cards that were turned lucky on this hand? I feel like I'd need to do some special coding for that

red flower
tight pumice
#

Yeah I've had that pulled up on another monitor

#

Oh that's you

#

I've been using that as my way of going about grabbing features that are already in the game from one joker or another

red flower
tight pumice
#

Sounds perfect

red flower
#

you can also do the opposite and flag the lucky cards instead

#

that's probably easier

tight pumice
#

Flag the lucky cards that aren't from this hand?

red flower
#

yeah

#

then you dont even need to reset them because they will be destroyed

tight pumice
#

Oh very true the condition only lasts for a second

#

Yeah that's probably a little neater

fossil ermine
#

can i store a blueprint-ish effect forever on a joker, tryna make it so that on blind select all other jokers are destroyed and the joker gains the effects of those jokers

#

trying this

#

doesnt seem to be working tho

fossil ermine
#

i.. dont really understand that code sowy

fossil ermine
copper perch
#

I have this code for destroying 1 card...how would I do 2 cards instead?

calculate = function(self, card, context)
        if context.end_of_round and not context.game_over and context.main_eval then
            local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
        end
    end
red flower
#

do that twice

copper perch
#

so just copy paste it again?

fossil ermine
copper perch
#

I do have an issue that 2 different Jokers can delete the same playing card though, one of which gains mult when a playing card is destroyed. That card gains mult twice for a card being hit by deletion twice even though only 1 card gets deleted. Anything I can do there?

gusty iron
#

how would i set a music track for a consumable type?

red flower
#

what

#

what would that mean

urban wasp
#

why does this never give xmult

SMODS.Enhancement {
    key = "mechanical",
    name = "Mechanical",
    pos = { x = 2, y = 0 },
    config = {
        extra = {
            x_mult = 1,
            x_mult_mod = 0.5
        }
    },
    atlas = "enhancement",
    any_suit = false,
    replace_base_card = false,
    no_rank = false,
    no_suit = false,
    always_scores = false,
    weight = 5,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.x_mult, card.ability.extra.x_mult_mod } }
    end,
    calculate = function(self, card, context)
        if context.discard and context.other_card == card then
            card.ability.extra.x_mult = card.ability.extra.x_mult + card.ability.extra.x_mult_mod
            return {
                message = "Upgrade!",
                colour = G.C.RED
            }
        end
        if context.after and context.cardarea == G.play and card.ability.extra.x_mult ~= 1 then
            card.ability.extra.x_mult = 1
            return {
                message = "Reset!",
                colour = G.C.RED
            }
        end
    end
}
red flower
#

do you ever return mult

azure valley
#

it doesn't look like it

#

@urban wasp you'll need to add a context.joker_main part to your calculate

#

that's where you'll actually return your xmult.

faint yacht
#

...it's an enhancement...

red flower
#

main_scoring

faint yacht
#

context.individual and context.other_card == card

azure valley
#

oh

frosty rampart
#

main_scoring

azure valley
#

well, I made the rare and valuable wrong in two different ways at once.

frosty rampart
#

i don't think enhancements will even calculate context.individual on themselves

azure valley
#

huh, so this enhancement is intended to add x_mult to... something? when a card that has this enhancement is discarded, and it resets at the end of the round

#

but what is actually doing the x_mult and when?

jolly shadow
#

😁

elder rune
urban wasp
#

i initially did it manually on context.individual and context.cardarea == g.play but this seemed to be able to do it automatically

elder rune
#

What about it

jolly shadow
#

so if you have it enabled, your thing wont work

elder rune
#

That's dumb

jolly shadow
#

lol u chose to install talisman

frosty rampart
#

talisman has to treat numbers as tables in order to store numbers larger than lua's maximum floating point number limit

elder rune
#

Ah

#

Not as dumb

red flower
urban wasp
#

in config?

red flower
#

you have extra

urban wasp
#

ahh i see

#

that's literally the only issue lol thanks

tight pumice
#

Trying to make a joker pick a random card from the non-played hand to delete but instead it goes on a murderous rampage and deletes everything from your hand

#

Tried to do it like this

frosty rampart
#

context.destroy_card is calculated once for each card played or held in hand, and returning something during destroy_card destroys the card it's currently checking
for what you want to do, have it be in context.joker_main instead (or whatever timing you want it to destroy the card, maybe context.after)

tight pumice
#

Gotcha

#

Cool it works

#

Thank you

serene granite
#

ahhh why does it keep saying, could not find center.. how do i register my new enhancement so that my custom jokers can turn cards to that enhancement

red flower
serene granite
#

maybe

#

u were right omg

red flower
#

of course i was

umbral zodiac
#

please call me an idiot what did i do wrong in my sticker

#

there should be proper localization but it's just doing nothing

red flower
#

can i see the sticker code

umbral zodiac
#

it does remove itself but it should only do that at end of round

red flower
#

hmm i never made a sticker but is the apply function correct

umbral zodiac
#

card.ability.transform_rounds is being set properly

red flower
#

i think it should be calling the original

#

becuase it does more

umbral zodiac
#

wdym the original

#

is apply part of something else and im just overriding it by mistake

umbral zodiac
#

oh lmao

#

that would probably do it

#

i thought apply was for stuff i wanted to run that was blank by default not a function i was overriding

#

works now tho, thank you N 🙏

red flower
#

❤️

elder rune
chrome widget
#

Breuhh have you been here, like 60% of the devs here are trans

granite jay
#

Anyone know how to make new boss blinds in balatro

queen crescent
#

the smods wiki has documentation on it

granite jay
#

Yeah I wanna make a finisher blind that makes it so hands containing cards with a specfic suit won't be scored

#

the suit changes per hand

#

but I'm having a hard time making it

#

actually appear

#
-- Onyx
SMODS.Atlas({
    key = "bl_final_onyx",
    path = "onyxblind.png",
    atlas_table = 'ANIMATION_ATLAS',
    px = 34,
    py = 34
})

SMODS.Blind {
    key = "final_onyx",
    atlas = 'bl_final_onyx',
    pos = { x = 0, y = 0 },

    vars = {suit='Spades'},
    debuff = {suit='Spades'},
    dollars = 8,
    mult = 6,
    boss = { showdown = true },
    boss_colour = HEX("8a71e1"),
    get_loc_debuff_text = function(self)
        return G.GAME.blind.loc_debuff_text ..
            (G.GAME.blind.only_hand and ' [' .. localize(G.GAME.blind.only_hand, 'poker_hands') .. ']' or '')
    end,
    calculate = function(self, blind, context)
        if not blind.disabled then
            if context.hand_drawn then
                local valid_onyx_cards = {}
                for _, playing_card in ipairs(G.playing_cards) do
                    if not SMODS.has_no_suit(playing_card) then
                        valid_onyx_cards[#valid_onyx_cards + 1] = playing_card
                    end
                end
                local onyx_card = pseudorandom_element(valid_onyx_cards, 'ameliorates_onyx')
                if onyx_card then
                    debuff.suit = onyx_card.base.suit
                end
            end
        end
    end
}```
daring fern
granite jay
#

Damn thx

#

I am currently having problems on trying to make the actual boss blind show up

copper perch
#

Can you play a sound when a joker is scored if theres no message? My current code is below and is not playing the sound for some reason when scoring. I tried just using the sound as well but that didnt work either

elseif context.joker_main then
            return {
                chips = card.ability.chips,
                extra = {sound = 'DRY_CerobaAiegh'}
            }
        end
ivory citrus
#

Hi, i'm triying do a joker that set a flag to true when is obtain (by the shop, booster pack or judgement) and set this flag to false when is destroyed (by sold or destroyed by joker or consumeables)

daring fern
daring fern
granite jay
copper perch
elder rune
#

omg im so dumb

#

the badge color did show up just that it was too dark for me to notice so I thought it didnt work

quiet pivot
#

how do i do the effect "+ 0" on the money counter

elder rune
#

maybe just add a tiny tiny amount

faint yacht
#

Check the attention_text function used by ease_dollars.

queen crescent
#

the money is not at ease at all

burnt tide
#

How can I make a rank that gives +1 Mult instead of +1 Chip ?

daring fern
burnt tide
stoic void
#

would this work?

hidden notch
#

So what exactly am I missing?

hidden notch
#

I guess I'm keeping my Decks Unlocked then??? RobynUh

Even when I ignore the missing text, the Unlock-Condition Code doesn't work either;
Just Unlocks after winning any Run - Even when I specify Erratic Deck

hidden notch
#

It's using my Normal Vars and then inserts the Locked-Vars Value??

fossil ermine
pale holly
#
   config = { extra = {hand = 1, cards_ned = 15, hand_max = 10}},
        loc_vars = function(self, info_queue, card)
        return { vars = {card.ability.extra.hand,  card.ability.extra.cards_ned, card.ability.extra.hand_max } }
    end,

    calculate = function(self, card, context)
    if context.main_eval then
    card.ability.extra.hand = card.ability.extra.hand * (math.floor((#G.playing_cards) / card.ability.extra.cards_ned))
    card.ability.extra.hand = math.min(card.ability.extra.hand, card.ability.extra.hand_max)
    G.hand:change_size(card.ability.extra.hand)
            end
       end,
        
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.hand)
    end```

Hi, trying to make my joker add +1 hand size for every 15 cards in the deck, but right now it's broken and everytime i use it gives me 500+ hand size, not sure how the heck i f'ed up this bad, would like some help please !
maiden phoenix
#

(don't forget to remove the check_for_unlock)

hidden notch
pale holly
hidden notch
#

Still a little confused on the Vouchers now, tho xwx

maiden phoenix
#

What's the issue?

hidden notch
pale holly
#

can you show the full code ?

hidden notch
#
SMODS.Voucher {
    key = "mask_tragedy",
    name = "SEMBY_mask_tragedy",
    atlas = "SEMBY_vouchers",
    pos = { x = 0, y = 1 },
    requires = { 'v_SEMBY_mask_comedy' },
    config = {
        extra = {
            percent = 0.15,
            hand_size = 1
        }
    },
    loc_vars = function(self, info_queue, card)
        local percent = 100 * card.ability.extra.percent
        SEMBY_Queue_Artist(card, info_queue)
        return { vars = {
            percent,
            card.ability.extra.hand_size
        } }
    end,
    redeem = function(self, card)
        G.GAME.SEMBY_blind_mod = (G.GAME.SEMBY_blind_mod or 0.9) - card.ability.extra.percent
        G.hand:change_size(-card.ability.extra.hand_size)
    end,
-- Unlock Code:
    unlocked = false,
    locked_loc_vars = function(self, info_queue, card)
        return { vars = { 25 } }
    end,
    check_for_unlock = function(self, args)
        if args.type == 'blind_discoveries' then
            local discovered_blinds = 0
            for k, v in pairs(G.P_BLINDS) do
                if v.discovered then
                    discovered_blinds = discovered_blinds + 1
                end
            end
            return discovered_blinds >= 25
        end
        return false
    end
}
pale holly
#

do you also happen to have text description code for it ? the loc_txt if you want

#

because in general the nil might come from there so might as well see it first

hidden notch
#

I don't see why my Description would be the Issue here, The Unlock-Text isn't showing at all confus

pale holly
#

Well because right now it shows you didn't defined the #2#

#

look at your vars, there's only 25

hidden notch
#

I'm defining 25 for the UNLOCK TEXT
NOT for the Normal text xD

#

I want this:

#

Not that:

pale holly
#

what #2# is even meant to be ?

#

is it a value or something you want to add ?

hidden notch
pale holly
#

you can just remove #2# by -1 hand size then

#

or do { vars = { 25 , -1} }

#

whatever you prefer

hidden notch
#

????
I'm pretty sure you don't understand my issue here ^w^'

pale holly
#

wasn't your issue being the -nil ?

fossil ermine
#

its that locked is showing what it does

#

i thinks

pale holly
#

oh

hidden notch
#

You are right ^^

fossil ermine
#

supposed to be:
'Discover',
'{C:attention}25{} Blinds'

#

havent worked with unlocked stuff so no idea how to help here

pale holly
#

okay i think know how

maiden phoenix
#

So, where you got your loc entry, you need to add an unlock table to it

hidden notch
#

Huh?? stress

pale holly
# hidden notch You are right ^^

you should include the key of the locked voucher in your vars and it should be something like
{ vars = { 25, key = self.key .. '_locked'}}
_locked is for the name of your voucher in the localization files with _locked at the end

#

that's an exemple but i do remember it's about self key

maiden phoenix
#

Just add an unlock thing to the loc

pale holly
fossil ermine
#

syo anyway, an issue i hav

#

i assume its simple im jus stupid heh

maiden phoenix
#

it's G.jokers.cards

fossil ermine
#

thx

hidden notch
#

But why is there a key for deck_locked_win and all that if it's just defined in there aaaa--
Alright I'll use that then , Thank you :)

pale holly
fossil ermine
#
    card.ability.extra.hand = card.ability.extra.hand * (math.floor((#G.playing_cards) / card.ability.extra.cards_ned))
    card.ability.extra.hand = math.min(card.ability.extra.hand, card.ability.extra.hand_max)
    G.hand:change_size(card.ability.extra.hand)
``` this
pale holly
#

math.floor if i'm right is so that it rounds the number (so it doesn't end up as like 0.6 but 1 instead)
math.min is so card.ability.extra hand never gets higher than hand_max

#

so first calculating the number of hands in total then turning it down to hand_max if hand is too high

hidden notch
pale holly
#

well i want to keep the change dynamic so that's why there's only context.main_eval and nothing else
but i didn't kne for G.hand:change_size(tho)

okay that explain why it gave me +500 hand size

hidden notch
#

Alright, I mean.. Yeah that would work - There's better contexts and all, but:
The first and fastest fix would be to:

#
G.hand:change_size(-card.ability.extra.hand)
card.ability.extra.hand = math.floor(#G.playing_cards / card.ability.extra.cards_ned)
card.ability.extra.hand = math.min(card.ability.extra.hand, card.ability.extra.hand_max)
G.hand:change_size(card.ability.extra.hand)
maiden phoenix
pale holly
prisma loom
#

wtf is causing the crash

pale holly
hidden notch
# pale holly seems so far the easiest fix yes, thanks !

if context.playing_card_added or context.remove_playing_cards then
Would be the ones you could use, you could also just set it at the beginning of every blind and shop;
if context.setting_blind and not (context.blueprint_card or self).getting_sliced then
if context.starting_shop then

Up to preference really, it's not like 1 Hand Size Matters in am Tarot-Pack in the SHop - So you could get away with always just updating it at the start of every blind

prisma loom
slim ferry
#

pretty sure fantom's preview causes that crash

#

which is an issue because multiplayer has that built in

prisma loom
#

I have no crashes

slim ferry
#

you probably have it disabled in multiplayed config

prisma loom
#

kill me

pale holly
#

thanks i appreciate th the lp

#

wait

#

if context.playing_card_added or context.remove_playing_cards then would then wouldn't then add the handsize directly until a card is added, so it wouldn't work directly

#

oh wait i could also just if context_setting blind in that case

hidden notch
#

And add_to_deck = function(self, card, from_debuff)

pale holly
#

not sure if in that case it'll be necessary since it'll already change the handsize upon check, but i guess i better to do for safety anyways

hidden notch
#

It kinda depends on what ya' Aiming for - Should the Joker have a Dynamic Size like... If I draw Cards the Hand-Size shrinks in the Blind - Then you have to do something different x3

pale holly
#

well the main goal was if you got to destroy 15 cardsi in your hand while playing then yeah you would lose a handsize, that's why it was context.main_eval so it always check, but the card adding and removing as well of setting blind could do the job in a probably less painful way xP

hidden notch
#

Then you're fine to continue~ lewxen_ok

pale holly
#

as long it works without doing the weird instant crash, i'll be happy with that alreayd =w=b

#

i appreciate the help, thanks
-# also i swear, doing the easiest jokers concept sometimes seems the hardest to code

solid salmon
#

Guys i never made localization files

#

How do implement them?

slim ferry
#

make a folder named localization in your mod folder, then you can have one lua file per language code in there and a default.lua to use as a fallback over en-us.lua since thats the normal fallback language

queen crescent
#

working

fossil ermine
#

tryna make so that the for loop is how many jokers there are -1

daring fern
#

for i=1, #G.jokers.cards-1

fossil ermine
#

thx

queen crescent
pure salmon
#

how do i suppress the +num extra chips message from appearing in the ability box? i'm using card.ability.bonus

slim ferry
#

just dont use card.ability.bonus and count the amount of that enhancement in scoring

fossil ermine
#

i was going to post a textwall

slim ferry
#

card.ability.bonus wont work since the game manually subtracts the bonus value in the enhancement's center when its removed

fossil ermine
#

@daring fern you online?

daring fern
fossil ermine
#

tryna do the code for making basically a fake card thing

#

but for my joker's thing instead

#

cuz its not the exact same venniebwaah

fossil ermine
pure salmon
#

post your textwall i got it

fossil ermine
# daring fern https://discord.com/channels/1116389027176787968/1209506360987877408/14123926706...

trying to do this, but im bad at understanding it so

calculate = function(self, card, context)
    if context.setting_blind and not context.blueprint then
        if SMODS.pseudorandom_probability(card, 'group_0_e2e11086', 1, card.ability.extra.odds, 'j_fox_singing') then
            for i=0, #G.jokers.cards-1 do
                local jokers = {}
                for _, j in pairs(G.jokers.cards) do
                    if j ~= card then
                        jokers[#jokers + 1] = j
                    end
                end
                local sliced_joker = pseudorandom_element(jokers)
                if sliced_joker then
                    card.ability.extra.currentJoker = sliced_joker.key
                end
                if card.ability.extra.currentJoker then
                    local key = card.ability.extra.currentJoker
                    G.modprefix_savedjokercards = G.modprefix_savedjokercards or {}
                    G.modprefix_savedjokercards[card.sort_id] = G.modprefix_savedjokercards[card.sort_id] or {}
                    if not G.modprefix_savedjokercards[card.sort_id][key] then
                        local old_ability = copy_table(card.ability)
                        local old_center = card.config.center
                        local old_center_key = card.config.center_key
                        card:set_ability(key, nil, 'quantum')
                        card:update(0.016)
                        G.modprefix_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
                        G.modprefix_savedjokercards[card.sort_id][key].ability = copy_table(G.modprefix_savedjokercards[card.sort_id][key].ability)
                        for i, v in ipairs({"T", "VT", "CT"}) do
                            G.modprefix_savedjokercards[card.sort_id][key][v] = copy_table(G.modprefix_savedjokercards[card.sort_id][key][v])
                        end
                        G.modprefix_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G.modprefix_savedjokercards[card.sort_id][key].config)
                        card.ability = old_ability
                        card.config.center = old_center
                        card.config.center_key = old_center_key
                        SMODS.destroy_cards(sliced_joker)
                    end
                    return G.modprefix_savedjokercards[card.sort_id][key]:calculate_joker(context)
                end
            end
        end
    end
end
}

( only doing it for every blind rn cuz testing it firstly )
tryna store the effects of every joker it kills permanently

#

it kills the jokers fine

daring fern
#

Also you need to change modprefix to your mod prefix.

maiden phoenix
# queen crescent working

Here's something neat you can do, if you got a boolean condition to check if it's either true or false, you don't need an if else block, you can set the value depending of a boolean alone

if context.joker_main then
  e_chips = card.ability.extra.e_chips * (#G.jokers.cards * (next(SMODS.find_card("j_gj_pr")) and 2 or 1))
end
fossil ermine
#

?

daring fern
fossil ermine
#

like this ?

#

card.ability.extra.currentJoker = jokers.key ?

#

nope..

queen crescent
maiden phoenix
#

Forgot the end but yes

queen crescent
#

i did remove the if smods.find

#

(the code i had previously)

maiden phoenix
#

Wait e_chips is a global and you don't return it?

queen crescent
#

shi-

#

rookie mistake

long sun
#

hehe, during my modding process, i noticed that Negative Emperors can be used regardless of the consumable limit, if they're held

#

they don't do anything when used but that's silly :>

fossil ermine
azure valley
#

If I spawn a consumable into G.consumeables using SMODS.create_card and the cards end up not working properly (they don't move around correctly, and they don't have "Use" and "Sell" buttons), what is the most likely cause of this behavior?

I adapted the vanilla code for High Priestess and Emperor:

G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
  play_sound('timpani')
  local make_spectral = pseudorandom('curt_rev_fool_spectral') > (1 - card.ability.extra.spectral_rate)
  local t = { 
    set = make_spectral and 'Spectral' or 'curt_rev_tarot',
    area = G.consumeables,
    allow_duplicates = true,
    key_append = 'curt_rev_fool',
  }
  local _card = SMODS.create_card(t)
  _card:add_to_deck()
  G.consumeables:emplace(card)
  card:juice_up(0.3, 0.5)
  return true end }))
slim ferry
#

just use SMODS.add_card if you're immediately emplacing and adding it and doing nothing else

daring fern
fossil ermine
daring fern
# fossil ermine

You would do table.insert(card.ability.extra.currentJoker, j.config.center.key) in the for loop.

fossil ermine
#

that's it ?

daring fern
fossil ermine
#

like this ?

#

@daring fern

daring fern
fossil ermine
#

theres only 1 return ?
return G.fox_savedjokercards[card.sort_id][key]:calculate_joker(context)

lyric wadi
#

i have some effects that should trigger when a tarot or planet card is used, but from testing it didnt trigger

#

is my code for the card usage detecting correct?

if context.using_consumeable and not context.blueprint then

            if context.consumeable.ability.set == 'Planet' and (not (indexOf(card.ability.extra.activeTriggers, 'planetUse') == nil)) then activateEffect(card.ability.extra.activeEffects[indexOf(card.ability.extra.activeTriggers, 'planetUse')]) end
            if context.consumeable.ability.set == 'Tarot' and (not (indexOf(card.ability.extra.activeTriggers, 'tarotUse') == nil)) then activateEffect(card.ability.extra.activeEffects[indexOf(card.ability.extra.activeTriggers, 'tarotUse')]) end

end
fossil ermine
lyric wadi
#

the condition is to prevent it from triggering if activeTriggers does not contain the relevant key

queen crescent
lyric wadi
#

indexOf is a function that returns the index of a value in a list, or if the value is not found in the list it will return nil

#

so that's why im checking it against nil

fossil ermine
#

cuz it keeps saying bad arguement #1 to 'insert' (table expected, got nil)

#

@daring fern

daring fern
fossil ermine
#

hold on

queen crescent
fossil ermine
#

new run, added it to jokers

daring fern
fossil ermine
#

ipairs(card.ability.extra.currentJoker) ?

daring fern
fossil ermine
#

new run added it same error

daring fern
fossil ermine
#

o okais

#

@daring fern

daring fern
# fossil ermine

Remove the first for loop and everything below the second for loop.

fossil ermine
#

lmao

daring fern
fossil ermine
#

the jokers i destroyed were sock in buskin, oops all 6s (x2), and armed and dangerous

daring fern
# fossil ermine

Change local key = card.ability.extra.currentJoker to local key = v

fossil ermine
fossil ermine
#

didnt crash

#

but didnt copy the joker effects

#

@daring fern

#

probably SMODS.merge_effects

flint valve
#

modding phones is a thing ?

slim ferry
flint valve
#

thx\

cyan lagoon
#

anyone knows how to retrigger discard effects?

#

or atleast how can i add retriggers to em

slim ferry
#

by default discard retriggers dont work, you would have to make a custom context

#

i know at least morefluff does this, you could look into that

cyan lagoon
#

aight, thanks

tired moat
#

does anyone want help for joker ideas 🙏im bored pls

fossil ermine
daring fern
fossil ermine
#

could you explain further ?

#

returns being the for looped return G.fox_savedjokercards[card.sort_id][key]:calculate_joker(context) ?

fossil ermine
tired moat
#

hacked lmao

daring fern
winter flower
#

<@&1133519078540185692>

daring fern
#

Also you need to insert it into the table.

winter flower
#

also holy shit discord actually doing smth for once

fossil ermine
#

i think this is wrong

#

but maybe smth like this

daring fern
#

Also you need to use calculate_joker

fossil ermine
#

in the insert ?

#

wait no im stupid

fossil ermine
daring fern
fossil ermine
#

okai did that

#

@daring fern

fluid steppe
#

how would i make something not show up in the collection until you've seen it for the first time

daring fern
daring fern
fossil ermine
#

also i destroyed the jokers in the for loop

daring fern
fossil ermine
#

not sure what to put in calculate_joker()

daring fern
pastel kernel
#
if context.selling_self and context.card.config.center.key == "j_para_jokerrune" and (something something doesn't work when it's eternal) then
fossil ermine
#

yea put context in

prisma loom
#

Folks, does anyone know how to adjust UI in packs to give more space between card options?

daring fern
pastel kernel
prisma loom
fossil ermine
daring fern
pastel kernel
#

What about checking for eternal to ignore it?

fossil ermine
hasty summit
fossil ermine
slim ferry
daring fern
fossil ermine
#

thx it works fully now

#

wait how do i make it so that its specifically on start of boss blind

lavish elm
fossil ermine
#

thx :3

cyan lagoon
#

i want to animate the soul sprite. what am i doing wrong?

dapper sun
dapper sun
daring fern
dapper sun
#

thanks

pale holly
cyan lagoon
cyan lagoon
pale holly
#

It's for the hand only no ? I mean like after the jokers triggered and everything

daring fern
pale holly
#

thanks i'll try that, and it's only for the current hand and not total right ?

cyan lagoon
pale holly
cyan lagoon
#

how in god's name do i retrigger this?

daring fern
cyan lagoon
#

...

#

i guess that'll do

red flower
#

(i dont remember if the name is floating_sprite)

cyan lagoon
red flower
#

it should

cyan lagoon
#

i saw morefluff do it and copied the code

red flower
#

that should work in the collection afaik

#

maybe use draw instead of update

#

i use drawsteps for this stuff

cyan lagoon
solid salmon
#

this SLEEVES code makes playing cards retrigger twice

#

even tho

#

i want it to either retrigger playing cards by itself or jokers with white deck

cyan lagoon
vale zinc
#

I see a mod_mult() function used by The Flint, what does that do?

lavish elm
#

how to make cards permanently have 1 extra repetition?

red flower
red flower
#

basically use it when modifying scored mult directly

vale zinc
#

Here's why I ask:

red flower
#

yeah you would do mult = mod_mult(hand_chips/2)

pseudo furnace
#

I hooked add to card to my function, which runs smods.debuff_card, which runs card:set_debuff, which runs add to deck, creating stack overflow.

How would I mitigate this?

lavish elm
#

how to loop through every card in the deck?

vale zinc
next timber
#

how do i make a sound play when an edition triggers? i've tried this but it didn't work: return {xmult = value, sound = {sound = sound, per = 1, vol = 1}}

#

where sound is "hodge_trigger_slime_good" or "hodge_trigger_slime_bad" depending

#

both of which should be valid sounds

daring fern
next timber
#

hm, i tried that and it didnt work

#

guess ill try again

cyan lagoon
next timber
daring fern
cyan lagoon
#

you mean...?

daring fern
dapper sun
#

how do i make a joker change an enhancement's probabilities?

dapper sun
#

custom enhancement

daring fern
# cyan lagoon you mean...?
local oldcalcseal = Card.calculate_seal
function Card:calculate_seal(context)
    local g, post = oldcalcseal(self, context)
    if (g or post) and context.discard then
        for i, v in ipairs(SMODS.find_card('j_modprefix_key')) do
            SMODS.calculate_effect({message = localize('k_again_ex')}, v)
            local _, postpost = oldcalcseal(self, context)
            post = post or postpost
        end
    end
    return g, post
end
lavish elm
dapper sun
#

thanks

#

like this?

calculate = function(self, card, context)
    if context.identifier == "elle_slime_card" then
        return {
            numerator = 3
        }
    end
end```
lavish elm
dapper sun
#

thanks

cyan lagoon
#

thanks

#

but the joker that i added 'return nil, true' to still dont show the 'again' message

timid zinc
#

is there a way to tell what booster you're currently in while in context context.skip_booster?

cyan lagoon
#

try to see what gets returned here

dapper sun
lavish elm
dapper sun
#

?

lavish elm
#

the context.identifier should be the string from your get_probability_vars

#

local numerator1, denominator1 = SMODS.get_probability_vars(card, 1, card.ability.seal.extra.odds1, "epik_face_hand")
example

dapper sun
#

okay?

#

how would i use this for what i'm doing?

#

i'm a little confused, sorry,, 😅

lavish elm
#

if context.mod_probability and not context.blueprint_card and context.identifier == "epik_face_hand"

dapper sun
#

that's the same as before

lavish elm
#

hmm that is weird it works for me maybe try print(context.identifier) to see the value

dapper sun
#

ok

#

nil

#

maybe there's an optional feature i need to enable?

lavish elm
#

there isn't can I see the code for setting up your probability?

dapper sun
#

i mean i put the print in the base of the calculate function

#

so it'd always go off

#

and every single context check gave nil

#

so it's not just my card

lavish elm
#

ok put the print inside the context.mod_probability

#

and only context.mod_probability no other contexts

dapper sun
#

it only prints when hovering over lucky cards

winter flower
#

is it possible to change a rarity's badge text color

lavish elm
dapper sun
#

nope

lavish elm
#

try glass cards just to be sure

dapper sun
#

ok it does for glass too

lavish elm
#

then there is something wrong with your probability setup for your card

dapper sun
#

i think it may have to do with

#

uhhhh

#

this 😭

-- Cryptid/Talisman Compatibility functions
function elle_prob(card,p_key,odds)
    return pseudorandom(p_key) < (Cryptid and cry_prob(card.ability.cry_prob, odds, card.ability.cry_rigged) or G.GAME.probabilities.normal) / odds
end

function elle_prob_loc(card,odds)
    return Cryptid and cry_prob(card.ability.cry_prob, odds, card.ability.cry_rigged) or G.GAME.probabilities.normal or 1
end```
lavish elm
dapper sun
#

without the cryptid support it's essentially just

function elle_prob(card,p_key,odds)
    return pseudorandom(p_key) < G.GAME.probabilities.normal / odds
end

function elle_prob_loc(card,odds)
    return G.GAME.probabilities.normal or 1
end```
daring fern
daring fern
next timber
#

is that the issue

#

or have i just screwed up some other way

dapper sun
daring fern
dapper sun
#

what do those mean? i'm a bit confused by some of them 😭

daring fern
dapper sun
#

thanks

#

what should i put for the numerator?

#

just 1 or

daring fern
dapper sun
#

ok

dapper sun
daring fern
dapper sun
#

ok

orchid bolt
#

does anyone have an example of targetting a random card in hand

red flower
#

pseusorandom_element(G.hand.cards, "seed")

dapper sun
#

okay i've replaced all uses of probability in my mod with the correct method

#

it works now yippee

winter flower
daring fern
# winter flower im a bit lost on what line i need to patch

badges[#badges + 1] = create_badge(((card.ability.name == 'Pluto' or card.ability.name == 'Ceres' or card.ability.name == 'Eris') and localize('k_dwarf_planet')) or (card.ability.name == 'Planet X' and localize('k_planet_q') or card_type), card_type_colour, card_type_text_colour, 1.2)

copper perch
#

I have 2 Jokers that destroy playing cards, my problem is that both can hit the same playing card and one earns a bonus from said playing card being destroyed twice. Code for both is below, with a comment on what both are. Wanna make it so 3 cards are destroyed if possible, if not then destroy as many as possible

-- Destroyer

calculate = function(self, card, context)
        if context.end_of_round and not context.game_over and context.main_eval then
            local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
            local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
        end
    end

-- Destroyer and Mult Gain

if context.joker_main and card.ability.extra.xmult > 1 then
            return {
                extra = {func = function() G.E_MANAGER:add_event(Event({func = function() play_sound('DRY_WyfoleDah') return true end})) end},
                xmult = card.ability.extra.xmult
            }
        end
        if context.end_of_round and not context.game_over and context.main_eval and not context.blueprint then
            local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
        end
    end
ivory citrus
solid salmon
#
    key = "white_sleeve",
    atlas = "white_sleeve",
    pos = { x = 0, y = 0 },
    unlocked = false,
    discovered = false,
    config = {repetitions = 1},
    unlock_condition = { deck = "b_othe_white", stake = "stake_green" },
    loc_vars = function(self)
        local key, vars
        if self.get_current_deck_key() == "b_othe_white" then
            key = self.key .. "_white_alt"
        else
            key = self.key
        end
        return { key = key, vars = {self.config.repetitions}}
    end,
    calculate = function(self, sleeve, context)
        if self.get_current_deck_key() == "b_othe_white" then
            if context.retrigger_joker_check and context.other_card ~= card then
                if not (context.other_card.edition) then
                    return {repetitions = self.config.repetitions}
                end
            end
        else
            if (context.repetition and context.cardarea == G.play) then
                if not (context.other_card.edition or (next(SMODS.get_enhancements(context.other_card)) and not context.other_card:get_seal())) then
                    return {repetitions = self.config.repetitions}
                end
            end
        end
    end
}
SMODS.Atlas {
    key = "white_sleeve",
    path = "white_sleeve.png",
    px = 71,
    py = 95
}
``` this sleeve code for some reason whenever its paired with my WHITE DECK retriggers all cards twice and retriggers jokers
latent perch
#

if self.get_current_deck_key() == "b_othe_white" then is there a r missing here? "b_other_white"?

stoic void
#

this triggers twice

wintry swallow
#

is it triggering twice or is the normal state of the Chips & Mult just overwriting the code of the Joker?

stoic void
#

@wintry swallow

#

also i might buff this to rare

solid salmon
#

to clarify

wintry swallow
#

yeah so as soon as the hand starts scoring, it switches the state of the Round Score back to before Cassette triggered. The Joker itself isn't triggering twice

solid salmon
#

the sleeve is supposed to retrigger jokers when used with the white deck

stoic void
#

ah ok

wintry swallow
#

The Round Score is overwriting Cassette

stoic void
#

is there a way to not have that happen?

queen crescent
#

should latest smods not increment ante and show 0 when levelling up

queen crescent
wintry swallow
stoic void
#

k

wintry swallow
#

now i might be wrong i am new to this myself Im just giving an educated guess

orchid bolt
#
            if SMODS.pseudorandom_probability(card, 'rw_rotten', 1, card.ability.extra.odds) then
                local target = pseudorandom_element(G.hand.cards, "seed")
                SMODS.destroy_cards(target)
                G.E_MANAGER:add_event(Event({
                    func = (function()
                        play_sound('tarot1', 1)
                        return true
                    end)
                }))
                card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mod_mult
                return {
                    message = localize('k_upgrade_ex'), 
                    card = self,
                    colour = G.C.IMPORTANT
                }
            end
        end```
this entire block of code just does not run :[ it doesnt even crash it just does nothing
ivory citrus
wintry swallow
stoic void
wintry swallow
#

without the calculate function the joker's effects wont work

wintry swallow
stoic void
#

I gtg now :(

orchid bolt
stoic void
wintry swallow
orchid bolt
#

nothing except the bottom thing that returns mult is doing anything

wintry swallow
stoic void
#

K

wintry swallow
# stoic void K

you can look at the vanilla code for Hanging Chad, that's what I'm getting this from

#

and maybe try [0] instead of [1] if it doesn't activate before the first card of the hand

#

again, all educated guesses

wintry swallow
orchid bolt
wintry swallow
#

so why is the game over context there? the only joker i can think of that would need that is that one base game joker

#

every other joker assumes that the game is continuing

#

otherwise im not educated enough to give any other guess

orchid bolt
#

well i yoinked it from somewhere and i dont think mr. bones was that somewhere

#

and also this very similar header does work so idk

wintry swallow
#

then idk, someone else will have to help unfortunately

#

that being said; does anyone have any advice for a Joker triggering that creates a Tag similar to the Rework tag from Cryptid?

#

I'm looking at the code for it but idk how much of it is Vanilla and how much is Cryptid

orchid bolt
#

diet cola might have something

#
            G.E_MANAGER:add_event(Event({
                func = (function()
                    add_tag(Tag('tag_double'))
                    play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
                    play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
                    return true
                end)
            }))```
wintry swallow
#

the main issue is creating a unique tag, so it stays out of the tag pool that can pop up when you skip blinds

orchid bolt
#

hm

#

idk how you'd do that then im still quite new to this

distant junco
#

how can i generate a list of the keys of all the hand types

timid zinc
#

Can you ban editions in challenges?

wanton cobalt
#

baltro

distant junco
#

ah

pure salmon
#

this joker doesn't retrigger +chips or +mult joker effects like it should

orchid bolt
#

i return to inquire once again why nothing in the if context.joker_main and context.main_eval and not context.blueprint then runs

gilded goblet
#

try removing context.joker_main in the first if statement
tip: put a print("test") inside the main if statement just to see if it's passing (maybe this isn't needed in this scenario since you have a return with a message there)

orchid bolt
#

it instantly crashed 🔥

gilded goblet
#

ough

#

send the crash log

orchid bolt
#

no its like a full crash when i do that it doesnt even show the gray page with the text

gilded goblet
#

oh, hold on im testing out something

#

i think you need to use a context different from joker_main and main_eval
these dont work for what youre trying to do

try it with context.before (will trigger before the hand plays) or context.after (will trigger after the hand plays)

wicked leaf
#

how does one fix this in the collection

#

(consumables section)

distant junco
#

whats your SMODS.ConsumableType look like

orchid bolt
gilded goblet
#

send crash log

distant junco
# wicked leaf

are you doing your localisation text in that file or are you doing "proper" localisation

wicked leaf
#

proper

#

this is a PR for entropy so a lot of this isnt my code

distant junco
#

then i have no idea cuz i am not doing proper localisation

orchid bolt
gilded goblet
#

yay

#

does ti work?

copper perch
#

what would be the way to check the number of cards in hand for an if statement?

wicked leaf
#

how do I remove all the stickers off a joker?

copper perch
#

I have that now and its not working, I'm checking if its greater than 0 but still runs if it is, crashing the game

gilded goblet
#

what context u using

copper perch
#
if context.end_of_round and not context.game_over and context.main_eval and not context.blueprint and G.hand.cards > 0 then
            local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
        end
slim ferry
#

#G.hand.cards

gilded goblet
#

should be #G.hand.cards > 0

#

also maybe remove context.main_eval

copper perch
#

Ahhhh, no clue there was a difference

gilded goblet
#

length being the amount of things inside said table

#

that was a shit explanation im sorry

copper perch
#

all good, gonna test now

#

It worksss, thank ya :)

gilded goblet
#

hip hip hooray

gilded goblet
unkempt bronze
#
SMODS.Consumable {
    key = "lithium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 16, y = 0 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 5
    end,
    loc_txt = {
        name = 'Lithium',
                text = {
                    'Adds +5 chips for the hand',
                    'after this is used, and adds one',
                    'new card to the deck',
                },
            },
    calculate = function(self, card, context)
      local alki_card = SMODS.add_card { set = "Base" }
      G.GAME.blind:debuff_card(alki_card)
      G.hand:sort()
      SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
    end
}```

Upon playing this card, the game just snaps. Not even a reason for the crash, no log, just close.
gilded goblet
slim ferry
unkempt bronze
slim ferry
#

what

#

look idk when its supposed to trigger

#

i cant guess what your goal is

unkempt bronze
#

It's supposed to buff the next hand and add a card

slim ferry
#

then dont put that in calculate?

#

why would the thing you do when you use the consumable not just go in use

unkempt bronze
#

actually you're right

frail parcel
#

is there a way to get custom text on challenges in the custom rules area

frosty rampart
gilded goblet
# red flower ?

Last time I tried doing that it crashed on me so I just assumed it's not possible

slim ferry
#

Its just defining a variable it has no reason to crash

gilded goblet
#

Defining a variable in there has made it crash for me before so idk

red flower
gilded goblet
#

<@&1133519078540185692>

winter flower
#

MURDER

gilded goblet
#

I'm just stipid

#

Why is this still here 😭

solemn shuttle
#

how could i get the localization for a blind
[basically would it be infoqueuebithere i know this part = {key = "blind_key", set = "Other"}

#

or do blinds have their own set

solemn shuttle
next timber
#

im going crazy why does no sound play

tranquil gull
#

okay guys i am dying over here

#

can someone draw a spectral card for me

#

i've tried to draw it like 3 times but i just can't

wind steppe
urban wasp
vernal path
#

the rest of config is for like, other things that vanilla uses, i think

#

anyway its just good practice to use it, keeps it contained

urban wasp
#

like i’ve used it for months but i’ve never known why exactly

vernal path
#

so that it doesn't interfere with vanilla stuff

solemn shuttle
#

how do you do emult without talisman again

red flower
#

values in other fields didn't use to get saved
nowadays it's just recommended to not clash with vanilla fields, stickers, etc and so it doesn't keep the values when you change a card

urban wasp
#

i see

hardy viper
#

real uncs know

solemn shuttle
#

not sure if its supposed to be emult_mod now or 😭

red flower
#

there's no emult without talisman or cryptlib

solemn shuttle
#

-# for reference im just tryna remove the only thing i have that NEEDS talisman so i can work without dependences

loud summit
#

you can always just like

solemn shuttle
red flower
#

you can do mult = mult ^ num

loud summit
#

multiply it locally a lot and return a big xmult

#

yea

vernal path
#

Check Prism if you want an implementation that is also compatible with talisman

solemn shuttle
#

i see

#

ty

tight pumice
#

Had a joker that worked fine, then added another joker (which also works fine), but now the other joker crashes the game when hovered over

#

Crash message says "attempt to index field 'extra'" but I'm not sure where that would be

solemn shuttle
#

if its when its hovered over id guess it has smth to do with loc_vars for that joker

tight pumice
solemn shuttle
# tight pumice

ah so yeah it probably doesnt recognize card.ability.extra.destroy then

#

did you define it in config or no

tight pumice
#

I'm confused why it worked fine earlier

#

Hovering over it as well as the general functionality

solemn shuttle
#

as for why the change uh

#

im not sure

#

;w;

#

without further context i couldnt say

tight pumice
#

I'll look into that

#

Thanks

solemn shuttle
#

sorry

#

np tho ^^

versed swan
#

Is there a way to force a specific Joker order in the Collection?

tight pumice
#

Is there something like G.play.cards that specifically refers to cards that score and not just played cards

red flower
#

in calculate you have context.scoring_hand

tight pumice
#

I see

#

Makes sense I'll check it out

#

So within context.scoring_hand, G.play.cards would refer to scoring cards?

red flower
#

no

#

context.scoring_hand is a table of the scoring cards in various contexts like context.joker_main
(there's also context.full_hand which is equivalent to G.play.cards)

tight pumice
#

Okay I think I understand

#

So picking a random card out from specifically the scoring cards could work with this?

red flower
#

yes

tight pumice
#

Dope

#

Learning a little every day

copper perch
#

So sometimes this code can hit the same playing card twice, any way to prevent that?

if context.end_of_round and not context.game_over and context.main_eval and #G.hand.cards > 0 then
            local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
            if #G.hand.cards > 0 then
                local card_ = pseudorandom_element(G.hand.cards, 'seed')
                SMODS.destroy_cards(card_, nil, true)
            end
        end
red flower
#

easiest is to copy the list of cards instead of using G.hand.cards directly and then remove the card that you destroyed first from the list

copper perch
#

How would I go about that?

red flower
#

which part

copper perch
red flower
#

for copying you can do SMODS.shallow_copy(G.hand.cards) or just loop through the hand and add it to a new table