#đ»ă»modding-dev
1 messages · Page 61 of 1
That way they're loaded in order
because I can use ipairs to iterate over the integer indexed table values exclusively
the gsubs are just to convert the key into a name for printing
This is how I load hooks
And this is the file structure showing off all folders
Looking through the code, I'm kind of wondering if their keys are specifically "Gold" or "gold_seal" and so on, but take ownership automatically adds the "s_" to it so it can't find it. @wintry solar Any thoughts?
Hm, may i pm you?
the printout of G.P_CENTER_POOLS.Seal does say the key is just "Red"
Sure but I'm going to sleep
so you may be right

momentâwait it's not their fault
yeah probably just the colours
Would it require an addition to Steamodded to make them into SMODS objects, or what? Maybe something as simple as appending s_ to any mentions of the seals in the code might work?
Append s_ raised to the negative first power before the color name so it cancels out when Steamodded prepends s_ /j
Yeah the key is added onto seals but they don't normally have one in the first place.
So no matter what SMODS will try looking at the key as s_Red
Issue has been made
oh thanks, you beat me to it! :P
yeah you can definitely do better than Cryptid
Is there a resource somewhere for Badge colors?
What do you mean? Just the vanilla badge colors?
Any colors really
globals.lua, get_badge_colour() in UI_definitions.lua, and loc_colour in misc_functions.lua.
Ah i see, ty đ
i need to reload the shop (re-evaluate UI tree) after a function... is there an easy way to do this already or am i going to have to patch something together?
if you need to update the ui after changing something about it you can try [UIBox]:recalculate()
[uibox] being the uibox you need to update
unless im misunderstanding what u mean by "reevaluate ui tree"
Doesn't seem to work for the shop for some reason.
yeah, tried that đ
did you try doing it through an event?
yep!
hold on
if you want to see what i've been doing it's in https://discord.com/channels/1116389027176787968/1275677876036960279
so 1x is 71x95 what is the aspect for 2x and can i change it without re-doing the joker art?
x2 is (71*2)x(95*2) = 142x190
you just need to take the x1 art and scale it up
scaling mode in your art program of choice should be nearest neighbour to about the program from trying to smooth out the pixels
idk what you mean by "can i change it"
like it scale it up without it looking weird
but i guess i just do scale mode
thank you
ye you just need to make sure the program is using the correct scale mode
a lot of programs by default use modes that try to smooth out the image bcos thats usually what the user wants when scaling images
ok I did it, thiank you
How to change sticker's compatibility with other stickers?
I mean I can probably check existing stickers in apply() but that doesn't seem right
I can't get the hoverable word in the deck preview to work, what am I doing wrong?
Tried to put the same description in the G.localization.descriptions.Joker/Voucher/Tag, with no luck
yeah the {T:key} pulls the loc_txt from the center object rather than direct from the localization tables
oh, oof, do I need to create a dummy center object just for that
I guess so, yeah
alright, thanks!
okay that's all it took to get it working
oh nice
is this to make your own enhancement? or what's this supposed to do? (just askin)
This exists so I can hover over a word in my deck and it'll show what it means
Oh I didnt know you could load custom object as hover, last time I tried it crashed.
ooh ok, thats cool!
something's wrong with my joker... đ€
misprint my beloved
That's a very wide spade
why are you misprinting all over the place
pls fix ur printer
is this better?
Is this to replace the glitched edition?
I think itâs just a separate edition
it wont replace glitched no
Maybe not even for cryptid
jen will add it to jen's almanac
i don't think it changed? ;-;
Oh ok
I improved this part
anyways
I may have misprinted the misprint
how many times does the misprint have to be misprinted for it to get printed correctly
depends on the shift tbh
she misprint on my misprint til i
Thats my boy!
..
Noo my boy!
..
Father help-
rint til i she misprint on my misp
how does one... make a base deck, like no modifications?
I'm trying to put a stake before the gold one and some weird shit happens (orange stake got duplicated and my stake is still at the end of the list), what am I doing wrong?
above_stake = 'orange'
oh, in that case do I need the take_ownership?
I don't know what unlocked_stake does
It is for which stake it unlocks next I assumed based on the vanilla stakes implementation in smods
I think take_ownership is broken or something because it just duplicated the stake
it's for some janky ass base game win counting
I rewrote stake unlocking to work based on applied stake completion
okay I don't really understand if I need it so I got rid of it
thanks for the help!
yeah it's not very useful
???
all it does is when you win on that deck it assigns a win to every stake below it if you haven't beaten them already
what does your loc_txt look like?
I think it needs your mod prefix
cyan
that seems weird but I'll try
your loc table seems weird, I don't understand how you're making it
yeah, this doesn't make sense - it does retrieve exactly cyan and not bunc_cyan
how are you adding your localization stuff?
(did that message sent twice or not because discord showed it as red first)
oh I see
okay
loc_txt = {description = {
name = "Test Stake FINAL",
text = {
"Required score {T:e_foil}scales",
"faster for each {C:attention}Ante"
}
}},
it needs to be description
ah
I don't think stakes ever got updated to now just description
afaik everything else is consistent now, but I could be wrong
also sneak peak of info tips on stakes
so it is something that'd be changed in the future?
yaay
ouch why it adds this line
I don't want it
which line?
"Applies Orange Stake" is not in the localization, I think it was added because I put that it applies the orange stake
yup
that's automatically added, yeah
can I get rid of it?
You can get rid of your last line
that won't be consistent with the other stakes then
I think Steamodded automatizes it since mods can have nonlinear stakes
Probably just a matter of Steamodded fixing vanilla Stake descriptions
yeah if people are injecting stakes into the original line of 8 maybe they need changing
but I'd just recommend people add their stakes to appear after gold in the order
i've seen that stake coin in the textures but how come i never seen it in the base game? the coin looks so good!
Wait, if there's a description field for the stake localization then the other one must be for the joker sticker?
because I'm not sure how to add that one
(this one I mean)
I think the sticker text is just outisde of the description part
What if the Stake is easier than White đ€
I still think it shouldn't intefere with the base game stakes
nope, I think it should have some other field because that doesn't work
still ERROR-ing
omg- i may of have done something :>
i may or may not have made a deck for every rank-
:)
It is simply sticker
anyways, anyone able to help me? i am trying to make a deck with absolutely no modifications but it just doesn't like it?
oh i did it?
i removed the:
g.playing_cards[i]:set_edition{{
base = true
}, true, true}
that seemed to have done it-
Why "kings" not capitalized?
it just isn't in the text
but to refer to the actual card in the code it is capitalized, otherwise it wouldn't work
pretty sure you don't even need to have an apply function if it's not meant to have any effect
I have this condition, which is supposed to check for Steel cards in hand if the played hand contains a Full House.
if context.individual and context.cardarea == G.hand and context.other_card.config.center == G.P_CENTERS.m_steel and next(context.poker_hands['Full House'])
The problem is that it, for some reason, crashes the game after the hand is scored, and I don't know how to prevent it.
context.poker_hands doesnât exist
Make sure to only execute the code if it exists
What do you mean?
Not all contexts exist all of the time
Oh right
(I thought you meant in general)
So, is there a way to check if it exists first?
Do the same thing youâre doing at the start
Though make sure that context is even called alongside the others youâre requiring
Got it, added a and context.poker_hands before the other check and it's fixed đ
I'll see if i can get rid of it tmr
any way to have a joker add mult and upgrade itself per card scored? as far as i can tell both use return which i imagine skips to the next step of scoring
Upgrading itself shouldn't use a return.
Steamodded has an example joker mod in the files, you can look at the Runner in there to see how it upgrades chips, and just do that for mult in context.individual.
ooh thank u
Is there a way to make it so you need a specific type of card for a Joker to show up, like with Lucky Cat, Steel Joker, and Stone Joker?
enchancement_gate = âm_bonusâ to the joker config
Or whatever enchancement
No like a separate line
Ig that was misleading oops
here is how lucky hoker from cryptid does it
So like this?
enhancement_gate = 'm_wild',
config = {extra = {repetitions = 1}},```
perfect
Hooray
new world just dropped
dancing cards đ
ok i have no idea what i am doing, does anybody know how do i add a sprite that is in the foreground?
or atleast ontop of the background?
I have a question about the game, more algorithm based than anything
How does the game remember the position you're on with the Random Seed?
Let me explain
The game remembers the seed, that's already one thing. But, it that was what it remembered only, every time you restart the game, it would start the seed from the start of the formula
Meaning, say, if you played a bunch, opened a pack with choices you didn't like, and then reset the game
Since all those Next() commands have been reset as well, the seed will go back as if you're using it from the first time
Giving you different output
And I'm trying to figure out how to make my game remember the position of the random seed as well as the seed itself
Anyone have any tricks to quickly previewing UI changes? Launching the game and navigating to the modded UI is such a pain
how do you get a joker by number?
like if i wanted to get the 5th joker (gluttonous joker) what would i use
Maybe check how the collection page does it
i think each has an order
so you could iterate over the joker pool checking order
unless the joker pool is already in order
in which case just iterate in order
I think each seed in the game (not the seed used for individual runs) saves its state in a specific place, and I imagine when the game is saved it saves the state of each of those seeds. So in theory, if the game saved and you advanced the state of some seed without saving, then went back, you'd have changed your (IRL) state by gaining the knowledge of what the next state of that particular seed was.
That's what I thought too, but I need a way to actually do it programmatically. I did find a solution though, I think
is there a way to check if a card area is visible or if the player is currently in the shop?
Tired of your poker levels being uneven? No? Well this solves that anyways! :)
i weirdly like the idea-
i believe you can check if the shop is loaded by just doing if G.shop
i made a similar thing but it's a boss blind
good choice of moon!
Thank you :3 We're planning on adding each of the Jovian moons in some way. We've already made [Ganymede](#1270210678635892809 message), so now we need Callisto and Europa
ooh very nice!!
calculate = function(self, card, context)
-- main
if context.joker_main then
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.x_mult}},
colour = G.C.RED,
Xmult_mod = card.ability.x_mult,
repetitions = 0
}
end
-- end of round
if context.end_of_round and not context.blueprint then
if card.ability.x_mult - card.ability.extra <= 1 then
G.E_MANAGER:add_event(Event({
func = function()
play_sound('tarot1')
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true; end}))
return true
end
}))
return {
message = 'Smoked!',
colour = G.C.RED,
repetitions = 0
}
else
card.ability.x_mult = card.ability.x_mult - card.ability.extra
return {
message = localize{type='variable',key='a_xmult_minus',vars={card.ability.extra}},
colour = G.C.MULT,
repetitions = 0,
}
end
end
end,```
got this code for a joker that gives x mult and the x mult is supposed to decrease by 0.05 each round
instead tho it decreases by a random amount
is there another check i need?
in the games source, popcorn only uses end_of_round and not blueprint i think
There are multiple trigger in context.end_of_round
If you want the end of a scoring hand use context.joker_main
The end of a round looks like context.end_of_round and not (context.individual or context.repetition) iirc
thank you
yep that works now
id tried checking context.repetition but it still didnt work
forgot individual was a thing
Iirc SMOD has a context that's just like that for end of round
Nvm it's for scoring hand
Honestly, I do think it would be a good SMODS addition.
I am quite happy with how these turned out! I've never really attempted doing art before this. These Jokers are available to play with!
i've almost got my mod completely functional but the last thing i'm stuck on is reloading the shop when redeeming a voucher... it doesn't seem like :recalculate() works in the context of the shop, either that or the way i'm adding areas to the shop (conditional returns of {G.UIT.R} objects from functions) is the wrong way to go about it
i'm just patching the function calls directly into the shop layout created in UI_definitions.lua (code here if anyone would be willing to take a look)
anyone able to help me with fusions?
How can I make so the game reloads when you modify config of the mod?
Design your config in a way that doesnât require a reload đ€
you can add like an apply button
Why do you need to restart?
to reset/reapply take_ownership, shader file replacements, sprite replacements
You could definitely do that without restarting
is it possible to put a specific color into a localization file
like w/o a keyword just a value
I think not because the text processor expects a keyword, but you can add new keywords or hook the processor to accept hex values
The keyword is basically a key to access a color anyways
there's color variables though, i.e. you pass the color from loc_vars
ik about color vars, just working with something where i dont have access to loc_vars
but i got the keyword for what i need to work
You can also just register the colours that you want to use
Which is what I suggested
im having a problem where after i play a a hand my fps drops but then when i playa hand again or enter the pause menu it goes back up to like 60
anyone have a fix
so I wanted to try and make something like this, and apparently it's not that simple đ @zealous glen changing scale increases the size, but also offsets the edges further away from the center
I'll let you know if I manage to make it work, so far I'm clueless as to how all this works
By the way, how would you implement a visual effect that renders a copy of the card? I think Eremel had made a similar effect, but I was wondering what if the second copy (or copies) followed the movement of the original with a delay, like an afterimage.
I think it could be done either in the shader or outside of it
Though I donât exactly have a better solution than recording the position and transforms of the card for each frame between now and however many seconds in the past the delay is set to
it is possible but you need to store copy of canvas from previous frame
tho I haven't looked into it too much yet
it is pretty hard to do for a specific card
hard in a way that you need to somehow make sure that everything else on the screen still moves and changes
Why would that be hard?
Shouldnât I just need a copy of the card itself in however many frames I need?
If you can work out which way the card is moving you could likely do it with a shader drawn before the in dissolve shader with the appropriate offset
An idea I just had is that in each call to draw the card, I could create an Event(?) to draw the card again with the same data, but after a few seconds
Hello fellow mod developers
you can actually just send previous positions to the shader
should probably add that to the api at some point
extra shader values
it's not like you can find out how the player moved the card with a formula, lol
I think this is closer to being a better implementation for that effect
Without looking at how the event system would interact with the draw loop, I think passing previous position to a shader would be a mch better solution
But then you need to store the position for every frame within a time period
so would sending an event every frame
But it seems easier since you donât have to build a new list of arbitrary length to track it
Since the Event queue is a preexisting list of arbitrary length
Though I can see some issues with both approaches when the frame rate changes
I wonder how Weaverâs ultimate in DotA 2 works, since it restores his position and statistics to those a couple of seconds prior
How does this even happen-
Like, everything is working correctly but
Somehow it's, affecting, the field???
solved
don't let us cook ever again bro's
we burned the kitchen
Isaac Reference
The gangs all here-
all my homies fw IO
i have been trying for a while now, and i cannot figure out how to change a vanilla joker into a SMODS joker
anyone able to help?
What are you trying to do specifically?
i am trying to copy a joker from the base game, into a SMODS joker
so i can more easily change it
for example i would like my joker to figure out if a glass has been shattered and if it did i would like the joker (for example) add a lucky card to my deck
Did you take a look at the context guide you were sent yesterday?
yes but my mind cannot comprehand what i read-
Understanding contexts is the first step to making more than very basic jokers
then i think i know what i needa learn :,)
the guide is a step by step explanation of how each contexts are fired
to add a code to the joker referring to a specific context you define the joker's calculate(self, card, context) and write code like for example if context.joker_main and not context.blueprint then <code> end
^ this specific condition would make an action for the joker during main scoring phase that wouldn't be copyable by blueprint
you can look at the vanilla's Card:calculate_joker(context) to see how it uses the contexts but you should keep in mind that self in Card is card in SMODS.Joker (SMODS.Joker uses self to refer to the object that vanilla would refer to with self.config.center)
^ modded vanilla is an example mod that converts a bunch of vanilla jokers into SMODS format, which should be really helpful
i know i used it for a phew things already :>
dont copy paste the magic words, study what they actually do
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = {set = 'Other', key = 's_cere_green_seal'}
end,```
how do i pass vars into the info queue things?
{key = card.ability.extra.balloon.."_seal", set = 'Other', vars = G.P_SEALS[card.ability.extra.balloon]:loc_vars(info_queue, card).vars}
figured it out
this is what I do
thank you tho
Are mod prefix case sensitive? Will j_mymodprefix_joker and j_MyModPrefix_joker both work the same?
should be case sensitive
in my previous experience testing for your space jokers, it appears that they are all lowercase tho
i mean if the prefix is SDM0 it will be registered as j_sdm0_joker
can we start a petition to up the length of mod prefixes to 5 characters?
are they restricted?
but twewy is five
I've checked the last mod you made a pr of and their prefix is set with caps letter
I'll test it out rq
hence the full keys i PRed are exchanged to lowercase by me since this
you can set them as whatever you want
it just auto sets it as first four characters if you dont define a prefix
no way đ
rip
So I did test it out and they wouldn't spawn if the prefix wasn't 1:1 to the mod
We should normalize lowercase prefix smh
I swear to god
good to know tho, i am not sure where did I have the conclusion they should be converted to all lowercase
It's just the norm, but sometime people don't follow it.
j_MyModPrefix_joker is just ugly in snake_case
that is CamelCase right
No thats PascalCase
camelCase is myModPrefix
So in the example above it would be a mix of snake_case and PascalCase
TIL, thanks
Fun fact btw the case name for css attributes is called kebab-case
oh because of dashes instead of under_score
Yea
how can i replace an info queue with other DynaText code?
what do you mean?
like instead of the text in there replace it with this
Does Balatro (or SMOD) saves each cards of the deck at the start of a run? Like if modifications or removal happens it stays the same?
Anyone managed to get UI Elements to have the same hover effect as Cards/Blind Chip etc.
It's very doable, but for some reason my method isn't working.
function Blind:draw()
...
self.tilt_var = self.tilt_var or {}
self.tilt_var.mx, self.tilt_var.my =G.CONTROLLER.cursor_position.x,G.CONTROLLER.cursor_position.y
...
Blind.lua uses this to create the effect. And both UI elements and Blind chips / Cards etc share Moveable, and Node. Which handle most of the movement etc. So it's very doable with some modifications to the UI element class.
Is it possible to create SMODS.ConsumableType without creating an entry in the collection?
No J in donât think so
collection is created automatically by going through G.P_CENTER_POOLS[Set]
it is possible but in a very janky way
Making a new pool technically works but youâll have to manually inject or hook into get_current_pool for any additional functionality (e.x. default card, rarities, etc).
Thatâs handled exclusively by SMODS.ConsumableType which would auto-assume youâre making a consumable and try to add it to collections.
you can also just make sure your item is not in the corresponding G.P_CENTER_POOLS while looking at collection
That would still create a button in collections it just wouldnât display anything.
it appears ive misunderstood the question
I need that because I want to create a type of card/consumable that is needed me in a technical way but it isn't actually a something that should be shown in the collection
technical way as in?
Blinds but in a form of cards
galdur does something like that for the stakes
It wouldn't make sense to have two blind entries - I need just one card object to do it for every blind anyway
they're not consumable cards and dont even use smods for it though
Yeah that's not really the thing I want
if you want a consumable card that doesnt show up in the collection, you can make a card that ejects itself from the G.P_CENTER_POOLS, but that would mean you can only forced_key it into the game (also idk how smods would react to an empty/nil consumable type if you're making it with a custom type)
Would creating a custom card exactly when you need it work?
I think myst wanted to add something like that for lobcorp
idk how that went but might be a good place to start looking
i'm trying to make an animated joker sprite, do i need to add anything other than atlas_table = 'ANIMATION_ATLAS' and the number of frames to the atlas? i assume i do cuz right now it crashes saying attempt to index field 'atlas' (a nil value)
on steamodded 1.0.0 if it matters
and it only crashes when the joker appears
ooh thanks
i got it working yay
Why this patch doesn't work???
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = 'function get_pack(_key, _type)'
position = "after"
payload = """
print("Hello?")
"""
match_indent = true
steamodded overrides get_pack destructively
fine
there's currently no way to lovely patch these overrides, but there should be soon enough
at least I forwarded it to meth
no way*
you have an option of creating this monstrocity
https://github.com/stupxd/Cartomancer/blob/main/core/view-deck-steamodded.lua
"No we have lovely patches at home"
My point stands, that isn't a lovely patch, it's a disgusting patch
is there a way to change text from a joker without using loc_vars
How would I add a challenge restriction only if a different mod is installed? I'd like to disable one of the spectral cards from Mika's Mod Collection in a challenge I've made, but just putting it in the restrictions normally crashes the game if someone without MMC views the challenge restrictions ingame
This is how I've got my banned cards set up
this is how lobcorp does it for one of their challenges, could help
That should help a lot, thank you :]
keep in mind though that things in loborp all all in their own files and are formatted differently
so don't do a 1 to 1 of this
The main issue is, while I have coding experience, none of it is with Lua (I made this challenge by looking at a lot of other mods), so I don't really know how to fix errors - I did this, but it crashes the game when loading mods with something about "chal" being a nil value
Which I assume is something to do with what you said about lobcorp, but I have no idea how to fix it
Actually I might know the issue, give me a sec
Yeah I don't know, I thought I'd put it in the wrong place but moving it caused other problems
What mod and file is this from? So I can look at the whole thing myself
either store challenge metadata in a table and modify it before turning it into a gameobject, or store the gameobject as a variable and modify it
I bodged it in a much worse way to get it working, don't worry :P
noMMC = {
...
}
MMC = {
...
{id = 'c_mmc_incense'}
}
And then put the entire challenge into an if/else with the only difference between the if version and the else version being which variable is inserted for the banned cards :P
there is but why
thing im doing that requires two types of the same exact joker
specifically because loc_txt is so annoying for this
I'm a bit confused what you want to do here bcos it's all doable with loc_vars
make a localization file
alright i should probably have thought of that
if you want the same joker to show completely different texts based on context, you can use loc_vars to call a different localization entry
also if it's just "purified" or "cursed" then you can make that (and the associated colour) into a variable
If I wanted to make a joker that functions after exiting the shop how can I do it?
just look at perkeo for reference
Ight
are there any jokers that reset at the end of the ante or smth similar?
wait campfire
These look sick, will be adding these when you release them!
-- atlas for stakes
local stake_atlas = SMODS.Atlas{
key = 'stake_atlas',
path = 'stakes.png',
px = 29,
py = 29,
atlas_table = 'ASSET_ATLAS',
}
-- stakes
local steel = SMODS.Stake{
key = "steel",
pos = {
x = 0,
y = 0
},
atlas = "stake_atlas",
applied_stakes = {"gold"},
loc_txt = {
name = "Steel Stake",
text = {
"{C:red}-1{} hand size",
}
},
modifiers = function()
-- -1 handsize
end,
colour = HEX("71797E")
}```
could anyone tell me where im going wrong?
yeah i got it
ty
loc_txt = {
name = "Steel Stake",
description = {
name = "Steel Stake",
text = {
"{C:red}-1{} hand size",
}
}
},```
not sure if thats fully right
but it works
you won't need the top name one
why does smods expect loc_txt.description though
remnant of different apis being merged and it got missed in the update to make all loc_txts consistent
Itâs #1217704157574860810 so itâll be a while. I just wanted to share website wip
is there a way to tell more specifically what the current stake is?
atm ive added 4
and theyre 9, 10, 11, 12
at least thats what G.GAME.stake says
but if i had another mod that added stakes
would it shift all my stakes up by the number of stakes in the new mod
potentially yes
yeah i completely missed that because it's a different format
is it possible to check which number my stake is?
<Stake>.order i think
what do you need it for out of interest?
shiny = true
iirc
doesnt seem like thats the case
damn
man tf am I doing đ
tbh despite the recent stake api update, stakes are still wip
stake api is more functional than before though, i was rlly happy cutting a bunch of redundant hooks after the update
by default each card is sized as default card, so you need to mess with card.T.h and card.T.w
nah I'm not talking about the size
it's more about it's placement - it appeared where the booster pack was opened but it didn't move anywhere after that
in theory there's three blinds stacked in the screenshot
wtf
havent messed with cardareas but i think that means the cardarea is not right
oh, I think I know what's up
it's weirdly doesn't seem like an actual card and just a sprite without a card, in an empty card table
I mean yeah??? something definitely changed
I'm glad it alteast shows up
cursed
I will definitely need some kind of a new card type just to handle this
because rn I just use jokers
what are you making, just out of interest?
you know that tag that rerolls bosses? I'm reworking that so it'd give these
oo thats cool
so it'd be less random and more of "pick your own poison"
I thought stakes supported loc vars
i mightve been doing it wrong, but i was doing it exactly how other loc_vars work
I wonder if you could just show three Blind selection UIs like the ones you see to select Blinds
the sticker_pos in stakes, is that only from the same atlas as the chip sprite?
smods' in-run stake ui doesnt call a loc_vars, neither does G.UIDEF.stake_description(_stake)
that sounds like a fun incompatibility looming on the horizon with any joker that adds more items to booster packs
and also there's a possibility of a blind object outside of booster packs
and that, yes
or cryptid's ://RUN actually, I'm not sure the game would be too happy swapping the blind out mid-blind
no, you can add a sticker_atlas
it defaults to the base sticker sheet
thank you
that looks real
that should probably be addressed then
you can't open packs in ://RUN tho
thatd fix it
if i have a stake after gold will it auto unlock when you beat gold?, or have i gotta mess about with gold stake to add the unlock?
it should do, yes
oh no among us balatro cards
surely thunk was held at gunpoint to add those to the game
how do i get the badge and info for my sticker to show?
When you'll finish this, contact me. I have an idea for unique interaction with my mod
Noted!
quick question, what is the default atlas for card backs
i'm running into a ton of nil atlas issues and it's giving me a headache
centers
ok so atlas = deck[7] or "centers" is causing a different, mysterious crash
it works if deck[7] has anything in it
is it appending cry_ into the atlas name
wait, original_key:source_deck... this isn't even part of my code, oh god i broke something else
đ
oh i fixed a typo and that broke source deck
because it's looking for "atlasenchanced"
yeah idunno even if deck[7] ~= nil then obj.atlas = deck[7] else obj.atlas = "centers" end is causing the same nil atlas issue which is weird since that's like pretty explicitly setting the atlas
What is deck[7]?
part of a table to set the atlas, it's usually either 'atlasenhanced' (defined earlier in the file) or nil
the idea being nil just uses the vanilla card backs...
could you do obj.atlas = G.ASSET_ATLAS[deck[7]] and deck[7] or 'centers'?
it works fine if deck[7] is not nil is the thing, it only starts crashing when deck[7] is nil which is what i don't understand
oh
local defective = SMODS.Sticker{
key = "defective",
badge_colour = Ceres.C.defective,
atlas = 'sticker_atlas',
pos = {
x = 4,
y = 0
},
loc_txt = {
name = "Defective",
text = {
'{C:green}#1# in 3{} chance',
'to do nothing',
}
},
apply = function(self, card, val)
card.ability[self.key] = val
end,
loc_vars = function(self, info_queue, card)
return {vars = {G.GAME.probabilities.normal or 1}}
end,
}```
this is driving me insane
it was working
and then it stopped
and im not sure what i changed to break it
also im now realising the apply function isnt needed
yeah the object atlas IS being set to 'centers' and smod's default fallback atlas is 'centers' so i have no bloody idea why it's crashing with an invalid atlas
You might need to call obj:set_sprites() (that might be wrong I donât remember the correct syntax)
Although without knowing what youâre trying to do Iâm not sure
programmatically generated enhancement decks
i basically have
--object_key, deck_internal_name, deck_name and deck[i] are provided from a table and are always valid
SMODS.Back { object_type = "Back",
name = deck_internal_name,
key = deck[3] .. "_deck",
config = {cry_force_enhancement = "m_" .. object_key},
pos = {x = deck[8], y = deck[9]},
atlas = deck[7] or "centers",
loc_txt = {
name = deck_name,
text = {
"All {C:attention}playing cards{}",
"are {C:attention,T:m_" .. object_key .. "}" .. deck[4] .. " Cards{}",
"Cards cannot change enhancements",
"{s:0.8,C:inactive}" .. deck[10]
}
},
}
['Other'] = {
['cere_defective'] = {
['name'] = "Defective",
['text'] = {
'{C:green}#1# in 3{} chance',
'to do nothing',
}
},```
i have this in my loc file
but this is still blank
what am i missing?
there's also ['label'] but it should show the other things at least
Itâll be adding the mod prefix to centres
You need to tell it youâre using a raw atlas key and modify the one in deck[7] to have the prefix already added I think
i'm going to guess that doing this makes smods assume that you're using "cry_centers"
oh my god do stickers have a prefix?
Sorry I was meaning samario đ
I donât know where stickers go on the loc table
But I imagine theyâd have a prefix
Did you change your prefix to ceres yesterday?
no i just left it
Fair
Is it possible to create a nothing card?
I wonder with the new customize deck option, will SMODS try to hook into it to make a better ver. of AltTexture API?
I feel like you could genuinely do that now with not a lot of hassle as
finally supports "texture packs"
ish
Iâd have to look at how thunk handles it
hardcoded to hell and back
tears streaming down my face, okay
also need to modify the ui to fit all ranks and not just face cards
But other than stealing the button, probably not
Iâm still undecided whether to pull alt textures into an individual mod or not
yeah uh it's a mess 
I donât know what would be better, itâd be nice for it to be implemented in smods but I also think just having it as an external dependency for texture packs would suffice
Any one got any thoughts?
I feel like texture packs are a common enough thing for people to want to do to warrant being in smods (especially now that texture packs are kinda a vanilla feature)
Just woke up and saw the new update, is there going to have to be another modding patch to fit this update, or can I keep using what I already have?
It shouldnât affect too much
If Cryptid loaded fine on the new update I think everything should be mostly good
it doesn't change much
local defective = SMODS.Sticker{
key = "defective",
badge_colour = Ceres.C.defective,
atlas = 'sticker_atlas',
pos = {
x = 4,
y = 0
},
loc_txt = {
label = 'Defective',
name = 'Defective',
text = {
'{C:green}#1# in 3{} chance',
'to do nothing',
}
},
loc_vars = function(self, info_queue, card)
return {vars = {G.GAME.probabilities.normal or 1}}
end,
}```
even putting the loc text in the thing doesnt work
why đ
My favorite enhancement, small blind
I think you could extend Center or something
I figured I could use the same thing as the poker hand preview uses
IIRC it keeps a flag for each object, maybe inside the pool, and sets that flag when the object is created or removed.
However, I think Blinds work differently. I know the game tracks how many times Blinds have been used, but Iâm not sure what for. By all accounts, the way I read the code I donât think it should work, but since it does, I must have misunderstood it
Ah I forgot about that
By the way, does the DLC break anything?
aside from itself not really for now
i think for jokers and consumables etc it just checks for showman doesnt it?
What do you mean âaside from itselfâ?
I also imagine it could serve for an easy way to make texture only mode via Steamodded in the future
the update has stickers always shown and it toggles weirdly
anyone?
What are you trying to do?
i just want my sticker to have text when you hover over it
but it doesnt want to
it was working
but i mustve changed smth
I could help hardcode it, but I imagine thereâs a natural way to do it
but idk what
yeah but im not gonna spam ctrl z
also i havent pushed any of it to git because ive been working on it today
Git wouldnât have a history but the text editor might
Also see if the key names are correct
Two general questions about Lua:
- How to get a list of folders in a directory in Lua?
- How to read a text file in Lua?
Native fs.
you're not going insane
i beg to differ
you don't need nativefs
also the sticker isnt actually displaying on jokers
just use love.filesystem 
is that not smth steamodded does?
steamodded uses nativefs
there was a change in 1.0.1g that altered a line in the code, blocking a steamodded patch
Thereâs a reason people donât use love.filesystem.
nativefs literally uses love.filesystem 
me when my file isnt in the game directory
What kind of nativefs are you using lol
which line??
nativefs replicates lfs, removing the restriction of only being able to access specific folders
theres acc no way
generally using love.filesystem is discouraged because it fails as soon as someone uses a custom mod folder
^
Itâs also much less flexible than nfs.
I believe there is a nativefs patch you can add that overrides love.filesystems restrictions.
But Iâve never used it.
how would someone use a custom mod folder
and how would nfs figure out the flag value
there's a lovely module that has that information
Is there an event for obtaining a joker?
my point is that love.filesystem physically can't access such a folder
ah
you could hook to add to deck and check if its a joker?
This module provides access to files in specific places:
The root folder of the .love archive (or source directory)
The root folder of the game's save directory.
The folder containing the game's .love archive (or source directory), but only if specific conditions are met.
i'm looking to calculate a number based upon the amount of jokers, for a joker that has X0.1 mult for each joker (like Abstract but XMult)
oh you can just do 0.1 * #G.jokers.cards then
well, if a mod would need to implement support for custom mod dir either way, there's no point in using nfs if there's a total of 0 people with custom mod dir and 1? mods with custom dir support (steamodded I assume has it)
Most mods that use nfs literally crumble if mod folder isn't the exact same name, so it's kinda funny
ok i fixed sticker.toml on my end
wh
god i hate myself
still doesnt show up here tho
is that also to do with a broken patch?
yeah
damn
not sure how the collection started working for you lmao
crossover stuff i assume
so how do i get it to work here?
not sure?
fixing the patch made it work in both collection and run for me
there's usually no need to support it specifically outside of steamodded as you're given the mod dir either way
most non-smods mods include NFS themselves
# generate_UIBox_ability_table()
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''if self.sticker or \(\(self.sticker_run and self.sticker_run~='NONE'\) and G.SETTINGS.run_stake_stickers\) then loc_vars = loc_vars or \{\}\; loc_vars.sticker=\(self.sticker or self.sticker_run\) end'''
position = "before"
payload = '''
for k, v in ipairs(SMODS.Sticker.obj_buffer) do
if self.ability[v] and not SMODS.Stickers[v].hide_badge then
badges[#badges+1] = v
end
end'''
not pull reqing this because the regex sucks but it should work?
uh still not working for me
yes, but my point is, you don't have to use NFS, unless the wild user with custom mod dir who doesn't want to use steamodded appears
so far most mod devs don't even care to support non exact folder name for non steamodded mods
It's kinda funny
I wonder how many mods need to copy-paste steamodded code for non steamodded support for a non steamodded modloader to appear 
I meannnn, unless itâs a very simple mod, nfs is usually needed. There can also be many reasons why people donât want to use steamodded.
Itâs not hard at all to make something to support mod folders that arenât exactly the same name as the devs. It took me about 5 minutes lol.
I think you missed my point with steamodded
Never said it's hard or anything, but it's the same code in every single mod who wants to support non steamodded
something finally fucking works?????
I mean, Iâm sure a few people stole/copied code, but I donât think most devs have done that.
You're still missing my point
Iâm not sure I am, I just think your point isnât a great one lol
its not about stealing, its about everyone reinventing the wheel for something they shouldn't have to
I understand what ur saying âwhatâs the point putting the same code as steamodded when they donât use steamodded, why not just use steamodded etc etcâ
nope lmao
I mean thatâs exactly what ur saying
is there a way to add a resource file through a lovely patch file? (i have steamodded installed)
âReinventing the wheelâ
I never said anything against non steamodded
eg. Ankh uses some Steamodded code (I yoinked file indexing) so it can detect mods loaded even without Steamodded active
?
Actually I said that weirdly
Basically it uses that to detect Steamodded mods, but it doesnât just hook the Steamodded function because it also shouldnât require it by design
Yeah exactly
Also I have to deal with Balamod support now
Oh dear
like, convenience of loading atlas, having config file, localization, and some other features like keybinds is very nice
I havenât even looked into Balamod.
also fucking settings menu lmao
Who said otherwise??
I donât really understand ur whole argument
I have my own setting menu API for my mods xdd
Yeah,,,
But most of them really could use Steamodded
Like if I moved Trance to Steamodded nobody would really care
Yes but also, some people donât want to install stwamodded
And I think Talisman depends on Steamodded now too? At least, havenât tested in a while without it and it adds some stuff with Steamodded
Iâm of the opinion that, let people do what they want lol
Iâm only ever going to make steamodded a dependency for something where it absolutely makes sense to do so.
Like custom content; etc
I think both arguments are fair
Of course, I respect the argument otherwise.
I would just say though, let people experiment!
i get people might not want to use steamodded because it's rather invasive in what it does
of course not all mods need this sort of invasiveness, mostly these are QoL mods or ones that are equally invasive themselves
That's sad
?
I will say it directly: I wonder how long it takes until QoL mods create a non invasive mod loader with just qol steamodded features (Atlas, localization, config, centralised settings menu, keybinds)
Because what we have right now is straight up ass, lol
m
Oh I didn't see that message for some reason, my reception was really bad.
Ok I get ur point.
I mean I'm not fully opposed to splitting steamodded into a loader and a modding API, it's just that it would be harder to maintain which would in the end be a me problem
I feel like splitting it would be a lot of work, haha.
I'd love for there to be a straight up "Mod client".
I think qol mod loader doesn't really need that much updating though
surely there's some way to make something of that sort but with an integrated setting, though at that point it becomes a case of managing lovely patches in a way that's not possible currently
steamodded mostly gets updated with modding api
alternatively a reorganized version could have steamodded loading most of itself as a steamodded mod which can itself be disabled. again, get me to do that
would patches and other stuff work if it's something like a nested folder
no
ah so it would need to be 2 folders
patches must be exactly one directory deep into the mods folder (Mods/MyMod/lovely.toml or Mods/MyMod/lovely/*.toml)
I'm thinking that could be annoying to explain if it remains in the same repo
cuz people download zip
Yeah exactly.
and then they don't understand that it needs to be not nested
nested mod folders support when? 
lovely v20.0.1?
there could be a config file which would tell lovely which folder is a mod root
I dunno
i have been trying to get this joker to have random hands everytime you leave the shop but i cannot for the life of me figure out what i am doing wrong
you need to also change G.hand size after changing the config value
you only change it on add to deck and remove from deck which only happen when sold/destroyed/debuffed
i've seen cryptid's misprintize function dozens of times but i still dont get how they change every value of a joker
how do i get the named values or whatever??
like if someone had a card.ability.extra.NameThatIDoNotKnow, how would i get that value without knowing it
Loop through pairs(card.ability.extra)
remove hand size
randomize hand size
add hand size
thanks
wait you can do that?
So I can get a list of folders and files and read a .txt from it?
Yes
Wait no not love.filesystem
nativefs.
I'll send you nativefs if you want?
Does Balatro or Steamodded come with it?
Steamodded does yes.
Because I want to use it for a mod
My idea is to make a mod that simplifies making texture pack mods
Oh, do you know if it can get the size of an image?
Eremel is looking into finishing his WIP AltTextures, could maybe look into helping/using that.
@wintry solar oh?
How Do, i can't find anything with some ctrl+fing in steamodded
Did you never see it before?
No I havenât seen you talk about AltTextures
Do you have to manually add the Texture Packs?
it uuh works?
my friend like it when it went tru 10 sizes per card đ
You probably need to also make it change when added/removed from the deck
You just register them as an object
But Iâm going to start on it from the ground up again
I have some structural changes I want to make
My idea was to do it automatically, so that people with no knowledge of programming could do it
So it would only need folders with the images and a configuration .txt file
With three possible configurations:
- Full spritesheet swap;
- Individual sprite swaps, listed by object name;
- Individual sprite swaps with a spritesheet, so that each sprite in row-major order is assigned to each object in a list.
Okay so. Setting it to nil? crashes the game
Not setting it at all? works perfectly fine
I??????? Sure???
NEVER MIND, I ALWAYS ASSUMED THE FIRST PART OF "for X,Y in pairs(Z)" WAS LIKE A REGULAR FOR LOOP
I THOUGHT IT WAS JUST THE NUMBER OF TIMES ITS LOOPED
That's why you'll often see k, v, for key, value.
I NEVER KNEW THIS
THATS WHY I ALWAYS USE FOR I,V
cant believe for all this time i didnt know
why does cryptids code seem so complex
@wintry solar what do you think? This way the mod can:
- Iterate over subfolders;
- Iterate over configuration files;
- Take ownership of the listed object and replace the texture.
all it took me was this man
You should do card.ability.extra[i] = v*mult
Ideally, it overwrites the full atlas on a full sprite retexture, but I personally think this would be a good tool to use, using AltTextures API once that's finished, rather than being a mod that does everything on it's own.
eh
As I said, my idea was to have three types of configurations
Including full spritesheet replacement
You donât need to access the same memory address three times
That sounds like a way more complicated set up for someone who has no experience modding
I think writing a .txt is easier than having to manually write Lua to register objects
is there any way to tell if a colour actually exists before trying to render with it and presumably throwing an error
What do you mean?
like, the {C:red}
Youâd just copy a template and change two words though
is there a giant table full of the colours
Yes, they are defined in the code
Which I think is harder than writing the name of a file or a list of Jokers
wait
Search for loc_colour, don't remember the specific file.
But youâd have to have some sort of knowledge of the correct format anyway which would suggest reading some sort of documentation
it's in globals.lua
Two actually. You want the table that maps names to colours, but thereâs also a table of colours. Three tables if you count dynamically changing colours
I mean, each of the three types of configurations could have their own template to copy from, which I think would be easier than Lua because thereâs less information on the file
And most of the information in the file is accessible by playing the game
Only the file names arenât
I remain to be convinced
If you could mock up a quick example of what a config might look like that would help
Iâll go dig out an old version that I have
full-spritesheet
vanilla.png
custom.png```
partial-spritesheet
custom.png
Joker
Lusty Joker
Egg```
individual
Joker
customjoker.png
Egg
customegg.png```
Wait hold on
It ate the first line
oh I guess loc colors is also a thing, didn't know that
Loc colours is for loc txt colouring
Fixed
Theyâre not mutually consistent but that can be improved
Itâs going to need more information than that though
Like what?
Dimensions for one
Which I already asked about
Canât Lua read it?
If it canât that can be an argument too
I dunno, it could be useful I guess but it seems like making a new system to make mods just for the sake of it
I asked a server of Balatro fanartists and Iâm waiting for their response. So far I have:
âI feel like .txt files are very intuitiveâ
I think it'd be good as a basic, non-modding tool, but if you want to do anything actually complex, like non-standard sizes, then you just use the API instead of the easy mod tool.
SMODS.Atlas({
key = "hd_tags",
path = "hd_tags.png",
px = 34,
py = 34,
})
SMODS.AltTexture({
key = "hd_tags",
texture = true,
atlas_key = "alttex_hd_tags",
type = "Tag",
name = "HD Tags",
})
``` this is the previous iteration
Actually it does probably need to ask for size because textures could use custom resolutions
Balatro HD
Just grab the sizes from vanilla game, and if they want to change it, then use AltTextures API.
As Eremel pointed it, it does need to know the dimensions of the file to function properly, and I think alternative resolutions are simple enough they should be supported
oh this is the first i've heard of alttextures, is it properly in smods now?
no
Ah so you can only do full Atli swaps?
at the moment, yes
but I had planned to allow individual control
though individual control requires editing the individual objects and is more work
I also wanted to implement localization support
but having a pipeline of features is what was leading me to prefer packaging it as an individual mod like I did with Galdur, it gives me a lot more control to update it when I need to
Which is why I want to automatize as much as possible
The user should only need to provide the data and the mod automatizes the rest
I think it'd be good to do this while working on it, and once it's fleshed out, then integrate it into SMODS.
Localization would be a neat feature as well, by the way, but, yeah, further down on the priority list, I'd say.
I'm still not sure about supporting single textures, it just opens a huge can of worms from a logistical point of view of which texture is applied and how you switch between them
Huh. Apparently I've been using Lovely to do all my modding. Steamodded doesn't seem to want to work on my end... this might explain why all my SMODS functions within said mods have been doing absolutely nothing...
Maybe allow for a texture pack to set a table of keys, so you can have all of whatever under one pack?
But some mods only want to change a single or a small number of textures
Oh! Apparently I'm missing dependencies.
Like Legendere which only changes the Legendary Jokers
I'm using an outdated version of Steamodded.
I think not supporting that kind of retexture is a bit of a failure
I think it could work like Minecraft
I mean you can package it as the entire spritesheet with the alternate textures in the relevant places
Have an ordered list, higher takes priority
It both seems excessive and frankly a bit dubious to send a mostly unchanged Balatro spritesheet around
And it makes it difficult to use two different texture packs that change sets of Jokers without overlap
If one changes Food Jokers and the other Legendary Jokers, wouldnât it be easier to tell if the code individually registered each
Again, I think they can be packaged in a row-major spritesheet, smaller than the gameâs spritesheet
So you put the five Legendary Jokers into a single spritesheet thatâs 5-by-2 Jokers in size
How do you specify the pos for each one?
As I said
Row-major in order
So, just have it as key index = pos x?
Itâs a bit tricky for Souls; there needs to be a standard
Whatâs âkey indexâ?
In a list of {'a', 'b', 'c'}, c = 3.
Then you write
partial-spritesheet
custom.png
Perkeo
Yorick
the blue one
the white one
the bad one
and it expects to find them in that order
Yes, but itâs more like { x = i mod row, y = dividend } if Iâm not getting the dimensions swapped in my mind
where i is the index in the input list
I think priority should be, get full sprite replacements working, test it out, make sure there's no bugs, then come back and add in individual texture support.
Wait I got the names wrong
i mod row is the remainder lol
it should be⊠dividend
Thatâs why I was confused. Now I hope itâs correct
Maybe individual texture swaps can be melded into partial sprite sheets, since an individual texture is a partial sprite sheet of size 1-by-1 object
For now, if you want to do it, I think it should be separate from AltTextures, and most of the code would be finding a way to read the .txt file, and converting it into just a take_ownership call for any objects, and a atlas replacement for any textures that aren't objects, like the balatro title screen or shop sign.
I reckon this might make more sense for animated textures anyways since those have to be spritesheets
Welp, just ended up figuring out that the latest version of Steamodded does not play nice with the Mac version of Balatro.
Went through the trouble to try and clone the latest Steamodded git, only for it to backfire.
Oh wait--
I figured it out.
I think.
I'm trying to make a card that does something when money is gained. What's the best way to check how much money is gained from each source of money?
Nope. Still not liking it.
I'm still trying to wrap my head around how you would select textures if they were all individual like that
Priority list, I think it's that all the individual images would still be considered as one singular pack.
I mean, from the userâs standpoint, either a subset or the entire texture pack would be put on a list, and the higher priority would apply. If a higher priority texture doesnât change an object, a lower priority texture can change it
Oh wait-- the lovely injector might be out of date???
Basically, if you have cards a, b, c, d and pack 1 overwrites a, b, pack 2 overwrites a, c, then,
Priority for pack 1 takes over pack 2, so a and b use pack 1's sprites, c uses pack 2's, and d uses base game.
And obviously, if pack 2 has priority, then a changes to pack 2's sprite, but b still uses pack 1's.
I mean from a ui standpoint, how are you setting the priority of texture packs in the game
Probably just an up and down list, or left to right - you could make it take after jokers, and how the order matters for them.
OKAY GOT IT WORKING.
I could picture a card area above an area of all texture packs loaded with pages as needed, with base game being unremovable - basically, it'd have the texture pack icon in the bottom table, which you could click to spawn in the card area at the top, and use that to switch around priority, moving texture pack icons around just like jokers.
If you wanted to disable texture packs, then you'd do something similar to selling jokers - but I will say, as fun as that does seem, it could be far more effort than it's worth to do.
Like Minecraft does it
This isnât an unsolved UI problem
Is custom sticker can be applied on booster pack only?
Although I do like the idea of making use of Balatro mechanics and making it kinda like a CardArea
I think having text saying Overwrites or Priority some other word under the left side, and then an arrow pointing towards the right under the card area would probably make it pretty intuitive for most players.
I think you can just say it takes priority left to right
Yeah, I'm just thinking from a fancy UI perspective.
Is there any proper API documentation yet for Suits? I've mostly been taking a look at the Six Suits mod for reference and was curious on it
local suit_atlas = SMODS.Atlas{
key = 'suits',
path = 'suits.png',
px = 71,
py = 95,
atlas_table = 'ASSET_ATLAS',
}
local ui_atlas = SMODS.Atlas{
key = 'ui_icons',
path = 'ui_icons.png',
px = 18,
py = 18,
atlas_table = 'ASSET_ATLAS',
}
local leaves = Ceres.SETTINGS.suits.enabled and Ceres.SETTINGS.suits.leaves.enabled and SMODS.Suit {
key = 'Leaves',
card_key = 'LEAVES',
hc_atlas = 'suits',
lc_atlas = 'suits',
hc_ui_atlas = 'ui_icons',
lc_ui_atlas = 'ui_icons',
pos = {
y = 0
},
ui_pos = {
x = 0,
y = 0,
},
hc_colour = HEX('419947'),
lc_colour = HEX('419947'),
}```
ty
Right, I think I'll port over full sprite sheet stuff first, set up a modding forum and we can carry it on over there
Sounds good to me. I can either make a terrible example image or try doing some UI code to just do the basic shape of what I'm imagining, but I haven't interacted with CardArea enough to know how I'd make that function. I don't imagine it'd be too different from how Galdur's chips work, just that they'd be moveable afterwards and then that order would be read, probably on pressing an apply button, to figure out priority to load things in.
yeah I can picture what you mean
why wont this work đ
does anyone know how to change the sort order of the default suits? i thought i was onto something with the view_deck function but it looks like SMODS overrides it...
Something something, CardArea:sort?
Just a few random searches, might lead you in the right direction, but no idea for sure, haven't touched it myself.
i think this leads me to the same place i was looking, which is get_nominal
lemme get the code i have one sec
What happens if you overwrite local suit_map and rank_name_mapping in G.UIDEF.deck_preview?
I think it'll probably be hardcoded in several places throughout the code, though, that'd just change the sort function.
i didn't touch rank_name_mapping since i wasn't messing with the ranks, but i did try the other one with no changes... i think it's because SMODS overrides the deck_preview method as well
in core/overrides.lua
the other thing i was looking at was core/game_object.lua where it defines the Suit object
it sets max_nominal and suit_nominal
Are you just trying to make diamonds come before spades or something, or?
i'm trying to make the suits go clubs -> spades -> hearts -> diamonds
(the reason why being i'm messing with https://discord.com/channels/1116389027176787968/1236035627288367115)
the cards have numbers that ascend in that order, plus 4 more suits
yeah the base game functions for this are absolute dogshit for extensibility
I've tried with lovely patches, it ended up being more lines than the actual function in full
just overwrite the overwrite taps head
hopefully patching loaded files like from steamodded is possible soon with lovely
(rn it's possible without lovely but super cursed
do you happen to have the code you wrote somewhere?
the deck view override or patching steamodded files?
the deck view override
if it ends up being too too painful i'll look into what would need to change in steamodded i guess
uh yeah it's at line log10(naneinf) in core/overrides.lua
getting this rn... here's the code snippet I have as well and I can confirm the textures are loaded.
--SMODS.Atlas {key = 'digits', path = 'digits.png', px = 71, py = 95}
--SMODS.Atlas {key = 'digits_hc', path = 'digits_hc.png', px = 71, py = 95}
--SMODS.Atlas {key = 'arms', path = 'arms.png', px = 71, py = 95}
--SMODS.Atlas {key = 'arms_hc', path = 'arms_hc.png', px = 71, py = 95}
--SMODS.Atlas {key = 'bottles', path = 'bottles.png', px = 71, py = 95}
--SMODS.Atlas {key = 'bottles_hc', path = 'bottles_hc.png', px = 71, py = 95}
SMODS.Atlas {key = 'webs', path = 'webs.png', px = 71, py = 95, atlas_table = 'ASSET_ATLAS'}
SMODS.Atlas {key = 'suitsui', path = 'suitsui.png', px = 18, py = 18, atlas_table = 'ASSET_ATLAS'}
--SMODS.Atlas {key = 'webs_hc', path = 'webs_hc.png', px = 71, py = 95}
--Actual suit code
local websuit = SMODS.Suit {
key = 'Webs',
card_key = 'WEBS',
hc_atlas = 'webs',
lc_atlas = 'webs',
hc_ui_atlas = 'suitsui',
lc_ui_atlas = 'suitsui',
pos = {
y = 0
},
ui_pos = {
y = 0,
x = 0,
},
hc_colour = HEX('47d7cc'),
hc_colour = HEX('47d7cc')
}```
sorry for ping
also happens on the suit as well
aure can I create smods objects inside an inject function? will it mess anything up?
recursion potential?
it's a different object it creates
might be fine then
that method seems to call back to self.base.suit_nominal which if i'm understanding correctly is set from max_nominal.value in the SMODS.Suit constructor. in theory i should be able to change the sort order with the code i've added to override that value but it doesn't work:
SMODS.Suit:take_ownership('Clubs', {
max_nominal = { value = 0.00 }
})
SMODS.Suit:take_ownership('Spades', {
max_nominal = { value = 0.01 }
})
SMODS.Suit:take_ownership('Hearts', {
max_nominal = { value = 0.02 }
})
SMODS.Suit:take_ownership('Diamonds', {
max_nominal = { value = 0.03 }
})
idk exactly how lua likes messing with an iterated table while within a loop, but I think it would be fine
max_nominal.value is a static property used only to determine the suit nominal for new objects
oh
you'd want to change suit_nominal instead
