#💻・modding-dev

1 messages · Page 642 of 1

dapper sun
wintry solar
#

Yeah I think it’s catching itself

dapper sun
#

ah

wintry solar
#

Add a and context.card ~= card

dapper sun
#

okii

lyric wadi
#

game is crashing when switching save files, never happened before i added a localization file to my mod

#

is there something i overlooked about how to load in loc files or something

red flower
#

localization files just need to be put in the correct folder with the correct structure, you don't need to load them or anything

#

what's the crash

lyric wadi
red flower
#

are you sure it's not a problem with deck creator

#

something is trying to parse multi box descriptions as single box

red flower
lyric wadi
#

aw heck

#

so any recommendation for testing tools

#

i usually just use it to make a deck where you start with a joker i wanna test

wind steppe
#

debugplus

stoic void
#

I screenshotted my message and didnt forward it because... idk

#

Ima eat dinner now, so i most likely wont respond immediately

dapper sun
#

how would i make a challenge's joker start with a modded sticker

twilit tundra
#

how do pseudoseeds work how do i just get a random item from a table i'm looking at other mods' code for reference do i need to constantly change what pseudoseed i'm using? what do i even put in pseudoseed()

slim ferry
#

you dont need to use pseudoseed anymore, you can just put a plain string to any of the pseudorandom functions and itll automatically use pseudoseed

#

use pseudorandom_element(table, seed) to get a random table element

junior tapir
#

How do I check whether a card is in a pool in the function Card:set_cost() if I have a pool like this one

SMODS.ObjectType({
    key = "Interest_Vouchers",
    default = "v_seed_money",
    cards = {
        v_seed_money = true,
        v_money_tree = true
    }
})

(setting the cost to a voucher in another way would too be appreciated)

smoky holly
#

i notice that when i change the pixel_size of jokers they're no longer centered, do i need them to be in the top-left of their position in the atlas? or the center?

#

it would appear to be the case

red flower
teal grotto
#
    local scoring = {}
    for _, card in pairs(hand) do
            scoring[#scoring + 1] = card
    end
    return scoring
end,```
HOW TF DO I JUST MAKE ALL THE CARDS SCORE
teal grotto
red flower
#

works fine for me

#

can i see the entire code

teal grotto
#

oh wait im just stupid

#

works now lol

#

ty

#

thing is thats not my actual code and i want only the specific cards in the hand to score

lucid trench
#

yo guys i'm kinda new to modding in general, i know some lua but it's difficult for me to find the variables i need to do certain things, i wanted to make a simple joker: each stone cart discarded gives +3 to mult

calculate = function(self, card, context)
if context.on_discard_card then
if card.base and card.base.type == 'STONE' then
context.mult = (context.mult or 0) + card.ability.extra.mult
return {
message = 'Upgraded!',
color = G.C.RED
}
end
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end
end

i tried a lot of things and this is the one that got me the nearest

red flower
#

it just needs to be a table of all card combinations

red flower
slim ferry
#

it doesnt

lucid trench
#

i have no idea

#

at least it gave me some +3 prompts, but nothing else

red flower
#

your base mult might be 3 already so the joker_main part is scoring

#

anyway have you checked green joker

lucid trench
#

oh damn thanks, i was searching for this type of snippets

red flower
#

you would move what's in context.before to the discard part

lucid trench
#

the base problem was that i couldn't find the right variables from the source code

red flower
#

you can also check stone joker for the stone card part

bitter juniper
#

I edited the low contrast deck version sprites, how can I edit the high constrast version now?

red flower
teal grotto
#

random question
where the fuck is the documentation for smods.font

slim ferry
#

wait wtf

#

where did it go

#

it was definitely there first

bitter juniper
red flower
red flower
bitter juniper
red flower
#

the numbers are the cards

lucid trench
#

uh is there any video or step by step documentation for each command? the smods one is a bit chaotic

red flower
#

not really

bitter juniper
#

got in

#

thanks

red flower
lucid trench
#

damn, alr maybe this is a rushed start. What si the most basic thing i can make? Simple +4 joker?

red flower
#

yeah

lucid trench
#

let's roll

bitter juniper
#

should'nt this work? its not working

red flower
#

you're only defining the atlas objects there, not the skin

bitter juniper
#

whats an atlas object

red flower
#

the object that holds the sprite

#

SMODS.Atlas

#

you need the SMODS.DeckSkin now

bitter juniper
#

im trying to think how to do it with those hints

#

or will you get mad if I didnt understand what im supposed to do?

red flower
#

i literally sent you the code 😭

bitter juniper
#

ohhh

red flower
bitter juniper
#

pasted it

#

do i need to edit something?

red flower
#

remove the 3 suit_icon lines if you're not going to use icons

bitter juniper
#

i did that

#

thats what i have

red flower
#

that should work for hearts i think?

#

idk I've never done this

bitter juniper
#

lol

#

i have no clue too

#

not working 😭

calm reef
#

Is there somewhere to find the ids of every vanilla joker? I tried looking on the wiki but can't find anything

bitter juniper
slim ferry
#

vanillaremade uses the vanilla keys for everything

#

you can look at that

slim ferry
#

that also works ig

stoic void
#

I think

#

Where it says atlas = atlas_lc.key
Shouldn’t it be the key of your lc atlas

calm reef
red flower
stoic void
#

Oh

#

I thought it should have been TroopaDeckLC

red flower
stoic void
#

Well I suck at Lua then lol

bitter juniper
red flower
red flower
bitter juniper
red flower
#

check hearts

bitter juniper
red flower
#

yeah the "Spades", ... is not going to do anything

bitter juniper
bitter juniper
red flower
#

yeah

bitter juniper
#

done

#

it wont work tho

#

alrd tried

red flower
#

let me test stuff myself

bitter juniper
#

okie dokie

#

thanks :D

red flower
bitter juniper
#

in my mod folder

#

alongside "assets"

red flower
#

do you have a .json

bitter juniper
#

nop

#

just lua

red flower
#

you need to add that

bitter juniper
#

and copy paste the lua stuff?

red flower
#

check the one in the repository

bitter juniper
#

aight

red flower
bitter juniper
#

Does its name needs to be DeckSkinTemplate?

bitter juniper
#

done

red flower
bitter juniper
#

Done

red flower
#

check if it loads now, you should see it in the mod menu

bitter juniper
#

oh wait

#

i didnt even tried to check the mods menu, i thought i was modifying the game's files itself 😭

#

Ima name it my mod name now, right?

red flower
#

uhh it has an error it seems

bitter juniper
#

I probably need to edit the json file

red flower
#

ah yeah the main_file should point to your lua

bitter juniper
#

this might work, now?

#

nvm

red flower
#

that's good it means it loaded

bitter juniper
#

ill try to reset the lua one

#

i ve been messing w it

red flower
#

yeah theres a syntax error somewhere

bitter juniper
#

nop

#

crash

red flower
#

is it the same crash

bitter juniper
#

nop

red flower
#

ah ok

#

you need to remove the suit_icon lines i said before

bitter juniper
#

aight

red flower
bitter juniper
#

like this?

#

not working

#

shit's hard lol

stoic void
#

That is what code is like

#

Then you realise you missed like one letter or something and it just works

#

Which is why I love code

bitter juniper
#

lmao

red flower
#

does it crash or does it not show up

bitter juniper
#

crash

red flower
#

you're missing a } before SMODS.DeckSkin

bitter juniper
#

with space?

red flower
#

not necessary

stoic void
#

Ohh yeah i see

bitter juniper
#

working

#

lesgoo

#

let me see if they re there

bitter juniper
#

😭

slim ferry
#

what not using a code editor does to someone

bitter juniper
red flower
#

again, check hearts

bitter juniper
#

not there too

slim ferry
#

and also check the last skin of hearts

#

since thats where itll be

bitter juniper
#

OHH

#

THERE

#

THE ALST SKIN

#

wait

red flower
#

yeah it's probably going to be the wrong one

bitter juniper
#

so this adds a deck instead of retexturing it?

red flower
#

yeah

bitter juniper
#

oh my dumbass

#

lmao

stoic void
#

Ok, well that’s good that it works

bitter juniper
#

Only in hearts tho

red flower
#

now you need to add an SMODS.DeckSkin for each suit

bitter juniper
#

got it

#

brb

#

can I change the skin name instead of EXAMPLE?

#

loc.txt?

vale crow
#

When you create a seal, where is the calculate function stored? Can't find it in shared_seals or SMODS.Seals.

red flower
slim ferry
red flower
slim ferry
bitter juniper
#

not showing

#

am I doing smoething wrong?

vale crow
#

Ok thanks!

lucid trench
#

ok now i understand somethings, i did some base jokers tests and the all worked, now I just need to get the enhanchment thing


    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_CENTERS.m_stone
        return {vars = {card.ability.extra.d_mult, card.ability.extra.h_mult}}
    end,

   --I DID THIS BASICALLY RANDOM
    calculate = function(self, card, context)
        if context.discard and SMODS.has_enhancement(playing_card, 'm_stone') then
            return {
                d_mult = card.ability.extra.d_mult,
            }
        end
    end,
red flower
bitter juniper
#

oh wait

#

make it like this?

red flower
bitter juniper
#

key1 for hearts. key2 for spades etc...

#

okay got it

#

done

#

got it

#

all working

#

dont ask lol

#

what if I want to change the rest of the deck what do I add to the code? (Ace card)

red flower
#

i think the code already changes all the cards

bitter juniper
#

oh okay

red flower
#

but its set to show the face cards in the preview

bitter juniper
#

so just editing the texture?

red flower
#

yeah

bitter juniper
#

aight

#

thank you so much

#

:D

short fulcrum
#

I know some mods can change what ante the game is won at, is there a way to make a blind unable to appear in the ante before the final one (even if a mod changes what that is)

manic tusk
#

Would it be possible to make a joker trigger when a playing card is modified? The closest I can find is when a consumable card is used, but that wouldn't apply when, for example, midas mask or vampire modify a card

red flower
bitter juniper
#

just one more question

#

how do I change the mod image?

red flower
bitter juniper
#

I can only edit badge colour in the json file

short fulcrum
red flower
manic tusk
bitter juniper
#

thanks

red flower
bitter juniper
red flower
#

check the wiki i dont recall the name

short fulcrum
# red flower ah hmm you can just check the ante in in_pool then

right now I've got this:

    in_pool = function(self)
        local ante = G.GAME.round_resets.ante

        if G.GAME.round_resets.ante = 7 or G.GAME.round_resets.ante <= 2 then
            return false
        else
            return true
        end
    end

which would work in most situations, but if the final ante is changed, it obviously wouldn't change that

red flower
#

so you need to know how to check the final ante?

#

let me check the code

short fulcrum
winter flower
red flower
manic tusk
short fulcrum
#

ah awesome thanks, I'll test it out

teal grotto
#

how do i make a suitless rank
(can form 3oak, but not flushes)

red flower
manic tusk
#

Ah, a third wiki, thank you !

red flower
#

this should be your main one

manic tusk
#

I even have that one open but I didn't think of it as a wiki

#

I guess it's just github in my mind first

#

I am pretty new to this

teal grotto
#

the steamodded wiki is so unhelpful sometimes ;-;

red flower
teal grotto
#

aight

lucid trench
#

Ok now the things changed, 2 problems:
1 - Sometimes crashes when cards are pulled from deck (probably cause of enhancement)
2- The stone discard activates but crashes the game whenever an enhanced card is discarded (any enhance)


    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_CENTERS.m_stone
        return {vars = {card.ability.extra.d_mult, card.ability.extra.h_mult}}
    end,

   --I DID THIS BASICALLY RANDOM
    calculate = function(self, card, context)
        if context.discard and SMODS.has_enhancement(playing_card, 'm_stone') then
            return {
                d_mult = card.ability.extra.d_mult,
            }
        end
    end,
red flower
#

playing_card is nothing

lucid trench
#

where do i declare it?

red flower
#

in context.discard the playing card is context.other_card

#

also d_mult is not a thing

lucid trench
#

i tought that the variables names in loc_vars didn't matter, my bad

red flower
#

i dont mean those

#

those are fine

#

i mean the d_mult = ...

lucid trench
#

oh ok, ty

red flower
teal grotto
#

how do you hook a function but like put something in the middle of it

lucid trench
#

It works, thanks man

teal grotto
red flower
#

no

#

they're easy

teal grotto
#

everything is the same colour

red flower
#

well if you need highlights just code in the dump and then move it to a patch

unkempt bronze
#

guys, may I ask for new help?

#
                    local xiferp_up_another_step = SMODS.poll_enhancement({guaranteed = true, type_key = 'shuffletheseed'})
                    card:set_ability(xiferp_up_another_step, nil, true)   
                 end```
This isn't enhancing any cards
#
SMODS.Consumable {
    key = "flynnine",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 14, y = 6 },
    unlocked = true,
    discovered = true,
    config = { extra = { element_no = 103, odds = 3, yes_is_no = false }},
    keep_on_use = function(self, card)
       return true
    end,
    can_use = function(self, card)   
      if card.ability.extra.yes_is_no == false then
        return true
      end
    end,
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 2, card.ability.extra.odds, 'c_xiferp_flynnine')
        return { vars = { numerator, denominator } }
    end,
    use = function(self, card, area)
       card.ability.extra.yes_is_no = true
    end,    
     loc_txt = {
        name = 'Flynnine',
                text = {
                    'Adds x5 mult to your next hand',
                    'and enhances all held cards',
                    '(2/3 chance to radioactively decay)',
                },
            },
    calculate = function(self, card, context)
    if card.ability.extra.yes_is_no == true then
        if context.individual and context.cardarea == G.play then
                   G.GAME.xiferp_rowseven_xmult = (G.GAME.xiferp_rowseven_xmult or 0) + 5
                 SMODS.destroy_cards(card, nil, nil, true)
                 for _, card in ipairs(G.hand.cards) do
                    local xiferp_up_another_step = SMODS.poll_enhancement({guaranteed = true, type_key = 'shuffletheseed'})
                    card:set_ability(xiferp_up_another_step, nil, true)   
                 end
            end
        end
    if context.individual and context.cardarea == G.play then
         if SMODS.pseudorandom_probability(card, 'c_xiferp_flynnine', 2, card.ability.extra.odds) then
                SMODS.destroy_cards(card, nil, nil, true)
                SMODS.add_card({ key = 'c_xiferp_xenon' })
        end    
    end
end
}```
#

here is it in context

wind steppe
#

you should probably check card.ability.extra.yes_is_no after checking for context.individual

#

i dont see any issues with the snippet though, make sure the code is being reached in the first place with a print or something

unkempt bronze
#

thank you

wind steppe
#

also oops won't affect your joker's description (still affects the chance)

#

+the description is unclear about when that chance is rolled

unkempt bronze
#

doesn't seem to work

wind steppe
#

by that do you mean the code isnt being reached?

unkempt bronze
#

code's not reached, yea

wind steppe
#

check if the destroying code is reached

unkempt bronze
#

Oh, wait, it works actually

#

thank you!

#

(took playing a hand, but still works)

wind steppe
#

also the timing at which it enhances is a little weird?

#

me personally id put it in context.before

#

wait no thats held in hand nvm

#

this would still have issues with something like cryptid's None though so i still recommend using context.before

unkempt bronze
#

fair

#

Thanks anyways!

spiral mural
#

how does a vanilla blind debuff a card

unkempt bronze
#
SMODS.Blind {
    key = "club",
    dollars = 5,
    mult = 2,
    debuff = { suit = "Clubs" },
    pos = { x = 0, y = 4 },
    boss = { min = 1 },
    boss_colour = HEX("b9cb92")
}```
Here's how the boss blind "The Club" does it
wind steppe
spiral mural
#

what function does a vanilla blind use to debuff a card

teal grotto
#

how do you change ante scaling on a specific deck?

spiral mural
#

🪱

wind steppe
teal grotto
#

alright

wind steppe
#

both stakes increase it by 1

spiral mural
red flower
#

yes

unkempt bronze
#

I have an error in the following line:
G.GAME.card.Joker.display_size.h = 0.7 * G.GAME.card.Joker.display_size.h
It's supposed to squash all jokers by 70%

red flower
#

because that line is non sensical

unkempt bronze
#

Well, how would I do it?

red flower
#

dunno

wind steppe
#

id hook update

unkempt bronze
#

the line's supposed to read the joker's display size and shrink it like how the Wee Joker does it

wind steppe
#

if whatever condition is satisfied loop through G.I.CARD every frame and squash every unflagged card, then add a flag to the card so you dont further squash it next frame

unkempt bronze
#
        G.GAME.xiferp_lineseven_xmult = (G.GAME.xiferp_lineseven_xmult or 0) + 5
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                func = function()
                        G.GAME.card.Joker.display_size.h = 0.7 * G.GAME.card.Joker.display_size.h
                    return true
                end
            })) 
    end,```
Here's the line's context
wind steppe
#

can i ask why your xmult scaling starts at 0

unkempt bronze
#

it doesn't

#

not practically at least

wind steppe
#

whats with the G.GAME.xiferp_lineseven_xmult or 0 defaulting to 0 then

unkempt bronze
#

copy-paste thing

wind steppe
#

in the event you would want to set a flag in G.GAME

#

then hook update and check for it every frame: if its true, loop through G.I.CARD and squash every unflagged card, then add a flag to the card so you dont further squash it next frame

#

also check to make sure the card is a joker

unkempt bronze
#

Anything a bit simpler? One that just starts with the jokers?

wind steppe
#

i mean theoretically you could loop through G.I.CARD in the event if you dont want it to apply to any future jokers

#

but also i dont think any of that is that complicated? G.I.CARD is a table containing every currently visible card

#

you have to loop through it with pairs

unkempt bronze
#

I'll code that up later.

#

(after dinner, tell you consequences tomorrow)

dawn granite
red flower
#

1.0 is not out

#

: )

#

its in beta

dawn granite
#

i should just set it to like 0.smth then right

red flower
#

"Steamodded (>=1.0.0~BETA)" i think

#

i just set it to the exact one "Steamodded (>=1.0.0~BETA-0624a)"

dawn granite
#

ok it's working now

teal grotto
#

how do you make blinds "score at least as low as:"

red flower
#

what do you mean

teal grotto
white hull
#

Assuming you already have a way to decrease score, probably just make the blind itself compare scores and trigger a win if it's correct

#

I think it has a calculate function

young leaf
#

ive been having trouble getting these consumables to appear correctly
they are 64 x 64 pixel squares but ive tried setting their px and py, defining pixel size and display size, and theyre always stretched into the default dimensions
does changing these values work for consumables or just jokers?
(spoilers for blue prince)

short fulcrum
#

I'd imagine spacing them out in your atlas while pretending they're the size of normal joker cards (71*95) would work

#

though I guess they'd be off-centre

young leaf
#

that works!
i just moved them to be in the center
i guess the only issue is you can still grab it from that 71 x 95 zone but im ok with that for now

#

alright pixel_size fixed that issue huzzah

round lion
#

i don't have can use set, why isnt it usable?

harsh belfry
#

you don't have a can use function

round lion
#

i was out here thinking it would just be usable at any time

#

how should use select card as a function anyway

#

i got a attempt to compare number with table on

if G.GAME.hands[G.handlist[i]].level > 0 and G.handlist[i] ~= card.config.extra.poker_hand then

#

wait

daring fern
gilded blaze
round lion
gilded blaze
#

what are you trying to do

round lion
#

trying to make a legendary consumable that sacrifices everything in exchange for supercharging a poker hand

#

doesnt matter because i got wrong number of arguments to insert over
table.insert{todestroy, G.playing_cards[i]}

gilded blaze
#

that does "everything" mean in this context

round lion
#

Aka. "Dying Neutron Star"

Trades all your enhanced cards, jokers, and hand levels for levels on a hand determined the moment the card generates.```
#

wait a mminute

-# that was another bug, still at large is the main elephant in the room

gilded blaze
#

lua treats that as a single table

round lion
#

i feel like the entire circus rn.

#

why does times negative 1 no llonger work for flipping

gilded blaze
#

what

#

did you mean Card:flip

round lion
#

no

#

i mean turning a number negative

red flower
#

you need to multiply harder

round lion
#

atp ima just use the method that works every time

pulsar hawk
#

y'all is there an easier way to do custom boxes for tooltips?

#

because istg having to define them from scratch, then hook UIE functions to see the custom tooltip just feels off

frosty rampart
#

yea
in localization, do this

return {
  descriptions = {
    ...
    Other = {
      custom_tooltip = {
        name = "Something",
        text = {
          "This is a custom tooltip"
        }
      },
      ...

and then in the loc_vars function for the object you want the custom tooltip, do this

loc_vars = function(self, info_queue, card)
  info_queue[#info_queue + 1] = { set = "Other", key = "custom_tooltip" }
  ...
end
#

the key of the tooltip doesn't require a mod prefix but it's probably a good idea to set it anyway

next pivot
#

do you guys know a good way to stack cards in a cardarea vertically?

pulsar hawk
frosty rampart
#

a
my bad lol
yea idk balatro ui is jank

pulsar hawk
#

you ever pour your heart and soul into a feature and forget to do micro-commits?

round lion
#

how do i use timers

eager anvil
#

edit: I figured it out

sturdy compass
eager anvil
#

ur wrong, it works now it was just a typo in my code

sturdy compass
#

I am so sorry I replied to the wrong thing

#

That was meant for modding general

eager anvil
#

ah no worries haha ^^
I assumed you saw my pre-edited message somehow

wild patrol
#

Looking for ideas of twitch commands for the twitch mod if you could have the ability to control a streamers run what would you want to control

loud citrus
wild patrol
#

Had an idea for a random joker command

#

So yeah might do that instead

#

My favorite working command so far is the fake soul card

#

Gives you a soul that just makes a fart sound

#

And says pranked

glass scaffold
#

Love it.

loud citrus
#

another silly one, if in a shop, forces them to move on, if selecting a blind, forces them to skip it, if in a blind, forces them to play a hand

glass scaffold
#

Anyways, code no work and don't know why. No crash or anything.

wild patrol
#

Can u show the whole code

#

I'm not very smort but I think I might know

#

If not someone will correct me

loud citrus
#

depends on your goal

glass scaffold
round lion
#

how do i use the sprite manipulation functions

#

wait i might have a plan

glass scaffold
#

Ok, now it's saying xnil. What is wrong with it where it's not triggering?

#

and it's not the Xmult_mod needing to be in a config, there are other Jokers in my mod that use the same method to do xMult

wild patrol
#

Had very similar thing when working on the monkey joker

glass scaffold
#

Here's the full code.

wild patrol
#

I think xchips_mod should just be x_chips

#

Same for xmult_mod

#

If I'm not mistaken

#

I'm still learning this stuff as I go but I think that's how I fixed mine

daring fern
glass scaffold
daring fern
loud citrus
glass scaffold
#

Yeah, still not triggering at all.

red flower
#

you're not returning

loud citrus
glass scaffold
loud citrus
#

lol

glass scaffold
#

How is this not triggering? I'm wasting all my hands except the last one and nothing.

red flower
#

check what it is returning

glass scaffold
#

Oh my god. I just checked the return.

golden lake
#

I am terrified of people who code with non-monospaced fonts

glass scaffold
#

FINALLY WORKS

limber aspen
#

When does set_sprites gets called?

#

And is front in set_sprites(self, card, front) a bool

#

I figured it out

#

Seems like front is not bool

red flower
#

front is the playing card front iirc

#

so the suit and rank i think

toxic cave
#

how do you check for a specific deck? i do this but it doesnt seem to work

#

no errors btw, it just does nothing

red flower
#

the key should be b_[mod prefix]_[deck key]

toxic cave
#

im so smart and intelligent how do i keep on forgetting this

stoic void
toxic cave
#

nope still nothing

#

i took these patches from VR and replaced the next(smods.find_card()) parts with IsEffectDeck

stoic void
#

wait no I cant read

#

excuse my dumbassery

red flower
toxic cave
#

wait

#

how does vr smeared joker work?

#

it does this but i dont see it patch the actual smeared_check

#

and the smeared_check fails automatically because it doesnt have the actual smeared joker

#

or wait does find_joker just do it by name and im stupid

daring fern
junior tapir
#

Does anyone know how to force skip a pack?

daring fern
#

wintry solar
#

I admire your persistence on these

teal grotto
#

is it possible to make jokers take up 2 slots?
because i tried incrementing all joker values and it seems to have made the jokers take up 2 slots

slim ferry
#

yes, card.ability.extra_slots_used

teal grotto
#

ty

hasty kelp
#

How to add your own poker hands

#

Like a poker hand named junk which is half a high card score

wild patrol
#

i did e_bootleg and ttv_e_bootleg

#

and keep getting this crash telling me i'm missing the e_ prefix

slim ferry
#

the mod prefix is always after the class prefix

#

its e_ttv_bootleg

wild patrol
#

oh ok

#

the vision is real

limber aspen
#

Is there a built in functions for selecting and deselecting a card?

wild patrol
#

slightly updated

#

but this probably what i'm going for when I mentioned the idea of temu jokers

daring fern
smoky holly
#

im trying to make an idol-like joker but for some reason it's crashing when i hover over it in my collection while a run is open, and not outside of it

#
{
    key = "search_and_find",
    atlas = "jokers",
    pos = {
        x = 5,
        y = 2
    },
    unlocked = true,
    discovered = false,
    rarity = 1, -- Common
    cost = 6,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,

    -------------------------

    loc_vars = function(self, info_queue, card)

        return {
            vars = {
                localize(G.GAME.current_round.j_o_y_search_find_card.rank, "ranks"),
                localize(G.GAME.current_round.j_o_y_search_find_card.suit, "suits_plural"),
                colours = { G.C.SUITS[G.GAME.current_round.j_o_y_search_find_card.suit] }
            }
        }
    end,

    calculate = function(self, card, context)

        
    end
}

-- im gonna be real this is mostly just copy-pasted code, i have a decent understanding on how it works tho
-- here i save this game function so i dont completely overwrite it
local igo = Game.init_game_object
--we make a new function with the same name that will run the old function
function Game:init_game_object()
    -- this is where the old function is run, any code before or after it will "add" that code to it
    local ret = igo(self)
    ret.current_round.j_o_y_search_find_card = { rank = "Ace", suit = "Spades" }
    return ret
end

-- and this is where the card's rank and suit to find changes between runs and rounds like Idol does, no need to put it inside the SMODS.Joker
function SMODS.current_mod.reset_game_globals(run_start)
    G.GAME.current_round.j_o_y_search_find_card = { rank = "Ace", suit = "Spades" }
    local valid_saf_cards = {}

    for _, v in ipairs(G.playing_cards) do
        if not SMODS.has_no_suit(v) and not SMODS.has_no_rank(v) then
            valid_saf_cards[#valid_saf_cards + 1] = v
        end
    end
    if valid_saf_cards[1] then
        local saf_card = pseudorandom_element(valid_saf_cards, pseudoseed("j_o_y_search_and_find"))
        G.GAME.current_round.j_o_y_search_find_card.rank = saf_card.base.rank
        G.GAME.current_round.j_o_y_search_find_card.suit = saf_card.base.suit
    end
end```
#

i followed it exactly as it tells me in ExampleMods

red flower
#

i dont like this change because you can't hook the function but whatever

red flower
#

i did some things different that i didn't like in the examples

smoky holly
#

how important is appending G.GAME.round_resets.ante to the seed btw?

#

ah i think i see what went wrong

red flower
red flower
junior tapir
# red flower G.FUNCS.skip_booster()

ehh, I tried like that, right after the open() with skip_booster(e) or end_consumeable(...), but to no avail. I achieved my desired functionality with dissolving the cards in the pack right after they emplace (it forces the player to manually skip, and I am ok with that)

smoky holly
junior tapir
#

ooh, manager, ofc

storm kraken
#

made an accidental discovery

gilded blaze
#

ghost card

stoic void
#

yeah what

#

what card is that

gilded blaze
#

happens when there are 2 or more references to the same card

#

that face-down darkened card is supposed to be in deck, not drawn yet, and way below
or in discard pile

#

but the second reference forces the card to be in hand

#

thus it tells Lua to "draw" (both ways!) the card to hand, with its state still intact

hasty kelp
#

randomly my mod is crashing at line 8 and line 14 in my current code

    key = 'Jokers',
    path = 'Jokers.png',
    px = 71,
    py = 95,
}

SMODS.Joker{
    key = 'mrsexy',
    loc_txt = {
        name = 'Mr. Sexy',
        text = {"{C:blue,s:1.1}+#1#{} Chips"}
    }
    atlas = 'Jokers',
    rarity = 1,
    cost = 2,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    perishable_compat = false,
    pos = {x=0, y=0},
    config = {extra = { chips = 69}},
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.chips}}
    end, 
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chips
            }
        end
    end,
}
stoic void
hasty kelp
#

wtf because when i made it like 6 months ago it worked without it

#

nope still same errors

stoic void
#

and is the name of your image for jokers called Jokers.png

stoic void
hasty kelp
stoic void
#

you need it in your mod

#

it is looking for Jokers.png

#

if that isnt in your mod

#

well... I dont think I need to explain

hasty kelp
#

it crashes after having the image in my folder

stoic void
wild patrol
#
    local RanJoker = {"j_gros_michel", "j_egg", "j_ice_cream", "j_diet_cola"}
    local RanSelect = math.random(#RanJoker)
    local RanCreate = RanJoker[RanSelect]
    if is_on_cooldown then
        math.randomseed(os.time())
        if G.STAGE ~= G.STAGES.RUN or not G.GAME then return end
        local card = SMODS.add_card({key = RanCreate})
        card:add_to_deck()
    end
end```
stoic void
#

which both of those folders being in an assets folder

wild patrol
#

made a scuffed random joker selector

#

is there an easier way to do this

wild patrol
#

or is just manually adding the jokers the best way lmao

stoic void
hasty kelp
#

i have this as my loading main file:
SMODS.load_file("src/jokers.lua")()
SMODS.load_file("src/pokerhands.lua")()

wild patrol
#

also is there like a list of every j_ name

#

so I don't have to dig through balatros lua to find them all

red flower
stoic void
#

Wait wha

red flower
#

you might as well do G = nil

stoic void
#

Mb

hasty kelp
#

its my formatting that is wrong

red flower
#

you were missing a comma

hasty kelp
#

where

red flower
hasty kelp
#

@red flower can you please send me a layout template

hasty kelp
#

when i add it is still give me the error

red flower
#

can i see your current code

red flower
# wild patrol ```chat_commands.randomjoker = function() local RanJoker = {"j_gros_michel",...

there are a couple of problems: math.random doesnt respect seeds and add_card already does add_to_deck so you're doing it twice

local random_joker_key = pseudorandom_element({"j_gros_michel", "j_egg", "j_ice_cream", "j_diet_cola"}, "seed")
SMODS.add_card{key = random_joker_key}

you can also make a pool and use that as the set for add_card, there's an example in vremade wiki of how to make a pool with food jokers

hasty kelp
wild patrol
#

if i'm making a pool does it really matter

hasty kelp
#

i just didnt copy it from where its located

red flower
#

i dont understand the question

wild patrol
#

working on a command that can pick any joker in the game to spawn

hasty kelp
#

i have a 2x png that is unsupported lmao

red flower
wild patrol
#

seems making a table is the way to go lol

red flower
#

post the log, this is literally a basic command lol

wild patrol
#
functions/common_events.lua:2172: bad argument #1 to 'ipairs' (table expected, got nil)


Development version of Steamodded detected! If you are not actively developing a mod, please try using the latest release instead.



Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1229a-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
    1: Twitch Integration by chowder908, JackMacWindows, Mossloth [ID: twitchintegration, Version: 1.0.0]
    2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.5.1, Uses Lovely]
    3: SystemClock by Breezebuilder [ID: SystemClock, Priority: 100000, Version: 1.7.1, Uses Lovely]
    4: JokerDisplay by nh6574 [ID: JokerDisplay, Priority: -1000000000, Version: 1.8.8.5]
Lovely Mods:

Stack Traceback
===============
(3) LÖVE function at file 'boot.lua:352' (best guess)
Local variables:
 errhand = Lua function '(LÖVE Function)' (defined at line 605 of chunk [lovely debugplus.console "debugplus/console.lua"])
 handler = Lua function '(LÖVE Function)' (defined at line 605 of chunk [lovely debugplus.console "debugplus/console.lua"])
(4) global C function 'ipairs'
(5) Lua global 'get_current_pool' at file 'functions/common_events.lua:2172'
Local variables:
 _type = string: "joker"
 _rarity = nil
 _legendary = nil
 _append = nil
 _pool = table: 0x13b9a628  {}
 _starting_pool = nil
 _pool_key = string: "joker"
 _pool_size = number: 0
(6) Lua global 'create_card' at file 'functions/common_events.lua:2338'
Local variables:
 _type = string: "joker"
 area = nil
 legendary = nil
 _rarity = nil
 skip_materialize = nil
 soulable = nil
 forced_key = nil
 key_append = nil
 area = table: 0x03ea29a8  {click_offset:table: 0x0b2d5c58, static_rotation:false, shuffle_amt:0, T:table: 0x13a273c8, offset:table: 0x03e9a278, role:table: 0x03cd19d8, last_aligned:-1 (more...)}
 center = table: 0x04533b10  {order:1, _d:true, set:Back, stake:1, key:b_red, discovered:true, alerted:true, pos:table: 0x04533c00, unlocked:true, _u:true, _discovered_unlocked_overwritten:true (more...)}
(7) Lua field 'create_card' at Steamodded file 'src/utils.lua:383' 
Local variables:
 t = table: 0x13b9a5c8  {set:joker}
(8) Lua field 'add_card' at Steamodded file 'src/utils.lua:405' 
Local variables:
 t = table: 0x13b9a5c8  {set:joker}
(9) Lua function '?' at file 'commands.lua:196' (from mod with id twitchintegration) (best guess)
Local variables:
 modifier = string: ""
 RanEdit = table: 0x13b9a558  {1:nil, 2:e_foil, 3:e_polychrome, 4:e_holo, 5:e_negative}
 RanSelect2 = number: 4
 RanCreate2 = string: "e_holo"
(10) Lua method 'update' at file 'main.lua:118' (from mod with id twitchintegration)
Local variables:
 self = table: 0x03ace6b0  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x0e89e888, F_ENGLISH_ONLY:false, viewed_stake:8, HUD:table: 0x0e806690 (more...)}
 dt = number: 0.00606091
 line = string: ":chowder9o8!chowder9o8@chowder9o8.tmi.twitch.tv PRIVMSG #chowder9o8 :!randomjoker"
 err = nil
 user = string: "chowder9o8"
 msg = string: "!randomjoker"
 command = string: "randomjoker"
 arg = string: ""
(11) Lua field 'update' at file 'main.lua:1011'
Local variables:
 dt = number: 0.00606091
(12) Lua function '?' at file 'main.lua:950' (best guess)
(13) global C function 'xpcall'
(14) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
 func = Lua function '?' (defined at line 921 of chunk main.lua)
 inerror = boolean: true
 deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
 earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])```
red flower
#

Joker uppercase

wild patrol
#

works

#

now I gotta do the same for editions

#

have it sorta working

red flower
#

all of this is in the vanillaremade wiki btw

#

editions too

wild patrol
#

I got the editions working

#

I just need to figure out how to havea chance at it being a normal joker

red flower
#

jokers added thorugh that command already have a chance for editions btw

#

you dont need to add them

wild patrol
#

oh

red flower
#

this is why it's imporant to look at documentation before you try things lol

wild patrol
#

I'm a if it works it works guy

#

"As long as it works"

#

🧨

#
    if is_on_cooldown then
        math.randomseed(os.time())
        if G.STAGE ~= G.STAGES.RUN or not G.GAME then return end
        end
        local card = SMODS.add_card{set = 'Joker'}
        card:add_to_deck()
        card:juice_up(0.3, 0.5)
        play_sound('card1', 1)
    end```
red flower
#

well i dont agree with that philosophy

red flower
wild patrol
#

SMODS.add_card{set = "Joker"} isn't really random sadly

#

it just creates the next card in seed

#

it's only random if u never play a seeded run

#

I guess it can work for now then whenever I get free time i'll figure something out

hasty kelp
#

so if you type baron it will give you baron

wild patrol
hasty kelp
#

i havent tried making that

wild patrol
#

well using the table i made from the original version is actually random

hasty kelp
#

then use it if you can convert it to smods

red flower
#

if you want it truly random then yeah you can use math.random

wild patrol
#

I mean this is ok for now

#

like I said i'll probably swap back to table method later

#

well it's still random

#

enough

#

it's just the randomness is seed just like the joker pool

#

but the jokers aren't the same in the shop so it's good

red flower
#

you can give it a key_append based on the time for more randomness

hasty kelp
#

i had made a reverse tooth blind as joker before i lost my mod progress i had made

wild patrol
#

but yeah it works

#

even supports the custom jokers

#

now question

hasty kelp
#

it had knave which basically was a baron for jacks, while i had made a baron but instead of 1.5x mult for kings it gave +1.5 mult

wild patrol
#

Destroy all jokers or destroy a random joker

tidal hemlock
tidal hemlock
#

there, its fixed

pastel kernel
#

i don't remember if this is the way to do itlua if context.post_joker or (context.main_scoring and context.cardarea == G.play) then return { hypermult = {self.config.hyper, self.config.mult} } end

#

for an edition

red flower
#

looks fine to me

tidal hemlock
#

why does none of my stuff work

red flower
#

you dont believe in it

frosty rampart
#

you have to believe in the heart of the cards

viscid talon
#

ok uh chat

#

i have no idea how to make this sticker a reality

#
SMODS.Sticker {
    key = "burdened",
    badge_colour = HEX '3abd4c',
    pos = { x = 0, y = 0 },
    atlas = 'CustomStickers',

    should_apply = function(self, card, center, area, bypass_roll)
        return G.GAME.modifiers.enable_burden_in_shop and card.config.center.burden_compat
    end,
}

local smods_is_eternal_ref = SMODS.is_eternal
function SMODS.is_eternal(card, trigger)
    return card.ability.vremade_eternal or smods_is_eternal_ref(card, trigger)
end
#

this is the code i got from the eternal stickers thing

#

and i edited some of it to have "burden"

#

but like

#

i dont know what i am doing

#

afaik thee stickers must be defined somewhere else

#

maybe i apply some sort of hook?

#

the role is this: every burdened joker takes up 2 joker slots instead of 1

shell timber
#

you should start by cutting the eternal ref

frosty rampart
#

you just need an apply function in the sticker to set extra_slots_used
here's the code I wrote for a sticker in starspace that does the exact same thing

#

when apply is called with val set to true, it's applying the sticker, and with val set to false, it's removing it

viscid talon
#

oke, ill give that a shot later

viscid talon
shell timber
frosty rampart
#

ya the outer if statement just skips the extra_slots_used stuff if it's being applied to a dummy card in the collection, because the tooltip that smods adds ends up being treated as the card's primary description instead of the sticker's tooltip

shell timber
#

oh thats weird

frosty rampart
#

I'd love to actually fix that but idk where to start in terms of the code for that

shell timber
#

ideally thered just be a way to suppress the tooltip

#

or at least some amount of it, so if a different source adds some itll still show

frosty rampart
#

true but in general I'd like to be able to have other tooltips
like if there was a sticker in entropy that did something with ascension power, I'd like the ascension power tutorial tooltip to pop up in the collection without also clobbering the sticker tooltip

shell timber
#

true

frosty rampart
#

oh also I just remembered
I was looking at morefluff code recently and I think colour cards could do with an smods.consumable:extend to define some common behavior. would make crossmod colour cards far less tedious

shell timber
#

oh yeah thatd probably be a decent idea

frosty rampart
#

I can probably write up a PR for that if you'd like

shell timber
#

thatd be lovely

sturdy compass
#

Last night I discovered Tags do not have sprite manipulation and it makes me sad 😭

shell timber
#

like for animation?

sturdy compass
#

No, like for changing sprites on the fly

final jewel
#

why does my cards dont show ?

sturdy compass
final jewel
# final jewel why does my cards dont show ?
    local ovch = {}
    for k, i in pairs(SMODS.Stickers) do
        if Giga.is_overcharge(k) then
            ovch[k] = i
        end
    end
    return SMODS.card_collection_UIBox(ovch, { 5, 5 }, {
        snap_back = true,
        hide_single_page = true,
        collapse_single_page = true,
        center = 'c_base',
        h_mod = 1.18,
        back_func = 'your_collection_other_gameobjects',
        modify_card = function(card, center)
            card.ignore_pinned = true
            center:apply(card, true)
        end
    })
end
G.FUNCS.your_collection_giga_overcharges = function()
    G.SETTINGS.paused = true
    G.FUNCS.overlay_menu {
        definition = ovch_ui_collection()
    }
end
local function wrap_without_overcharges(func)
    local dump = {}
    for k, i in pairs(SMODS.Stickers) do
        if Giga.is_overcharge(k) then
            dump[k] = i
            SMODS.Stickers[k] = nil
        end
    end
    local ret = func()
    for k, i in pairs(dump) do
        SMODS.Stickers[k] = i
    end
    return ret
end
local stickers_ui_ref = create_UIBox_your_collection_stickers
create_UIBox_your_collection_stickers = function()
    return wrap_without_overcharges(stickers_ui_ref)
end
local other_objects_ref = create_UIBox_Other_GameObjects
create_UIBox_Other_GameObjects = function()
    return wrap_without_overcharges(other_objects_ref)
end``` heres the code
normal crest
#

what does Giga.is_overcharge do

frosty rampart
#

this looks very similar to the code that paperback uses to give paperclips their own category and hide them from the stickers category, so yes I assume the issue is with that function's behavior

viscid light
#

I have two questions. Just got into modding today and need a teensy help already (big surprise, I know).

  1. How do I import Steammodded into Visual Studio so I can see the functions?
  2. How come the description text doesn't show "X10" and instead only shows "X"? (I mean for the bottom line of text, not the temp text)
round lion
#

there should be a lsp def folder in your smods folder

#

if there is, copy and paste it into your workspace

round lion
viscid light
viscid light
#

im not very technical when it comes to file formatting and such

slim ferry
#

oh wait youre in notepad++

#

yeah nvm then you cant get lsp i think

viscid light
#

im trying to go over to Visual Studio for this reason

#

i switched over to it, Im just not familiar with how VS works either

slim ferry
#

youll first want to open the folder of your mod in File > open folder

#

so you just see everything

viscid light
#

alright

#

and then open main.lua?

slim ferry
#

well you have your folder open so now you should see all the contents of the mod folder on the left

#

youll probably want to install the lua extension by sumneko from the extensions tab too

viscid light
#

alright, done and done

slim ferry
#

then you should hit F1 and search for Preferences: Open Workspace Settings (JSON)

#

and in the file it will create you should add the code snippet in the link i sent

viscid light
#

okey, done

#

-# is that actually it?

slim ferry
#

youll then just want to replace the two file paths with the actual steamodded and lovely dump file paths

#

so just open up file explorer, go to those folders and then copy the file path from the top into the settings file

#

if youre on windows youll have to replace all the slashes because it uses backslashes in file paths for some reason

viscid light
#

ah, I see

#

i got the paths and undid the slashes

slim ferry
#

if you did it right it should eventually show SMODS and balatro functions

viscid light
#

i think it does, yep

#

thanks for the help

final jewel
frosty rampart
#

could you post the code for the function

#

@keen atlas why does frost utils cause like half the lovely dump to stop dumping

#

actually i should probably test frost utils on its own before i pin the blame on it, i was using it in a big modpack for reasons

keen atlas
#

it loads the prepatched version for most of vanilla files so it doesn't get patched afterwards

#

except for when it's patching due to empty cache / modified modlist

#

the dump is there

frosty rampart
keen atlas
#

👍

#

ill add a toggle

dapper sun
#

how would i adapt my legendary jokers in shop code to uhhh not do this

-- 1 in 20 chance for shop Jokers to be Legendary
local gcp_hook = get_current_pool
function get_current_pool(_type, _rarity, _legendary, _append)
    if #SMODS.find_card("v_elle_breakthrough")>0 and _type == 'Joker' and _append == 'sho' and pseudorandom('ellerar'..G.GAME.round_resets.ante.._append, 1, 20)==1 then _legendary = true end
    return gcp_hook(_type, _rarity, _legendary, _append)
end```
normal crest
#

it could be the issue since the ui seems to be working

junior tapir
#

When hovering over a deck like Magic or Zodiac, certain UI boxes appear referring to the vouchers/tarots. Does anyone know how to achieve such boxes in a custom deck?

slim ferry
#

{T:key} in the formatting

#

the key can be any key in G.P_CENTERS or G.P_TAGS

junior tapir
#

thanks

craggy ledge
#

this is gonna sound really really really stupid so bare with me here, if i'm on jokerforge, how would i make a joker that resets its mult at end of round? i know i'm missing something obvious.

#

i'm a novice doing this for the first time

slim ferry
#

you should probably ask the joker forge thread or discord for this

slim ferry
#

Locked i think

#

it says it there

wild berry
#

it looks familiar but i guess youre right

#

probably just a coincidence

slim ferry
#

im pretty sure familiar is a spectral card

spiral mural
#

why does this crash

#
                    local edition = G.P_CENTERS["e_MDJ_corrupted"]
                    local aura_card = G.jokers.highlighted[i]
                    aura_card:set_edition(edition, true)
slim ferry
#

its supposed to be a string

#

smh

spiral mural
dapper sun
#

yea

#

not the G.P_CENTERS

final jewel
# normal crest what does the code look like tho?
---@param key string
---@return boolean
function Giga.is_overcharge(key)
    for i, _ in ipairs(Giga.POOLS.Overcharges) do
        if i == key then
            return true
        end
    end
    return false
end

--- Check if a card has an overcharge.
---@param card table
---@return string | nil
function Giga.has_overcharge(card)
    for i, k in pairs(card and card.ability or {}) do
        if Giga.is_overcharge(i) then
            return i
        end
    end
    return nil
end

--- Delete overcherge on a card
---@param card table
function Giga.delete_overcharge(card)
  for i, _ in pairs(card and card.ability or {}) do
        if Giga.is_overcharge(i) then
      card.ability[i] = nil
    end
  end
end

--- Add an Overcharge to a card
---@param card table
---@param key string
function Giga.set_overcharge(card, key)
    if card and Giga.is_overcharge(key) then
        Giga.delete_overcharge(card)
        SMODS.Stickers[key]:apply(card, true)
    end
end
```thats the code my bad for the delay I got an important call
normal crest
#

since ipairs only goes over consecutive indices starting from 1

final jewel
#

oooh

#

let me try

#

but I get this crash now

normal crest
#

that looks like you have a non existent function name in a ui element

#

but i'm not sure

final jewel
#

oh Idk what I have done but just a CTRL + Z and now it work

#

but is it possible to add a sticker to a card with like a command or something

normal crest
#

I mean you have it on your code, SMODS.Stickers[key]:apply(card, true)

#

with debugplus console

frosty rampart
#

and in debugplus, dp.hovered is the card object for whatever card you're currently hovering over

normal crest
#

you can also just use your own function, eval Giga.set_overcharge(dp.hovered, key)

final jewel
#

ok it work fine now but I want to make the sprite change dynamicly

light heron
red flower
red flower
# light heron

ui is hard to explain, did you look at the smods wiki guide?

final jewel
light heron
red flower
red flower
#

intermediate i would say at least

light heron
#

yea I’m cooked

lethal belfry
#

I wanna make the top card always be a steel card if there's one in the deck but I'm very confused on what to do because i ain't the smartest at code

red flower
#

G.deck.cards is a list of cards in the deck where the card at index 1 is the one at the bottom of the deck
what you want to do is sort the list so that the steel cards are closer to G.deck.cards[#G.deck.cards]

lethal belfry
#

so like...
G.deck.cards[1] = SMODS.has_enhancement(playing_card, 'm_steel')

final jewel
lethal belfry
#

i wouldn't know how to format a card like that cause nothing in vanilla works like that

red flower
final jewel
#

no no just the sprite

#

of the sticker

red flower
#

yeah that's what i mean

#

you want to do that but with the stickers sprite object

#

let me look up where it is

final jewel
#

like its supposed to be different during boss blind

red flower
#

G.shared_stickers["modprefix_key"]:set_sprite_pos{...} i think

red flower
#

I would maybe recommend doing easier stuff until you get a bigger grasp on coding

lethal belfry
#

right ok

umbral zodiac
#

is there a way to get a cards description as a table from localize

#

if not how else would be best to do so

unkempt bronze
#

Does anyone know any jokers that shrink cards?

frosty rampart
#

wdym by shrink cards
like physically shrink the visual size of the card?

unkempt bronze
#

yea

#

to wee joker height specifically, but to any size broadly

frosty rampart
#

for wee size, set card.T.w = card.T.w * 0.7 and card.T.h = card.T.h * 0.7 on the card you want to shrink
this won't save if you back out to the main menu tho, and i'm not sure if there's any better way to do it

unkempt bronze
#

Is it permanent for the run or for as long as it's onscreen?

frosty rampart
#

i tested and it does persist across the rest of the run, just not if you quit out and load the save back up

unkempt bronze
#

good with me

#

now to make it only hit the held jokers...

#

should be easy

frosty rampart
unkempt bronze
#

eh, so long as it shrinks the height of jokers, it's good with me

#
             card.T.w = card.T.w * 0.7
         end)```
Implemented, should it look like this?
frosty rampart
#

don't forget card.T.h = card.T.h * 0.7

#

also do you want it on the jokers or the cards held in hand? because G.hand.cards is the cards held in hand

unkempt bronze
#

Okay, it works

#

Next challenge

#
                      (find jokers of rarity_statarity - 1, and randomly get two)```
how do I get two jokers of the next rarity down from a random joker?
#

(ping if you have an answer)

frosty rampart
#

assuming the rarity is a vanilla rarity, you can just call SMODS.add_card { set = "Joker", rarity = x } where x is the number of the rarity (common = 1, uncommon = 2, rare = 3) and it'll automatically create a random joker of that rarity for you
if the rarity is a modded rarity, you'll have to manually define what "the next rarity down" means, but once you know that you can pass that into SMODS.add_card just the same (rarity can also be a string, for modded rarities)

#

@unkempt bronze

unkempt bronze
#

thank you!

#

hm

#

if context.yes_is_no = true then

frosty rampart
#

it should be == true, but really it should just be if context.yes_is_no then

#

you don't need to have == true for any if checks

#

unless you're trying to make sure that it's specifically a boolean and not some other thing that just counts as true, which is a rather niche case

spiral mural
#

how do it tell what object type a card is/if its a voucher

white hull
#

local is_voucher = card.ability.set == "Voucher"

#

vanilla remade wiki is helpful for questions like this

red flower
#

i wonder who wrote it

normal crest
#

it was you N

#

how do you not know

#

did you forget

red flower
#

where am i

lethal belfry
#

i'm trying to get my joker to retrigger held steel cards, but i have no earthly idea why it isn't retriggering

frosty rampart
#

not context.cardarea == G.hand

#

steel cards only trigger in G.hand

lethal belfry
#

oh it's the not

#

it still doesn't retrigger anything

daring fern
#

And you should use SMODS.has_enhancement(context.other_card, 'm_steel') instead of SMODS.get_enhancements(context.other_card)["m_steel"] == true

lethal belfry
#

ah thanks

red flower
lethal belfry
#

yeah that tracks

#

i'm trying to learn this code by making the joker in jokerforge and then editing the code myself which is why a lot of this is really sloppy

frosty rampart
#

honestly a pretty bad idea
jokerforge generated code is usually not a good reference, because there's usually a lot of extra syntax junk to account for every possible option (and also a lot of it is just bad even for generated code). might be worse than writing the code from scratch, because otherwise you'll constantly have to be unlearning bad habits

lethal belfry
#

i guess, but i'm definitely trying to learn more from the vanilla reforged than i am from jokerforge

frosty rampart
#

vanillaremade is right there for you
great reference of well-written code reimplementing basically all the vanilla content, including non-jokers

lethal belfry
#

whoops i meant vanillaremade

#

i am looking at that yes

#

looking at reforged would be completely redundant lol

pastel kernel
#

i'm tripping , why won't sound and colour register```lua
return {
hypermult = {self.config.hyper, self.config.mult},
sound = "busterb_Thunder1",
colour = SMODS.Gradients["busterb_Thomasgradient"]
}

lethal belfry
#

alright, this is supposed to unlock a joker if the joker itself gets destroyed it's definitely not working

glass scaffold
#

Also, maybe remove the G.P_CENTERS from that?

lethal belfry
#

yeah still doesn't work... this entire thing of code needs to be redone i think but i am absolutely not sure how

frosty rampart
lethal belfry
#

also yeah crucify me it's jokerforge but this is a joker i made before you said that and i'm trying to code jokers from scratch now

#

by taping together a bunch of vanillaremade code

#

it is not working in the slightest

#

god i hate modding

frosty rampart
faint yacht
glass scaffold
#

I've tried context.after and context.final_scoring_step, but it still keeps on adding the 10% before ANY scoring is done. Why is this being difficult with me?

pastel kernel
frosty rampart
# lethal belfry like this?

no need to put anything in a return statement, literally just

if context.joker_type_destroyed and context.card == card then
  unlock_card("j_stinky_crucible")
end

(to be clear, the intended effect is "if this joker is destroyed, unlock the Crucible joker"?)

glass scaffold
faint yacht
# pastel kernel hypermult_message = "text string"?
echip_message = {message = localize{ type = "variable", key = "toga_Echip", vars = { card.ability.extra.heldechip } }, colour = G.C.DARK_EDITION, sound = "talisman_echip"}

Snippet from my Michael Rosen return.

lethal belfry
#

and yes, the name of the card is spelled right

frosty rampart
#

hrm, stumped then

#

unlock conditions aren't my strong suit

lethal belfry
#

i'm seeing usually that unlock conditions are in the jokers themselves and not really in other jokers

#

maybe that's the problem

#

but then the code would be entirely different and i am tired

#

wait is it supposed to be outside of the calculate

pastel kernel
#

i don't use any localization files

faint yacht
#

You can just give it a raw string.

glass scaffold
frosty rampart
#

G.GAME.chips doesn't actually update its value until after context.after

pastel kernel
# faint yacht You can just give it a raw string.
return {
                hypermult = {self.config.hyper, self.config.mult},
                hypermult_message = {message = "^^^^ "..self.config.mult, colour = SMODS.Gradients["busterb_Thomasgradient"], sound = "busterb_Thunder1"}
            }
frosty rampart
final jewel
#

is there a G that hold every card discarded, I tried G.discard and G.discard.cards and it doesnt seems to work

lethal belfry
frosty rampart
faint yacht
#

Should work, although I am not familiar with hypermult specific strings.

pastel kernel
#

where'd you get the strings?

frosty rampart
final jewel
#

in the loc_vars

#

oh shoot should make an if statement so only during run

#

mb

faint yacht
# pastel kernel where'd you get the strings?
elseif eval_type == 'hyper_mult' then 
        sound = 'talisman_eeemult'
        text = (amt[1] > 5 and ('{' .. tostring(amt[1]) .. '}') or string.rep('^', amt[1])) .. tostring(amt[2]) .. ' ' .. localize('k_mult')
        amt = amt[2]
        colour = G.C.MULT
        config.type = 'fade'
        config.scale = 0.7
pastel kernel
#

so it's eeemult_message?

faint yacht
#

The sound is.

pastel kernel
#

ok so it just randomly works now

#

removed hypermult_message

round lion
#

why can vanilla cards move their multipliers straight into the config table without worry, but modded ones have to use extra as a table

white hull
round lion
#

can i just throw a entire table that belongs to a card into set ability and make a carbon copy?

normal crest
#

you can use the copy_card function for copying

storm kraken
#

Why
(only happens when adding and removing cards on the winning hand)

daring fern
frosty rampart
#

also, don't use create_playing_card, use SMODS.add_card
there's a lot of extra work you have to do that SMODS.add_card will handle for you
in fact it'll automate some of the stuff you're currently doing manually
SMODS.add_card { set = "Playing Card", suit = "Clubs", area = G.hand } is all you have to do to create a random Clubs card and put it in your hand

storm kraken
#

actual help yay!!!!

#

thank you guys!!!

wintry solar
# round lion why can vanilla cards move their multipliers straight into the config table with...

You can put your own stuff directly in the config table, but it might get picked up by some of the automatic handling of stuff that vanilla uses, and there are some weird remnants with things not resetting or loading properly when you change/copy the card iirc. The entire extra table was always given the correct behaviour, AND allows you to control exactly how you want the card to calculate, so that’s always been the recommended place to store your values

torpid flicker
#

made this to make it easier to make new boosterpacks in a semi vanilla style. its intresting to see how the location of the text differs between versions as these are made from the vanilla bufoon packs.

formal osprey
#

Why are my jokers showing up with the wrong texture

formal osprey
#

Used jokerforge

limber aspen
#

How do I spawn joker with custom name? (For example spawn photograph with name "Joker")

limber aspen
#

Thanks

slim ferry
white hull
#

cuz vanilla remade mr. bones uses it

red flower
#

oh i should change that

white hull
#

:0

#

i have been bamboozled

red flower
#

i mean start_dissolve works too

#

it's just that it's recommended to use destroy_cards

#

because it handles more logic

#

anyway for the case somethingcom was saying it's important to use destroy cards to destroy playing cards during scoring

slim ferry
#

where does SMODS relocate observatory behaviour to? its not in the normal vanilla place of Card:calculate_joker, but there also isnt any take_ownership done for Observatory either

warped ocean
#

wicked ty, sry for not explaining correctly

lucid trench
#
-- 3. Logica di valutazione della mano (fuori dalla definizione)
local evaluate_poker_hand_ref = evaluate_poker_hand
function evaluate_poker_hand(cards)
    -- Controlla se possiedi il joker (usa il prefisso corretto se necessario)
    local has_trinity = next(SMODS.find_card("j_trinity"))
    
    if has_trinity then
        local original_ids = {}
        for i, card in ipairs(cards) do
            original_ids[card] = card.base.id
            -- Se è J, Q o K, trattalo come un 11 (Jack)
            if card:is_face() then
                card.base.id = 11
            end
        end

        local ret = evaluate_poker_hand_ref(cards)

        -- Ripristina i valori originali per non rompere Baron/Shoot the Moon
        for i, card in ipairs(cards) do
            card.base.id = original_ids[card]
        end

        return ret
    else
        return evaluate_poker_hand_ref(cards)
    end
end
#

Yo guys, i'm trying to make a "Joker Fluid" card like, what's wrong?

#

At first i tought about making every face card the same ID, but that would prevent the cards from activating upon jokers that work with specific faces, so i changed it to only when played hand

daring fern
tidal hemlock
#

why does only orange deck break and nothing else

#

ok it might have to do with the card trying to reference a variable when it physically cannot

#

ok that's what was happening lol

junior tapir
slim ferry
#

it doesnt work for jokers, T:key is for tooltips on hover which you can only do with decks

#

for tooltips with jokers (and other objects) see how info_queue is used in vanillaremade

junior tapir
#

well some jokers too achieve tooltips, like diet cola, I thought surely they work the same

red flower
#

because they're not on hovering the word like decks

junior tapir
#

@red flower has anyone told you you are the goat

wintry solar
#

Maybe I should put galdurs infoqueue adaptation for those into smods

tepid egret
#

hey guys, i just ran into an issue in my mod that hasn't been there in the past.
My mod uses function SMODS.debuff_card(card, debuff, source) in src/utils.lua line 417 to debuff jokers, which works fine while in a blind, but I also want to have some jokers debuffed in the main menu (in the collection or when the card burns). If you call it however, it will eventually run into G.GAME.blind:debuff_card(card) which crashes because blind is nil in the main menu.
is there a workaround for this? I mean i could just call card:set_debuff(true) but then it could fuck with the blind specific logic.

#

main reason im reporting this is because i dont think debuffing a card while not being in a game is that unreasonable, so it could be good to have a nil check or whatever in steamodded

daring fern
tepid egret
#

Ok i guess ill use the workaround then, thx for replying

long sun
lucid trench
dapper sun
#

how would i change the order that the cardareas are scored?

daring fern
dapper sun
#

ty

tidal hemlock
#

i am having so many problems

glossy stone
#

time to come back to moddin gafter like a ear of inactivity

#

wooooooooooooo babyyyyyyyy

granite raptor
#

can the message_card value of a calculate function's return table be an array of multiple cards to display the message on each one in the array?

wild patrol
#

what is the debuff ability under

#

is it considered a edition?

harsh belfry
#

its just a card property

#

card.debuff

wild patrol
#

ok thanks

red flower
#

you have to use extra to return multiple messages or use SMODS.calculate_effect

wild patrol
#
SMODS.Edition {
    key = 'bootleg',
    shader = 'holo',
    prefix_config = {
        -- This allows using the vanilla shader
        -- Not needed when using your own
        shader = false
    },
    config = {
        extra = {
            odds = 4
        }
    },
    in_shop = true,
    apply_to_float = false,
    sound = { sound = "ttv_fart_sound1", per = 1.2, vol = 0.4 },
    disable_shadow = false,
    disable_base_shader = false,
    loc_txt = {
        name = 'Bootleg',
        label = 'Bootleg',
        text = {
            [1] = '{C:green}1 in 2{} chance to fail'
        }
    },
    unlocked = true,
    discovered = true,
    no_collection = false,
    get_weight = function(self)
        return G.GAME.edition_rate * self.weight
    end,
    

    loc_vars = function(self, info_queue, card)        
        local new_numerator, new_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'e_ttv_bootleg') 
        return {vars = {new_numerator, new_denominator}}
    end,

    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.hand then
            return card.debuff
        end
    end
}```
#

trying to give the bootleg edition the chance to debuff

#

doesn't seem to crash so I can't really figure out where to look at

granite raptor
daring fern
red flower
red flower
wild patrol
#

if context.cardarea == G.play and context.main_scoring

#

so this right here

harsh belfry
#

card.debuff is the actual debuff property

#

but obviously returning it doesn't do anything

red flower
harsh belfry
#

read the message

#

lmfao

#

i did not add new information

red flower
#

they did what? I asked for the exact effect. What does chance to debuff mean? When? Why do they want to debuff?

harsh belfry
red flower
#

ok then i wont help

wild patrol
#

weirdchamp i just asked a question I didn't expect mom and dad to argue over dinner

red flower
#

i already had them ignored anyway idk why i clicked on show

wild patrol
#

no trying to be mean but that is just pointless arguing

#

i'm gonna try giving the context change an try

#

see if that works

harsh belfry
wild patrol
#

local new_numerator, new_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'e_ttv_bootleg')

#

curious if it's related to this

#

with e_ttv_booleg being defined

#

since it's not a card but a edition being called lol

red flower
#

what do you mean

harsh belfry
#
SMODS.Edition {
    key = 'bootleg',
    shader = 'holo',
    prefix_config = {
        -- This allows using the vanilla shader
        -- Not needed when using your own
        shader = false
    },
    config = {
        extra = {
            odds = 4
        }
    },
    in_shop = true,
    apply_to_float = false,
    sound = { sound = "ttv_fart_sound1", per = 1.2, vol = 0.4 },
    disable_shadow = false,
    disable_base_shader = false,
    loc_txt = {
        name = 'Bootleg',
        label = 'Bootleg',
        text = {
            [1] = '{C:green}#1# in #2#{} chance to fail'
        }
    },
    unlocked = true,
    discovered = true,
    no_collection = false,
    get_weight = function(self)
        return G.GAME.edition_rate * self.weight
    end,
    

    loc_vars = function(self, info_queue, card)        
        local new_numerator, new_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'e_ttv_bootleg') 
        return {vars = {new_numerator, new_denominator}}
    end,

    calculate = function(self, card, context)
        if context.cardarea == G.play and context.main_scoring
            if SMODS.pseudorandom_probability(self, 'e_ttv_bootleg', 1, card.ability.extra.odds) then
                card:set_debuff(true)
            else
                card:set_debuff(false)
            end
        end
    end
}
red flower
#

the problem with the code you showed is that it doesn't make sense

harsh belfry
#

this is almost there

#

but i'm fairly sure that it needs a different context

#

since i THINK editions run after

#

would have to double check

wild patrol
#

i'll slap it in see what it does

frosty rampart
#

i don't have much context but main_scoring only works with playing cards, and is correct for editions on playing cards
if bootleg is intended to appear on jokers, you'll also need the same behavior in context.pre_joker

harsh belfry
#

also self should be card

wild patrol
#

after main_scoring lol

harsh belfry
wild patrol
#

most my lua knowledge comes from like 2009 gmod

#

so very rusty on this shit