#💻・modding-dev
1 messages · Page 190 of 1
i usually ignore leaks because i dont understand game mechanics until i play with them
mostly because his kit is a bit too rng, 64% to inflict a debuff (i wont go further than that, unless ur interested) on a lv 95 enemy
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
if you put it in the localization you can just call localize and it will make it for you
oh, so stuff in 'name' is automatically converted into DynaText i assume?
yes
thats very convenient, thank
what are yall using to do the coding part?
vscode
It's a popular code editor
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
yeah it is
well shit
you might wanna start out learning some basic lua if you wanna add functionality and stuff
^
im just gonna pray it works gnag
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
Crawl before you can walk before you can run before you can fly
bars
i just want to atleast see my silly boykisser joker in the game even if it doesnt work
genuinely baffled on how LocalThunk didn't already have a function for this and just coded it manually for every food joker
then just edit the textures of another joker
(this specific iteration was cannibalized from a mix of JenLib, Ortalab and Paperback <3)
thats boring
agreed
ill let yall know how it goes
it is but if all you want is to see it in game then its much easier than learning to program
im going to learn how to program watch me
uhh nvm
i just remembered im stupid
yeah ima just modify a different joker then
a premade joker
how would i do that?
@graceful magnet sorted
do i just find the card in the balatro files?
hey theres some pretty simple lua tutorials out there
yeah but... im also pretty stupid
huh?
like beachball mentality
are you talking adding a new joker or editing an existing joker
editing an existing

open the exe with 7zip
okay how do i get 7zip T-T
it is most definitely easier to make a new one than edit an existing one
Internet
Internet
i went on the 7zip website
are you on windows
alright now install it
okay
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
}```
do you know how to find the exe
no
just that there seems to be a white box
you have it on steam?
yeah
right click it on steam and click browse local files
open the exe with winrar
how would i remove this box?
now open the exe with 7zip
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
got it
then go to resources/textures/
whats ur code
im there
and open one of the folders
okay
the badge?
got it
and edit jokers.png
just paste it into the spot of the joker you wanna replace
nope, you can actually see another box in the joker's description
oh aight
and do that for 1x and 2x
how would i change the properties of a card tho?
...oh wait, i can probably just remove the .config.color line
in theory
you would need a mod for that or to edit the game files
oh this is just jank from when loc_txt updated that I haven't been bothered to change 🤣
change the card.ability.extra
which is a lot more work
nope, still the same
theyve never programmed before they have no idea what that means
like youd need to learn lua and how balatro works and shit
fuck.
try passing true to desc_from_rows as the second value
i bearly even know how to play the game
if you wanted to change the joker name you can edit that in the localization folder
i dont know how to play balatro, that's not a requirement for modding
wonderful, it works, thanks :D
oh aight
just ctrl+f the joker you replaced with your boykisser or whatever
and replace it with what you want
where in the localization files do i change it
en-us.lua is english
does it look like a normal joker's description now?
oh thanks
make sure to only replace the text in quotes
if you replace anything else itll fuck it up
hmmmmmmmmmmmm
is this how i get a joker's loc_vars?
i have no clue
💔
im just gonna do a workaround to be sure
alright i changed some stuff yall wanna see?
yep
oh im dumb, figured it out
alright nevermind it doesnt work
plus it was stupidly immature and a reflection of my anger
alot of racism i would say
damn 😔
the way this game is coded makes me angry as fuck
makes me want to kill something
It angers me because ive never coded before
well... yeah
like, it turned into a box and it starts overwriting letters
it's not a great first programming project
ok I wouldn't go thaaaaat far
but big projects like this are never super clean
i was bored and wanted to turn jimbo into a boykisser to release my anger
interesting method
its definitely better than yandere simulator imo, i would say the code readability is on par with undertale
me when i make random ortalab compat in my mod because funny
it's pretty good considering it's > 100k loc
localthunk is very talented :-)
mhm
The thought of local thunk angers me
like no hate, but all hate
it cant seriously be that deep 😭
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
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
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
the jokers
idk what makes you so mad about it
and honestly, we should be glad that localthunk actually didnt make his code too complex
fair enough
else it would gatekeep quite a lot of modders
yea
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
it at one point was more than just a asset mod
I knew absolutely nothing about lua until I started balatro modding and i've been learning pretty well
it was an actual custom joker
lua is really easy to learn ngl
and then i realized im stupid
false
i started coding with lua like 13 years ago ??? lmao
i started coding in Roblox studio, its basically lua but a bit more convenient
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
what do you mean
the next thing i need to learn next is adding another button to a joker
hm
shouldn't be that hard
Buttons aren’t too bad, you can reuse a lot of what is already there
I wasn't replying to that lol, what do you need from the code
this?
this is for the shop
yw
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
It depends on what your destroy joker function does
Btw food jokers in vanilla don't dissolve when they're "eaten"
ik, I've looked through that code, but I saw Ortalab used start_dissolve() and thought it looked neater to do everything with that one line
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
i think it does but I'm moving back to this because I figured out how to get it onto one line
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,
}```
Does it shrink when you sell the negatives
How do I make juice up actually work, because for me it just crashes because it's nil
What's your relevant code
return { message = 'Again!', repetitions = card.ability.extra.repetitions, juice_up() }
put juice_card = card instead
it's like. if you use it, then ectoplasm or otherwise convert to negative, then use it again, it eats the negative slots.
It worked :D
Check the code for Antimatter
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
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```
that worked, tysm!
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?
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?)
anyone knows what this could be? outdated lovely?
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
ty I'll tell that to them
honestly i hate troubleshooting through github issues
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
code?
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
localize({type = 'name_text', set = 'Joker', key = [KEY OF COPIED JOKER]})
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)
elaborate what i do with this?
put it in your loc_vars
alr
replace [KEY OF COPIED JOKER] with card.ability.extra.copying
is it crashing or is it just not working
crashing
you're missing an end
I am once more begging you to get an IDE that can tell you of your syntax errors
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.```
they had 0.6.0
Because #G.hand.highlighted is never a false value, that will always be picked in the or
do we like, swap jokers and hand highlighted then, or will that just cause the reverse problem?
That will cause the same problem but reversed yes
What exactly is your use function meant to do
it is supposed to take either 1 playing card, or 1 joker, but not both 1 playing card AND 1 joker
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]
^ if you had a joker and a playing card highlighted that condition above would prioritize the playing card
While you're learning it might be easier to understand if you break it down to its simplest parts in an if-else
local highlighted = nil
if #G.hand.highlighted == 1 then
highlighted = G.hand.highlighted[1]
elseif #G.jokers.highlighted == 1 then
highlighted = G.jokers.highlighted[1]
end
so, this is how we learn lua actually lacks an xor keyword innately. Which. Wild.
is there a context called when cards are destroyed? like how canio has a condition that activates when face cards are destroyed
context.remove_playing_cards
Lua has ~ in 5.3, but Balatro only runs 5.1
thanks!
it is called one time with a list of all destroyed cards in context.removed
can we ask for balatro to be remade in php
...Ah.
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
oh funn
so that behaviour was fixed, if it's still relevant to you
if perhaps you gave up on the joker temporarily
sorta did but I might circle back to the idea now
it's still not registering jokers highlighted, not entirely sure we even inserted this correctly tbh.
did that fix it?
you do not need a for loop for this
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
you're meant to set context.blueprint and context.blueprint_card to nil after calling calculate_joker
And make sure to save a reference to context.blueprint_card before doing that
So you can use it in other_joker_ret.card
okay, now the opposite problem is happening... jokers can be buffed, playing cards can't be. kinda at a loss for how that even happens.
is there a context for a joker just sitting in the joker area or would I just set it to true?
Did you have both a joker and a playing card highlighted
you'll need to specify a bit more
no, and it's impossible to even use the card if you have both a joker and a playing card selected
I guess you changed the can_use function from the last time you sent that screenshot
can you send your entire use function
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
you'll have to do hooks/lovely patches to achieve this
fml
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,```
and then you can check next(SMODS.find_card(your joker key here)) to check if the player has your joker
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
yeah so uhh, managed to get the description swapping stuff working
the arguments for the xor need to be boolean values i.e.
xor( #G.hands.highlighted == 1, #G.jokers.highlighted == 1)
is there any examples for jokers with another button below SELL?
so there's this mod called joyousspring that has cards with extra buttons
that looks fine, I am not sure about the trig check
joyousspring my beloved
you can pretty much reference all the blueprint behavior from the vanilla code
did that, still only works on jokers while ignoring playing cards, so. no idea. (we feel like the elseif has to be set up wrong but couldn't tell you how)
(what card to be more specific? 😭)
look at the card:highlighted hook in zones.lua
wonderful, thanks 🙏
im gonna print trig to see what it is in the first place then i guess
you're on Paperback, right? mind if I kitbash a patch for it using the one for shopping center as a base?
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
i see, i dont know whats going on here then
try copying the vanilla blueprint code as it is
just make sure to change self for card
still nothing
Apply your brain!
if xor( #G.hand.highlighted , #G.jokers.highlighted ) then return true
is just checking #G.hand.highlighted ~= #G.jokers.highlighted three times over.
The reason xor isn't defined as a function is that it's totally unnecessary. Don't check to check if the check is true is true. Just return the result
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.
can you send the entire use function and define what the problem is exactly
for the ENTIRE use function, see this
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,
yeah that xor function is hilarious
The problem is that you need an end after the if condition
You have an extra at the bottom so it doesn't crash but the events are always ran in the last block of the if because of the misplaced end
There are shorter and simpler ways to do this, i'm just trying to help you through understanding the logic
Don't just copy the code, try to understand what it's doing and why
we get that, but like, we don't need an elseif in the can_use, =~ was basically just doing the xor operand we wanted
It wasn't checking for what you wanted it to check for
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
Or a more vanilla like example, if you selected 2 playing cards and 1 joker
what is G.jokers?
the card area where the jokers go
so if I just check if my joker is in g.jokers, i can have this effect work without having to draft a lovely patch?
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
couldn't I just use take ownership to do that?
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.
that'd unconditionally make all magicians have a different value
Are you in vscode
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)
ZeroBrane.
im still so lost 🕊️
You've clearly just changed the theme of notepad++, but alright. What are you doing with highlighted once it's assigned?
And it doesn't tell you where syntax errors are?
That doesn't feel like a very helpful IDE
open balatro as an archive (like you're opening a zipfile), all the game's code is in a lua file called "game.lua"
the balatro executable is basically just a fancy zip file you can extract its contents to see the source code
you can always just reverify the integrity of your files if you screw up the game but yeah
- highlighted is used in the subsequent events to represent the target card or joker
That error is very explicit
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
and we tried that. and it did this. and then we tried other combinations of ends and ,s and it didn't work.
Exactly what I mean, not helpful at all
You have more syntax errors
Further down in your code it seems
line 1003 is the end that's meant for the use function.
The "end" on line 1002 is the issue
...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.
lmao
Your inconsistent indentation and use of commas unnecessarily is probably making things more confusing for you and harder to see where statements don't match up
yall gotta admit its pretty funny though
okay. so uh. significantly less intense of a question, is there an equivalent to G.hand:unhighlight_all() but for jokers
I'd never heard of ZeroBrane, but check to see if it has a way to auto-format and auto-indent your code
Just replace hand with jokers
uhhhhh
you put _ instead of :
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
seems like zerobrane is a lua-specific IDE for reference
okay, THERE we go.
how would one modify prices of items in the shop?
Loading the utils file once for every other file doesn't feel very efficient
true, but I'm aware of the lua debate between global and local variables, and apparently local variables/these hacky workarounds might be more efficient because of something about global variables taking longer to index than local ones
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
bump
my utils file is just function definitions so that's nothing to worry about
how do I watch a shader with debugplus?
G.shop_jokers.cards[1].cost = x, shop_jokers can be shop_vouchers, shop_boosters
I am not actually too sure about shop_jokers
awesome, thanks
ahh
watch shaders Mods/mymod/assets/shaders/myshader.fs
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
'''
ooh, i'm definitely gonna go with this approach. ty for the insight! 🧡
can someone show me an example and/or breakdown of a hook pls
within a joker, i should say
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
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?
excellent advice breeze
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
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
https://github.com/Steamodded/smods/wiki/calculate_functions you can check the lists of contexts though i dont think i saw one of what you're looking for when i skimmed through it
maybe ending_shop is close enough
this is incredibly comprehensive, thank you
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?
i can't tell you myself since i don't have talisman rn for my needs but you should try checking the table contents to see if there's anything that you can refer to in math.ceil
bump
i think this should work yeah
thank you again
im pretty sure end of round is before cashing out? but you can check for yourself
hmm
why on earth does enhancing my card change hands_played_at_create to 3
and add a field for order = 22
apologies if this is a dumb question haha, but how would i get "Joker to the right", i.e index of 'card' + 1?
ok, so the order thing happens for any enhancement, apparently
something like this basically how blueprint does it
for i=1, #G.jokers.cards do
if G.jokers.cards[i] == card then
joker = G.jokers.cards[i+1]
end
end
of course replacing joker with whatever its supposed to be
speaking of blueprint im gonna crash out if i dont figure this out
ahh makes sense, thought i would have to loop but i thought there might have been an easier way, thanks!
even if there was an easier way the amount of objects itd have to loop through is so miniscule that it wouldn't really matter anyway
so this works as intended, but how would I be able to edit the edition of the joker before placing it
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
are all of the game's objects global?
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)
so I can just hook into a tarot card like so?
nnnno
tarot cards are not functions
you should look through the game's code for a little bit, i recommend searching for "magician" across the files
SMODS take_ownership
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?
i was told thAT THIS WOULDNT WORK
im going to become jimbo
what are you trying to do
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
adding onto this, can SMODS functions be used in hooks? i'm attempting to make a joker that works similarly to astronomer, but that one uses find_joker(). and i know it's been recommended to use SMODS.find_card() instead, but i'm unsure if the way hooks work allow SMODS functions like that one
yes, you can use any functions in hooks
awesome, thank you!
you're allowed to do a lot of Very Illegal things in lua
also, I DID do this
magician cards are only referenced in the game.lua twice, both on the same line here
might be because the specific thing your trying to do is weirdly complicated for how simple it should be
(my answer to this btw)
thats
just wonderful

oh I'm forgetting how awful tarots are
(btw I switched from JetBrains to VSCodium :3)
it's simple to do if you know how the game works but I'd recommend doing simpler things first or reading more code
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)
that's the prototype, you don't want to change that unless you want to make your changes permanent
it's not too bad to do with take_ownership without changing the on-use behavior
Does anyone know how to update the text of a blind on the blind selection screen
Like changing the shown score value
actually we don't have a context before using a consumable
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
well actually you could just override the can_use function, no?
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
you're right, the use function for these just loops through all highlighted cards
you can only make 2 luckys again
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
can you point me in the general direction of can_use's description so I have an idea of what you're talking about
well I was able to access the text by doing G.blind_select_opts.boss:get_UIE_by_ID('blind_desc').children[2].children[2].children[3].config.text but changing it doesn't do anything
So I am lost
after changing the values u need to run a function that recalculates it to update
I'll check rn
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
I meant general ui code
when changing values in the boxes u need to recalculate the UI element for it to update
How would one do that
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
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
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
It seems the only distinguishable thing about it is that it has the score of the boss blind
I wish it had an id
Where is this function defined?
engine/ui.lua
yeah
Which rarity should this one be?
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
Rewording.
can ANYONE point me in the general direction of can_use's description
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
thank you
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
Imagine writing docstrings
By not working what do you mean
Does it not execute
it just goes to 0
Add and context.main_eval
it just crashes now
did you do main.eval accidentally
if you can't read this; it goes to show that 98% of balala players cant read
if you cant read it then you're proving the original point
wait wtf that is the original 98% message
-# i actually couldn't read this 😭
Man i wish i learned how to read, i feel like i'm missing out on some real wisdom here
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?
Probably whatever function decides whether the play button is enabled or not
I don't know where it is tho, maybe UI definitions
I hooked for that. https://github.com/TheOneGoofAli/TOGAPackBalatro/blob/24781891f3d097bd80fe460232d4712f7423c52d/togastuff.lua#L149-L164
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:
@wintry solar just woke up, latest SMODS patch works wonders! huge thanks :3
still baffled that these spectrals returned {true}
like i get it probably made implementing hologram 1% easier but damn 😭
Yeah I do t understand why they were like that, the jokers at least made sense for timing animations
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?
to_big(hand_chips)
I imagine there’s some talisman function you need to use instead of math.ceil
how do I check the mod a card is from again
this still gives a table unfortunately
config.center.mod.id?
-# i brute forced it i was right
is there a guide to lovely patches? the lovely-injector page is lacking
-# 98%
Where can I find a list of talisman functions? I've looked all over its github and this server to no avail
i hate how G.C.EDITION goes into this bright yellow, should i just have it be no color?
Try G.C.FILTER?
Ya that :D
right, i thought that was exclusive to negative
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
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",
},
},```
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
card.edition
right was it like this? my memory is so ass lmao
also due to vanilla things, card.edition.holo also works
Anyone have a guide to begin making your own balatro mod cause i tbh, have no clue what i am doing
uh... are playing card retriggers off by default now too or am i doing this wrong?
also https://github.com/Steamodded/smods/wiki this is a good place to start
then just check through the wiki, there's documentation and guides on how to set things up
Ooh oki
How do my sprites look?
0/10 they dont say joker /j
meanwhile this the kinda shit im doin
this is correct, but you need to return it if context.repetition
individual and repetition is now separated
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
I FINALLY GOT THE BUTTON WORKING 😭
use context.end_of_round then increases some stuff in the joker's config within that context
Thank you!!!
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
I been trying to firgue this out for about 4 days
i really suggest checking out this: https://github.com/Steamodded/smods/wiki/calculate_functions
I had a silly idea and went out of my way to try to firgue all this stuff out
im pretty sure it documents all the contexts
Ooooo
The hardest part for me now is most likely trying to find a way to make a joker run a python script now
...run a python script?
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
bump
Is there a way to make a simple way to tell what I can delete so there isnt a bunch of extra stuff?
Usually I'd draw a flow chart of what a piece a code does, and then untangle the net to make it look simpler.
Thats a good idea thank you
The calculation page does this
I just checked lovely/dump/functions/common_events.lua and found this:
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.
thx
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) ?
If anyone is in a similar situation to what I was in, you can use to_number(hand_chips), and that'll get rid of the table problem!
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
nop
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
can you send your code over here
that means you're not returning the right vars in loc_vars
Loc_vars?
send your code i'll run through it
I just sent it to bepis
the best way to get someone to help you with your code is sending it here, since all we can do is assuming rn
damn, you can just post it here tho 😭
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
and what about your localization
Wait thats wrong?
yeah
I just trying to get it to go up by .3 each time
its supposed to be a whole number, corresponding to the order of the variable you want it to represent
when you return values in loc_vars
#1# refers to the first value, #2# refers to the second, etc
So you mean the 2 didn't need to change to
mhm
the number just denotes which variable it's displaying
--- 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
So that fixed that problem
oh you'll want to split localization at some point
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
having your localization in a separate file makes it easier to translate
Localitzation?
the text on the joker
Oh
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
So thats what a json was in there for
Oh
the mod name, ID, prefix, main file, version number, the authors, the description, its dependencies
but the metadata file also can do this
after you do this, your mod folder will have a localization folder with a dump.lua file inside it
Why is it now going straight from 1 to 2.3 and not going up to 1.3
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
So I renaming localization to default?
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
I having a hard time understanding sorry!
I'm super new to all this and I honestly getting super confused
Would it be alright to vc so I might be able to understand a bit better?
i can't immediately but a bit later sure
Thank you
brb
first patch!!1111
-# ignore less than mediocre artwork
-# also ignore that i forgot to include "when used"
That’s not how doubling works
nuh uh
it's doubling for the first time!!!
like mult
I feel like I gonna lose my mind with this
you'll be fine
is the misprint predict something thats possible to access?
brb again
no, for econ tag its:
40>80>120
hermit:
20>40>60
(like mult)
-# (again)
what we thinkin of this one
yeah it adds the base value (20 for hermit, 40 for econ)
thats great
multiplies the base value
if you want to phrase it that way, it gains one multiplier to the base value
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
Increase maximum values on
The Hermit and Economy Tag
by X1
(Currently X2)
I got the card to go up by .3!!!!
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
i guess not
not without some heavy patching
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
think ima just time it like this
canio on steroids
yeah
if you have a source to pump out steel/gold cards this could go insane i reckon
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
rarity = 4
yea i goofed up
You can use the perscribed_bosses table
I'm nervous to remove anythign to try to make this go off each round
if your joker code breaks, the worst you'll get is a crash
fuck around and find out
how do i make my mod talisman-compatiable?
So maybe I should save a copy and then mess with it
I do have areally odd question through
what is these green things?
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
what are you editing in
Notepad++
use vscode with the lua plugin
probably diffs
Ohhh
use the config.extra field when creating the card, and card.ability.extra in the functions
is it possible to force my mod to load after talisman without neccessarily requiring it to be installed
put a priority lower than talisman's
talisman converts G.GAME.chips and G.GAME.dollars
not mult?
I changed one line of stuff and deleted other stuff and already crashed it
if your mult exceeds 1e300, you have bigger problems
like?
oh ok
the mult given by a joker should not be going anywhere near that high
how are you the chosen one
oh i thought you meant in general
i think it also converts the current chips and mult i forgot those
that's all it does
ok
Ok I changed a single line and it worked (started up)
crashing isn't a big deal
Yeah but its a success if it doesn't crash right away for me now I just got to firgue out what I got to change next
Whats a boolean value?
or at least if someone can help me with this event? i see the delay happen before the cards are scored but for some reason the message is delayed after they score
ill ask again: how does the misprint access the cards drawn next turn
misprint doesn't
"true" or "false"
yes it does
what do you mean misprint, the joker that randomly gives between 0 and 23 mult, predicts the cards drawn next turn
in the garbled text you can see the next card drawn
wait what
its an easter egg
what the fuck
since when???
i need to check the localisation files
try it
i will not be trying it i'll take your word for it
Now the card is suddenly jumping up 1.5
fudging. the localisation for it is empty
4 to 5.5 to 7.6 ???
yeah the misprint code is elsewhere
Don’t use events, just return what you need and smods will likely handle the timings for you, if you need more advanced timings than that you’d need to give more context to your problem
9.7
jasp
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
Ok something I did broke it
i can vc now
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},```
Add
alright so i'm making a joker that makes you lose the game if you have it in your hand when playing a card (for the funny)
For readability reasons i'd like for the joker to do the animation and have the text and then to game over
What a strange idea
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
for reference i want to remove (3 different decks)
- the fool from all sources
- spectral cards from all sources (remove the tag and spectral packs too)
- remove tarots and planets from appearing in the main shop slots
are any of these not possible to do?
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
also youre not returning
You don’t need to return
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
Delete talisman problem solved 🙃
it weirdly consistently returns 10 times the ID number instead of the nominal
i dont want to add "conflicts" = ["talisman"] thoughhh
Ah, it's because
↯⟜(×10-1×2÷⟜⇡)200
-≡⊃∠(⍜∩°√+)⊸⍉
-π◿τ⊞-×τ÷⟜⇡20
when it should obviously
↯⟜(×10-1×2÷⟜⇡)200
+≡⊃∠(⍜∩°√+)⊸⍉
-π◿τ⊞-×τ÷⟜⇡20
use to_number(hand_chips), which should convert the table type (talisman shenanigans) into a value
id rather not do that as that risks an infinity if the chips are too high
wait is hand chips just from planet cards or is it the current running total
current running total
yeah that's fair enough
sooo is there any way to fix the crash without resorting to risking an infinity or just banning talisman from my mod
You don’t have to design your mod around talisman existing
Common or Uncommon?
Reworded a little:
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
use only one context.scoring_hand, and use or instead
one return for all suits?
thats taking the hearts return if you have any hearts
and ignoring the diamonds, etc
because the function has already eturned
if suits["Hearts"] > 0 or suits["Diamonds"] >0 then
the other suits should also have the > 0
I forgor
but yes, that should work
Is context correct?
(under calculate)
this whole wall of text is supposed to to take into account wild cards
when scoring
still checks only 1 suit
try if statements instead of elseif
Why not merge those two for loops and use if wild than... else... end?
I took flower pot as a base
that's literally how its coded
I'm making a booster pack with forced items, and now there's lots of green squares everywhere... anyone know why?
Also you can use SMODS.has_enhancement(context.scoring_hand[i],'m_wild') instead of context.scoring_hand[i].ability.name == 'Wild Card'.
instead of that wall of text?
No, just the if condition.
wait, so what's different then?
just the condition line?
Replace context.scoring_hand[i].ability.name == 'Wild Card'
with SMODS.has_enhancement(context.scoring_hand[i],'m_wild')
Wait, I didn't notice it'd be longer.
it's still best practice because quantum and stuff
I mean, you iterated through the same list (which is context.scoring_hand in this case) twice.
yeah so i just noticed the second for loop, even though its a wild card you are still checking for its suit?
or am i understanding it wrong 💀
Yeah, I'd rather +1 to every suit in the list if it's a Wild card.
also, i would have a table with all of the suits name ngl
for suit, _ in pairs(SMODS.Suits) do
suits[suit] = (suits[suit] or 0) + 1
end
end```
accounts for custom suits, works with wild cards
Which, at that point, you can just :is_suit([suit name]) all the way down.
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
don't ignore custom suits :v
but you can see how its much shorter
...i mean, his joker only seems to account for the vanilla suits
pattern = "\"Clubs,",
payload = "\"Clubs\","
I guess you can still make an util function and use only the vanilla suit data if that's all you care about
oh but i actually just knew about this smods function
thanks ❤️
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
my processing power is 1 comment per hour
be kind with me folks
just take it slow lol
sometimes i have to reread ppl's feedback for like 5 times to actually understand it 😭
Can anyone help me find out why this is happening?
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```
its a booster pack bug, im sure
That's a lot of confetti.
...since i got it before
So much confetti, T-T
thats a lot of jirachi
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
thats neat, thank you wise man
Me on my way to patch every single rank-based joker in the name of making these abominations functional
🙈
Just make it rip off the corners, XD
yes
It's rank is "Yes"
baldi last question ahh rank 😭
dude, implement Card:has_rank() instead patching get_id into everything 🙈
I already have it correctly playing the hand it should
Nah we’re hard coding the shit out of this card
we love hard coding around here
it is very much in the spirit of vanilla i'll give you that
Speaking of hardcoding, here's an example of my latest joker:
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
#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...
seems quite good for early game too
So this for loop checks hand for suit (any) and adds them up to the total amount?
or I should insert certain suit in the brackets?
true but the point is if you're patching it you might as well make it nicer
this is true
goddamn it i cant even hear what they r talking about, theres a literal storm outside my house 😭
local suits = {}
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```
anis_rank() that takes an array of values and returns true if one of them matches would be nice
ohhhh so thats the reference
output is suits{} has any suit that appeared at least once as key
thats neat, i will save the video for relistening later
value is the times it appeared
You don't need to since there's english subtitles and they were speaking Japanese.
yeah but lets be honest, thats half the fun gone
Yo
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)
Does anyone here know how to get the card value
this is a straight flush btw
(playing card here):get_id()
oxford, not brogues
So card:get_id()?
i fucking refuse to believe thats a straight flush, what the hell.
oh, right
i actually never used a straight build before so i straight up forgot its existence 💀
hold up, does the queen actually get scored?
it's not supposed to if it's a straight flush
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
These are so cursed, I like them.
those aren't necessarily aces though
are you looking for chip value or what exactly?
card.base.nominal if so
ngl i like the idea of just straight up ripping the corners, i think someone said that earlier
So the answer is 7, if the card is a 7?
no
Just a nibble off the top
it's a 7 if card.base.value == '7'
is that the same as :get_id()?
also i guess card:get_id() == 7 works as well
also, is that 7 supposed to be a string
should be, but i have absolutely no idea if you can have conflicting ids or values
yes
it's not if you consider a jack
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
<jack>:get_id() == 11 and <jack>.base.nominal == 10 and <jack>.base.value == 'Jack'
pick your poison
:(