#💻・modding-dev

1 messages · Page 190 of 1

manic rune
#

anaxa and castorice kits r getting reworked a lot lol

#

anaxa just got his kit leaked yesterday and its already getting reworked

#

😭

red flower
#

i usually ignore leaks because i dont understand game mechanics until i play with them

manic rune
#

and theres no way to work around that

#

since its a fixed percentage

#

oh wait i just realized something

#

the name should be a dynatext object

red flower
#

if you put it in the localization you can just call localize and it will make it for you

manic rune
#

oh, so stuff in 'name' is automatically converted into DynaText i assume?

red flower
manic rune
#

thats very convenient, thank

polar marlin
#

what are yall using to do the coding part?

red flower
#

vscode

polar marlin
#

whats that

#

this is my first time ever touching code/mods

red flower
#

It's a popular code editor

manic rune
#

arguably the most popular and versatile one

#

ok maybe notepad is more versatile

#

❤️

polar marlin
#

okay wait, heres a better question, how do i start putting the code to work the joker?

#

i have the .lua file

#

made in notepad

manic rune
#

uhh

#

just type in the code

#

❤️

polar marlin
#

do i just use the code from smods jokers

#

oh wait actually?

#

its that easy?

manic rune
#

yeah it is

polar marlin
#

well shit

hot island
#

you might wanna start out learning some basic lua if you wanna add functionality and stuff

manic rune
#

^

polar marlin
#

im just gonna pray it works gnag

hot island
#

like if this is your first time programming you should start with the basics instead of trying to skip to the end and getting overwhelmed

paper zealot
#

Crawl before you can walk before you can run before you can fly

hot island
#

bars

manic rune
#

absolute cinema

#

breezebuilder cooked

#

🗣️

polar marlin
#

i just want to atleast see my silly boykisser joker in the game even if it doesnt work

plush cove
#

genuinely baffled on how LocalThunk didn't already have a function for this and just coded it manually for every food joker

hot island
plush cove
polar marlin
manic rune
#

agreed

polar marlin
#

ill let yall know how it goes

hot island
#

it is but if all you want is to see it in game then its much easier than learning to program

polar marlin
#

im going to learn how to program watch me

hot island
#

alrighty

#

good luck

polar marlin
#

uhh nvm

#

i just remembered im stupid

#

yeah ima just modify a different joker then

#

a premade joker

#

how would i do that?

wintry solar
#

@graceful magnet sorted

polar marlin
#

do i just find the card in the balatro files?

hot island
polar marlin
#

yeah but... im also pretty stupid

graceful magnet
polar marlin
#

like beachball mentality

hot island
polar marlin
#

editing an existing

wintry solar
#

oh shit I have pinged the wrong person sorry

#

@spring lantern sorted

graceful magnet
hot island
#

open the exe with 7zip

polar marlin
#

okay how do i get 7zip T-T

graceful magnet
graceful magnet
polar marlin
#

internet

#

thanks

plush cove
#

Internet

hot island
polar marlin
#

i went on the 7zip website

hot island
#

are you on windows

polar marlin
#

yea

#

i downloaded it

hot island
#

alright now install it

polar marlin
#

now how would i open the game with 7zip

#

i did that

hot island
#

right click the balatro exe

#

and open with 7zip

polar marlin
#

okay

high stag
#

A much easier to implement deck

--- Gambler Deck
--- Gain no money from beating Blinds
--- Gain no Interest
--- All cards are Lucky
------------------------------
SMODS.Back{
    name = "GamblerDeck",
    key = "gamblerDeck",
    atlas = 'tgmp-other',
    pos = {
        x = 1,
        y = 0,
    },
    config = {},
    loc_txt = {
        name = "Gambler Deck",
        text = {
            "{C:attention}Blinds{} give no reward money",
            "Earn no {C:attention}Interest{}",
            "All cards are {C:attention}Lucky{}",
        }
    },
    apply = function()
        
        G.E_MANAGER:add_event(Event({
            func = function()
                for i = #G.playing_cards, 1, -1 do
                    G.playing_cards[i]:set_ability(G.P_CENTERS.m_lucky)
                end
                G.GAME.modifiers.no_blind_reward = G.GAME.modifiers.no_blind_reward or {}
                G.GAME.modifiers.no_blind_reward.Small = true
                G.GAME.modifiers.no_blind_reward.Big = true
                G.GAME.modifiers.no_blind_reward.Boss = true
                G.GAME.modifiers.no_interest = true
                return true
            end
        }))
    end
}```
hot island
#

do you know how to find the exe

manic rune
#

it almost works now

polar marlin
#

no

manic rune
#

just that there seems to be a white box

hot island
polar marlin
#

yeah

hot island
#

right click it on steam and click browse local files

polar marlin
#

no pirating here

#

okay

#

i got it

rose dragon
manic rune
hot island
random sleet
#

eremel i stole them look /s
guess i cant have this thing queue up rustys
-# net's down here so sorry for the picture of a screen

polar marlin
hot island
#

then go to resources/textures/

red flower
polar marlin
#

im there

hot island
#

and open one of the folders

polar marlin
#

okay

rose dragon
polar marlin
#

got it

hot island
#

and edit jokers.png

manic rune
hot island
#

just paste it into the spot of the joker you wanna replace

manic rune
polar marlin
#

oh aight

hot island
#

and do that for 1x and 2x

polar marlin
#

how would i change the properties of a card tho?

manic rune
#

...oh wait, i can probably just remove the .config.color line

polar marlin
#

in theory

hot island
#

you would need a mod for that or to edit the game files

wintry solar
rose dragon
hot island
#

which is a lot more work

manic rune
hot island
hot island
polar marlin
#

fuck.

red flower
polar marlin
#

i bearly even know how to play the game

hot island
#

if you wanted to change the joker name you can edit that in the localization folder

red flower
#

i dont know how to play balatro, that's not a requirement for modding

manic rune
#

wonderful, it works, thanks :D

hot island
#

just ctrl+f the joker you replaced with your boykisser or whatever

#

and replace it with what you want

polar marlin
#

where in the localization files do i change it

hot island
#

en-us.lua is english

manic rune
#

does it look like a normal joker's description now?

polar marlin
#

oh thanks

hot island
#

make sure to only replace the text in quotes

#

if you replace anything else itll fuck it up

manic rune
#

hmmmmmmmmmmmm

#

is this how i get a joker's loc_vars?

#

i have no clue

#

💔

#

im just gonna do a workaround to be sure

polar marlin
#

alright i changed some stuff yall wanna see?

manic rune
#

nvm, hm

#

i thought changing specific_vars would allow me to do #1# stuff

manic rune
#

oh im dumb, figured it out

polar marlin
#

alright nevermind it doesnt work

#

plus it was stupidly immature and a reflection of my anger

#

alot of racism i would say

hot island
#

damn 😔

polar marlin
#

the way this game is coded makes me angry as fuck

manic rune
#

💀

#

relatable

polar marlin
#

makes me want to kill something

manic rune
#

yeah uhhh

#

wait

#

i SOMEHOW

#

made my type cursor weird

polar marlin
gaunt thistle
#

well... yeah

manic rune
#

like, it turned into a box and it starts overwriting letters

gaunt thistle
#

it's not a great first programming project

#

ok I wouldn't go thaaaaat far

#

but big projects like this are never super clean

polar marlin
#

i was bored and wanted to turn jimbo into a boykisser to release my anger

gaunt thistle
#

interesting method

manic rune
#

its definitely better than yandere simulator imo, i would say the code readability is on par with undertale

random sleet
#

me when i make random ortalab compat in my mod because funny

gaunt thistle
#

localthunk is very talented :-)

manic rune
#

mhm

polar marlin
#

The thought of local thunk angers me

polar marlin
#

like no hate, but all hate

manic rune
#

it cant seriously be that deep 😭

gaunt thistle
#

damn that's a big opinion to have for someone who doesn't really know the codebase :-/

#

let's not trash lt, he's great

polar marlin
#

not saying hes bad

#

the code angers me immensly tho

#

like wdym i cant name the blueprint "penis"?

#

i am angry

#

and i wish to take it out on the cards

manic rune
#

i feel like the same could apply for basically every game's code, unless you are directly involved with the development then you would have to spend quite a while learning how everything works in the code

polar marlin
#

the jokers

gaunt thistle
#

idk what makes you so mad about it

polar marlin
#

jimbo

#

jimbo is number one opp now

manic rune
#

and honestly, we should be glad that localthunk actually didnt make his code too complex

polar marlin
#

fair enough

manic rune
#

else it would gatekeep quite a lot of modders

polar marlin
#

yea

gaunt thistle
#

you probably don't even need to touch real code to do what you want to do

#

just an asset mod and a localization change

polar marlin
#

it at one point was more than just a asset mod

scarlet spire
#

I knew absolutely nothing about lua until I started balatro modding and i've been learning pretty well

polar marlin
#

it was an actual custom joker

manic rune
#

lua is really easy to learn ngl

polar marlin
#

and then i realized im stupid

manic rune
#

false

random sleet
#

i started coding with lua like 13 years ago ??? lmao

manic rune
#

i started coding in Roblox studio, its basically lua but a bit more convenient

gaunt thistle
#

yeah it's not a bad language to learn on

#

it's just weird

manic rune
#

mhm, after learning lua you actually start to question some other languages

#

like, you automatically assume if statements to have "end'

#

and then some languages dont have it

red flower
#

what do you mean

manic rune
#

the next thing i need to learn next is adding another button to a joker

#

hm

#

shouldn't be that hard

wintry solar
#

Buttons aren’t too bad, you can reuse a lot of what is already there

red flower
#

I wasn't replying to that lol, what do you need from the code

#

this is for the shop

#

yw

plush cove
#

question: is this code for Sleepy Joker's Nightmare function optimized like at all?

#

what it's meant to do is detect if the player also has Scary Face, and if so, destroy the card and create awake joker

#

and I feel like this is the simplest solution but i'm not sure if it's flawed at all

normal crest
#

It depends on what your destroy joker function does

plush cove
#

this is it (add_event is basically just the same thing as G.E_MANAGER:add_event)

normal crest
#

Btw food jokers in vanilla don't dissolve when they're "eaten"

plush cove
normal crest
#

I don't remember exactly what start_dissolve does but make sure it handles removing the joker from the cardarea

#

Otherwise if it works it works

#

Idk about setting card to nil tho

plush cove
grim remnant
#

for whatever reason, if you use this while having more than 1 negative card, it actually shrinks the amount of joker slots you have. what're we missing here?

    key = 'dissociate',
    set = 'Spectral',
    loc_txt = {
        name = 'Dissociate',
        text = {
            "{C:dark_edition}+1{} Joker Slot"
        }
    },
    loc_vars = function(self, info_queue, card) --make colors exist
        return { vars = { colours = {HEX('CE001F')}} } end,
    atlas = 'Tarot',
    pos = { x = 2, y = 0 },
    cost = 3,
    can_use = function(self, card, area, copier)
        return true -- you're always allowed to use this, of course
        end,
    use = function(self, card, area, copier)
        G.jokers:change_size(1) --BUG: this just breaks HARD if you have negatives
        play_sound(timpani)
    end,
}```
normal crest
#

Does it shrink when you sell the negatives

gusty sequoia
#

How do I make juice up actually work, because for me it just crashes because it's nil

gusty sequoia
normal crest
#

put juice_card = card instead

gusty sequoia
#

Okie

#

I'll go test that rq

grim remnant
gusty sequoia
plush cove
#
        G.E_MANAGER:add_event(Event({func = function()
            if G.jokers then 
                G.jokers.config.card_limit = G.jokers.config.card_limit + 1
            end
            return true end }))```
#

@grim remnant

minor furnace
#

I may not have solved the issue of hands not scoring at all when they contain an Omnirank card, but I at least optimized this function :/

    if best_hand then
        for _, v in ipairs(G.handlist) do
            if next(current_hand[v]) then return current_hand
            elseif next(best_hand[v])then return best_hand end 
        end
    else
        return current_hand
    end
end```
grim remnant
minor furnace
#

I think I need somebody to sanity check my code, because I don't know what would be causing my return from my get_best_omnihand() to differ from the output format of evaluate_poker_hand(), considering the omnihand function uses that evaluate function as its calculation

#

If I sent the code would someone be willing to review it?

grim remnant
#

how can we make a consumable that can target either 1 joker or 1 playing card, but not both at the same time? (for that matter, how do you just, Select 1 Joker in the first place?)

red flower
#

anyone knows what this could be? outdated lovely?

gaunt thistle
#

it's hard to tell without a full log. there's a good chance that they have 0.7.0 and need to update to latest.

#

I fixed that specific bug in 0.7.1 iirc

red flower
#

ty I'll tell that to them
honestly i hate troubleshooting through github issues

fathom thunder
#

does anyone know why it shows up as "j_melo_scribbal" instead of just "Scribbal" it's copying itself in which it's not supposed to and i think this is why

fathom thunder
#

figured that i didnt need to post any code since it'd probably just be a matter of me missing some info that i had to put in the table but

SMODS.Joker{
    key = "scribbal",
    loc_txt = {
        name = "Scribbal",
        text = {
            "When blind is selected,",
            "randomly copies one of",
            "your {C:attention}Jokers' abilities{}.",
            "{s:0.75}Currently copying: {C:attention}#1#{}"
        }
    },
    rarity = 3,
    atlas = "Jokers",
    pos = {x = 0, y = 0},
    config = { 
        extra = {
            copying = "None",
            instCopy = nil
        }
    },
}

excluding all the functions cuz that just makes it really long

plush cove
grim remnant
#
        if #G.hand.highlighted == 1 or #G.jokers.highlighted == 1 then
        return true
        end,```
well, this isn't working. uh. how do we do this? (it's MEANT to be an exclusive or, but we're taking this one step at a time here)
fathom thunder
plush cove
fathom thunder
#

alr

plush cove
#

replace [KEY OF COPIED JOKER] with card.ability.extra.copying

red flower
grim remnant
red flower
#

you're missing an end

normal crest
#

I am once more begging you to get an IDE that can tell you of your syntax errors

grim remnant
#

okay, almost there. uh. we understand roughly how for loops work now, but how exactly do we clarify two things for it? (this isn't crashing, but it is ignoring jokers altogether here.)

        for i = 1, #G.hand.highlighted or #G.jokers.highlighted do --for the first card or joker highlighted (of only 1, of course)...
            local highlighted = G.hand.highlighted[i] or G.jokers.highlighted[i] --set that 1 card or joker highlighted to local variable highlighted.```
normal crest
grim remnant
#

do we like, swap jokers and hand highlighted then, or will that just cause the reverse problem?

normal crest
#

That will cause the same problem but reversed yes

#

What exactly is your use function meant to do

grim remnant
#

it is supposed to take either 1 playing card, or 1 joker, but not both 1 playing card AND 1 joker

red flower
#

because of your condition in can_use you don't need a loop because it's always 1

you can do
local highlighted = #G.hand.highlighted == 1 and G.hand.highlighted[1] or G.jokers.highlighted[1]

normal crest
#

^ if you had a joker and a playing card highlighted that condition above would prioritize the playing card

red flower
#

you will need to change can_use to an exclusive or like you said

#

yeah

paper zealot
grim remnant
#

so, this is how we learn lua actually lacks an xor keyword innately. Which. Wild.

lucid owl
#

is there a context called when cards are destroyed? like how canio has a condition that activates when face cards are destroyed

normal crest
#

context.remove_playing_cards

stray warren
lucid owl
normal crest
#

it is called one time with a list of all destroyed cards in context.removed

red flower
#

can we ask for balatro to be remade in php

grim remnant
normal crest
# graceful magnet huh?

funniliy enough, that Eremel mention to you was related to what you were struggling with like two weeks ago with a joker that depended on playing cards added

#

this

normal crest
#

so that behaviour was fixed, if it's still relevant to you

#

if perhaps you gave up on the joker temporarily

graceful magnet
grim remnant
plush cove
normal crest
fathom thunder
# plush cove did that fix it?

no, but i found just simply adding name = "Scribbal" fixed it, i had to find some other solution for it copying itself
new issue though if you don't mind, this is a sort of blueprint-like ability i guess, and i got it working somewhat, jokers like say gros michel with joker_calculate work perfectly fine, however something like lusty joker doesn't and I don't know why, i simply copied the blueprint code from old blueprint from cryptid

if context.joker_main then
    other_joker = card.ability.extra.instCopy
    if other_joker and other_joker ~= card then
        context.blueprint = (context.blueprint and (context.blueprint + 1)) or 1
        context.blueprint_card = context.blueprint_card or card
    
        if context.blueprint > #G.jokers.cards + 1 then
            return
        end
    
        local other_joker_ret, trig = other_joker:calculate_joker(context)
        if other_joker_ret or trig then
            if not other_joker_ret then
                other_joker_ret = {}
            end
            other_joker_ret.card = context.blueprint_card or card
            other_joker_ret.colour = G.C.BLUE
            other_joker_ret.no_callback = true
            return other_joker_ret
        end
    end
end

i think it has to do with the fact that jokers like lusty joker for example dont have anything related to calculate_joker but I don't know what exactly I'd use otherwise

normal crest
#

And make sure to save a reference to context.blueprint_card before doing that

#

So you can use it in other_joker_ret.card

grim remnant
candid willow
#

is there a context for a joker just sitting in the joker area or would I just set it to true?

normal crest
normal crest
grim remnant
normal crest
#

I guess you changed the can_use function from the last time you sent that screenshot

#

can you send your entire use function

candid willow
#

I'm trying to make a joker that has no active effects, simply increases the number of cards one can highlight when applying Lucky to a set of given cards

normal crest
candid willow
#

fml

grim remnant
# normal crest can you send your entire use function

for context, we were able to nab an xor function from a stackoverflow thread and just used that in can_use. literally it's just this:

if a ~= b then return true else return false end
end```
which is used like so:
```    can_use = function(card)
        if xor( #G.hand.highlighted , #G.jokers.highlighted ) then
        return true
        end
    end,```
normal crest
#

and then you can check next(SMODS.find_card(your joker key here)) to check if the player has your joker

fathom thunder
# normal crest So you can use it in other_joker_ret.card

elaborate a bit please? cuz i did just that but it's still not working unless i misunderstood

local other_joker_ret, trig = other_joker:calculate_joker(context)
local other_joker_cbc = context.blueprint_card
context.blueprint = nil
context.blueprint_card = nil
if other_joker_ret or trig then
    if not other_joker_ret then
        other_joker_ret = {}
    end
    other_joker_ret.card = other_joker_cbc or card
    other_joker_ret.colour = G.C.BLUE
    other_joker_ret.no_callback = true
    return other_joker_ret
end
manic rune
#

yeah so uhh, managed to get the description swapping stuff working

red flower
manic rune
#

is there any examples for jokers with another button below SELL?

red flower
#

so there's this mod called joyousspring that has cards with extra buttons

normal crest
manic rune
#

joyousspring my beloved

normal crest
#

you can pretty much reference all the blueprint behavior from the vanilla code

grim remnant
manic rune
#

(what card to be more specific? 😭)

red flower
manic rune
#

wonderful, thanks 🙏

fathom thunder
normal crest
#

it's either nil or true

#

in the base game

candid willow
normal crest
#

I don't think shopping center has a patch

#

But feel free to use any of the patches in paperback as a reference

#

Ideally look in the beta branch of it too, cus the version in the main branch is a bit old

fathom thunder
normal crest
#

try copying the vanilla blueprint code as it is

#

just make sure to change self for card

fathom thunder
#

still nothing

paper zealot
grim remnant
#

is this for can_use because our problem lies with the actual use function

#

since, filling this out and adding the "else" debug message, it now does. Absolutely nothing. implying the only reason it was only buffing jokers initially is because jokers were listed last.

normal crest
#

can you send the entire use function and define what the problem is exactly

grim remnant
#

for the ENTIRE use function, see this

paper zealot
# paper zealot Apply your brain! ```lua if xor( #G.hand.highlighted , #G.jokers.highlighted...

Further to this, what you're actually checking here is if the number of highlighted cards is not equal to the number of highlighted jokers.
What you want to check is if only one card is highlighted. So:

can_use = function(card)
    if #G.hand.highlighted == 1 and #G.jokers.highlighted == 0 then
        return true
    elseif #G.jokers.highlighted == 1 and #G.hand.highlighted == 0 then
        return true
    end
end,
hot island
red flower
paper zealot
#

Don't just copy the code, try to understand what it's doing and why

grim remnant
#

we get that, but like, we don't need an elseif in the can_use, =~ was basically just doing the xor operand we wanted

paper zealot
#

It was checking if the number of selected joker and playing cards was unequal

#

So it would still be valid if you'd selected 4 playing cards and 5 jokers, but not if you'd selected 4 of each

normal crest
#

Or a more vanilla like example, if you selected 2 playing cards and 1 joker

candid willow
#

what is G.jokers?

normal crest
#

the card area where the jokers go

candid willow
normal crest
#

not quite, you can indeed check if your joker is in the area to apply your effect outside of its calculate function and such

#

but you still need to find the part where the game determines how many cards magician can turn into lucky and modify them

candid willow
#

couldn't I just use take ownership to do that?

grim remnant
# paper zealot It wasn't checking for what you wanted it to check for

okay, that makes sense, but it isn't fixing the use function, which is currently valid for only 1 or the other, but it's doing absolutely nothing; fixing can_use, while helpful, wasn't what we were after, and now it's just doing absolutely nothing to the valid targets. and adding end to the end of the if condition is just doing this.

yes we downloaded an IDE. yes we debugged and tried end, end end, end, end, end end, and all it got was a bunch of syntax errors.

normal crest
#

that'd unconditionally make all magicians have a different value

raven tusk
#

i'm working on a mod with my friend (i have no clue how to code but he doesnt own a copy of balatro on pc so i'm basically testing everything for him), so i dont know how to access the source code or the code of certain jokers. would anyone be able to help me figure out how, because i cant find anything on the internet (that or i'm just not understanding)

grim remnant
fathom thunder
paper zealot
normal crest
#

That doesn't feel like a very helpful IDE

candid willow
fathom thunder
raven tusk
#

would i need to copy it somewhere as to not explode my game

#

ah wait

candid willow
#

you can always just reverify the integrity of your files if you screw up the game but yeah

grim remnant
raven tusk
#

ah yeah i figured it out

#

thank you guys <3

normal crest
#

There is an extra comma in that line

#

That shouldn't be there

#

Also unless you set it up properly (if it even has the option to) that IDE might not be helpful at all

grim remnant
normal crest
#

You have more syntax errors

#

Further down in your code it seems

grim remnant
#

line 1003 is the end that's meant for the use function.

normal crest
#

The "end" on line 1002 is the issue

grim remnant
#

...oh my god is it seriously just because we forgot to remove the end when removing the for loop like an hour ago

#

We are going to become the joker, and because of the game we are modding, this is literal.

candid willow
#

lmao

paper zealot
candid willow
grim remnant
#

okay. so uh. significantly less intense of a question, is there an equivalent to G.hand:unhighlight_all() but for jokers

paper zealot
#

I'd never heard of ZeroBrane, but check to see if it has a way to auto-format and auto-indent your code

normal crest
#

Just replace hand with jokers

grim remnant
normal crest
#

you put _ instead of :

plush cove
#

ok so

is it more efficient to:

A. have a global table that contains all of my functions, load it once, and just keep indexing it

or

B. make that same table local, and run this in every file I want to use it

lucid owl
#

seems like zerobrane is a lua-specific IDE for reference

grim remnant
#

okay, THERE we go.

lucid owl
#

how would one modify prices of items in the shop?

normal crest
plush cove
normal crest
#

I wouldn't know about that, but just keep in mind that if in your utils file you have anything other than just function definitions, for example, a hook, that will cause issues

plush cove
weak gate
#

how do I watch a shader with debugplus?

normal crest
#

G.shop_jokers.cards[1].cost = x, shop_jokers can be shop_vouchers, shop_boosters

#

I am not actually too sure about shop_jokers

weak gate
#

ahh
watch shaders Mods/mymod/assets/shaders/myshader.fs

paper zealot
#

Whichever does the least number of lookups is the most efficient, but usually good organisation is worth a very slight loss in efficiency. It's rare that the need for efficiency trumps the importance of organisation.
Keeping it all in a global table is fine for organisation, though if you were doing MyMod.mistiutils.anotherobject.yetanotherobject.function() dozens of times every frame, then those lookups are going to be expensive, and at that point you might want to refactor that code to improve the performance.

Also, instead of using NFS.load to load it yourself, you can instead load the file as a module with Lovely and require it like so:

lovely.toml:

[[patches]]
[patches.module]
source = 'src/moveable_container.lua'
before = 'main.lua'
name = 'systemclock.moveablecontainer'

Then local moveable_container = require('systemclock.moveablecontainer') where necessary.
require is smart enough to check if the code has already been run, and to return the existing instance instead of a whole new one.

#

It also makes small patches easier, as you can just access the required module directly:

[[patches]]
[patches.pattern]
...
payload = '''
    tab_definition_function = require('systemclock.config_ui').create_config_tab
end
'''
plush cove
candid willow
#

within a joker, i should say

normal crest
#

you do not hook "within" a joker

#
local level_up_hand_ref = level_up_hand
function level_up_hand(card, hand, instant, amount)
  -- your code before

  local ret = level_up_hand_ref(card, hand, instant, amount)

  -- your code after
  return ret
end

this is an example of a hook

#

on a global function

raven tusk
#

if i have an econ joker that resets after a boss blind is there any way to make it so the reset comes after the cash out?

gaunt thistle
#

excellent advice breeze

lucid owl
#

this makes all shop items (except rerolls) free which is intended, but that only takes effect after buying a booster pack of some kind - when you get to the shop from the end of a blind everything is still normally priced. is there an issue with contexts? i basically copied the code of the coupon tag but i don't see why it's not taking effect right away

paper zealot
# candid willow can someone show me an example and/or breakdown of a hook pls

In Lua, everything is a variable and all variables can be changed at runtime.
First it's good to be aware that

function level_up_hand(card, hand, instant, amount)
``` is actually just shorthand for:
```lua
global level_up_hand = function(card, hand, instant, amount)
```and you can change what `level_up_hand` is at any time.

So if there's a function like `level_up_hand(...)` declared before your code, and you declare `level_up_hand(...)` again, then anytime `level_up_hand` is called, it'll be running your new function instead.

To make a hook, if you first copy a reference of the original function:
```lua
local level_up_hand_ref = level_up_hand
```then declare your own:
```lua
function level_up_hand(card, hand, instant, amount)
```and call the old function inside your new one:
```lua
local return_value = level_up_hand_ref(card, hand, instant, amount)
``` then you've effectively made a wrapper around the original function where you can do things immediately before or immediately after the original function, like this:
[#💻・modding-dev message](/guild/1116389027176787968/channel/1233186615086813277/)

You can also modify the original arguments before they're passed to the original function:
```lua
amount = 1000
``` or replace the original function's return value
```lua
return_value = 'something completely different'

The most important thing to remember is that because you're completely replacing all the calls of that function, you need to ensure that your replacement function also returns a value if the original one did!

return return_value
fathom thunder
candid willow
bold gyro
#

I'm trying to get the ceiling of current chips for a Joker, and I have Talisman installed. I'm finding this to be a troubling combo, as Talisman makes hand_chips a table, and math.ceil does not like tables. Is there an alternative ceiling calculation function? Otherwise, how do I retrieve current chips such that both hand_chips and math.ceil behave nicely together?

fathom thunder
raven tusk
#

thank you again

fathom thunder
raven tusk
#

hmm

minor furnace
#

why on earth does enhancing my card change hands_played_at_create to 3

#

and add a field for order = 22

primal iron
#

apologies if this is a dumb question haha, but how would i get "Joker to the right", i.e index of 'card' + 1?

minor furnace
fathom thunder
#

of course replacing joker with whatever its supposed to be

#

speaking of blueprint im gonna crash out if i dont figure this out

primal iron
fathom thunder
foggy carbon
#

so this works as intended, but how would I be able to edit the edition of the joker before placing it

minor furnace
#

I solved the issue of hands containing omnirank cards not scoring

#

turns out, creating a deep copy of the played hand was actually causing issues, because when comparing the cards played vs the cards that count towards scoring, it checks for equality by comparing the pointers, not the actual contents of the card

#

I though I was being clever by making a copy so I didn't accidentally manipulate the real cards in an unwanted way, but that was what was causing the problem in the first place

candid willow
#

are all of the game's objects global?

marble flint
#

kinda? just about everything is accessible indirectly via a global, but depending on the thing it's more or less annoying

#

most functions are simply globally scoped, though (or like, G.whatever which is basically the same thing)

candid willow
#

so I can just hook into a tarot card like so?

marble flint
#

nnnno

opal spade
#

tarot cards are not functions

marble flint
#

you should look through the game's code for a little bit, i recommend searching for "magician" across the files

opal spade
#

SMODS take_ownership

lucid owl
#

also to clarify something with hooks - they're defined outside of jokers, right? so if i wanted to hook set_cost() this would be how i do it, outside of any joker code?

candid willow
#

im going to become jimbo

opal spade
#

what are you trying to do

candid willow
#

create a Joker that modifies the behavior of the Magician, increasing the number of cards you can apply Lucky to at a time from 2 to 4

#

i feel like I'm constantly flailing and hearing conflicting things from different people about how to do something that should be extremely simple and so very little of it makes sense

lucid owl
opal spade
lucid owl
marble flint
#

you're allowed to do a lot of Very Illegal things in lua

candid willow
plush cove
marble flint
plush cove
marble flint
plush cove
opal spade
#

it's simple to do if you know how the game works but I'd recommend doing simpler things first or reading more code

marble flint
#

so in that table, magician has something in config for the limit

#

that needs to be changed in the finished card objects (it ends up in ability)

opal spade
frosty dock
#

it's not too bad to do with take_ownership without changing the on-use behavior

normal crest
#

Does anyone know how to update the text of a blind on the blind selection screen

#

Like changing the shown score value

frosty dock
candid willow
#

I dont need a context for before using a consumable, I just need a context for the joker effect to be active as long as it is in g.jokers

marble flint
candid willow
#

once you're done making Lucky cards, you can just discard the Joker and the ability to make more Luckys with only one Magician goes away

frosty dock
candid willow
#

you can only make 2 luckys again

frosty dock
#

so just doing can_use is good enough for working properly

#

might also need to update it in loc_vars so it displays correctly though

candid willow
#

can you point me in the general direction of can_use's description so I have an idea of what you're talking about

normal crest
#

So I am lost

opal spade
#

I'll check rn

normal crest
#

yeah I ran this and it made it again

#

But I don't know if they're stacking

#

Doesn't seem like the previous UI is getting removed so I'm afraid calling that might lag the game.. but who knows

#

if you have any other ideas please do share

opal spade
#

when changing values in the boxes u need to recalculate the UI element for it to update

normal crest
#

How would one do that

opal spade
#

looking at my own older ui code it should be just :recalculate() on the root node

#

running that should update all the text and stuff

normal crest
#

Oh that does work

#

Now how likely is it that another mod messes with the structure of the UI

#

and all the children indexing I did gets messed up

opal spade
#

what's the thing that distinguishes the node you want to replace from all the other nodes

#

you could write a function that looks for that

normal crest
#

It seems the only distinguishable thing about it is that it has the score of the boss blind

#

I wish it had an id

normal crest
#

engine/ui.lua

opal spade
#

yeah

runic pecan
#

Which rarity should this one be?

minor furnace
#

Insane thing: I patched out the get_straight() from the smods override so that the original get_straight()from the base game would be active, and now my Omnirank cards are correctly being identified in straights and scoring properly

#

also, the goofiest looking straight you will ever see

#

goofy straight flush

#

this feature is now working as I intended it to, aside from the joker interactions which I need to add

runic pecan
candid willow
normal crest
#

can_use should be a function that returns true if it can be used, false otherwise

#

the parameters are (self, card) where card is the actual consumable card

candid willow
#

thank you

iron iron
#

im making an econ joker where the payout is halved after the boss blind is defeated, but this doesnt work. what should i be doing instead

minor furnace
#

Imagine writing docstrings

normal crest
#

Does it not execute

iron iron
#

it just goes to 0

normal crest
#

Add and context.main_eval

iron iron
#

it just crashes now

normal crest
#

did you do main.eval accidentally

rose dragon
sturdy compass
iron iron
rose dragon
paper zealot
stiff locust
#

trying to make an effect that gives +1 card selection limit, but after running
G.hand.config.highlighted_limit = G.hand.config.highlighted_limit + 1
I am able to select 6 cards, but I cannot play all 6 of them. I'm guessing I am missing a step that makes you able to play hands with more than 5 cards?

normal crest
#

Probably whatever function decides whether the play button is enabled or not

#

I don't know where it is tho, maybe UI definitions

faint yacht
shadow rapids
#

me: has a blind idea to debuff rarer jokers
me: oh wow, a cool idea for a blind! I hope no other mods have this blind!
cryptid mod pin blind:

spring lantern
normal crest
#

Thanks ere mel

#

for fixing local thunks code

spring lantern
#

still baffled that these spectrals returned {true}

#

like i get it probably made implementing hologram 1% easier but damn 😭

wintry solar
#

Yeah I do t understand why they were like that, the jokers at least made sense for timing animations

bold gyro
#

I have Talisman installed, and I'm trying to get the ceiling of current chips for a Joker. I'm finding this to be a troubling combo, as Talisman makes hand_chips a table, and math.ceil does not like tables. How do I get the current chips from hand_chips as a value?

wintry solar
#

I imagine there’s some talisman function you need to use instead of math.ceil

stiff locust
#

how do I check the mod a card is from again

bold gyro
stiff locust
rose dragon
#

is there a guide to lovely patches? the lovely-injector page is lacking
-# 98%

bold gyro
spring lantern
#

i hate how G.C.EDITION goes into this bright yellow, should i just have it be no color?

long sun
#

Try G.C.FILTER?

humble girder
#

{C:dark_edition} exists

#

(and is used for editions everywhere)

long sun
#

Ya that :D

spring lantern
#

like it's meant to represent negative while G.C.EDITION is for the others

#

does look way better of course so ima just keep it either way

humble girder
#
c_aura={
    name="Aura",
    text={
        "Add {C:dark_edition}Foil{}, {C:dark_edition}Holographic{},",
        "or {C:dark_edition}Polychrome{} effect to",
        "{C:attention}1{} selected card in hand",
    },
},```
spring lantern
#

ahh ic

#

quick question how do i access a card's edition again?

humble girder
#

btw with the old joker calcs page gone from the smods wiki I'm pretty sure there's currently no page that exactly describes the order in which contexts are evaluated

humble girder
spring lantern
#

right was it like this? my memory is so ass lmao

humble girder
#

no, it's a table

#

card.edition and card.edition.key == X

spring lantern
#

there ya go thx

#

i always forget the most basic stuff

humble girder
#

also due to vanilla things, card.edition.holo also works

halcyon osprey
#

Anyone have a guide to begin making your own balatro mod cause i tbh, have no clue what i am doing

spring lantern
#

uh... are playing card retriggers off by default now too or am i doing this wrong?

spring lantern
halcyon osprey
#

Ive gotten Steamodded

#

dunno what to do after xD

spring lantern
#

then just check through the wiki, there's documentation and guides on how to set things up

halcyon osprey
#

Ooh oki

spring lantern
runic pecan
#

How do my sprites look?

spring lantern
#

absolute fire

#

home run

#

off the park

rose dragon
spring lantern
#

meanwhile this the kinda shit im doin

humble girder
spring lantern
#

ohh shit alright thx

#

it's not doing the thing, am i stupid?

runic pecan
#

individual and repetition is now separated

spring lantern
#

oops

#

makes sense

#

it now does the thing, thank you

warm sphinx
#

How would you go about making a joker that just adds a .3 mult every round to it?

#

I still trying to firgue this stuff out

manic rune
#

I FINALLY GOT THE BUTTON WORKING 😭

manic rune
rose dragon
#

why isn't this patch changing the tooltip?

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "elseif _c.name == \"The Hermit\" then loc_vars = {_c.config.extra}"
position = "at"
payload = "elseif _c.name == \"The Hermit\" then loc_vars = {_c.config.extra*(G.GAME.investment_mult or 1)}"
match_indent = true
warm sphinx
#

I been trying to firgue this out for about 4 days

manic rune
warm sphinx
#

I had a silly idea and went out of my way to try to firgue all this stuff out

manic rune
#

im pretty sure it documents all the contexts

warm sphinx
#

Ooooo

#

The hardest part for me now is most likely trying to find a way to make a joker run a python script now

manic rune
#

...run a python script?

warm sphinx
#

I had a really stupid idea for a joker that basically has a chance to jumpscare and this is the best idea I had so far to make it work

#

And I already messed something up again

warm sphinx
#

Is there a way to make a simple way to tell what I can delete so there isnt a bunch of extra stuff?

runic pecan
wintry solar
runic pecan
#

So you need[[patches]] [patches.pattern] target = "functions/common_events.lua" pattern = "elseif _c.name == \"The Hermit\" then loc_vars = {cfg.extra}" position = "at" payload = "elseif _c.name == \"The Hermit\" then loc_vars = {cfg.extra*(G.GAME.investment_mult or 1)}" match_indent = trueinstead.

rose dragon
#

thx

warm sphinx
#

My brain is overloading I have zero clue what I doing again

#

Would anyone maybe be free to vc to help me understand what I doing?

#

I deleted something and now its crashing

#

Is it ment to say (Currently Xnil Mult) ?

bold gyro
warm sphinx
#

I broke the joker

#

It now gives only a .3 mult but still does gives a 1.3 I think

#

It is in fact giving a 1.3 mult

#

4 to 5.2

manic rune
warm sphinx
#

I trying this with a mod with a lot less text to try to set this up right and I feel like I getting further and further from what I trying to do

manic rune
#

can you send your code over here

stiff locust
stiff locust
#

send your code i'll run through it

warm sphinx
#

I just sent it to bepis

manic rune
#

the best way to get someone to help you with your code is sending it here, since all we can do is assuming rn

manic rune
warm sphinx
#

config = { extra = { XmultGain = 1.3, Xmult = 1, containsSpade = false } },
rarity = 3,
atlas = '',
pos = { x = 0, y = 0 },
cost = 10,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.XmultGain, card.ability.extra.Xmult } }
end,
calculate = function(self, card, context)
if context.using_consumeable then
if context.consumeable.ability.set == "Spectral" then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.XmultGain
return { message = "Upgraded!" }
end
end
if context.individual and context.cardarea == G.play then
if context.other_card:is_suit("Spades") then
card.ability.extra.containsSpade = true
end
end
if context.joker_main then
if context.poker_hands['Flush'] and card.ability.extra.containsSpade then
card.ability.extra.containsSpade = false
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
Xmult_mod = card.ability.extra.Xmult
}
end
end
end
}

#

I just using this to try and set up the mult right

stiff locust
#

and what about your localization

manic rune
#

oh i see whats wrong

#

#1.3#

warm sphinx
#

Wait thats wrong?

manic rune
#

yeah

warm sphinx
#

I just trying to get it to go up by .3 each time

manic rune
#

its supposed to be a whole number, corresponding to the order of the variable you want it to represent

stiff locust
#

when you return values in loc_vars

#1# refers to the first value, #2# refers to the second, etc

warm sphinx
#

So you mean the 2 didn't need to change to

manic rune
#

mhm

stiff locust
#

the number just denotes which variable it's displaying

manic rune
#
--- STEAMODDED HEADER
--- MOD_NAME: Meg Of Spades
--- MOD_ID: mos_card
--- PREFIX: mos
--- MOD_AUTHOR: [Crossu]
--- MOD_DESCRIPTION: Meg jokersona
--- LOADER_VERSION_GEQ: 1.0.0
--- VERSION: 1.0.0
--- BADGE_COLOR: 8839ef

SMODS.Atlas {
    key = "MegOfSpades",
    path = "MegOfSpades.png",
    px = 71,
    py = 95
}

SMODS.Joker {
    key = 'meg',
    loc_txt = {
        name = 'Bunny',
        text = {
            'When a {C:attention}Flush{} is played with',
            '{C:spades}Spade{} cards, {X:mult,C:white} X#1# {} Mult per',
            '{C:spectral}Spectral{} card used this run',
            '{C:inactive}(Currently {X:mult,C:white} X#1.3# {}{C:inactive} Mult){}'
        }
    },
    config = { extra = { XmultGain = .3, Xmult = 1, containsSpade = false } },
    rarity = 3,
    atlas = 'MegOfSpades',
    pos = { x = 0, y = 0 },
    cost = 10,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.XmultGain, card.ability.extra.Xmult } }
    end,
    calculate = function(self, card, context)
        if context.using_consumeable then
            if context.consumeable.ability.set == "Spectral" then
                card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.XmultGain
                return { message = "Upgraded!" }
            end
        end
        if context.individual and context.cardarea == G.play then
            if context.other_card:is_suit("Spades") then
                card.ability.extra.containsSpade = true
            end
        end
        if context.joker_main then
            if context.poker_hands['Flush'] and card.ability.extra.containsSpade then
                card.ability.extra.containsSpade = false
                return {
                    message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
                    Xmult_mod = card.ability.extra.Xmult
                }
            end
        end
    end
}
#

this is their entire code

#

they didnt send the loc_txt part so yeah

warm sphinx
#

So that fixed that problem

stiff locust
#

oh you'll want to split localization at some point

warm sphinx
#

Now I need to firgue out how to make it do it at the end of each round and not for just hands and stuff

stiff locust
#

having your localization in a separate file makes it easier to translate

warm sphinx
#

Localitzation?

stiff locust
#

the text on the joker

warm sphinx
#

Oh

stiff locust
#

everything inside loc_txt is the localization

#

but with using loc_txt, the text cannot be translated

#

you can automatically set up a localization file with smods

#

remove all other content mods (keep your mod, its dependencies if any, and smods) then put "dump_loc": true in your .json mod file (or smods header if you're still using that)

#

then open and close balatro

warm sphinx
#

So thats what a json was in there for

stiff locust
#

no

#

the json tells smods info about your mod

warm sphinx
#

Oh

stiff locust
#

the mod name, ID, prefix, main file, version number, the authors, the description, its dependencies

stiff locust
#

after you do this, your mod folder will have a localization folder with a dump.lua file inside it

warm sphinx
#

Why is it now going straight from 1 to 2.3 and not going up to 1.3

stiff locust
#

change the name of that to default or en-us and then remove all loc_txt from your mod and then make sure you change dump_loc back to false or remove it from your metadata file and you're done

warm sphinx
#

So I renaming localization to default?

stiff locust
#

no

#

the dump.lua file it creates

#

inside the localization folder it also creates in your mod folder

#

change the name of that to default or en-us

warm sphinx
#

I having a hard time understanding sorry!

#

I'm super new to all this and I honestly getting super confused

stiff locust
#

it's alright

#

you only gotta do this once, after that you can copy paste stuff

warm sphinx
#

Would it be alright to vc so I might be able to understand a bit better?

stiff locust
#

i can't immediately but a bit later sure

warm sphinx
#

Thank you

stiff locust
#

brb

rose dragon
#

first patch!!1111
-# ignore less than mediocre artwork
-# also ignore that i forgot to include "when used"

wintry solar
#

That’s not how doubling works

stiff locust
#

i return

#

yeah that's scaling quadratically or smthn

rose dragon
#

like mult

frosty dock
#

that's just linear scaling

#

just say you're adding the base value

warm sphinx
#

I feel like I gonna lose my mind with this

stiff locust
#

you'll be fine

neat plover
#

is the misprint predict something thats possible to access?

stiff locust
#

brb again

rose dragon
spring lantern
frosty dock
neat plover
rose dragon
frosty dock
#

if you want to phrase it that way, it gains one multiplier to the base value

rose dragon
# spring lantern what we thinkin of this one

i think the card eval status should be on the joker, not the card
if you are going to keep the eval status on the playing cards, i think you should make it so that after the eval status is shown it destroys the card, instead of all at once

frosty dock
#

Increase maximum values on
The Hermit and Economy Tag
by X1
(Currently X2)

warm sphinx
#

I got the card to go up by .3!!!!

sweet nimbus
#

In a custom deck, is it possible to force bosses like Ante 1: The Hook, Ante 2: The Mouth? So that it's the same every run

humble girder
wintry swallow
#

heyo, is there a way to have an order of events when a joker is triggered? Like a message first and then an action or smth. I'm trying to mess around with the event stuff but it doesn't work

spring lantern
humble girder
#

canio on steroids

neat plover
#

yeah

spring lantern
#

if you have a source to pump out steel/gold cards this could go insane i reckon

humble girder
#

well consider this

#

it's under on the rarity for sure

spring lantern
#

i totally forgot midas mask exists

#

wow

#

that's quite

humble girder
#

canio only counts card being destroyed after it pops into existence, you naturally set up for this joker from ante 1 because you want to put steel/gold on cards that aren't desirable to play anyway

spring lantern
#

WAIT IT'S MEANT TO BE LEGENDARY LOL

#

why does it say uncommon

humble girder
#

rarity = 4

spring lantern
#

yea i goofed up

wintry solar
warm sphinx
#

I'm nervous to remove anythign to try to make this go off each round

stiff locust
#

if your joker code breaks, the worst you'll get is a crash

#

fuck around and find out

shadow rapids
#

how do i make my mod talisman-compatiable?

warm sphinx
#

So maybe I should save a copy and then mess with it

#

I do have areally odd question through

#

what is these green things?

halcyon osprey
#

i think im just dumb but also ive never used Lui, and adding all these variabled even looking at the steamodded stuff, im just confused 😭 but im trying to make a joker that Scores xmult on every diamond, but also Increase said xmult for each diamond scored

stiff locust
warm sphinx
#

Notepad++

stiff locust
#

use vscode with the lua plugin

warm sphinx
#

Its the only one I really know anything about

#

Vscode?

shadow rapids
#

probably diffs

stiff locust
#

visual studio code

#

shortened to vscode

warm sphinx
#

Ohhh

shadow rapids
#

is it possible to force my mod to load after talisman without neccessarily requiring it to be installed

red flower
#

put a priority lower than talisman's

shadow rapids
#

ok

#

does talisman auto-convert numbers returned from calculate functions

stiff locust
#

talisman converts G.GAME.chips and G.GAME.dollars

shadow rapids
#

not mult?

warm sphinx
#

I changed one line of stuff and deleted other stuff and already crashed it

stiff locust
shadow rapids
#

like?

stiff locust
#

.

#

it's an expression

shadow rapids
#

oh ok

stiff locust
#

the mult given by a joker should not be going anywhere near that high

#

how are you the chosen one

shadow rapids
#

oh i thought you meant in general

stiff locust
#

i think it also converts the current chips and mult i forgot those

#

that's all it does

shadow rapids
#

ok

warm sphinx
#

Ok I changed a single line and it worked (started up)

stiff locust
warm sphinx
shadow rapids
#

whats the main way to detect if talisman exists

#

is it if tobig then

stiff locust
#

no

#

one sec

warm sphinx
#

Whats a boolean value?

wintry swallow
neat plover
#

ill ask again: how does the misprint access the cards drawn next turn

stiff locust
#

misprint doesn't

shadow rapids
#

joker or deck

#

i know theres a misprint deck in cryptid

wintry swallow
stiff locust
#

it's just true or false

wintry swallow
#

yeah in the code

#

yeah better way to show it

neat plover
stiff locust
#

what do you mean misprint, the joker that randomly gives between 0 and 23 mult, predicts the cards drawn next turn

neat plover
#

in the garbled text you can see the next card drawn

shadow rapids
#

wait what

neat plover
#

its an easter egg

stiff locust
#

what the fuck

shadow rapids
#

haow

#

one sec

stiff locust
#

since when???

shadow rapids
#

i need to check the localisation files

neat plover
#

try it

stiff locust
#

i will not be trying it i'll take your word for it

warm sphinx
#

Now the card is suddenly jumping up 1.5

shadow rapids
#

fudging. the localisation for it is empty

warm sphinx
#

4 to 5.5 to 7.6 ???

stiff locust
#

yeah the misprint code is elsewhere

wintry solar
warm sphinx
#

9.7

shadow rapids
#

jasp

daring dirge
#

im making a mod with new decks and i wanted to be able to remove certain tarot cards / booster packs from appearing, how would i do that

warm sphinx
#

Ok something I did broke it

stiff locust
#

i can vc now

shadow rapids
#

line 776 of card.lua

#
                    {string = 'rand()', colour = G.C.JOKER_GREY},{string = "#@"..(G.deck and G.deck.cards[1] and G.deck.cards[#G.deck.cards].base.id or 11)..(G.deck and G.deck.cards[1] and G.deck.cards[#G.deck.cards].base.suit:sub(1,1) or 'D'), colour = G.C.RED},```
warm sphinx
#

Add

wintry swallow
wintry solar
#

What a strange idea

wintry swallow
#

yeah

#

but it's what i wanna do

#

for fun

shadow rapids
#

do any of yall know how to detect if talisman is active

#

new question: does talisman make hand_chips a bigg

#

well only one way to find out

daring dirge
shadow rapids
#

i know you can take ownership of different features

#

i got hit with a crash

edgy mountain
#

this returns some really weird values

#

its supposed to give just the nominals

#

when discarding one card, it returns 10 times the value

#

if you discard more, the value is completely wrong

#

it goes into the thousands quick

wintry solar
#

Discard is called on every card

#

You want context.pre_discard

shadow rapids
#

also youre not returning

wintry solar
#

You don’t need to return

shadow rapids
#

also can i have some help debugging my joker?

    calculate = function(self, card, context)
        if context.joker_main then
            if Big then
                return {
                    chips = hand_chips:pow(0.5),
                    card = card
                }
            end
            return {
                chips = math.sqrt(hand_chips),
                card = card
            }
        end
    end```
this crashes with talisman, but only when scoring animations are enabled. it says its comparing a number with a table
wintry solar
#

Delete talisman problem solved 🙃

edgy mountain
shadow rapids
#

i dont want to add "conflicts" = ["talisman"] thoughhh

opal spade
#

notepad++ is fine

paper zealot
bold gyro
shadow rapids
#

uiuua mention???

#

UIUA MENTUION!!!!!!

#

UIUA UIUA UIAU UIUA UIAU

shadow rapids
#

wait is hand chips just from planet cards or is it the current running total

bold gyro
#

current running total

shadow rapids
#

sooo is there any way to fix the crash without resorting to risking an infinity or just banning talisman from my mod

wintry solar
#

You don’t have to design your mod around talisman existing

shadow rapids
#

well i want it to at least function with it

#

please

runic pecan
#

Common or Uncommon?

runic pecan
prisma loom
#

So, the upper block gets executed and my Joker gains xMult (all good here)
but the lower block gets ignored. Is there a way to make code not ignore it?

#

(without for loop or whatever its called)

#

cuz idk how to do it

manic rune
#

use only one context.scoring_hand, and use or instead

shadow rapids
#

fool, youre returning

#

one return executes the function exits

prisma loom
shadow rapids
#

thats taking the hearts return if you have any hearts

#

and ignoring the diamonds, etc

#

because the function has already eturned

manic rune
#

if suits["Hearts"] > 0 or suits["Diamonds"] >0 then

prisma loom
#

oh wait

manic rune
#

the other suits should also have the > 0

prisma loom
#

I forgor

manic rune
#

but yes, that should work

prisma loom
#

(under calculate)

#

this whole wall of text is supposed to to take into account wild cards

#

when scoring

prisma loom
unkempt thicket
#

try if statements instead of elseif

runic pecan
prisma loom
#

that's literally how its coded

raw geyser
#

I'm making a booster pack with forced items, and now there's lots of green squares everywhere... anyone know why?

runic pecan
# prisma loom Is context correct?

Also you can use SMODS.has_enhancement(context.scoring_hand[i],'m_wild') instead of context.scoring_hand[i].ability.name == 'Wild Card'.

runic pecan
prisma loom
#

just the condition line?

runic pecan
#

Wait, I didn't notice it'd be longer.

prisma loom
#

could I merge blocks tho?

#

if I use this line

humble girder
runic pecan
manic rune
#

or am i understanding it wrong 💀

runic pecan
#

Yeah, I'd rather +1 to every suit in the list if it's a Wild card.

manic rune
#

also, i would have a table with all of the suits name ngl

humble girder
#
    for suit, _ in pairs(SMODS.Suits) do
       suits[suit] = (suits[suit] or 0) + 1
    end
end```
#

accounts for custom suits, works with wild cards

runic pecan
manic rune
#
local Suits = {"Hearts", "Diamonds", "Clubs", "Spades"}

for i,v in pairs(Suits) do
  for d = 1, #context.scoring.hand do
    if context.scoring.hand[d]:is_suit(v) and suits[v] == 0 then
      suits[v] = 1
    end
  end
end

#

basically that

#

i forgot to account for the wild card

humble girder
#

don't ignore custom suits :v

manic rune
#

but you can see how its much shorter

manic rune
runic pecan
manic rune
#

i forgot

#

💔

humble girder
#

I guess you can still make an util function and use only the vanilla suit data if that's all you care about

manic rune
#

thanks ❤️

prisma loom
humble girder
#

thing is, this doesn't work with cards that aren't all suits

#

like suit seals from unstable

#

so yeah i guess it'd be like

prisma loom
#

my processing power is 1 comment per hour
be kind with me folks

manic rune
#

just take it slow lol

#

sometimes i have to reread ppl's feedback for like 5 times to actually understand it 😭

raw geyser
#

Can anyone help me find out why this is happening?

humble girder
#
for suit, _ in pairs(SMODS.Suits) do
    if context.scoring_hand[i]:has_suit(suit) then suits[suit] = (suits[suit] or 0) + 1 end
end```
manic rune
#

its a booster pack bug, im sure

runic pecan
manic rune
#

...since i got it before

raw geyser
#

So much confetti, T-T

manic rune
#

thats a lot of jirachi

humble girder
#

and using that snippet you don't even need to handle default cards and enhanced cards differently

#

in fact that should work with any mod for any purpose forever

manic rune
#

thats neat, thank you wise man

minor furnace
#

Me on my way to patch every single rank-based joker in the name of making these abominations functional

humble girder
#

🙈

manic rune
#

what the fuck is that rank

#

😭

raw geyser
#

Just make it rip off the corners, XD

minor furnace
raw geyser
#

It's rank is "Yes"

manic rune
#

baldi last question ahh rank 😭

humble girder
minor furnace
#

I already have it correctly playing the hand it should

wintry solar
#

Nah we’re hard coding the shit out of this card

manic rune
#

we love hard coding around here

humble girder
#

it is very much in the spirit of vanilla i'll give you that

runic pecan
#

Speaking of hardcoding, here's an example of my latest joker:

manic rune
#

23.76

#

thats an oddly specific number, but alright

minor furnace
#

considering basically every rank-based joker calles either get_id() or is_face() and there isn't already an is_rank() I think I actually must patch every joker individually

runic pecan
# manic rune thats an oddly specific number, but alright

#hololiveclips
#hololiveclip
#ホロライブ切り抜き

https://en.wikipedia.org/wiki/Gomoku
Gomoku, also called Five in a Row, is an abstract strategy board game. It is traditionally played with Go pieces (black and white stones) on a Go board. It is played using a 15×15 board while in the past a 19×19 board was standard. Because pieces are typically not mo...

▶ Play video
manic rune
#

seems quite good for early game too

prisma loom
humble girder
minor furnace
#

this is true

manic rune
humble girder
minor furnace
#

anis_rank() that takes an array of values and returns true if one of them matches would be nice

manic rune
#

ohhhh so thats the reference

humble girder
#

output is suits{} has any suit that appeared at least once as key

manic rune
#

thats neat, i will save the video for relistening later

humble girder
#

value is the times it appeared

runic pecan
manic rune
strong jacinth
#

Yo

humble girder
#

so you can check if it ever appeared with if suits.Hearts or if suits['Hearts'], get its value, w/e, just don't forget to check for nil (you have to add an extra for loop if you want to convenience-initialize each possible suit to 0)

manic rune
#

are you the suits guy baliame

#

you seem to know a lot about suits

strong jacinth
#

Does anyone here know how to get the card value

minor furnace
manic rune
humble girder
strong jacinth
manic rune
humble girder
#

four fingers

#

the queen is not scored

manic rune
#

oh, right

minor furnace
#

yes it is

#

because the longest straight you can form includes the queen

manic rune
#

i actually never used a straight build before so i straight up forgot its existence 💀

humble girder
#

hold up, does the queen actually get scored?

#

it's not supposed to if it's a straight flush

manic rune
#

9 J Q A

#

it seems so

#

i dont think you can get a straight with 9 J A A unless some dark magic is involved here

runic pecan
#

These are so cursed, I like them.

minor furnace
manic rune
#

oh

#

so are they like uhhh

#

wild cards, but for ranks?

humble girder
#

card.base.nominal if so

manic rune
#

ngl i like the idea of just straight up ripping the corners, i think someone said that earlier

strong jacinth
humble girder
#

no

limpid halo
#

Just a nibble off the top

humble girder
#

it's a 7 if card.base.value == '7'

manic rune
#

is that the same as :get_id()?

humble girder
#

also i guess card:get_id() == 7 works as well

manic rune
#

also, is that 7 supposed to be a string

humble girder
#

should be, but i have absolutely no idea if you can have conflicting ids or values

#

yes

manic rune
#

💀

#

thats confusing

humble girder
#

it's not if you consider a jack

manic rune
#

my half activated ass would immediately forget that and ask why it doesnt work

#

😭

minor furnace
#

I do have one last issue with these cards (aside from the joker compatibility which I should be able to handle). But because of my current implementation, it's internally technically a different enhancement for each suit. But I've just realized that if I use, say, a Wolrd Tarot on one of them, the suit will change but the sprite will not

humble girder
#

<jack>:get_id() == 11 and <jack>.base.nominal == 10 and <jack>.base.value == 'Jack'

#

pick your poison

limpid halo
#

:(

manic rune
#

yeahhhhhhhhh no, get_id() is clearly the superior here

#

💔