#💻・modding-dev

1 messages · Page 625 of 1

slim ferry
#

context.retrigger_joker_check

#

oh lol

stoic void
#

oh wtf

slim ferry
#

fucked up brackets

#

also idk if the Tag needs an extra false, "Small" as the second and third argument

#

it might because the vanillaremade example for giving a tag does that

tired kestrel
#

How do I make a custom string for the loc that determines?

stoic void
gusty compass
tired kestrel
#

what is the equivalent to #1# but for strings?

slim ferry
#

it retriggers a lot of things though

#

that arent jokers

#

so mayb

slim ferry
gusty compass
#

It returns nil in the edition code so I'm a bit skeptical

stoic void
#

I fixed one of them

slim ferry
#

and itll use the variables passed into localize

tired kestrel
stoic void
#

Ok what do i use to fix the last one

tired kestrel
slim ferry
#

if its in a joker description

#

with SMODS.find_card

tired kestrel
slim ferry
#

what does the loc_vars code look like

obsidian spear
#

not for lily no more

#

the ui is also smol

stoic void
#

FiXED IT!

tired kestrel
obsidian spear
obsidian spear
slim ferry
#

because you dont have anything set to make it not do that

tired kestrel
#

weird.

slim ferry
#

?

stoic void
#

ok the joker functionally does nothing

slim ferry
#

how is it wierd

#

the only string you put out for the description is "Five"

tired kestrel
#

dunno just said weird that this doesn't do it ehat I exactly thought.

#

yeah

#

but at the same time is there a way a proper way to do this?

slim ferry
#

just do next(SMODS.find_card("j_four_fingers")) and "Four" or "Five" in the loc_vars return

#

instead of having strings in the config

tired kestrel
#

alright, I'll put this and replace the #1# stuff

#

wait nvm it worked

obsidian spear
tired kestrel
#

there we go.

prisma loom
#

How can I change this line to account for ANY enhancement and not just Gold?

umbral spire
red flower
#

or assert

umbral spire
umbral spire
#

like error("test")

red flower
#

yes

prisma loom
red flower
#

yeah ranks dont calculate

prisma loom
red flower
#

nothing they can't have effects in the API

prisma loom
#

hooks?

red flower
#

yeah

#

you should hook the smods enhancement functions to check for the rank

red flower
#

very

prisma loom
red flower
#

should be SMODS.get_enhancements or SMODS.has_enhancement

#

idk which one is better i dont want to look at the code

slim ferry
#

SMODS.has_enhancement uses SMODS.get_enhancements iirc

#

so probably SMODS.get_enhancements

red flower
#

yeah i dont remember which way around it is

prisma loom
#

So basically, I just have to hook this func and it's done

#

and I have no idea how to make hooks

tired kestrel
#

Anyone have any ideas to make a single box black or gray background?

#

kinda like how paya's comment except it's the text box instead without labelling it as "paya's comment"?

red flower
tired kestrel
queen crescent
#

how would i get the current ante/round

tired kestrel
#

let me look

red flower
red flower
tired kestrel
#

since box_colours is something I didn't try before

red flower
#

i think it was vars = { box_colours = { nil, nil, nil, G.C.BLACK } }

tired kestrel
#

(just wanna make sure)

red flower
#

no

#

loc_vars

desert ore
#
        if context.evaluate_poker_hand and next(evaluate_poker_hand(G.hand.cards)['Three of a Kind']) then
            if next(context.poker_hands['Pair']) and next(context.poker_hands['Flush']) and not next(context.poker_hands['Five of a Kind']) then
                return {
                    replace_scoring_name = "Flush House"
                }
            elseif next(context.poker_hands['Pair']) and not next(context.poker_hands['Four of a Kind']) then
                return {
                    replace_scoring_name = "Full House"
                }
            end
        end
    end``` 
Any quick fixes to have this kind of scenario? It plays as a pair, it's just this should be displaying as pair since I'm playing part of the held 3oak.
tired kestrel
#

I think it worked

#

Just another thought, you can customize fonts too?

#

as seen in the yahiamice video for example?

red flower
red flower
#

you would need to create an SMODS.Font and then use {f:key} in loc_txt

tired kestrel
#

I see.

desert ore
red flower
#

you need to do that yeah

#

(dont actually remove them from G.hand.cards tho make another table)

desert ore
#

ah alright thanks

#

(I hate for loops)

obsidian spear
umbral spire
#

is there a way to add another language to the language selection thingy.

prisma loom
#

Folks, let's say I want to make a new Rank and any card with that rank always has a certain quantum enhancement by default (my custom enhancement)
How would the hook for it look like?

#

That's what Im working with

#

(UPD)

cerulean rose
#

instead of hooking check enhancement directly, you should add a mod calculate with the quantum enhancement context

#

also for rank checking do card.base.value == "rank_key"

tired kestrel
#

somehow {F:key} didn't work.

#

how do you apply emojis to a font that doesn't have it?

quasi pike
#

Any idea of why does this crash the game

#

??

#

here without the pop-up

tired kestrel
#

@red flower I'm having troulbe triyng to import a custom font and I'm staritng to get crazy as I did try to load in a custom font but for some reason it doesn't load into the loc_txt or whatever?

wintry solar
#

where are you defining the font

tired kestrel
#

the fonts are located in the fonts.lua file:

#

thought of taking the approach that Aiko did

wintry solar
#

iirc you need to prefix it in your loc txt

tired kestrel
#

oh.

#

how?

wintry solar
#

{f:modprefix_CasinoKidNES}

umbral spire
#

how do i make any card that has a specific edition give an additional xmult

#

like polychrome

#

on jokers/cards

twilit tundra
#

for other modded jokers that do similar things

slim ferry
#

This is just for description but i guess so

tired kestrel
#

how do I use text color exactly?

#

But I meant like, do text colors but like how you do box colors. cause I did try it but for some reason ti defaults to the default color

wintry solar
#

your box colour is working fine there

#

the default colour is white

umbral spire
#

is there a way to change a random asset to an image.

tired kestrel
#

on each box.

crisp coral
#

why dont you C:white in your loc_txt

wintry solar
#

you can't change the default text colour, you have to do it manually like myst said

#

iirc

wild berry
#

use card.edition to check the edition

#

i think the key is inside one of its propreties

wintry solar
#

might be worth adding though

umbral spire
#

how do i change the title music

#

or replace any music basically

#

and how do i play a song on loop forever?

#

until you quit the run.

crisp coral
#

read the docs on SMODS.Sound

umbral spire
tired kestrel
#

There we go.

pale holly
#

Is there a code exmple of how to make a planet card ? I didn't see VanillaRemade to have those

red flower
#

it does

#

make sure you're not looking at an old commit, github likes doing that

pale holly
#

Oh that could explain why, thanks

short girder
#

what is the variable for the hand size

daring fern
mellow marsh
#

is there a way to know what hand is being upgraded in Scoring Parameter's level_up_hand? id be shocked if there wasnt but as far as i can tell it only receives the data for the hand to upgrade, which doesn't contain a key referring to the hand itself

frosty rampart
#

...
hand.key

red flower
#

as far as i can tell there isnt

#

lol

red flower
frosty rampart
#

ah

#

it does have a key in smods.pokerhands

red flower
#

yeah it should probably copy those to G.GAME.hands too

mellow marsh
#

yeah the SMODS.PokerHand game objects have it, but G.GAME.hands doesn't, which is what level_up_hand uses

#

would be nice if it added the keys to G.GAME.hands

#

(that or level_up_hand should receive the PokerHand object instead. not sure if that's viable)

red flower
mellow marsh
#

neat ty

tired kestrel
#

the heck happened now?

#

hold on

red flower
#

the font is cool

#

is that the same font the game uses or a generic nes one

quasi pike
#

hey, this doesn't retrigger anything, what did I do wrong?

normal crest
#

instead of using a local variable inside calculate you should store the value in the card's ability table

obsidian spear
#
    return {n = G.UIT.C, config = {align = "tm", minw=0.5, minh=0.5, colour = HEX("00000088"), padding = 0.15, r = 0.02}, nodes = {
        -- Use a Row node to arrange the contents in rows:
            {n=G.UIT.R, config={align = "cm"}, nodes={ {n = G.UIT.T, config = {align= "cm", text = time, colour = G.C.WHITE, scale = 0.75 }}, }}
    }}```

why no appear
chrome widget
#

Do jokers and consumables add mod prefixes to atlases specified on the centers?

#

I don't remember if they do by default

chrome widget
#

thank you!!!

dense fulcrum
#

how do i ban a group of boosters in a challenge

twilit tundra
# quasi pike hey, this doesn't retrigger anything, what did I do wrong?

as its a local, once it leaves the calculate function that variable ceases to exist. since it can't be both context.setting_blind and context.repetition at the same time, that means whenever it checks the id, it'd simply be nil

like said earlier, just storing it elsewhere so it still exists fixes this

dense fulcrum
twilit tundra
#

why cant you just ban all the standard packs individually there arent that many?

dense fulcrum
#

i did

chrome widget
#

I was under the impression that when using SMODS.Atlas, the item should become available in the Atlas table immediately. But for some reason, even though I'm adding the spectrals atlas, it's returning nil when I try to access it immediately afterwars?

final jewel
#

Why does the animation is wacky like that

grand violet
#

Scram

#

Oi

#

don't delete the pings

#

what're the other mods gonna do when they come in here and can't find them

prisma loom
#

Let em check this outamong_us_pat

keen gorge
#

We find eggs notes

karmic creek
#

savage

livid scroll
#

Yep

prisma loom
#

holy, the entire gang

karmic creek
#

can’t make an omelette without breaking a few eggs

livid scroll
karmic creek
#

two

#

straight to jail

grand violet
#

Where did you all come from

winter flower
#

oh that's a jumpscare 😭

prisma loom
#

Noooosad

keen gorge
#

Dunno, not like we were pinged

final jewel
#

holy whats happening

winter flower
#

half the modteam chilling in modding dev 😭

karmic creek
livid scroll
#

This is the mod channel right

winter flower
karmic creek
keen gorge
#

I at everyoned but deleted it real fast

winter flower
livid scroll
#

@ everyone

final jewel
final jewel
grand violet
livid scroll
#

Live living dangerous

keen gorge
#

@eggryone

karmic creek
#

@everyegg

livid scroll
#

Yeah we lost the privilege after the last incident....

karmic creek
#

I think we gave it up freely

livid scroll
#

@eggryegg

final jewel
karmic creek
#

Or at least I advocated to have it removed from us

livid scroll
karmic creek
#

Now it really is mod chat

livid scroll
final jewel
#

yeah but what did the mod that ping everyone says

livid scroll
#

P*** raids and other stuff

spiral mural
#

@egg hi

karmic creek
prisma loom
#

Can I use @ everyone on my birthday?

karmic creek
final jewel
grand violet
livid scroll
#

They were seeing if they could use it

karmic creek
#

@everyone

spiral mural
final jewel
karmic creek
#

Wait please tell me that didn’t work

grand violet
#

It did not

#

We GAVE IT UP

keen gorge
#

Ahahahhha

prisma loom
#

Jan 14, I'll be waitingalbino_perturbado '

karmic creek
#

That it highlighted scared me

keen gorge
#

The terror

final jewel
#

ahahahahahaha

spiral mural
final jewel
#

ahahahahah

grand violet
#

This is genuinely

#

not good for my blood pressure

#

I'm checking out

turbid maple
#

mods???in my mod channel??

livid scroll
#

Yeah that's scary

final jewel
#

oh my days

keen gorge
#

Eggs don't have blood

karmic creek
#

good bye eggbert

karmic creek
versed swan
final jewel
#

hell yeah

spiral mural
#

we should ping @everyone every day

final jewel
#

omg

prisma loom
final jewel
#

another one

karmic creek
#

we should turn it on for everyone all at once

livid scroll
#

I'm having nam flashbacks

karmic creek
#

And not tell anyone

spiral mural
#

@everyone
rarity: rare...
effect: retrigger everything

final jewel
#

third time

karmic creek
#

April fools joke: chaos and notifications

spiral mural
#

april fools joke: /ban @here

karmic creek
#

I don’t think the slash command works that way

spiral mural
#

it does

#

trust

karmic creek
#

But thanos snapping the server is really funny

spiral mural
#

only those who are offline can survive

#

or are invisible

karmic creek
#

Touch grass as a survival mechanism

spiral mural
livid scroll
#

Reminds me of the jschlatt purge

prisma loom
karmic creek
spiral mural
#

5 free retriggers

prisma loom
#

nah thats broken

#

mods pls nerf

spiral mural
#

ok rarity: common...

final jewel
#

at this point no one cares about @ everyone

karmic creek
keen gorge
#

🎄🎄🎄🎄🎄 5 tree figures

spiral mural
#

@someone
rartiy: common
effect: retrigger something

karmic creek
final jewel
#

yeah

spiral mural
#

if @everyone pings @everyone... no one will be pinged

final jewel
#

should make a @civilization that ping evryone on the planet even those whose doesnt have a pc or internet at this point you just get ping and it sound in your head

spiral mural
#

@Homo Sapiens

final jewel
#

yeah

#

no internet..... not a problem..... @humankind will help you.....

#

oh no its dead now

dense fulcrum
solid salmon
#

<@&1133519078540185692>

karmic creek
#

shame

normal crest
#

hi mods

final jewel
normal crest
#

thru its parameters

final jewel
daring fern
normal crest
quasi pike
#

this booster crashes my game ):

#

I don't know what I did wrong

daring fern
quasi pike
# daring fern Log?

I'm kinda new to modding, and on top I'm spanish, and for any reason I don't think you're refering to a tree

#

What log

#

?

#

sorry

daring fern
quasi pike
#

oh

#

ok

normal crest
#

you might want your joker to have its effect before context.before, I think there's initial_scoring_step now but I'm not sure if that'll work

normal crest
# quasi pike

i think this means the set "matronmod" doesn't exist

final jewel
quasi pike
normal crest
quasi pike
#

okay, thx

#

👍

normal crest
final jewel
#

the animation with the cunsumable works fine but now with the joker its so weird

normal crest
#

Is that with having set_ability in an event

final jewel
#

yeah but now like I said earlier the animation with the joker is ok but the effect of the upgraded enhancement isnt there

normal crest
#

Uhh, I'm not sure actually, I thought that'd work

final jewel
#

isnt a thing thats reload cards

daring fern
daring fern
quasi pike
normal crest
#

If it's your own jokers you can go to each joker and add pools = { matronmod = true }

#

To each of them

quasi pike
#

they have the pool

#

should it work?

final jewel
normal crest
quasi pike
#

oh

#

could it be a problem of the object type, is the first one I define

#

it probably is

normal crest
#

What about in the jokers themselves

quasi pike
#

they all have the pools like this

quasi pike
#

oh, to much copypaste from other mods

#

thx

#

it works!! thx

final jewel
#

And a message like 'Not allowed' when thats happend

normal crest
#

and just change it to Not allowed!

fair zephyr
#

Hi! Is there any tutorial on every component needed to create a new deck or an small example deck mod to understand how the initial setting and events work? I'm a dev, but new to lua ;-;

daring fern
urban wasp
#

this doesn't allow me to use it even when jimbo is highlighted

can_use = function(self, card)
    if #G.jokers.highlighted ~= 1 or G.jokers.highlighted[1].ability.key ~= 'j_joker' then
        return false
    end
    local joker = G.jokers.highlighted[1]
    return not joker.ability.eternal and not joker.ability.rental and not joker.ability.perishable
end,
daring fern
urban wasp
#

ah ok thank you

daring fern
#

reef belfry
#

why does this not remove the specified consumable k from the consumable pool after being used? (k is from a custom consumable set)

#

it still persists... (the only unlockable hand is Flush House)

#

i only want the consumable to be removed from the pool, not the hand

#

i have it running in a loop for every hand to planet and to its respective unlock consumable (p is for planets, which is added after unlocking and works just fine)

#

maybe theres something wrong in this?

wooden nexus
#

Okay, so I'm trying to manipulate the starting deck to have additional cards, but I don't want the cards to spawn in after i load into the game, but instead just already be in there. Is that possible?

versed swan
#

maybe a hook onto Game:start_run?

#

like doing stuff to G.deck.cards occurs after running the Game:start_run reference

#
local game_startrun_ref = Game.start_run
function Game:start_run(args)
  game_startrun_ref(self, args)
  create_playing_card(...) -- silent = true
end

Not that I've tried this, but this might be a possibility?

daring fern
#

jade socket
#

i have no experiance with lua, and baltros code would someone be willing to help explain how i could go about adding a new joker? i am doing this a weird way

jade socket
#

i spoke too soon! im trying my hardest to mod the gamepass version. i already added a custom chalange but im trying to add a joker and have no ides where to start.

ITS NOT A RULE 4 #1349064230825103441 message

red flower
#

you cant mod the gamepass version with smods

jade socket
#

dose this help?

daring fern
jade socket
red flower
jade socket
#

i have found some of the code relating to the jokers functionality

red flower
#

i mean if you want help finding code we can help but i don't think almost anyone here has made jokers without smods

#

also distributing the mod would be a pain

jade socket
crystal perch
#

i'm adding custom suits to my mod, and i want there to be a set of secret hands which all involve 5 or more suits. i'd want this to be functionally identical to paperback mod's implementation of the same system, without relying on it. but, i'd also like there to be cross compatibility and i don't want to flood planet packs and the store with effectively dupes of the same planet cards. any painless way of going about this? i was thinking of checking if the player has paperback installed, enabled, with spectrums toggled for every check on my mod's end, but that seems tedious.

jade socket
normal crest
#

the behavior of jokers are in card.lua

#

in the calculate_joker function for most of them

jade socket
#

i know but i do not know lua to add the functionality

normal crest
#

you need to know lua

oblique lotus
#

Is there a built-in method in SMODS to make a single card pullable from a pack, or is it limited to just boosters?

red flower
#

there is actually, in the most recent version

#

i think it has the same name

oblique lotus
#

Nice! Thanks!

slow pond
#

is there a way i can run a task every say 10 seconds in the background? i tried to figure it out earlier but i can't seem to find a way that doesnt crash

red flower
#

there's also probably some threading stuff that's possible but idk about that

slow pond
#

i know cryptid has one that runs every 60 seconds to get the discord member count, but their codebase is so huge i couldnt find my way into what i needed and when i did it didnt really make sense

turbid maple
#

the wiki page for the event manager has an example of a periodic event iirc

slow pond
#

i literally just found that on google, not sure how i didnt see that earlier

red flower
#

oh cryptid just hooks update

slow pond
#

i should mention i am very new to lua but not programming in general

turbid maple
#

welcome lua feels like everything is glued with playdoh and magic

slow pond
#

yeah thats the impression i get

stoic heron
#

playdoh is yummers

jade socket
#

i added a joker but im lost on adding functionality

turbid maple
#

isnt there like jokerforge or whatever

#

never used it

#

but either you're gonna learn lua or use that thing

red flower
#

joker forge also doesn't work on gamepass balatro lol

turbid maple
#

oh

#

welp

jade socket
turbid maple
#

:3

normal crest
#

:3

jade socket
#

:3

red flower
#

:3

slow pond
#

also one more is there a way i can tell if the user is in the game or not?

#

like versus being on the title screen or pause menu

red flower
#

G.STAGE == G.STAGES.RUN
i think i didnt check

normal crest
#

i also think that is correct

#

i also didn't check

turbid maple
#

I really did not think this effect through and I don't know how I feel about the hand being treated as a flush house

slow pond
turbid maple
#

surely I could just run get_poker_hand_info (n choose 5) times surely that'd be so efficient

jade socket
#
        elseif self.ability.name == 'Photograph' then loc_vars = {self.ability.extra}
        elseif self.ability.name == 'test' then loc_vars = {self.ability.extra}```

i dont wanna check with ai because ai is stinky so can yall doube check im doing this right?
normal crest
#

That's fine but that part doesn't define the behavior, it's for the variable values in the joker description

jade socket
#
if self.ability.name == 'Photograph' then
                    local first_face = nil
                    for i = 1, #context.scoring_hand do
                        if context.scoring_hand[i]:is_face() then first_face = context.scoring_hand[i]; break end
                    end
                    if context.other_card == first_face then
                        return {
                            x_mult = self.ability.extra,
                            colour = G.C.RED,
                            card = self
                        }
                    end
                end
if self.ability.name == 'test' then
                    local first_face = nil
                    for i = 1, #context.scoring_hand do
                        if context.scoring_hand[i]:is_face() then first_face = context.scoring_hand[i]; break end
                    end
                    if context.other_card == first_face then
                        return {
                            x_mult = self.ability.extra,
                            colour = G.C.RED,
                            card = self
                        }
                    end
                end```

is this right? im copying photographs code
turbid maple
#

what are you trying to make exactly

#

photograph #2 just to test things out?

wooden nexus
#
            for k, v in pairs(self.GAME.starting_params.extra_cards) do
                card_protos[#card_protos+1] = v
            end
        end```

Where is this used?
normal crest
#

that's when the deck is created

#

the initial deck

wooden nexus
normal crest
#

based on that it'd be like

#
G.GAME.starting_params.extra_cards = {
  { s = 'H', r = '2' },
  { s = 'C', r = '9' }
}

something like that, where s is the suit and r is the rank

#

it's kind of annoying

wooden nexus
#

think i can add an enhancement?

normal crest
#

i think there was a steamodded wiki page on this

reef belfry
#

how do you make it so discards give money under SMODS.current_mod.calculate

#

is it just the same logic as having a joker?

normal crest
wooden nexus
#

ty

normal crest
#

ignore the deck.cards part of that screenshot

#

each table can have those 5 keys

#

suit and rank are needed

wooden nexus
#

I'm gonna make a while loop so that it goes through giving a random rank/suit and then adds stone to them (until i get 13 cards)

turbid maple
reef belfry
#

no, like remaining hands at the end of the round

normal crest
#

in the cash out screen?

reef belfry
#

i guess i should have worded that better

#

yeah

normal crest
#

you wouldn't use calculate for that no

turbid maple
#

i remember lovely patching for cashout effects idk if smods has stuff built in for that

normal crest
#

i don't know if there's a global version of it, but jokers have a function dedicated for it

daring fern
turbid maple
#

also does your mod just do this unconditionally

reef belfry
#

yes

#

well technically yes

#

there is a condition but its under using a consumable once

turbid maple
#

this sounds like a voucher with extra steps

daring fern
normal crest
#

you will have to patch like somethingcom said, it's in state_events.lua in that function

wooden nexus
#

right?

normal crest
#

that looks correct, does it work?

wooden nexus
#

lemme test

#

Oh my gosh it works

#

Well...

#

now there's a new problem

#

each refresh, it seems like it won't change

#
    if self.effect.config.stone_total then
        local i = 0
        local suits = {"H", "C", "S", "D"}
        local ranks = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K"}
        local extras = G.GAME.starting_params.extra_cards or {}
        for i = 1, self.effect.config.stone_total do
            local stone = {
                s = pseudorandom_element(suits, pseudoseed('StoneSuit' .. i)),
                r = pseudorandom_element(ranks, pseudoseed('StoneRank' .. i)),
                e = 'm_stone'
            }
            table.insert(extras, stone)
        end
        G.GAME.starting_params.extra_cards = extras
    end```
daring fern
wooden nexus
#

Back:apply_to_run

normal crest
#

wdym by each refresh btw

#

are you starting a new run each time

#

also a better way of picking a suit and rank would be pseudorandom_element(SMODS.Suits, "seed").card_key

wooden nexus
#

specifically "seed" like that?

normal crest
#

no, that string can be whatever you want

#

same with SMODS.Ranks

wooden nexus
#

so "pseudorandom_element(SMODS.Suits, "StoneSuit).card_key"?

normal crest
#

you're missing a quote there but yes

wooden nexus
#

and same for ranks

normal crest
#

yes

wooden nexus
#

Let's try again then

#

btw i have a separate list for vanilla ranks and suits (the ones I want in this case so that's why i'm not using the smods.suits/ranks)

#

but one sec

#

wonder if it's because I put T instead of 10

#

one moment

#

nope

normal crest
wooden nexus
#

doesn't matter, i tried your method and it still has the same outcome

#

Every time i refresh

normal crest
#

So every time you start a run with that deck you get the same cards

wooden nexus
#

yes

normal crest
#

you're not starting a seeded run right

wooden nexus
#
function Back:apply_to_run()
    if self.effect.config.stone_total then
        local i = 0
        local suits = {"H", "C", "S", "D"}
        local ranks = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K"}
        local extras = G.GAME.starting_params.extra_cards or {}
        for i = 1, self.effect.config.stone_total do
            local stone = {
                s = pseudorandom_element(suits, pseudoseed('StoneSuit' .. i)),
                r = pseudorandom_element(ranks, pseudoseed('StoneRank' .. i))
                e = 'm_stone'
            }
            table.insert(extras, stone)
        end
        G.GAME.starting_params.extra_cards = extras
    end
#

Correct

normal crest
#

cus I can't really think of why that'd be happening

wooden nexus
#

is there a way to have a string be constantly randomizing?

normal crest
#

Wait, do you get more and more cards every time you start a run

wooden nexus
#

no it's the same 13 stone cards

normal crest
#

uhh, can you try s = suits[math.random(1, #suits)] and same with rank, that should make it fully random

#

just to see if the problem is with pseudorandom_element here

wooden nexus
#

ok let's try that

#

Okay, so far so good

#

Now the next test

#

set seeds

normal crest
#

it won't work for seeded runs no

wooden nexus
#

So we closed one problem but opened another

#

what if pseudorandom_element but instead of "StoneSuit"...

normal crest
wooden nexus
#

It's just seed seed

wooden nexus
#

it's a lovely patch

normal crest
#

then could you show the patch

wooden nexus
#

[[patches]]
[patches.pattern]
target = "back.lua"
pattern = ''' if self.effect.config.edition then
G.E_MANAGER:add_event(Event({
func = function()
local i = 0
while i < self.effect.config.edition_count do
local card = pseudorandom_element(G.playing_cards, pseudoseed('edition_deck'))
if not card.edition then
i = i + 1
card:set_edition({[self.effect.config.edition] = true}, nil, true)
end
end
return true
end
}))
end'''
position = "before"
payload = '''if self.effect.config.enhancement then
G.E_MANAGER:add_event(Event({
func = function()
local i = 0
while i < self.effect.config.enhancement_amount do
local card = pseudorandom_element(G.playing_cards, pseudoseed('enhancement_deck'))
if not card.edition then
i = i + 1
card:set_ability(G.P_CENTERS.m_steel, nil, true)
end
end
return true
end
}))
end
if self.effect.config.stone_total then
local i = 0
local suits = {"H", "C", "S", "D"}
local ranks = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K"}
local extras = G.GAME.starting_params.extra_cards or {}
for i = 1, self.effect.config.stone_total do
local stone = {
s = pseudorandom_element(SMODS.Suits, "StoneSuit").card_key,
r = pseudorandom_element(SMODS.Ranks, "StoneRank").card_key,
e = 'm_stone'
}
table.insert(extras, stone)
end
G.GAME.starting_params.extra_cards = extras
end
'''
match_indent = false

#

i undid the random btw

#

what if...

#

s = pseudorandom_element(SMODS.Suits, G.GAME.pseudorandom.seed).card_key,
r = pseudorandom_element(SMODS.Ranks, G.GAME.pseudorandom.seed).card_key,

normal crest
#

Maybe try putting everything in an event?

#

that seems to be how the other deck effects do it

#

maybe that function is called before the seed is applied

wooden nexus
#

lemme try my thing rq and if that doesn't work then i'll try yours

#

idk why this popped into my brain

normal crest
#

that said, maybe the event will make it happen too late

wooden nexus
#

so far so good

#

Now lemme use my test seed "Shinku"

#

I thought It'd work since y'know... tie it to the seed

#

unless i didn't do it properly

#

Is there anything that is tied directly to the seed that we could possibly find how it works?

normal crest
#
local numbers = { 1, 2, 3 }

local bap = Back.apply_to_run
Back.apply_to_run = function(self)
  for i = 1, 5 do
    local num = pseudorandom_element(numbers, "meow")
    print(num)
  end
  return bap(self)
end

i tested this code and it works as intended

wooden nexus
#

Okay, so how do I apply this to the lovely patch?

normal crest
#

I mean I just did the same thing as you and it worked for me

wooden nexus
#

oh

#

y'know what, I'll just do it the odd way then

normal crest
#

I guess I can try using your stone adding code

wooden nexus
#

ok

#

Wait a minute, you have a return in yours

normal crest
#

cus it's a hook

wooden nexus
#

oh right

normal crest
#
local bap = Back.apply_to_run
Back.apply_to_run = function(self)
  local suits = { "H", "C", "S", "D" }
  local ranks = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K" }
  local extras = G.GAME.starting_params.extra_cards or {}
  for i = 1, 13 do
    local stone = {
      s = pseudorandom_element(suits, "StoneSuit"),
      r = pseudorandom_element(ranks, "StoneRank"),
      e = 'm_stone'
    }
    table.insert(extras, stone)
  end
  G.GAME.starting_params.extra_cards = extras
  return bap(self)
end

this works just fine

#

that said I'm not in the same smods version as you

#

I'm on 1118a

#

I guess it's possible it's somehow broken in the latest release

wooden nexus
#

"Latest"

#

apparently i'm outdated

normal crest
#

the version I'm on isn't a release

wooden nexus
#

oh

#

lemme try the non release

#

or you try release, idk

normal crest
#

I can try the release

wooden nexus
#

ok

normal crest
#

it still works

wooden nexus
#

I hid the stone for now, but lemme try

#

Those are different runs, I swear

#

is it something with lovely?

normal crest
#

I wish I knew what the issue was

wooden nexus
#

Alright so the hook

#

I put it under apply(self, back), right?

wooden nexus
#

yes

normal crest
#

I put that at the end of my main file

wooden nexus
#

alright, lemme try with my code

#

okay i'm not getting it, i used your code and it's not working

#

I can't work on it anymore rn, It's 1:40 AM

normal crest
#

it is 3:43 am for me

wooden nexus
#

You want me to just send you the WIP mod in DMs or something?

normal crest
#

even if you do I'm about to sleep so I'm not gonna look over it rn

#

I'd say try disabling all other mods first

#

except debugplus ofc

wooden nexus
#

I have. Other than Galdur

stoic void
#

Good morning

golden field
#

question: why does this softlock the game when i select a blind

SMODS.Joker {
    key = "khet",
    config = { extra = { xmult = 5 } },
    rarity = 2,
    atlas = "khet",
    blueprint_compat = false,
    pos = { x = 7, y = 0 },
    cost = 7,
    
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult } }
    end,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult
            }
        end
    end,    

    add_to_deck = function(self, card, from_debuff)
        G.E_MANAGER:add_event(Event({
            func = function()
                G.GAME.starting_params.ante_scaling = G.GAME.starting_params.ante_scaling * 2
            end
        }))
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.E_MANAGER:add_event(Event({
            func = function()
                G.GAME.starting_params.ante_scaling = G.GAME.starting_params.ante_scaling / 2

            end
        }))
    end
}
#

-# yes this is for the aforementioned hebrew part of my goofy ahh mod that i mentioned yesterday

daring fern
golden field
#

-# cant type this properly rn im away from my pc

golden field
#

ah i see

reef belfry
#

hooking Game:start_run to create something at the start recreates it when reloading the run, is there anyway to check if the run is being reloaded under it?

woeful basin
#

Any idea how I can fix this? It doesn't seem to care what mods I have, I think one of the mods I installed caused a lasting break somehow. I've even tried uninstalling and reinstalling. It happens almost any time I click any planet card.

north crater
#

hey, has anyone compiled a reference of all of the keys used (and what they are used for) for the pseudoseed function? i need to compile something like it for a personal project and i'm wondering if it's been done already.

wraith jolt
#

Does anyone know what happen to the originally jellymod?

#

When download it only gives me Bad Apple or crashes

wind steppe
#

its broken due to being Very Old

quasi pike
#

why does this joker turn every card lucky?

daring fern
fossil ermine
#

how could i like pull from a fork of smods that isnt merged yet to use that code's functionality in my code ?

mystic river
#

like, you want that code in your mod?

mystic river
# quasi pike why does this joker turn every card lucky?

because that code means "when a card is scored, iterate over the scoring hand and turn each card lucky if the card just scored was a king"
if you're trying to turn just that one king lucky you don't need to iterate over the scoring hand at all, just set ability directly on context.other_card

golden field
#

question: how do i make something pick a random joker

dense fulcrum
#

how do i set the number of chips a card gives?

mystic river
mystic river
dense fulcrum
golden field
mystic river
#

card.ability.perma_bonus = 0 to erase its hiker bonus
if you want to override the rank chips without affecting the rank, I'm not sure there's a simple way to do that

dense fulcrum
mystic river
golden field
mystic river
mystic river
dense fulcrum
mystic river
#

i believe it's vanilla, actually

golden field
dense fulcrum
mystic river
golden field
#

hm

dense fulcrum
golden field
#

huh

#

im trying to have a joker pick a random joker

mystic river
#

I'll explain it anyway if you want, though

golden field
#

i dont rlly get this

#

if i make a new random event, does that mean i make a new seed string

mystic river
#

basically, computers can't actually do randomness, so instead they do complicated math to be unpredictable
the seed gets fed into the complicated math to get a specific series of unpredictable numbers
also for balatro specifically, each type of random event gets its results from its own specific series of random numbers, so that e.g. "what order you draw your deck in" doesn't disrupt "what jokers the shop has"

#

what people usually do for a seed string is just say what they're doing
i think there's examples of this in the vanilla code too

golden field
#

(?)

mystic river
#

basically

golden field
#

so it can be anything i want... hehe

#

thanks

#

i get it now

long sun
#

the line G.hand.highlighted[i]:flip() is crashing here

#

what was my mistake?

dense fulcrum
#

how do i display a message on a scoring card without putting it in the return table? my code is already using the return table for something else

golden field
#

is there any mistakes i made in my code or nah

pale holly
# golden field

You should first test your joker if it works as intended that way you could see if your code is correct or not

pale holly
# golden field huh

I think you've added an extra 'end', since you only got two 'if' unless the third one is meant to close to the calculate function

#

it's also possible the syntax error is somewhere else

golden field
#

after fixing and going through a shit ton more errors i get one i'm stumped on

#

i already have the }

pale holly
#

either there's a { open somewhere else or you might need to add an extra '}', try that last idea first then check again, otherwise, see for any open {

#

syntax errors are always hell with this

golden field
quasi pike
pale holly
quasi pike
golden field
#

now to test if it REALLY works

quasi pike
vale grove
#

how do you change a jokers sprite when something happens?
(i have a countdown joker that i want to change sprites when the countdown finishes)

red flower
vale grove
#

i see i see

vale grove
#
    loc_vars = function(self, info_queue, card)
        local rounds = 3

        return { vars = { card.ability.extra.Xmult, rounds } }
    end,
    calculate = function(self, card, context)
        local rounds = 3

        if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
            rounds = rounds - 1
            if rounds == 0 then
                return {
                    card.children.center:set_sprite_pos { x = 1, y = 1 },
                    message = 'wakey wakey',


                }
            else
            end
        end
    end,
}

why do the rounds not actually go down?

long sun
#

whenever loc_vars or calculate are run, a new rounds is created, which always starts at 3

#

consider making rounds a variable in card.ability.extra

tired kestrel
#

Welp... this is fun to work aorund with.

#

(also the colors would be adapted soon just right now I'm testing out about how it would look with game-accurate boxes)

long sun
#

-# wait, isn't this like, really op?

#

-# The Trio is only X3

tired kestrel
#

However there was this issue.

#

there is a limit on this which is the 500 limit.

#

but overall it only does if you only have 3 of a kind

#

though I know people are going to like over tops the stuff so I had set up a limit of 500 since in the oriignal DOS game the Gin game had the limit of winning scores from 100 to 500 and I picked the maximum one though I'd be happy to set it back to 100

crisp coral
#

whats the 500 limit

tired kestrel
#

but overall I don't think it would be overpowered as long as you kept looking for three of a kind or four of a kind.

tired kestrel
long sun
#

okay i'm very confused

crisp coral
#

same

long sun
#

so like

crisp coral
#

why do you have an arbitrary limit not listed on the card

long sun
#

i assume that joker gives you X12 Mult if you play a hand containing a 3oak

#

and gains X3 Mult when doing that 3 times

#

that, in itself, is Legendary

#

and a high Legendary, at that

crisp coral
#

hell that's an Epic

long sun
#

honestly ya true

crisp coral
#

(because cryptid epics are better than legendaries go figure

tired kestrel
#

I mean, honestly I tried to apply sometihng about Gin Rummy

#

Although I am processing about the other jokers

#

cause I was thinking like maybe if I were to like have a feature where you choose between like casual or boundless.

long sun
#

i think we're missing lots of context

tired kestrel
tired kestrel
long sun
#

oh i see, XMult is capped at 500

tired kestrel
long sun
#

that will almost never apply

tired kestrel
long sun
tired kestrel
#

Yeah, now I'll show the first set of jokers I had made for my mod I'm currently thinking of processing.:

#

Which those jokers in different styles came from different games that involved with playing cards.

tired kestrel
crisp coral
#

X500 Mult for an Uncommon is.

#

a bit absurd, don't you think

tired kestrel
#

I know but right now I have most of the new jokers as uncommons but I might change the rarity

#

but right now I think I'm foing mosto f the fun of trying to like goinf for pin-point accuracy of game dialouges

#

Cause I had one idea of a joker being themed after a game I can make it obvious more if I also replicate more from the kind of dialouge as well as the style of it

umbral spire
#

how do i make a joker apply negative to a random joker you have every ante?

#

I tried this:

    config = { extra = { Xmult = 10, last_ante = 1 } },

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.Xmult } }
    end,

    calculate = function(self, card, context)
        if context.buying_card and context.card == card then 
            card.ability.extra.last_ante = G.GAME.round_resets.ante
        end 
        if G.GAME.round_resets.ante ~= card.ability.extra.last_ante then
            card.ability.extra.last_ante = G.GAME.round_resets.ante
            if G.jokers.cards and #G.jokers.cards >= 1 then
                local r = pseudorandom('j_closet_will', 1, #G.jokers.cards)
                local card = G.jokers.cards[r]

                card:set_edition('e_negative', true)
            end
        end
    end

tired kestrel
#

how do you reposition stickers?

#

or resize them?

umbral spire
#

how do i make that one 'code art idea' thingy that some mods have.

#

i think hot potato has it (?)

#

after doing G.C.colour = SMODS.Gradients['colour'] , it allows you to do {C:colour} in localization files (or loc_txt) right?

#

also does {C:white,C:black} make the text black and the highlighted bg white?

mystic river
red flower
#

modprefix_key

umbral spire
red flower
#

yes

umbral spire
#

where it shifts between "Code: X", "Art: Y", "Idea: Z".

#

as a badge.

long sun
#

okay i fixed the issue i had earlier, but i have a new one

#

this is Silver Deck, unscored cards give $1, -1 hand size

#

this is The Apparition, retriggers all played and scored cards

#

The Apparition doesn't retrigger the deck's effects, why not?

long sun
#

oh nevermind, i fixed it ^^

wooden nexus
umbral spire
#

is it possible to put an animating sprite on a rarity badge

red flower
umbral spire
#

Like I want "T[animated sprite]ext"

wooden nexus
red flower
# umbral spire wdym?

It is possible to add sprites to any part of the UI if you work it out but there's no API that provides that

umbral spire
#

oh

umbral spire
red flower
#

no

umbral spire
#

damn.

twilit tundra
#

is there no like. font shenanigans or anything you can do to just have a character be animated

red flower
#

it would be the same level of difficulty because both use the same system for ui

wooden nexus
# wooden nexus

Am i going at this wrong because I'm putting it on "Back.apply_to_run"

#

I don't want the game to just have a second where it puts them into the deck like how other decks do it, since the actual deck itself just automatically does it

umbral spire
#

aint no way i can't find it on github, bmm not even codeberg?

#

is it even a mod ;-;

wooden nexus
#

Wait, i had a stupid idea

#

What if I used the same logic as the metal deck, how it chooses random cards, and then whatever cards it chooses, it stores a base edition copy that gets inserted

wintry solar
umbral spire
umbral spire
wintry solar
#

no

umbral spire
#

or has it been used in any mods so i can reference it?

wintry solar
#

aiko uses it

umbral spire
#

oh ok

umbral spire
wintry solar
#

I don't think you can use dynatext for sprites but I might be wrong

umbral spire
# wintry solar I don't think you can use dynatext for sprites but I might be wrong

idk if this is for a sprite or not, but this looks like one... it was used in aikoshen

    SMODS.DynaTextEffect {
        key = "obfuscate",
        func = function (dynatext, index, letter)
            letter.letter = love.graphics.newText(dynatext.font.FONT, string.char(math.fmod((string.byte(letter.char) + math.fmod(math.floor(G.TIMERS.REAL * 142.1 + index), 192)), 94)+ 33))
        end
    }
wintry solar
#

that's for a character of text

umbral spire
#

oh.

umbral spire
quasi pike
wintry solar
#

I mean if you want to create a font that functions as a sprite sheet knock yourself out

umbral spire
#

do i need cdataman and talisman or just cdataman?

wooden nexus
#

Ok so i'm getting closer

mystic river
quasi pike
#

I copypasted a lot when doing my mod

mystic river
#

you should look that up real quick
it would make this make a lot more sense

quasi pike
#

ok, thx

wooden nexus
#
        G.E_MANAGER:add_event(Event({
            func = function()
                local i = 0
                local extras = G.GAME.starting_params.extra_cards or {}
                while i < self.effect.config.stone_total do 
                    local card = pseudorandom_element(G.playing_cards, pseudoseed('rockydeck'))
                    local suit_prefix = string.sub(card.base.suit, 1, 1)..'_'
                    local rank_suffix = card.base.id == 14 and 2 or math.min(card.base.id+1, 14)
                        if rank_suffix < 10 then rank_suffix = tostring(rank_suffix)
                        elseif rank_suffix == 10 then rank_suffix = 'T'
                        elseif rank_suffix == 11 then rank_suffix = 'J'
                        elseif rank_suffix == 12 then rank_suffix = 'Q'
                        elseif rank_suffix == 13 then rank_suffix = 'K'
                        elseif rank_suffix == 14 then rank_suffix = 'A'
                        end

                    if not card.edition then
                        i = i + 1
                        local stone = {
                            s = card.suit_prefix,
                            r = card.rank_suffix,
                            }
                        table.insert(extras, stone)
                        card:set_ability(G.P_CENTERS.m_stone, nil, true)
                    end
                end
                G.GAME.starting_params.extra_cards = extras
            return true
            end
        }))
    end

trying to get whatever card it is to set the prefix/suffix to add to to the extra_cards

#

oh

#

i see a comma

#

Okay so prefix and suffix are working, so lemme try something

#

okay this is useless apparently

#

lemme try again

lunar tiger
#

Sorry to interrupt the current conversation but I have some questions. I want to make a mod that adds jokers and maybe consumables and other things, like vouchers, etc. I have modding experience in more... dynamic platforms, like in The Elder Scrolls Construction Set, but I have never modded in a code-based system directly. Is there any video tutorial or similar resource anyone could recommend to me to start out with to learn the basics of modding Balatro?

twilit tundra
wooden nexus
tired kestrel
#

I added in the importance color stuff but no idea if it's right dispite I tried ot use a guide on how it works.

lunar tiger
#

Thank you!! And I think I can already tell from all of the previous discussions I've been reading, but essentially modding Balatro is always going to be a coding experience, right? Like, there's no visual interface to go about modding it?

quasi pike
tired kestrel
#

also how am I goign to adjust the sticker when the texture is like very tiny or small

lunar tiger
#

Thank you! I will now dissapear into the learning curve of coding Lua and maybe have something to show you guys in a few days lol

umbral spire
#

how can i replace all the music with X every 7th ante?

wooden nexus
#

duality of man

lunar tiger
# quasi pike good luck

Follow up question, do y'all just use notepad for editing this stuff or is there a better program I could be using? I'm sure there is something better, it's just that I've never modded in code before

red flower
#

i mean it is awful to look at

wooden nexus
#

Notepad++, Visual Studio Code, Notepad, whatever you want

lunar tiger
#

Thank you!

wooden nexus
quasi pike
#

I'm just used to it

wooden nexus
#

for now I have it in steel cards so i can see if it duplicates properly, but obviously it's not duplicating at all

#

The idea is that whatever card is a stone card, it copies itself without a rank. (I'm inputting this as a lovely patch)

lunar tiger
quasi pike
#

What do I have to write instead of card to make this work?

wooden nexus
red flower
quasi pike
#

transform the kins to lucky cards

red flower
#

that should already work

quasi pike
#

and I0m pretty sure that 'card' is the problem

red flower
#

oh yeah

#

it should be context.other_card

quasi pike
#

ohhhhh

red flower
#

oh

quasi pike
#

yeah, thanks

red flower
#

also this is self,card

quasi pike
wooden nexus
#

and in my case?

#

do i need a return for the table?

quasi pike
#

!!

umbral spire
red flower
umbral spire
wooden nexus
# red flower no idea

damn. I'll just do the try and true method of "throwing stuff at a wall and see if it sticks

twilit tundra
umbral spire
#

this is the best i can get 🥀

#

well 20.7 now

#

my steam folder is only 4.28gb ;-;

fleet reef
#

idk how much of those you have

umbral spire
#

barely anything

fleet reef
#

ah

umbral spire
#

only managed to get .5gigs

fleet reef
#

then whats takin up everything else?

#

i like to use windirstat to look at my storage it helps a lot to see whats taking up the most

umbral spire
#

I have no clue

#

my downloads folder was kinda big

#

well 0.25GB

fleet reef
#

yeah its really helpful

#

it even gives you a visual representation of your storage

umbral spire
#

managed to get 0.5GB free so far.

umbral spire
#

got it.

#

it's loading.

#

22% 🥀

fleet reef
#

yeah it takes a bit to boot up cuz its gotta measure everything

versed swan
# wooden nexus and in my case?

I don't think you should be using an event; by the time that event runs, the game has already skimmed through the (undefined) G.GAME.starting_params.extra_cards table and finished initialization

#

The reason why the other self.effect.config checks involve an event is because they need to wait for the run to finish initializing to modify cards and whatnot

#

Back:apply_to_run is called before G.GAME.starting_params.extra_cards is checked

umbral spire
#

AppData is apparently 80gigs

#

mostly /Local

#

damn docker is 30??

#

might aswell uninstall that lmaoo

fleet reef
#

yup thats what im sayin

#

way easier to find out where all your storage is

lunar tiger
#

Super quick question, in Balatro logic, does a Flush Five contain a five of a kind?

#

Planning out Joker effects

final jewel
#

is there a function to hook so I can generate something when I enter blind selection screen

wooden nexus
lunar tiger
wooden nexus
frosty rampart
#

same goes for flush house and straight flush with their respective non-flush aspects

lunar tiger
#

Awesome, thank you!

twilit tundra
#

dont forget that four fingers exists when planning it out btw

twilit tundra
lunar tiger
twilit tundra
lunar tiger
#

I'm making a spreadsheet (cuz I'm a nerd) to plan out all Joker/Consumable effects before I start coding anything because I need to know what I'm coding, and one of the Joker effects is going to be "When played hand contains a five of a kind destroy all cards held in hand" so the Four Fingers integration is really important

versed swan
twilit tundra
#

and also even if it did you could just do the contains hand function and it would already account for four fingers

umbral spire
#

how can i make a config variable for a joker that always keeps track of your highest mult this run?

wooden nexus
versed swan
#

actually taking a look at the code, it can be written differently; asking for clarification, you're trying to add some amount of stone cards in the default deck?

wooden nexus
#

yes

#

suit and rank randomized as well

twilit tundra
# lunar tiger Ohhhh sweet sweet thank you!!

oh and also heres some code for runner, although you might want a later context than context.before depending on whether you want it to trigger stuff like steel cards before the cards get destroyed

    key = "runner",
    blueprint_compat = true,
    perishable_compat = false,
    rarity = 1,
    cost = 5,
    pos = { x = 3, y = 10 },
    config = { extra = { chips = 0, chip_mod = 15 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.chips, card.ability.extra.chip_mod } }
    end,
    calculate = function(self, card, context)
        if context.before and not context.blueprint and next(context.poker_hands['Straight']) then
            -- See note about SMODS Scaling Manipulation on the wiki
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_mod
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.CHIPS,
            }
        end
        if context.joker_main then
            return {
                chips = card.ability.extra.chips
            }
        end
    end
}```
versed swan
#

gotcha

twilit tundra
#

just swap Straight for the hand type you want, and put in the different effect :P

wooden nexus
#

My only thing is that i have 2 custom suits but i don't want them in the pool for suits

umbral spire
#

idk if putting it at the top of calculate is efficient

frosty rampart
#

config = { extra = { highest_mult = 0 } }
to actually code it is a different question but i'll answer that too :3 do you want it to track even before you picked up the joker?

umbral spire
frosty rampart
#

ok, gimme a bit to run use the bathroom and then look into how to save game global variables

final jewel
#

is that the function when you enter the blind selection screen

normal crest
#

Game:update_blind_select creates the blind selection UI if that's what you're looking for

frosty rampart
# umbral spire oh yeah i did that, i meant the actual code, and yes i want it to track before. ...

step 1: add this function to your mod

function SMODS.current_mod.reset_game_globals(run_start)
  if run_start then
    G.GAME.modprefix_highest_mult = 0
  end
end

(replace modprefix with your mod's actual prefix, just so that you don't accidentally collide with any other global variables. do not replace current_mod, it should literally be current_mod)
this sets a global variable in G.GAME to 0 at the start of the run

step 2: add this to your mod's global calculate function (add one if you don't have it yet)

function SMODS.current_mod.calculate(self, context)
  -- potentially other stuff if you already have a mod calc function
  if context.after then
    if mult > G.GAME.modprefix_highest_mult then
      G.GAME.modprefix_highest_mult = mult
    end
  end
  -- potentially more other stuff
end

step 3: G.GAME.modprefix_highest_mult will always be the highest mult this run

normal crest
#

step 3: profit

#

that's what it looks like

final jewel
frosty rampart
#

no need to hook
use a mod calculate and do the thing in context.ending_shop

final jewel
#

yeah but its not on a joker

frosty rampart
#

use a mod calculate

#

you can give a calculate function to the mod object itself

final jewel
#

like I can do it on a pool ?

umbral spire
frosty rampart
twilit tundra
#

you need to replace where it says modprefix, not SMODS.current_mod

#

SMODS.current_mod needs to stay

frosty rampart
#

using local thecloset = SMODS.current_mod is perfectly fine

twilit tundra
#

oh huh

final jewel
frosty rampart
#

the mod calculate function always runs regardless of what content you have

normal crest
tired kestrel
#

Has anyone have an idea of changing offset of the stickers on a joker?

final jewel
#

cause I have this pool

umbral spire
#

and if i wanted to have it set to the highest mult in the localization file, would i do #2# and have something like:

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult, card.ability.extra.highest_mult } }
    end,
#

and the config is

#

config = { extra = { mult = 3, highest_mult = G.GAME.thecloset_highest_mult } },

normal crest
final jewel
normal crest
frosty rampart
#

^ you don't need the joker's config variable for highest_mult at all anymore

umbral spire
#

oh yeah

wooden nexus
#

While i wait for onite to try and code up the deck effect, I'm gonna work on other jokers and whatnot

umbral spire
#

i do want to update one of the jokers' config value when the highest mult is passed though

#

card.ability.extra.mult = card.ability.extra.mult + distance_between_last_highest_mult_and_the_amount_passed

#

^ that's basically it.

#

like if it went from 1-101

#

add 100.

normal crest
#

and you want that to happen whenever the highest mult is updated?

normal crest
#
function thecloset.calculate(self, context)
      if context.after then
        if mult > G.GAME.modprefix_highest_mult then
            SMODS.calculate_context({ highest_mult_changed = true, current = mult, previous = G.GAME.modprefix_highest_mult })
            G.GAME.modprefix_highest_mult = mult
        end
      end
end

Maybe just something like this? Then in your joker you'd modify mult when if context.highest_mult_changed then

umbral spire
#

or?

normal crest
#

just context.previous

umbral spire
# normal crest just context.previous

so like

        if context.highest_mult_changed then
            local dist = context.current - context.previous 
            card.ability.extra.mult = card.ability.extra.mult + dist
        end 
normal crest
#

yeah that looks fine

#

does it work

umbral spire
#

i'll test in a sec.

balmy spire
#

im having trouble getting a joker to retrigger other jokers

umbral spire
#

i think that'll retrigger all jimbos.

#

after they trigger.

balmy spire
#

would it retrigger itself?

umbral spire
#

but if you don't want that

balmy spire
#

yeah

umbral spire
#

Wait no

#

it wont.

balmy spire
#

i can test

versed swan
#

so the seed "rockydeck" always maps to the same seed value and hence randomness never occurs

normal crest
#

since you're patching already, why not patch directly in the deck generation

normal crest
normal crest
balmy spire
#

in general

umbral spire
#

just the calculate.

balmy spire
#

how do i do the box

normal crest
#

surround with triple `

balmy spire
#

alright

versed swan
wooden nexus
#

that's fine

balmy spire
# umbral spire just the calculate.
        if context.other_joker and context.other_joker.label == 'j_joker' then
            return {
                repetitions = card.ability.extra.repetitions
            }
        end

        if context.repetition and context.cardarea == G.play then
            return {
                repetitions = card.ability.extra.repetitions
            }
        end

        if context.repetition and context.cardarea == G.hand and (next(context.card_effects[1]) or #context.card_effects > 1) then
            return {
                repetitions = card.ability.extra.repetitions
            }
        end
    end```
versed swan