#💻・modding-dev

1 messages · Page 490 of 1

scarlet imp
#

damn

pure salmon
#

why does calling this function like this during context.final_scoring_step cause a crash for "init_chips" being a nil value?

buoyant shard
#

Is there a game event for when a card gets flipped?

pure salmon
#

also crashes when it's not in an event

normal crest
normal crest
pure salmon
#

oh

#

oops

buoyant shard
daring fern
glass crown
#

how do i check what seal a card has?

daring fern
normal crest
#

🥴

pure salmon
# pure salmon

strangely this activates after scoring despite using final_scoring_step

normal crest
#

probably because of the event

pure salmon
#

i've taken it out of the event and it still scores incorrectly

glass crown
#

asking for help with this again, cannot for the life of me figure it out on my own

daring fern
sleek nova
#

the game crashes for the x mult part

glass crown
daring fern
sleek nova
#

oh

sonic cedar
#

top 1 people who weren't at their computer #1

me

placid star
#

ty ty, I'm in bed now but I had a static sprite on top of the sprite I applied a shader to if that makes sense so hopefully this will fix it

#

:3

sonic cedar
#

yeah also about declaring the thing it's declared in that draw func

#

hiii somecom

#

ok modding question how would i check the sellvalue of a card

#

hi dilly

modern kindle
#

qusetion for you absolutely beautiful babes

#

hi

sonic cedar
modern kindle
#

cant you not just just check sell_cost

sonic cedar
#

(i didnt know that was a thing)

modern kindle
#

oh

sonic cedar
#

(that's why i asked)

sonic cedar
normal crest
modern kindle
#

why the hell does my consumable not work if its found in a booster pack here

it works if its already in consumables and i dont have a can_use, do i really need one when i just have a use?

#

highlighted card or not is irrelevant btw

modern kindle
#

cause the card just pulls from your profile settings

modern kindle
#

is that specific to packs or if ytou have set conditions?

sonic cedar
#

behold my egg of pure evil, now with a random sellvalue limit per run

normal crest
subtle merlin
#

i once again ask: how do you make tooltips on rarities?
-# (The documentation makes no sense to me and neither does any examples i look at so i need someone to dumb it down slightly)

subtle merlin
#

i think so...?
-# The things that pop up when you hover over a joker with eternal on it, for example

normal crest
#

I don't think there's an api for doing that on rarities

subtle merlin
#

ughh

lament agate
#

what is nativefs

subtle merlin
#

could i use a UI element or smth?

normal crest
normal crest
subtle merlin
#

ill try that but i won't be happy abt it

normal crest
#
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "local cfg = (card and card.ability) or _c['config']"
position = "after"
match_indent = true
payload = '''
if _c and _c.rarity == 2 then
  -- append stuff to info_queue if it's uncommon
end
'''

something like this i think

subtle merlin
#

oh that's how you patch things-

#

for a custom rarity i would just put the rarity's key in place of "2", right?

lament agate
#

@limber blaze the talisman code doesnt work

normal crest
#

Yeah, should be

limber blaze
#

depends how youre loading the image

#

show code

lament agate
lament agate
# limber blaze show code

nxkoo_dies = {
    show_mustard = false,
    mustard_timer = 0,
    show_image = false,
    image_timer = 0,
    show_flashbang = false,
    flashbang_timer = 0,
    current_flashbang = nil,
    default_flashbang = love.graphics.newImage("Mods/Tangents/assets/customimages/jumpscare_2.png"),
    path = SMODS.current_mod.path,
    flashbangs = {
        shop = "shop_flashbang.png",
        blind = "blind_flashbang.png",
        hand_played = "hand_flashbang.png",
        discard = "discard_flashbang.png",
        round_start = "round_flashbang.png",
        joker_trigger = "joker_flashbang.png"
    }
}
limber blaze
#

well yeah you didnt change the path

#

the talisman code just gives you the path to use

lament agate
#

i see

limber blaze
#

itll give you .../Mods/Tangents/ iirc

#

you should check

lament agate
#

how

limber blaze
#

though

lament agate
#

to check

#

eval?

foggy ginkgo
#

What's the code to detect certain played hands and level up those hands

limber blaze
#

something with eval

#

but anyway

#

itd be something like

#

tangents_path .. "/assets/customimages/jumpscare_2.png"

foggy ginkgo
#

:(

limber blaze
#

although you might not even need the talisman code if smods.current_mod.path works i think talisman is weird because it doesnt need smods 💀

normal crest
limber blaze
#

that file path is definitely corrrect?

subtle merlin
lament agate
#

wait

#

yeah its trolling

limber blaze
#

im not sure

normal crest
limber blaze
#

try SMODS.current_mod.path .. "/assets/customimages/jumpscare_2.png"

limber blaze
#

wait

#

i think i know why

lament agate
#

hm?

limber blaze
#

love.newImage im pretty sure uses relative paths

#

but idk how you fix that

lament agate
#

relative means?

limber blaze
#

relative to the love directory aka the folder where Mods is in

lament agate
#

shit

#

uhh

limber blaze
#

can you load an image from file data instead of a file path

lament agate
#

how is tha

#

t

#

exactly

limber blaze
#

im trying to figure this out

pure salmon
#

how do you check if an enhancement overrides the base rank?

lament agate
#

ping me if you find out why

normal crest
modern kindle
#

i should make a deck that makes everything have no rank and then make no hands exist and then

normal crest
#

my mod will be G = nil

lament agate
normal crest
#

something, did you figure out how to patch debugplus

limber blaze
#
local nativefs = require("nativefs")
local data = nativefs.newFileData(nativefs.read(tangents_path.."/assets/..."), '???', 'base64')
local imagedata = love.image.newImageData(data)
local image = love.graphics.newImage(imagedata)
#

does thiswork?

subtle merlin
daring fern
normal crest
limber blaze
#

well no it wouldnt be base64 here

lament agate
foggy ginkgo
#

I figured it out lmao

#

Thanks yall

modern kindle
#

damn smt beat me to it

foggy ginkgo
#

Thank you Nxkoo

modern kindle
#

i was gonna give him bad info on my second part, is there a reason we return level up as opposed to using the smart level stuff

subtle merlin
normal crest
#

what did you append

lament agate
#

what should the default path line be

daring fern
limber blaze
#

idk

modern kindle
#

gotcha okay, thankies from mcspankies

subtle merlin
normal crest
#

well, 'some key' is just not a valid key

#

change it for idk

#

'blue_seal'

modern kindle
#

srock we are gonna be besties in exactly 4 years i think

normal crest
#

i think that's in that set

normal crest
#

is it forwards or forward

modern kindle
#

forward i think

#

but its because you wont trust someone you randomly met ont he internet so i gotta get real super close to you and itll take 4 years and then i will be at your wedding

normal crest
#

i think you got the wrong person

modern kindle
#

no because that would not fit the narrative i made up

foggy ginkgo
#

More than just one level up

daring fern
foggy ginkgo
#

That makes sense

#

How would one do multiple

#

Play a hand to level two playing hands

modern kindle
#

what do you mean

#

oh

foggy ginkgo
#

Like it levels up a pair and two pair

lament agate
daring fern
normal crest
lament agate
#

thank you brock

limber blaze
#

but this would break with a fucked up path

#

that has more than 1 Mods in it

foggy ginkgo
#

Curiosity yk

subtle merlin
normal crest
lament agate
foggy ginkgo
#

Extra sandwich

normal crest
#

delicious

lament agate
#

insideof the increment?

limber blaze
#

like C:\users\me\appdata\roaming\Balatro_with_Mods\Mods

foggy ginkgo
#

Thank you my goats

limber blaze
#

so love.graphics.newImage

subtle merlin
#

-# now i need to figure out how to make a custom one-

limber blaze
#

yeah that should work

#

its just a weird string hack to make the native path a relative path

normal crest
lament agate
limber blaze
#

try SMODS.current_mod.path instead

normal crest
#

where are you defining tangents_path

limber blaze
#

if you deleted the unneeded talisman code tangents_path is gonna be nil

subtle merlin
lament agate
limber blaze
#

yes

normal crest
limber blaze
#

you dont need that part

#

anymore

lament agate
#

oh

limber blaze
#

i was trying stuff that didnt work

lament agate
#

same issue, concatenate

#

string inside string

limber blaze
#

go back to when you had the image loading originally

#

and just

normal crest
#

I think SMODS loads nativefs info a global NFS already btw

lament agate
limber blaze
#

aughh idk

#

nvm it works

#

i was testing and it didnt work for me

lament agate
#

should be good

#

tysmmmm @limber blaze @pure salmon

pure salmon
#

what i do

lament agate
#

being here

paper trout
#

maybe this is a stupid idea, but is it possible to make a joker that allows legendary jokers to appear in shop? so something like showman, but instead of overriding it so duplicate jokers can appear, it just overrides legendaries to appear

pure salmon
#

yeah sure it is

pure salmon
#

just set legendary’s joker pool rate to something non-zero i think

paper trout
#

how do i do that, i've never messed around with modifying vanilla stuff before

hidden creek
#

hey guys im tryna start messing around with making mods and the quick-restart binds are kinda js not working

#

closing the game and it dont restart

daring fern
hidden creek
#

why the frig

wind steppe
#

how would i check if a card has a specific modded enhancement?

daring fern
wind steppe
#

also make sure its alt f5 and not alt f4

hidden creek
#

yea i tried the m and the alt f5

#

lemme try one more time

paper trout
daring fern
chrome widget
#

Visdev for custom suits

subtle merlin
hidden creek
#

so i definitely have the right things installed and i know im pressing alt+f5

brisk atlas
#

I'm adding new suits, how would I make it so Erratic still starts with 52 cards but it selects from the new suits?

hidden creek
#

it js kinda closes the balatro window and leaves the console open

#

im on linux so i fear its a little fucky

#

may be a bug?

normal crest
#

I'm on linux and holding M works, but alt f5 doesn't

modern kindle
#

also hi winter

gray void
#

Requiem arrow and stone mask

subtle merlin
#

one last thing that should be much easier: how can i make a joker double all blind requirements?

hidden creek
#

yea nah it js closed the balatro window and kept the console open

pure salmon
foggy ginkgo
pure salmon
foggy ginkgo
pure salmon
#

optional but i like using it

chrome widget
modern kindle
#

i like the right one if it helps at all for the arrow

subtle merlin
# subtle merlin ty!

waitwaitwait, i should have specified: i want this to affect all blinds in the future even if the joker is sold

chrome widget
#

Mmmmm. Yeah the arrow has these little green trim details, and the mask has various cracks and wear that I can either keep or withhold

#

Unsure

modern kindle
#

icicic

#

i think youre doing epically

chrome widget
#

Thank you dilly!!!

modern kindle
#

youre perfect and awesome and epic

chrome widget
#

Jgdgjfsskfkfskg

foggy ginkgo
#

I like the arrow

#

Peak

modern kindle
chrome widget
#

Yep!!! I didn't respond at the time because I was too busy gay making out with my partner hold on

modern kindle
#

wheres the patreon

foggy ginkgo
#

So I did read that correctly

#

Amen

#

Also nvm Something I don't need it

#

Wanted to have only playing Pairs of 2 to level up

#

But idk how it would work with Two Pairs of 2s so

subtle merlin
foggy ginkgo
#

Amen to that

pure salmon
chrome widget
#

I can't make out with anyone straightly, I'm sorry

hidden creek
chrome widget
subtle merlin
chrome widget
#

Instead my programming is quite pornographic. Don't look kids, it's optimized to the point of eroticism

#

(I don't actually write optimal code. I'm a designer, not an engineer)

hidden creek
crisp coral
#

??????????????

hidden creek
#

im dying

subtle merlin
#

that is a sentencee i didnt think i'd hear today

subtle merlin
hidden creek
#

i GUESS i can continue watching my queer show while i wait for it to restart

subtle merlin
#

in theory this should be working, but it isn't doing anything...

subtle merlin
modern kindle
wooden nexus
#

question: how do i give a card more than one rarity just because?

hidden creek
#

ive only seen kids and the queers watch it

subtle merlin
subtle merlin
modern kindle
#

But that would not fit the storyline im trying to pursue

wooden nexus
#

how does this relate to modding dev?

modern kindle
#

Im trying to do the winter route

modern kindle
wooden nexus
#

doubt

hidden creek
subtle merlin
wooden nexus
#

is it possible to CHANGE the rarity mid-round?

wooden nexus
#

in calculate?

daring fern
wooden nexus
#

how do i do it then?

daring fern
wooden nexus
#

okay cool thanks

#

I'll try messing around with it

chrome widget
modern kindle
#

How does a bear look gay

#

I love bears they're such cool fellas even though they could murder me

quasi comet
#

how does one change the spawn rate of a booster through a joker?

subtle merlin
quasi comet
#

like let's say I want a joker to prevent a specific booster pack to spawn

subtle merlin
quasi comet
#

yeah i've tried but it didn't seem to work

subtle merlin
#

may we see the code?

quasi comet
#

wouldn't be sure how to format it

#

i formated it similarly to uh. consumeable's rates

subtle merlin
#

why do you have an underscore before weight?

quasi comet
#

cause tht's how it works with rate lol

#

it still shows up regardless

#

did some research, figured it out

#

changed center

#

to
G.P_CENTERS.p_rw_selectfoodpack.weight = 0
G.P_CENTERS.p_rw_regularfoodpack.weight = 0

#

works as far as i know :3

subtle merlin
#

yayy :3

subtle merlin
modern kindle
#

I cant imagine it would

Blind requirements are in G.GAME.blind.chips so you'd have to change that

wind steppe
#
local delta_extra_slots = function(self)
    local slots = 0
    if self.config.center_key == "j_delta_cooledwater" then
        slots = slots + 1
    end
    return slots
end
local delta_empty_slots = function(self)
    if G.jokers ~= nil then
        return (G.jokers.config.card_limit - #G.jokers.cards + delta_extra_slots(self)) > 0
    else
        return false
    end
end
-- Hooking buyspace checks
local delta_buyspace_check_old = G.FUNCS.check_for_buy_space
G.FUNCS.check_for_buy_space = function(card)
    return delta_empty_slots(card) or delta_buyspace_check_old(card)
end
local delta_cardselect_check_old = G.FUNCS.can_select_card
G.FUNCS.can_select_card = function(e)
    local card = e.config.ref_table
    if delta_empty_slots(card) then
        e.config.colour = G.C.GREEN
        e.config.button = 'use_card'
    else
        delta_cardselect_check_old(e)
    end
end

replace j_delta_cooledwater with your joker

#

@wooden nexus

wooden nexus
#

and i just put this in the joker?

wooden nexus
wind steppe
#

it runs outside the joker and does its thing

#

replace j_delta_cooledwater with your own joker name

wooden nexus
#

gotcha

wooden nexus
#

got it

#

works, thanks

wooden nexus
foggy ginkgo
#

How do I make the cards jiggle like DNA does

subtle merlin
timid zinc
#

is ObjectTypes a real table or did i make a typo

foggy ginkgo
#

Sorry I meant how do I make the joker keep jiggling like how Dna does until you do a certain action

subtle merlin
foggy ginkgo
#

Been doing it actually but yk

lament agate
#

how do you detect if a player bought something from the shop

timid zinc
#

i think i've done that

timid zinc
#

yeah buying_card

lament agate
#

tyty

#

yall the goats

sonic cedar
#

i know ✨

timid zinc
#

i dont think this includes booster packs tho

sonic cedar
#

(it does not)

timid zinc
#

yeah

lament agate
#

then..

timid zinc
#

maybe you could use both open_booster and buying_card?

foggy ginkgo
timid zinc
#

that would include boosters from skips tho...

foggy ginkgo
#

Imma kms brb

timid zinc
#

you could do

sonic cedar
timid zinc
#

if context.buying_card or context.open_booster and G.shop

foggy ginkgo
#

I think

sonic cedar
lament agate
#

hold on i gotta

#

take a bathroom breK rq

timid zinc
#

or just put parantheses around it

lament agate
#

brb

sonic cedar
foggy ginkgo
timid zinc
#

what if you buy a card while not in the shop 😲

foggy ginkgo
#

Fuck that's the same image

sonic cedar
#

what if the card costs 0 because of a tag

foggy ginkgo
#

Then don't put > 0

#

I only did that is because the joker steals a card

#

In the shop for free

#

And it's kinda useless if the free item gets used

#

On a free item

timid zinc
#

is there a way to detect if card is in an ObjectType if card is a part of P_CENTERS and not a string

#

sorry if it's stupid

foggy ginkgo
#

Nothing's stupid

#

Tho idk so

#

I'm very helpful

paper elbow
#

I had an idea for a pair of jokers that I'm not sure how to implement.

Free Cell: Lets you move base cards between empty joker slots and your hand.

Ambidextrous: Same as above, but also lets you store jokers in your hand. ( But the jokers return to the joker space at the end of the round which can put you over the joker limit if you use Judgement, similar to what happens if Invis Joker copies a Negative. This is intended, you have to sell down below the limit to acquire more jokers. )

Also, why not throw in a third:

Sleight of Hand: Lets you store hand cards in empty consumables.

No Jokers in consumable space because Perkeo, but this would be a way to acquire negative copies of a good hand card.

lament agate
foggy ginkgo
#

Wassup

#

Cool idea

lament agate
#

hold ON

foggy ginkgo
#

NO

lament agate
paper elbow
#

I was thinking that Free Cell would be a Common, Sleight of Hand is an Uncommon, and Ambidextrous is a Rare. But what would I need to do to the game to put things in slots they're not originally intended for?

foggy ginkgo
lament agate
#

yeah but

#

like

#

the code

foggy ginkgo
#

Didn't you already do that but with spamton

azure wraith
lament agate
#

thats randomize

#

r

foggy ginkgo
#

Hm

lament agate
#

you orick

foggy ginkgo
#

Well damn

lament agate
#

so like

#

hows the code gonna look like

foggy ginkgo
#

Good question

lament agate
azure wraith
foggy ginkgo
#

I remember someone did a joker where if you didn't buy anything in shop you get X3 mulg

#

I forgot who

lament agate
lament agate
#

dont worry

foggy ginkgo
#

I stole this off of someone so

#

I mean

#

Borrowed

lament agate
foggy ginkgo
#

Oh yea

#

nic = {} -- Vouchers/Boosters

function nic_ctx(context)
if context.nic_buying_voucher then return 'buy a voucher' end
if context.nic_buying_booster then return 'buy a booster pack' end
end

nic.hooks = {}

nic.hooks.Card_open = Card.open
function Card:open()
if self.ability.set == "Booster" then
SMODS.calculate_context({nic_buying_booster = true, card = self})
end
return nic.hooks.Card_open(self)
end

nic.hooks.Card_redeem = Card.redeem
function Card:redeem()
if self.ability.set == "Voucher" then
SMODS.calculate_context({nic_buying_voucher = true, card = self})
end
return nic.hooks.Card_redeem(self)
end

lament agate
#

nic = {} ?

foggy ginkgo
#

Idk

#

I just did it

#

Also

#

More fluff has something you need @lament agate

lament agate
#

alright thanks

#

what rarity btw

foggy ginkgo
#

Uncommon

foggy ginkgo
#

Should probably use this instead of my hook-

#

Thank you notmario

#

Mine just accounts for the cost of the item so it can either be free or double price while the one mf use just depends on if an item is purchasrd

#

Sooooo

lament agate
#

lmao

foggy ginkgo
#

What you need is mf lmao

#

Mine is just different path

lament agate
#

i suppose

foggy ginkgo
#

I suppose 😒

lament agate
#

DUDE THERES NO OTHER WAY

#

okay it worked

#

thanks @foggy ginkgo @shell timber

shell timber
#

huh

lament agate
shell timber
#

oh alright

lament agate
#

yeah

foggy ginkgo
#

Yipee

foggy ginkgo
spark remnant
#

I'm currently trying to add a consumable type however it crashes when I enter the shop.

SMODS.ConsumableType {
    key = 'reversetarot',
    primary_colour = G.C.SET.Tarot,
    secondary_colour = G.C.SECONDARY_SET.Tarot,
    loc_txt = {
        name = 'Reverse Tarots',
        collection = 'Reverse Tarots',
    },
}
spark remnant
subtle merlin
#

i wouldn't know then

lament agate
#

SOMEONE HELP VIOLAET

foggy ginkgo
#

GET THAT PERSON SOME HELP

#

A SHIELD

#

They wanna know how to double the blind requirements

daring fern
lament agate
#

try looking at Cryptid

subtle merlin
lament agate
#

cryptid has it

#

methinks

foggy ginkgo
#

I think it's when you have a score that's x2 it sets you to ante 8

subtle merlin
#

cryptid is the one place i wont look at for reference

foggy ginkgo
#

Unless it's somewhere else

daring fern
# subtle merlin

Have you tried: ```lua
for k, v in pairs(G.P_BLINDS) do
v.mult = v.mult*2
end

foggy ginkgo
#

Gulp

daring fern
foggy ginkgo
#

Oh my

lament agate
#

lmao

subtle merlin
#

-# i fucking swear if that was it-

foggy ginkgo
#

It's okay bud we all experience it

#

-# way to much

subtle merlin
#

fucking hell that was it

foggy ginkgo
#

Oh my

#

Something is a genius

spark remnant
foggy ginkgo
#

I wasn't paying attention

subtle merlin
#

this is a joker, yes

foggy ginkgo
#

Yummy

#

Well glad you got that sortrd

subtle merlin
#

how can i increase the selection limit in booster packs?

lament agate
#

how do you detect other jokers retriggering

daring fern
daring fern
daring fern
lament agate
#

mm i see

lament agate
#

but the quantum enhancement doesnt work somehow

lament agate
#

before i changed it to something else

#

because it doesnt work

#

how doyou even use it anyways

daring fern
lament agate
daring fern
subtle merlin
normal crest
#

Pro

subtle merlin
normal crest
#

If it worked it's not stupid

subtle merlin
#

but everything i do is stupid :3

brittle tide
#

This joker I'm making is able to retrigger all other jokers except for TV. I believe it has to do with the fact that TV is a retrigger joker as well and I was wondering if there was anyway to get it to do the retrigger for tv as well?

brittle tide
#

alr thanks for letting me know

daring fern
#

Jokers that retrigger jokers cannot retrigger jokers that retrigger jokers.

normal crest
#

also you shouldn't check the localized name, but the key

#

which, joker59 is a first for me

subtle merlin
brittle tide
faint yacht
spark remnant
#

how does can_use work? for some reason it wont let me use this.

SMODS.Consumable {
    set = 'reversetarot',

    loc_txt = {
        name = 'The Fool?',
        text = {
            'The Fool??',
        },
    },
    atlas = 'reversetarots',
    pos = { x = 0, y = 0 },
    unlocked = true,
    discovered = true,

    use = function(self, card, area, copier)
        SMODS.add_card({set = 'Joker'})
    end,
    
    can_use = function(self, card)
        return true
    end,
}
brittle tide
normal crest
#

but if numbers work for you I guess that's fine

daring fern
brittle tide
spark remnant
normal crest
#

Your code looks correct to my 4 am eyes, did you save it?

#

uhh actually nvm you're missing a key

#

i think your game would crash without a key so it's still likely you didn't save it

spark remnant
lament agate
#

how do you make stuff expensive

#

with a joker

daring fern
lament agate
#

thanks

subtle merlin
#

I noticed that when starting a new run after acquiring a joker with this code, the doubled blind requirements stay even if you go to the main menu. I would just use remove_from_deck, but i want the effect to stay throughout the run, and solely using remove_from_deck would work when the card is sold. How could i go about fixing this?

daring fern
daring fern
lament agate
#

how to make rerolls free

shell timber
#

how many rerolls

daring fern
lament agate
#

every

daring fern
lament agate
#

G.GAME.current_round.free_rerolls = G.GAME.current_round.free_rerolls + 1

#

is this a thing?

#

and alos this?

red flower
#

yes but if you want every reroll free then do what something said

#

also why would eremel lie

lament agate
#

he could be, who knows

#

it maybe low but never zero

#

:3

daring fern
#

Why is this happening?:

spark remnant
#

how do I add a custom Consumable Types to boster packs? this is currently what I've got which kinda works, just the problem is it can try to add the custom consumable type more times than there are implemented.

SMODS.Booster:take_ownership_by_kind('Arcana', {
        create_card = function(self, card, i)
            local _card
            if (pseudorandom('reversetarot') > 0.8) then
                _card = SMODS.create_card({
                    set = 'reversetarot',
                    area = G.pack_cards,
                    skip_materialize = true,
                    soulable = false,
                })
            else
                _card = SMODS.create_card({
                    set = 'Tarot',
                    area = G.pack_cards,
                    skip_materialize = true,
                    soulable = false,
                })
            end
            return _card
        end,
    },
    true
)
red flower
#

The way the card creation system works in balatro it doesn't really care about if there are any cards of the type left, if it chooses to make a type of object and there's no other one available it will make the default
You'll need to do it manually. I think rare tag does something like that?

violet gull
#

is there a context after hand scoring but before it's checked to be above blind

#

i need to compare hand chips to blind size but using contexts directly related to hand scoring does not work

red flower
#

context.after?

#

what do you need it for exactly?

violet gull
#

i need it to then compare current chips to chips needed to beat the blind

#

so if the current chips is higher, it adds mult

#

but using context.after did not trigger it

red flower
#

context.final_scoring_step then

violet gull
#

will try that

floral narwhal
lament agate
#

can a hook be wrapped in to_big?

red flower
lament agate
red flower
lament agate
#

i got a talisman crash over here

floral narwhal
red flower
red flower
lament agate
#

thanks

floral narwhal
red flower
#

you'll have to extend SMODS.Center then

floral narwhal
#

ok thanks

violet gull
#

is there a context like end of hand, like after the hand has scored and it has been added to game chips but before the round ends

red flower
#

context.after

#

you'll have to be more clear as to exactly you want to do, you might have a problem with the logic not the context

red flower
#

no, you'll need to extend the class like in the link I sent
It's a bit advanced

floral narwhal
#

ah f

#

and how can i make cons work is it like enh?

violet gull
red flower
#

and what was the problem with final_scoring_step?

wintry solar
#

use context.final_scoring_step and use hand_chips * mult as your current score value

violet gull
#

ohh omg that works

#

thank u all so much :)

#

one last question

#

is there a way to check that before adding the mult from the card to scoring

violet gull
#

joker has 2x mult

#

and the final scoring step would reset the mult to 1x

#

but the 2x would be added to mult before it reset

#

if that makes sense

red flower
#

like this?

-- pseudocode
local old_xmult = card.ability.extra.xmult
if chips > blind chips then
  card.ability.extra.xmult = 1
end
return { xmult = old_xmult }
lament agate
#
SMODS.Back {
    key = "gangsta",
    loc_txt = {
        name = "Gangsta Deck",
        text = {
            "Start with {C:money}$50{}",
            "and a {C:dark_edition}Negative{} {C:red}Eternal{} {C:attention,f:tngt_DETERMINATION}DealMaker{}",
            "{C:money}$2{} per remaining {C:red}discards{} and {C:blue}hands{}"
        }
    },
    unlocked = true,
    discovered = true,
    atlas = "dicks",
    pos = { x = 3, y = 1 },
    config = { dollars = 50, extra_hand_bonus = 2, extra_discard_bonus = 2 },
    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.extra_hand_bonus, self.config.extra_discard_bonus } }
    end,
    apply = function(self)
        G.E_MANAGER:add_event(Event({
            trigger = 'immediate',
            delay = 0.1,
            func = function()
                SMODS.add_card({
                    key = "j_tngt_dealmaker",
                    edition = "e_negative",
                    stickers = { "eternal" },
                    area = G.jokers,
                    discovered = true
                })
                return true
            end
        }))
    end
}
#

deck not showing up

#

what happened

red flower
#

what not working

violet gull
#

it only uses the reset xmult for future calculations

lament agate
red flower
#

looks fine to me

lament agate
#

weird

red flower
#

check if the file is loading, you saved properly, etc

lament agate
#

dude i spammed S

#

hold on

#

i got the autosave on

#

yeah no

red flower
#

is it on a different file to the main one

lament agate
#

well yeah

#

i did smods load file

#

i mean all decks shows up fine

#

modded one

#

except this one

red flower
#

are they all in the same file

#

send it here

lament agate
red flower
#

dunno, looks fine to me

lament agate
#

this game keeps fucking with me

#

oh my god

#

fxed

#

ifx

#

ed

#

fixed

#
local original_calculate_reroll_cost = calculate_reroll_cost
function calculate_reroll_cost(...)
    local cost = original_calculate_reroll_cost(...)
    if next(SMODS.find_card("j_tngt_dealmaker")) then
        cost = pseudorandom('dealmaker_reroll', 1, cost + 100)
    end
    return cost
end
#

aritmethic crash

#

any idea?

red flower
#

what's the crash log

lament agate
red flower
#

oh it doesnt seem to return a value

lament agate
#

but i already set return cost

red flower
#

the original i mean

lament agate
#

huh

#

what do then

red flower
#

i have a hook that sets all rerolls free but im not on that PC rn haha
i think you just set reroll_cost to 0 in that hook

#

or whatever value you want obviously

lament agate
#

well i mean

#

i wanted to like

#

randomize its value

#

just how i randomize

#

the items in the shop

#

thought i could do the same

#

with rerolls

red flower
#

you can write the entire sentence in one go

lament agate
#

it doesnt look good

red flower
#

it's less annoying

lament agate
#

valid

#

but yeah, that

red flower
#

yeah you can just randomize G.GAME.current_round.reroll_cost in that hook

lament agate
red flower
#

no, in that same hook replace all the cost stuff for that

#
local original_calculate_reroll_cost = calculate_reroll_cost
function calculate_reroll_cost(...)
    local cost = original_calculate_reroll_cost(...)
    if next(SMODS.find_card("j_tngt_dealmaker")) then
        G.GAME.current_round.reroll_cost = pseudorandom('dealmaker_reroll', 1, G.GAME.current_round.reroll_cost + 100)
    end
    return cost
end
lament agate
#

thanks

red flower
#

no idea

lament agate
#

local cost_dt = 0
local oldgameupdate = Game.update
function Game:update(dt)
    local g = oldgameupdate(self, dt)
    if G.shop and G.jokers and next(SMODS.find_card("j_tngt_dealmaker")) then
        cost_dt = cost_dt + dt
        if cost_dt > 0.2 then 
            cost_dt = cost_dt - 0.2
            for i, v in ipairs({G.shop_jokers, G.shop_vouchers, G.shop_booster}) do
                for ii, vv in ipairs(v.cards) do
                    vv:set_cost()
                end
            end
        end
    end
    return g
end
#

i have this for the joker itself

red flower
lament agate
#

what do i add in here

#

G.GAME.current_round.reroll_cost?

red flower
#

yes

#

this

lament agate
#

sure

lament agate
#

should i put this code to the deck too

#

that code is only in the joker data rn

red flower
#

i mean i dont know how your code is structured or what you want to do

tepid crow
#

anyone who understands why Thunk wrote it like this? (it's how the Ox determines the most played hand)

if G.GAME.blind:get_type() == 'Boss' then
    local _handname, _played, _order = 'High Card', -1, 100
    for k, v in pairs(G.GAME.hands) do
        if v.played > _played or (v.played == _played and _order > v.order) then 
            _played = v.played
            _handname = k
        end
    end
    G.GAME.current_round.most_played_poker_hand = _handname
end
red flower
#

you mean the order part?

tepid crow
#

yea

maiden phoenix
#

If you got hands with equal plays I think it takes the highest one?

red flower
#

he probably wanted to give you the hand with the lowest order if tied but he either forgot or removed it

tepid crow
#

wait isn't the ordering from pairs undefined btw

red flower
#

yes

tepid crow
#

oh so in case of a tie it's just... random

maiden phoenix
#

Isn't order called to prevent that?

tepid crow
#

no _order never gets redefined

red flower
#

yeah and also seems device dependent

maiden phoenix
#

oh

red flower
#

the order would solve that

tepid crow
#

Yeah, okay. Funny

red flower
violet gull
# violet gull ohh omg that works

using hand_chips * mult means for blinds that cap score like the tax, it triggers as true every hand because the chips and mult are above the blind but is then capped later

is there a way to work around that

lament agate
#

doesnt work

#

multiple times

red flower
#

lemme see

lament agate
# red flower lemme see
local cost_dt = 0
local oldgameupdate = Game.update
function Game:update(dt)
    local g = oldgameupdate(self, dt)
    if G.shop and G.GAME.current_round.reroll_cost and next(SMODS.find_card("j_tngt_dealmaker")) then
        cost_dt = cost_dt + dt
        if cost_dt > 0.2 then 
            cost_dt = cost_dt - 0.2
            for i, v in ipairs({G.GAME.current_round.reroll_cost}) do
                for ii, vv in ipairs(v.cards) do
                    vv:set_cost()
                end
            end
        end
    end
    return g
end
red flower
#

that doesnt make sense

lament agate
#

oh really?

#

fuck

#

how to do it then

red flower
#

do you want to keep the random card cost stuff

#

or just the reroll cost

lament agate
pure salmon
#

ok i’ve made my new suit give mult instead of chips, how do i change the ability box to display “+X mult” instead of “+X chips”?

red flower
# lament agate reroll only
local cost_dt = 0
local oldgameupdate = Game.update
function Game:update(dt)
    local g = oldgameupdate(self, dt)
    if G.shop and next(SMODS.find_card("j_tngt_dealmaker")) then
        cost_dt = cost_dt + dt
        if cost_dt > 0.2 then 
            cost_dt = 0
            G.GAME.current_round.reroll_cost = pseudorandom('dealmaker_reroll', 1, G.GAME.current_round.reroll_cost + 100)
        end
    end
    return g
end
crisp coral
midnight coyote
#

does find_card check every card area

lament agate
#

thanks

red flower
#

so consumables and vouchers too i think

midnight coyote
#

ah alright

#

so can i SMODS.find_card('c_temperance') and get away with it

red flower
#

i think so

midnight coyote
#

ill just test

red flower
#

but its a try and find out moment

midnight coyote
#

this is what im doing

#

ill see if it works

red flower
#

idk how check for unlock works but doesnt it only check when it's called

midnight coyote
maiden phoenix
#

Pro coding tip if you got a bool check that goes if .. return true else return false you can just shorten it to one line, going return next(SMODS.find_card...

midnight coyote
#

yeah it works fine

old hull
#

Anybody know how to make custom rarities for Jokers? Specifically for the shop.

red flower
old hull
#

Thanks!

near heart
#

probably fairly obvious and simple answer to this question: how do i make a joker using a probability based event like business card? when i look at the code it uses pseudorandom with the name of the joker, but how can i define my own probability like this (if i need to)?

red flower
#

(also I recommend vanillaremade to look at vanilla code)

near heart
#

k thanks ill look into that

jolly shadow
midnight coyote
#

i may change my random calls to this

red flower
#

last smods release

midnight coyote
#

ah

red flower
#

also people are working on a bunch of cool stuff with this so you defo should

#

or it wont be compatible

midnight coyote
#

okay cool ill migrate it in my next commit

#

let me finish this joker and ill comb through and change stuffs

red flower
#

there's documentation in the last release notes

midnight coyote
#

okay cool

#

right now im scratching my head at something

#

i need to see all of the unscored cards in my hand

#

in a played hand

#

i mean

#

i was thinking of iterating over played hand AND scored hand to see if they match up then putting them in a different table?

red flower
#

yeah, theres a helper for that SMODS.in_scoring(card, context.scoring_hand)

midnight coyote
#

that makes it way easier

#

i was gonna do some nested for loop shenanegans

normal crest
#

hi

red flower
#

i mean this basically does that

#

hi srockw

midnight coyote
normal crest
#

🍪

midnight coyote
#

alright

final monolith
#

I've done a little bit of snooping around the files and I noticed the music files are all sped up, has anyone talked about this?

red flower
#

yes, the game slows them down. to save space i think?

near heart
lament agate
#

@manic rune i need your help

manic rune
#

hi

lament agate
#

i want it to be activated when theres that joker

#

but it just leaks into a jokerless run

manic rune
#

damn thats a lot of ui code

#

sob

lament agate
#

ITS JUST TEXT THO

gaunt thistle
#

5 kb of UI code

lament agate
#

hey atleast it worked

manic rune
#

oh, i think i know hy

#

why

high stag
#

SO I'm trying to make a Tag that makes a mega pack of my custom boosters, but when I use it the game crashes and gives me this

functions/common_events.lua:2301: attempt to index local 'center' (a nil value)

    key = "occ_tag",
    loc_txt = {
        name="Rite Tag",
        text={
            "Gives a free",
            "{C:attention}Mega Occult Pack",
        },
    },
    atlas = "occ_tag",
    pos = { 
        x = 0, 
        y = 0 
    },
    apply = function(self, tag, context)
        if context.type == 'new_blind_choice' then
            local lock = tag.ID
            G.CONTROLLER.locks[lock] = true
            tag:yep('+', G.C.PURPLE, function()
                local booster = SMODS.create_card { key = 'p_tg_occocc_m_booster_1', area = G.play }
                booster.T.x = G.play.T.x + G.play.T.w / 2 - G.CARD_W * 1.27 / 2
                booster.T.y = G.play.T.y + G.play.T.h / 2 - G.CARD_H * 1.27 / 2
                booster.T.w = G.CARD_W * 1.27
                booster.T.h = G.CARD_H * 1.27
                booster.cost = 0
                booster.from_tag = true
                G.FUNCS.use_card({ config = { ref_table = booster } })
                booster:start_materialize()
                G.CONTROLLER.locks[lock] = nil
                return true
            end)
            tag.triggered = true
            return true
        end
    end
}```
The code's built from the Vanilla Rebuild charm tag since the boosters work like arcana packs
lament agate
manic rune
#

try using if G.jokers and next(SMODS.find_card("j_tngt_autocorrect")) then

#

if im not wrong, SMODS.find_card returns a table? 🤔

lament agate
#

IT WORKED

#

holy jesus

#

i thought im fucked

#

tysmmmmmmm @manic rune

midnight coyote
#

@red flower is SMODS.destroy_cards a new thing?

red flower
#

yes somewhat

midnight coyote
#

holy shit theres alot of new functions

#

i need to like

#

learn these

#

all of these

#

does it work on jokers?

#

if it works on jokers this is huge

red flower
#

yes, it checks eternal too

midnight coyote
#

oh my god

#

i feel like a kid on christmas

midnight coyote
#

and context.joker_type_destroyed??
oMGGGG

#

opirtjnmgoignjowerhwouigfwr

#

THIS FIXES A CARD I HAVE

high stag
#
    name = "Occult Pack",
    key = "occ_m_booster_1",
    kind = "occult",
    atlas = "occ_pack",
    pos = { 
        x = 2, 
        y = 1 
    },
    config = { extra = 7, choose = 2},
    cost = 8,
    weight = 1,
      draw_hand = true,
      unlocked = true,
      discovered = true,
    set = "Booster",
    group_key = "occult_pack",
    loc_txt = {
        name="Mega Occult Pack",
        text={
            "Choose {C:attention}#1#{} of up to",
            "{C:attention}#2#{C:spectral} Occult{} cards to",
            "be used immediately",
        },
    },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.config.center.config.choose, card.ability.extra } }
    end,
    ease_background_colour = function(self)
        return ease_background_colour_blind(G.STATES.SPECTRAL_PACK)
    end,
    create_card = function(self, card, i)
        return {
            set = "occult",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = false
        }
    end
}```
near heart
red flower
manic rune
near heart
#

this is literally the first joker im making so bear with my incompetence

high stag
#

prefix is tg_occ

lament agate
#
function calculate_individual_effect(card, context)
    local ret = original_calculate_individual_effect(card, context)
    if ret and G.jokers and next(SMODS.find_card("j_tngt_autocorrect")) then
        if ret.mult then
            ret.xmult = (ret.xmult or 1) * (1 + (ret.mult or 0)/100)
            ret.mult = nil
            if not ret.message then
                ret.message = localize{type = 'variable', key = 'a_xmult', vars = {ret.xmult}}
                ret.colour = G.C.MULT
            end
        end
    end
    
    return ret
end
#

this somehow doesnt do anything

#

did i fuck something up

manic rune
red flower
manic rune
#

holy

#

wait does that include consumables

red flower
#

yes

manic rune
#

:3 why is it called joker_type then

#

but thats very cool

red flower
#

consumables are a joker-type

manic rune
#

-# damn you only had to send a file 😭

red flower
#

but i dont like the name either

high stag
#

i forget it shows the content of txts

red flower
#

it doesnt seem to be able to find the key

#

make sure the prefix is correct

midnight coyote
#

oops

red flower
manic rune
#

its SMODS.calculate_individual_effect

red flower
high stag
#

OH it adds the _ at the end of the prefix automatically this explains so much

#

thank you

midnight coyote
#

i cant tell if this is a card sleeves problem or a me problem

#

i call SMODS.destroy_cards to wipe unscored cards but when i check my full deck card sleeves crashes

red flower
#

dont use that to destroy during scoring

#

use context.destroy_card

midnight coyote
#

im checking for a condition in one context

lament agate
midnight coyote
# near heart

first off, dont use that ancient header, please use a metadata file instead

red flower
midnight coyote
#

so just mark it for death pretty much

manic rune
midnight coyote
manic rune
#

its 11 PM for me

#

anyways

red flower
# near heart

you're using really old syntax, please use a newer example mod as a base

lament agate
#

figured it out

midnight coyote
#

yeah there is a lot of old syntax here

lament agate
near heart
#

yeah thats mb i copied bbbalatro as a base since its the first one i found

manic rune
#
local ref = SMODS.calculate_individual_effect
function SMODS:calculate_individual_effect(card, context)
  local ret = ref(self, card, context)
  --code in here...!!!
  return ret
end
lament agate
#

thank youu!!!!!

red flower
#

@near heart

near heart
#

k will try

#

thanks

midnight coyote
#
if context.destroy_card then
            
            for k,v in ipairs(context.full_hand) do
                if context.full_hand[k].marked_for_death then
                    SMODS.destroy_cards(context.full_hand[k])
                end
            end
        end

    end
#

like this?

manic rune
#

that seems wrong

lament agate
manic rune
#

-# i meant that to basil

lament agate
#

oh

#

well both works

#

ANYWAYS

midnight coyote
red flower
manic rune
#

and returning remove = true will mark them to be destroyed

red flower
#

this is in the docs :3

midnight coyote
#

sorry

manic rune
#

.

#

wait actually

sonic cedar
midnight coyote
#

it still does

manic rune
midnight coyote
#

the same thing

manic rune
#

you got all the arguments right??

lament agate
#

..pretty sure

midnight coyote
#

i feel like this is a card sleeves issue

lament agate
#

threw a trash bag

midnight coyote
#

let me see if card sleeves has an update

lament agate
#

LMAO

#

BAHAHAHAHA

#

oh my god

#

ether way

manic rune
#

i just checked and i see it having 5 arguments 😭

lament agate
manic rune
#

I WAS

#

REFERENCING FROM YOUR CODE

lament agate
#

WHEN

manic rune
#

😭

lament agate
#

[podqwgbjnpokuhqc

manic rune
#

i thought YOU got it correct already...

midnight coyote
#

yep

#

card sleeves is outdated

#

LMAO

lament agate
sonic cedar
#

modding dev is the second funniest channel on this server i swear

manic rune
#

leaning

lament agate
lament agate
sonic cedar
manic rune
#

friend

#

pal

#

look at your local ret = ..., carefully

lament agate
#

....

#

can you tell i havent slept for 2 days

sonic cedar
#

wtf are you doing

manic rune
#

yes

lament agate
lament agate
sonic cedar
lament agate
#

ill FIX this first

manic rune
#

local ret = ref(self, effect, scored_card, key, amount, from_edition)

#

thats all

#

i thought you knew how to hook already nxkoo 😭

lament agate
#

IM

#

IN A VERGE

#

OF LOSING IT

#

i DO know

manic rune
#

yeah

sonic cedar
#

😭

lament agate
#

oiuy7tfdgvhbjwkqpo8u9y78yguvhjbkcnwklm;l,q[spkopi9u89hbijkcwlqs

#

thnks

#

ill try

sonic cedar
lament agate
sonic cedar
lament agate
#

ARE YOU SURE

lament agate
#

fuck

manic rune
#

wuh

lament agate
#

the crash did not copy

#

im killing myself

manic rune
#

sob

sonic cedar
#

oh i know that pain

manic rune
#

oh but also

sonic cedar
#

i did it here before and i just didnt say shit

manic rune
#

im pretty sure what you are doing for your code rn doesnt work

#

the hook works, but the code isnt correct

lament agate
manic rune
#

SMODS.calculate_individual_effect() always returns a bool value

lament agate
#

so just need to fix it?

manic rune
#

mhm

lament agate
#

dfghjkoploiou9o8y7t6r57edrycghjlknml'lo0i98768t5e46we5sre3w4q23waesdfghjjklm.,/,l;opiou8y7tufydrxfzhuyt675r64e3w4q2awrextfcghvhjbjnj bnvbcxdfrtyuhbm bvghfdtesrdxcvbn.8y78tyufc sxs465t87y98upok;lm,

sonic cedar
lament agate
#

my forehead is imprinted with keyboard

sonic cedar
#

encryption.....inscr.... WOAHcat

lament agate
#

toma

#

cease breathing

sonic cedar
#

yes boss

manic rune
#

nxkoo DIES in approximately 12 minutes, 30 seconds and 113 ms later.

sonic cedar
#

what about the other 25 letters

lament agate
#

WHAT

hardy viper
#

how many nanoseconds vro...

sonic cedar
#

3

manic rune
#

uh

#

2

sonic cedar
#

1

manic rune
#

light sway on the horse's back

hardy viper
#

does this mean somethign

lament agate
#

you know what

#

im lucky im unemployed for now

#

i got some

#

times

hardy viper
#

i would hate to be employed

sonic cedar
#

can confirm as someone employed

lament agate
#

I NEED TO BE EMPLOYED

#

I NEED MONEY