#💻・modding-dev
1 messages · Page 653 of 1
Also if you're trying to edit game.lua in the lovely folder, that's not what you should be doing
The lovely folder contains a dump - a copy - of the code
im not
To patch the code, you'll need to write a lovely patch
im looking for the code name
Ah fair
the vanillaremade wiki has some info on stuff
Can someone help me figure out why this patch isn't making my sticker spawn?
which appears to be a massive waste of time
like here is the change size thing https://github.com/nh6574/VanillaRemade/wiki#how-do-i-checkchange-an-areas-card-limit
you should also check out other vanilla effects
is handsize also G.handsize:change_size(1)
not SMODS.Stickers["nancy_baneful"].should_apply is always false
It's the same check for the vanilla stickers though
This is just above my patched code
```lua
if G.GAME.modifiers.enable_eternals_in_shop and eternal_perishable_poll > 0.7 and not SMODS.Stickers["eternal"].should_apply then
card:set_eternal(true)
elseif G.GAME.modifiers.enable_perishables_in_shop and ((eternal_perishable_poll > 0.4) and (eternal_perishable_poll <= 0.7)) and not SMODS.Stickers["perishable"].should_apply then
card:set_perishable(true)
end
they have should_apply = false
Ohh
basically so if you take ownership that code doesnt run
So I should add that to my sticker so smods doesn't try to spawn it using its own logic?
wrong channel teehee >.<
I see I see
maybe?
"+1 ".. statChosen.. " slot"
I mean, if it works then it's okay lol
statChosen should be a local variable
G.shops should be G.shop_jokers
Added this to the sticker and it's still not spawning. Where exactly do the vanilla stickers have should_apply = false, so I can look?
```lua
should_apply = function(self, card, center, area, bypass_reroll)
return false
end
why is it specifically jokers thats odd
localthunk
smods game_object.lua
and its literally should_apply = false
not return false
the return should be inside the if condition
IT FUCKING WORKS
YEAAAAAAAAA
the only one that doesnt work is the shop slots
it just... squishes the cards
ah there's a function for it i forgot
tysm btw
change_shop_size(1)
that
just copypaste my dude
its FREAKING out in my code editor
Well a lot of things seem to be freaking out in your code editor lol
Setting up this has been really helpful for me https://github.com/frostice482/balatro-lsp
There's a section for it and adjacent stuff on the vanilla remade wiki here https://github.com/nh6574/VanillaRemade/wiki#3-set-up-the-lua-lsp
when increasing hands and discards, it only increaes in the next blind
is there any way to see it increase automatically?
Does Card:add_to_deck normally run for jokers showing up in the shop or did I fuck something up?
no
I'm doing my sticker functionality (-1 hand size) with hooks like this
```lua
---- Baneful sticker functionality (obtaining or undebuffing Joker)
local card_add_to_deck_ref = Card.add_to_deck
function Card:add_to_deck(from_debuff)
local ret = card_add_to_deck_ref(self, from_debuff)
if self.ability.set == "Joker" and self.ability.nancy_baneful and G.hand then G.hand:change_size(-1) end
return ret
end
---- Baneful sticker functionality (removing or debuffing Joker)
local card_remove_from_deck_ref = Card.remove_from_deck
function Card:remove_from_deck(from_debuff)
local ret = card_remove_from_deck_ref(self, from_debuff)
if self.ability.set == "Joker" and self.ability.nancy_baneful and G.hand then G.hand:change_size(1) end
return ret
end
Oh actually it's remove_from_deck that runs
Cuz I just see a few stickered jokers in the shop and my hand size goes up
Even tho I don't actually buy them
hmm they might run but the function usually checks self.added_to_deck or something like that
As a sidenote, I had to add the set == "Joker" check because I could go to the collection, stickers, view the sticker, and then exit and my hand size went up
So looks like remove_from_deck ran
Yeah I just had to check for self.added_to_deck myself and also do it before the function ran, it works now
Thanks so much for your help ❤️
should i make this blueprint compat just like cola
Why not?
:3
:3
anyways i dont know how to generate random tags its so over
pool i think
im assuming add_tag is accurate but i dont know how to pull from the pool
a pool is just a list of keys
cough vremade wiki cough
you can use a pool that's buried somewhere in g.game
or you can also just
use a list
I CANT PARSE THAT SHIT
WHY DOESNT IT HAVE A SEARCHING FEATURE
ITS SO ASS
yeah
yeah
yeah
Ctrl+F bestie
ctrl+f for tags gave me like 30 results and i couldnt find it 😭
🫡
"it" not the whole thing
“it” is short for “iteration”
Its only use here is changing the pseudorandom seed to be different each attempt so it doesn’t hit the same result on a fail
it is iteration
hope this helps
and since its in context.selling_self, this happens when you sell the card
Worth noting that in the next smods release there will be a function that returns a pool of objects without UNAVAILABLE entires
So this won't be necessary when that comes out
ah!
You’re welcome 
will say, when selling for vouchers, the packs are claimed weird
like it isnt automatically processing
Yeah those tags trigger under specific circumstances
I disagree. That function is cool but the unavailable stuff is there so rng is consistent
how i can make a strong course on a balatro mod. but without any bit of bind or anything
can you elaborate
Not quite sure what you mean by that
retrigger based legendaries are hard to make
spreadsheet 👀
yeah
is it possible to change the scored hand played into a different one? Like if I played a pair but the hand gets scored as if it was a straight
is it possible to make text pink
which text
context.evaluate_poker_hand
message text
the background or the text itself
text itself
.w.
so would it be like
context.evaluate_poker_hand = "key_of_hand"
or am I doing it wrong
That is incorrect
booo
boooooooooooo
but scam message!
how do i check specifically the last card in a hand? ive been struggling because first card is much easier
maybe like context.scoring_hand[#context.scoring_hand]
?
check the docs
I'm seeing this
yeah
the paragraph explains how to use it
oh it's replace_scoring_name not hand it still hasn't been fixed
oop
code?
was trying to find a last played card thing somewhere and i couldnt
context.other_card == context.scoring_hand[#context.scoring_hand]
also you dont need message or color or card
repetitions does all of that
I'm going to go fix like 2 other jokers then
is this too weak?
fair
it would trigger ancient joker on every 5 card hand, every 5 card hand would be playable(its like splash but more points basically)
how do i check if something happened in only one hand? like if you won on the first played hand
SMODS.overshot in context.after i believe
didnt work
How can I get the price increase on a joker from an edition?
is this like... possible to code
What's a past copy
Yes
Might require thinking
yeah
just save every jonker
also thats just invis joker without the timer
Yeah flag the one you want to copy
Technically no
It can copy the deads
Already sold ones
Invis
But almost invis
Visible Joker
Nuh
Schrodinger's joker i guess
"I don't know if the joker is dead or alive until i watch inside the box"
"Laughter"
"Shut up"
well it might be easier if i make a save and a load instead
Schrodinger's Joker
Rare
+120 Mult
Fixed 50% chance to end scoring before scoring this Joker
gamba
Lol
Lost edition already have a Schrodinger's cat joker
But it's a boring 50/50 (non fixed) chance to get 120 chips
this is much better because it can kill your setup if you lose enough coinflips
||dawn||
||tsuki||
||saturday||
||allison||
yes!
yay hi fellow v/s player
player :)
i finished story in v4.2 and decided to restart story for the 5.0 release
good idea
||Pew pew||
||Swoop||
||Nyom||
||Kling kling||
im so happy for you
allison should be hearts, and maybe saturday should be spades
dawn/tsuki clubs/diamonds isnt that crazy
Rotating AutoMobiles
???
X2 Mult, all text is upside-down
OH GOD YOURE SO RIGHT FOR THIS
make all of the boundary shatter songs into gimmick jokers /j
what is each suits weakest point
hearts is really good for x mult and money because of smeared
so maybe chips
honestly all the suits are pretty equal in vanilla
clubs has double vision
SMODS.last_hand_oneshot
when developing a mod is there any way to ensure compablity with both talisman and amulet
if something works in talisman but not in amulet that's amulet's fault
With amulet it should be automatic, but talisman you need to use to_big() in your comparisons
```lua
-- To_Big function either Talisman's or a dummy to ensure optional compatibility.
-- https://github.com/nh6574/VanillaRemade/wiki#why-do-i-get-attempt-to-compare-number-with-table-when-talisman-is-installed
to_big = to_big or function(x) return x end
so this should be fine since amulet and vanilla does that but talisman needs that
That's a fallback for if talisman isn't installed. You should pass in numbers you use in comparisons to that function for it to actually do anything
yeah that's the plan
Is there any way to make it so cards played or discarded return to deck?
You can do it with patching, though I'm pretty sure there is a SMODS solution being worked on
Up to you how you wanna solve it tbh
Also how do you directly modify the round score for things like boss blinds?
G.GAME.blind.chips
Also patches if you want it to look nice, though I do have a PR made for this https://github.com/Steamodded/smods/pull/1135
This commit allows objects that trigger off contexts to change a blind's target amount and correctly shows it on the Blind UI screen (assuming the object is in the player's possessi...
I meant this
oh
Oh that
G.GAME.chips
There's ALSO a PR out for that LOL https://github.com/Steamodded/smods/pull/1167
or hooking
oh tldr uhh
theres no easy way to change the visual
I actually recently implemented something that does the visuals nice, lemme find it rq
the problem is the tally at the end uses the value its at at the moment of scoring
i did that too
i set the chips display to read a temporary variable and swapped it on an event
I simply ran this during context.setting_blind and it worked a charm. Modifier is just a value calculated prior to the event
Lua G.E_MANAGER:add_event(Event({ trigger = 'ease', blocking = false, ref_table = G.GAME, ref_value = 'chips', ease_to = math.floor(G.GAME.blind.chips * modifier), delay = 0.5, func = (function(t) return math.floor(t) end) }))
I'm sure it works on other contexts too
oh READING from it is fine
you just cant set it that well since it either updates instantly after scoring calcs, or gets overriden by the final tally
balancing...
ease_chips
that is a mean boss btw
are you trying to set the chips or subtract from it
Set the chips
tho looks like that solution works
jk no
it flipped the chips to negative
-(hand_chips + G.GAME.chips)
oh uhh
well youre setting the chips
before its being multiplied
tho the way this boss is set up, you can actually do something a LOT easier
Oh?
Btw context.after triggers AFTER scoring
correct
oh wait then it would be context.final_scoring_step
thats the one plasdeck uses
and visually its probably fine if the setting to 0 part happens "before" scoring
also SMODS.calculate_round_score() to get the total the hand scoes
Does anybody know how to check if a Joker is a "triggering" joker rather than a passive one (like Four Fingers and Shortcut)?
I want to check before applying a Joker retrigger
Well
Joker retriggers wont apply anyway unless the joker actually triggered
They arent calculated in the first place unless something was returned by the joker to be retriggered
hmmmm, I'm looking to retrigger two random jokers
Youd probably just set two jokers as a target and randomize the targets in some context
Since joker retriggers can happen basically anywhere
I love floating point
Hi I have 10 years coding experience I can help
I've fixed it
does SMODS.ConsumableType require c_prefix, prefix or no prefixes?
```lua
SMODS.ConsumableType{
key = "togaitem",
primary_colour = HEX('5f0000'),
secondary_colour = HEX('5f0000'),
no_collection = true,
}
is how I've done it.
oh sorry i meant the default ;u; i'm tired
my hanafudas define default = "phanta_pine_chaff_a" but i'm not sure if that's correct
?
so like, the default consumable that appears if you see all of them at once
key, primary_colour and secondary_colour are required.
But I'd assume any setting of a "default" involves the proper full key, including the c_
🤝
you could just check if theyre blueprintable
i'd like to display a multiline localisation variable with formatting in my UIBox, how may i do that?
(think ability texts)
(i'd look for where they're defined but i can't find them)
Is rate = 0.3 on SMODS.Sticker based on vanilla rates? And do all vanilla stcikers use the same rates?
Yes.
To both?
Yes.
? did u add a teapot?
oh fuck
i wanted to add the utah teapot too
Then go for it - there's a reason I named this GLTeapot.
true
mine is a roblox hat anyways lol
what is the gl in reference to? opengl?
or is it the utah teapot itself
nvm i found why
This might be complete bullshit but I decided to annotate the functions of a certain Joker for those who may be completely new to VScode. Again, I may be completely wrong with what each variable does, but this was how I personally understood it
You spelled loc_vars wrong also xmult = card.ability.extra.xmult means that the joker will give Xmult equal to the value in config = {extra = {xmult = number}}
@pastel kernel
```lua
local image_file = assert(NFS.newFileData(SMODS.current_mod.path .. "assets/misc/your_image_file.png"))
local image_data = assert(love.image.newImageData(image_file))
YOUR_MOD_TABLE.YOUR_IMAGE = assert(love.graphics.newImage(near_spear_data))
--- Hook love.draw
local draw_ref = love.draw
function love.draw()
draw_ref()
--- Inside the if statement, check to see if the sprite should be drawn
if ... then
local width, height = love.graphics.getDimensions()
local x_factor = width / 1920
local y_factor = height / 1080
local image_width = ... -- width of image goes here
local image_height = ... -- height of image goes here
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(
YOUR_MOD_TABLE.YOUR_IMAGE,
0, -- x position
0, -- y position
0, -- rotation of image
x_factor * 1920 / image_width, -- x stretching
y_factor * 1080 / image_height, -- y stretching
0, -- x offset for image origin
0, -- y offset for image origin
0, -- x shear
0 -- y shear
)
end
end
Let me know if you need a specific location for where the image should be drawn and I can send you the appropriate params (unless you can figure that out - the love2D docs should help with that)
It should cover the entire screen
What are the dimensions of the sprite
About as large as a pc screen
so 1920 x 1080 roughly
or something with a similar proportion?
The intention was that if you tried to play the mod with pwx on, it would make you unable to play the hands section.
I was thinking you could resize it to fit the screen
As in
It auto updates
To match the balatro game resolution
this is referenced from canio's vanillaremade code, i didnt really change anything internally except the joker's position
@pastel kernel
This code should be correct, assuming you replace the variables and if statements correctly
Just updated it
Yes, you spelled loc_vars wrong in your comments.
oe
Keep in mind the code i sent is slightly different from how I did that kind of stuff in my mod because I didnt want to tell you to ctrl c ctrl v my mod's code for that
i might be off with my math because of that (my mental math kinda sucks sometimes)
When Sold, Create a Past copy of a Joker you had when you first acquired this Joker.
How difficult of an idea is this to code
creating a new copy isn't hard; just save all the keys of all the other jokers in this joker's add to deck, and then in context.selling_self create a random joker from that set of keys
creating an exact copy (e.g. tracking the state of scaling jokers) is more difficult, because you can't/shouldn't save whole cards to a joker's ability table
depends how accurate you want the copy to be
(aka what meta said :v )
No, it's not, because Card:save exists.
oh huh
how would that work
Joker idea: Mitosis - Something related to card duplicating, maybe when you add a card to your deck make a copy
Hello. Is there a way to like, expand these tables and what not?
soothe your chips
my current localisation file crashes whenever i try to load my decks and i have a feeling its because of ts
what do i do
what exactly is the crash
lemme load it up again
you're missing a }, before b_hatch_violet
oh shit
uhhhhh
what does this mean
it means },
how do i add an extra tooltip to this?
Editions = {
e_hatch_divine = {
name = "Divine",
text = {
"A {C:enhanced}temporary evolution{}",
"Lasts {C:attention}5{} rounds"
},
},```
i want to add an art credit to cassknows for the shader
in loc_vars: info_queue[#info_queue+1] = { key = "key", set = "Other" } and then you add the credits to descriptions.Other.key
oh hm
thats difficult 😭
ill try
ok idk whats going on
en-us.lua code:
Other = {
hatch_burdened = {
name = "Burdened",
text = {
"Take up",
"an extra slot",
},
},
hatch_divinecredit = {
name = "Credits",
text = {
"Credit to {C:attention}cassknows",
"for the shader",
},
},
},
},
dictionary = {
},
misc = {
labels = {
hatch_burdened = "Burdened"
}
}
}
}
}```
edition code:
SMODS.Shader({ key = 'divine', path = 'divine.fs' })
-- Credit to cassknows for the shader art
SMODS.Edition {
key = 'divine',
weight = 14,
sound = { sound = "gong", per = 1.2, vol = 0.4 },
shader = 'divine',
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = { key = "divinecredit", set = "Other" }
end
}```
you need to add the mod prefix here too
o
same error
SMODS.Shader({ key = 'divine', path = 'divine.fs' })
-- Credit to cassknows for the shader art
SMODS.Edition {
key = 'divine',
weight = 14,
sound = { sound = "gong", per = 1.2, vol = 0.4 },
shader = 'divine',
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = { key = "hatch_divinecredit", set = "Other" }
end
}```
code looks like this now
that looks correct but the fact that the edition is also not working makes me think there might be something else wrong with your localization file
hm
i decided to remove the extra tooltip
shes already credited in the credits.txt file + i hope to make credits ui eventually
It's on boot
is there some function to get a random rank or do I just make my own table with all of them and pseudorandom that?
what variable should i use for increasing x_mult in my jokers config, i cant find a variable name looks right, does the name even matter?
the names dont matter
ok
thx
i keep getting this error
Oops! The game crashed:
[SMODS Crossover "jokers/jokers.lua"]:635: attempt to perform arithmetic on field 'morex_mult' (a nil value)
post the joker code tbh
SMODS.Joker{
key = "gardenspade",
config = { extra = { x_mult = 1, morex_mult = 0.1} },
pos = { x = 0, y = 0 },
rarity = 3,
cost = 10,
blueprint_compat = true,
eternal_compat = false,
unlocked = true,
discovered = true,
effect = nil,
atlas = 'gardenspade',
soul_pos = nil,
calculate = function(self,card,context)
if context.individual and context.cardarea == G.play and not context.blueprint then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_suit("Spades") then
return{
x_mult = card.ability.x_mult
}
end
end
end
if context.end_of_round then
card.ability.x_mult = card.ability.x_mult + card.ability.morex_mult
end
end,
loc_vars = function(self, info_queue, card)
return { vars = {card.ability.extra.x_mult }, key = self.key }
end
}
behold the garden spade
extra
also, wrapping code blocks in triple backticks will make them monospace and much easier to read
will do!
what node is the root? i'm trying to add a uibox to the game area but idk what to set the parent to
Just to the screen?
best bet would be G.ROOM_ATTACH
for a parent for a uibox
ty
i'm doing something kinda similar to your stockstuff devilsknife present but the custom renderer stuff scares me so i'm trying to uibox instead
Are you trying to make a minigame with the UIBox system?
Yeah if you need text
I would heavily recommend using UIBox systems because love2d text drawing is jank
But that also requires that you know how to update the UIBoxes yourself
i've done uibox stuff before
I wonder if CanvasSprite could apply here
canvassprite?
new PR that got merged to smods recently, that allows you to create a sprite object that uses a love2d canvas as its image data
Basically
You do similar rendering techniques I used for devilsknife, draw it to the canvas sprite, then put that sprite in an object node within your ui
ah
it's similar tech to how cardsauce renders the tetris game on that one joker
hi meta
hiii
i thought about the possibility of making my wordle game fit in the joker image but idk how i'd do that
I think the canvas sprite stuff has custom methods for drawing text that massively simplifies drawing text on a sprite
ok
it does, but you might be better off handling it in a custom drawstep for the purposes of wordle
so that you can highlight letters and whatnot
here's the current joker art, maybe i'd be able to do this with a custom text atlas
yea a custom text atlas would work too (entropy is gonna have something similar, to update the text on one of those slay the spire inspired jokers)
okii
oh it's actually already in the entropy dev version
How would I get the amount of unscored cards in played hand? I know you can specify context.cardarea == 'unscored' but how do I get the cards
#context.full_hand - #context.scoring_hand
need help with this
nice
i thought you wanted to do wordle in balatro
in a joker, not in a boss blind
also probably not interacting with aikoshen letters at all
did you not even look at the aikoshen blind 😭 /nsrs
i have a niche issue and idk what to do
i made this logo for a specific mod
but its not showing up on the title screen
its just showing the default logo
What code did you use?
this is the main.lua file
SMODS.Atlas({
key = "modicon",
path = "ModIcon.png",
px = 34,
py = 34,
atlas_table = "ASSET_ATLAS"
})
SMODS.Atlas({
key = "balatro",
path = "balatro.png",
px = 333,
py = 216,
atlas_table = "ASSET_ATLAS"
})
SMODS.Atlas({
key = "CustomJokers",
path = "CustomJokers.png",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
})
-- ASSERTS
assert(SMODS.load_file("src/jokers.lua"))()
-- Unsure what this does
local NFS = require("nativefs")
to_big = to_big or function(a) return a end
lenient_bignum = lenient_bignum or function(a) return a end
SMODS.current_mod.optional_features = function()
return {
cardareas = {}
}
end
Oh, hmmmm
atlases add mod prefixes by default
idk what im doing;-;
This is what my mod does
^ that prefix config should do it
oh hm, do i need to have prefix_config off or
oke
prefix_config = { key = false },
did you make the 2x sprite correctly
i dont think so
will try again
we did it
now how do i change the colors and the ace of spades in the title screen?
Ima just check my GitHub again
wait for the next smods update, i have a PR merged that'll make changing the title screen cards easier
wait for SMODS.menu_cards
Is it possible to have one deck skin pull from 2 different files?
smods…
like one file for queen and king, another for jack
oke
or do I need to combine the 2 files together
how many jokers is too many for a vanilla adjacent modpack
Depends really
i would say 30-45 is a good number
All in jest does a pretty good job of being vanilla adjacent and it adds like 470 jokers
im at 42 right now
but then there are cases like all in jest yeah
So you can really do whatever
and im like nowhere near done 😭
it really depends on how good you are at balancing things
And also how many unique jokers you can make
doing a vivid/stasis pack
Because tbf all in jest also has like
Especially a lot of legendaries that are just an existing joker but better
i think every single legendary i have(12) is unique
there are a lot of important vivid stasis characters
that unfortunately leads to legendary creep
so i think subtracting legendaries id probably do... 45/60 additional for a total of 55-70 jokers
also self-destructing legendaries???
Yeah idk
It could also definitely use some more sources of legendary jokers with how many it adds
my worry is that adding a legendary source feels too outside the realm of reasonability
maybe making the joker packs i make include the legendary pool could help
i also don't have an artist that wants to work on this rn .w.
who likes placeholders!!! wooo!!!!
@red flower is it supposed to gain 3 times the x0.2 mult every time i play a card
yes
i need to write it better
oh ok cool
ash blossom is definitely not a he/him tho
anyways how do i change the colors in the main menu background
i see,,, so ill have to make a separate general_ui.lua file? then
ill put it in the main.lua file then
it says smallpox is a null value
what do i doooo 😭 😭
you can remove that condition if you dont have a config
also this will crash if you dont change it to a real color balatro has
oh wait
dont change these 😭
wot
then what do i doooo 😭
@red flower the code rn
local game_main_menu_ref = Game.main_menu
function Game:main_menu(change_context)
local ret = game_main_menu_ref(self, change_context)
if not smallpox.config.disable_main_menu then
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = G.C.JOY, ref_value = "EFFECT" },
{ name = "colour_2", ref_table = G.C, ref_value = "BLACK" },
},
},
})
end
return ret
end
idk what im doing
```lua
-- Main Menu Colours (Credit to Cryptid and JoyousSpring)
local game_main_menu_ref = Game.main_menu
function Game:main_menu(change_context)
local ret = game_main_menu_ref(self, change_context)
local colours = { c1 = HEX("3F528C"), c2 = HEX("89ACEB") }
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = colours, ref_value = "c1" },
{ name = "colour_2", ref_table = colours, ref_value = "c2" },
},
},
})
return ret
end
that should work i think
have you heard of twinks
thats a 5 year old
twink catboy? sign me u- 💥
oh ok
times it by -1
How does ease_dollars work again
ease_dollars(x) adds x dollars, it doesn't set it
x can be negative
does anyone know off the top of their heads the base shop weight for rare jokers?
0.05
thanks!
???
G.GAME.dollars = G.GAME.dollars * -1
is there an escape charecther i can use in strings like \n? im using misprints random text stuff and cant seem to make things be on multiple lines
did you ever figure this out?
/genq, is it possible to store joker data like scaling value at all?
What do you mean by that?
i figured out how to do mulitple lines by doing main_end. its not perfect but it works
how do i add a soul layer that's bigger than the base layer?
preferably with the soul layer in a separate atlas
how difficult is this to do as a joker name
ah ok gotcha
the name can use loc_vars too
should i delete or add something?
How do i go make a joker destroy itself and then create a joker in the spot that it was in?
remove the atlas line if you don't have an atlas defined
also it's loc_txt
i recommend using these examples instead https://github.com/nh6574/VanillaRemade/blob/main/src/boosters.lua
Thank you
trying to think of something unique is hard
i wanna make a mult/chips joker for a number thats the weakest, which one should i do?
considering just vanilla balatro, 7 is definitely the weakest (it only synergizes with odd todd). but it's definitely gotten a lot of modding attention both because of that and because of the "lucky 7" connection
6 is probably another good target, it only gets even steven and sixth sense
What would be the best way to approach making a poker hand that upgrades non-linearly?
how do i make a color global so i can do G.C. whatever with that color
you can either do a patch OR do
loc_colour()
G.ARGS.LOC_COLOURS.modprefix_your_colour_name = HEX('FFFFFF')
^ (incase you didn’t read)
thank you
how would i change the mod badge text color to be a gradient
the voucherCount local var isnt incremeneting properly
oh i fucked up the if
uhhh
i need a voucher specific purchasing if
SMODS.current_mod.badge_colour = gradient
thank you
i split it in 2 just for be sure
Is there a way to reload an atlas in real time?
if you have debug plus i belive you can press ctrl m
@torpid flicker I used this logic instead, just change the descriptions in total
hi chat, long time no see
what part of the vanilla remade allows me to check what i need to do to alter these?
i'm trying to do a texture
or do i just edit this in the assets folder of the mod folder?
How do I make it so that a joker would always appear with a specific edition? I know how add to deck works but idk how to make it always spawn with an edition.
look at cryptids stardust
is there some way to permanently change blind scoring requirements, or would that require something like a hook to get_blind_amount?
Cape Soya is the northernmost point in Japan, is this a good joker for it?
during the blind or before
can you also affect all future blinds?
i gave you two options 😭
but yes for that you would need to hook get_blind_amount iirc
okay so, i'm losing my shit
i can't make the custom card skins to load and i'm losing it
key = "wildmoney",
config = { extra = {} },
pos = { x = 0, y = 0 },
rarity = 2,
cost = 6,
blueprint_compat = false,
eternal_compat = false,
unlocked = true,
discovered = true,
effect = nil,
atlas = 'wildmoney',
soul_pos = nil,
calculate = function(self,card,context)
if context.individual and context.cardarea == G.play then
for _, scored_card in ipairs(context.scoring_hand) do
if SMODS.has_enhancement(scored_card, 'm_wild') and not context.repetition then
ease_dollars(3)
end
end
end
end,
loc_vars = function(self, info_queue, card)
return { vars = { mult }, key = self.key }
end
}```
why does this give me 75 dollars
with 5 wild cards
its supposed to 3 per card, so 15
when you use context.individual, it goes over a single card
You are then looping through the whole scoring hand
so im giving the money for the full hand every card?
yeah - if you remove "for _, scored_card in ipairs(context.scoring_hand)"
that should be alright
I think
and then replace the scored_card with context.other_card in the enhancement check
oh yeah, that's how you refer to the card that context.individual is currently checking over
Does anyone know how to use a Joker's calculate function to block a glass card shattering? I want the cards to do something else instead
I'm messing around with patches currently and it's causing me more problems than solutions
hi N :>
hewwo
could you help me rq please? i can't make it work and it's infuriating me
hmmm, yeah, I'll give that a try, ty
whats the issue
if it's a texture, shouldn't it just... work? i've made a pack before and it worked.
essentially, my custom skin doesn't work
ah no idea about that stuff
do i need a .lua file for that?
yes, if it's a playing card skin you need to use SMODS.DeckSkin and if it's for something else you would use Malverk
im not sure how either works tho
i'm trying to look here and i can't really understand much 💀
like, this is confusing me
i'd look at Card:shatter and see if hooking it would do the job
at work rn (nobody tell
) so i can't actually look at the code, but that's my first idea
Hmmm, yeah, that's what I've been doing, but it's fiddly. Not sure how to use take_ownership to change the glass breaking effect, so I think I'll give Card:shatter patching another shot
you would replace the calculate function
smods takes ownership of it already
so you can copy that and add your effect
Unaware of this! Great
I'll give that a shot
was looking in lovely/dump
@red flower
key = "QueensHC",
path = "suit_queens_hc.png",
px = 71,
py = 95,
}
local atlas_lc = SMODS.Atlas {
key = "QueensLC",
path = "suit_queens_lc.png",
px = 71,
py = 95,
}
so far, i have this
This solved it, thanks!
key = QueensHC,
path = "suit_queens_hc.png",
px = 71,
py = 95,
}
local atlas_lc = SMODS.Atlas {
key = QueensLC,
path = "suit_queens_lc.png",
px = 71,
py = 95,
}
SMODS.DeckSkin {
key = Queens,
suit = "Hearts",
palettes = {
{
key = lc,
ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
display_ranks = {"King", "Queen", "Jack"},
atlas = QueensLC,
pos_style = '2',
},
{
key = hc,
ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
display_ranks = {"King", "Queen", "Jack"},
atlas = QueensHC,
pos_style = '2',
---colour = HEX("1E2C30"),
},
}
}```
i don't know what i'm doing wrong, i'm also looking at the examples and i don't understand
like, what key am i missing
?
these " " or these ' '
but what's wrong with it?
The keys arent strings
So it references the value with the given name which does not exist making the key also not exist
key = "QueensHC",
path = "suit_queens_hc.png",
px = 71,
py = 95,
}
local atlas_lc = SMODS.Atlas {
key = "QueensLC",
path = "suit_queens_lc.png",
px = 71,
py = 95,
}
SMODS.DeckSkin {
key = "Queens",
suit = "Hearts",
palettes = {
{
key = "lc",
ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
display_ranks = {"King", "Queen", "Jack"},
atlas = "QueensLC",
pos_style = '2',
},
{
key = "hc",
ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
display_ranks = {"King", "Queen", "Jack"},
atlas = "QueensHC",
pos_style = '2',
---colour = HEX("1E2C30"),
},
}
}```
?
that's giving me the error
If this doesnt work idk
i fixed the issue
wanted to change the sprite for when my actives are undiscovered (by default it just showed the sprite with the overlay question mark) so I did this, but hum only the overlay seems to work properly?
It does work properly for my loot cards, tho these are ConsumableType not ObjectType so I assume that plays a part in it
but then again it's supposed to work with any ObjectType
what is your spritesheet?
this is alternate universe version of minecraft from the v/s universe but i have no idea what i can do with it x3
localisation bros, how do i add that little "from (Name)" subtitle underneath the title?
you can do a multiline title like how you'd do a joker description
ooooh how do i do that :o
"text",
"more text on a new line"
}```
and any formatting tags work on joker names too
i wonder who added that feature
i wonder why it has been added
this probably sounds stupid but try soul_pos
hi I'm an absolute noob in balatro modding, how can I make a localization mod/patch
that's not that
on the contrary that's the only thing working properly lol
oh i get it now
from aikoshen
SMODS.ConsumableType{
key = "Replicant",
primary_colour = HEX("a30262"),
secondary_colour = HEX("ff9a56"),
collection_rows = { 4, 4 },
shop_rate = 0,
default = "c_akyrs_replicant_music_streaming"
}
SMODS.UndiscoveredSprite{
key = "Replicant",
atlas = "replicant_undisc",
pos = {x=0, y=0}
}
i hope this helps
it works!!!!
woohoo
thanks
guys, is it futile to try to make a balala mod with 0 Lua knowledge or I can bruteforce it?
do you have coding knowledge
if so you're good because lua is simple
If you know loops in python, you won't be able to make an insane mod by tomorrow, but you'll be able to make a lot of stuff already, and learn enough to make an insane mod over time
i learned lua by frankensteining together parts of existing mods until it clicked
you'll be fine, probably
@hushed field i can show you a placeholder card with the 3 sigils atlasses overlayed on top to show you an example
which guide is this?
go ahead
that what i was planning)
from smods github page
Oooh, yeah, it's that one, that's pretty decent
I really recommend checking out VanillaRemade as well
will do
I know there's a guide floating around that I think is based on the smods guide that is very outdated, so I thought it was that one, for a second, haha
XD
The VanillaRemade repo has every vanilla objects remade through the modding framework, which is great reference, but its wiki (https://github.com/nh6574/VanillaRemade/wiki) is even better if you're just getting started
Thank you very much sir!
Is that how you hope they'll get laid out in the end, or is that already your current implementation?
i will get started
thats how the three atlasses layer on top of each other (i selected a different sigil for each)
if you look closely
me rn
nice
So what's the issue you're running into? That should already work, no?
Is each sigil its own sticker?
ok chat
dumb question
how do i make a showman deck
this is the code i have rn
SMODS.Back {
key = 'showman',
pos = { x = 0, y = 0 },
config = {},
unlocked = true,
discovered = true,
no_collection = false,
atlas = 'CustomDecks',
locked_loc_vars = function(self, info_queue, back)
return { vars = { 4 } }
end,
}
local smods_showman_ref = SMODS.showman
function SMODS.showman(card_key)
return smods_showman_ref(card_key)
end```
i also wanna make an unlock condition where it only activates if you two showmans in your hand
In the hook you would put if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'b_modprefix_key' then return true end
where in the hook would i put that
function SMODS.showman(card_key)
if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'b_smallpox_showman' then
return true
end
return smods_showman_ref(card_key)
end```
?
Yes.
oke
ok i think it works
all i need to do is figure out how to program the unlock condition in
bc idk
give it
check_for_unlock = function (self, args)
return #SMODS.find_card("j_ring_master") >= 2
end
danks
how would i get the level of the lowest level hand
local num = math.huge, then iterate through G.GAME.hands and do num = math.min(num, v.level)
thx
No, it's math.huge not math.huge()
it's also v.level to get level, not v.played to get play count
could've sworn I've seen huge as a function before but eh, that's why i always double check this stuff when I'm actually coding
each sigil its own stickers, each position its own atlas
i can't figure out a system for positions
for example, the first sigil on the card should take atlas one, the second atlas two, the third atlas three
a maximum of 3 sigils, if there is a new one added, it overwrites the third one
LIFO
live in and find out
Try to not think of them as stickers. If you write a function that applies them, you can use that to specifically check how many there are, and match a position to it. Then, you can use a drawstep to draw them on
i want to copy the thing asteroglyph does where it sends you less far back each time you use it, but I'm looking at it and
am i missing something or would this not just do 0 once and then repeat 1 forever? i have to be missing something but i can't work out where it is in the code
no yea they tried to make it scaling based on the amount of times the voucher is used, but 1^1.13 is still 1
hm
I've never actually used asteroglyph multiple times; i think the only way to do that is with either doe or trade shenanigans? so it's entirely possible this bug just went unnoticed until now...
it's still pretty surprising that no one ever noticed it, because 95% of cryptid's playerbase runs nothing but doe and antimatter /lh
nah that's just the youtubers :v
what kind of lua object is SMODS.Keybind and the other SMODS classes? It's my understanding that lua doesn't have classes.
tables with some metamethods to make them act like classes iirc
How do you make it so a Blind disables your discard/play hand button and the ability to rearrange your cards?
The Coda in paperback disallows rearranging cards (and jokers too)
hook Moveable:drag() for the movement bit (as paperback does)
and look for the play/discard button definitions for their callback function (s) and hook the ones that determine when they work
Ah thx
me when 1^^^^^9999 = 1
how do you check if a card in hand is faced down
.facing = "back"
how would i go about leveling up a poker hand by 0.1? it increases the values correctly but when it tries to get the colour for lvl 1.2 it crashes (idk why it doesnt crash for 1.1)
is there a way i can switch the face and back sprite of a joker
like i want a joker that's face down the entire time but if it gets flipped in the boss blind it reveals its face
i think that'd be a funny detail
swap card.children.center and card.children.back
do i need to redefine those or can i literally just swap them naively
you can just swap them i just tested
you would need to do it when the joker is created and on reload tho
oh yeah speaking on reload
how do you update a sprite on reload, i've been trying to fix jokers with changing sprite reverting to the default state on reload
lots of thing i have to learn
probably with set_sprites
yeah but i mean how do i trigger it on reload
Bit of a shot in the dark, but I'm trying to convert the Playset code I wrote in Kino to their own repo, and for some reason, I'm getting crashes. They happen when I hover over any content package object that is generated by the code. This only happens in the Blockbuster Playsets repo. In the Kino repo, the text is properly displayed. The code is identical with the exception of two lines in a drawstep, where I change a modkey.
I suspect I must be doing something in the broader Kino code, somewhere, but I have no clue what it could be. The only lead I have is that if I print the localization entries, in the Kino repo, they are tables that contain a name, text, name_parsed and text_parsed, while in the Blockbuster Playsets repo, they only contain name and text. I don't know what I could be doing in Kino's other code that would change how their localization is registered, though
This is the process_loc_txt function, btw
are you running init_localization somewhere else in kino (function name might be wrong)
I'm not. I don't think I'm running any function at all that has the word localisation in it. It's the term I've been trying to find and see if I used somewhere, haha
try with the z 🤣
nope
I wish that'd be the issue, though, damn, haha
For a second I thought it could maybe relate to load priority, somehow, but nope. Wonder if there's a chance that the order files get processed could be the cause, though
I sometimes ask the AI in vscode questions and it just told me that if key == 'key1' or key == 'key2' then can be rewritten as if key in ('key1', 'key2') then. Is that true?
could maybe be another mod calling it? though I would have thought kino code is run after blockbuster anyway
no
i wish
thats python
The way I've currently set it up is that Blockbuster's all part of Kino, and gets ran pretty quickly, and the API mods are just me tearing them out, haha. If another mod would call it, I don't know why it'd change. The way I've set it up is that either Kino or Blockbuster is enabled, and in both cases all the other mods would be the same
No; in Lua the analogous syntax would be if ({key1=true, key2=true})[key] then; this sucks for readability, do not do this
anyways, reject ai, just look it up on stackoverflow
have you tried just throwing an init_localization() after it?
I'm not entirely sure what the details are of how init_localization works, but I'll try that
you can also make your own init stuff that targets just your additions, similar to how the potato patch utils work now
I suspect I indeed just have to call init_localization again, yeah. It seems that the way I've set it up in Kino, I should be experiencing the same bug, but I've accidentally already solved it by calling something else that calls it, haha
but yeah, calls it before, and then not again, while Kino calls it twice, after
i'm reworking the retcon voucher to make the shop reroll button reroll booster packs as well
am i hooking the shop reroll right? i'm not sure if this getting the voucher or not. had a test block of code inside that was supposed to run where the comment is, but nothinhg was happening
wait actually i might be stupid
hold on
Managed to solve it! Thanks! 😄
Gonna mess around to see if I can figure out why it gets called in Kino, just so I know, but it definitely works now
for _, v in ipairs(SMODS.find_card('v_retcon')) do
like this?
if next(SMODS.find_card('v_retcon')) then
SMODS.find_card returns a table of all cards you have that fit the key
if in your mod you can have multiple copies of retcon and you wanted to do something for each copy, then you'd do for _, v in ipairs(SMODS.find_card('v_retcon')) do
okay, then i'll keep the for statement then
G.GAME.used_vouchers is a list indexed by voucher keys
With each value being true or nil
So just check if G.GAME.used_vouchers.v_retcon
the only problem with the if statement is that i'm not sure how to get the extra variables from a voucher that way
i was looking at v.ability.extra in the voucher for another check
I think it returns card objects
So you could save next(SMODS.find_card('v_retcon')) in a local variable and then check for attributes on that
keep in mind next returns the key, value pair
so local _, voucher = next(SMODS.find_card('v_retcon'))
anyone has any ideas whats the lua that contains how mult sounds works
it getting pitched up and whatnot
as in when a card gives mult?
should be in card_eval_status_text
theres alot of stuff in here
hold on
i really just want to modify xmult hit sounds
and nothing else
im afraid im just patching the whole thing
I just discovered that context.modify_scoring_hand doesn't work for debuffed cards, they don't get added to the hand
Can I fix that somehow?
I will fix this in smods
how do i use my gradient in en-us.lua
SMODS.Gradient { key = "Typ0", colours = {HEX('A4C2F4'), HEX('EAF4A4')} }
"{s:0.5}Created by {s:0.5,C:typ0}Jimbo{}{}"
everything shows up correctly the gradient just isnt happening and its gray
I do t think you use C for custom colours
I think it is X
I Might be wrong
capitalization is wrong
should be C:Typ0
ah wait
i tried that and it didnt work
also C:modprefix_Typ0
Do gradients not need to be added to the G.ARGS.LOC_COLOURS table?
they do automatically
at some point they didnt
Well, if you want to change the key, you can add them that way, at least, as that's how I'm handling them, haha
not working
"{s:0.5}Created by {s:0.5,C:smallpox_Typ0}SLDTyp0{}{}"
its just gray
are you sure the prefix is correct
yup
🤷♂️ that should work
maybe it is lower case actually
ill try it
yep
is card.ability.wheel_flipped universal for any scenario where cards are flipped?
I'm looking at vremade blinds that draw cards face down and they all set card.ability.wheel_flipped to nil when disabled
So I assumed it just tracks whether the card is flipped
And wheel in the name doesn't mean anything
it is set automatically when emplacing a flipped card in hand
but not when flipping a card in hand i think
anyway you can just check if the card is flipped directly if you need that
Eh I'm just making a blind that draws editioned cards face down
So I think it's fine leaving it as is
Just incase lol
is there any example code on how to have the reroll button reroll booster packs? i'm still struggling to wrap my head around this
You could probably yoink the code that puts them there in the first place, remove existing packs, then run it again
unfortunately this wasn't what i was looking for, this was for rerolling the cards inside booster backs instead of the packs themself
ohh thats a bad way to word it then lol
i remembered theres something that did that let me look again
the mod i mean
cardsauce has a joker that says it can reroll packs but looking at the code it's still going over my head
guess i'll download cardsauce as well to see how it works
i coded that one
its just hooking
,,,wait no i coded the one that adds packs on reroll
it looks like a hook
the only problem is that it uses vanilla functions (yuck) and events for timing but you can probably just copypaste
okay yea, koffing is what i'm looking for
yea unless it got reworked then i did that one
Is context.setting_blind calculated before or after cards in deck are shuffled?
Strange then...
I'm trying to make a blind that puts editioned cards at bottom of deck but it's not doing the thing
waves at u
waavee
i should stop answering without looking
Yeah fair enough
good job
I guess I'll have to hook the shuffle effect then to do it
as you can see i have a patch to stop the shuffling lol
i dont have a reason why either would be better
i personally say that as hyperbole for people that are new because they dont understand how to make patches not clash
but if you know then either is the same i usually prefer hooks because they're easier to read
I think I can be considered new, how do you make patches not clash? Avoid using the at placement?
I try to do that but sometimes you gotta overwrite the code
How do you make it so that a joker can spawn rare consumables but excludes omega consumables
basically
Fair enough lol
if you use at you better have a good reason to use it p much
this is an at patch :3
i don't think there's anything else other than the hook? but also plugging the function in as is. i can't get it to work, even after switching objects
gonna see if i can find a patch
may i see yours
koffing doesnt use patches no
local reroll_shopref = G.FUNCS.reroll_shop
function G.FUNCS.reroll_shop(e)
local ret = reroll_shopref(e)
for _, v in ipairs(SMODS.find_card('v_retcon')) do
if G.GAME.Biased_Balance.can_reroll_shop then
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
if #G.shop_booster.cards > 0 then
for i = #G.shop_booster.cards, 1, -1 do
local c = G.shop_booster:remove_card(G.shop_booster.cards[i])
c:remove()
c = nil
end
end
G.GAME.current_round.used_packs = G.GAME.current_round.used_packs or {}
for i = #G.GAME.current_round.used_packs+1, #G.GAME.current_round.used_packs+2 do
if not G.GAME.current_round.used_packs[i] then
G.GAME.current_round.used_packs[i] = get_pack('shop_pack').key
end
if G.GAME.current_round.used_packs[i] ~= 'USED' then
local card = Card(G.shop_booster.T.x + G.shop_booster.T.w/2,
G.shop_booster.T.y, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS[G.GAME.current_round.used_packs[i]], {bypass_discovery_center = true, bypass_discovery_ui = true})
create_shop_card_ui(card, 'Booster', G.shop_booster)
card.ability.booster_pos = i
card:start_materialize()
G.shop_booster:emplace(card)
end
end
return true
end
}))
G.E_MANAGER:add_event(Event({ func = function() save_run(); return true end}))
G.GAME.Biased_Balance.can_reroll_shop = true
break
end
end
return ret
end
i have can_reroll_shop always set to true just to get it working
if you print SMODS.find_card('v_retcon') at the top what does it do
ah okay koffing got reworked
with debugplus, is it printed to the lovely console or the log in game?
both
print(SMODS.find_card('v_retcon'))
is this how you print or is it a different command
ye
if it prints nothing then its not running at all, if it prints an empty table then find card doesnt work
cinema

im confused why its searching for retcon vouchers but im. not gonna ask
retcon rerolls b
mod reworks base game vouchers. replaces the original effect
already have lovely patches in place that remove the old ability
i use take_ownership for everything except what i can't use it with
there's a few hardcoded edgecases, like a few upgrade messages on jokers like red card
unfortunately, retcon is one of those "very much hardcoded" cases
Question about seals. Is it possible to make a seal not show up until certain requirements are met?
in packs?
defining the in_pool function on it should do the thing
Nevermind they don't have one
lmao
managed to also have it reroll vouchers as well. so that's cool
theyre in the booster code iirc
they probably should tho
Like, I'm working on something atm where I don't want Blue or Purple seals to show up
at all?
Currently, yes
i would take ownership and give them a weight of 0 for random stuff
for fixed stuff like the spectrals it depends on what you want them to do but you can also take ownership of those and remove them from the pool
does this work?```lua
if v.hidden and not v == "jen_omegaconsumable" then pool[#pool+1] = v.key end
for other things you can hook set seal but it will be wonky
i figured for the cards that directly give them, it was just the overall pool i was a bit stumped with
mayhem dev would like to have a word with your choice of prefix
what