#💻・modding-dev

1 messages · Page 272 of 1

open aspen
#

and if u put the right key right place thats all you need (and loc_vars for the variable stuff)

primal robin
#

settings localization moment

red flower
#

my loc file is too big

primal robin
#

Oh god

#

It is massive indeed

red flower
#

soon it will surpass vanilla :))

primal robin
#

If only I was able to art water

red flower
#

my mod uses official yugioh art so that allows me to do 500 jokers an update

open aspen
#

is this the correct way to do an effect on cards held in hand at the end of a round?

#

cause its not working

primal robin
#

I never did jokers btw

open aspen
#

is end of round not the literally round end screen?

primal robin
#

End of round it's when rental stickers trigger for example

open aspen
#

so context.end_of_round instead of after if i drop in would work?

red flower
open aspen
#

with the g.hand check?

#

wtf is wrong with githu

#

idk if u can even make out the text

#

this still dont work 😭

hardy viper
#

do some print debugging

red flower
#

there's no context.scoring_hand in end_of_round

#

also you don't need the loop because it runs for each card

red flower
open aspen
#

no

#

its a sticker

red flower
#

because playing cards have another context for end of round i think

open aspen
#

oh my god

open aspen
red flower
#

context.playing_card_end_of_round

thin anchor
#

how do you make shaders

stark geode
#

i love trying to read the balatro sorce code to figure out how to do somthing

red flower
#

me but unironically

open aspen
tall wharf
stark geode
tall wharf
#

how does this look chat

stark geode
vast lily
#

literally just got done playing letter deck for the first time

thin anchor
#

thats really awesome though
youre so smart!!!

vast lily
#

this

stark geode
stark geode
red flower
uncut grail
#

just use debug plus for this

red flower
uncut grail
#

oh, didn't catch up to that

red flower
#

G.title_top is the title screen

hushed field
#

damn, apparently the movie database I'm pulling info from attracts a very specific crowd, because the actors that don't meet my popularity threshold to get selected as metadata is surprising

#

Helen Mirren didn't even get read in

narrow iron
#

for some reason this consumable never stops adding money after i press use

hushed field
narrow iron
#

oh

#

thanks

modern kindle
#

since i saw talk of the title screen, do we know of a way to replace the title screen music

stark geode
hushed field
red flower
modern kindle
stark geode
red flower
stark geode
#

what does that mean

open aspen
stark geode
#

very nice

#

i should prob learn all the quriks of lua

sturdy compass
#

Hooking is very nice and I need to do it more (instead of patching 😭)

thin anchor
#

just got a new monitor 🗣️

uncut grail
#

wait

#

guys i added a sound in assets/sounds/petrify.wav and it can't find it

sturdy compass
#

did you create an SMODS.Sound?

uncut grail
#

yup

#

is it normal that it is referring not to my directory layout?

#

wait

sturdy compass
#

⚙️

uncut grail
#

why does it say ogg

faint yacht
#

modprefix_key

tall wharf
#

her astra

sturdy compass
#

hi aiko

tall wharf
#

did i cook

sturdy compass
#

But yeah show where you're actually playing the sound

faint yacht
#

.ogg is preferred for sounds and what not for excellent quality/space ratio, fwiw.

sturdy compass
thin anchor
#

horror

tall wharf
rain slate
#

what's the context for when a Joker gets destroyed (e.g. by madness joker or ceremonial dagger)?

uncut grail
rain slate
#

I'll just hook into somewhere

sturdy compass
uncut grail
rain slate
uncut grail
rain slate
#

I'm just gonna find a method that gets called and then SMODS.calculate_context

sturdy compass
uncut grail
#

thank you!

sturdy compass
#

Like ali said lol

uncut grail
#

i just didn't get what they meant

#

my bad, sorry

faint yacht
#

Should've been more clear about that. 😅

sturdy compass
thin anchor
#

can i see an enhancement made by one of you guys? i would like an example

rain slate
zealous glen
modern kindle
uncut grail
#

damn why is there NO SOUND

#

sound design for nothing

sturdy compass
rain slate
#

im just gonna hook into Card:remove

rain slate
#

and make a custom context

modern kindle
uncut grail
zealous glen
#

for now

#

I have Stheno

uncut grail
modern kindle
#

Oops! All Medusa!

rain slate
#

😭

uncut grail
zealous glen
#

I did have the Curse of the Gorgon a long time ago

uncut grail
#

my medusa is at least cool

#

im still proud of my child

modern kindle
#

i have a hand that is specificlaly made from stone cards so thats why medusa exists for me

rain slate
modern kindle
uncut grail
#

help

modern kindle
uncut grail
#

my medusa is so overpowered with vampire

#

if the hand is all stone cards

modern kindle
#

ive tried to keep things relatively balanced
stoner and like 7 other hands are all secret hands

sturdy compass
subtle mason
#

Is it possible to edit another mods code with a toml and if yes then how?

uncut grail
modern kindle
sturdy compass
red flower
#

it was easy 🙂

modern kindle
uncut grail
#

If played hand is 5 Big Booms, add 5 random big booms to the deck.

thin anchor
#

can someone send an example of an enhancement?

rain slate
#

ok I have this now ```lua
local _remove = Card.remove

function Card:remove()
SMODS.calculate_context({
destroyed = true,
card_area = self.area,
other_card = self,
})

_remove(self)

end

zealous glen
zealous glen
uncut grail
#

i have three scaling jokers and have no idea what to do with them

zealous glen
subtle mason
#

In need to edit another mods lua code with a toml so I can make it compatible with another mod I don't know if it's possible to do that.

modern kindle
subtle mason
#

Any help?

uncut grail
zealous glen
sturdy compass
#

It is

modern kindle
uncut grail
#

i wish i knew how to sprite

#

and make cool stuff like this

#

who made this

modern kindle
#

a friend of mine has made all my art

uncut grail
#

who do i respect forever

rain slate
#

ok this will be wack but hear me out

G.CONTROLLER.locks.selling_card

sturdy compass
#

Here's a less niche one. Very happy with how I got this one to work

modern kindle
#

all i had to do is bribe her with mcdonalds

uncut grail
zealous glen
zealous glen
#

could just have the second part

modern kindle
#

you can also tell which cards arent quite done yet lmao

sturdy compass
zealous glen
uncut grail
#

super placehold

zealous glen
#

is that another red hand

zealous glen
#

so it's not included

sturdy compass
#

Oh wait I understand the question now

#

Yea you are correct

modern kindle
uncut grail
#

7 fingers 🔥

#

is it rare

uncut grail
#

rename 7 fingers to stub my toes

modern kindle
#

both 6 and 7 are rare, and 7 doesnt show up in shop unless you own 6

modern kindle
# zealous glen bottom left

oh thats called sold soul, saves you if you would lose the run but destroys all jokers and spawns 2 rares in their stead

pulsar flower
sturdy compass
#

Yep

uncut grail
#

marble joker + stone joker + rock slide

#

= peak

zealous glen
sturdy compass
#

Stone builds will always be niche but this makes them more doable

long sun
#

hiyaaaaaaa what did i do wronggggggg :>

zealous glen
#

not the most recent 0.9.8 version but still

#

@modern kindle

modern kindle
sturdy compass
uncut grail
long sun
#

the joker returns a message as expected, but no cards get destroyed or added

#

i'm guessing context.other_card doesn't exist? no idea why that'd be

uncut grail
modern kindle
#

eventually, descs are the last thing to change

#

making the rest of the mod takes precedence

uncut grail
#

no yeah im jujst kidding around

#

really cool idea

modern kindle
#

i ahve no idea how close i am to done

#

there is always more to add...

uncut grail
#

add spectrals

#

🔥

modern kindle
#

i dont even know what other spectrals would matter to add

zealous glen
#

not destroying

long sun
#

ah -w- thanks

zealous glen
long sun
#

ah weird, but it works in this Joker

uncut grail
#

pick a random word

#

shovel or the morgue

#

pick something

zealous glen
#

or

rain slate
#

or

modern kindle
uncut grail
#

im going to cry

uncut grail
#

ok then. i see how it is

sturdy compass
long sun
zealous glen
uncut grail
#
local a = {'the morgue', 'shovel'}
print(pseudorandom_element(a, pseudoseed('or')))
#

please execute this.

long sun
uncut grail
#

somebody write out the output

long sun
#

nil

#

:}}}}}} /j/j/j

uncut grail
#

crying

rain slate
uncut grail
#

nothing ever happens

#

bye chat.... i'm leaving

#

good luck to everybody

zealous glen
#

I'm gonna flip a coin

zealous glen
#

heads shovel tails morgue

rain slate
uncut grail
zealous glen
hushed field
uncut grail
#

cara. oh well

#

i guess

#

thats nothing

zealous glen
#

exactly

rain slate
uncut grail
#

yup

rain slate
zealous glen
#

dude

lyric blade
#

How do I force stickers on Jokers? (For example give eternal to popcorn), is there a way to do so?

zealous glen
#

apply or set I think

long sun
#

ah lemme try something

lyric blade
#

When I apply it doesn't apply if it normaly can't have it

#

They get eternal except some like Popcorn, Bean, Ice Cream etc

zealous glen
#

sounds incorrect

modern kindle
#

i mean they likely dont have eternal compat to start since they destroy themselves

lyric blade
zealous glen
#

applying the sticker doesn't check if it can apply

#

it just applies

long sun
#

perfecto ✨ got it working

zealous glen
#

although I see that adding the sticker does check

#

are you applying or adding

lyric blade
#

Oh ok nevermind

#

I set not apply I see

rain slate
#

here's the definition for that function ```lua
function Card:add_sticker(sticker, bypass_check)
local sticker = SMODS.Stickers[sticker]
if bypass_check or (sticker and sticker.should_apply and type(sticker.should_apply) == 'function' and sticker:should_apply(self, self.config.center, self.area, true)) then
sticker:apply(self, true)
end
end

bold sleet
#

Help, my balatro has started to halucinate tables and shit.

thin anchor
#

what is the name of the playing cards file?

rain slate
#

it's in SMODS utils.lua file

lyric blade
#

I understand

rain slate
lyric blade
#

Thanks I really appreciate it

thin anchor
#

got the visual done

minor furnace
#

That seems very strong lol

thin anchor
#

yeah i know, its temporary

#

lol

#

just a placeholder to see if it worked

open aspen
thin anchor
#

uhhhhhhh

#

what is this supposed to mean

wooden nexus
#

Dumb question: if i wanted my mod to load after EVERY other mod, do i need to do something specific?

minor furnace
#

It’s just card.ability.mult

thin anchor
#

oop

wooden nexus
minor furnace
#

Surely there is a max int size

red flower
wooden nexus
#

ok

#

I was just curious is all

minor furnace
red flower
wooden nexus
#

One more question: is there a way for me to do branching ranks with Strength?

minor furnace
#

That makes sense

red flower
wooden nexus
#

Like I want one to have the default 2-10JQKA, but a different one be a different set of faces for example

minor furnace
#

I still do not understand

weak brook
#

@frosty dock hey quick question about quantum enhancements, I got a joker rn that applies quantum enhancements and it works nicely but i wanna make sure those quantum enhancements go away when the card is removed, is there a way to do that outside of calculate?

red flower
#

oh that's a question for aure lol

tepid crow
#

SMODS.Rank supports branching "next ranks" if that's what you mean?

weak brook
#

wanna put it in remove_from_deck

wooden nexus
minor furnace
#

What on earth is a quantum enhancement

red flower
#

multiple enhancements on a single card basically

minor furnace
#

Ah

wooden nexus
#

Estate Playing Cards: Instead of 10JQKA it's 10, Man, Woman, Ace

tired skiff
#

im watching a tutorial on how to make mods for balatro and there is a thing where the guy makes a folder called main.lua and its type is lua source file and i think i installed lua correctly but i cant make a lua source file (i am a stupid person so maybe i did a stupid)

red flower
wooden nexus
minor furnace
wooden nexus
#

Because it's new ranks

minor furnace
#

Oh

#

O

red flower
tired skiff
wooden nexus
#

Plus I got other stuff like 11s, Mahjong cards where I need to loop back to 1 with strength, etc

red flower
tired skiff
#

i turned it on but still no cigar

minor furnace
tired skiff
#

wait i did somthing

#

is this the thing

#

the holy lua file?

#

do i need to install lua code studio?

minor furnace
#

Any text editor works

#

Vscode is pretty good

tired skiff
#

ok

#

thank you guys for the help im sure ill be back here again

#

i got told that i can get into a course early to leave school but i needed like 5 thigns for a portfolio and i though that making balatro mode would be good enough since a friend got in with a peglin mod in his portfolio

long sun
#

hiya!! sometimes, my Yoyle Deck spawns Jokers with editions — how can i prevent this?

tired skiff
#

just gonna make sure this is all correct?

sturdy compass
open aspen
#

is there a way to define what stickers my sticker is compatible with?

#

also, what pool is for playing cards?

#

is it default?

chrome widget
#

Hmm I need to hide the use button of a consumable

#

As well as the Buy and Use button in the shop

red flower
heady siren
#

How would I go about making a certain joker appear in the shop more often, just manually shoving it into the shop like a tag joker?

red flower
#

yes, I don't think there's another way other than giving it a custom rarity

#

(i just implemented a whole weighted rarity system to do just that lol)

heady siren
#

I wanna make a deck that makes my own jokers appear in the shop more often, as well as starting you with a rare joker from my mod

red flower
#

the second one you can do with objecttypes

#

the first you can also do it with object types but you will need to modify the shop functions

heady siren
#

I can also just make a table and pick a random rare joker and use SMODS.add_card

red flower
chrome widget
#

Also, the SMODS docs haven't been updated to reflect blinds having calculate support now. Can you also give a config table for blinds, and does it similarly apply it to the blind as part of the ability table?

sturdy compass
#

Does anyone happen to know if the SMODS universal card highlight limit was implemented? Asking so I can move some stuff over to using that for compat reasons

frosty dock
frosty dock
weak brook
#

thats true, right?

sturdy compass
#

Gotcha. I just remember a few contributers talking about doing it within a week and ig they never got to it lol

sturdy compass
frosty dock
weak brook
#

gotcha

frosty dock
#

however maybe there should be an additional cache clear when a card gets removed, that isn't actually present

#

which I guess is fine under the premise of cards not being removed mid-scoring, but it's still safer to have

quartz ravine
#

hey dudes, is there a context window for 'card selected' ? I want to do something when the user changes the number of cards they have selected for their hand

stark geode
red flower
#

what area did you give it

chrome widget
#

Huh, for some reason this error log is telling me that my blind is still listed as "true" instead of a number based on how many times it's been used when it tries to check it

sturdy compass
#

Ok I wanna try to fix this very long-standing issue by the time I'm ready to release 1.0.0 of Maximus, but no clue where to start. Zombie and Bootleg both have blueprint-like functionality whereby they copy the abilities of other cards, but they are not position dependent. My current solution is by storing a card table in a global variable (because all Bootlegs/Zombies should always be copying the same card), but I've been told that stored tables get deleted on game restart. I've thought about storing joker keys instead but that would lead to some issues because ideally they'd be targeting the exact card, not potentially a card of the same type. Any ideas on how to tackle this?

junior lily
#

new to modding, but i know lua, can anyone explain how make a deck with a custom back and effect?

heady siren
#

How would I detect that the shop has been entered to shove a joker into it like a tag but from a deck back?

twilit cargo
sturdy compass
sturdy compass
twilit cargo
#

fair

rugged pier
#
calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and not context.blueprint then
            local upgraded_elend = 0
            for k, v in ipairs(context.scoring_hand) do
                if v:is_face() then 
                    if pseudorandom('elend') < G.GAME.probabilities.normal/card.ability.extra.odds then
                        upgraded_elend = upgraded_elend + 1
                    end
                end
                if upgraded_elend > 0 then
                    card.ability.extra.mult = card.ability.extra.mult + (card.ability.extra.mult_mod * upgraded_elend)
                    return {
                        message = 'Upgraded!',
                        color = G.C.MULT
                    }
                end
            end
        end
        if context.joker_main and card.ability.extra.mult > 0 then
            return {
                mult = card.ability.extra.mult
            }
        end
    end

I am trying to upgrade a joker based on some probabilities to gain mult. Currently the upgrade message shows on the card, I want it to show on the joker. What should I change?

twilit cargo
quartz ravine
#

damn you letter m

heady siren
sturdy compass
#

Exactly

heady siren
#

It saves the parameters of the card, but doesn't actually point to the card in your deck / jokers

junior lily
twilit cargo
stark geode
# red flower what area did you give it
local game_main_menu_ref = Game.main_menu
function Game:main_menu(change_context)
    local ret = game_main_menu_ref(self, change_context)
    SMODS.add_card({key='j_perkeo', edition='e_negative',area = G.title_top })
    return ret
end
#

title top

heady siren
#

lua only works as well as you can type things correctly

quartz ravine
twilit cargo
sturdy compass
#

That's exactly what I said I'm trying to avoid doing lol

stark geode
twilit cargo
#

oh 💀

stark geode
#

that stole its code from cryptid

twilit cargo
#

reading comprehension is lacking my bad 💀

quartz ravine
red flower
#

m

twilit cargo
# quartz ravine

i did this too much I just started restarting the game manually

sturdy compass
#

While I'd love to just store keys, it could do some weird stuff if more than one card of the same type are being held

heady siren
# stark geode that stole its code from cryptid

30% of mod coding is stealing code from people who you directly ask for help, 50% of mod coding is stealing code from source code or other mods, 20% of mod coding is actually writing code

stark geode
red flower
stark geode
#

well i

heady siren
twilit cargo
stark geode
junior lily
quartz ravine
heady siren
#

Am I the only person that actually goes to the lua website?

twilit cargo
heady siren
#

-# Oh god

twilit cargo
#

works 2% of the time

last sentinel
#

Does SMODS.has_enhancement(context.other_card, nil) work or is there a better method for finding cards with no enhancement

stark geode
#

why so small 😭

twilit cargo
rugged pier
heady siren
quartz ravine
sturdy compass
heady siren
junior lily
#

is that what youre looking for

stark geode
junior lily
#

(just clarifying so i can watch the chat more intensely)

stark geode
#

looks like i need to scale the soul value too lol

twilit cargo
#

with the message

rugged pier
twilit cargo
red flower
rugged pier
twilit cargo
#

ahhh

heady siren
stark geode
heady siren
#

I wanna make my own jokers appear in the shop more often if you're using my custom deck specifically for testing out my jokers

sturdy compass
red flower
#

then on load you get the card again

heady siren
#

And you keep track of where it is on your joker that needs to reference it, and then just set the reference to G.jokers.cards[i] on load

#

And replace card == v with whateveryourreferencevariableisidk == v

sturdy compass
#

My concern with keeping it on the joker is if there are multiple of them

heady siren
#

You could make it a table that stores all the indexes, and then just iterate through that table on load

red flower
#

surely this won't break anything

heady siren
#

Wuh oh

twilit cargo
hushed field
#

N why does my smods say 'distributing nuclear launch codes' all of a sudden?

red flower
#

🙂

twilit cargo
#

i LOVE debugging!!!!!!!!

#

I LOVE DEBUGGING!!!!!!!!

red flower
heady siren
#

Why did a physical card just appear on my table you made the add_card function too functional

twilit cargo
hushed field
red flower
#

consumeable

heady siren
twilit cargo
twilit cargo
#

was doing web dev

red flower
heady siren
#

Every reference of color I've seen is spelled "colour"

twilit cargo
#

the CORRECT spelling

#

i did spend ages using color instead of colour at the start of modding tho cuz i assumed it wouldn't be spelt with a u

heady siren
red flower
#

there is

#

is not documented

heady siren
#

Oh

#

I can probably just use that then

hushed field
sturdy compass
# red flower only on save

Ok I have a process in mind as to how I want to handle this now. I'd assume I'd need to hook into the save function? If so, what exactly is that function so I can find it?

red flower
#

Card:save()

sturdy compass
#

I'm gonna be handling this outside of a card scope

red flower
sturdy compass
#

Gotcha, thanks

normal crest
#

Yw

red flower
#

i hope no one develops with my mod in their folder lol

limber warren
#

lol, any ideas for how to fix this?

#

i think its only for the collection but still

#

:/

long sun
#

is there a way of setting a card as polychrome without playing the sound?

limber warren
#
Card:set_edition(edition, immediate, silent)

edition, nil removes edition, key of edition as a string
immediate, boolean
silent, boolean Use this function to set the edition of a card

try either the immediate or silent flags

long sun
#

awesome, thanks :D

quartz ravine
#

This should be reproccing cards of a certain hand type. Anyone see whats wrong? They are not retriggering

 if context.poker_hands ~= nil and context.cardarea == G.play and next(context.poker_hands["Fox_cosmocanyon"]) and context.repetition then
            return {
                message = "Awooo",
                repetitions = card.ability.extra,
                card = card
            }
        end
vestal mist
long sun
limber warren
long sun
#

i changed my set_edition code to context.full_hand[1]:set_edition({edition='e_polychrome', immediate=true, silent=true})

limber warren
#

im not too worried about it though lol, but if i can fix it that's be nice

long sun
#

do i need to add SMODS. to the start?

vestal mist
red flower
limber warren
#

yeah. the config for handy tag doesnt have anything that i can easily patch. i wonder if takeover works with tags

#

i havent used it yet

heady siren
#

What do I put instead of back.ability.extra? I tried back.config.extra and it still just dies

long sun
#

change ability to config

red flower
limber warren
#

oh

heady siren
#

That is the second part of my message

long sun
#

ah -w- missed that

limber warren
#

let me do some research on that, thanks bro

long sun
#

what's line 1824?

heady siren
#

That line with the add_card

red flower
thin anchor
#

is this correct?

heady siren
long sun
#

ah no wait

#

found it

heady siren
#

I accidentally used config for the second one, but that's not really relevant, it still dies on back.ability

long sun
#

use self instead of back

#

keep config

quartz ravine
#

what is that line trying to do ..back.ability.extra.etc....

long sun
heady siren
limber warren
limber warren
#

let me see what the wiki says about info queues, just heard about them a minute ago

#

ok

heady siren
red flower
quartz ravine
long sun
#

mm?

sturdy compass
# red flower maybe store the card and store the index on save?

Ok this method ALMOST works. The only weirdness that I've come across is if the Zombie/Blueprint is before the copied card in the joker order. My guess is because those later cards are not yet loaded in when the Zombie/Blueprint loads in. Any ways around that?

long sun
#

full code looks like this now

heady siren
#

Custom VS Code colors woah

sturdy compass
#

f a n c y

thin anchor
#

how would i do some sort of chance thing?

modern kindle
red flower
long sun
#

thanks ^^" didn't expect to receive compliments for my VS Code theme

#

it came with VS Code :} i think it's called Atom, or Acid, or something starting with A

limber warren
#

i wish there were more resources on info queues in the wiki

red flower
long sun
#

ah

long sun
#

i got a different error when i tried without the curlies, lemme grab that in case it's unrelated

#

on startup

red flower
#

thats a syntax error

long sun
#

i thought it meant i needed to pass it in as a table, but i'm not sure what it's expecting

red flower
#

if you're doing edition='e_polychrome' then don't

#

it's just 'e_polychrome'

long sun
#

right

#

so remove the labels, then?

red flower
#

yes

long sun
#

sadly that makes things much harder to read but that's okay if it works 😭

#

Lua is truly a terrible language 😭😭😭

#

thanks :>

limber warren
#
function Tag:get_uibox_table(tag_sprite)
    tag_sprite = tag_sprite or self.tag_sprite
    local name_to_check, loc_vars = self.name, {}
    ...
    elseif name_to_check == 'Handy Tag' then loc_vars = {self.config.dollars_per_hand, self.config.dollars_per_hand*(G.GAME.hands_played or 0)}
#

i think this is my culprit

red flower
#

well that's why smods makes everything tables but thats a vanilla function

long sun
#

ahhhh gotcha

limber warren
#

does anyone know how to override / edit vanilla functions?

long sun
red flower
#

did vars not work?

limber warren
#

no

long sun
#

perfect! as a bonus, the code works :D

heady siren
heady siren
limber warren
#

now how does one patch

#

every new joker i add in brings interesting consequences

red flower
red flower
limber warren
#

'ppreciate it

heady siren
midnight coyote
#

how do i make a joker negative?

red flower
long sun
#

your_card:set_edition{negative = true}

midnight coyote
wintry solar
#

dont do that

buoyant merlin
#

Is there a variable for a joker's rarity in the deck?

long sun
#

npnp

wintry solar
#

your_card:set_edition('e_negative')

long sun
#

1-4 is Common-Legendary

heady siren
midnight coyote
#

how do i find the total amount of jokers

#

g.jokers.cards?

long sun
#

#G.jokers.cards

#

# means the count

midnight coyote
#

yeah

#

ik that i was just wanting the object

red flower
buoyant merlin
long sun
#

what's your Joker's ability?

buoyant merlin
#

Supposed to give 1X Mult per Rare Joker you have

long sun
#

ah gotcha

midnight coyote
#

just do a for loop

long sun
#

ya so you'd write a function that loops over everything in G.jokers.cards

midnight coyote
#

and check if the joker in G.jokers.cards

long sun
#

and for each, check if its rarity = 3

midnight coyote
#

has a rarity of 3

#

and then add it into a table of rare jokers

#

then just go down the table and add mult for each one

long sun
#

ah i'd just increment a value, and return that

buoyant merlin
midnight coyote
long sun
#

their ability only needs how many

midnight coyote
#

r

buoyant merlin
#

That's the problem

midnight coyote
#

better for this situation

heady siren
#

Does pseudorandom not work in the back:apply() function?

buoyant merlin
#

This is rarity being printed

sturdy compass
long sun
#

ya but can i see your code?

buoyant merlin
long sun
#

grand

#

sorry, got impatient

thin anchor
#

how would i make a random chance of things happening?

sturdy compass
long sun
#

try printing joker == nil

#

ah ya :P sorry

midnight coyote
#

alright

buoyant merlin
midnight coyote
#

got my code workiong nicely

#

now im gonna go ahead and make it look nicer

red flower
buoyant merlin
bronze ocean
#

JOB IS DONE

sturdy compass
bronze ocean
#

I CAN NOW REST FROM BEING A DEVELOPER BY MAKING A MOD

red flower
heady siren
sturdy compass
#

That's not the issue, the issue is that with the start_run hook I made, continued runs aren't continued

red flower
#

none of them?

#

oh you're missing self

sturdy compass
#

it takes a self?

red flower
#

yes it's Game:start_run

#

so it should be Game.start_run(self,args)

haughty snow
#

Hey why does this say "nanpas" (it should just say "nanpa") (Using Steammodded)

thin anchor
#

how does pseudorandom work?

heady siren
thin anchor
#

thumbs up

midnight coyote
#

how does juice up work again

haughty snow
midnight coyote
#

i want to juice up the negative card

#

so its a visual indicator

red flower
midnight coyote
buoyant merlin
#

Should this card also restore sold cards too? (Still nets you gold from it)
Saying this here because it seems like the best spot for it

midnight coyote
#

awesome, it all works

fringe hill
#

so I've been trying to make a joker that changes Kings into Queens when played, and i've been fiddling with it for a while but it doesn't even seem to see the King when I play it? probably something silly I missed and I'm probably using the smod function here wrong but

red flower
#

context.after doesn't have other_card

fringe hill
#

oh

red flower
#

you need to do it in individual

fringe hill
#

so like

#

hold on lemme put in what i think you're saying

heady siren
#

If you want it to happen after they're played then do final_scoring_step and iterate through the G.play.cards table to find the Kings

fringe hill
#

doesn't really super matter when it happens as long as it works

heady siren
rich dragon
#

Hey guys, I'm trying to pick up coding to make my first mod. What coding software would you reccomend?

rich dragon
heady siren
#

You've got Google at your disposal

#

I just kinda messed around until I understood it

rich dragon
#

or do they not exist

heady siren
#

I literally just use the default settings

red flower
heady siren
#

I'm not even setting the value when it crashes, so it should just skip right past it

#

It should just return the original function with zero changes, but it gets confused with hand_chips

#

And I've used this exact same setup for other hooks and it works perfectly

heady siren
# red flower wdym

G.GAME.new_poker_hand is false, so it shouldn't even run the hook code, it should just run the original function

red flower
#

oh that's what i was asking

#

does it always do it or no

sturdy compass
heady siren
#

Okay, rephrase, I didn't change the variable G.GAME.new_poker_hand and it still gets confused with hand_chips

#

nil == false, so it shouldn't run the if statement

#

In my replacement function it worked just fine, so something is going wrong with the hooking functionality specifically

rich dragon
red flower
#

lua

rich dragon
#

i dont see it

#

so i just pick a random one then use lua?

red flower
#

just pick whatever there

heady siren
#

Lua is an external extension so it isn't built into VS Code by default

rich dragon
#

okay

heady siren
rich dragon
#

ah okay

zealous glen
#

Reimplementing an effect. It's still missing some safeguards and calculation integration, but so far this went faster than expected.

heady siren
red flower
#

have you tried a test print?

west mason
#

is there any way to keep track of sold jokers?

red flower
heady siren
#

Oh, I'm dumb

#

Problem solved, thank you

red flower
#

it's good that you switched to a hook tho because you were entirely deleting the smods hook of that function lol

red flower
west mason
rich dragon
#

okay do i now make a new file to start

fringe hill
#

alright well now the game crashes on playing the king because it says suit=nil and rank=Queen are invalid, am I even using the function right?

red flower
tired skiff
#

in some code is see G.
can somone explain what the g is cause im crashing and the error text says somthing like G is missing argument

red flower
buoyant merlin
#

Queen i Believe is 11

zealous glen
#

isn't G the Game object?

tired skiff
zealous glen
tired skiff
red flower
tired skiff
#

gimme a sec

zealous glen
#

the code helps too, especially with the line numbers

tired skiff
#

im getting better code ss

#

there we go

#

sorry about that

zealous glen
zealous glen
fringe hill
tired skiff
#

thank you

red flower
tired skiff
#

i goofy goober

fringe hill
#

oh yeah that'll do it

zealous glen
# tired skiff ahh fixed

also you can use the utility function SMODS.add_card instead of create_card; it creates the card and emplaces it for you

#

there's also a SMODS.create_card that just creates the card

fringe hill
tired skiff
zealous glen
tired skiff
#

could u explain a bit more im not the smartest

#

if you dont mind

thin anchor
#

god dammit the video is frozen

rich dragon
#

💀

tired skiff
#

sht school bell rang

thin anchor
zealous glen
zealous glen
thin anchor
#

lol

rich dragon
#

im learning modding, i just downloaded virtual studio code. is this where i get the lua extention?

#

if not can someone link me to it

zealous glen
#

You can find the extension inside vscode

rich dragon
zealous glen
junior lily
#

what a nice mod name, surely this wont backfire later when typing it in code

rich dragon
thin anchor
#

how would you delay code?

tired skiff
red flower
zealous glen
red flower
rich dragon
#

k

zealous glen
junior lily
tired skiff
zealous glen
#

but no, you need to write something like {key = value}

tired skiff
#

and what is the area called

zealous glen
#

G.jokers but if you tell it to create a Joker it'll automatically assume you want to put it there

tired skiff
#

ahh ok

zealous glen
#

But it doesn't automatically try to create a Joker if you tell it area = G.jokers IIRC

manic rune
#

good morning everyone

zealous glen
manic rune
#

maybeeeeeee

zealous glen
manic rune
#

god, i did x = {+-1} for my test instead when it should've been x = +-1

#

i want to die 💔

thin anchor
#

for some reason all of these cards trigger even if theyre not played
can someone help?

tired skiff
manic rune
#

im on phone rn so i cant write indented code

thin anchor
#

o

manic rune
#

im guessing card refers to the card the enhancement is on

#

im not sure tho, never made an enhancement before

thin anchor
#

oh

#

i will try it

zealous glen
gentle rain
thin anchor
#

well im not sure

#

i will see

junior lily
#
SMODS.Joker {
    key = 'bonusbonus',
    loc_txt = {
        name = 'Bonus Bonus',
        text = {
            "Creates a random consumable whenever a {X:chips}Bonus{} card is scored."
        }
    },
    config = {},
    loc_vars = function(self, info_queue, card)
        return { vars = {} }
    end,
    rarity = 2,
    atlas = 'ash',
    pos = { x = 0, y = 0 }, -- very top left
    cost = 5,

}

im at this point in making my joker but im not sure how to actually make it do stuff can someone help

manic rune
#

-# i forgot the joker name

thin anchor
manic rune
#

guess card refers to the enhancement, not the card its on then

thin anchor
#

hmmm

manic rune
#

hmm

thin anchor
#

hm

manic rune
#

can u try

#

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

thin anchor
manic rune
#

oh actually?

#

yipee

thin anchor
#

yes

junior lily
thin anchor
#

uhh how do i make my own badge colors

junior lily
open aspen
#

this prints my print but doesnt seem to swap sticker

rain slate
#

I think I figured out why my attempt at hooking Card:remove() has produced a crash

#

the start animation has the card dissolving, which means it probably calls Card:remove(), probably before everything has finished initializing...

#

and also G.hand would probably be null when not in-game anyway

open aspen
#

i mean

#

how are u hooking it

rain slate
#

which SMODS.calculate_context for some reason uses without checking if it's nil

open aspen
#

the way i did my hooks was adding an extra parameter, if true, call my version of the function

rain slate
# open aspen how are u hooking it

I'm doing it this way ```lua
local _remove = Card.remove

function Card:remove()
if self.area == G.jokers then
SMODS.calculate_context({
destroyed = true,
cardarea = G.jokers,
other_card = self
}, nil)
end

_remove(self)

end

stark geode
# stark geode

Hey does anybody know how to get the texture of the perkeo face to be scaled up as well

open aspen
#

oh u wanna hook it for any time its called huh

rain slate
#

yeah

rain slate
#

cuz I want to establish a custom context for when a card is destroyed

#

(obviously this is also called when a card is sold but that's not important right now)

open aspen
#

that must exist no?

#

well

rain slate
open aspen
#

whats the crash say?

#

nil?

rain slate
#

yes

open aspen
#

can u send error

rain slate
#

I already know where it's crashing and why

open aspen
#

check if that thing is nil then

rain slate
#

....

open aspen
#

if not nil, do ur code

rain slate
#

oh god I have to check a lot of things it seems

open aspen
#

ah yea

#

it says

#

attempt to index field deck

rain slate
#

because SMODS.calculate_context just uses everything like G.hand, G.deck, G.discard without checking them for nil

open aspen
#

oh its crashing in calculate_context

rain slate
#

yes

#

like I said originally

open aspen
#

perhaps

#

u can hook that too

rain slate
#

no I'm just gonna check them all in my hook

open aspen
#

alright that works too

#

perhaps

#

this is something u can submit a feature request or PR for?

#

cause it seems like it could be annoying in other contexts too, idk

rain slate
#

I mean joker destroyed context is already planned anyway

open aspen
#

and its an smods thing so

manic rune
# junior lily i found it but idk what to do with it

put the code in your Joker's calculate function, and the context should be smt like

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

use SMODS.has_enhancement(x,y) to check if context.other_card is a bonus card

rain slate
#

at least I think so

open aspen
rain slate
#

so that wouldn't do much

manic rune
#

im in class rn so i cant help much :(

tired skiff
#

what am i missing?

thin anchor
#

how would i go about making my own badge?

manic rune
#

check stickers

thin anchor
#

thumbhg uhp

limber warren
open aspen
#

ok it doesnt even print sus2

limber warren
#

and the tag descriptor works in the collection and everything else..

open aspen
#

why does this for loop not work to check cards in hand

limber warren
#

idk why im getting nil on handy tag

rain slate
#

I'm gonna use G.CONTROLLER.locks.selling_card to check if we're selling a card catxdd

manic rune
rain slate
#

because Card:remove() also gets called when a card is sold

open aspen
open aspen
#

uhm

#

oh ur using info_queue stuff

#

im unfamiliar

#

sorry

limber warren
#

no worries

tired skiff
#

pls help :<

rain slate
red flower
tired skiff
open aspen
#

help with what

tired skiff
#

it no work :<

thin anchor
#

how do you make a badge color?

open aspen
#

yea but like does it crash?

limber warren
rain slate
# tired skiff im stupid so can you elaborate
 G.E_MANAGER:add_event(Event {
  func = function ()
    SMODS.add_card {
        key = "j_joker",
        edition = "e_negative"
    }
                    
    return true
  end
})
``` This is what a Joker of mine does to add a card
limber warren
#

format is like this

tired skiff
open aspen
#

whats the exact error

limber warren
#

you dont use bracket, just the curlies

rain slate
open aspen
rain slate
rain slate
#

better to check

red flower
open aspen
#

surely better to not have to use it if you dont need to

limber warren
#

i thought it was strictly curly brackets

rain slate
thin anchor
red flower
#

I like ({}) more than just {}

rain slate
#

their context looks alright so I'm not sure why it'd not work

open aspen
rain slate
open aspen
#

what kind of weird syntax craziness

red flower
open aspen
#

lua moment

rain slate
#

syntax sugar :)

red flower
#

syntax salt

manic rune
#

hi N'

#

how u doin

red flower
#

hiii

#

im doing good ty and you

rain slate
#

but you have to take into account that if you have multiple arguments then you need to use ({})

open aspen
#

yea that makes sense

manic rune
#

i made so many dumb mistakes in my math test, still got 9/10 tho :3

open aspen
#

kind of how : passes self automatically

rain slate
manic rune
#

thanks yall :D

rain slate
tired skiff
#

but i feel like im doing somthing wrong

rain slate
#

what's the full code for the joker look like?

narrow iron
#

no wonder my lucky potions werent scoring

tired skiff
rain slate
limber warren
#

add another end?

#

you need an end to close the if statement at line 46

manic rune
#

guh

rain slate
#

that's so stupid

limber warren
#

im just guesstimating

rain slate
#

unless there is an error that we were not told about...

red flower
#

we need to delete whatever tutorial names card as center

manic rune
#

true....

rain slate
#

it's just

tired skiff
rain slate
#

that definitely should give a syntax error

limber warren
#

thats the one

rain slate
#

oh my lord it does

open aspen
#

is there any reason why this code runs twice? it all works well but I see tagged show up twice which again is technically fine but is still a visual bug that i dont want

rain slate
# tired skiff

it would be good information to know that there is an error that we can reference

#

I thought it was like working but the card was not being added

red flower
#

(this is in the docs)

tired skiff
manic rune
#

dont u need :emplace too

#

i forgor

rain slate
#

soryr

#

wrong reply

#

you don't need card emplace

manic rune
#

oh

rain slate
tired skiff
#

like this

rain slate
#

sure ?

#

I'd have done it after the return but that works

red flower
rain slate
#

also get a formatter extension for your code please 🙏

tired skiff
#

o shit it lauchers

tired skiff
rain slate
#

it formats your code so that it looks nice

tired skiff
#

how would one get one of those formats