#💻・modding-dev
1 messages · Page 327 of 1
do you like my joker
btw for manually loading files you should prob do something similar to entropy where you store file names in a table then load them instead of calling SMODS.load_file manually multiple times
😭😭😭😭😭
oh my god please teach me how to do ui
gulp
lua is frustrating sometimes, it SCARES me that its one of the easiest languages to code in
im technically doing that for jokers by rarity but that's it
Here it is
Divide every number by 9 cause this is the breakdown among the "minority groups" and 1/9th answered the question
i was just looking at entropy to see how you did it lmao
ie:
local files = {
"tags",
"jokers"
}
for i, v in pairs(files) do
local result, err = SMODS.load_file(v..".lua")
if results then results() else error("error in file: "..v..": err)
end```
thank you ruby this is perfect
?
Statistics jumpscare
i legit just cant use my leftshift for a while gg guys 😭
Like, a 3.5% of trans people is enormous compared to the average
It's honestly quite funny
programmer socks :)
did you get a shift lock moment
insert roffle lite speech bubble image
ive been around trans people for like 5 years its quite embarrassing i didnt realize i was trans until a year ago
no my keyboard is just old as hell and needs some time to dry out
:((((
Oh no I can't use my backspace or arrow keys! (I didn't tap alt)
i like it!!!!!
this looks so fun
Voucher city
i love vouchers
i think it should give you an extra booster pack just for the funsies
last time i showed it off i got clowned
hey folks,
trying to import some card art for face cards.
a) does the art need to be in a sprite sheet?
b) do the cards need to be a certain width apart?
c) I copied the code from another mod I found and tried to only edit what I needed to. Is there any reason code-wise that my game is crashing? ```lua
local atlas_key = 'MW' -- Format: PREFIX_KEY
-- See end of file for notes
local atlas_path = 'MW_lc.png' -- Filename for the image in the asset folder
-- local atlas_path_hc = 'MW_hc.png' -- Filename for the high-contrast version of the texture, if existing
local suits = {'hearts'} -- Which suits to replace
local ranks = {'King', 'Queen', "Jack"} -- Which ranks to replace
local description = 'Mouthwashing cards' -- English-language description, also used as default
-- You should only need to change things above this line --
SMODS.Atlas {
key = atlas_key .. '_lc',
px = 71,
py = 95,
path = atlas_path,
prefix_config = {
key = false
} -- See end of file for notes
}
if atlas_path_hc then
SMODS.Atlas {
key = atlas_key .. '_hc',
px = 71,
py = 95,
path = atlas_path_hc,
prefix_config = {
key = false
} -- See end of file for notes
}
end
for _, suit in ipairs(suits) do
SMODS.DeckSkin {
key = suit .. "_skin",
suit = suit:gsub("^%l", string.upper),
ranks = ranks,
lc_atlas = atlas_key .. '_lc',
hc_atlas = (atlas_path_hc and atlas_key .. '_hc') or atlas_key .. '_lc',
loc_txt = {
['en-us'] = description
},
posStyle = 'deck'
}
end
code jumpscare
sorry. meant to send as a file
ally
:3
aikoyori when are you adding ally as a joker
rog ally joker
It gives you enough rope to hang yourself with, and no compile-time safety or type checking to prevent it. It's a simple language, but I'd argue it's actually a pretty challenging language to learn good practice in. Especially in a modding environment where there are so many interconnected systems and no real structure to it all
allison is the name of a vivid stasis characteer
what is this server's fascination with the question mark emoji
(also lesbians)
How do I get a value inside an enhancement config from a separate source, I tried self.ability.value and self.config.value and it's not working
yuri
yeah thats true
(I'm bad at rhythm games)
@tall wharf there's a prelude mode so you can beat the bosses and enjoy the story
Lua is not easy, it's simple; and it's not a good thing for a language
See Go for the exact same fucking problem
I used to have headmates but they recombined with my main host after a breakdown ;~;
:(
hey, they might come back sometime, if you want them around they'll show up someday
i just think it's neat
I LOVE THAT GAME SO MUCH
Bump, I wanna make it so that certain enhancements can't be changed using jokers or consumeables
you meant maimai?
ive never been able to learn a coding language before until lua, now i already have a basic grasp of lua, ive made 7 jokers and a boss blind in the span of 3 weeks
or the yuri game
yeah
i always just call it "washing machine rhythm game"
i remember trying to learn java (or javascript whatever idk the difference) on khan academy and getting so upset i quit using technology for a week
(i was TIRED of drawing ELIPSES)
22 jokers, 1 boss blind, a new consumable type, and others in 2 weeks ,,,,,,,
i have alot of experience with lua (roblox developer!!!!!!!)
i only started modding balala because i saw aiko's mod and thought "hey i wanna do that"
i originally made retextures
I can't help with a) or b), but chances are it's crashing because it's not finding the atlas files. What's the crash, and what do you have in your 1x and 2x folders?
omg hi
but i wanted to do something more
I managed to make a modular consumeable that functions in an entirely different way for each instance of itself
hi aikoyori
also aiko's mod lets you play "nitoglycerine", so it gets an instant 10/10 from me
tnt
a few things inspired me to start modding and i was considering trying to learn for a few weeks but ruby's entropy is what really convinced me to commit to learning
i need to add chess deck to my mod
rhythm game joker
you get more chips based off of rating
no you just
unfortunately i am an extremely ambitious person and will always dig myself into a hole of frustration trying to code something COMPELTELY unfeasible for my skill level
start playing stepmania
i was trying to make boss blinds skippable the other day
if you lose all energy you just lose the game
didnt go well
adding klondike to balatro
I'm like... the worst at teaching myself anything, hence why I still haven't properly started modding
if you ask me how to ui i wouldn't be able to answer
i dread the day ill have to dip my feet into ui
i know itll happen
but its scary...
the worst part about ui is lovely patching ui
i looked at the documentation and it seems okay-ish
its goddamn FLEXBOXES !!!!
a web dev's worst nightmare
also you'd also need to account for the odd restrictions that ui nodes have
I figured out the answer to A, I think I figured out the answer to B,
and here is the crash log
atm I don't have a x2 folder
if that is necessary, then that's probably why haha
That's not gonna work, lol
I assure you, while flexboxes are kinda bad, they are WAY better than any other solution that exist on the web
(And honestly, people overexaggerate how bad they are)
will that still load everything at least?
That's fine, but integer rescaling a png is very trivial
this is the unfortunate truth
Was it ever considered to add an option to auto-generate it?
there's a python script that can do that for you
Gimp makes me wanna commit die so I'm not sure. I'd say it'd be called 'resize image' and make sure to set it to nearest neighbor
Or none I guess they call it in gimp
thanks!
Image > Scale Image
Interpolation: None
you're gonna have fun adding micro games
game development !!!
And ofc to make it 2x just keep them linked and multiple one dimension by 2
And multiply by 2 any of the width or height field (adding *2 to it is enough)
Im gonna make a simple "AH SCARY CLICK THE BUTTON IN TIME OR DIE" microgame to get a handle of it
Lol that's I guess a non-self-die invoking niceity of gimp
Once of the few
but if you want to make the ui as a collab (im delusional), feel free to help!
you play rhythm games but you start the game with the total score in the round
as starting HP
🤯🤯🤯
Honestly, GIMP is far better than most people give it credit for
Its UI used to suck massively, but it improved A LOT since
Like 3.0 is so nice to use; non-destructive editing is so nice
Look, I love open source software and gimp is very powerful, it's just alien go someone who learned raster image editors from pirated photoshop
Which is why I prefer krita
speech bubbly
like i wanna get solitaire running in the game first
I mean, yeah of course preference is fine
But criticizing something for the sole reason of not being used to it is a bit dumb
i forgot about solitaire
KRITA MENTIONED
i love solitaire
I mean joking that using it makes me wanna off myself is a preference not a serious criticism
Im gonna make the timer just a simple countdown because i do NOT feel like making bomb sprites
im not sure whats wrong here
results instead of result means that it's always falling through to the error case, even though it's (probably) successful
changing to result gives the same crash
wait i think i fixed it
fuck
how in the world did that happen
Iterating through files might also require ipairs, not pairs
Your joker.lua file references the variable start that hasn't been created yet. When you're using multiple files, you have to be careful of what's declared when, and in which order they're being loaded
this is where its crashing, this code worked just fine when everything was in one file
the variable should be loading first, as it's in items/lib, and the joker is in items/joker
do i have to do something else to make it load first
how can i make a joker detect if a card is a specific number?
if card:get_id() == number
Your use of pairs as the iterator means that it's not necessarily iterating in the order that they're written there. You want ipairs for iterating through simple arrays
Is there a good github repo I can fork to just look at some mods?
I have a joker I want to trigger at the START of round
ah
ughh what now
same line different crash
start is being loaded first now
this is the start variable for reference
should it not just load as intended?
i dont get whats failing
The problem is the scope. start only exists in its own local file
ok, its working now! thanks so much
Yw :3
But you don't just want to make it global, because then you've introduced a new global that pollutes the namespace for all mods. Good practice is to just keep one global table for your mod, then add variables that you want to share between files as members of that table
how would i do that?
i only have three variables right now that are in different files to where they're referenced
im pretty sure euler and pi are defined in the math library
because i did this before i knew about math.pi 😭
i am a brand new coder
Convention is that in your main_file, you declare the global YourMod = {}, then add variables to it with something like YourMod.start = love.timer.getTime(), which can then be accessed both by you and others anywhere
alright, thank you
idk i just do current_mod thing
That's exactly what SMODS is, by the way - SMODS is the global table, and SMODS.Joker is just calling the function Joker that's stored as an entry inSMODS
i see
I was under the impression that SMODS.current_mod changes as mods are loaded in, and it's never guaranteed to point to your own mod after the initialization
SMODS.current_mod iirc is your mod when your mod loads in
they are like 5 data structures in one
question, how do i actually draw the ui?
im just doing what cryptid does where i lovely patch my table initialisation really early for crossmod support
also, i have many jokers that perform arithmetic directly on your score, such as this one, all of them are extremely hardcoded, how do i migrate these to their own function that i can call so i don't have to keep them hardcoded?
If it's created and parented properly, it'll draw itself. You just need to create the type of UIElement you want, with a definition and a first node of type G.UIT.ROOT, and with the config.major set to an appropriate parent (typically G.ROOM)
so would this work?
-- Create a UI overlay for the microgame
local microgame_ui = {
n = G.UIT.ROOT,
config = {
align = "cm",
colour = G.C.CLEAR,
padding = 0.1,
r = 0.1
},
nodes = {
{
n = G.UIT.R,
config = {
align = "cm",
colour = G.C.CLEAR,
padding = 0.05
},
nodes = {
{
n = G.UIT.T,
config = {
text = "Press Space!",
colour = G.C.UI.TEXT_LIGHT,
scale = 0.5
}
}
}
}
}
}
do i hook into SMODS.calculate_context to always have an effect running in a certain context?
just to be sure
does anyone have a clue as to what this crash might be caused by? im getting reports of this from playtesters and i cant for the life of me reproduce it
That's a set of nodes, which you then provide as the definition when creating a UI.
Try something like:
if G.HUD_microgame then
G.HUD_microgame:remove() --if HUD already exists, remove existing one
end
G.HUD_microgame = UIBox({ --create and initialise a new UIBox
definition = microgame_ui, --your definition here
config = {
major = G.ROOM, --attach to the room
align = 'cm',
offset = { x = 0, y = 0 },
colour = G.C.CLEAR --set background colour clear
}
})
``` and see what happens
where/what do i replace with this?
No need to replace anything, just place it in an appropriate spot after you create the microgame_ui definition
i dont think its showing up
pulling my hair out over this i dont know what the problem is
im so lost
ive done this wrong but i cant figure out how
ive tried multiple variations of this
Almost there. You're trying to add members of the table to the table within the table.
Just define AST = {}, then do AST.etc = etc as needed
ah
heres the entire joker code if anyonec an help
this seems to work now, thank you!
and would i put like (8) in the paren
No, you would replace number with 8
I can't see any obvious issues, though the text will be white and very small, and will probably show up in the top left of the screen. Try making it a bit bigger with some kind of frame
note!!!
J, Q, K, and A are 11, 12, 13, and 14 respectively!
Ace is 14?
the size is relatively good, i just need to center it
Will this trigger a chip gain whenever one of these certain boss blinds is triggered? That is the intent but i want to make sure that it's correct
though, how do i center it?
Are ... you coding with the Balatro font???
Incredible
Otherwise, trying it in game is the best way to know if it works
if m6x11 was monospace i would use it as a coding font
Is it showing up now?
You can try setting major = G.ROOM_ATTACH and setting offset = { x = 0, y = 10 }
yeah i looked in the top left and i saw the text!!!
ill try this
Was planning on it. My PC just SUCKS so i was asking around before the laborious task of booting it up'
we are one step closer to mindwave joker
If you prefer, you can also parent it to your joker by setting major = card, and just tweaking the offset as needed
OKAY
THE TEXT IS IN THE MIDDLE NOW
I just need to
check if you press space
how the HELL do i do that-
anyone down to help me troubleshoot getting a sound to work that is currently crashing the game?
currently says the sound doesn't exist so i imagine its a naming issue
this is where is put the sound in, can only imagine the problem is there?
Not the simplest thing, if you want to be compatible with other mods that add keybinds like Handy and typist. I'd check how they do it - would involve Controller:key_press
you could also not care about that and just use love2d input check functions
To check the obvious first - does resources/sounds/Test_chomp.ogg exist?
could i get a repository for that
chomp.ogg does which is what ive told it to look for in the path part
SMODS adds the Mod prefix. Try renaming it to Test_chomp.ogg
in both filename and path?
oh i just made the key and the file name the same and that seemed to work
not gonna question it
okay so like
if context.before then
microgame(self)
repeat
delay(0.1)
until finished
if pressed then
card.ability.extra.multg = card.ability.extra.multg + card.ability.extra.Xmult
else
card.ability.extra.lives = card.ability.extra.lives - 1
if card.ability.extra.lives <= 0 then
G.E_MANAGER:add_event(Event({
func = function()
card:start_dissolve(nil, G.jokers)
return true
end
}))
end
end
end
if context.joker_main and not context.blueprint then
return{
card = card,
mult_mod = card.ability.extra.multg,
message = '+'..card.ability.extra.multg.." Mult",
colour = G.C.MULT
}
end
end
}
this just hard-crashes the game
any help
im trying to make it so that it waits to score until the microgame is finished
I finally got that one joker working
The answer is YES, it does trigger!
I don't see any other problem, at all!
tooltip: triggers everything for no reason
what in the world is this even doing 😭
I just wanted chip gain matador is that so much to ask
should this go down to a 2? bit easy to get mult quick
really nice for deck fixing
yeah i feel like thats a huge boon as is
theres an initial 39 mult off of the base 13 hearts cards then it slows down a lot
Vibe check?
really good if you get it early but so are most Rares ig and not ideal for late game, you've convinced me to leave it
1 in 3 chance to lose all of your money, 2 in 3 chance to have a really strong buff with no downside?
How do I remove items from their default pool?
I'd say its a little wordy
the hand size is great
I.E. I have a "joker" item that's meant to just be used for Challenge displays, but it's not a real joker. I can easily hide it from the collection, but what's the best way to avoid keeping it in the regular joker pool?
Just use the in_pool function individually?
whats vibe are you wanting it to hit?
well right now only one of the 3 buffs has both an upside and a downside
What would be a good downside for Mult?
well you've already got random chance so
I think adding hand size but destroying cards randomly is good for hand size
id say just have a good result and a bad one maybe?
I worry that adding more mechanics to what you already have is going to make it very wordy and convoluted
i agree
depends on what your mod is doing though, if its all about adding wordy jokers then thats the intention
Does anyone happen to know how I would access the number of jokers (or any card type) are unlocked from my mod specifically?
Alternatively, how would I add new stats to a profile?
I think you could make the ability choose 1 of these 3:
- +50 mult
- +4 hand size
- +lose all $
and it would feel reasonable
Every time I tried to make a choose UI box I got crashes xD
if you can point me to a good example haha
oh I didn't mean choose lol
well it would be random still
I meant the joker chooses
Hmmm this is the "Demonic Ritual" meaning something is sacrificed
and something is gained
but I hear yall

maybe it takes $10 and does one of a couple good things?
what about essentially being a rental joker and randomly select one buff?
easier to balance then bc you just change the money it takes based on how good your effects are
& what rarity you want it ig
im trying to make a joker that creates a spectral card when both blinds are skipped. im assuming the best way to do this is just a variable that goes up 1 whenever a blind is skipped, resets to 0 when a blind is selected, and when it it = 2, set it to 0 and create a spectral card. how would i detect when the blind is skipped?
isDoorult = false
card:start_dissolve()
end```
This one is meant to set isDoorult to false before dissolving so if you get the joker again it would usable. But that doesn't seem to work
probably should have the variable in card.ability.extra?
then it would die with the joker
is this in the smods wiki? if so what page
Put it in G.GAME
how do i split my main mod file into multiple files?
Is there a good way to display a choosing UI box I don't know about?
i see other mods doing it but idk how
not that I'm aware of, but I'm still pretty new here
hmhmmamamam thank you! 🙂
do you mean like, have the jokers in files seperate to the main lua?
I also would like to know this
i can show you guys my set up
yea kinda
so in the main folder i have a jokers folder and in that i have the luas for all my jokers
those are set up like jokers would be in main
i wanna know like how those files can get loaded in
i think either through main lua declared in metadata or some kind of smods process
The thing with it is the Joker is creating a playing card that when scored sets isDoorult = true
What is G.GAME and what should I put in it?
im using assert(SMODS.load_file('jokers/NAME.lua'))()
like this
G.GAME is where global variables should usually go, and in this case it seems like the right place for your isDoorult variable
G.GAME.prefix_isDoorult = false
in what sense?
you'd have to manually add each joker to the list instead of automatically adding each of them
i guess
^
i'd argue its a lot easier than scrolling through a gigantic lua file with all of your mods code in it
thats true, thats what im looking to do
personally i just do something like this
-- Load all files in a folder
function PTASaka.RequireFolder(path)
local files = NFS.getDirectoryItemsInfo(PTASaka.Mod.path .. "/" .. path)
for i = 1, #files do
local file_name = files[i].name
if file_name:sub(-4) == ".lua" then
assert(SMODS.load_file(path .. file_name))()
end
end
end
PTASaka.RequireFolder("content/jokers/rare/")
PTASaka.Mod is a shortcut to uhh SMODS.current_mod btw
see thats a lot of words i dont know the function of xD
is there a way to only retexture some of the boosters in the booster png, rather than all of them
SMODS.Atlas {kind = 'Celestial', key = "Booster", path = "boosters.png", px = 71, py = 95, prefix_config = { key = false } } im just trying to retexture the celestial boosters not all
Use malverk.
Bump
okay guys if i wanted to modify the base sprites of jokers with a soul layer but not touch the sprite of the soul layer as they are being generated in a booster pack, how would I go about doing that?
I have this thing that's pretty advanced and I would like all the help I can get 😭
How would one create a tarot card with a specific key? I have been trying forever and I can’t stop this error about an error about center being nil. This only happens when I use the key property to force a specific card.
SMODS.add_card({key = 'c_prefix_key'})
SMODS.add_card({area = G.consumeables, key = "c_prefix_tarotKey"})
set not needed if key is forced, also j_ is for jokers
How do I enable G.deck optional feature?
For those that would be interested I'm trying to make a booster pack that
- Offers 3 random legendaries
- These legendaries have a random background, with one of 4 possible ones
- The soul layers have a shader that turns them entirely black
- The description of the jokers are hidden until they're selected
- Maybe a cool reveal effect once you select one
I've gotten step 1 but that's basically it
Area isn't needed either.
return {
G.deck = true
}
end```
Like that or?..
SMODS.current_mod.optional_features = function()
return {
cardareas = {
deck = true
}
}
end
Thanks!
OOOH, I was missing the c_ (responding to some 2 people a couple messages up) thank yall!
oh really? that's neat
Is it possible to add extra layers to a card? Non-legendary / floating / whatever
Worst case scenario I can use stickers
Yes.
Can I do it based on code rather than definition of the card?
is NFS some kind of external library or something
What do you mean?
I wanna make the layers of the card change depending on extra variables of the card
Will this work for any arbitrary legendary or just base game/ones from your mod?
Any
Then an additional thing to account for is not all legendaries actually having soul layers
How do you fetch the localize name of a Poker Hand?
Cause I'm doing something wrong, but I don't know why...
-- jokers.lua
config = {
extra = {
hand = "aod_sequence",
xmult = 2,
},
},
loc_vars = function(self, _, _)
return {
vars = {
self.config.extra.xmult,
localize(self.config.extra.hand),
}
}
end,
-- en-us.lua
misc = {
poker_hands = {
["aod_sequence"] = "Sequence",
},
},
Besides that it seems doable to hijack the draw routine while in a specific booster pack and do everything it is that you have planned
You should be using card and localize(card.ability.extra.hand, 'poker_hands')
yes though it should be provided by smods by default
anyone know why this is an error?
Is that supposed to be the mod badge?
yea i think so
Or drawstep
idk if i need to add something for it
Oh yeah I forgor that exists
You need to define the label for it.
I think it's there by default if you stunt do something to disable it and it reads from your header
Or json Metadata file now? Idk if t trust somethingcom over me, they're actually a modder
Do you have this in your localization?
no that makes so much sense
im still elarned localization just caught onto how it works lol thx man
I'm confused. Mod badges are just the mod's "name" value and the "badge_color" as the bg... unless it's supposed to be a different type of badge
Or seals don't have mod badges by default?
its how i set up localization
Dumb question, but is there a mod to spawn in jokers for testing?
i got it working :3
DebugPlus
yup, that ☝️
I know the ones in the collection don't.
I hate that then... and that blinds dint either
I mean... They're smods objects so it should just be built in like fir jokers abs consumables
I'm pretty sure tooltips are all through the info queue?
if i have a consumeable i made same issue how would i do that one?
thats what i initially thought too, but its different for detailed tooltips i guess
What do you mean?
That's definitely supposed to be automatic I'm almost certain
here
not seeing sum sadly
lemme try
How do i use drawstep?
The thing smods wiki says to use is a function called set_badges
anyone know how to set up a use function on a consumable that would destroy the selected jokers
I guess that's for additional pet-item badges so nvm
for k, v in pairs(G.jokers.highlighted) do
v:start_dissolve()
end
thank you!
https://github.com/Steamodded/smods/wiki/SMODS.ObjectType#api-documentation-smodsconsumabletype
Actually it seems like it should be automatic and your formating may be off
You're using double quotes for one, I don't remember if Lua is okay with that
it's fine, I do that too cause screw '
In any case they're missing the collection label
Which is part of the consumabletype definition
And I think they're localization fine night just be overwriting the default badge with error, because it should draw from 'name'
For the uiheads here, is there a way to intentionally make a UI element extend beyond the bounds of its parent?
It also doesn't seem like 'set' is a thing for consumabletype from the wiki?
anyone know if there's a function i can call that opens a specified booster pack type?
ideally one that could be used anywhere, not just part of the calculate function, for example
Maybe check what modded tags that do such a thing do?
good idea
Yes but base game code is different from smodded code
I mean.. ofc your can usually stuff base game code in snodded but it's probably gonna be worse and less compatible
cross referencing the toga and base game stuff it's the same
Ah very fair. I didn't look myself so didn't wanna lead you down a non-ideal path is there was a nice steamodded way to do it
bump
Well... the approach I'd take would be to iterate over everything, check one by one, and increment a variable for each one that is
But I'm... not by any means a proper modder
The thing is I feel like there should be an easy way to do this since you can see the number in the mods menu under the mod's additions tab
Hmm that does suggest there is a variable somewhere you can check
Exactly. However, I cannot find it lol
If only memory-viewer style debugging wasn't deadass against the rules for some reason
At least I think that's what rule 3 means
printing the entire profile table
there might be a game variable

Yes there probably is, but I cannot find it
I'd suggest to find the code that generates the additions dialog abs see what it's doing
I tried that too and it was not helpful at all 😭
actually it just seems like each joker just has a discovered true/false variable
i don't think there's a game variable that tracks total jokers discovered, especially not filtered by mod
you may just have to iterate through every joker with your mod key and check if their discovered is true 😭
wait holy shit I think I found it in a very generic looking function LOL
why is this happening XD
And unfortunately for me it looks like the tallies are done on the spot 
green
are you talking about the one on Game:save_progress
Not sure if it's the right place to ask, but is there any documentation to when vanilla uses bumping or floating motion modifiers?
local consumable_nodes = {}
for _, key in ipairs(SMODS.ConsumableType.visible_buffer) do
local id = 'your_collection_'..key:lower()..'s'
local tally = modsCollectionTally(G.P_CENTER_POOLS[key])
if tally.of > 0 then
consumable_nodes[#consumable_nodes+1] = UIBox_button({button = id, label = {localize('b_'..key:lower()..'_cards')}, count = tally, minw = 4, id = id, colour = G.C.SECONDARY_SET[key]})
end
end
if #consumable_nodes > 3 then
consumable_nodes = { UIBox_button({ button = 'your_collection_consumables', label = {localize('b_stat_consumables'), localize{ type = 'variable', key = 'c_types', vars = {#consumable_nodes} } }, count = modsCollectionTally(G.P_CENTER_POOLS.Consumeables), minw = 4, minh = 4, id = 'your_collection_consumables', colour = G.C.FILTER }) }
end
local leftside_nodes = {}
for _, v in ipairs { { k = 'Joker', minh = 1.7, scale = 0.6 }, { k = 'Back', b = 'decks' }, { k = 'Voucher' } } do
v.b = v.b or v.k:lower()..'s'
v.l = v.l or v.b
local tally = modsCollectionTally(G.P_CENTER_POOLS[v.k])
if tally.of > 0 then
leftside_nodes[#leftside_nodes+1] = UIBox_button({button = 'your_collection_'..v.b, label = {localize('b_'..v.l)}, count = modsCollectionTally(G.P_CENTER_POOLS[v.k]), minw = 5, minh = v.minh, scale = v.scale, id = 'your_collection_'..v.b})
end
end
if #consumable_nodes > 0 then
leftside_nodes[#leftside_nodes + 1] = {
n = G.UIT.R,
config = { align = "cm", padding = 0.1, r = 0.2, colour = G.C.BLACK },
nodes = {
{
n = G.UIT.C,
config = { align = "cm", maxh = 2.9 },
nodes = {
{ n = G.UIT.T, config = { text = localize('k_cap_consumables'), scale = 0.45, colour = G.C.L_BLACK, vert = true, maxh = 2.2 } },
}
},
{ n = G.UIT.C, config = { align = "cm", padding = 0.15 }, nodes = consumable_nodes }
}
}
end
Almost looks like this is just doing what I said in the first place
In stylizing descriptions, I mean
Sorry I know the convo has progressed, just is a pain in the ass to look at code from github on my phone, lol
Bump
anyone know?
set_sprite_pos will be your friend. Here's an example of how I do it in a similar application
You can do the same thing for back and front
What about additional layers?
wdym additional?
I'm also looking to have extra non-legendary / non-floating layers on top of the card
I think that should work just the same
How do I make those layers?
Oooooh
I know Cryptid adds another layer so that might be worth looking into, but I am not well versed in it
I honestly really don't wanna go digging through Cryptid code
And I cannot blame you for that in the slightest
I might just be flying too close to the sun, I'm making a modular consumeable with 4 different layers
Mayhaps
First layer has 4 options, second layer has 17 options, third layer has 4 options, fourth layer has 4 options, and I just realized, there's actually a 5th layer, with 3 options
I also need to learn how to do dynatext
Hi, I have been having a tsunami of good mod ideas for Balatro, I've only started to learn how to code about a couple weeks ago. And so for things have been okay. When it comes to modding balatro, I find it difficult as to how to use the steammodded or love frameworks. Is there any good resources I can use to help me start creating mods?
Is it possible to track jokers triggering?
context.post_trigger you have to enable it as an optional feature though.
How so?
I literally have a variable in my own jokers called "triggers" that goes up by one whenever they're triggered and resets on final scoring step
you just need a little snippet of code in your file that looks like this
SMODS.current_mod.optional_features = function()
return {
post_trigger = true,
}
end
actually didn't unscored cards get moved out of optional features at some point? I should probably just remove that
They did.
thx
How do I use it to track jokers triggering also? I wanna use it to make a joker that scales when a joker triggers
does anyone know issue?
context.post_trigger works on jokers by default.
plz😭
Thx
How do I make a joker scale also?
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain for example.
What does your code look like?
Bump 2.0
Anyone wanna hear a joker idea I had?
This took a SURPISINGLY little amount of patches. Just three and they're all non-destructive
lovely patch ,,,
What would happen if return true in G.E_MANAGER is conditional, such as putting it under if #G.jokers.cards < G.jokers.config.card_limit?
Would that event keep on queuing until the condition meets?
Is there a guide on how to mod? pitfalls, functions, etc?
pitfalls: not knowing lua
also the typos in the vanilla code are pretty funny
and assuming some functions exist that don't
is_suit() and get_id()
Is there a way to check if a UIBox is currently open?
Wait, I get that it's get_id instead of get_rank, but what do you meanis_suit doesn't exist?
card:is_suit
no, is_suit and get_rank exist
i'm saying that is_rank and get_suit don't exist
No, it's get_id
oops
i've fallen in my own hole
oh wait i redefined get_id to be get rank in my misc functions that's why
i'm stupid
can u look at my code?
What if you removed the particles function?
bump
why is extra nil here
Show your config.
Because there's no extra in this picture?
In this case you should return card.ability.extra.money*(G.GAME.current_round.hands_left + 1)
No, It queues everything else permanently.
That doesn't work that way, the return true tells the function it's done executing, if that's ever false, it will continue to run the event every frame
SO CLOSE
Unless a joker is force removed.
i just need to somehow move the (0/25) to the line below
this returns nil at 1432 now
and i legit dont know where im doing wrong
What type of object is this?
Return the number, not the table.
a joker
what do i need to change here 😭
i assumed i needed to change this from G.UIT.R to G.UIT.C, but it didnt change anything
did you try starting a new run
thank you all for the help, it worked
What do you mean by layer?
they probably mean stuff like Souls
If you go up they want one they can change based on values on the card
I think 2 layers is fine just a changing layer
It must be possible because aura has some dynamic sprites I think and I don't think it'd be too different
Idk how it's done though
I'm looking for static layers, none of the floating offsets
Worst case scenario I can use stickers
static layers?
look into SMODS.DrawStep
i have decided to just make my own ui box from scratch 😭
What’s this for?
https://github.com/Steamodded/smods/wiki/SMODS.DrawStep
God this documentation is lacking though
Now I'm just looking at Card:draw
skill tree im working on
i wanted to try and use detailed_tooltip to achieve something like this
i wanted to make it so that it read from localization instead of a center
but after 30 minutes of tweaking - i genuinely dont know why it doesnt want to move the (0/25) to another line, even when i changed everything to G.UIT.C
Also I can't figure out how to control when it executes a certain drawstep.
If it's just any time the card it acts on is rendered, that doesn't solve káeda's needs
Draw step is exactly what they need
Unless steps can be conditional
Of course they can
It's really hard to tell what I'm supposed to actually do with SMODS.DrawStep
why cantI use this?
Look in carddraw.lua in your smods folder
How would I add additional draw layers?
Just make your own
It looks like you're just using it automatically when created?
And then making it as used
yea
I'm currently staring at card_draw.lua and trying to figure out what I'm supposed to copy and what I'm not supposed to copy, I have no idea
im just making it be where u can always use
I mean in the booster logic
Just take one of the draw steps and then change it to draw what you need it to draw
where?
local c = create_card("Snack", G.pack_cards, nil, nil, true, true, nil, 'mills')
-- auto-use the snack card immediately
if c and c.use then
c:use(c)
-- optionally mark as used
c.ability.used = true
end
-- optionally remove the card afterwards so it doesn't clog inventory
c.remove_from_deck = true
return c
end```
I feel like a fucking idiot
I'm probably being stupid but afaik "if c.use" executes the use function
i put that in cause it wasnt working
added {E:1} and shi straight up disappeared 🥀
How do I reference an atlas, where do I put the position, what variable do I tell to :draw? I do not know how this works
When you open the booster, do you get a buff? If so the card is auto-using but not dissolving
I'm just stuck here staring at the file and my own empty DrawStep and I don't know what the hell I'm supposed to type
yea i think this is what u mean
i think this looks good enough
She Mults on my Jimbo 'til I The Water
Splash
So good I'm Seeing Double
Okay, so, if I'm referencing this, what do I replace these variables with to render my own sprite from a specific atlas?
why does this not retrigger even when i have oops all 6s
You're an insane person
Replace context.individual with context.repetition
Is there a specific way to reference an Atlas using this format?
i cant use this consumable why is that?
Just like, SMODS.Atlases['atlasname'], and then define a pos somewhere
Anyone who can comfortably do UI stuff is insane
huh, so blueprint is pretty much the same as brainstorm?
I guess.
It just randomly selects?
i am so close to
No, you get to choose for both.
Oh I see
chat i remember this was answered here before but i lost the place where it was answered
what causes these white alpha artifacts around the edges of cards in 2X?
i remember this being an encoding issue
this issue is exclusive to 2X/pixel art smoothing
Did you use nearest neighbor/ no interpolation scaling when you upscaled
the pixels on the outside are probably white with 0 alpha
this is with no pixel art smoothing
that shouldn't be possible since i exported from aseprite just now
i deleted the whole 2X sheet
re-exported it from Aseprite
Just normal exporting at 2x? Weird
p sure there is a script that makes it look better
does this issue persist if even one of my atlases is wrong?
i don't care
:(
sorry
why are you roffle lite bepis
do you have a link
the creator of balatro star rail would never be roffle lite
yeah from aseprite, so there should be no alpha issues
the plague took over
which is why i'm thinking if a single atlas being wrong could affect it
Yta
i don't
Just a reminder that this is not your channel
This chat always has multiple threads of conversation going and it's no one's place just to hog it
i just asked a question and I'm trying to get an answer so I can move on with this
this is already frustrating as is
forgive me if i'm a little on edge but i've been trying to solve this for an hour
and i just want to get this done and over with
This channel isn't typically known to be consistent, don't shut people down from sharing things because you're personally in a bad mood
that was a repost in my defense
First thing I'd do is just... make sure it's not just how the engine works. Are the vanilla jokers doing it too?
Because bepis is actively working on their custom UI system
i added the " (0 SP)" to show how many skill points you accumulated throughout the run
no they are not
so not exactly a repost
i'm sorry then, it just seemed like one
its fine
okay i found that script
i didn't notice there was any change
the addition of 0 SP
If it's 2x upscale with no interpolation it's going to be identical regardless of how it's done. That is how it is in aseperite
the ui system is neat this has just been a headache for me because it's been fine until some other people working with me on the mod insisted that uploading jokers directly to 2X is fine
surprisingly it's not
and then these artifacts happened
i feel like in this case its less of an issue with upscaling and more with love2d being a goofhead
which is why that script exists
i personally just don't play in 2x so i don't have to worry about it too much 😛
Then either aesperite or the script is doing something different than normal nearest neighbor 2x
I wonder which it is
I think the cost should be the bottom box
due to the way balatro displays 2x sprites, it is going to be different depending on how the upscaling handles fully transparent pixels
the white outline comes from pixel interpolation between transparent pixels, which just happen to be white because I assume aesprite blanks them to save file size or something, but in turn some interpolation techniques see them as white pixels that need to be blended to, introducing the artifact
I’ve seen some people before saying you need a transparent outline of your sprites that is the same colour as the adjacent pixels but I’ve never had the weird white glow on my stuff and I just upscale using aseprite 🤷♂️
i upscale using a python script i stole from morefluff
Maybe it’s a screen res issue?
just fix the rendering its so easy (lie)
for whatever reason just upscaling the sprite not using the export option works
this is plain silly
i need a break
There... should be no confusion. 1 fully transparent pixel should become 4
That's what nearest neighbor is
moved the cost to bottom
yes, but balatro renders the 2x sprites with slight interpolation, thats the whole point of the pixel art smoothing setting
the interpolation is on balatro's side, not on the process of creating the 2x sprites
Which is why i said one of the methods must not be actually doing scaling sans interpolation
For the following interpolation to be different
and that's what I'm saying
the game interpolates the sprites on purpose for pixel art smoothing mode
the game only uses nearest neighbor sampling when pixel art smoothing is off
btw for anyone who encounters this issue in the future
the solution is to literally upscale *2 in "Sprite Size" in aseprite or whatever program you use
do not use export options, they have some weird encoding crap that causes the artifacts
when are we getting a lovely patch to fix pixel art smoothing
take it up with whoever invented bilinear sampling
wait i thought the export upscale is the same as sprite size
it might be bicubic I have no idea I just thought that was a funny thing to say
hi myst
but yeah I assume the export function of aesprite blanks out transparent pixels for... extremely slim file space savings?
you're really saving a handful of bytes with this one
it is not
export upscale does some weird stuff
sprite size keeps the thing right
it is the most painfully weird thing i've encountered
I’ve always just exported at 1x with the open spritesheet option checked, then resized that and exported again
How would I get a DrawStep to draw onto a specific card? It's a consumeable card
just use a normal draw function on the card
Check the key of the card
I need to get my hands on an upscale script, the number of spritesheets in my mod keeps growing and the only ones I have 2x versions of is an extremely outdated jokers sheet and enhancements sheet
script that purposefully applies gaussian blur to your spritesheets and saves over them
how do i draw a specific thing after each discard? for example, 3 random diamond cards from the deck
It's the one thing I keep forgetting to fix. The outline artifacts can be ignored sometimes but they look really off on seals
why does it look so ass tho
How do I get the key? I've only ever used the key to create a new card or used next(SMODS.find_card('key'))
card.config.center_key
card.config.center.key
ye.
I know that... I meant for the output of that to be different so must be the input
in this case it's that the export function of aesprite is overwriting transparent pixels to be white, for whatever reason
That's weird because it's definitely supposed to be strict nearest neighbor
well it is
It’s to do with how the engine up scales the images with pixel smoothing on
It just renders in the corner
But it supports transparency in general so as I said the already fully transparent pixels /should/ be turning into 4 which are thus
Can you upload the 2x png here?
it's solved already
What am I doing wrong here that's causing this?
is it for k v in ipairs? this happened when i was trying to code insane joker too
Okay. Can you upload the 2x png, so that I can check the alpha colours?
and they are, 1 transparent pixel becomes four fully transparent pixels
the issue here is not related to nearest neighbor at all, but the export function culling transparent pixels to be fully white, in conjuction with how balatro renders the sprites with pixel interpolation
Oh you mean white as in ffffffff
As opposed to having a hue too
As well as being transparent
it's no longer an issue though
and i did say what i did to solve the issue
my obligation is done
It's probably because the alpha and color interpolation are done at the same time, so it interpolates towards the color alongside interpolating towards the alpha, making it turn halfway to white while halfway to transparent
yep, the exporter botches transparent pixels and causes unexpected artifacts when the pixel art is displayed in an unconventional way, like balatro does with pixel smoothing on
yeah so basically you have to upscale using the sprite size operation
rather than using the exporter
which is annoying
but not the end of the world
thank you
Also I think that might be ffffff00. I forget whether transparent is 00 alpha or ff alpha. I think it's 00 egged though ff makes more intuitive sense to me despite knowing that alpha means lack of transparency abs ff is 255
is it possible to reorder cards in the deck?
Hook CardArea:shuffle
Just realized that rgba is a nice clean 32 bit standard
does that shuffle everything randomly?
it does
well is it possible to order specifically?
can i put the cards i want on top of the deck
Yes.
I wanna make the sprite connected to the card and not just hanging out in the corner ;~;
im pretty sure how cards are drawn in the deck is that it goes from index 1 to index n, so you will need to shuffle the entire table around manually
basically: put the card you want to be drawn first in index 1 of G.deck.cards, i think
alright
1: Don't create a new sprite every frame 2: Try using card.T.x, card.T.y, card.T.w, card.T.h for the first inputs
How do I not create a new sprite every frame
Could I store the sprite somewhere in the card table?
Store the local outside the draw step code! Or store it in a global table
Would I need to make a new sprite for each individual atlas position I'd like to use?
here's how morefluff does the sts mana values, this should be useful
where G.mf_mv_spr is set up earlier
I'm adding an extra layer on top of the base card sprite
that's what this does
I also wanna have multiple instances of the card that uses different sprites, so making an individual sprite for each one would probably work better
you can have an atlas with different positions
if you look at the code you can see how
Can you post what G.mf_mv_spr looks like?
wdym
That's a variable it's referencing
it's a sprite that's set up before
Does set_sprite_pos override the position for all cards that use that sprite?
yes, but if you call it before every draw then it can be in multiple places
Ah, that makes sense
Should I make one sprite per layer, or just render it all using the same sprite if it's in the same atlas?
anyone?
Set the third argument of set_ability to true, that'll delay the sprite change until it's processed
You going through every card when any card scores.
first of all - the context is wrong, you should put it to context.before instead
reason being: exactly what smt said, im too slow 🥀
thats what i FIGURED but i dont know how ipairs works 💔
runs through a table from index 1 to index #table
context.individual = for each card
for k,v in ipairs(context.scoring_hand) = for each card
So for each card... you're checking each card
local a = {1,5,9}
for i,v in ipairs(a) do
print(i.." has "..v)
end
=>
1 has 1
2 has 5
3 has 9
This is how I did a played hand full enhancement change
https://gyazo.com/923f60168e864cc8188c1340c91737b1 now checks for requirements
It looks so mundane to anybody who doesn't know how much effort you've put into this
Which means you're doing UI right but regardless good job
it was honestly SO painful to get everything like how i wanted 😭
especially the info box - i had to manually create it myself
and thanks :3
And it looks official
If Bepis were here to see this
They'd be proud
I still wanna see what G.mf_mv_spr looks like so I can figure out where to put card.T.x, card.T.y, card.T.w, card.T.h
it's just a normal 71x95 atlas
Yeah and the first 2 are the position of the sprite
And the card isn't full size
If I do this it's just gonna be like wtf do you mean "card.T.x"
Because card isn't defined as a variable
How do I make it follow the card itself then? Wouldn't that just render the sprite at position 0, 0 with default sizing?
i want it to do every card
i might not be underttsanding right because it IS 4 am
this is why you do
G.mf_mv_spr.role.draw_major = self
``` or whatever
You're doing all 5 cards for each card, so you're processing every card 5 times
jesus christ, get some sleep 😭
So each card is checking every other card including itself
25 total card processes instead of 5
Alrighty that's what I needed
What function is that in? It's throwing an error because it can't find the atlas
is it a good approach to have stuff saved to G.GAME first, then when the run is over - save those back to G.PROFILES?
Roffle Blight has evolved into dog bepis
But then . freddy egt me
its the origin of my name too :3
Congrats on your transition
laughs in having woken up after getting only roughly 2 hours of sleep because people in the house were loud and continued to remain loud for multiple hours and prevented me from getting back to sleep
does everyone here have a fucked up sleeping schedule or something
because me too
🥀
Went to sleep at 9:30 AM woke up at 4 PM
Currently 2:30 in the morning
Probably won't sleep for a while
so these are just redudanbt then
Yes, they're both doing the same thing, but one is happening inside the other, so it's doubling up
doesnt seem to work well, how can i limit the deck reordering to a maximum of 3 times
You can't hook inside of calculate.
What is the goal?
If a Joker is .getting_sliced, I can assume it doesn't have its' calculate go through?
As long as it checks for that I'm pretty sure.
sorry if these all seem like stupiud questions or whatever but like im majoing in biochemistry not coding
You probably don't want to hook shuffle then.
how would i do it?
I was able to make a card draw to your hand from your deck but it copies the card to your hand and deletes the original from your deck ;~;
sounds pretty unoptimized
Yep
but if it works i guess
...about that...
Though, I suppose it still might do its' remove_from_deck call...
whats iut do
Damnit it doesn't work with resizing
What is this? is this a consumables that you can build yourself?
It's a randomly generated card that essentially acts as a basic stat joker, this one gives +8 Mult for every played 5
It even goes into it's own cardarea
It can give chips, mult, xmult, or money when scored, discarded, held in hand, or in deck, and it can trigger on any default suits and ranks
yeaa i couldnt figure out how i can do it, id appreciate some help
who's steve jobs
ligma balls
hiii meow
How would I go about fixing this?
what are you trying to do
for keep_on_use and checking cardings in consumable why isnt this working
me exploding someone with my mind powers
Put a sprite on a card using a DrawStep that matches the card's size, I've done everything except the last one
blows up pancakes with mind
.
What does the draw step look like?
did you set the sprite's major?
This is where G.buffsprite is defined
Yes, it's in the image above
G.buffsprite.role.draw_major = self
It follows the card properly, but doesn't resize itself to match the card's scale
I do this when defining sprites
may i ask what mod you’re using to spawn stuff?
I think that's the wrong object
if you just want to attach it to another object
I've also done confused cards
oh that’s built into debug plus? how do you open that menu
i’ve been using debug plus 💔😭
My mistake, that is Too Many Jokers
oh okie bet
I was told to define the sprite elsewhere
do you have a link to a repo by chance?
And in a DrawStep
Yo repo that's just like the hit game R.E.P.O. no way
wait no fucking way i love that game
🤯
if you're going to reuse the sprite
then it makes sense to define a single one
to reuse
My main problem is that it doesn't resize, that's it, besides that it's working just fine
Wrong image
This is where I've told the card to resize itself, is this wrong?
I think either you're not setting the major correctly or the atlas is wrongly sized
card sizing is difficult so I just need to figure it out when I try to
But once the size of the card changes, it becomes out of sync
This is the DrawStep for the card, the major is being set in the same way as with yours, just with a single sprite instead of an individual sprite for each card
Do you think the individual method would fix the problem?
I'm not setting it in the draw step
Moving it to the draw function did not solve the problem
It's the exact same
But I'll move them to the draw function for simplicity's sake
I'm not doing it in the draw function
Ya think set_sprites would fix it?
I think you'd hook calculate_joker not calculate_context
That's what I'm doing to force certain jokers to trigger
Then if you had no jokers or consumables or vouchers, nothing would happen.
I wasn't sure if that's specifically what they're looking for or not
Ah, not triggering on every joker, just triggering as if from a joker
mhm
Help make the joker immediately polychrome in the store, how to implement in the
idk
either that or whatever I did for confused cards
try using G.CARD_W and G.CARD_H instead of hard coding those numbers
Scale still is not working
the draw step all looks fine
Well now I put it in the card draw function, so
A drawstep allows you much more control over when and at what layer it's drawn
