#💻・modding-dev
1 messages · Page 269 of 1
But idk where it's defined
yeah so uh
And I don't have access to the source rn
local gfts = G.FUNCS.toggle_shop
G.FUNCS.toggle_shop = function(e)
gfts(e)
if G.GAME.USING_RUN then
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.5,
func = function()
G.GAME.USING_RUN = false
G.GAME.USING_CODE = false
return true
end,
}))
local hand_count = #G.cry_runarea.cards
for i = 1, hand_count do
draw_card(G.cry_runarea, G.hand, i * 100 / hand_count, "up", true)
end
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.5,
func = function()
G.cry_runarea:remove()
G.cry_runarea = nil
G.STATE = G.STATES.SELECTING_HAND
return true
end,
}))
end
end
tried that too
this bit looks like it's handling getting back from shop into run
and also
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''ease_background_colour_blind(G.STATES.SHOP)'''
position = "at"
payload = '''if not G.GAME.USING_RUN then ease_background_colour_blind(G.STATES.SHOP) end'''
match_indent = true
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''if self.STATE == self.STATES.SELECTING_HAND then'''
position = "before"
payload = '''if G.GAME.USING_RUN then self.STATE = self.STATES.SHOP end'''
match_indent = true
these two patches look relevant, but didn't really look into what they patch into
top one just stops the bg from fading into the shops bg
yeah the second one is more interesting
bump
i think its jsut so that the cards you get in packs and stuff are the same as the ones you hold?????
not sure what this one is about
# Run - don't clear shop
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''if self.shop then self.shop:remove(); self.shop = nil end'''
position = "at"
payload = '''if self.shop and not G.GAME.USING_CODE then self.shop:remove(); self.shop = nil end'''
match_indent = true
i think i just have to find out how the game removes the blind selection
can't be, apparently they're literally preventing you from opening packs
--Run - don't open packs in shop
ive done it before what
might be on an old af cryptid
i mean you don't really need to remove the blind selection
it duplicates itself so either i remove the old one or stop the new one
that's not what you should be focusing on, it's about the leave shop button doing a state transition into blind selection by default that needs to be patched to go back into play instead if your conditions are met
cause i'm pretty sure blind selection is a state
from cryptidless smods:
G.FUNCS.toggle_shop = function(e)
stop_use()
G.CONTROLLER.locks.toggle_shop = true
if G.shop then
SMODS.calculate_context({ending_shop = true})
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
G.shop.alignment.offset.y = G.ROOM.T.y + 29
G.SHOP_SIGN.alignment.offset.y = -15
return true
end
}))
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.5,
func = function()
G.shop:remove()
G.shop = nil
G.SHOP_SIGN:remove()
G.SHOP_SIGN = nil
G.STATE_COMPLETE = false
G.STATE = G.STATES.BLIND_SELECT
G.CONTROLLER.locks.toggle_shop = nil
return true
end
}))
end
end
pretty sure you just need to patch this line:
G.STATE = G.STATES.BLIND_SELECT
with something to conditionally go back into whatever state you came from
which file is this
i should mention that you do start in the blind_select state
and then when skipping a blind it will open a shop
three spectral cards all done
so hold on, what exactly is the issue, is the blind select in the background never going away when you're going into the shop?
oh
okay let me look at what the blind select button does then
trigger = 'immediate',
func = function()
ease_round(1)
inc_career_stat('c_rounds', 1)
if _DEMO then
G.SETTINGS.DEMO_ROUNDS = (G.SETTINGS.DEMO_ROUNDS or 0) + 1
inc_steam_stat('demo_rounds')
G:save_settings()
end
G.GAME.round_resets.blind = e.config.ref_table
G.GAME.round_resets.blind_states[G.GAME.blind_on_deck] = 'Current'
G.blind_select:remove()
G.blind_prompt_box:remove()
G.blind_select = nil
delay(0.2)
return true
end}))```
i literally think it's just this
G.blind_prompt_box:remove()
G.blind_select = nil```
Anyone can help with making custom poker hand. I want to make poker hand which will be plays when hand contains one 5 and one 2 with same suit. I read steamodded wiki and watched examples but I still dont understand
I will investigate this in a minute
how can i add a card to a pool that isnt the pool of an objectType?
this worked but now uhhhhh
progressish
how do people add the compatibility popup to joker descriptions?
like blueprint?
mhm
im not sure i fully understand
you need to return a UI table in main_end
here's an example on how I added the "Removes negative from copy" tooltip to a Joker I made
the blueprint one is more complex cus it's not just a line of text
it has a background and stuff
ahh, thanks
how would i make the number actually change in the description for a scaling joker
oh, cool! thanks!
Hello!! I was playing around and ended up making a modded deck similar to Ace in the Hole, but with a random card (so not always Aces)
I wanted to see how to add the config tab, but the mods that do have them are HUGE. Is there a simpler example?
https://github.com/Steamodded/smods/wiki/Mod-functions#modconfig_tab Did you read this
I did not! I was mostly just playing around with Ace in the hole but it just went crazy from there tbh - thanks a bunch!
I just realized everything I did is deprecated lmao
How do you create a deck if not with the deprecated function thingy?
im trying to get a consumable i made to say "Nope!", ive gotten it to make the text using attention_text(), but its displaying it in the top left corner, how could i get it to display on the card im making?
Is there a function i need to call after start_dissolve to fully remove a playing card from the deck? Realizing now that dissolve is just the visual
ik card:remove() will delete the card
classy, simple... i like it
theres also a context for removing cards in blinds
what did I do
did you use create_card instead of add_card ?
bah
no I hooked Node.stop_drag
except all I did was add a print
nothing should've broken like this
what exactly are you trying to do with this removal
discarded cards with gold enhancement are destroyed, I already have all the logic in context.discard and context.other_card.config.center.key == "m_gold". Was previously just running context.other_card:dissolve but that just visually removes the card from the deck
how would i get the eternal tag hint near the description?
don't think its in G.P_CENTERS
maybe something like this
if context.discard and SMODS.has_enhancement(context.other_card, 'm_gold') then
return {
remove = true
}
end```
is temporary the way perishable is called in the souce code?
you might need to add an extra check for context.destroying_card maybe i dont mess with card destruction all that much
but this code block should be somewhat similar to your final product
I'll look into it, thanks
Is SMODS.has_enhancement better than context.other_card.config.center.key for any reason?
Functions can be interacted with
Smeared exists but Smranked doesn't
SMODS has quantum enhancements functioning
so mods can make use of it
what victin said
it also looks prettier if thats of any worth
that is of the most worth
truth nuke
New Blind
can i assign multiple ids to a certain card, like 6s may be treated as 6s and 9s for example
you can make 6 be treated as 9s, or 6 treated as 9s and 9s treated as 6s
basically, switching ranks instead of multiple
How did you achieve this? i thought quantum ranks were still pretty unusable
I just switched the ranks, they aren't multiple ranks, so 3s are 8s not 3s and 8s
When I ran into this, I just made the relevant cards into Face cards
teto
I had to do a similar thing for a different joker, i'd much rather have the quantum rank version
Teto?
could anyone help with this?
@formal parrot ?
can't you just return your message
Maybe it doesn't work
I do this for that effect G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function() attention_text({ text = localize('k_nope_ex'), scale = 1.3, hold = 1.4, major = card, backdrop_colour = G.C.GREY, align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and 'tm' or 'cm', offset = {x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and -0.2 or 0}, silent = true }) G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.06*G.SETTINGS.GAMESPEED, blockable = false, blocking = false, func = function() play_sound('tarot2', 0.76, 0.4);return true end})) play_sound('tarot2', 1, 0.4) card:juice_up(0.3, 0.5) return true end }))
ye
but it seems to be different for consumables
Showdown Boss Blind idea:
+X0.5 Blind size per $1 of sell value above $10
cooked
may need some diffrent colors for the sprite though, would appreciate some suggestions
bang bang
teto.
@formal parrot
how would one make an editions shader so that it just is all one colour and it is different shades of said colour
I love you
Thank you but I don't understand whatever I could've done to deserve such comments
Eremel and stupid have done it
that does not mean shit to me
but suggestion is to look at colors according to human perception
and hueshift them to the same hue in the perceptual space
@ Eremel and @ stupid
check out the example shaders
?
I was thinking that someone could create a mod that adds a virtual keyboard input button. For example, if a mod requires keys like F2 or TAB, we could have a button on the screen for touch users.
For instance, the Brainstorm mod needs the Z and X buttons, as well as the 1, 2, 3, 4, and 5 buttons. In this mod, Z+1 adds a save, and X+1 loads a save.
im trying to get to the chat
is there a limit to the number of sprites you can load from a single atlas?
its stuck in suggested
Great
@tall wharf
i like this one a lot
the atlas has a size limit
simple strong effect, it should scale just about the same rate as red card
maybe more if you really dont want/cant have enhanced cards
it should be within the limits
this should be right
pos = {x = 1, y = 6},
Is that mod possible?
is the atlas key correct?
maybe idk
yeah, it's the same as all my other jokers
aiko has basically added a functioning visual keyboard
double-checked the spelling and everything
Can u show me please?
its def possible, but you will be driven mad by how UI works in this game
Did you update the texture file? Both of them?
@tall wharf if he/she comes plz let him/her know if he/she could help me
the humble they:
I could have sworn I saved it to the 2x folder...
the word they exists my man
we love it here
Why?, btw the visual keyboard is that a mod or
It's part of scrabble
its part of their scrabble mod
the humble red card:
Is there any pics I could check
if you're interested in learning how it works you should ask them, but i think it might be too big for a first project
skip to 14 seconds to see the keyboard
but most of their stuff is worth checking out, its very creative
skip to 14 seconds to feel like a Victorian child eating a tablet with social media installed in it
I wanted to create shortcut keys for touch users even if I got a lil guide from anyone to get this mod work for example in Brainstorm mod or the DebugPlus/menu mod which needs keyboard inputs
shader tomfoolery
It's insane 🤯
anyone got a good rgb to hsv code for the shaders
thunk
?
the vanilla shaders have one
oh my god it’s the creature
creature feature, featuring the creature
oh nice
can you put vars inside the name field of loc_txt?
No
darn
what would they even do 😭
change the display name of the joker on the fly
so you want a dynamic name huh
you can do it with Card.generate_ui
thanks 🙏
Example
I'm making a joker that updates its name as you upgrade it
Would there be a way to make Vampire not clear a certain enhancement? Without just like, stealing the Vampire code and shoving in if enhancement then don't
is there anyone here familiar with attention_text() that could help me out with using it?
I think stealing the Vampire code and shoving in
Actually... what if I just give the enhanced card the vampired variable when it's spawned?
If a card is already vampired then Vampire will ignore it
Possibly? That might be a value the game is constantly setting tho
You should try it out, it sounds like it could work
This is the only place it tries to set the vampired tag, and it only sets it if vampired isn't already set
It worked
Huge
Now I just need to figure out how to prevent them from being set to enhancements using Tarot cards
I might just make them check to see if they're selected alongside a Tarot card and make them destroy themselves
You could create a new boolean attribute for playing cards which is enabled when this enhancement is given and you patch in a check for if the attribute is enabled and the enhancement is no longer correct
Cryptid has decks that only allow one Enhancement to exist I think
The destroying method works, and I kinda like that it does, the enhancement is meant to destroy the card once it's played, discarded, or at the end of the round, so it makes sense that trying to change the card would also destroy it
weight = 0, that's how I did it
i forgot im gonna remove it
how can I stop an enhancement from showing up in my thoughts? I keep forgetting I'm gonna remove it

remove the weight in your brain (if it got any)
How would I override the loc_txt table after the card has been initialized? I want a card to have a different description when it's in the shop vs when it's in your jokers
apparently, there is no context for after the deck's final scoring step occurs
in loc_vars return key = whatever
The description itself already has variables and stuff inside of it
return { key = in_shop and 'key_when_shop' or 'key_when_not_shop', vars = { ... } }
i.e. the final_scoring_step context occurs before the plasma deck's balance happens
you will have to use localization for this I guess then
where could i find the position variables for the side menu? i see the table layout for a lot of the elements but is there an easy way to shift the menu over to the left some more?
There's a SMODS.process_loc_text function but it doesn't seem to actually work
just use a localization file
I don't know how to set up localization
Apparently no jokers natively use the context.final_scoring_step
Mods/your mod name/localization/en-us.lua
Is this what I'd use for the loc_txt?
In that file do something like
return {
descriptions = {
Joker = {
j_yourmodid_yourjokerkey = ... -- the stuff you usually put in loc txt
}
}
}
Then you can just remove your loc_txt in the joker
How would I differentiate between in shop and not in shop?
in your loc_vars check if card.area == G.shop_jokers
I want to retrigger only lucky cards in this function:
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
for k, v in ipairs(context.scoring_hand) do
if SMODS.has_enhancement(v, 'm_lucky') then
return {
message = 'Again!',
repetitions = 1,
}
end
end
end
end
But currently this is retriggering every scored card if lucky card is being scored, whats my error?
in your loc_vars function
So this?
Yeah, you don't need the or part now that I think about it
use a calculate function
can i do that on editions?
yes
for mod dev purposes, i'm not very familiar with lua but is there some way to get a debugger or shell inside a running instance of balatro with a mod?
debug plus
is that another mod?
yes
and you can use that to evaluate lua or print variables or similar?
yes
Got it working
Though after removing if self then to the remove_from_deck function so it doesn't get nil it doesn't reset when you remove the joker
Alrighty
How could an extra line be added to card tooltips like how Hiker or Enhancements do?
for example
loc_vars = function(self, info_queue, card)
if card.area == G.shop_jokers then
return {
key = 'shop_key'
}
else
-- info_queue stuff
-- here the key will default to the key of the joker already
return {
vars = {} -- your vars
}
end
end
something like this, adapt it to whatever you need
instructions unclear removed all gravity affecting my brain
universe is now massless
I did it in the opposite direction but yeah
that works too
you can skip the key when it's not _shop cus it defaults to the key of the joker
How to convert taliman's big number to regular number?
use to_number
ok
make sure to define it if it doesn't exist
Man adding Talisman compat for Saturn such a pain
Like this?
to_number = to_number or function(x)
return x
end
Cool
So return the key for if it's in a shop and return the variables for if it's in jokers?
I mean it works the way you have it, just that specifying the key is not necessary when you're gonna put the same key of the joker
bump, any ideas?
context.repetition is called for each card individually already so remove the for loop and just use context.other_card instead of v
Yeah, you're checking if there's a lucky card in hand, not if the card that's retriggering is lucky.
gotcha okay thank you so much
i see, i misunderstood how that context works
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
if SMODS.has_enhancement(context.other_card, 'm_lucky') then
return {
message = 'Again!',
repetitions = 1,
}
end
end
end
end
like so?
omg it worked
ya, you can skip the message too, it's done by default
awesome thank you both :)
ooo okok
better to skip it too cus it's localized properly by default
that makes sense
agony
Squeeshed Joker
so, I've been using card.children.center:set_sprite_pos({x = 0, y = 5}) to change the base sprite of a card, but is there a way to do this with the soul sprite instead?
awesome, thanks!
yw
it worked! 🙏
srsly, does anyone have pin permissions?
looking in UI_definitions.lua for the side menu position, it looks like a lot of the table definitions are in create_UIBox_Hud(). haven't been able to achieve anything from changing the padding or scale. any ideas?
unfortunately doesn't seem possible to paste in debugplus console 😦
you definitely can paste
how do i allow for selecting multiple consumables at once
Huh, I'm trying to hook an SMODS ui function but it's seemingly not letting me
Oh wait no I see. that's specifically for the mod additions
Is there a conventional way to use pseudorandom for simple "1 out of 7 odds" events? seems like most mods just use math.random but that ruins seeded runs no?
obv couls use just {true, false, false, false, false...} as the pool but wanted to know if there was a more conventional way of doing it
I haven't seen a mod use math.random, honestly
Pseudorandom can work exactly for that, no? Or am I misunderstanding what you need it to do?
I've only seen it used for a random item from a table not for "1 in 7 odds", but maybe im mistaken
yeah
pseudorandom("what") < 1/7
np
Ah yeah, pseudorandom_element and pseudorandom are different functions indeed
is this correct?
looks right
the joker_main doesnt do anything...
is card.ability.extra.chips above 0
isn't it because your intendentation is fucked?
uhhhh 
fix the indentation and you'll see the issue
if context.joker_main is inside context.individual block
💔
this is why you make sure your indentation is fixed before working on anything else chat
code easier to read = easier to fix
Which the exception of python I don’t think any programming language cares about indentation when it comes to executing the code so it’s better to do whatever is most readable
i think im gonna make my shit in one line how about that
Well I’m not the one debugging the thing so I don’t give a rats ass
setting up an automatic formatter is the best thing ive ever done
i still need help with this, been trying to make it work all day and im going insane 
Which ide are you using?
nvim
Ooh that’s cool
not that the choice of editor matters formatters are cool
screw u, respectfully:3
D:
wait, how did u do that
would this be the right channel to ask for help with an error?
its not
if its crashes about other mods then #⚙・modding-general
but this is the only active modding channel
I don't know what editor you use but there's probably a plugin that autoformats lua code
I’m so nvim pilled
Best keybinds, I don’t know how people go their day with using arrow keys or mouse
sound-imatic
im so lonely :3
can sm1 maybe help me in modding chat?
Multiple phase Blinds? interesting...
anyone knows where the code for the particles floating in the screen is?
I have a joker that does an effect when a card is sold, how do I make it not check for itself?
I tried like this but it doesn't work
Can I use vanilla faster scaling in challenges, or would I have to implement it from scratch?
😭
if context.selling_card ~= card then
aka checking whether the card being sold is itself
I watched the youtube tutorial for creating a joker and they use in_pool Is that necessary for getting my joker(s) to show up in the game naturally in the shop?
still doesn't work
here's the calculate
No, that's used for the opposite: to make the joker not show up
if context.selling_card and context.selling_card ~= card then
I think I tried that but let me double check
you don't need to check for debuff in calculate and self can never be debuffed because it's not a card
let me see
oh ty
very cool
it still doesn't
it's current sell value is 4, then I sell it which triggers the selling card thing and it upgrades so it sells for 2 more than it's supposed to
i need the cocolia boss fight theme in balatro
thats the next boss im adding
its kinda weird how SMODS.Blind doesnt support custom bg color for showdown blinds specifically
what's it supposed to do exactly?
boss_color is completely ignored if its a showdown blind, since it shoves into your face the balatro color-themed background instead
💔
time for lovely patches 🙂
gain sell value when any other joker is sold (rn it just checks for any card to be sold but I'll add the joker check later)
I'd like it not to count itself towards the "any joker is sold" becuase it looks confusing when playing
you need to use card instead of self
and you know what, its also weird how particles arent saved
like wtf is this
"MANUAL_REPLACE" my ass 😭
had to hook that to start_run too, basically recreating the particles every time ghh
oh wait i see the problem
calculate takes 3 arguments
oh
mmm
might as well work on cocolia while im on this
then release both boss blinds at the same time :3
🔥
luckily the instrumental and vocal tracks are of the same duration
so i can use sync for this one
lets see if i can do the fight justice
I did that and also changed all the self for card
but now it tells me that context is a nil value
can you post the full crash log please
sure gimme a sec
I need to figure out how to make different objects in the same consumable type have different shop appearance rates
Does anyone have any experience doing something similar?
Remove the self argument.
why is that? am I missing something
I mean I tried it
it worked just like before when it had self
didn't crash but it still counted itself
i'd say update steamodded just in case
The calculate for that addition appears to only lead to 2 args.
and if it keeps happening send your full object
only if you can't keep up with it
i think my mod officially reaches 10k lines now
after 1 month of constantly working on it
:3
yipee
my localization file has like 3500 lines now
yeah
i only have 22 so far
I have 209 :3
my localization file is only 900 lines rn
that's like 2x lovely's LOC
-# wtf :3
I just wrote like 50 more
how do i do this
in my defense - my mod adds too many new mechanics, and i added too many things to implement them easier 💔
I already have the latest version so
this is the whole jokers thing
I did make this mod on top of a tutorial mod called samplejimbos btw
I assume that matters?
I can send the whole .lua file if needed
modify G.jokers.config.card_limit
ok how do i change that in a way that doesnt end up making it happen infinitely
where are you actually calling SMODS.Joker
oh is this 0.9.8 compat stuff?
if #G.playing_cards >= 60 or #G.playing_cards <= 20 then
if not (some var to check, making sure that it doesnt increase the limit everytime) then
(some var to check, making sure that it doesnt increase the limit everytime) = true
G.jokers.config.card_limit = G.jokers.config.card_limit + 1
end
else
if (some var to check, making sure that it doesnt increase the limit everytime) then
(some var to check, making sure that it doesnt increase the limit everytime) = false
G.jokers.config.card_limit = G.jokers.config.card_limit -1
end
end
smt like that?
i forgot if its playing_cards or playing_card
I assume this thing
I didn't write it, it comes from sample jimbos
no clue srry
I started yesterday so I don't know compatibilities and stuff
change it once, set a boolean to true to signify that you changed it and then revert it back in remove_from_deck or when the condition stops being true
doesnt jonkler's calculate always have self, card and context in calculate
Replace all that is inside the for loop with SMODS.Joker(v)
you should look at the example jokers to see how it is done now, some things like loc_def are not used anymore
https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua
example mods should include localization too smh...
you can PR it 🙂
gg ez
im not confident in my coding skills enough to actually do a PR :3
confix
shhhhhhhhhh
oh ty!
I'll try it tomorrow, seems like I'll have to change a lot of stuff
is that
more like cocoolia because shes cool
she's not cool
wildfire hits so hard im on my knee every time
cocooln'tia
🧎♂️
oh wow we're not respecting women over here
😭
not this specific person, naur
shit how do i make it go down when i sell the card
remove_card
remove_from_deck function
love it when SMODS documentation isnt correct
that looks like the edition docs
it is
the setting to false should be there too because it's called on debuff
remove_from_deck is not on an edition i'm pretty sure
its edition?
neither is calculate but that works too
ok wait i think i gotta change my jokers
😭
thats concerning
edition does have calculate
not in the docs
i guess you use on_remove for editions instead
thats what i did
where can i access the number of boosters in the shop?
it didnt work
nvm, i think its fine
false alarm ❤️
what
weird
we have false alarm in this server?
oh yeah, maybe check context.selling_card or smt in calculate?
this is when you look at the source code
you should probably keep on_remove though
it just doesnt run for when the card is being destroyed/sold, i think
yea it doesnt
worst case scenario you might have to hook Card.remove
nop
tf is card.remove
i think it pretty self explanatory
#G.shop_booster.cards
im pretty sure
removes the card
i have never seen this before
ig more specifically how could i change the number of boosters in the shop?
SMODS.change_booster_limit
i actually wonder why context.card_removed or something hasnt been added yet
wish we knew
...wait wait wait
you are telling me
cocolia, the supreme guardian of belobog, the embodiment of ice aura
shares the same VA as Corin???
😭
what
who wants to tell me how i fucked up this time
Card not card
And make sure to check if self.edition and self.edition.type ... cus the card might not have an edition
isnt it edition.key
either works
huh
didnt know theres a lot of ways to refer to an edition
how might one change the displayed name of a Joker?
genshin impact
how does the localization file know which description is for which joker?
this is svarog's, its consistent
it has the same key as the joker's
thats what i thought but ive seen multiple mods where thats not the case and it still works
What's an example
mine works that way, i dunno
it's always j_modpefix_key
ohhhh
(for jokers)
pefix
yeah smods will add those prefixis for most things
gotcha okay that makes sense now
cause i spent the last 30 mins scrolling through every mod i had installed and had no clue
how it connected
i use generate_ui but there's probably a way to do it by returning a new key in loc_vars
you'll have to make a different localization entry for the one with a different name
or directly make your own generate_ui
probably have to change how this is worded to fit in 💔
like,
-20% Ice, -20% Quantum or some shit
ghh
I want it to be literally identical in every way and the only thing that changes is the display name
add symbols 🙂
:3
Add new colors for the elements
this wouldnt work right?
it wouldnt
because of the extra "_"
if scdrl is your modprefix don't put it in the SMODS.Joker call
i think smods ignores the prefix even if you put it there
true...
im gonna work on that later, since that means i will have to rework jokers' description pages a bit too
actually, how do i do that
:3
i forgot
PefisBeaver
wergogkwerhplwe
patch or hook loc_colour in misc_functions.lua
i wish you choke on your pepsi for that one.
got it to work, thanks guys!
yw
id rather DIE before i add a patch.
:3
of course it has to be joyousspring 😭
thanks :D
patches are cool
why not
they look ugly
patches are literally just
almost all my patches are UI related
"hey there is this line of code I want to add code after/before"
All my patches are really simple
yeah, but...
gray files
"hey you have this voucher, increment this variable by exactly 1"
get toml highlight
get toml highlight
always try to avoid using at
yeah, its a patch from multitextbox
not using it rn tho
the plugin i downloaded makes comments highlighted sometimes 💔
my favorite patch
gradients are automatically added to loc colours now which is cool
oo
oh thats useful
my primary issue with patches was that its usually the cause of crashes
i like patches which prevent crashes though
i mean i wouldn't advice copying that one it's probably something dumb I'm doing with one of my card areas
am i not using your card area code though
i bet its cus of the unscoring card area
that is not actually a card area
but is returned from SMODS.get_card_areas
if crash then pls_dont() end
and is a string
but why doesn't it crash normally tho
sooo
cus it depends on the optional feature being toggled
at least that's what happened to me
if i use {C:hsr_wind}, it should work now right?
some other mod was using it
i dont have it toggled and i dont have other mods :3
also im pretty sure the log said it was because my card area didnt have a cards field when exiting a run for some reason
also, im trademarking "hsr" as my mod prefix, sorry future balatro hsr modders
yes
then idk
my localization file is full of joy_ (not joy from me i hate writing descriptions)
joy
i love writing descriptions
my players dont read my cards so why bother
yeah i saw that 😭
i get dopamine from a well written description
and you know maybe one or two people will actually read it properly once
i like the description writing part i hate the color coding
im still glad that some people figured out how qingque works through her description
i also have to write like 50 at a time so it doesn't help
my code handles it for me
:3
i just put text without colors in, then it auto-colors everything for me
its convenient
i use a lot of colors
actually, i can just do this right
tldr
im so proud about ability transfers theyre so cool
why does divine color look like sh- 😭
I vote C = "something" instead of ["C"] = "something"
Same with ["Wind"] and ["Suit"]
454561564
Ya I am voting on your code
i am voting against your code
Me too
Hello, all! Today in a break from work I spiraled and begun modifying a deck mod but I've hit a wall regarding custom deck creation and the mod config menu
I'm not entirely sure what I'm doing + I don't know much lua so I'm a bit lost
I have a modified version of "Ace in the hole" (which makes you begin the game with 4 aces, one of each suit). Right now, my modified version makes it so the card type is random every time you play. You can also set how many cards to begin with of each suit, and also a boolean to get a spectral pack after each boss blind (just for fun I guess)
However, I'd like to change these settings from the config menu in the mod screen itself - but the Deck API seems to be deprecated, an I'm not really sure how to connect it with this menu. I've managed to make it appear based on this: https://github.com/Steamodded/smods/wiki/Mod-functions#modconfig_tab
But I can't for the life of me understand how to actually connect that to the mod itself. Plus I need a drop-down selector, or some sort of text input so you can pick the card type (2-9, T, J, Q, K, A). The rest would be just a number input and a boolean.
Can anyone point me where I can read more about this? the git says to "see 'Building a UI' page" but I can't find it either 😅
this is the UI page https://github.com/Steamodded/smods/wiki/UI-Guide
wee
https://github.com/Steamodded/smods/wiki/UI-Guide#helper-functions this part is important too
what does this crash message mean?
Tho that doesn't look like your files, so you probably messed up the type of some argument
what's your code
lmao I can't believe I didn't see it 🗿
...what happened to imaginary?? 😭
the documentation for how to actually use generate_ui to modify descriptions is rather sparse
you forgot to define it?
SMODS.Joker {
key = 'spook',
atlas = 'scadrial',
pos = { x = 0, y = 0 }, -- TBD after new art
rarity = 1,
cost = 4,
unlocked = true,
discovered = true,
blueprint_compat = false,
config = { extra = { rounds = 8 } },
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.rounds
}
}
end,
}
this is my new joker
looks like the default text color
oh
accidentally uppercased that
:3
silly me
-# maybe thats foreshadowing welt's fate in the upcoming versions
it's the ugliest part of my mod's code but you can look at it for pointers (all jokers have generate_ui point to this function) https://github.com/nh6574/JoyousSpring/blob/1b08302dd479967067c04d7c18a7ed5fe3aef684/src/card_ui.lua#L221
gotta darken wind and imaginary guh
--Function to check if Aces, 2s, 4,s and 8s appear in played hand/discard
function Card:is_preservation()
local id = self:get_id()
if id == 14 or id == 2 or id == 4 or id == 8 then
return true
end
end
local mod_path = "" .. SMODS.current_mod.path
local function load_folder(folder)
local files = NFS.getDirectoryItems(mod_path .. folder)
for i, file in ipairs(files) do
SMODS.load_file(folder .. "/" .. file)()
end
end
load_folder('src/joker')
this is my main file that loads in those jokers
I may take a peek then 👀
does this make it 20% darker?
percentage
uh
0.2 i think
well you know what i mean
that is NOT percent 💔
localthunk is on my side once again
no idea sorry
all good im going to revert back to a version that worked then go step by step
its actually hard getting a decent yellow color
without it fading into the white background
😭
ok maybe thats it
how do i blacklist cards
when i create random cards
local randomsets = {'Joker'}
for i, v in pairs(SMODS.ConsumableTypes) do
table.insert(randomsets, i)
end
functions Starry.random_add_card(blacklist)
SMODS.add_card({
set = randomsets[math.random(1, #randomsets)]
})
end
why dont you use gold
🤷♂️
use gradient
which table should be referenced for the mod's config? I tried SMODS.current_mod.config but it's being set as nil?
SMODS.current_mod only refers to your mod during the loading stage
so you should store it somewhere or use SMODS.Mods.yourmodid.config
how do you arrange mods in your mods settings? like is there a way to order them?
i think they're sorted by mods with a config first and then loading order
hmm i tried just putting my mods' priority at -160000 from being originally at 0
didnt change position
is it after mods with a cogwheel
yeah
then it's what i said
oh like when you say config you mean they have a setting to apply not a config file in the mod
gotcha
okay that makes sense, thank you
gotcha
I do not feel any closer to figuring it out after looking at this...
if you need to change the name you just need the second line
just the full_UI_table.name bit?
yes
full_UI_table.name = localize { type = 'name', set = "Joker", key = "your_key", nodes = {} }
but what value there actually changes the name?
localize takes the name from your localization file and makes the UI for it
(you also need to call SMODS.Center.generate_ui or the rest of the description won't show up)
ah, well I don't have localization file
nvm, its just my vsc being slow and fucked up
:3
is this what coding on a bad pc feels like
then get one :3
is there not just a quick and dirty version that lets me set the text manually?
element color changes now
yes, make the UIElement table for the name yourself
I don't understand how this changes the text if there is no text field in the thing I'm setting
print(tprint(full_UI_table.name))
SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)```
or, I guess this method only works with a localization file
This should work in my head, but it's crashing when trying to figure out the width. Automatically setting the width also doesn't fix it. The idea is to have a slider to go from 1 to 14 to select which card rank to use and It works (ish) but I want to display the selected rank in real time. Any ideas?
local rank = "Rank: "
if SMODS.Mods.AllOfOne.config.only_one_rank_all_of_one == 1 then
rank = rank .. "Random"
elseif SMODS.Mods.AllOfOne.config.only_one_rank_all_of_one == 11 then
rank = rank .. "Jack"
elseif SMODS.Mods.AllOfOne.config.only_one_rank_all_of_one == 12 then
rank = rank .. "Queen"
elseif SMODS.Mods.AllOfOne.config.only_one_rank_all_of_one == 13 then
rank = rank .. "King"
elseif SMODS.Mods.AllOfOne.config.only_one_rank_all_of_one == 14 then
rank = rank .. "Ace"
else
rank = rank .. SMODS.Mods.AllOfOne.config.only_one_rank_all_of_one
end
return rank
end , ref_table = SMODS.Mods.AllOfOne.config, ref_value = "only_one_rank_all_of_one"}),```
inside the table with n = 5 the config should have a dynatext object with the text I think. I don't know if you can edit that easily tho
yeah, I used tprint so I'm not sure why it isn't showing that information. So either it's not easily editable, or I called the wrong thing inside of localize {}
never used tprint, does it have a depth limit?
I don't think it does, but if it does its depth limit is higher than a regular print
I'm just surprised there isn't just an easy way to say name = "text" and be done with it quickly
it's not that simple
all right, time to figure out localization files
i have my own fields in the localization because im built different
I lied, I do have a localization file, default.lua
that I used for the tooltip for my Daily Double Joker
you need to return key in locked_loc_vars doesn't seem that complicated
already
and what's the problem
blank description
isn't it unlock instead of unlock_parsed
how can i add the eternal description to a card with info_queue?


it's been there the whole time
unlock works but I forgor to provide locked_loc_vars
i think it's this but i dont have the game's code with me rn
info_queue[#info_queue+1] = {key = 'eternal', set = 'Other'}
I can't completely ban planet cards, can I?
from where
Challenges
I put down all the appropriate IDs, but Pluto seems to love showing up still
in the shop or only in packs
so something like this then?
Other={
sword_0 = {
name = "Goddess Sword"
},```
```full_UI_table.name = localize { type = 'name', set = "Other", key = "sword_" .. math.min(card.ability.extra.level, 4), nodes = {} }
SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)```
Packs are all banned, just the shop
yeah you might need a patch for that probably
what is patching, anyways?
just to be sure, this resets your hands back to max hands right?
basically: injecting your own code to a file
well this did not work
you need to modify create_card_for_shop most likely and remove the planet check
I'm assuming that Pluto still forcibly appears as a failsafe for cards that happen to have blue seal
so what have I done wrong here?
I ended up beating a blind with a flush in that challenge and a blue seal card created a Pluto card
did it not show anything or did it crash
oh well i might be confusing it with another problem
it's most likely done to prevent a crash, if anything
can you show me the full code in the joker?
Still an issue though since the crux of one of my challenges is relying on Tarots, Spectrals, and eternal Abstract and Madness jokers to beat the blinds without any forms of hand scaling
weird, I don't see anything wrong
you can patch blue seals out too or at least their functionality
maybe I need a text filed in the localization even if it doesn't contain anything?
maybe!
I'll try it at least
That's as simple as writing code in the challenge's lua script, I hope
probably not lol
I don't have the code with me rn but if you search "Blue" in the game's code there's a part where it checks which planet corresponds to the current hand and creates the card
yeah that was it
its probably the pitch, how do i set it to normal?
I guess it doesn't recognize it as valid if it doesn't also have a text field
thanks for the help! definitely would not have gotten there on my own lol
nvm
❤️
update: that's what create_option_cycle is for, and for future reference it need a callback function stored in G.FUNCS
ignore the hedious green
I can now die happy I should be asleep
I would be offended if not for the fact that it does look like ass
im forever questioning your privilege to design uis
someone quick give me a color I cannot be trusted
I am forbidden from doing so at work, so yes, you should
do you specifically hate red or something
G.C.aikoyori
true
I only wanted to play around with the settings 😔
wait you can?
please make the background not that colour
you gotta make your own gradient for that one
you can change the background color?
is that comic sans
WHY IS YOUR BACKGROUND ROUNDED
WHY IS MY UI SO ASS, I'VE ONLY BEEN PLAYING AROUND FOR 2 HOURS I SHOULD BE A GOD BY NOW
true
can we exchange brains for a bit I wanna see smt
at least you didn't use a shit green 😔
but thats not impressive anymore
Ok so where's the make_background_pretty helper function?
fuck it we ball it's good enough I have work in a few hours
shit bg tbh
I have 0 idea on how to change it I didn't even put a bg node and I'm not willing (atm) to look up how to unshitify it
I am the single user of this mod nobody will know
imma make it shit green now thanks
please end the development now
you've given me unholy powers that I am in no way qualified of using for good
G.C.CLEAR also works if you just want to hide the background